Re: [GtkGLExt] on_realize() vs. on_configure_event()
- From: Jonathan Brandmeyer <jbrandmeyer earthlink net>
- To: gtkglext-list gnome org
- Subject: Re: [GtkGLExt] on_realize() vs. on_configure_event()
- Date: Wed, 26 Apr 2006 21:06:36 -0400
First off, the Gtk docs are probably the best source for these
questions. Second up are the examples.
On Wed, 2006-04-26 at 00:08 -0700, Andrew Speirs wrote:
> Sorry if this is a bit of a newbie question, but I've
> only just started playing with gtkglextmm, and I can't
> find much in the various documentation.
> In e.g. simple.cc, the Gtk::GL:DrawingArea has
> on_realize() and on_configure_event() member
> functions. My guess is the former is called when the
> object is created (instantiated)
Yes.
> and the latter is
> called (immediately?
Don't know, but I think so.
> ) afterwards to set the properties
> of the object.
Yes.
> Is the on_realize() called only once per object?
Yes.
> Is the on_configure_event() called anytime the
> object's properties are changed e.g. a window resize?
Yes.
> Are there guidelines as to what to put into these
> functions?
get_gl_context() will not work until on_realize() is called (I could
have that wrong - it might be get_gl_drawable() that returns a NULL
Glib::RefPtr<>. Point being, no GL calls will have any effect until the
on_realize signal has been delivered). If you override on_realize() in
a child, you must call the parent's impl as the first task in the child.
It is common to call glViewPort() in on_configure(), but not required.
HTH,
-Jonathan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]