• Welcome to Dark Bit Factory & Gravity.
 

OgreMagic for PureBasic

Started by Emil_halim, August 26, 2007

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Emil_halim

Hi PureBasic users

Just want to tell that , OgreMagic is supporting PureBasic now. So you can easlly use OgreMagic Library with your favorite basic language.

Here is a small test programe.


;**********************************************
;
;
;  OgreMagic Library with PureBasic Test
;
;             By Emil Halim
;
;               22/8/2007
;
;**********************************************

XIncludeFile #PB_Compiler_Home + "Includes\Imports\Dx9.pbi"
XIncludeFile #PB_Compiler_Home + "Includes\Imports\OgreMagic.pbi"

Global D3DDevice.IDirect3DDevice9  
 
OpenWindow(1,0,0,640,480,"OgreMagic with PureBasic",#PB_Window_ScreenCentered|#PB_Window_SizeGadget|#PB_Window_MaximizeGadget )

SetWindowPos_(WindowID(1),#HWND_TOPMOST,0,0,0,0,#SWP_NOSIZE|#SWP_NOMOVE)

D3DDevice = D3D_OpenWindowedScreen(WindowID(1),640,480)

InitialMagicLibrary(D3DDevice,640,480)

If(ML_FileExist("MagicMedia.cfg"))
  ML_SetMediaDirectoryFromFile("MagicMedia.cfg")
Else
  ML_SetMediaDirectory("../OgreMagic/MagicMedia/")
EndIf

Tweety.l = ML_LoadStaticSprite("Tweety.bmp",0)
ML_SetSpriteColorKeyFromPoint(Tweety,0,0)

Repeat
 
 D3DDevice\Clear(0,0,#D3DCLEAR_TARGET,0,0,0)  
 D3DDevice\BeginScene()
 
 ML_UseOrthogonalView()
 ML_SetAlpha(1.0,#AllPoints)
 ML_SetColor(255,255,255,#AllPoints)
 ML_SetBlendMode(#ALPHABLEND)
 
 ML_SetSpriteTexture(ML_GetDefualtFont(),0)
 ML_SetColor(255,255,0,#AllPoints)
 ML_DrawString("Welcome To OgreMagic World",200,350)
 
 ML_SetSpriteTexture(Tweety,0)
 ML_DrawSprite(Tweety,320,240)
   
 ML_DrawLogo(0.8,75,60)
 
 ML_UsePerspectiveView()
 
 D3DDevice\EndScene()
 D3DDevice\Present(0,0,0,0)
 EventID = WindowEvent()
 
Until EventID = #PB_Event_CloseWindow  


D3D_Release(D3DDevice)
End


energy

Hi Emil...
Thank yu for Ogre Magic....    :goodpost:
Will test it!!!
Best regards....
coding: jwasm,masm
hobby: www.scd2003.de

va!n

@Emil_halim:
Have never heared of this 3D engine... any link or files where ppl can download it? Is the engine an opensource project or done by yourself? thx
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Emil_halim


Shockwave

Have some Karma Emil, you are very kind to port your engine for the PB users :)
Shockwave ^ Codigos
Challenge Trophies Won:

Emil_halim

thanks shocky for your karma .  :)

Hope to port it to BlitzMax too.

Shockwave

Happy birthday Emil :)

I hope you have your topic notifications on and get this message.
Shockwave ^ Codigos
Challenge Trophies Won: