Getting Started
with
OgreMagic
There are a lot of things you must to know before trying to use OgreMagic Library.
2- for using OgreMagic library with your code you have to include OgreMagic.h header file.
Example:
;********************************************** ; ; ; OgreMagic Library with PureBasic Test ; ; By Emil Halim ; ; 22/8/2007 ; ;**********************************************
|
3- When dealing with 2d Drawing the Original coordinates (0,0) is the upper left corner of the Screen,
you can chang it any tim by using ML_SetOring function.
4- First we must initialize the OgreMagic library by callling InitialMagicLibrary Function.
Example:
;********************************* Initial OgreMagic Library here for PureBasic ;********************************** SetWindowPos_(WindowID(1), #HWND_TOPMOST,0,0,0,0, #SWP_NOSIZE | #SWP_NOMOVE) DX_InitDirectX9(WindowID(1),640,480,0,0)
|
5- OgreMagic Library will only work with 32 Bits so you must work with 23 bits.
6- Before we dealing with 2D Drawing we must call ML_Use2DView() Function.
7- After we finishing 2D Drawing we must call ML_Stop2DViewe() Function.
8- Sometimes we want to dealing with 3D so we must call ML_Use3DView() Function.
9- After we finishing 3D Drawing we must call ML_Stop3DView() Function.
10- All Drawing Functions must be called between BeginScene & EndScene
a - with Ogre
do all OgreMagic stuff inside Ogre::RenderQueueListene , so do not worry about that.
b - with Irrlicht
do all drawing stuff inside while loop and initializing stuff befor it.
c - with FreeBasic
do all drawing stuff inside render function between DX9_BeginScene & DX9_EndScene.
11- The original hotspot of the Sprite is it's middle see this picture

12- HowTo Drawing a Sprite into your Screen
;**************************** ; PureBasic Example ;**************************** If(ML_FileExist("MagicMedia.cfg")) Tweety.l = ML_LoadSprite("Tweety.bmp",0) Repeat DX_FreeDirectX9() |
Create a free website at Webs.com