GithubHelp home page GithubHelp logo

Comments (13)

 avatar commented on August 25, 2024

More information in my case. It seems like I get to if (!_glfwIsValidContext(&ctxconfig)) in GLFW and whatever checks are done inside _glfwIsValidContext(&ctxconfig) are failing so I get NULL instead of a context.

For the tutorial itself, maybe some wording about debugging and seeing where the context is failing is appropriate? In my case I've just been single stepping the code in Visual Studio.

from glitter.

 avatar commented on August 25, 2024

Found it. In glfwIsValidContext, two OpenGL contexts are checked against each other and if the version doesn't match, we get NULL.

I'm on Windows 10 on a Lenovo X1 Carbon (3443CTO)
ctxconfig = 0x003ef8a8 {api=196609 major=4 minor=1 ...} //the context we're checking window->context = {api=196609 major=4 minor=0 ...} //result of _glfwPlatformGetCurrentContext

Further than that, I don't really understand - maybe someone else can provide more insight.

FWIW, making _glfwIsValidContext return GL_TRUE gets me a grey window, but I have no idea if it's usable / working.

from glitter.

Polytonic avatar Polytonic commented on August 25, 2024

Can you try generating an OpenGL 3.3 context instead?

glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);

I don't have an HD 4000 anymore, but I can ask around and try to have someone else reproduce this.

from glitter.

 avatar commented on August 25, 2024
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);

works, and so does

glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);

Maybe something in the README about dropping the OpenGL version down if you have trouble? Or is there a way to make the "Failed" message spit out the system's supported OpenGL version?

from glitter.

Polytonic avatar Polytonic commented on August 25, 2024

@voltagex according to Wikipedia, the Intel HD 4000 only supports OpenGL 4.0 under Windows. Looks like that's what your error messages were saying as well. You'll want:

glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);

I tested this on an HD 4000 in OSX, where 4.1 is available. Should have caught this, sorry about that!

from glitter.

 avatar commented on August 25, 2024

Edit: Similar problems under Linux.

from glitter.

Polytonic avatar Polytonic commented on August 25, 2024

This chart says it only runs 3.3 under Linux.

Looks like it's time to roll back to an older GL version or maybe insert more error messages ...

from glitter.

 avatar commented on August 25, 2024

Depends what you expect from your target audience. If this is intended for classrooms where all the machines would have the same version supported, maybe hardcoding 4.0 is OK.

Should I open another issue for something like "Minimum OpenGL requirements"?

from glitter.

Polytonic avatar Polytonic commented on August 25, 2024

Fundamentally, GL 3 and GL 4 are pretty similar. They're both within the scope of "Modern OpenGL" though there are a few nice things about 4 that aren't available in 3. 4.0 and 4.1 is miniscule differences, so it's probably safe to drop to 4.0. It'll still create a forward compatible context when possible.

I'm more concerned about users who are on older graphics cards that aren't GL 4 compatible. They are out there, but evidently a lot more are still floating around than I realized, considering this is the second issue raised about this so far.

from glitter.

 avatar commented on August 25, 2024

Setting an error callback could be helpful: http://www.glfw.org/docs/latest/quick.html#quick_capture_error - but in this case, the error message produced is useless. I wonder if that's worth a bug report to GLFW...

from glitter.

Polytonic avatar Polytonic commented on August 25, 2024

I want to avoid callbacks as much as possible. This project is used by a significant number of "non-programmers" (art majors, etc. who just want OpenGL to "work"). Ideally the main code should be as short and simple as possible, and should be easy to read without having to go "oh, this is called when an error happens? But why?!"

from glitter.

 avatar commented on August 25, 2024

Fair enough. Thanks for helping me get started.

from glitter.

Polytonic avatar Polytonic commented on August 25, 2024

@voltagex sure thing!

I set it to OpenGL 4.0, so you should be able to pull latest and pick up that change.

from glitter.

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.