sgsrules's picture

creating a context without an Accumulation Buffer.

I'm trying to create a graphics context without the accumulation buffer since i never use it and given my current resolution it would save me 16mb. I'm created my context with:

private void CreateGLContext()
        {
            GraphicsMode gmode = new GraphicsMode(new ColorFormat(8,8,8,8),24,0,0,new ColorFormat(0,0,0,0),2,false);
 
            nWindow = new NativeWindow(DisplayWindowWidth, DisplayWindowHeight, "OpenGl Window", GameWindowFlags.Fullscreen, gmode, DisplayDevice.AvailableDisplays[1]);
            GlContext = new GraphicsContext(gmode, nWindow.WindowInfo, 3, 2, GraphicsContextFlags.Default);
            GlContext.MakeCurrent(nWindow.WindowInfo);
            (GlContext as IGraphicsContextInternal).LoadAll();
        }

but when i look at the debug output it still shows that its allocating 64 bits for the accumulation buffer.

Creating GraphicsContext.
    Creating default GraphicsMode (32, 16, 0, 0, 0, 2, False).
    Creating GraphicsContext.
        Device context: 1862339931
        Selecting pixel format... GraphicsMode: Index: 11, Color: 24 (8880), Depth: 0, Stencil: 0, Samples: 0, Accum: 64 (16161616), Buffers: 2, Stereo: False
        IWindowInfo: Windows.WindowInfo: Handle 2819870, Parent (Windows.WindowInfo: Handle 1312580, Parent (null))
        GraphicsContextFlags: Default
        Requested version: 1.0
        Loaded opengl32.dll: 8791417815040
        OpenGL will be bound to handle: 2819870
        Setting pixel format... 11
        Creating temporary context for wgl extensions.
        Load extensions for OpenTK.Platform.Windows.Wgl... 50 extensions loaded in 14 ms.
        Load extensions for OpenTK.Platform.Windows.Wgl... 50 extensions loaded in 0 ms.
        Using WGL_ARB_create_context... success!
        success! (id: 131072)
    Selecting pixel format (ARB)... success!
    Disposing context 131072.
    Destroying window: Windows.WindowInfo: Handle 1312580, Parent (null)
    GraphicsMode: Index: 8, Color: 32 (8888), Depth: 24, Stencil: 0, Samples: 0, Accum: 64 (16161616), Buffers: 2, Stereo: False
    IWindowInfo: Windows.WindowInfo: Handle 3802890, Parent (Windows.WindowInfo: Handle 3736578, Parent (null))
    GraphicsContextFlags: Default
    Requested version: 3.2
    OpenGL will be bound to handle: 3802890
    Setting pixel format... 8
    Using WGL_ARB_create_context... success!
    success! (id: 196608)
Load extensions for OpenTK.Platform.Windows.Wgl... 50 extensions loaded in 1 ms.
Loading extensions for OpenTK.Graphics.OpenGL.GL... 1900 extensions loaded in 307.6494 ms.

also i'm not sure why a "default " context is created and destroyed before making the one i requested.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

You are using a nvidia card, right? Nvidia always reports a 64bit accumulator buffer even if you don't explicitly request one. (Running 'glxinfo' on my ubuntu laptop also shows a 64bit buffer, so this is not an issue specific to OpenTK or the OS). Just ignore this, it's harmless and doesn't appear to consume any memory (create a few contexts and check the task manager).

The default context is necessary to retrieve Wgl extensions (which are necessary for OpenGL 3.0+, fullscreen antialiasing and floating-point pixel formats). This is how Wgl is designed, nothing we can do to avoid the temporary context.

sgsrules's picture

Right on, that's good to know, learn something new everyday. Once again, thanks for all your help fiddler, you're a great source of knowledge.