Commit Graph

16 Commits

Author SHA1 Message Date
Matthias Clasen
f95fb6f893 GtkGLArea: avoid extraneous property notifications 2014-11-23 18:30:13 -05:00
Matthias Clasen
72a501fe15 GtkGLArea: Formatting fixes 2014-11-22 21:38:46 -05:00
Alexander Larsson
ef9ac24e95 GtkGLArea: Correctly position/size input window on realize 2014-11-03 13:35:00 +01:00
Alexander Larsson
3656c21030 GtkGLArea: Don't dispose gl context on unrealize
This was done to ensure the context is not current, but this is
pretty broken for shared contexts. We now just make it non-current.
2014-11-03 13:19:40 +01:00
Alexander Larsson
9930e6dcaa GtkGLArea: Add create-context signal
This lets you hook into the GL context creation which is useful
if you want to share one GL context between GtkGLArea widgets.
2014-11-03 10:43:31 +01:00
Alexander Larsson
f66060c422 GdkGLArea: fix has_alpha changes at runtime
We need to completely reallocate the buffers if we switch
has_alpha, because we may switch from render buffers to
texture.
2014-10-30 21:04:29 +01:00
Alexander Larsson
37d0159a84 GtkGLArea: Add resize signal
This is very useful, as almost all GL code wants to recalculate
the cameras each time the window size changes.
2014-10-30 21:04:29 +01:00
Alexander Larsson
969b9c6552 GtkGLArea: Add profile property
This lets you force a core 3.2 context if you want
2014-10-30 21:04:29 +01:00
Alexander Larsson
b519b642bd GtkGLArea: Add INPUT_ONLY window so that we can get events 2014-10-30 21:04:29 +01:00
Alexander Larsson
5ea3a1028d GtkGLArea: Major reworking
This restructures the way buffers are allocated and bound in a way
that is more flexible.

Buffer operation happens in three phases:
create_buffer() - Creates the gl objects
allocate_buffers() - Allocates space for the buffers at a given size
attach_buffers() - Attaches the buffers to the framebuffer and makes
                   the framebuffer the default drawing target
And destroy via
delete_buffers()

We call all these the first draw, and after that we allocate buffers
each time the widget changes size until the buffers are deleted.
We delete the buffers at unrealize.

However, anyone that wants to manually control buffer allocation strategies
can manually call allocate/delete_buffers().

There are also some other changes:
* Support for stencil buffers.
* A manual render mode where ::draw doesn't render unless you manually
  invalidated the previous rendering.
2014-10-30 21:04:29 +01:00
Alexander Larsson
ad30262fef GtkGLArea: Always destroy context on unrealize
We had some code that tried to reuse the context over realize, but
that doesn't work as we need to share with the possibly new
paint context of the re-realized window.
2014-10-30 12:43:03 +01:00
Benjamin Otte
44c8df62f2 glarea: Display the error message when an error occurred
Simply center a PangoLayout with the message text.
2014-10-16 03:33:15 +02:00
Matthias Clasen
e7c16a5e82 Drop a reference to GtkGLArea::create-context
The signal no longer exists.
2014-10-13 10:43:32 -04:00
Matthias Clasen
e5e9d87171 Nitpicky documentation fixes 2014-10-13 10:43:32 -04:00
Alexander Larsson
fdeb4f8c16 gl: Make gdk_gl_context_make_current() return void
Its not really reasonable to handle failures to make_current, it
basically only happens if you pass invalid arguments to it, and
thats not something we trap on similar things on the X drawing side.

If GL is not supported that should be handled by the context creation
failing, and anything going wrong after that is essentially a critical
(or an async X error).
2014-10-13 10:43:32 -04:00
Alexander Larsson
535723ce86 Add GtkGLArea widget 2014-10-13 10:43:31 -04:00