Hi there,
I’m trying to create a depth texture on gl 3.0,
everything works fine if I do not use GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB to create gl 3.0 context, but with the flag active, the following code gives me an gl error
→
glGenTextures(1, &id);
glBindTexture(GL_TEXTURE_2D, id);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
checkErrors("Before: ");
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT24, 256, 256, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL);
checkErrors("After: ");
→
After: GL_INVALID_ENUM : An unacceptable value is specified for an enumerated argument. The offending function is ignored, having no side effect other than to set the error flag.
I’ve checked the gl spec and I don’t think an invalid enum should be thrown with the forward compatibility contexts,
Am I wrong?, if so, how can i create a depth texture with a forward compatibility context
I’m running ubuntu with the following gpu
Graphics report :
Renderer : GeForce GTS 250/PCI/SSE2
Vendor : NVIDIA Corporation
Version : 3.0.0 NVIDIA 185.18.36
Shading Language Version : 1.30 NVIDIA via Cg compiler
thank you
best regards
Rui