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!
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!
I have never used extensions before, so how do I try and call GL_ARB_window_pos? Is it just a function with the same arguments or what? Thanks!
An extension is a set of additional features to a given OpenGL version.
Each extension can define new tokens (macros), new functions or just new features.
For instance extension ARB_texture_non_power_of_two tells you can use non-power-of-two textures but it does not add new tokens or functions.
Extensions are all listed here:
The extension you are interested in is described here:
This extension defines the following functions:
void WindowPos2dARB(double x, double y)
void WindowPos2fARB(float x, float y)
void WindowPos2iARB(int x, int y)
void WindowPos2sARB(short x, short y)
void WindowPos2dvARB(const double *p)
void WindowPos2fvARB(const float *p)
void WindowPos2ivARB(const int *p)
void WindowPos2svARB(const short *p)
void WindowPos3dARB(double x, double y, double z)
void WindowPos3fARB(float x, float y, float z)
void WindowPos3iARB(int x, int y, int z)
void WindowPos3sARB(short x, short y, short z)
void WindowPos3dvARB(const double *p)
void WindowPos3fvARB(const float *p)
void WindowPos3ivARB(const int *p)
void WindowPos3svARB(const short *p)
Look at this document http://glew.sourceforge.net/basic.html to learn how to use glew with the extension you want.
In your case the code should look like:
GLenum err = glewInit();
if (err == GLEW_OK)
… just a guess from the doc.