aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/FBObject.java
Commit message (Collapse)AuthorAgeFilesLines
* Minor cleanup of imports, etc: FBObject, GLContext*, Texture, ..Sven Gothel2023-08-131-14/+3
| | | | TODO: Full cleanup perhaps
* Add {GL, GLContext}.getDefaultDrawBuffer() to complement getDefaultReadBuffer()Sven Gothel2023-07-151-0/+4
|
* iOS: Clean up promotion of EAGLLayer use down to FBObjectSven Gothel2019-06-241-51/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initial commit bba73bc096250a3c7fc036d84b1ea054d1b70b06 hacked its path using a context global EGLLayer instance attachement. The hack was good for the first demo, however, it forbid using other FBObjects etc on the way. Properly specifying FBObject.Attachment.StorageDefinition, allowing the user to inject code for selected FBO attachements to define their storage. This might be useful for different platforms as well - however, it is OS agnostic and instance specific now. In this sense, GLFBODrawableImpl, hosting FBObject, has a more specific instance of FBObject.Attachment.StorageDefinition for color-renderbuffer. It is passed along newly created color renderbuffer. GLDrawableFactoryImpl.createGLDrawable uses a derived interface, OnscreenFBOColorbufferStorageDefinition which is defined in IOSEAGLDrawableFactory and return by its getter. GLDrawableFactoryImpl.createGLDrawable is therefor platform agnostic again. Bottom line is, as more platforms will be added, these semi-public interfaces have to adapt to suit them all .. All this due to iOS architecture for 'onscreen rendering' using a FBO which shares its color renderbuffer storage with the EAGLLayer, associated with the UIView. A bit weird maybe in first sight, but efficient for creating cheap hardware design ;-) Only criticism here is that Apple didn't bother using EGL and an extension.
* iOS: Initial working commit supporting iOS (ipad pro 11)Sven Gothel2019-06-231-3/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | using our OpenJFK 9 x86_64 and arm64 build. Test demo class is 'com.jogamp.opengl.demos.ios.Hello', residing in the new demo folder 'src/demos/com/jogamp/opengl/demos/ios/Hello.java'. This commit does not yet include a working NEWT specialization for iOS, but it shall followup soon. Instead this commit demonstrates JOGL operating on native UIWindow, UIView and CAEAGLLayer as provided by Nativewindow's IOSUtil. Test Video https://www.youtube.com/watch?v=Z4lUQNFTGMI +++ Notable bug: The FBO used and sharing the COLORBUFFER RENDERBUFFER memory resources with CAEAGLLayer to be displayed in the UIView seemingly cannot handle GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT24 or GL_DEPTH_COMPONENT32 depth buffer - none at all (Device + Simulation). Therefor the default demo GLEventListener chosen here don't require a depth buffer ;-) This issue can hopefully be mitigated with other means than using a flat FBO sink similar to FBO multisampling.
* Bug 1135 - Cleanup: Class ownership change of static GL enumeratesSven Gothel2015-03-061-10/+10
| | | | GLBufferStateTracker now also supports GL4.GL_QUERY_BUFFER
* Bug 682 - Relocating javax.media.opengl.* -> com.jogamp.opengl.* (Part 1)Sven Gothel2015-02-021-11/+11
| | | | | | | | | 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/**
* FBObject: indentation / DEBUG output cleanupSven Gothel2015-01-231-7/+7
|
* Minor Cleanup (FBObject, GLBase)Sven Gothel2014-12-061-4/+1
| | | | | | FBObject: Remove redudant case GLBase: Add API doc reference to GLContext implementation
* Use ExceptionUtils.dumpStack(..) instead of Thread.dumpStack()Sven Gothel2014-10-261-3/+4
|
* Bug 1066: Reduce glGetError() in FBObject / GLFBODrawableImplSven Gothel2014-09-211-24/+37
| | | | | | | | | | | | | | | - GLFBODrawableImpl - cache getMaxRenderbufferSamples() result from initialize call, method checks glGetError() - FBObject - init(..): Remove one redundant checkPreGLError() - Allow reset(..) / modify-attachment-operations w/o glGetError(): - Only check error if DEBUG || GLContext.DEBUG_GL: - RenderAttachment.initialize() - TexureAttachment.initialize() - syncSamplingSink(gl)
* Bug 1073: FBObject/GLFBODrawable: Remove deprecated methodsSven Gothel2014-09-201-56/+3
| | | | | | | | | | - dual-use reset(..), use dedicated init(..) and reset(..) - GLFBODrawable.FBOMODE_USE_DEPTH: Use GLCapabilities.[get|set]DepthBits(int) Note: Applications shall use _requested_ GLCapabilities, if passing caps down to the GLFBODrawable. Otherwise (using _chosen_ caps) we may end up in requesting properties not desired, e.g. stencil bits, if driver has chosen.
* FBObject: Fix depth- and stencil bit count selection for attachRenderbuffer(..);Sven Gothel2014-09-201-38/+92
| | | | | | | | | | | | | | | - Fix depth- and stencil bit count selection for attachRenderbuffer(..) - Add generic values: DEFAULT_BITS, REQUESTED_BITS, CHOSEN_BITS, MAXIMUM_BITS - Refactor depth- and stencil bit-count -> format into own method - Allow depth- and stencil bit-count select a higher bit-count if required (fix) - GLFBODrawable.FBOMODE_USE_DEPTH is deprecated, using GLCapabilities.[get|set]DepthBits(..) - It was an oversight to introduce the bit flag in the first place, since we should have used the capabilities depth bit-count - Graph Test: GLEventListenerButton shall use requested capabilities for FBO drawable.
* FBObject: Simplify API (init/reset); Only issue automatic ↵Sven Gothel2014-09-201-169/+364
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | resetSamplingSink(..) if required; Fix resetSamplingSink(..), isBound(), .. - Simplify API (init/reset) - use new unique methods for init and reset: - void init(final GL gl, final int newWidth, final int newHeight, final int newSamples) - does not issue resetSamplingSink(..) - boolean reset(final GL gl, final int newWidth, final int newHeight, final int newSamples) - always issues resetSamplingSink(..) - deprecated dual-use (init/reset): - boolean reset(final GL gl, final int newWidth, final int newHeight) - boolean reset(final GL gl, int newWidth, int newHeight, int newSamples, final boolean resetSamplingSink) - reset(..) no more creates a dummy 'samplingSink' instance if sampling > 0, left up to resetSamplingSink(..) - Track 'modified' state of FBObject, if size, format or any attachment has been changed since last - use(..) - syncSamplingSink(..) - resetSamplingSink(..) - Only issue resetSamplingSink(..) from syncSamplingSink(..)/use(..) if 'modified == true' +++ - Fix setSamplingSink(..), i.e. samplingSink state handling: - Validated whether given samplingSink is initialized, throws Exception if not. - Fix resetSamplingSink(..) - resets the bound state, i.e. leaves it untouched - also unbinds the samplingSink - sampleSinkDepthStencilMismatch() also returns true if this.depth/stencil == null, but samplingSink is not. - Newly created colorbuffer/-texture matches exiting colorbuffer's internal-format, if exists. - Using simplified resetSizeImpl(..) for size mismatch - Simplified samplingColorSink init check - Fix isBound() was: 'bound = bound && fbName != gl.getBoundFramebuffer(GL.GL_FRAMEBUFFER)' fix: 'bound = bound && fbName == gl.getBoundFramebuffer(GL.GL_FRAMEBUFFER)' - Fix detachRenderbuffer(..) validates whether detachment was successful, similar to detachColorbuffer(..)
* FBObject.reset(..): Return true if modified, otherwise falseSven Gothel2014-09-181-13/+32
|
* FBObject Cleanup: Add comments about maxSamples > 0 implies fullFBOSupport; ↵Sven Gothel2014-08-311-14/+11
| | | | | | | | | bind(): Set dedicated read/write if fullFBOSupport - Add comments about maxSamples > 0 implies fullFBOSupport - bind(): Set dedicated read/write if fullFBOSupport as done in syncSamplingSink() and unbind()
* Bug 1037 - FBObject: Add proper attachment size validation at init, reset ↵Sven Gothel2014-07-281-13/+43
| | | | and attachColorbuffer(..) / attachRenderbuffer(..)
* Bug 1037 - FBObject/GLFBODrawable: Do not assume using a TextureAttachment ↵Sven Gothel2014-07-281-142/+255
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for a Colorbuffer, also make DEPTH optional. API Change +++ In certain cases a TextureAttachment for the FBO's color buffer is not desired, either for performance reasons where texture functionality is not required or to avoid texture restrictions like size, etc. +++ GLFBODrawable shall use TextureAttachment for the FBO's color buffer and a DEPTH buffer per default. However, the user shall be allowed to use a plain ColorAttachment (renderbuffer) and also no DEPTH buffer. +++ FBObject Details: - Colorbuffer interface exposes Attachment details like format, size, etc as well as it's implementation specifics, isTextureAttachment() and getTextureAttachment() allowing a clean cast and type query. - Allow ColorAttachment to be used for non MSAA - Make TextureAttachment optional for method 'use(GL, TextureAttachment)' - Only validate size against MAX_TEXTURESIZE if using a TextureAttachment - API Change: - rename: getColorAttachmentCount() -> getColorbufferCount() - add: getTextureAttachmentCount() - change 'TextureAttachment getSamplingSink()' -> 'Colorbuffer getSamplingSink()'
* Findbugs.minor: Fix 'array -> string', missing argumentSven Gothel2014-07-081-1/+1
|
* Code Clean-Up based on our Recommended Settings (jogamp-scripting ↵Sven Gothel2014-07-031-83/+83
| | | | | | | | | | | | | 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
* Bug 1009: Make FBObject's sampling sink format compatible w/ sampling source ↵Sven Gothel2014-05-261-17/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if possible (ES3 spec requirement) Make FBObject's sampling sink format compatible w/ sampling source if possible, i.e. for all GL profiles but ES1 and ES2. This is an ES3 spec requirement: For ES3, sampling-sink colorbuffer format must be equal w/ the sampling-source Colorbuffer. ES3 BlitFramebuffer Requirements: OpenGL ES 3.0.2 p194: 4.3.2 Copying Pixels: If SAMPLE_BUFFERS for the read framebuffer is greater than zero, no copy is performed and an INVALID_OPERATION error is generated if the formats of the read and draw framebuffers are not identical or if the source and destination rectangles are not defined with the same (X0, Y 0) and (X1, Y 1) bounds. Texture and Renderbuffer format details: ES2 Base iFormat: OpenGL ES 2.0.24 p66: 3.7.1 Texture Image Specification, Table 3.8 - ALPHA, LUMINANCE, LUMINANCE_ALPHA, RGB, RGBA ES3 Base iFormat: OpenGL ES 3.0.2 p125: 3.8.3 Texture Image Specification, Table 3.11 - ALPHA, LUMINANCE, LUMINANCE_ALPHA, RGB, RGBA DEPTH_COMPONENT, STENCIL_COMPONENT, RED, RG ES3 Required Texture and Renderbuffer iFormat: OpenGL ES 3.0.2 p126: 3.8.3 Texture Image Specification - RGBA32I, RGBA32UI, RGBA16I, RGBA16UI, RGBA8, RGBA8I, RGBA8UI, SRGB8_ALPHA8, RGB10_A2, RGB10_A2UI, RGBA4, and RGB5_A1. - RGB8 and RGB565. - RG32I, RG32UI, RG16I, RG16UI, RG8, RG8I, and RG8UI. - R32I, R32UI, R16I, R16UI, R8, R8I, and R8UI. +++ Our implementation shall attempt to use the same format for the sampling-source and -sink wherever possible, e.g. GL2ES3 (excluding ES1 and ES2)!
* Bug 801: Add MSAA_RENDERING_BIT ; VBAA: Uses GL_NEAREST (good result) ; ↵Sven Gothel2014-03-021-2/+2
| | | | Demos: Use local GLRegion for uncached text (perf.) ..
* Bug 950 - Recognize full FBO capabilities for ES 3.0 - ↵Sven Gothel2014-01-241-16/+17
| | | | | | | | [GLContext|GL].hasFullFBOSupport() == true OpenGL ES 3.0 supports full framebuffer operations, incl. multiple color-attachments and multisample. Hence [GLContext|GL].hasFullFBOSupport() shall returns true w/ a ES 3.0 context.
* jogl: add missing @Override annotationsHarvey Harrison2013-10-171-0/+4
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* jogl: remove all trailing whitespaceHarvey Harrison2013-10-171-393/+393
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* GLVersionNumber.createVendorVersion(): Only test match result and ↵Sven Gothel2013-05-311-10/+5
| | | | potentially continue matching if having a pattern-match (don't loop for-ever).
* FBObject.init() uses safe 1x1 size like reset(..) to behave equal; ↵Sven Gothel2013-04-121-5/+7
| | | | GLFBODrawableImpl.contextMadeCurrent(ctx, true): Throw exception if !initialized
* FBObject/GLFBODrawableImpl: Silence stderr if not in DEBUG mode relying on ↵Sven Gothel2013-01-261-2/+4
| | | | | | | | | | | application handling verbosity and debug output The following cases were dumping states on stderr: - FBOObject.isStatusValid() if false -> Only dumps if DEBUG - GLFBODrawableImpl.reset() if fboResetQuirk becomes true and 1st time in ClassLoader -> Only dumps if DEBUG
* FBObject, minor edit: GL2GL3.GL_MAX_COLOR_ATTACHMENTS -> ↵Sven Gothel2012-12-211-1/+2
| | | | GL2ES2.GL_MAX_COLOR_ATTACHMENTS
* Cleanup GLContext special entries: getOffscreenContextPixelDataType(), ↵Sven Gothel2012-12-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | getOffscreenContextReadBuffer(), .. ; Add GLFBODrawable API entries for multi buffering (no impl. yet); GLJPanel 1st simplification using offscreen drawable - Cleanup GLContext special entries: getOffscreenContextPixelDataType(), getOffscreenContextReadBuffer(), .. ; - add: getDefaultReadBuffer() (-> exposed via GLBase as well) - add: isGLOrientationFlippedVertical() - add: getDefaultPixelDataType() - removed impl: getOffscreenContextPixelDataType() - removed impl: getOffscreenContextReadBuffer() - removed impl: offscreenImageNeedsVerticalFlip() - Add GLFBODrawable API entries for multi buffering (no impl. yet); - TODO: Add implementation code in GLFBODrawableImpl - GLJPanel 1st simplification using FBO - Use above new GL/GLContext entries - Fix: getNativeSurface() and getHandle() - TODO: - Remove distinction of 'pbuffer' and 'software', - Use GLDrawableFactory.createOffscreenDrawable(..) - Use GL for FBO swapping
* Bug 634 - Part 1: Fix FBObject regression of commit ↵Sven Gothel2012-11-081-4/+12
| | | | | | | | | | dbc260bd2e917ee9001461749c99da0c9cbfaf9a - init(..): Query MAX_COLOR_ATTACHMENTS: Remove erroneous samplingSink null check (it's always null) - reset(..): Create & construct samplingSink if required and missing before detaching all (due to bind) - setSamplingSink(..) returns previous samplingSink
* FBObject: Rename private fields for better reading: samplesSink* -> ↵Sven Gothel2012-11-061-65/+65
| | | | samplingSink*
* Bug 634 - Part 1: FBObject, Make MSAA 'samplingSink' mutable and add ↵Sven Gothel2012-11-061-10/+33
| | | | setSamplingSink(..). Create MSAA samplingSink lazy if null.
* Minor edits FBObject/GearsObjectSven Gothel2012-10-281-1/+1
|
* Fix Bug 630: packedDepthStencilAvail didn't check for ↵Sven Gothel2012-10-241-1/+3
| | | | EXT_packed_depth_stencil extension
* Fix Bug 617 (part2): Workaround buggy GPU driver where FBO reattachment of ↵Sven Gothel2012-10-061-1/+4
| | | | | | | | | | | | | | | | | | | Colorbuffer w/ diff size leads to GL_FRAMEBUFFER_UNSUPPORTED. This occured at least on: - OS X 10.6.8 - GL_RENDERER NVIDIA GeForce 7300 GT OpenGL Engine - GL_VERSION 2.1 NVIDIA-1.6.36 Remedy is to catch the exception @ GLFBODrawableImpl.reset(..) and switch over to fallback 'reset' method: FBO reattachment -> FBO complete recreation Of course, the FBO recreation is noticable slower, but at least it seems to work on the offending system. Not tested on the offending system, but manually provoked GLException on FBOObject to trigger fallback, which is working here.
* Fix FBObject DEPTH_STENCIL renderbuffer usageSven Gothel2012-10-051-38/+46
| | | | | | If DEPTH_STENCIL was selected, recreate destroyed the common buffer when stencil was being 'reset'. To unify and simplify code, if DEPTH_STENCIL stencil == depth reference.
* FBObject/GLFBODrawable: Debug / glError detectionSven Gothel2012-10-021-8/+11
| | | | | | | - Enh. Debug output a bit - FBObject: Detect glError @ syncFramebuffer MSAA blit, throw GLException if glError to fail-fast - TODO: May add Mesa NoFBOMSAA Quirk to disable even trying it ..
* FBObject: Clarify reset(..), resetSamplingSink(..) ; Rename ↵Sven Gothel2012-09-271-23/+37
| | | | | | | | | | | syncFramebuffer(..) -> syncSamplingSink(..) - reset(..) adds a new argument, boolean resetSamplingSink, allowing to trigger a reset on the samplink sink as well. Use cases are documented. - made public: resetSamplingSink() - Rename syncFramebuffer(..) -> syncSamplingSink(..) to clarify semantics
* FBObject: Small cleanup of freeColorbufferImpl(gl, i) -> ↵Sven Gothel2012-09-211-27/+26
| | | | freeAllColorbufferImpl(gl)
* FBObject cleanup / review: strings, simplified re-attachment, removed ↵Sven Gothel2012-09-201-169/+262
| | | | | | | | | | | | redundancy, adding quirk. Strings: Cleanup status strings; More verbose TextureAttachment toString() Simplified re-attachment: Using simple switch/case block to recreate renderbuffer instead of task list (duh!) Removed redundant calls to bind(gl) Adding quirk for re-attachment: detach all 1st, then recreate. Disabled per default.
* Seamless Integration of an FBObject based GLFBODrawable as ↵Sven Gothel2012-09-151-342/+540
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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].
* Robostness FBObject / GLReadBufferUtil: Ignore pre-existing GL errors - ↵Sven Gothel2012-08-171-3/+1
| | | | | | | | | | | remove GL error checking in FBObject bind/unbind. - User GL code caused errors shall not fail impl. - FBObject bind/unbind GL error checking is almost useless due to it's simple code, would only catch user GL code errors, which should be ignored here. - MultisampleDemoES2: Only enable GL_MULTISAMPLE if available, i.e. validate passed multisample flag
* Robustness: FBObject or reset(..)Sven Gothel2012-08-171-37/+69
| | | | | | | | | | - Add property 'jogl.fbo.force.min' to simulate minimum FBO caps - Check new size in reset(..) - Ignore the status in attachColorbuffer(..), attachRenderbufferImpl(..) and attachTexture2D(..) when recreating the resources in detachAllImpl(..)/reset(..). The status is validated after recreation of all resources in detachAllImpl(..)
* Bug 599 - FBObject / Offscreen Support - Part 1Sven Gothel2012-07-191-0/+1943
- 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