-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initialization context problem. #766
Comments
ps, I jumped back in the git revision to pretty much at the beginning of the project when I just had a triangle moving up and down, as soon as I touch GLFW_CONTEXT_VERSION nothing gets rendered at screen any-more, I don't get errors or crash just no render whatsoever. |
You can and should set the error callback before you initialize glfw. |
@giordi91 What is the output of |
Hi here is the output, i recompiled the latest 3.2 glfw to run glwinfo i hope that doesnt affect the result. `Welcome to Git (version 1.9.5-preview20141217) Run 'git help git' to display the help index.
The driver should support up to 4.5 no problem, same goes for the card. |
@intrigus thanks for the tip, I moved the error calback before the init but did not change anything , and no extra output was seen at the console, aka I think the init works fine. |
Versioned context creation seems to work, then. This does not appear to be a bug in GLFW. |
if the context is not specified, what will glfw create? is it possible to On Fri, May 27, 2016 at 2:24 PM, Camilla Berglund [email protected]
Marco Giordano |
Sorry, I don't understand what that means. |
if I create a glfw window without asking for a specific context version , On Fri, May 27, 2016 at 2:44 PM, Camilla Berglund [email protected]
Marco Giordano |
See the documentation for those hints:
|
Also note that if you request version 3.2 or greater, the context may by default have any profile. |
Yes that s what I mean, I am sorry if I am not explaining myself correctly. that s is how I am currently initalizing the window:
I am not setting any hint to glfw of the version of the context I want. In that case what kind of context will glfw try to initialize for me ? I don't think it is a 1.0 because i am using shaders and geometry shaders etc. So what I would like to know is what context version is glfw trying to initialize if not asked explicitly? If not asked explicitly will be glfw making the decision or the driver? Either way if not explicitly set, is there a way to query with what version the context has been created? I hope it makes sense. |
The context is re-created because that is the correct and only way to access modern extensions to the WGL API, such as versioned context creation. One needs to create a legacy context to gain access to the newer context creation functions. By putting the calls to A tool like gDebugger should be able to cope with context re-creation, as it is a very commonly used technique. |
Interesting thanks for clarification, oh gdebugger has not a problem with context, my application fails flat out on simple opengl commands like : glBindBuffer(GL_ARRAY_BUFFER, m_buffer_index); You mentioned that should default to opengl 1.0 context correct? If so how come I can access shaders , frame buffer etc which should be stuff only used in newer opengl version? PS mine are not complains but genuine questions trying to figure out why app fails if context is set to any version M. |
This is all described in the documentation, which I linked to and quoted earlier as well. Also, if I recall, running any but the most recent version of GLEW on a core profile context will cause |
Thank you for your patience and help, I really appreciate it, mmmm I am going to double check the latest version of glew and try with this. Thank you so much. |
Sorry to re-open the issue, but actually found what the problem was it is written here , under the the GLEW bug: http://www.opengl-tutorial.org/miscellaneous/faq/ It is a glew bug which leads to problem, I started putting glGetError() everywhere , and got up all the way to glewInit(), if the context is set right after glewInit() i get error 1280, although glew does not return any error. In the end i solved it adding: This fixed the problem, I also read that using glewExperimental = true; might help aswell in combination with the above line of code. Now my last question is do I have any way to make sure that GLFW create successifully a 4.3 context and did not backfault to 3.0? Again thanks for all the help Also found related bug on glew repository which looks like has been sitting there for more than two years: Might be time to leave glew once and for all. |
Thank you for the detailed follow-up!
Just request 4.3 via the |
That s all I needed to know! Thanks a lot M. |
Hi, I am currently trying to get shadow mapping working, and after hitting my head all over the place I cannot make it to work, so I started to compare 1:1 my code with all the tutorials online. But there is no way to get my shadow texture to render, it comes white, while following one of the tutorials I saw the guy setting major and minor context version, which I did not do, so I wondered if that could have been a problem and decided to set the version aswell, all my shader use 430 as version so I thought to set the same, here how i initialize the window:
Now as soon as I try to set minor or major context, I start to get problem all over the place, where opengl call crash saying I am trying to write to 0x00000 etc. Basically this happens with the first function call to opengl. Also instead if I try to set opengl core profile. I get error saying that the profile works only from opengl 3.2 and up. My driver support up to opengl 4.5 and that s what I thought I was using, I have been using geometry shaders aswell which are core since 3.2 so I should at least be running a 3.2 context. I am really confused by that. Do you see anything wrong in my code? or what do you think might trigger the problem if i set the context version?
Is it there a way to query whats the version of the created context? The crashing in opengl might it be a problem with glewInit() not initializing properly if the context is too high?
Any help on the matter is much appreciated. I am running glfw 3.1.2
The text was updated successfully, but these errors were encountered: