Commit Graph

17 Commits

Author SHA1 Message Date
Matthias Clasen
8db308be4d glarea: Add property annotations
Connect properties, getters, and setters with annotations.
2021-03-11 16:37:32 +00:00
Benjamin Otte
d7266b25ba Replace "gint" with "int" 2020-07-25 00:47:36 +02:00
Matthias Clasen
86f81a11d8 gl area: Use standard padding 2019-05-26 22:19:21 -04:00
Matthias Clasen
4c150d8eb5 The big versioning cleanup
Remove all the old 2.x and 3.x version annotations.
GTK+ 4 is a new start, and from the perspective of a
GTK+ 4 developer all these APIs have been around since
the beginning.
2018-02-06 01:16:32 -05:00
Matthias Clasen
f3927f1155 Drop GtkGLArea::has-alpha
We now always behave as if has-alpha is TRUE.

Update all callers.
2018-01-17 12:01:25 -05:00
Emanuele Aina
971998de34 glarea: Relay the use-es flag to context creation
https://bugzilla.gnome.org/show_bug.cgi?id=743746
2016-04-25 14:35:02 +01:00
Matthias Clasen
b2e121039e gl area: Add a few missing docs 2015-04-26 10:19:26 -04:00
Matthias Clasen
0ddb5d729c More documentation fixes 2015-03-13 23:24:53 -04:00
Emmanuele Bassi
d066e7541e Remove GdkGLProfile
The existence of OpenGL implementations that do not provide the full
core profile compatibility because of reasons beyond the technical, like
llvmpipe not implementing floating point buffers, makes the existence of
GdkGLProfile and documenting the fact that we use core profiles a bit
harder.

Since we do not have any existing profile except the default, we can
remove the GdkGLProfile and its related API from GDK and GTK+, and sweep
the whole thing under the carpet, while we wait for an extension that
lets us ask for the most compatible profile possible.

https://bugzilla.gnome.org/show_bug.cgi?id=744407
2015-02-12 17:51:31 +00:00
Emmanuele Bassi
c372f95a41 glarea: Add accessors for the required GL version
Specifying the version of OpenGL is enough of a common operation that it
should not require overriding the creation of the GdkGLContext.
2015-02-12 13:25:12 +00:00
Emmanuele Bassi
59679daeae glarea: Clean up the header 2015-02-12 12:44:01 +00: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
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
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
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