Re: Small cross-platform OpenGL demo
Posted: Mon Aug 13, 2012 6:56 pm
great, thank you luisWindowEvent() does not wait for messages like WaitWindowEvent()
http://www.purebasic.com
https://www.purebasic.fr/english/
great, thank you luisWindowEvent() does not wait for messages like WaitWindowEvent()
Code: Select all
InitKeyboard()
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
CompilerIf Subsystem("OpenGL") = #False
MessageRequester("Error", "Please set the subsystem to OpenGL")
End
CompilerEndIf
CompilerEndIf
If InitSprite() = 0
MessageRequester("Error", "Can't open screen & sprite environment!")
End
EndIf
OpenWindow(0, 0, 0, 640, 480, "press space key to switch On/Off the fan rotation", #PB_Window_SystemMenu | #PB_Window_Invisible)
SetWindowColor(0, 0)
OpenWindowedScreen(WindowID(0), 0, 0, WindowWidth(0), WindowHeight(0), 0, 0, 0)
HideWindow(0, #False)
Global running.b = 0;
Global angle_step.f = 0.3
Global angle_direction.f
lngh.f : width.f : depth.f
Global Dim LightPos.f(4) ;Light Position
LightPos(0)= 0.0 : LightPos(1)= 5.0 : LightPos(2)=-4.0 : LightPos(3)= 1.0
Global Dim LightAmb.f(4) ;Ambient Light Values
LightAmb(0)= 0.2 : LightAmb(1)= 0.2 : LightAmb(2)= 0.2 : LightAmb(3)= 1.0
Global Dim LightDif.f(4) ;Diffuse Light Values
LightDif(0)= 0.6 : LightDif(1)= 0.6 : LightDif(2)= 0.6 : LightDif(3)= 1.0
Global Dim LightSpc.f(4) ;Specular Light Values
LightSpc(0)=-0.2 : LightSpc(1)=-0.2 : LightSpc(2)=-0.2 : LightSpc(3)= 1.0
Global Dim MatAmb.f(4) ;Material - Ambient Values
MatAmb(0)= 0.4 : MatAmb(1)= 0.4 : MatAmb(2)= 0.4 : MatAmb(3)= 1.0
Global Dim MatDif.f(4) ;Material - Diffuse Values
MatDif(0)= 1.2 : MatDif(1)= 0.6 : MatDif(2)= 0.0 : MatDif(3)= 1.0
Global Dim MatSpc.f(4) ;Material - Specular Values
MatSpc(0)= 0.0 : MatSpc(1)= 0.0 : MatSpc(2)= 0.0 : MatSpc(3)= 1.0
Global Dim MatShn.f(1) ;Material - Shininess
MatShn(0)= 0.0
glClearColor_ (0.0, 0.0, 0.0, 0.0);
glShadeModel_ (#GL_SMOOTH)
glEnable_(#GL_LIGHTING);
glEnable_(#GL_LIGHT0);
glEnable_(#GL_DEPTH_TEST);
glLightfv_(#GL_LIGHT1,#GL_POSITION,LightPos()) ;Set Light1 Position
glLightfv_(#GL_LIGHT1,#GL_AMBIENT,LightAmb()) ;Set Light1 Ambience
glLightfv_(#GL_LIGHT1,#GL_DIFFUSE,LightDif()) ;Set Light1 Diffuse
glLightfv_(#GL_LIGHT1,#GL_SPECULAR,LightSpc()) ;Set Light1 Specular
glEnable_(#GL_LIGHT1) ;Enable Light1
glEnable_(#GL_LIGHTING) ;Enable Lighting
glMaterialfv_(#GL_FRONT,#GL_AMBIENT,MatAmb()) ;Set Material Ambience
glMaterialfv_(#GL_FRONT,#GL_DIFFUSE,MatDif()) ;Set Material Diffuse
glMaterialfv_(#GL_FRONT,#GL_SPECULAR,MatSpc()) ;Set Material Specular
glMaterialfv_(#GL_FRONT,#GL_SHININESS,MatShn()) ;Set Material Shininess
Procedure.l blade(lngh.f, width.f, depth.f)
a.f = lngh: b.f = width: c.f = depth
glBegin_(#GL_QUADS);
; Top face of box
;glColor3f_(1.0, 0.0, 0.0)
glVertex3f_(a, b, -c); // Top right vertex (Top of cube)
glVertex3f_(-a, b, -c); //Top left vertex (Top of cube)
glVertex3f_(-a, b, c); // Bottom left vertex (Top of cube)
glVertex3f_(a, b, c); // Bottom right vertex (Top of cube)
;Bottom face of box
glVertex3f_(a, -b, -c); // Top right vertex (Bottom of cube)
glVertex3f_(-a, -b, -c); // Top left vertex (Bottom of cube)
glVertex3f_(-a, -b, c); // Bottom left vertex (Bottom of cube)
glVertex3f_( a, -b, c); // Bottom right vertex (Bottom of cube)
glColor3f_(1.0,0.0,0.0);
;Front of box
glVertex3f_(a, b, c); // Top right vertex (Front)
glVertex3f_(-a, b, c); // Top left vertex (Front)
glVertex3f_(-a, -b, c); // Bottom left vertex (Front)
glVertex3f_(a, -b, c); // Bottom right vertex (Front)
glColor3f_(1.0,0.0,0.0);
;Back of box
glVertex3f_(a, -b, -c); // Bottom right vertex (Back)
glVertex3f_(-a, -b, -c); // Bottom left vertex (Back)
glVertex3f_(-a, b, -c); // top left vertex (Back)
glVertex3f_(a, b, -c); // Top right vertex (Back)
glColor3f_(1.0,0.0,0.0);
;Left of box
glVertex3f_(-a, b, c); // Top right vertex (Left)
glVertex3f_(-a, b, -c); // Top left vertex (Left)
glVertex3f_(-a, -b, -c); // Bottom left vertex (Left)
glVertex3f_(-a, -b, c); // Bottom vertex (Left)
glColor3f_(1.0,0.0,0.0);
;Right of box
glVertex3f_(a, b, -c); // Top right vertex (Right)
glVertex3f_(a, b, c); // Top left vertex (Right)
glVertex3f_(a, -b, c); // Bottom left vertex (Right)
glVertex3f_(a, -b, -c); // Bottom right vertex (Right)
glColor3f_(1.0,0.0,0.0);
;End drawing the box
glEnd_();
;Return TRUE;
EndProcedure
Procedure.l Fan_Render(spin.f)
glPushMatrix_();
;Fan
glPushMatrix_();
;Fan Base:
qobj = gluNewQuadric_();
gluQuadricDrawStyle_(qobj, #GL_FILL); /* smooth shaded */
gluQuadricNormals_(qobj, #GL_SMOOTH);
glScalef_( 4 , 0.5 , 4 );
glEnable_(#GL_NORMALIZE);
;Sphere With radius 0.25 then scaled
gluSphere_(qobj, 0.25, 20, 20);
glPopMatrix_();
;Fan stand:
glPushMatrix_();
gluQuadricDrawStyle_(qobj, #GL_FILL); /* flat shaded */
gluQuadricNormals_(qobj, #GL_FLAT);
glRotatef_(-90, 1.0, 0.0, 0.0);
gluCylinder_(qobj, 0.125, 0.125, 3, 16, 10);
glPopMatrix_();
;Fan Motor:
glRotatef_(angle_direction, 0.0, 1.0, 0.0)
glPushMatrix_();
gluQuadricDrawStyle_(qobj, #GL_FILL); /* smooth shaded */
gluQuadricNormals_(qobj, #GL_SMOOTH);
glTranslatef_(0.0, 2.5, 0.0);
glScalef_( 0.5, 0.5, 1);
glEnable_(#GL_NORMALIZE);
gluSphere_(qobj, 1 , 20 , 20 );
glPopMatrix_();
;**********************************************
;Blades construction
glTranslatef_(0.0, 2.5, 0.5)
;glClear_ (#GL_COLOR_BUFFER_BIT | #GL_DEPTH_BUFFER_BIT)
glRotatef_(spin, 0.0, 0.0, 1.0 );
For i = 1 To 360 Step 60
glPushMatrix_();
glRotatef_( i, 0.0, 0.0, 1.0 );
glTranslatef_(1.2, 0.0, 0.0);
glRotatef_( -45, 1.0, 0.0, 0.0 );
glShadeModel_(#GL_FLAT);
glEnable_(#GL_DEPTH_TEST);
glEnable_(#GL_LIGHTING);
glEnable_(#GL_LIGHT0);
;glMaterialfv_p(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, mat_amb_diff_color);
glPushMatrix_();
;calling blade ie: drawing the Blade of the fan*/
;glClear_ (#GL_COLOR_BUFFER_BIT | #GL_DEPTH_BUFFER_BIT)
blade(0.8,0.3,0.01);
glPopMatrix_();
glPopMatrix_();
Next
glPopMatrix_();
glPopMatrix_();
glPopMatrix_();
EndProcedure
Procedure.f Fan_Physics()
Static spin.f
Static speed.f
If running = 1
speed = speed + 1
angle_direction = angle_direction + angle_step
If angle_direction > 110
angle_step = -0.3
ElseIf angle_direction < 0
angle_step = 0.3
EndIf
EndIf
If speed > 360.0: speed = 360.0: EndIf
If running = 0 :speed = speed - 1.8: EndIf
If speed < 0: speed = 0: EndIf
spin = spin + speed/100
ProcedureReturn spin
EndProcedure
HideWindow(0, #False)
Procedure.l Fan_Run()
glViewport_(0, 0, WindowWidth(0), WindowHeight(0))
glMatrixMode_(#GL_PROJECTION)
glLoadIdentity_()
gluPerspective_(30.0, Abs(WindowWidth(0) / WindowHeight(0)), 0.1, 500.0)
glMatrixMode_(#GL_MODELVIEW)
glLoadIdentity_()
glClear_(#GL_COLOR_BUFFER_BIT | #GL_DEPTH_BUFFER_BIT)
glLoadIdentity_ ()
; viewing transformation
glTranslatef_(0.0, 0.0, -6.0);
gluLookAt_(5,5,5,0,1.5,0,0,1,0);
spin.f = Fan_Physics();
Fan_Render(spin);
EndProcedure
While Quit.b = 0
Repeat
EventID = WindowEvent()
Select EventID
Case #PB_Event_CloseWindow
Quit = 1
EndSelect
ExamineKeyboard()
If KeyboardReleased(#PB_Key_Space)
running ! 1
EndIf
Fan_Run()
FlipBuffers()
Delay(1)
Until EventID = 0
Wend
End
Code: Select all
IncludeFile #PB_Compiler_Home + "Examples\Sources - Advanced\OpenGL Cube\OpenGL.pbi"
InitKeyboard()
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
CompilerIf Subsystem("OpenGL") = #False
MessageRequester("Error", "Please set the subsystem to OpenGL")
End
CompilerEndIf
CompilerEndIf
If InitSprite() = 0
MessageRequester("Error", "Can't open screen & sprite environment!")
End
EndIf
OpenWindow(0, 0, 0, 640, 480, "press space key to switch On/Off the fan rotation", #PB_Window_SystemMenu | #PB_Window_Invisible)
SetWindowColor(0, 0)
OpenWindowedScreen(WindowID(0), 0, 0, WindowWidth(0), WindowHeight(0), 0, 0, 0)
HideWindow(0, #False)
Global running.b = 0;
Global angle_step.f = 0.3
Global angle_direction.f
lngh.f : width.f : depth.f
Global Dim LightPos.f(4) ;Light Position
LightPos(0)= 0.0 : LightPos(1)= 5.0 : LightPos(2)=-4.0 : LightPos(3)= 1.0
Global Dim LightAmb.f(4) ;Ambient Light Values
LightAmb(0)= 0.2 : LightAmb(1)= 0.2 : LightAmb(2)= 0.2 : LightAmb(3)= 1.0
Global Dim LightDif.f(4) ;Diffuse Light Values
LightDif(0)= 0.6 : LightDif(1)= 0.6 : LightDif(2)= 0.6 : LightDif(3)= 1.0
Global Dim LightSpc.f(4) ;Specular Light Values
LightSpc(0)=-0.2 : LightSpc(1)=-0.2 : LightSpc(2)=-0.2 : LightSpc(3)= 1.0
Global Dim MatAmb.f(4) ;Material - Ambient Values
MatAmb(0)= 0.4 : MatAmb(1)= 0.4 : MatAmb(2)= 0.4 : MatAmb(3)= 1.0
Global Dim MatDif.f(4) ;Material - Diffuse Values
MatDif(0)= 1.0 : MatDif(1)= 0.6 : MatDif(2)= 0.0 : MatDif(3)= 1.0
Global Dim MatSpc.f(4) ;Material - Specular Values
MatSpc(0)= 0.0 : MatSpc(1)= 0.0 : MatSpc(2)= 0.0 : MatSpc(3)= 1.0
Global Dim MatShn.f(1) ;Material - Shininess
MatShn(0)= 0.0
glClearColor_ (0.0, 0.0, 0.0, 0.0);
glShadeModel_ (#GL_SMOOTH)
glEnable_(#GL_LIGHTING);
glEnable_(#GL_LIGHT0);
glEnable_(#GL_DEPTH_TEST);
glLightfv_(#GL_LIGHT1,#GL_POSITION,LightPos()) ;Set Light1 Position
glLightfv_(#GL_LIGHT1,#GL_AMBIENT,LightAmb()) ;Set Light1 Ambience
glLightfv_(#GL_LIGHT1,#GL_DIFFUSE,LightDif()) ;Set Light1 Diffuse
glLightfv_(#GL_LIGHT1,#GL_SPECULAR,LightSpc()) ;Set Light1 Specular
;glEnable_(#GL_LIGHT1) ;Enable Light1
glEnable_(#GL_LIGHTING) ;Enable Lighting
; glMaterialfv_(#GL_FRONT,#GL_AMBIENT,MatAmb()) ;Set Material Ambience
; glMaterialfv_(#GL_FRONT,#GL_DIFFUSE,MatDif()) ;Set Material Diffuse
; glMaterialfv_(#GL_FRONT,#GL_SPECULAR,MatSpc()) ;Set Material Specular
; glMaterialfv_(#GL_FRONT,#GL_SHININESS,MatShn()) ;Set Material Shininess
glColorMaterial_(#GL_FRONT, #GL_AMBIENT_AND_DIFFUSE)
glEnable_(#GL_COLOR_MATERIAL) ; color tracking
glEnable_(#GL_NORMALIZE)
Procedure.l blade(lngh.f, width.f, depth.f)
a.f = lngh: b.f = width: c.f = depth
glBegin_(#GL_QUADS);
; Top face of box
glColor3f_(1.0, 0.0, 0.0) ; red blades !
glNormal3f_(0.0, 1.0, 0.0)
glVertex3f_(a, b, -c); // Top right vertex (Top of cube)
glVertex3f_(-a, b, -c); //Top left vertex (Top of cube)
glVertex3f_(-a, b, c); // Bottom left vertex (Top of cube)
glVertex3f_(a, b, c); // Bottom right vertex (Top of cube)
;Bottom face of box
glNormal3f_(0.0, -1.0, 0.0)
glVertex3f_(a, -b, -c); // Top right vertex (Bottom of cube)
glVertex3f_(-a, -b, -c); // Top left vertex (Bottom of cube)
glVertex3f_(-a, -b, c); // Bottom left vertex (Bottom of cube)
glVertex3f_( a, -b, c); // Bottom right vertex (Bottom of cube)
;Front of box
glNormal3f_(0.0, 0.0, 1.0)
glVertex3f_(a, b, c); // Top right vertex (Front)
glVertex3f_(-a, b, c); // Top left vertex (Front)
glVertex3f_(-a, -b, c); // Bottom left vertex (Front)
glVertex3f_(a, -b, c); // Bottom right vertex (Front)
;Back of box
glNormal3f_(0.0, 0.0, -1.0)
glVertex3f_(a, -b, -c); // Bottom right vertex (Back)
glVertex3f_(-a, -b, -c); // Bottom left vertex (Back)
glVertex3f_(-a, b, -c); // top left vertex (Back)
glVertex3f_(a, b, -c); // Top right vertex (Back)
;Left of box
glNormal3f_(-1.0, 0.0, 0.0)
glVertex3f_(-a, b, c); // Top right vertex (Left)
glVertex3f_(-a, b, -c); // Top left vertex (Left)
glVertex3f_(-a, -b, -c); // Bottom left vertex (Left)
glVertex3f_(-a, -b, c); // Bottom vertex (Left)
;Right of box
glNormal3f_(1.0, 0.0, 0.0)
glVertex3f_(a, b, -c); // Top right vertex (Right)
glVertex3f_(a, b, c); // Top left vertex (Right)
glVertex3f_(a, -b, c); // Bottom left vertex (Right)
glVertex3f_(a, -b, -c); // Bottom right vertex (Right)
;End drawing the box
glEnd_();
;Return TRUE;
EndProcedure
Procedure.l Fan_Render(spin.f)
glPushMatrix_();
glColor3f_(1.0, 1.0, 0.0)
;Fan
glPushMatrix_();
;Fan Base:
qobj = gluNewQuadric_();
gluQuadricDrawStyle_(qobj, #GL_FILL); /* smooth shaded */
gluQuadricNormals_(qobj, #GL_SMOOTH);
glScalef_( 4 , 0.5 , 4 );
;glEnable_(#GL_NORMALIZE);
;Sphere With radius 0.25 then scaled
gluSphere_(qobj, 0.25, 20, 20);
glPopMatrix_();
;Fan stand:
glPushMatrix_();
gluQuadricDrawStyle_(qobj, #GL_FILL); /* flat shaded */
gluQuadricNormals_(qobj, #GL_FLAT);
glRotatef_(-90, 1.0, 0.0, 0.0);
gluCylinder_(qobj, 0.125, 0.125, 3, 16, 10);
glPopMatrix_();
;Fan Motor:
glRotatef_(angle_direction, 0.0, 1.0, 0.0)
glPushMatrix_();
gluQuadricDrawStyle_(qobj, #GL_FILL); /* smooth shaded */
gluQuadricNormals_(qobj, #GL_SMOOTH);
glTranslatef_(0.0, 2.5, 0.0);
glScalef_( 0.5, 0.5, 1);
;glEnable_(#GL_NORMALIZE);
gluSphere_(qobj, 1 , 20 , 20 );
glPopMatrix_();
;Blades construction
glTranslatef_(0.0, 2.5, 0.5)
;glClear_ (#GL_COLOR_BUFFER_BIT | #GL_DEPTH_BUFFER_BIT)
glRotatef_(spin, 0.0, 0.0, 1.0 );
For i = 1 To 360 Step 60
glPushMatrix_();
glRotatef_( i, 0.0, 0.0, 1.0 );
glTranslatef_(1.2, 0.0, 0.0);
glRotatef_( -45, 1.0, 0.0, 0.0 );
glShadeModel_(#GL_FLAT);
glEnable_(#GL_DEPTH_TEST);
; glEnable_(#GL_LIGHTING);
; glEnable_(#GL_LIGHT0);
;glMaterialfv_p(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, mat_amb_diff_color);
glPushMatrix_();
;calling blade ie: drawing the Blade of the fan*/
;glClear_ (#GL_COLOR_BUFFER_BIT | #GL_DEPTH_BUFFER_BIT)
blade(0.8,0.3,0.01);
glPopMatrix_();
glPopMatrix_();
Next
; **********************************************
glPopMatrix_();
;glPopMatrix_();
;glPopMatrix_();
EndProcedure
Procedure.f Fan_Physics()
Static spin.f
Static speed.f
If running = 1
speed = speed + 1
angle_direction = angle_direction + angle_step
If angle_direction > 110
angle_step = -0.3
ElseIf angle_direction < 0
angle_step = 0.3
EndIf
EndIf
If speed > 360.0: speed = 360.0: EndIf
If running = 0 :speed = speed - 1.8: EndIf
If speed < 0: speed = 0: EndIf
spin = spin + speed/100
ProcedureReturn spin
EndProcedure
HideWindow(0, #False)
Procedure.l Fan_Run()
glViewport_(0, 0, WindowWidth(0), WindowHeight(0))
glMatrixMode_(#GL_PROJECTION)
glLoadIdentity_()
gluPerspective_(30.0, Abs(WindowWidth(0) / WindowHeight(0)), 0.1, 500.0)
glMatrixMode_(#GL_MODELVIEW)
glLoadIdentity_()
glClear_(#GL_COLOR_BUFFER_BIT | #GL_DEPTH_BUFFER_BIT)
glLoadIdentity_ ()
; viewing transformation
glTranslatef_(0.0, 0.0, -6.0);
gluLookAt_(5,5,5,0,1.5,0,0,1,0);
spin.f = Fan_Physics();
Fan_Render(spin);
EndProcedure
While Quit.b = 0
Repeat
EventID = WindowEvent()
Select EventID
Case #PB_Event_CloseWindow
Quit = 1
EndSelect
ExamineKeyboard()
If KeyboardReleased(#PB_Key_Space)
running ! 1
EndIf
Fan_Run()
FlipBuffers()
Delay(1)
Until EventID = 0
Wend
End
It never creates a depth buffer, except if you use ogre. It doesn't even create a depth buffer on windows here, or at least I've had this problem once with an earlier PB version. However, it should never initialize one if it isn't needed.Polo wrote:Is it just me or OpenWindowedScreen doesn't create a depth buffer on OSX (but does create one on Windows)?
Code: Select all
InitSprite()
OpenWindow(0, 100, 100, 1280, 800, "gl" , #PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(0), 0, 0, 1280, 800, 1, 0, 0, #PB_Screen_NoSynchronization)
Define pfd.PIXELFORMATDESCRIPTOR
Define hdc.i = wglGetCurrentDC_()
Define iPixelFormat.i = GetPixelFormat_(hdc)
DescribePixelFormat_(hdc, iPixelFormat, SizeOf(PIXELFORMATDESCRIPTOR), @pfd)
Debug pfd\cDepthBits
End
Code: Select all
CompilerIf #PB_Compiler_OS = #PB_OS_Windows And Subsystem("OpenGL") = #False
CompilerError "Please set the subsystem To OpenGL"
CompilerEndIf
It would be nice if this would be possible:Fred wrote:You can use a CompilerError to notify the subsystem error:
Nice code !Code: Select all
CompilerIf #PB_Compiler_OS = #PB_OS_Windows And Subsystem("OpenGL") = #False CompilerError "Please set the subsystem To OpenGL" CompilerEndIf
Code: Select all
CompilerIf #PB_Compiler_OS = #PB_OS_Windows And Subsystem("OpenGL") = #False
SetSubsystem("OpenGL")
CompilerIf Subsystem("OpenGL") = #False
CompilerError "Unable to set the OpenGL subsystem!"
CompilerEndIf
CompilerEndIf
Seems to be a bug, since we don't need a z-buffer until we use OGRE. Once upon a time it was already like this, I don't know why it has been changed on windows and not on other operating systems. Eating system resources which are not needed isn't good. Its possible to choose another pixelformat for better performance (but that has to be decided for each device), but enabling the depth buffer won't increase the speed, so there's no reason to enable it.xorc1zt wrote:the windows context has zbuffer by default now
Code: Select all
#GLX_DEPTH_SIZE = 12
ImportC "-lX11"
XGetVisualInfo.i(*display, vinfo_mask.i, *vinfo_template, *nitems_return)
XLoadQueryFont.i(*display, name.p-ascii)
EndImport
ImportC "-lGL"
glXGetCurrentDisplay.i()
glXGetConfig.i(*dpy, *vis, attrib.l, *value)
EndImport
Structure XVisualInfo
*visual
VisualID.i
screen.l
depth.l
class.l
red_mask.i
green_mask.i
blue_mask.i
colormap_size.l
bits_per_rgb.l
EndStructure
Define *display
Define *vinfo_template
Define *xvinfo.XVisualInfo
Define depthSize.l
InitSprite()
OpenWindow(0, 100, 100, 800, 600, "gldepth", #PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(0), 0, 0, 800, 600, 0, 0, 0, #PB_Screen_NoSynchronization)
*vinfo_template = AllocateMemory(64)
*display = glXGetCurrentDisplay()
*xvinfo = XGetVisualInfo(*display, $2, *vinfo_template, @numVis)
glXGetConfig(*display, *xvinfo, #GLX_DEPTH_SIZE, @depthSize)
Debug depthSize
End
I'm definately not a fan of reserving unnecessary system resources. Really, it should only be enabled when its necessary, which is when InitEngine3D was called before.Polo wrote:Ok maybe it should be added to OSX then!
If you don't want to use the 3d engine and just OpenGL it doesn't make sense. Is it taking that much resources anyway...?DarkDragon wrote:I'm definately not a fan of reserving unnecessary system resources. Really, it should only be enabled when its necessary, which is when InitEngine3D was called before.Polo wrote:Ok maybe it should be added to OSX then!
According to xorc1zt's code: 24 bit per pixel, that's 3 * resX * resY bytes which are reserved in the gpu. 5,93MB for 1920x1080. The size of the buffer might not disturb you, but its unnecessary without Ogre.Polo wrote:If you don't want to use the 3d engine and just OpenGL it doesn't make sense. Is it taking that much resources anyway...?DarkDragon wrote:I'm definately not a fan of reserving unnecessary system resources. Really, it should only be enabled when its necessary, which is when InitEngine3D was called before.Polo wrote:Ok maybe it should be added to OSX then!