aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
Commit message (Collapse)AuthorAgeFilesLines
* Bug 682 - Relocating javax.media.opengl.* -> com.jogamp.opengl.* (Part 2)Sven Gothel2015-02-021-798/+0
| | | | | Relocation javax.media.nativewindow.* -> com.jogamp.nativewindow.* Relocation javax.media.opengl.* -> com.jogamp.opengl.*
* Bug 682 - Relocating javax.media.opengl.* -> com.jogamp.opengl.* (Part 1)Sven Gothel2015-02-021-19/+19
| | | | | | | | | sed -i 's/javax\.media\.opengl/com\.jogamp\.opengl/g' `grep -Rl "javax\.media\.opengl" src` sed -i 's/javax\.media\.nativewindow/com\.jogamp\.nativewindow/g' `grep -Rl "javax\.media\.nativewindow" src` sed -i 's/javax\/media\//com\/jogamp\//g' `grep -Rl "javax/media/" src` sed -i 's/javax\/media\//com\/jogamp\//g' `grep -Rl "javax/media/" doc` Manually edited all occurences within make/**
* Bug 1068 - Allow GLContext creation and makeCurrent without default ↵Sven Gothel2014-12-071-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | framebuffer (Part 2); Bug 896: EGL_KHR_create_context (Part 1) Bug 1068 - Allow GLContext creation and makeCurrent without default framebuffer (Part 2) Implement surfaceless context on EGL and GLX/X11 utilizing *UpstreamSurfacelessHook as introduced in commit 9ea218a5990b908e04235c407c0951c60df6ffba. Surfaceless context is probed during GL profile probing by default. If available, it will be used for offscreen FBO drawables. If probing fails, or is disabled, the new GLRendererQuirks.NoSurfacelessCtx is set. - GLProfile.disableSurfacelessContext disables surfaceless context probing, set property 'jogl.disable.surfacelesscontext' Tested: - Mesa/EGL works, - Mesa + NVidia w/ GLX fail on GNU/Linux): Fails NoSurfacelessCtx - TODO: Windows impl. and more tests +++ Bug 896: EGL_KHR_create_context (Part 1) - Detect EGL_KHR_create_context capability and utilize if available. - Implement EGLContext.createContextARBImpl(..), allowing native DEBUG context usage, where available. - EGL implements SharedResourceRunner, i.e. probing profiles on dedicated thread using common interface. - Probe desktop profile/context ability in EGLDrawableFactory SharedResourceRunner, Where EGLGLnDynamicLibraryBundleInfo covers EGL + desktop GL. - TODO: Tests w/ capable implementation
* Bug 1038 - Allow skipping detection of certain GLProfiles: Skip native core ↵Sven Gothel2014-07-291-18/+1
| | | | | | profiles via property 'jogl.disable.openglcore' Also moved all GL profile properties to GLProfile class and made them public for better documentation.
* Bug 1035 - Allow Gamma [Brightness, Contrast] settings to be performed on ↵Sven Gothel2014-07-271-2/+65
| | | | | | | | | | | | | | | | | | | | | | | | | display/screen of a NativeSurface Currently GLDrawableFactoryImpl's gamma settings are performed only on the main screen. Allow passing a NativeSurface, so it's display/screen gamma values will be changed. Further, promote low-level gamma settings to GLDrawableFactory for direct usage. Change com.jogamp.opengl.util.Gamma to use a GLDrawable instead of a GL object to clarify that we use the drawable. Also add a GLAutoDrawable variant, allowing proper locking of its 'upstream-lock' to guarantee atomicity. +++ Tested manually w/ TestGearsES2NEWT on X11 and Windows using the 'g' and 'G' to modify gamma. Value is properly reset on exit.
* Bug 1031: Remove Deprecated Classes and Methods (JOGL)Sven Gothel2014-07-101-91/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed Deprecated Class: - com/jogamp/opengl/util/TGAWriter.java - Use TextureIO w/ .tga suffix - com/jogamp/opengl/util/awt/Screenshot.java - Use: - com.jogamp.opengl.util.GLReadBufferUtil, or - com.jogamp.opengl.util.awt.AWTGLReadBufferUtil The latter for reading into AWT BufferedImage See: TestBug461FBOSupersamplingSwingAWT, TestBug605FlippedImageAWT - javax/media/opengl/GLPbuffer.java - Use: caps.setPBuffer(true); final GLAutoDrawable pbuffer = GLDrawableFactory.getFactory( caps.getGLProfile() ).createOffscreenAutoDrawable(null, caps, null, 512, 512); - See: TestPBufferDeadlockAWT, .. Removed Deprecated Methods: - Constructor of AWT-GLCanvas, SWT-GLCanvas, AWT-GLJPanel with argument 'final GLContext shareWith' See GLSharedContextSetter, i.e. glCanvas.setSharedContext(..) ! - GLDrawableFactory.createOffscreenAutoDrawable(..) with argument 'final GLContext shareWith' See GLSharedContextSetter, i.e. offscreenAutoDrawable.setSharedContext(..) ! - GLDrawableFactory.createGLPbuffer(..), see above! - com.jogamp.opengl.util.av.AudioSink 'enqueueData(AudioDataFrame audioDataFrame)', use 'enqueueData(int, ByteBuffer, int)' - GLSharedContextSetter.areAllGLEventListenerInitialized(), migrated to GLAutoDrawable ! - GLBase's - glGetBoundBuffer(int), use getBoundBuffer(int) - glGetBufferSize(int), use getBufferStorage(int).getSize() - glIsVBOArrayBound(), use isVBOArrayBound() - glIsVBOElementArrayBound(), use isVBOElementArrayBound() - NEWT MouseEvent.BUTTON_NUMBER, use BUTTON_COUNT
* Code Clean-Up based on our Recommended Settings (jogamp-scripting ↵Sven Gothel2014-07-031-10/+11
| | | | | | | | | | | | | c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) - Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
* Fix 'typo' in messages: 'Catched' -> 'Caught'Sven Gothel2014-06-281-1/+1
|
* GLDrawableFactory.shutdown0() Add DEBUG line at the endSven Gothel2013-11-291-0/+3
|
* GLDrawableFactory: destroy() -> shutdownImpl() - Add DEBUG output in ↵Sven Gothel2013-11-281-2/+2
| | | | implementation
* Bug 894 - GLDrawableFactory* [dummy|offscreen] Surface creation w/ own ↵Sven Gothel2013-11-061-0/+13
| | | | device does _not_ require locking on global shared device.
* GLDrawableFactory: createDummy*(..) Pass GLCapabilitiesImmutable + ↵Sven Gothel2013-10-311-6/+13
| | | | GLCapabilitiesChooser instead of GLProfile, allowing using same or similar caps - important for sharing ctx
* GLDrawableFactory: Add 'GLAutoDrawable createDummyAutoDrawable(..)' for ↵Sven Gothel2013-10-291-22/+45
| | | | | | | convenience Added: GLAutoDrawable createDummyAutoDrawable(AbstractGraphicsDevice deviceReq, boolean createNewDevice, GLProfile glp)
* Bug 776 GLContext Sharing: Add note about driver stability (destruction ↵Sven Gothel2013-10-281-2/+2
| | | | | | | | | | | | | | | | | | | | | order) ; Fix unit tests (Shared Gears, wait for created context and destruction order) - Add note about driver stability (destruction order) - See GLSharedContextSetter: Don't destroy master context before slaves! - Fix spec-overview.html#SHARED links, add link to GLSharedContextSetter in SHARED subsection. - Fix unit tests (Shared Gears, wait for created context and destruction order) - The GearsObject sharing was completly bogus! It simply used the _same_ GLArrayDataServer instance for sharing, but it should use a _copy_ of the shared GLArrayDataServer while only preserving the VBO object! Fixed, while adding required methods to GLArrayDataServer. - Waiting for the created GLContext of a GLAutoDrawable required us to pass the latter _and_ check whether it's GLContext exists and is natively created. - Accomodated the destruction order - see above!
* Bug 776 GLContext Sharing: Refine API for relaxed and lazy GLContext sharing ↵Sven Gothel2013-10-271-2/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ; Fix GLContext memory contract (volatile) (Unit test remarks see below) - Add shared GLContext queries - Refined GLContextShareSet: - Use IdentityHashMap since GLContext's can only be identical w/ same reference (footprint, performance) - Add API doc for clarification - Add methods: - ArrayList<GLContext> getCreatedShares(final GLContext context) - ArrayList<GLContext> getDestroyedShares(final GLContext context) - Use 'final' where possible - Add GLContext methods: - boolean isShared() - List<GLContext> getCreatedShares() - List<GLContext> getDestroyedShares() - Add GLSharedContextSetter interface defining setting a shared GLContext directly (GLContext) or via a GLAutoDrawable: - setSharedContext(GLContext) - setSharedAutoDrawable(GLAutoDrawable) Both cause initialization/creation of GLAutoDrawable's drawable/context to be postponed, if the shared GLContext is not yet created natively or the shared GLAutoDrawable's GLContext does not yet exist. Most of impl. resides in GLDrawableHelper Implemented in: - GLAutoDrawableBase, GLOffscreenAutoDrawable - GLWindow - AWT GLCanvas TODO: - GLJPanel - SWT GLCanvas - GLDrawableFactory: - Add 'GLOffscreenAutoDrawable createOffscreenAutoDrawable(..)' variant w/o passing the optional shared GLContext _and_ specifying lazy GLContext creation. This allows to benefit from GLSharedContextSetter contract. Lazy GLContext creation is performed at 2st display() call at the latest. All JOGL code and unit tests use this new method now. - Mark 'createOffscreenAutoDrawable(..)' w/ shared GLContext argument and immediate GLContext creation deprecated - shall be removed in 2.2.0 - Make reference to GLContext and it's native handle volatile Since we rely on the query 'GLContext.isCreated()' to properly allow GLAutoDrawable's to query whether a shared GLContext is natively created (already), the handle must be volatile since such query and the actual creation may operate on different threads. +++++ - Add/Refine shared GLContext unit tests demonstrating diff. sharing methods. All variants of using shared GLContext: com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextVBO* Most convenient way to share via setSharedAutoDrawable(GLAutoDrawable): com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextVBOES2[NEWT|AWT]3 AWT use w/ JTabbedPane using setSharedAutoDrawable(GLAutoDrawable): com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextWithJTabbedPaneAWT
* jogl: add missing @Override annotationsHarvey Harrison2013-10-171-0/+1
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* jogl: remove all trailing whitespaceHarvey Harrison2013-10-171-76/+76
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* Fix some JavaDoc and API doc (reference) bugs ..Sven Gothel2013-09-081-5/+7
|
* GLDrawableFactory: Expose createDummyDrawable(..) / GLDrawableFactoryImpl: ↵Sven Gothel2013-08-101-1/+15
| | | | | | Make impl. methods final. createDummyDrawable(..) is useful for efficient shared context w/o actually rendering to this dummy drawable's framebuffer
* Fix OSX GL-core lack of pbuffer: GLDrawableFactory.canCreateGLPbuffer(..) ↵Sven Gothel2013-07-171-7/+11
| | | | | | add GLProfile argument, similar to canCreateFBO(..) In case a compatible non-core profile is requests, canCreateGLPbuffer(..) returns false on OSX.
* Fix Bug 761 (part 1/2): Move GLDrawableFactory.shutdownHook -> ↵Sven Gothel2013-06-231-34/+22
| | | | | | | | | | | | | | | | | | NativeWindowFactory.shutdownHook, the latter handles customShutdownHooks for NativeWindow, JOGL and NEWT. Unifying our shutdown mechanism is required to provide a controlled shutdown sequence. NativeWindowFactory is chosen to be the new central entry point, since it is the lowest denominator (common module). - Move GLDrawableFactory.shutdownHook -> NativeWindowFactory.shutdownHook Reverse the shutdown dependency for clarity and availability to all modules, i.e. NEWT may not know about JOGL. Remove the 'gamma' shutdown hook, instead simply call GLDrawableFactoryImpl.resetDisplayGamma() before destroy. NativeWindowFactory.shutdownHook handles customShutdownHooks for NativeWindow, JOGL and NEWT - Modules can register their shutdown runnable at head or tail of list. - Allows controlled shutdown across all modules.
* Mitigate Bug 728: Java Web Start Shutdown: Exception ↵Sven Gothel2013-06-131-1/+9
| | | | | | | | | "java.lang.IllegalStateException: zip file closed" on OSX 10.8.3 and Java 1.7.0_17 OS version: Mac OS X 10.8.3 Java version: 1.7.0_17 Catch any occuring exception at GLDrawable shutdown, report them briefly and verbose w/ DEBUG enabled.
* Simplify GLDrawableFactory's SharedResource Query Methods; Move ↵Sven Gothel2013-04-261-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | WindowsWGLDrawableFactory Quirks to GLRendererQuirks (NeedCurrCtx4ARBPixFmtQueries, NeedCurrCtx4ARBCreateContext); Bug 706: Confine NeedCurrCtx4ARBCreateContext to [Windows, ATI, driver < 12.102.3); Avoid possible NPE @ GLContext.getGLVendorVersionNumber() - Simplify GLDrawableFactory's SharedResource Query Methods - Moving common methods to GLDrawableFactory/GLDrawableFactoryImpl while reusing common methods to SharedResourceRunner.Resource. - All factories SharedResources impl. SharedResourceRunner.Resource. - Move WindowsWGLDrawableFactory Quirks to GLRendererQuirks (NeedCurrCtx4ARBPixFmtQueries, NeedCurrCtx4ARBCreateContext) - For better maintenance, move the mentioned quirks from the windows factory to our common place, being detected within GLContextImpl after each context creation. - Bug 706: Confine NeedCurrCtx4ARBCreateContext to [Windows, ATI, driver < 12.102.3) - Before we added this quirk if [Windows, ATI], however, we have hopes that the new drivers will suffice for all as tested successful on my test machine (AMD Radeon HD 6300M Series, amd_catalyst_13.5_mobility_beta2). - Avoid possible NPE @ GLContext.getGLVendorVersionNumber() - GLContext.getGLVendorVersionNumber() never returns 'null' but a zero version instance instead! - Add API doc. - Use mixed case names in GLContextImpl.setRendererQuirks(..).
* Fix Bug 720: Unify all platform specific GLContextImpl specializations; Fix ↵Sven Gothel2013-04-181-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug 719 - Windows BITMAP Offscreen Orientation is not propagated through API Fix Bug 719 - Windows BITMAP Offscreen Orientation is not propagated through API Depends on Bug 720, since cleaning up GLContextImpl* is required to move property 'GLContext.isGLOrientationFlippedVertical()' to 'GLDrawable.isGLOriented()' where it belongs! Windows BITMAP GLDrawable impl. isGLOriented() shall return false, while we keep the BITMAPINFOHEADER's height field negative to remove the need for vertical flip when used w/ AWT or Windows, .. Then property 'GLDrawable.isGLOriented()' has to be recognized throughout the utility functions, i.e. TextureData's mustFlipVertically and hence TextureIO writer. Fix Bug 720: Unify all platform specific GLContextImpl specializations GLContextImpl shall have only _one_ unique platform derivative to allow proper swapping of GLDrawables of any type via: - 'GLAutoDrawable.setContext(GLContext newCtx, boolean destroyPrevCtx)', which calls - 'GLContext.setGLDrawable(GLDrawable readWrite, boolean setWriteOnly)' Exception: External context may be specialized. All drawable specific property handling shall be provided and implemented (if possible) via GLDrawable specializations. - GLContext.isGLOrientationFlippedVertical() -> GLDrawable.isGLOriented() - PNGImage.createFromData() takes 'isGLOriented' to properly handle vertical flipping simply by line ordering - TextureIO's PNG writer passes TextureData's getMustFlipVertically() as isGLOriented to PNGImage.createFromData() - GLReadBufferUtil respects GLDrawable's isGLOriented() when creating TextureData instance. - Screenshot respects GLDrawable's isGLOriented() - Screenshot is deprecated, use GLReadBufferUtil. - Removed all PBuffer attributes, i.e. floatingPoint, RenderToTexture and RenderToTextureRectangle. - Allows removal of special pbuffer handling in GLContext* implementations. - Removed also from GLCapabilities* - Removed from deprecated GLPbuffer Impact: - Low, users who desire to render into a texture shall use our FBO GLOffscreenDrawable. - Only use case was the deprecated GLPbuffer - floating point framebuffer technology is still patented anyways :) - Removed Java2DGLContext, which was only used for OSX's GLJPanel Java2D bridge, which is no more supported anyways.
* Debug Messages: Unify getThreadName() usage and 'Catched Exception' messagesSven Gothel2013-04-101-0/+2
|
* Bug 713: Handle broken EGL setup - Catch all Exception types, not only ↵Sven Gothel2013-04-051-4/+2
| | | | | | | | | | JogampRuntimeException at *DrawableFactory* instantiation trial In case EGL is not completly installed, EGLDisplayUtil.eglGetDisplayAndInitialize(..) will throw a GLExeception which was not catched in GLDrawableFactory. The latter only catched JogampRuntimeException caused by ReflectionUtil due to n/a classes, but the actual initialization code is capable to throw others.
* Refine GL[Auto]Drawable 'realized' state in API doc, and relax it's realized ↵Sven Gothel2013-01-261-5/+9
| | | | | | | | | | | | | requirement in GL[Offscreen]AutoDrawableDelegate* Compatible w/ 'before'. TODO: Contemplate about GLDrawableFactory.createOffscreenAutoDrawable(..) whether it: - should better return an unrealized [auto]drawable - or adding another API method for such case Goal: Allow passing vector of [device/context/..] for use cases such as re-using an onscreen destructed surface and on-/offscreen hopping.
* Fix Windows ANGLE Workaround Regression of commit ↵Sven Gothel2012-10-131-14/+37
| | | | | | | | | | | | | | | | 923d9dd7f1d40db72d35ca76a761ca14babf147f We are aware that Google's ANGLE (Windows EGL/ES2 impl. based on D3D) crashes using eglInitialize(..) w/ EGL_DEFAULT_DISPLAY. Commit 923d9dd7f1d40db72d35ca76a761ca14babf147f moved the EGL device initialization into the EGLDrawableFactory ctor and hence slipped out ANGLE workaround to disable it per default. - Moving property static flags from GLProfile -> GLDrawableFactory - Moving ANGLE workaround right into EGLDrawableFactory (where it belongs) - Moving optional EGL/ES disable code to GLDrawableFactory (where it belongs) Tested on Windows w/ Java-32bit and latest Chrome ANGLE DLLs
* Add GLRendererQuirks; Fix shared EGL/ES resources;Sven Gothel2012-09-201-0/+37
| | | | | | | | | | | | | | | | | | | | | | | Add GLRendererQuirks: - Contains centralized 'tagged' workarounds for GL renderer bugs (quirks) - Accessible via GLContext and GLDrawableFactory - Initialized in GLContext.setAvailability* - Simplify GLGraphicsConfigurationUtil.fixOffscreenGLCapabilities(..) & use Quirks - use quirks - instead of passing booleans for each config, pass factory & device Fix shared EGL/ES resources: - GLProfile needs to initialize EGLDrawableFactory's shared resources before desktop, so EGLDrawableFactory can use the fallback defaultDisplay & defaultSharedResource for host mapped sharedResources (hack). - If using defaultSharedResources for host mapped ones, do not go through initialization cycles - simply map (sharedResource + context). - EGLDrawableFactory: Use device's unique-key instead of connection only, since the latter causes a collision (EGL-connection == X11-connection).
* Seamless Integration of an FBObject based GLFBODrawable as ↵Sven Gothel2012-09-151-24/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GLOffscreenAutoDrawable.FBO and as an OffscreenLayerSurface's drawable (OSX) - Fix Bugs 569 and 599 Summary: ========= The new FBObject based GLFBODrawable implementation allows the seamless utilization of FBO offscreen rendering in single buffer, double buffer and MSAA mode. The GLFBODrawable uses a parent drawable based on a dummy surface to allow a GLOffscreenAutoDrawable.FBO creation or a mutable surface supporting an existing offscreen layer surface (OSX CALayer). Offscreen GLDrawable's and GLOffscreenAutoDrawable's can be selected via the GLCapabilities. If simply !onscreen is selected in the caps instance w/o enabling FBO, PBuffer or Bitmap, the factory will automatically choose regarding availability: FBO > PBuffer > Bitmap Double buffering is supported in MSAA more (intrinsic) and explicit in non MSAA. It is preferred when delivering resources (texture id's or framebuffer names) to a shared GLContext. This is demonstrated in (emulates our OSX CALayer implementation): TestFBOOffThreadSharedContextMix2DemosES2NEWT, TestFBOOnThreadSharedContext1DemoES2NEWT and with the OSX JAWT OffscreenLayerSurface itself. FBO is the preferred choice. +++ Offscreen drawables can be resized while maintaining a bound GLContext (e.g. w/ GLAutoDrawable). Previously both, drawable and context, needed to be destroyed and recreated at offscreen resize. Common implementation in GLDrawableHelper is used in the implementations (NEWT's GLWindow, AWT GLCanvas, SWT GLCanvas). +++ Tested: ======= Manually run all unit tests on: - Linux x86_64 NVidia/AMD/Mesa3d(ES) - OSX x86_64 NVidia - Windows x86_64 NVidia - Android arm Mali-400/Tegra-2 No regressions. Disclaimer: =========== This feature is committed almost in one patch. Both previous commits were introducing / fixing the capabilities behavior: 90d45928186f2be99999461cfe45f76a783cc961 9036376b7806a5fc61590bf49404eb71830de92f I have to appologize for the huge size and impact (files and platforms) of this commit however, I could not find a better way to inject this feature in one sane piece. NativeWindow Details: ===================== Complete decoupling of platform impl. detail of surfaces implementing ProxySurface. Used to generalize dummy surfaces and EGL surfaces on top of a native platform surface. - ProxySurface.UpstreamSurfaceHook -> UpstreamSurfaceHook - abstract class ProxySurface -> interface ProxySurface + ProxySurfaceImpl - Misc. implementations JOGL Details: ===================== FBOObject: API Change / Simplification & Usability - Removed reference counter to remove complexity, allow user to choose. - Add 'dispose' flag for detachColorbuffer(..), allowing to keep attachment alive - Fix equals operation of Attachment - Check pre-exising GL errors - Interface Colobuffer gets lifecycle methods - Add static factory methods to create Attachments w/o FBObject instance - Reset: - Clip min size to 1 - Keep alive samplingSink, i.e. don't issue resetMSAATexture2DSink(..). It gets called at syncFramebuffer()/use(..) later on before actual usage. This allows the consumer to utilize the GL_FRONT buffer until (e.g.) swap. - misc bugfixes GLOffscreenAutoDrawable: API Change - Reloc and interfacing - class com.jogamp.opengl.OffscreenAutoDrawable -> javax.media.opengl.* interfaces GLOffscreenAutoDrawable extends GLAutoDrawable GLOffscreenAutoDrawable.FBO extends GLOffscreenAutoDrawable, GLFBODrawable - Added general implementation and FBO specialization - Replacing GLPBuffer (deprecated) .. usable for any offscreen GLDrawable via factory GLAutoDrawable: - Add 'GLDrawable getDelegatedDrawable()' - Refine documentation of setContext(..), remove disclaimer and fixme tags GLDrawableFactory: - Refine API doc and it's selection mechanism for offscreen. - Add createOffscreenDrawable(..) - Add createOffscreenAutoDrawable(..) - Add canCreateFBO(..) - Mark createGLPbuffer(..) deprectated Mark GLPBuffer deprecated New: GLFBODrawable extends GLDrawable GLCanvas (AWT and SWT): Add offscreen resize support w/o GLContext recreation GLAutoDrawableBase .. GLWindow: - Add offscreen resize support w/o GLContext recreation - Remove double swapBuffer call - GLBase/GLContext: - Add: - boolean hasBasicFBOSupport() - boolean hasFullFBOSupport() - int getMaxRenderbufferSamples() - boolean isTextureFormatBGRA8888Available() GLContext: Fix version detection and hasGLSL() - Version detection in setGLFunctionAvailability(..) - Query GL_VERSION ASAP and parse it and compare w/ given major/minor - Use parsed version if valid and lower than given _or_ given is invalid. - Use validated version for caching (procaddr, ..), version number, etc. - Fix hasGLSL() Since 'isGL2ES2()' is true if 'isGL2()' and the latter simply alows GL 1.*, we confine the result to a GL >= 2.0 on desktops. FIXME: May consider GL 1.5 w/ extensions. - return isGL2ES2(); + return isGLES2() || + isGL3() || + isGL2() && ctxMajorVersion>1 ; GLDrawableImpl: - Add 'associateContext(GLContext, boolean)' allowing impl. to have a (weak) reference list of bound context. This is was pulled up from the OSX specific drawable impl. - swapBuffersImpl() -> swapBuffersImpl(boolean doubleBuffered) and call it regardless of single buffering. This is required to propagate this event to impl. properly, i.e. FBODrawable requires a swap notification. - Clarify 'contextMadeCurrent(..)' protocol GLDrawableHelper: - Add resize and recreate offscreen drawable util method - Simplify required init/reshape calls for GLEventListener - GLGraphicsConfigurationUtil: - fixWinAttribBitsAndHwAccel: Reflect sharede context hw-accel bits - OSX has no offscreen bitmap, use pbuffer - use proper offscreen auto selection if offscreen and no modes are set EGL Context/Drawable/DrawableFactory: Abstract native platform code out of base classes - Use EGLWrappedSurface w/ UpstreamSurfaceHook to handle upstream (X11, WGL, ..) lifecycle - in case the EGL resource is hooked up on it. Invisible dummy surfaces: All platforms - size is now reduced to 64x64 and decoupled of actual generic mutable size - fix device lifecycle, no more leaks +++ OSX ==== Enable support for GLFBODrawableImpl in offscreen CALayer mode - NSOpenGLImpl: hooks to calayer native code - calayer code: - allows pbuffer and texures (FBO) - decouple size and draw calls avoiding flickering - enable auto resize of calayer tree MacOSXCGLContext: - NSOpenGLImpl: - Fix false pbuffer 'usage', validate the pointer - If !pbuffer, copy other window mode bits of caps - MacOSXCGLGraphicsConfiguration: - Only assume pbuffer if !onscreen - Remove reference of native pixelformat pointer Native code: - use 'respondsToSelector:' query before calling 'new' methods avoiding an error message where unsuported (prev. OSX versions) - if monitor refresh-rate is queried 0, set to default 60hz - add missing NSAutoreleasePool decoration +++ Android / NEWT: =============== Issue setVisible(..) w/o wait, i.e. queue on EDT, @Android surfaceChanged() callback. Otherwise we could deadlock: setVisible(..) -> EDT -> setVisibleImpl(..) -> 'GL-display'. the latter may may cause havoc while Android-EDT is blocked [until it's return].
* Cleanup shutdown mechanism ; Fix X11/ATI SIGV at shutdown ; EGLDisplayUtil: ↵Sven Gothel2012-09-071-22/+14
| | | | | | | | | | | | | | | | | | Check for leaked display handles GLProfile / all shutdown methods: Remove ShutdownType to remove complexity (not required) Proper shutdown sequence: GLProfile - GLDrawableFactory+ - GLContext - NativeWindowFactory - [X11Util, OSXUtil, ..] GLDrawableFactory: Always keep shutdown-hook alive, required for X11Util shutdown (@ JVMShutdown only) X11Util: Shutdown - @ JVMShutdown only - If GL vendor ATI: close pending X11 display connections in proper order of creation. This finally removes the SIGV when shutting down the JVM on X11 w/ ATI driver. EGLDisplayUtil: Add shutdown, allowing to validate whether leaked EGL display handles remain.
* Fix EGLDrawableFactory ES1/ES2 detection for !pbuffer ; Misc robustness ↵Sven Gothel2012-08-211-2/+9
| | | | | | | | | | | | | | | | | | | changes for GLDrawableFactory .. - EGLDrawableFactory ES1/ES2 detection for !pbuffer - isEGLContextAvailable(..) -> mapAvailableEGLESConfig(..) - handle case where no pbuffer configuration is available (nokia n9 meego ..). in such case, assume availability if onscreen profile is avail. - EGLDrawableFactory.getOrCreateEGLSharedResource(..) - avoid double creation attempt (similar to SharedResourceRunner) - EGLGraphicsConfiguration.EGLConfig2Capabilities(..) respect EGL.EGL_CONFIG_CAVEAT's EGL.EGL_SLOW_CONFIG - if EGL.EGL_SLOW_CONFIG -> no hw accel. - Fix GLContext.getRequestMajorAndCompat(..): Proper handling of ES1 and ES2 - Add abstract GLDrawableFactory.isComplete(): Only if true use the factory for 'getFactory(..)' avoid using incomplete ones.
* NativeWindowFactory.getNativeWindowType(..): Return canonical string ↵Sven Gothel2012-08-181-7/+7
| | | | | | representation allowing proper use of ref. comparison '==', instead of 'String.equals()' Also make NativeWindowFactory's instances of nativeWindowingTypePure and nativeWindowingTypeCustom static final.
* Fix GraphicsConfigurationFactory: Map factory to device-type _and_ ↵Sven Gothel2012-07-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | capabilities-type; Add a pre-set nativeVisualID to chooseGraphicsConfiguration(..) Map factory to device-type _and_ capabilities-type: - Allows using different GraphicsConfigurationFactory implementations for different capabilities-types. Previous impl. failed to use an OpenGL agnostic CapabilitiesImmutable for 'chooseGraphicsConfiguration(..)' since only the GL aware factory was mapped. The latter failed since it expected a GLCapabilitiesImmutable. - The passed capabilities-type as well as device-type given at getFactory(..) is traversed top-to-down to find a most suitable factory: For-All devT := getTopDownDeviceTypes(deviceType) For-All capsT := getTopDownCapabilitiesTypes(capabilitiesType) f = factory.get(devT, capsT); if(f) { return f; } end end Add a pre-set nativeVisualID to chooseGraphicsConfiguration(..) - In situations where a native visualID is already chosen [by external means for example], but we still need to query a matching GraphicsConfiguration - we require to pass a non VisualIDHolder.VID_UNDEFINED nativeVisualID. We had a hack implemented before within some implementations and their static calls, however an agnostic mechanism is required to implement new NativeSurface/Window's platform agnostic. - X11GLXGraphicsConfigurationFactory: respect a pre-set xvisualID - X11GLXDrawableFactory.createProxySurfaceImpl(..) queries the given windowHandle's visualID and 'chooses' the configuration accordingly. If the visualID is undefined an exception is thrown, since window is invalid. These mechanics are implicit for Windows and OSX. Fix X11GLXGraphicsConfiguration.updateGraphicsConfiguration(): - Skip any action if a valid X11GLCapabilities is already chosen, i.e. w/ visualID. Otherwise choose a suitable configuration incl. visualID. The latter is quite impossible and invalid, since visualID must be defined at window creation time and the update method is issued with a valid window. X11 - Misc: - Added 'int jogamp.nativewindow.x11.X11Lib.GetVisualIDFromWindow(..)' - All returned visualID's are of type 'int'
* Bug 599 - FBObject / Offscreen Support - Part 1Sven Gothel2012-07-191-50/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - New FBObject implementation handling FBO and it's attachments *** API CHANGE: Util -> Core *** while it's size and sample-count can be reconfigured on the fly. - com.jogamp.opengl.util.FBObject -> com.jogamp.opengl.FBObject - agnostic to texture unit - separate attachments using OO hierarchy reflecting FBO - handling MSAA and blitting - no FBO destruction for reconfig (attach/detach) - New GLFBODrawableImpl impl. an FBObject based GLDrawable - Instantiated by a dummy native surface (onscreen and invisible) hooked up to a dummy GLDrawable, which is the delegation for context creation. - Utilizies ProxySurface.UpstreamSurfaceHook for dummy surface avoiding specialization for native platforms. - TODO: Allow to utilize common surface interface as a dummy-surface to supporting API seperation of windowing/GL. The latter allows impl. of createGLDrawable(NativeSurface) with FBO. - New OffscreenAutoDrawable (extends GLAutoDrawableDelegate) for all offscreen drawables. Shall replace GLPbuffer. - New GLCapabilities*.isFBO() / setFBO(boolean) to request FBO offscreen, similar to isPBuffer(). Rule: if both are requested, FBO shall be favored. - GLContext adds raw FBO availability query (min. FBO avail), FBObject contains fine grained queries (TODO: Move parts to GLContext for efficiency). - Add framebuffer tracking, allowing fast querying: - GLBase/GLContext: public int getBoundFramebuffer(int target); public int getDefaultDrawFramebuffer(); public int getDefaultReadFramebuffer(); - GLContextImpl public final void setBoundFramebuffer(int target, int framebufferName) .. called by GL impl bind framebuffer - GL: getDefaultDrawFramebuffer(), getDefaultReadFramebuffer() Adding default framebuffer queries being issued by GL.glBindFramebuffer(target, 0) w/ a default framebuffer, o.e. zero. This allows a transparent use of a custom FBO even in case the applications attempts to reset FBO to zero. Value flow: GL <- GLContext <- GLDrawable, - GLCapabilities handle fbo/pbuffer seperate, don't disable the other - GLContext/GL track read/write framebuffer to be queried by FBObject to determine whether to bind/unbind a framebuffer - Test cases for multiple FBO w/ and w/o MSAA Other Features: - New interface ProxySurface.UpstreamSurfaceHook, allowing to hook an upstream surface of unknown type providing lifecycle and information (size, ..) callbacks. Used for all new dummy NativeSurface impl and SWT GLCanvas. - GLContext -> GLDrawable propagation context/drawable lifecycle via ProxySurface.UpstreamSurfaceHook allowing dynamic resources to react (create, init, ..) - contextRealized() - contextMadeCurrent() - SurfaceChangeable -> MutableSurface currently only contains setting the surface handle. TODO: May need to move ProxySurface.UpstreamSurfaceHook -> MutableSurface.UpstreamSurfaceHook, allowing other impl. classes (NEWT OffscreenWindow) to utilize the new upstream hookup mechanism - will allow FBO/Dummy window to work. - SWT GLCanvas using ProxySurface.UpstreamSurfaceHook for proper size propagation. - New GLAutoDrawable::getUpstreamWidget(), allowing GLEventListener to fetch the owning Java side UI element (NEWT, SWT, AWT, ..). - GLDrawableFactory: Removed createOffscreenSurface() - unused and not GL related - EGLDrawableFactory handles device/profile avail. mapping while actually creating context/drawable. This allows us to learn whether the ES context is software/hardware as well as FBO avail. - EGLDrawable: Removed secret buckets of EGL configs :) Employ native surface (X11, WGL, ..) to EGL 'mapping' in EGLDrawableFactory utilizing new EGLUpstreamSurfaceHook (implements ProxySurface.UpstreamSurfaceHook). Other Bugs: - Add CTX_OPTION_DEBUG to ctx/extension cache key since only a debug ctx may expose the ARB debug capability. This bug caused lack of ARB/AMD debug functionality. - Fix GLProfile deadlock (debug mode, w/ EGL/ES, no X11), dump availability information _after_ lock. - ImmModeSink draw(): Use GL's glDrawElements(..), don't cast for GL2ES1. Fixes use for GL2ES2. - Fix KeyEvent.getKeyChar() comment (-> only stable for keyTyped(..)) Misc: - Refined alot of API doc - New GLExtensions holds commonly used GL extension strings, allows better referencing and usage lookup. - Move GL (interface) decl. to GLBase - GLBuffers: Cleanup API doc (format, types) - TextureIO: Add PAM and PPM static suffix identifier - GLCapabilities getNumSamples() returns 0 if sampleBuffers is disabled, this seems to be more natural. - finalized a lot
* GLContext adds FBO availability to profile mapping; Fix ↵Sven Gothel2012-07-051-0/+17
| | | | | | | | | | | | | | | | GL[Auto]Drawable/GLContext re-association (switch) incl. unit test. - GLContext adds FBO availability to profile mapping - GLContext added 'GLDrawable setGLDrawable(GLDrawable readWrite, boolean setWriteOnly)' allowing to set the write GLDrawable. This method enables switching context/drawable. Fix GL[Auto]Drawable/GLContext re-association (switch) incl. unit test Commit eed8508ae1132e5f45f788e9cb3f3d5a1050ac70 impl. of GLAutoDrawable's setContext(..) enabled proper setting of the GLAutoDrawable context incl. updating the context's drawables. Test covers: - remove/set (GLContext, GLEventListener) of GL[Auto]Drawable - switch (GLContext, GLEventListener) of 2 GLAutoDrawables
* Adapt to gluegen Properties/Security commits ↵Sven Gothel2012-03-131-2/+3
| | | | f4ac27e177f6deb444280d3b375e7d343e38bd080 and eedb4b530fb83fc59a26962bcf7847a1404092a0
* X11/GLX: Query X Server whether GLX is available (X11/SharedResourceRunner) ↵Sven Gothel2012-02-251-2/+2
| | | | | | | | | | | | ; Minor cleanups. Before gathering GLX details and actually instantiate a X11/GLX shared resource, we shall query whether GLX is actually available. Since GLX availability is being queried on the server side, more changes are required for the X11GLX* impl, eg. not using X11GLXGraphicsConfigurationFactory and fall back to X11GraphicsConfigurationFactory.
* Fix GLProfile/GLDrawableFactory bug: Recursion on default desktop device, ↵Sven Gothel2012-02-251-2/+15
| | | | | | | | | | | | | | since no profile was mapped. GLDrawableFactory*: - Initialize defaultDevice, even if impl. is not available (no GL libraries for impl.), hence - getDefaultDevice() always returns a valid device - getIsDeviceCompatible() only returns 'true' if device is supported _and_ drawable factory is functional GLProfile: - default-desktop-device becomes default-device even if the desktop-factory itself is not functional. This is due to the fact that the subsequent EGL-factory always handles desktop-devices (X11->EGL, GDI->EGL, etc).
* OpenGL ES/EGL OverhaulSven Gothel2012-02-131-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - GLProfile properly detects native EGL/ES1/ES2 on the 'desktop' device factory. This allows usage of Mesa's EGL/ES or Imageon's PVR emulation, etc. - GLProfile drops getDefaultDesktopDevice() and getDefaultEGLDevice() since both are aligned by getDefaultDevice(). - Fix GL_ARB_ES2_compatibility detection and utilize resulting isGLES2Compatible() where possible. This allows ES2 compatible desktop profiles to use core ES2 functionality (glShaderBinary() .. etc) even with a GL2ES2 desktop implementation. - EGLDrawable: If createSurface(..) fails (BAD_NATIVE_WINDOW) w/ surfaceHandle it uses windowHandle if available and differs. This allows the ANGLE impl. to work. - Properly order of EGL/ES library lookup: ES2: libGLESv2.so.2, libGLESv2.so, GLES20, GLESv2_CM EGL: libEGL.so.1, libEGL.so, EGL - *DynamicLookupHelper reference will be null if it's library is not complete (all tool libs, all glue libs and a ProcAddressFunc lookup function - if named). - Enhance GL version string (incl. ES2 compatible, hw/sw, ..) - GLBase: Fix docs and remove redundancies - Prepared (disabled) DesktopES2DynamicLibraryBundleInfo to be used for a real EGL/ES2 implementation within the desktop GL lib (AMD). Sadly it currenly crashed within eglGetDisplay(EGL_DEFAULT_DISPLAY), hence it's disabled.
* Fix GLDrawableFactory lack of GLProfile initialization in case get*Factory() ↵Sven Gothel2011-12-131-7/+3
| | | | is called 1st, add tests. Add performance numbers of init/shutdown in tests.
* Fix concurrency bug of GLProfile initialization ; Fix SharedResourceRunner ↵Sven Gothel2011-12-111-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'dead' thread (Applets) GLDrawableFactory: - clarify: public getWasSharedContextCreated(..) -> protected createSharedResource(..) - add: getSharesResourceThread() GLProfile: - proper locking of initSingletion(..) path: - Use RecursiveThreadGroupLock and add/remove GLDrawableFactory's sharesResourceThread while creating it's the sharedResource. This simplifies and fixes GLProfile's locking code. - Fix and simplify initSingleton(boolean) API doc - mark it deprecated. - Add initSingleton() for controlled initialization only, pairing w/ shutdown(..) Remove initSingleton(boolean) calls in code and test! +++ Fix SharedResourceRunner 'dead' thread (Applets) In Applets, stopping an Applet makes the browser Java plugin interrupting and killing all related threads, including our SharedResourceRunner thread. - Validate whether the shared resource thread is alive - Catch interruption in shared resource thread and assume it's a kill signal - releaseSharedResource: clear devicesTried set
* New GLProfile.ShutdownType: SHARED_ONLY / COMPLETE - Enhance/Fix Lifecycle ↵Sven Gothel2011-12-011-6/+7
| | | | | | | | | | | | | | | | | | | | | Management - Leave Platform, .. TempJarCache untouched. - GLDrawableFactoryImpl*: Leave DynamicLibraryBundle(lib-binding) untouched, for NativeLibrary, JNILibLoaderBase (JNI libs), .. consistency. - SHARED_ONLY: shutdown shared GLDrawableFactoryImpl* resources and NativeWindowFactory - COMPLETE: additionally shutdown GLContext* Clear all cached GL/GLX proc-address and device/context mappings. - Use new "GLProfile.shutdown(GLProfile.ShutdownType.SHARED_ONLY)" in Applets - X11GLXDrawableFactory Shutdown: Uncomment close/destroy of shared resources. - JAWTWindow.destroy(): Close the delegated device. In case it's X11 this closes the exclusive opened X11 Display.
* GLDrawableFactory: Implementations lifecycle is handled via ↵Sven Gothel2011-12-011-27/+43
| | | | constructor/destroy()
* More Robust GLProfile Initialization ; Add NativeWindowFactory ShutdownSven Gothel2011-11-301-2/+1
| | | | | | | | | | | | More Robust GLProfile Initialization - Catch GLException in GLDrawableFactory getWasSharedContextCreated(device) impl., which may fail (See comment on Firefox/Chorme EGL deployed library for Windows). - If getWasSharedContextCreated(devide) fails, set respective factory availability to false, ie. hasDesktopGLFactory, hasEGLFactory, .. Add NativeWindowFactory Shutdown - Currenly a dummy entry, may evolve. X11Util shutdown is issued by respective GLDrawableFactory
* Fix GLDrawableFactory: Move 'GLContext getOrCreateSharedContext(..)' to non ↵Sven Gothel2011-11-211-16/+0
| | | | | | | | | | | | | | public class GLDrawableFactoryImpl. Michael Weber's test case (commit e7388512b69979d00e5a213a1b166a1b1726ae0c) pointed me to the flaw in GLDrawableFactory which exposed a non-public method, ie. 'getOrCreateSharedContext()'. This lead to the assumption, that the 'shared' drawable/context of the factory is multi purpose and may be used for application context sharing - which is not the case. Changed Michael's test case to use a local shared pbuffer based drawable/context and made the method non-public, where it belongs.
* JOGL: Make GLProfile shutdown()/initSingleton() functional, ie. proper ↵Sven Gothel2011-09-081-17/+15
| | | | | | | recreation of all resources - Release all GLDrawableFactory instances at shutdown, [re]create them at initialization - Release GLContext resources (availability map) as well
* Cleanup: Java Generics Use and Removed Unused MethodsSven Gothel2011-08-241-4/+4
|
* GLProfile / eager init: Use relaxed query, if context was created while ↵Sven Gothel2011-08-071-7/+5
| | | | initialize shared
* GLDrawableFactory::getFactoryImpl(): Only return the EGL factory if profile ↵Sven Gothel2011-07-311-7/+6
| | | | is native ES