The Little Body
04-16-2011, 07:22 PM
Hi,
I begin with geometry shader and have a problem with the glCreateShader(GL_GEOMETRY_SHADER_EXT) that return a value of 0 :(
GLEW say that geometry shaders are supported
glewInit();
if (glewIsSupported("GL_VERSION_2_1"))
printf("Ready for OpenGL 2.1\n");
else {
printf("OpenGL 2.1 not supported\n");
exit(1);
}
if (GLEW_ARB_vertex_shader && GLEW_ARB_fragment_shader && GL_EXT_geometry_shader4)
printf("Ready for GLSL - vertex, fragment, and geometry units\n");
else {
printf("Not totally ready :( \n");
exit(1);
}
Ready for OpenGL 2.1
Ready for GLSL - vertex, fragment, and geometry units
But the id returned by glCreateShader(GL_GEOMETRY_SHADER_EXT) is always 0 :(
v = glCreateShader(GL_VERTEX_SHADER);
if( v == 0)
{
printf("can't create a GL_VERTEX_SHADER :( \n");
exit(0);
}else{
printf("The vertex shader as the id %d \n", v);
}
f = glCreateShader(GL_FRAGMENT_SHADER);
if( f == 0)
{
printf("can't create a GL_FRAGMENT_SHADER :( \n");
exit(0);
}else{
printf("The fragment shader as the id %d \n", v);
}
g = glCreateShader(GL_GEOMETRY_SHADER_EXT);
if( g == 0)
{
printf("can't create a GL_GEOMETRY_SHADER_EXT :( \n");
exit(0);
}else{
printf("The vertex shader as the id %d \n", v);
}
say this :
The vertex shader as the id 1
The fragment shader as the id 1
can't create a GL_GEOMETRY_SHADER_EXT :(
So, of course I have a core dump at each glProgramParameteriEXT(p,GL_GEOMETRY_...) found after :(
=> what is the good way for to have a valid geometry shader id returned by the glCreateShader() func ?
PS : g = glCreateShaderObjectARB(GL_GEOMETRY_SHADER_EXT) return too the value 0 :(
PS2 : the error returned by glGetError is 1282 (GL_INVALID_OPERATION)
I begin with geometry shader and have a problem with the glCreateShader(GL_GEOMETRY_SHADER_EXT) that return a value of 0 :(
GLEW say that geometry shaders are supported
glewInit();
if (glewIsSupported("GL_VERSION_2_1"))
printf("Ready for OpenGL 2.1\n");
else {
printf("OpenGL 2.1 not supported\n");
exit(1);
}
if (GLEW_ARB_vertex_shader && GLEW_ARB_fragment_shader && GL_EXT_geometry_shader4)
printf("Ready for GLSL - vertex, fragment, and geometry units\n");
else {
printf("Not totally ready :( \n");
exit(1);
}
Ready for OpenGL 2.1
Ready for GLSL - vertex, fragment, and geometry units
But the id returned by glCreateShader(GL_GEOMETRY_SHADER_EXT) is always 0 :(
v = glCreateShader(GL_VERTEX_SHADER);
if( v == 0)
{
printf("can't create a GL_VERTEX_SHADER :( \n");
exit(0);
}else{
printf("The vertex shader as the id %d \n", v);
}
f = glCreateShader(GL_FRAGMENT_SHADER);
if( f == 0)
{
printf("can't create a GL_FRAGMENT_SHADER :( \n");
exit(0);
}else{
printf("The fragment shader as the id %d \n", v);
}
g = glCreateShader(GL_GEOMETRY_SHADER_EXT);
if( g == 0)
{
printf("can't create a GL_GEOMETRY_SHADER_EXT :( \n");
exit(0);
}else{
printf("The vertex shader as the id %d \n", v);
}
say this :
The vertex shader as the id 1
The fragment shader as the id 1
can't create a GL_GEOMETRY_SHADER_EXT :(
So, of course I have a core dump at each glProgramParameteriEXT(p,GL_GEOMETRY_...) found after :(
=> what is the good way for to have a valid geometry shader id returned by the glCreateShader() func ?
PS : g = glCreateShaderObjectARB(GL_GEOMETRY_SHADER_EXT) return too the value 0 :(
PS2 : the error returned by glGetError is 1282 (GL_INVALID_OPERATION)