


1. How do I make any widget opengl widget?

	Your widget needs OpenGL capable visual and
	you also need to set colormap for it.

	/* get visual using gdk_gl_choose_visual */
	visual = gdk_gl_choose_visual(visual_attributes);

	/* set visual and colormap */
	gtk_widget_push__colormap(gdk_colormap_new(visual, TRUE));
	gtk_widget_push_visual(visual);

	/* create your widget */
	widget = gtk_foobar_new();

	/* restore old values */
	gtk_widget_pop_visual();
	gtk_widget_pop_colormap();



2. How do I render to such widget?

	Create gl context and connect it to widgets GdkDrawable.

	context = gdk_gl_context(visual);
 
	/* connect to gdk window of widget */
	if (gdk_gl_make_current(widget->window, context)) {
		do opengl stuff...

	}



3. How do I render to off screen pixmap?

	See examples/glpixmap.c, remember that pixmaps can not be rendered to with
	direct context.


4. Can I use gdk_gl functions and GtkGLArea widget in the same program?

	Yes, just remember that gtk_gl_area_make_current makes internal context of GtkGLArea
	widget current context (and leaves it so).


5. I can't capture keypress events for GtkGLArea widget, why?

	- You forgot to set event mask:
		 gtk_widget_set_events(glarea, GDK_KEY_PRESS_MASK);

	- You forgot to grab focus:
		GTK_WIDGET_SET_FLAGS(glarea, GTK_CAN_FOCUS);
		gtk_widget_grab_focus(GTK_WIDGET(glarea));

	- Both of the above


6. I noticed that gtk_gl_area_begingl() and gtk_gl_area_endgl() are deprecated?

	- they are still there, but you should use gtk_gl_area_make_current() instead
	  then you can avoid calling matching gtk_gl_area_endgl().

	- just formalizing what has been true for a long time, gtk_gl_area_endgl is
	  no longer necessary and gtk_gl_area_begingl() just makes widgets context
	  current.

	- to convert your code you can replace them with following functions.

	   gtk_gl_area_begingl() =>  gtk_gl_area_make_current()
	   gtk_gl_area_endgl()   =>  glFlush() or nothing



7. Help, ./configure does not find Mesa, I do have Mesa libaries installed.

	- Mesa may need additional libraries to link with, depending on what
	  options were used while compiling Mesa libraries. Currently configure tries
	  to link Mesa with whatever libraries GTK needs and if this fails it tries
	  Mesa+needed by GTK+pthreads libraries. Try passing extra libraries to
	  ./configure in LIBS envinronment variable.

	- configure scripts are still a bit flaky, patches are gratefully accepted.

