Speed Difference

Blitz3D Forums/Blitz3D Programming/Speed Difference

Gauge(Posted 2003) [#1]
When i run this code in full screen mode (1), when i run it in windowed mode (3) it runs alot slower, but when i maximize it in windowed mode, it runs helly slow. why?

It animates/turns etc about 10 times faster in mode 1, then 3, and 1/4 that after i maximize from mode 3.

Graphics3D 800,600,16,1
type_ground=1
type_player=2
type_other=3
SetBuffer BackBuffer()
ClsColor 128,128,128
Cls

camera=CreateCamera()
CameraViewport camera,30,0,600,500
PositionEntity camera,50,36,-40
brush=LoadBrush("c:\blitz\grass.bmp")
light=CreateLight()
RotateEntity light,90,0,0
cube=CreateCube()
PositionEntity cube,50,1.5,2
mesh=CreateMesh()
surf=CreateSurface(mesh)
v1=AddVertex  (surf,0,0,0,0,0)
v2=AddVertex (surf,100,0,0,0,1)
v3=AddVertex (surf,0,0,100,1,0)
V4=AddVertex (surf,100,0,100,1,1)
tri=AddTriangle(surf,v3,v4,v2)
tri2=AddTriangle(surf,v3,v2,v1)
PaintSurface surf,brush
cone=CreateCone()
ScaleEntity cone,25,25,25
PositionEntity cone,50,5,20
EntityType cone,type_other
ScaleEntity mesh,100,1,100
ScaleEntity cube,4,4,4
;EntityTexture mesh,brush
Color 255,255,255
UpdateNormals mesh
pivot=CreatePivot()
PositionEntity pivot,50,1,25,2
EntityType mesh,type_ground
EntityType cube,type_player
EntityRadius cube,1
PaintEntity cube,brush
PositionEntity mesh,45,0,1
RenderWorld
Flip
mesh2=LoadAnimMesh("c:\blitz\runtest3.b3d")
ScaleMesh mesh2,.5,.5,.5
;FitMesh  mesh2,10,1,10,1.5,2,1
PositionEntity mesh2,56,24.75,10
EntityType mesh2,type_player
EntityRadius mesh2,12
RotateEntity mesh2,0,180,0
Animate mesh2,1,.75
UpdateNormals mesh2
EntityParent pivot,mesh2
EntityParent camera,pivot
While Not KeyDown( 1 )	
	Cls
	a$=""
	If KeyDown( 203 )=True Then TurnEntity mesh2,0,5,0
	If KeyDown( 205 )=True Then TurnEntity mesh2,0,-5,0
	If KeyDown( 208 )=True Then MoveEntity mesh2,0,0,3
	If KeyDown( 200 )=True Then MoveEntity mesh2,0,0,-3
	Collisions type_player,type_ground,2,2
	Collisions Type_player,type_other,2,2
	If EntityCollided(mesh2,type_other) Then
	a$="Collided Other"
	Else
	MoveEntity mesh2,0,-.25,0
	EndIf
	UpdateWorld
	RenderWorld
	;Text 10,10,x+"    "+a$
	Flip
Wend

ClearWorld

End



WolRon(Posted 2003) [#2]
All sounds normal to me. Fullscreen will be fastest, windowed will be slower, maximized window will be slowest.
BTW, I didn't try out your code.