diff options
author | Sven Gothel <[email protected]> | 2019-11-23 17:22:39 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2019-11-23 17:22:39 +0100 |
commit | 976e89ff24da3b2cdf206e8ef8f222f54fb467de (patch) | |
tree | c8fc6a0f5e8d8cc81042459a48d86249c5ca4f42 /src/jogl | |
parent | bb83bd2df5723ed145f59e9bd5d212de6c4daba8 (diff) |
Bug 1156: GBM: Bring up incl GL rendering (TODO: GBM working page flip / sync)
- EGLSurface: Factor out 'eglCreate[Platform]WindowSurface'
NEWT egl.gbm.WindowDriver
-- Properly use GBM fourcc format and use as visualID
for GBM surface creation and EGL config selection
-- Create eglSurface within this class
-- Hook up GBM/DRM page flip (not working yet, no visible artifacts - no swap)
- ProxySurfaceImpl.surfaceSwap() call upstreamSurface's implementation if available
TODO: 'Permission denied' calling:
- drmSetMaster (optional)
- drmModeSetCrtc
- drmModePageFlip
Diffstat (limited to 'src/jogl')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/egl/EGLSurface.java | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLSurface.java b/src/jogl/classes/jogamp/opengl/egl/EGLSurface.java index 20e067eac..367f83295 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLSurface.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLSurface.java @@ -36,7 +36,6 @@ import com.jogamp.nativewindow.ProxySurface; import com.jogamp.nativewindow.UpstreamSurfaceHook; import com.jogamp.opengl.GLCapabilitiesImmutable; import com.jogamp.opengl.GLException; -import com.jogamp.common.ExceptionUtils; import com.jogamp.common.nio.Buffers; import com.jogamp.nativewindow.GenericUpstreamSurfacelessHook; import com.jogamp.opengl.egl.EGL; @@ -93,6 +92,23 @@ public class EGLSurface extends WrappedSurface { } } + /** + * Entry point to C language function: + * <br><code> EGLSurface eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint * attrib_list) </code> <br>Part of <code>EGL_VERSION_1_0</code><br> + * <br>or<br> + * <p> + * <code> EGLSurface eglCreatePlatformWindowSurface(EGLDisplay dpy, EGLConfig config, void * native_window, const EGLAttrib * attrib_list) </code> <br>Part of <code>EGL_VERSION_1_5</code>, <code>EGL_EXT_platform_base</code><br>Alias for: <code>eglCreatePlatformWindowSurfaceEXT</code> + * </p> + */ + public static long eglCreateWindowSurface(final long dpy, final long config, final long win) { + final int eglPlatform = EGLDisplayUtil.getEGLPlatformType(true); + if( 0 != eglPlatform ) { + return EGL.eglCreatePlatformWindowSurface(dpy, config, win, null); + } else { + return EGL.eglCreateWindowSurface(dpy, config, win, null); + } + } + public void setEGLSurfaceHandle() throws GLException { setSurfaceHandle( createEGLSurface() ); } @@ -138,24 +154,15 @@ public class EGLSurface extends WrappedSurface { if( isPBuffer ) { return EGLDrawableFactory.createPBufferSurfaceImpl(config, getSurfaceWidth(), getSurfaceHeight(), false); } else { - final int eglPlatform = EGLDisplayUtil.getEGLPlatformType(true); final long eglNativeWin = useNativeSurface ? nativeSurface.getSurfaceHandle() : ((NativeWindow)nativeSurface).getWindowHandle(); - final long eglSurface; - if( 0 != eglPlatform ) { - eglSurface = EGL.eglCreatePlatformWindowSurface(config.getScreen().getDevice().getHandle(), - config.getNativeConfig(), - eglNativeWin, null); - } else { - eglSurface = EGL.eglCreateWindowSurface(config.getScreen().getDevice().getHandle(), - config.getNativeConfig(), - eglNativeWin, null); - } + final long eglSurface = eglCreateWindowSurface(config.getScreen().getDevice().getHandle(), config.getNativeConfig(), eglNativeWin); if(DEBUG) { + final int eglPlatform = EGLDisplayUtil.getEGLPlatformType(true); System.err.println("EGLSurface.createEGLSurface.X: useNativeSurface "+useNativeSurface+ ", nativeWin "+EGLContext.toHexString(eglNativeWin)+") @ "+ eglPlatform+"/"+NativeWindowFactory.getNativeWindowType(true)+": "+ EGLContext.toHexString(eglSurface)+ - ", "+((EGL.EGL_NO_SURFACE != eglSurface)?"OK":"Failed")); + ", "+((EGL.EGL_NO_SURFACE != eglSurface)?"OK":"Failed")+" - with config "+config); } return eglSurface; } |