Coder Social home page Coder Social logo

Debug context flag always set about glfw HOT 7 CLOSED

glfw avatar glfw commented on May 11, 2024
Debug context flag always set

from glfw.

Comments (7)

elmindreda avatar elmindreda commented on May 11, 2024

It's a side-effect of a workaround for the fact that some drivers don't set the debug bit of the context flags even when a debug context was created. The workaround checks for GL_ARB_debug_output if the bit isn't set, as that is the only way to tell on those drivers whether a debug context has been created.

I'll see if I can make a better workaround.

from glfw.

biller23 avatar biller23 commented on May 11, 2024

Ah.. now it's clear, thanks. Fine, I was only worried about the possible performance penalty of a debug context.

from glfw.

elmindreda avatar elmindreda commented on May 11, 2024

Since you (and therefore GLFW) aren't requesting a debug context, there shouldn't be any penalty. It seems your driver is nice and giving you the option of debug output anyway.

from glfw.

biller23 avatar biller23 commented on May 11, 2024

I think you're right. With glfw 2.7.9 and debug context disabled, it's sufficient calling glEnable(GL_DEBUG_OUTPUT) to have all the functionality...

from glfw.

georgevanvenrooij avatar georgevanvenrooij commented on May 11, 2024

I think the code should be modified to reflect the requested window hint:

So in my opinion, this piece of code (in context.c):

                // HACK: This is a workaround for older drivers (pre KHR_debug)
                // not setting the debug bit in the context flags for debug
                // contexts
                window->glDebug = GL_TRUE;

Should be changed to something like this:

                window->glDebug = <the value of the GLFW_OPENGL_DEBUG_CONTEXT hint>;

This way, GLFW doesn't report "unexpected" debug contexts. If a developer wants to check for the presence of the extension, that's up to him/her then.

Alternative, only check for the GL_ARB_debug_output extension if the window hint has been set to GL_TRUE.

from glfw.

elmindreda avatar elmindreda commented on May 11, 2024

@georgevanvenrooij The last option was my plan, but apparently I forgot to implement it. I'll fix it in 3.1. Thank you for the reminder.

from glfw.

elmindreda avatar elmindreda commented on May 11, 2024

@georgevanvenrooij Fixed with ae8393c. Thank you!

from glfw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.