The follow program demonstrates that the default flags that are set in SetGraphicsDriver(GLGraphicsDriver()) are ignored by the call to GLGraphics().
If you do GLGraphics(640,480,0,0,0), ie with 0 as the flags, the flags specified as default in the driver are completely ignored.
You might notice that if you ask for a stencil buffer you're likely to be given a depth buffer even if you didn't ask for one, that's not a bug it's normal GL behavior and it might not apply to all platforms.
So the issue is with GLGraphics() ignoring the default flags, requiring you to respecify them in the GLGraphics() call.
Strict
SetGraphicsDriver(GLGraphicsDriver(),GRAPHICS_BACKBUFFER|GRAPHICS_ALPHABUFFER|GRAPHICS_STENCILBUFFER|GRAPHICS_DEPTHBUFFER|GRAPHICS_ACCUMBUFFER)
Local g:TGraphics=GLGraphics(640,480,0,0,GRAPHICS_BACKBUFFER|GRAPHICS_STENCILBUFFER)
SetGraphics g
Local a:Int
glGetIntegerv(GL_RED_BITS,Varptr(a))
Print "Red bits: "+a
glGetIntegerv(GL_GREEN_BITS,Varptr(a))
Print "Green bits: "+a
glGetIntegerv(GL_BLUE_BITS,Varptr(a))
Print "Blue bits: "+a
glGetIntegerv(GL_ALPHA_BITS,Varptr(a))
Print "Alpha bits: "+a
glGetIntegerv(GL_STENCIL_BITS,Varptr(a))
Print "Stencil Bits: "+a
glGetIntegerv(GL_DEPTH_BITS,Varptr(a))
Print "Depth bits: "+a
glGetIntegerv(GL_ACCUM_RED_BITS,Varptr(a))
Print "Accum red bits: "+a
glGetIntegerv(GL_ACCUM_GREEN_BITS,Varptr(a))
Print "Accum green bits: "+a
glGetIntegerv(GL_ACCUM_BLUE_BITS,Varptr(a))
Print "Accum blue bits: "+a
glGetIntegerv(GL_ACCUM_ALPHA_BITS,Varptr(a))
Print "Accum alpha bits: "+a
It should print that you have 8-bit stencil (or whatever you have), probably x-bit depth, but no accumulation buffer.
[EDIT] GLMax2DDriver() in combination with CreateGraphics() doesn't have this problem.
|