Program has ended

Blitz3D Forums/Blitz3D Beginners Area/Program has ended

Clintonio(Posted 2007) [#1]
The program ends as soon as it starts.
example
Graphics3D 500,400
camera=CreateCamera()
CameraViewport camera,0,0,GraphicsWidth()/2,GraphicsHeight()/2
CameraRange camera,5,5000

tex=LoadTexture( "gray_clouds.bmp",3 )
ScaleTexture tex,1000,1000
p=CreatePlane()
EntityTexture p,tex
EntityFX p,1
PositionEntity p,0,600,0
p=CopyEntity( p )
RotateEntity p,0,0,180


Clintonio(Posted 2007) [#2]
Srry ive just got the program. I know now


Terry B.(Posted 2007) [#3]
Yeah, alls it doing is loading a texture. Thats it. So it loads it and quits.
So anyway try this, alls ive added is a Waitkey()(which stops the program untill a key is pressed) the RenderWorld() function which draws a frame, and the End function, which gets rid of the program has ended Error message.
P.S. Welcome to the club ;)
Graphics3D 500,400
camera=CreateCamera()
CameraViewport camera,0,0,GraphicsWidth()/2,GraphicsHeight()/2
CameraRange camera,5,5000

tex=LoadTexture( "gray_clouds.bmp",3 )
ScaleTexture tex,1000,1000
p=CreatePlane()
EntityTexture p,tex
EntityFX p,1
PositionEntity p,0,600,0
p=CopyEntity( p )
RotateEntity p,0,0,180 
RenderWorld()

Waitkey()
End



Blitz123(Posted 2007) [#4]
If this is the start of a game, I would change the first line to something like
Graphics3D 800,600
as this is compatible with all graphics cards.
500x400 is an odd resolution and if you try to run it on another machine you may get an error.
It's all good practice.