1. 14 Feb, 2020 1 commit
    • David Hogan's avatar
      Fixed OpenGL extension detection for extensions promoted to OpenGL core. · 66e2e9c0
      David Hogan authored
      For a given OpenGL context, macOS in particular does not support enumeration / detection of OpenGL features that have been promoted to core OpenGL functionality. It is possible other drivers are the same. This change assumes support for GL_ARB_texture_non_power_of_two with OpenGL 2.0+, GL_ARB_texture_rectangle with OpenGL 3.1+ and GL_EXT_framebuffer_blit with OpenGL 3.0+. I failed to find definitive information on whether GL_GREMEDY_frame_terminator has been promoted to OpenGL core, or whether GL_ANGLE_framebuffer_blit or GL_EXT_unpack_subimage have been promoted to core in OpenGL ES. This change results in a significant GtkGLArea performance boost on macOS.
      
      Closes #2428
      66e2e9c0
  2. 28 Jun, 2018 1 commit
    • Chun-wei Fan's avatar
      Add a EGL renderer (via ANGLE) for Windows · af66faf6
      Chun-wei Fan authored
      This is for adding a EGL-based renderer which is done via the ANGLE
      project, which translate EGL calls to Direct3D 9/11.  This is done as a
      possible solution to issue #105, especially for cases where the needed
      full GL extensions to map OpenGL to Direc3D is unavailable or
      unreliable, or when the OpenGL implementation from the graphics drivers
      are problematic.
      
      To enable this, do the following:
      -Build ANGLE and ensure the ANGLE libEGL.dll and libGLESv2.dll are
       available.  A sufficiently-recent ANGLE is needed for things to
       work correctly--note that the copy of ANGLE that is included in
       qtbase-5.10.1 is sufficient.  ANGLE is licensed under a BSD 3-clause
       license.  Note also that Visual Studio 2013 or later is required to
       build ANGLE from QT-5.10.1, but the 2013-built ANGLE DLLs can work
       without without problems for GTK+ that is built with Visual Studio
       2008 or later.
      -Build libepoxy on Windows with EGL support enabled.
      -Define GDK_WIN32_ENABLE_EGL when building gdk-win32.lib when building
       with Visual Studio, or pass in --enable-win32-gles during configure
       when building with MinGW/mingw-w64.
      -Prior to running GTK+ programs, the GDK_GL envvar needs to contain
       gles.
      
      Known issues:
      -Only OpenGL ES 3 is supported, ANGLE's ES 2 does not support the needed
       extensions, notably GL_OES_vertex_array_object, but its ES 3 support is
       sufficient.
      -There is no autodetection or fallback mechanism to enable using
       EGL/Angle automatically yet.  There is no plans to do this in this
       commit.
      
      Thanks to LRN for pointing out that we should #include
      "win32/gdkwin32.h" instead of #include "gdkwin32.h" for gdkgl.c.  LRN
      also did the autotools portion of this patch.
      
      Further notes about the autotools --enable-win32-gles option, fom LRN:
      
      This adds --enable-win32-gles option, which enables the
      code for GLES renderer.  This commit also adds tests for WGL and
      EGL in epoxy.  The absence of WGL is highly unlikely (it's enabled
      by default), but checking for EGL when GLES is enabled is necessary,
      as EGL is disabled in Windows builds of epoxy by default.
      af66faf6
  3. 22 Nov, 2017 1 commit
  4. 10 Nov, 2016 1 commit
  5. 23 Oct, 2016 2 commits
  6. 21 Oct, 2016 2 commits
  7. 22 Sep, 2016 1 commit
  8. 23 May, 2016 1 commit
    • Emmanuele Bassi's avatar
      gl: Add a realize() fallback · fe684078
      Emmanuele Bassi authored
      Calling gdk_gl_context_realize() should always result in a valid result,
      so we need to provide a default implementation, to avoid a call to a
      NULL function pointer.
      fe684078
  9. 26 Apr, 2016 1 commit
    • Chun-wei Fan's avatar
      gdk/gdkglcontext.c: Avoid a GCCism · 7700243b
      Chun-wei Fan authored
      Pointer arithmetic on GLvoid* (a void*) is a GCCism, so cast it to an
      unsigned char*, which is the type cairo_image_surface_get_data() returns.
      7700243b
  10. 25 Apr, 2016 6 commits
  11. 29 Feb, 2016 1 commit
    • Matthias Clasen's avatar
      gdk: Don't use g_print for debug output · 2801f3c8
      Matthias Clasen authored
      The g_print documentation explicitly says not to do this, since
      g_print is meant to be redirected by applications. Instead use
      g_message for logging that can be triggered via GTK_DEBUG.
      2801f3c8
  12. 07 Oct, 2015 3 commits
  13. 19 Jul, 2015 1 commit
  14. 06 Mar, 2015 1 commit
  15. 12 Feb, 2015 3 commits
    • Emmanuele Bassi's avatar
      Remove GdkGLProfile · d066e754
      Emmanuele Bassi authored
      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
      d066e754
    • Emmanuele Bassi's avatar
      gl: Add gdk_gl_context_get_version() · 390a42fa
      Emmanuele Bassi authored
      Store the OpenGL version when we first do the extensions check; this
      allows client code to check the available GL version without requiring a
      call to gdk_gl_context_make_current() and epoxy_gl_version().
      390a42fa
    • Emmanuele Bassi's avatar
      gl: Drop profile for gdk_window_create_gl_context() · 022724aa
      Emmanuele Bassi authored
      Now that we have a two-stages GL context creation sequence, we can move
      the profile to a pre-realize option, like the debug and forward
      compatibility bits, or the GL version to use.
      022724aa
  16. 10 Feb, 2015 1 commit
  17. 09 Feb, 2015 9 commits
  18. 28 Jan, 2015 1 commit
    • Niels Nesse's avatar
      Fix core context creation in GdkGLContext · 27cf0fa3
      Niels Nesse authored and Emmanuele Bassi's avatar Emmanuele Bassi committed
      - Specifically request GL version when creating context. Just specifying core
      profile bit results in the requested version defaulting to 1.0 which causes
      the core profile bit to be ignored and an arbitrary compatability context to be
      returned.
      
      - Fix GL painting by removing GL calls that have been depricated by the 3.2 core
      profile.
      
      - Additionally remove glInvalidateFramebuffer() call, it is not supported by 3.2
      core.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=742953
      27cf0fa3
  19. 17 Dec, 2014 1 commit
    • Chun-wei Fan's avatar
      gdkgl: Use vfunc For Uploading Textures · 9fd9f61b
      Chun-wei Fan authored
      As the alignments, strides and image formats may be different across
      platforms, make the texture upload a vfunc to allow backends to override
      the GL commands for uploading textures for the software implementation for
      gdk_gl_texture_from_surface(), if necessary.
      
      Suggested by Alex to avoid copying non-trivial portions of code which would
      then add maintainenace burden.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=740795
      9fd9f61b
  20. 08 Nov, 2014 1 commit
  21. 07 Nov, 2014 1 commit