-
glGetStringi how make it work?
I want to know the opengl extensions, using glGetStringi, but the code doesn't compile. What the include for glGetStringi?
I'm using Code::Blocks with mingw on windows 7.
My code:
#include <iostream>
#include "GL/gl.h"
#include <windows.h>
using namespace std;
int main()
{
int max = 0;
glGetIntegerv(GL_EXTENSIONS, &max);
for(int i = 0; i < max; i++)
cout << glGetStringi(GL_EXTENSIONS, i) << endl;
return 0;
}
-
Advanced Member
Frequent Contributor
Care to share the actual compiler error?
-
The error is:
'glGetStringi' was not declared in this scope
-
Advanced Member
Frequent Contributor
Ah yes, glGetStringi is a GL 3.0 or higher function IIRC. The standard GL header shipped with Windows, however, exposes only GL 1.1 functionality. Checkout glLoadGen or GLEW.
Correction: Your header is shipped with MinGW. Still, MinGW's gl.h doesn't expose GL 3.0 or higher functions. The advice stays the same.
-
Member
Regular Contributor
glGetStringi was only added to OpenGL in version 3.0, and the gl.h provided by Microsoft only includes OpenGL 1.1 entry points, so you will need to include extra code to the retrieve the function pointers, or use tools that do this for you
-
I got GLEW_OK on glewInit, but glGetStringi don't compile, I got undefined reference. What shall be wrong?
glewExperimental is a undefined reference too.
Last edited by ewerton; 01-04-2013 at 10:11 AM.
-
Advanced Member
Frequent Contributor
I am not sure what glew you are using but glGetStringi works find for me. Check your glew.h.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules