Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT GLCanvas has no depth buffer with GTK3
SWT GLCanvas has no depth buffer with GTK3 [message #1795159] Mon, 17 September 2018 11:22 Go to next message
Felix Hirsch is currently offline Felix HirschFriend
Messages: 8
Registered: May 2016
Location: Aachen, Germany
Junior Member
Hi,

I'm running a RCP application with OpenGL content using the SWT GLCanvas and a C++/JNI GL library which handles the OpenGL drawing in the canvas.

On RHEL/CentOS with GTK 3.14.13 (and also under Windows) everything works fine.

But when I run the application in RHEL7.5 (GTK 3.22.10) the 3D content has no depth buffer.

I read the GL depth bits using "glGetIntegerv(GL_DEPTH_BITS)" via JNI from the current GLContext of the widget and it says "0" .
Even if it was set to "24" in the SWT GLData object which was used to create the SWT GLCanvas object. (Do not use GLCanvas.getGLData(), since it will not return the real depth buffer size of the GLContext but only a local copy of the hint-value which was given to the widget contructor)

When I use SWT_GTK3=0 the depth is working as expected and there are no GL problems with the newer GTK3 version.

On gnome.org one can read that in GTK 3.16 the method "gtk_gl_area_set_has_depth_buffer (...)" was introduced to the new GTK3 widget GtkGLArea. (https://developer.gnome.org/gtk3/stable/GtkGLArea.html#gtk-gl-area-set-has-depth-buffer)

In the documentation of GtkGLArea it says that default "gboolean" values for the properties "has-depth-buffer", "has-stencil-buffer", "use-es" and "has-alpha" are FALSE.
(https://developer.gnome.org/gtk3/stable/GtkGLArea.html#GtkGLArea--has-depth-buffer
https://developer.gnome.org/gtk3/stable/GtkGLArea.html#GtkGLArea--has-stencil-buffer
https://developer.gnome.org/gtk3/stable/GtkGLArea.html#GtkGLArea--has-alpha
https://developer.gnome.org/gtk3/stable/GtkGLArea.html#GtkGLArea--use-es)

Does SWT GLCanvas use GtkGLArea as underlying widget when working with GTK3? Is it possible that the depth of SWT GLCanvas's GLContext is never initialized correctly when SWT is running in a GTK3 environment?

Has anyone observed similar problems or does anyone know a solution for this problem?

Felix

[Updated on: Mon, 17 September 2018 13:49]

Report message to a moderator

Re: SWT GLCanvas has no depth buffer with GTK3 [message #1795164 is a reply to message #1795159] Mon, 17 September 2018 15:06 Go to previous messageGo to next message
Felix Hirsch is currently offline Felix HirschFriend
Messages: 8
Registered: May 2016
Location: Aachen, Germany
Junior Member
With this post I add an example based on SWT Snippet209 (http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet209.java) .

In the provided eclipse plugin I use jogl-2.4-b1473 and gluegen-2.4-b903 (http://jogamp.org/deployment/autobuilds/master).

Please see LICENSE-jogl.txt, LICENSE-gluegen.txt and Snippet209.java for license information.

Instructions:
- Download and unpack
- Create and load an empty eclipse 4.8 workspace (with >= JDK 1.8)
- Import the extracted plugin project as existing project
- Build in the IDE
- Run the Snippet209 class from within the IDE as JavaApplication
- Look at the console output to see the GL properties read from GLContext
Re: SWT GLCanvas has no depth buffer with GTK3 [message #1795165 is a reply to message #1795159] Mon, 17 September 2018 15:09 Go to previous message
Felix Hirsch is currently offline Felix HirschFriend
Messages: 8
Registered: May 2016
Location: Aachen, Germany
Junior Member
Sorry - all my posts are submitted twice, when I use Chrome as browser. Ignore this one...

[Updated on: Mon, 17 September 2018 15:13]

Report message to a moderator

Previous Topic:Stopping Infinite Java Script Loop from SWT Browser
Next Topic:Instructions for SWT download out of date
Goto Forum:
  


Current Time: Mon Apr 06 22:30:33 GMT 2020

Powered by FUDForum. Page generated in 0.11591 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top