PDA

View Full Version : gtkglextmm and glew problems & questions



neoideo
09-15-2009, 07:40 AM
i have an application that uses gtkglextmm 1.2 and the extension version supported is 1.4.

i dont know if this is possible, but i want to initialize glew too, so i have this code and glewinit fails.



int main(int argc, char **argv){
GLenum initStatus = glewInit();
if( initStatus != GLEW_OK ){
printf( "*GLEW Cannot Init\n");
}
if( GLEW_ARB_vertex_buffer_object == NULL ){
printf( "*GLEW_ARB_vertex_buffer_object = NULL\n");
}
Gtk::Main m(argc, argv);

// Init gtkglextmm.
Gtk::GL::init(argc, argv);

// Query OpenGL extension version.
int major, minor;
Gdk::GL::query_version(major, minor);
std::cout << "OpenGL extension version - "<< major << "." << minor << std::endl;
GUIVentanaPrincipal gui;
m.run(gui);

return 0;
}


and this is my output:


*GLEW Cannot Init
*GLEW_ARB_vertex_buffer_object = NULL
OpenGL extension version - 1.4


why gtkglext support version is so low? also i dont know what is the problem with glewinit.

neoideo
09-15-2009, 01:25 PM
ok problem solved i was doing it on the wrong part!
i anyone has the same problem here goes the solution:
it is necessary to initialize a gtkglextmm context first.
what do i mean with this? create your opengl window first
then you can initialize glew correctly:
this is my output now.


*GLEW Initialized
*GLEW_ARB_vertex_buffer_object --- OK