I run to a really odd problem while trying to generate vertex arrays with openGL. I am using windows 7 as platform, and I am using GLEW 1.15 and glm as the openGL libraries with SDL as the interface.
The problem was that while trying to generate the vertex arrays using
glGenVertexArrays(1, &m_vertexArrayObject);
I came across with the following access violation error
Unhandled exception at 0x7469CB49 in OpenGL.exe: 0xC0000005: Access violation executing location 0x00000000.
I am sure that I initialized GLEW correctly and set the glewExperimental as true before calling any GLEW functions
glewExperimental = GL_TRUE;
GLenum status = glewInit();
After running the getInfo.exe I found out that the genVertexArrays commmand was MISSING from GLEW I had installed to my PC. I then suspected I had a GPU or drivers problem which I chased down and found out that my PC was running with Mobile Intel(R) 4 Series Express Chipset Family Graphics card with a CPU Intel Centrinto 2 - yes my PC is old.
I tried downloading drivers that support openGL version 4.5 or older but I couldn't find any that are supported from my CPU.
Does anyone know a way to go around this problem and make use of the glgenVertexArrays command with old or unsupported hardware? Maybe a command from older versions of openGL that produces the same result as glGenVertexArrays would be a really good help !
P.S I made sure to download the latest version of openGL. glGetString(GL_VERSION) returns Version 2.1.0 - Build 8.15.10.1840, which is not the one I've installed.
Related
I'm trying to use xming to render software using OpenGl running on the same machine in WSL / windows bash.
This works fine for some really small demos, however once I try something like glmark2, it fails because it seems the OpenGl version is reported incorrectly.
glxinfo | grep OpenGL reports this:
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 970M/PCIe/SSE2
OpenGL version string: 1.4 (4.5.0 NVIDIA 382.05)
If I let xming run on my internal graphics card (using a laptop), it reports
OpenGL vendor string: Intel
OpenGL renderer string: Intel(R) HD Graphics 4600
OpenGL version string: 1.4 (4.3.0 - Build 20.19.15.4568)
The weird part is the 1.4 in front of 4.5.0 NVIDIA 382.05.
The OpenGl support is definitely at least 3, because a demo using GLSL shaders which require newer OpenGl runs, but the version string is kinda garbage.
The problem you're running into is, that the GLX portion of XMing does support only up to OpenGL-1.4. The part inside the parentheses is the version string as reported by the system native OpenGL implementation. However since XMing lacks (so far) the capability to reliably pass on anything beyond OpenGL-1.4 it will simply tell you "all I guarantee you to support is OpenGL 1.4, but the system I'm running on could actually do …".
Maybe some day someone goes through the effort to implement a fully featured dynamic GLX←→WGL wrapper.
In trying to run a Qt app on a Windows 7 laptop it says the following (and keeps repeating the):
shader compilation failed:
"Failed to create D3D shaders.\n"
QOpenGLShader::link: Failed to create D3D shaders.
Failed to create D3D shaders.
QOpenGLShaderProgram::uniformLocation( matrix ): shader program is not linked
QOpenGLShaderProgram::uniformLocation( color ): shader program is not linked
QOpenGLShaderProgram::uniformLocation( textureScale ): shader program is not linked
QOpenGLShaderProgram::uniformLocation( dpr ): shader program is not linked
QOpenGLShader::link: Failed to create D3D shaders.
The output above is from the 'Application Output' window in QtCreator.
I am using windows 7, Intel (HD) Graphics Family: Driver version 8.15.10.2559, OpenGL version 3.1
The OpenGL version is from OpenGL Extensions Viewer
The Driver version was retrieved from Screen Resolution->Advanced Settings->Properties->Driver
Edit 1:
The app runs on Linux (Ubuntu 14.04). I moved it without any modifications to my Windows 7 laptop. I'm using Qt 5.7 on both laptops (Linux & Windows). It built on Windows 7 without any complaints. It built and ran on Linux without any complaints. I thought I might have an OpenGL version issue, but OpenGL Viewer says that my system has OpenGL 3.1.
This error log
shader compilation failed:
"Failed to create D3D shaders.\n"
QOpenGLShader::link: Failed to create D3D shaders.
strongly suggests that the Qt build you're using is using the ANGLE OpenGL (on top of Direct3D) emulation layer. You can find Qt in two build variants and ANGLE is the more widely deployed one in Windows, because the default drivers installed in Windows lack modern OpenGL support… which makes applications requiring modern OpenGL features, like Qt5 fail. Hence there's a Qt5 build variant that contains this emulation layer.
In your case you probably want to install (or probably already did so) the native OpenGL driver for your GPU (obtainable directly from the vendor website) and use a Qt build configured to use the native OpenGL implementation around (Qt built with -opengl desktop configuration). See also QT and native OpenGL support in MS Windows
I am developing a project using OpenGL and I need to use shaders. I have an example project which was given to me but I am struggling to compile it - I get the error: Function glGetUniformLocation cannot be resolved.
I am using Ubuntu 14.04, and the images below show my current graphics driver and OpenGL version as well as a screenshot of eclipse where you can see the problems list and, as I believe, the prototype of the function in glew.h which is included by the project.
Upon successful compilation of a recent program I wrote from the openGL-book using openGL 4.0 I wasn't able to run the program due to an error that stated " error XX - unsupported hardware.."
However according to a previous question I asked if I could compile/run openGL programs on my computer I got an answer that I could:
Wiki claims you can do GL 4.0 with your HD 4000 [Graphics Chip] on Windows.
My question is - is that I am using the libraries freeglut 2.8 and GLEW 1.10 (newest versions) but the tutorial I followed used functions that came with 4.0 could the reason that my program does not run follow because I am linking modern versions of openGL libaries?
Things you have to check to run modern OpenGL:
Graphics driver: Do you have the latest and most up to date drivers?
Graphics card/chipset: Can your graphics hardware support the latest OpenGL even with its most recent drivers?
Using Proper Hardware: Some laptops come with a low powered graphics chipset and a high powered alternate graphics card/chipset. The low powered one may not support new stuff, but the high powered one definitely should. Have you instructed your computer to use the right one?
Libraries: Have you properly linked to something like GLEW that gives you the ability to use modern OpenGL?
Since you're on Windows, do note that they purposefully don't give you preinstalled access to modern OpenGL, so you have to do it yourself. Usually that just means checking your drivers and downloading GLEW.
From your error message, it looks like your graphics drivers aren't up to date or the graphics card/chipset/whatever you're using doesn't support the OpenGL version you want.
I'm using GLFW and Netbeans to develop in C++. I'm able to render with immediate mode functions no problem. However, when I try to use core profile functions I get errors like this:
error: ‘glCreateShader’ was not declared in this scope
I get one of these errors for each core profile function I try. I did some research and found that GLFW doesn't provide any gl headers and just #includes the headers found on my system (at /usr/include/GL/).
Presumably this means that the gl.h and related files found here only contain the old style OpenGL API. I can't make sense of the hex code, but the gl.h file #defines GL_VERSION as 0x1F02.
If I perform this command in terminal: glxinfo | grep -i opengl it assures me that my OpenGL version string is "4.2.0 NVIDIA 304.88" -- Although I think that's reflected in the driver, unrelated to the gl.h file. Running this line in C++ code in my application yields the same string: printf("%s\n", glGetString(GL_VERSION)); For the same reason, no doubt.
Where can I source the appropriate OpenGL header files for OpenGL 3+ development on Ubuntu 13.04 x64?
I have installed these packages as suggested by most tutorials (to no avail): xorg-dev libglu1-mesa-dev
glCreateShader (...) is an OpenGL 2.0 function.
Short of OS X, I cannot think of any platforms that ship with OpenGL 2.0 without requiring runtime extension. On Microsoft Windows, you are guaranteed the full feature set of OpenGL 1.1 and anything beyond that requires calls to wglGetProcAddress (...) to load the function entry-points for the rest of the OpenGL API. The situation is the same on Linux, though it is more difficult to define what the "minimum" feature set is. In any case, to use glCreateShader (...) you are going to have to call glXGetProcAddress (...) in order to get the entry-point from the driver.
Libraries like GLEW will make your life easier by loading the entry-point for every function for each extension and core version of OpenGL your driver supports, on Ubuntu there should even be a package you can install that contains GLEW. Nevertheless, see the official project site for more details on actually using GLEW.