I noticed that glGenTextures isn't generating textures and instead causing GL_INVALID_OPERATION error in the project I'm currently working on, first I thought that there is a missing glEnd or something, I looked for such a thing but everything was OK, so I created this program:
Code:
#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow) {
UINT texture = 0;
glGenTextures(1, &texture);
GLenum e = glGetError();
switch (e) {
case GL_NO_ERROR:
MessageBox(NULL, "GL_NO_ERROR", "", MB_OK);
break;
case GL_INVALID_VALUE:
MessageBox(NULL, "GL_INVALID_VALUE", "", MB_OK);
break;
case GL_INVALID_OPERATION:
MessageBox(NULL, "GL_INVALID_OPERATION", "", MB_OK);
break;
};
return 0;
}
and it gave the same error
I loaded one of my previous projects and it worked OK.
So what am I doing wrong? does glGenTextures require some initialization (MSDN says nothing about this)?