Renderworld

BlitzMax Forums/MiniB3D Module/Renderworld

matty47(Posted 2007) [#1]
Hi, I hope this is not some idiotic error on my behalf. The following code when compiled gives an Unhandled memory access error and freezes when run. When I kill the app Renderworld is highlighted. I know that my klepto mod is working as I have successfully compiled and run most of the examples that came with sidesign.minib3d.
/code
Import klepto.minib3d

Strict

'Set up some varaibles for the graphics window
Local width=800,height=600,depth=0,mode=0
'create the graphics window
Graphics width,height,depth,mode

'set up a camera
Local cam:TCamera=CreateCamera()
CameraRange cam,0.5,500
PositionEntity cam,0,10,-10

'set up a light
Local light:TLight=CreateLight()
RotateEntity light,90,0,0

'now load our mesh
Local obj:TMesh=LoadMesh("./teapot.b3d")
PositionEntity obj,0,0,10

'main loop
While Not KeyHit(KEY_ESCAPE)

UpdateWorld
RenderWorld
Flip

Wend
End
/code

Thanks for any help
Matthew


Ninjacrat(Posted 2007) [#2]
Instead 'Graphics' try 'Graphics3d'. :)


matty47(Posted 2007) [#3]
Yep, that was it! An oversight on my behalf but I just could not see it.
Thanks
Matthew


plash(Posted 2008) [#4]
matty47, the code boxes work like this: [ code][/ code] (just remove the spaces)

forum codes