I am working on a project in VIsual Studio 2003 that uses Qt for the GUIs and OpenGL. I am currently using Qt 4.3.0 and am running into some problems using my glRasterPos2f( ) call. I think I am doing some conversion from window coordinates to my ortho coordinates incorrectly, and I was flipping through the red book when I discovered the function glWindowPos2f( ). I figured I should try and use this function since all my original numbers are in window coordinates. Unfortunately, when I try and compile, it says it knows nothing of the function. This is the only OpenGL function I have had it not recognize and I was wondering if anybody here knows what version of OpenGL Qt is using or what I need to add to be able to use glWindowPos2f( ). Thanks!
Edited Portion:
I ran a glGetString( GL_VERSION ) on my code to see what version of OpenGL I am using. It returns to me NULL. My code looks like this to check it.
OpenGL Version = (null)
Did I do the glGetString incorrectly or what is wrong? Does this mean I don’t have any OpenGL installed and that the OpenGL I am using is all being given to me by Qt? Thanks!
glGetString issue:
Make sure you have an OpenGL context created before any gl* call.
glWindowPos2f() issue:
If you go through the appendices of the OpenGL spec,
you’ll at section G.14 that this kind of function
is a core feature of OpenGL 1.4. If your driver version is less than 1.4, you have to use extension
GL_ARB_window_pos. Remember that Visual studio provides an OpenGL 1.1 header file, anything else has to be detected at runtime and loaded. For this purpose you can use
glew or do it yourself (by getting some tutorial on the web or studying the source code of glew).