Re: [gtkmm] [gtkglmm] Cannot set pixel format for a Gdk::GL::Pixmap?



> GdkGLExt-WARNING **: cannot set pixel format
> GdkGLExt-WARNING **: cannotcreate GdkGLPixmap
> 
> these error messages occur upon calling the following function from
> the 
> configure method of a Gtk::GL::DrawingArea:
> 
> //DrawingArea.h
> class MyDrawingArea : public Gtk::GL::DrawingArea
> {
> Glib::RefPtr<Gdk::GL::Pixmap>  GLbuffer;
> Glib::RefPtr<Gdk::GL::Config>  GLconfig;
> Glib::RefPtr<Gdk::Pixmap> buffer;
> };
> 

First, a Gtk::GL::DrawingArea is backed internally by a Gdk::GL::Window,
not a Pixmap.  It is a convince widget for on-screen drawing, and I'm
not sure what you need to do for off-screen rendering.


> bool MyDrawingArea ::configure(GdkEventConfigure* event)
> {
> ...
> GLbuffer = Gdk::GL::Pixmap::set_gl_capability(buffer, GLconfig); //it
> is 
> this line that causes the error.
> ...
> }

I call DrawingArea::set_gl_capability() in the constructor of my derived
class with the Gdk::GL::Config object that I have allocated.

DrawingArea::on_configure() is called when the widget is resized (maybe
other times too, this is the only one I know of).

> Needless to say, it was working before. (Isn't that always the way for
> novice programmers?) Also, the example applications provided with the 
> gtkglextmm packages work properly.

I learned a lot about the library by studying the example apps.  Perhaps
one or more of them would be a good starting point for you.

HTH,
Jonathan Brandmeyer




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]