Magic Library - True Type windows font
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
Magic Library - True Type windows font
this is an addon static library for Irrlicht 3D Engine.
it will extend the 2d features of Irrlicht , so you could easlly mix your 2d work with 3d world.
Features of magic2d library
===========================
+ TMovie class that will enable you to render your movie to a texture ,appleing effects
to movie such as gray scale the movie or nigative and more...(fade in & out)....
+ has some features & functions from BlitzMax basic language, so you could blending an image
with background, rotating ,scaling ,tilling it also, you could convert some BlitzMax programs for
work with Irrlicht.
+ has some features from Basic4Gl language,so you could scrolling a maped background,
or draw your 2d map background.
+ playing Gif animations,yes Gif animations,so you could blend this animation with
your background,also you could fade in and out the Gif animation
+ has some functions for easlly dealing with keyboard & mouse.
+ playing animated Images.
+ has class for fade in & out your images ,Gif animatiom and animated Images.
+ adding splash window in your game or program.
+ has classes for drawing fonts to texture or draw part of texture to an other one.
not will , it will only work with OpenGL driver of irrlicht .
it has a compiled demo to show you what could you do with this library.
please if you like it ,let me know and do not forget to tell my your
FPS when you run the demo in your system.
http://bcxdx.spoilerspace.com/BCXGL/Magic2d_03.zip
thanks
it will extend the 2d features of Irrlicht , so you could easlly mix your 2d work with 3d world.
Features of magic2d library
===========================
+ TMovie class that will enable you to render your movie to a texture ,appleing effects
to movie such as gray scale the movie or nigative and more...(fade in & out)....
+ has some features & functions from BlitzMax basic language, so you could blending an image
with background, rotating ,scaling ,tilling it also, you could convert some BlitzMax programs for
work with Irrlicht.
+ has some features from Basic4Gl language,so you could scrolling a maped background,
or draw your 2d map background.
+ playing Gif animations,yes Gif animations,so you could blend this animation with
your background,also you could fade in and out the Gif animation
+ has some functions for easlly dealing with keyboard & mouse.
+ playing animated Images.
+ has class for fade in & out your images ,Gif animatiom and animated Images.
+ adding splash window in your game or program.
+ has classes for drawing fonts to texture or draw part of texture to an other one.
not will , it will only work with OpenGL driver of irrlicht .
it has a compiled demo to show you what could you do with this library.
please if you like it ,let me know and do not forget to tell my your
FPS when you run the demo in your system.
http://bcxdx.spoilerspace.com/BCXGL/Magic2d_03.zip
thanks
Last edited by Emil_halim on Sun Oct 22, 2006 7:36 pm, edited 40 times in total.
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
ooh nice! if only i was writing a 2d game
you could do with splitting it up in to several examples though, also i use dev-cpp and theres no source tsk tsk
i hoped the sine wave image thing was a built in feature, that would be cool
edit:
forgot the fps!
500 fps, athlon xp 2800, fx5900
you could do with splitting it up in to several examples though, also i use dev-cpp and theres no source tsk tsk
i hoped the sine wave image thing was a built in feature, that would be cool
edit:
forgot the fps!
500 fps, athlon xp 2800, fx5900
Last edited by bitplane on Tue Nov 08, 2005 11:49 pm, edited 1 time in total.
-
- Posts: 38
- Joined: Mon Nov 07, 2005 5:55 am
Yeah, apparently the wave thing IS NOT built in. thats too bad. I guess I cant use it now.bitplane wrote:ooh nice! if only i was writing a 2d game
you could do with splitting it up in to several examples though, also i use dev-cpp and theres no source tsk tsk
i hoped the sine wave image thing was a built in feature, that would be cool
edit:
forgot the fps!
500 fps, athlon xp 2800, fx5900
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
thanks you guys very much.
thanks for feeding bach the FPS.
i will splitting it up in to several examples and make some help for explain each functions
and classes.
actually there are many 2d effects that you could apply by this magic library,so if i make
each effect as a built in, i thinks it will not a good idea,instead i will create a new
folder and name it Effects2D for holding snippets from me and other usres.
so what do you think guys?
again thanks for your comments
thanks for feeding bach the FPS.
i will splitting it up in to several examples and make some help for explain each functions
and classes.
actually there are many 2d effects that you could apply by this magic library,so if i make
each effect as a built in, i thinks it will not a good idea,instead i will create a new
folder and name it Effects2D for holding snippets from me and other usres.
so what do you think guys?
again thanks for your comments
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
Looks very interesting, maybe I can use it for our RPG projekt
Explaining the functions would be really great, as I am quiet new to the engine and not that good in C++
Making snippets in an extra folder sounds good, it would sure be easier to keep track of the several functions.
The FPS I got with my notebook (Pentium 1,6, 512 MB, Radeon 9700 Mobility): 88
Explaining the functions would be really great, as I am quiet new to the engine and not that good in C++
Making snippets in an extra folder sounds good, it would sure be easier to keep track of the several functions.
The FPS I got with my notebook (Pentium 1,6, 512 MB, Radeon 9700 Mobility): 88
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
hi eveybody,i do not pretend that i am a good writer,but for the sake of heaven,let me know if this is clear and understoodable tutorial or not,
so i could contnuie writing other stuff.
so i could contnuie writing other stuff.
Code: Select all
/************************************
Magic library manual
HelloWorld program will teach
you how to compile your first
magic 2d program.
*************************************/
/* when you install Magic library in your system, you will have
gl & Magic2d.hpp header in iclude folder,also having desired libs
in Lib folder such as Magic2d.lib,glu32.lib,opengl32.lib,glaux.lib.
*/
#include <irrlicht.h>
/* for using magic library with your code you have to include
Magic2d.hpp header file after including Irrlicht.h file,
*/
#include <Magic2d.hpp>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
// global declration of Irrlicht interfaces
IrrlichtDevice* device;
IVideoDriver* driver;
ISceneManager* smgr;
IGUIEnvironment* guienv;
/* if you need this variable to be global so declare it here.
FontM will hold the texture of font image ,so we use it later
when printing some text in our screen.
*/
SMaterial FontM;
int main()
{
/* NOTE WELL::
Magic Library has CreateDevice function ,it looks like the orignal createDevice
of Irrlicht,it will Initial some variables that needed by Magic Library then
it calls our orignal createDevice of Irrlicht automatically.so if you plan
to use Magic Library,you have to use it's CreateDevice function instead of orignal one.
*/
device = CreateDevice(640,480,false);
device->setWindowCaption(L"Hello World! - Magic 2d library for Irrlicht");
driver = device->getVideoDriver();
smgr = device->getSceneManager();
guienv = device->getGUIEnvironment();
/* here we load our font image, remmber that FontM is a Matrial
structur ,so we will load the texture as usual.
and set the transparent color of our font.
*/
FontM.Texture1 = driver->getTexture("../../media/Font.bmp");
driver->makeColorKeyTexture(FontM.Texture1,position2d<s32>(0,0));
// creat the font and set it as defulet for using it later
GLuint fnt_1 = CreateFont(FontM,16,16,10);
SetFont(fnt_1);
int lastFPS = -1;
while(device->run())
{
driver->beginScene(true, true, SColor(0,0,0,0));
/* ViewOrtho tells Irrlicht that we will deal with 2d screen
coordinates,no 3d depth,no 3d lighting.
the left upper point of screen is the Orignal point (0,0 coords).
so when we want to draw by some functios of Magic Library we have
to start with this function.
*/
ViewOrtho();
/*
those functions from BlitzMax.
seting the blending value and color of our next drawing
*/
SetBlend(ALPHABLEND);
SetColor(255,255,255);
SetAlpha(1.0);
//first we must set our desired font texture before
// drawing any text,we st it as we doing in Irrlicht
driver->setMaterial(FontM);
DrawText("Magic Library by Emil Halim",200,400);
/*after we finishing our 2d drawing, we have to reset screen
coordinates,depth,and lighting to 3d world,use ViewPerspective
function to do that.
*/
ViewPerspective();
// we have to reset blending system for correct 3d render
SetBlend(SOLIDBLEND);
// finally if we have some 3d stuff to draw , we use the next
// two lines
smgr->drawAll();
guienv->drawAll();
driver->endScene();
int fps = driver->getFPS();
if (lastFPS != fps)
{
wchar_t tmp[1024];
swprintf(tmp, 1024, L"Hello World! - Magic 2d library for Irrlicht (%s)(fps:%d)",driver->getName(), fps);
device->setWindowCaption(tmp);
lastFPS = fps;
}
}
device->drop();
return 0;
}
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
I agree, but I have a remark.
If you don't use the 'using namepsace' statement and instead qualify the calls it would make it easier to locate where something belongs to. So it is more to write, but easier to understand I think.
Second, you define some global variables, but they are only used within main(). I would consider it better style to move the definitions as late as possible (e.g. IrrlichtDevice*const device = CreateDevice(...);', make them const if they are changed later on, and always initialize variables like 'IrrlichtDevice* device = 0;'.
If you don't use the 'using namepsace' statement and instead qualify the calls it would make it easier to locate where something belongs to. So it is more to write, but easier to understand I think.
Second, you define some global variables, but they are only used within main(). I would consider it better style to move the definitions as late as possible (e.g. IrrlichtDevice*const device = CreateDevice(...);', make them const if they are changed later on, and always initialize variables like 'IrrlichtDevice* device = 0;'.
Where are the sources? I'd like to check at which points you introduced your own architecture on top of Irrlicht, and where you reuse existing features. Since you did not change Irrlicht itself it might be that most parts are created on top, but this might introduce additional overhead which could be avoided in some cases.
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
@Gambler:
thanks for your feed back.
@tobing:
+++++++++++++++++++++++++++++++++++++++++++++++++++++
If you don't use the 'using namepsace' statement and instead qualify the calls it would make it easier to locate where something belongs to. So it is more to write, but easier to understand I think.
+++++++++++++++++++++++++++++++++++++++++++++++++++++
i have used to use it like this just for fast typing.
+++++++++++++++++++++++++++++++++++++++++++++++++++++
you define some global variables, but they are only used within main().
+++++++++++++++++++++++++++++++++++++++++++++++++++++
because i past and copy this part from the demo which uses this variables in Splash function {outside of main function},so when you decide to use splash class you have to declare some var as a globle.
thanks for your comment
@hybrid:
+++++++++++++++++++++++++++++++++++++++++++++++++++++
but this might introduce additional overhead which could be avoided in some cases.
+++++++++++++++++++++++++++++++++++++++++++++++++++++
i do not think so,the secret is in OpneGl it self for not changing the Engine.
as you know openGl consistes of many c-function which you could call any function
at any time you want.
here is some source of Magic Library ,so what do you think?
thanks hybrid
thanks for your feed back.
@tobing:
+++++++++++++++++++++++++++++++++++++++++++++++++++++
If you don't use the 'using namepsace' statement and instead qualify the calls it would make it easier to locate where something belongs to. So it is more to write, but easier to understand I think.
+++++++++++++++++++++++++++++++++++++++++++++++++++++
i have used to use it like this just for fast typing.
+++++++++++++++++++++++++++++++++++++++++++++++++++++
you define some global variables, but they are only used within main().
+++++++++++++++++++++++++++++++++++++++++++++++++++++
because i past and copy this part from the demo which uses this variables in Splash function {outside of main function},so when you decide to use splash class you have to declare some var as a globle.
thanks for your comment
@hybrid:
+++++++++++++++++++++++++++++++++++++++++++++++++++++
but this might introduce additional overhead which could be avoided in some cases.
+++++++++++++++++++++++++++++++++++++++++++++++++++++
i do not think so,the secret is in OpneGl it self for not changing the Engine.
as you know openGl consistes of many c-function which you could call any function
at any time you want.
here is some source of Magic Library ,so what do you think?
Code: Select all
static GLubyte BZ__color[4];
static GLuint _currentFont;
static int _BltzScreenWith,_BltzScreenHieght;
f32 _BLTZ_ROT;
f32 _BLTZ_SCLx;
f32 _BLTZ_SCLy;
void ViewOrtho() // Set Up An Ortho View
{
glDisable(GL_LIGHTING);
glDisable(GL_DEPTH_TEST);
glDisable(GL_CULL_FACE);
glMatrixMode(GL_PROJECTION); // Select Projection
glPushMatrix(); // Push The Matrix
glLoadIdentity(); // Reset The Matrix
glOrtho( 0, 640 , 480 , 0, -1, 1 ); // Select Ortho Mode (640x480)
glMatrixMode(GL_MODELVIEW); // Select Modelview Matrix
glPushMatrix(); // Push The Matrix
glLoadIdentity(); // Reset The Matrix
}
void ViewPerspective() // Set Up A Perspective View
{
glMatrixMode( GL_PROJECTION ); // Select Projection
glPopMatrix(); // Pop The Matrix
glMatrixMode( GL_MODELVIEW ); // Select Modelview
glPopMatrix(); // Pop The Matrix
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
}
void SetRotation(f32 r)
{
_BLTZ_ROT = r;
}
void SetScale(f32 sx,f32 sy)
{
_BLTZ_SCLx = sx;
_BLTZ_SCLy = sy;
}
void DrawImage(SMaterial img,f32 x ,f32 y)
{
dimension2d<s32> size = img.Texture1->getOriginalSize();
f32 w = (f32)(size.Width>>1);
f32 h = (f32)(size.Height>>1);
glLoadIdentity();
glTranslatef(x,y,0);
glScalef( _BLTZ_SCLx, _BLTZ_SCLy, 0.0f );
glRotatef(_BLTZ_ROT, 0.0f, 0.0f, 1.0f );
glBegin(GL_QUADS);
glTexCoord2f(0,0);glVertex2f(-w,-h);
glTexCoord2f(0,1);glVertex2f(-w, h);
glTexCoord2f(1,1);glVertex2f( w, h);
glTexCoord2f(1,0);glVertex2f( w,-h);
glEnd();
}
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
-
- Posts: 448
- Joined: Tue Oct 05, 2004 3:24 am
- Location: Boston, MA
Very nice, and very interesting.
Irrlicht Moderator || Game Designer
Learn the basics at </dream.in.code>
Learn the basics at </dream.in.code>
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
thanks SkaterX29527 for your comment.
this is the new release of Magic 2d Library,[ie version 0.2].
i have added some new functions for 2d collision test,also added classes for
defining zones on screen,rectangle and ciecle zone,so you could ckeck if the mouse over any zone then take some action.
i have added new effects and examples and some manual examples which explain some functions and classes.
the bin folder contains all the compiled demos for fast testing.
download the new release from the same site.
try it and let me know your opinion.in the main demo do not forget to cilck the left mouse key to fire the tweety image.
thanks
this is the new release of Magic 2d Library,[ie version 0.2].
i have added some new functions for 2d collision test,also added classes for
defining zones on screen,rectangle and ciecle zone,so you could ckeck if the mouse over any zone then take some action.
i have added new effects and examples and some manual examples which explain some functions and classes.
the bin folder contains all the compiled demos for fast testing.
download the new release from the same site.
try it and let me know your opinion.in the main demo do not forget to cilck the left mouse key to fire the tweety image.
thanks
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
please .. shut the hell up i hate MS bashing without any reason, and even if i would ask you for one, you would probably come up with "because MS is bad and steals my milk!!!"NoM$please wrote:so what do you think guys?
Why are you doing all this, just to exclude all the DevCpp users or what?
Maybe you want to apply for a job at M$?
In the "Subliminal Advertisement" department, hehe.
Well, before i use this bloated compiler i simply ignore your "sweets".
This is so uncool.
so go away troll!