Unable to deploy GLFW 3.2

So this is one doozie,
I have a fairly large OpenGL solution written in the kernel version 3.2 with GLSL 1.5 on Windows 7. I use GLEW and GLM as auxiliary libraries. When I create a window, I use the following lines:

// Initialize main window glewExperimental = GL_TRUE; glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3); // Use OpenGL Core v3.2 glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2); glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); if(!glfwOpenWindow(Game::WINDOW_X, Game::WINDOW_Y, 0, 0, 0, 0, 32, 0, GLFW_WINDOW)) { ... 

If I omit the three functions glfwOpenWindowHint, the application disables my video drivers when glDrawArrays is called (GL_TRIANGLES, 0, m_numIndices);

But here is the kicker. When someone from my group tries to update and run the solution, they get an empty window without geometry. Commenting on three lines, the program works great for them. There is quite a split between working with and without 3.2core hint. I could not tell the difference between nVidia, AMD, a desktop computer or a laptop.

The best I could find was a suggestion to add glewExperimental = GL_TRUE; Glew is said to have core issues. It didn’t matter. The solution is too large to publish code, but I can put shaders, rendering code, etc. As needed.

Many thanks! This has been killing us for several days now.

+6
source share
2 answers

Try requesting a direct compatible GLFW window:

GLFW_OPENGL_FORWARD_COMPAT - Specify whether the OpenGL context should be forwarding compatible (i.e. disable outdated functionality). This should only be used when querying OpenGL version 3.0 or higher.

And try not to set the profile hint and let the system choose:

 // Use OpenGL Core v3.2 glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3); glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2); glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); 

Also, make sure you really get the right version:

 int major, minor, rev; glfwGetGLVersion(&major, &minor, &rev); fprintf(stderr, "OpenGL version recieved: %d.%d.%d", major, minor, rev); 

Not sure if you are also running for Mac, but read this anyway:

A.4 OpenGL 3.0+ on Mac OS X

Support for OpenGL 3.0 and higher was introduced with Mac OS X 10.7, and even then OpenGL 3.2 compatible main context contexts OpenGL 3.2 is supported, and there is no mechanism for requesting debug contexts. Earlier versions of Mac OS X support no more than OpenGL version 2.1.

In this regard, on Mac OS X 10.7, GLFW_OPENGL_VERSION_MAJOR and GLFW_OPENGL_VERSION_MINOR hints will fail if version 3.2 is provided, hints GLFW_OPENGL_DEBUG_CONTEXT and GLFW_FORWARD_FLOFLF_FLOF_FLOW are set to GLOWFLOFF completely and are set to GLFF_FLOF_FLOF_FLOF_FLOF_FLOFLY.

In addition, on Mac OS X 10.6 and later, GLFW_OPENGL_VERSION_MAJOR and GLFW_OPENGL_VERSION_MINOR prompts will fail if version 2.1 is provided, the prompt GLFW_OPENGL_DEBUG_CONTEXT will have no effect and set the GLFW_OPLEFOFFOR_P prompts to GLFW_OPLEFOFFEND_NO_FENFLEND.

+10
source

I ran into the same problem. I had to create a VAO before my VBO, and now it works on OS X.

 GLuint vertex_array; glGenVertexArrays(1, &vertex_array); glBindVertexArray(vertex_array); 
0
source

Source: https://habr.com/ru/post/906924/


All Articles