summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp
Commit message (Collapse)AuthorAgeFilesLines
* Bug 642 / Refine 1ae0737f34143a5ed655bd9c4d5fe9b0437c7774: ↵Sven Gothel2012-12-221-48/+42
| | | | | | | | | | GLContextImpl.makeCurrent() - Handle !drawable.isRealized() early, don't catch 'create' Exception Catching the createImpl() exception could be confusing, since it shall succeed. Such exception is required to hint a platform bug and to debug it. Hence testing drawable.isRealized() upfront is preferrable, i.e. catching a well known case for returning CONTEXT_NOT_CURRENT.
* Fix Bug 642 TestJSplitPaneMixHwLw01AWT (AWT-GLCanvas); Robustness ↵Sven Gothel2012-12-222-23/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | GLContext/GLDrawable - Fix Bug 642 TestJSplitPaneMixHwLw01AWT On Windows platform when mixing hw/lw JSplitPanel, the GLCanvas is removed and added when splitter is moved. The lack of robustness (see below) lead to an exception. Note: Only w/ GLJPanel (no hw/lw mixing) the splitter can be moved in both direction. Only here it is guaranteed that the GL component will survive the action. - Fix AWT-GLCanvas EDT Runnable: swapBuffer().. / display(..) - Check drawable.isRealized() within the lock on the performing thread. This is not possible before issuing the EDT Runnable action since we cannot hold the lock beforehand. - Robustness GLDrawableImpl - boolean realized -> volatile boolean realized - remove 'synchronized' on isRealized() and setRealized(..) - Use dbl-checked locking on 'realized' test for swapBuffers() and setRealized(..) - Robustness GLContextImpl - Catch createImpl(..) exception and properly return CONTEXT_NOT_CURRENT
* *Drawable impl. DEBUG: Add getThreadName() to debug out.Sven Gothel2012-12-228-13/+16
|
* GLContextImpl: Make createContextARBImpl/setGLFunctionAvailability more ↵Sven Gothel2012-12-219-23/+32
| | | | robost while detecting erroneous queried GL version
* MacOSXCGLContext: Use new setLocation(gl, shader-program); Minor edits..Sven Gothel2012-12-161-1/+1
|
* GLJPanel: Impl. is GLProfile agnostic; Use ↵Sven Gothel2012-12-163-5/+208
| | | | | | | | | | | | | | GLDrawableFactory.createOffscreenDrawable(..) for common OffscreenBackend (dropping pbuffer/software); Flip FBO w/ GLSL texture renderer. - Implementation is GLProfile agnostic - Shall work on ES2, GL2, .. etc - Use GLDrawableFactory.createOffscreenDrawable(..) for common OffscreenBackend (dropping pbuffer/software) - Leave offscreen selection to common factory code, favoring FBO - Flip FBO w/ GLSL texture renderer - Faster on low CPU machines - Enabled if GL2ES2 and FBO offscreen
* GLArrayData/ImmModeSink: Remove implicit dependency on ShaderState - allow ↵Sven Gothel2012-12-164-30/+115
| | | | | | | | | | | | | | | | | | | | | | operating w/o it; ShaderState: Remove notion of GL context attachment, use pass-through or object association; GLArrayData/GLUniformData: Add basic GLSL location methods - GLArrayData/GLUniformData: Add basic GLSL location methods - GLArrayData - add: setLocation(..) for attribute location/index retrieval (post link) and binding (pre link) - GLUniformData - add: setLocation(..) for attribute location/index retrieval (post link) - GLArrayData/ImmModeSink: Remove implicit dependency on ShaderState - allow operating w/o it - GLArrayData - add: 'public void associate(Object obj, boolean enable)', allows setting ShaderState usage - ShaderState: Remove notion of GL context attachment, use pass-through or object association - ownsAttribute(..) associates the attribute w/ ShaderState - removed GL context ShaderState attachment Tested: - ImmModeSink w/ GLSL/ES2 w/ and w/o ShaderState - GLArrayData* w/ and w/o ShaderState
* Cleanup GLContext special entries: getOffscreenContextPixelDataType(), ↵Sven Gothel2012-12-1511-98/+81
| | | | | | | | | | | | | | | | | | | | | | | 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
* Fix GLDrawableHelper invokeGLImpl(..): Only attempt to release context after ↵Sven Gothel2012-12-021-25/+28
| | | | successfull claim; Also fix intendations of block.
* OSX CALayer Stencil/.. Fix: In case of FBO CALayer usage, use default ↵Sven Gothel2012-11-212-17/+27
| | | | | | | | | | caps/pixelformat w/ chosen GLProfile only Using a pixelformat w/ chosen stencil for CALayer does corrupt rendering for an unknown reason, probably due to incompatible pixelformat w/ CALayer composition. This patch simply discards any special chosen caps, while only recognizing the desired GLProfile for the FBO CALayer pixelformat.
* Added a condition to skip updateGraphicsConfigurationARB when ↵jthedering2012-11-111-1/+2
| | | | non-hardware-accelerated capabilities are requested, because only updateGraphicsConfigurationGDI provides software rendering capabilities.
* GLDrawableHelper disposeAllGLEventListener(): Don't use cached listener size ↵Sven Gothel2012-11-111-3/+2
| | | | / check size() > 0, since List can be modified by listener itself
* Reorganize math code into: com.jogamp.opengl.math and ↵Sven Gothel2012-11-1112-18/+15
| | | | | | | | | | | | | | | | | | | | | | | com.jogamp.opengl.math.geom packages Note: WIP - We may relocate / reorg math package. Public relocations: com.jogamp.opengl.util -> com.jogamp.opengl.math - FixedPoint - FloatUtil com.jogamp.graph.math -> com.jogamp.opengl.math - Quaternion - VectorUtil com.jogamp.graph.geom -> com.jogamp.opengl.math.geom - AABBox VectorUtil: Introducing Vert2fImmutable and Vert3fImmutable interfaces, allowing graph Vertex instances to be used 'graph' agnostic and to document 2d/3d use-cases.
* Merge MathFloat into FloatUtilSven Gothel2012-11-113-62/+18
|
* Fix GLAutoDrawable.dispose(): Dispose drawable even w/o context; ↵Sven Gothel2012-11-082-112/+102
| | | | | | | | | | | | | | | | | | | JAWTWindow.lockSurface(): Check AWT component's native peer - Fix GLAutoDrawable.dispose(): Dispose drawable even w/o context - It is possible to have the GLContext not being created (not made current), so drawable shall be disposed independent. - Merge Runnable 'postDisposeOnEDTAction' to dispose Runnable for clarity - GLDrawableHelper: Split disposeGL from invokeGLImpl for clarity - JAWTWindow.lockSurface(): Check AWT component's native peer - W/o a native peer (!isDisplayable()), JAWT locking cannot succeed. - On OSX OpenJDK 1.7, attempting to JAWT lock a peer-less component crashes the VM - MacOSXJAWTWindow.lockSurfaceImpl(): Remove redundant null checks
* GLFBODrawableImpl: Following suit w/ commit ↵Sven Gothel2012-11-061-1/+1
| | | | | | | b83b068c0f426f24a58e2bd9f52de9ebd0c7876d, sync GL command stream before FBO reconfig Even though we currently have no bug experienced on this, it seems to be a good idea for highly concurrently GL driver implementations.
* Fix GLDrawableHelper.recreateGLDrawable(..): Sync GL command stream before ↵Sven Gothel2012-11-061-4/+9
| | | | | | | destruction of drawable Lack of finishing the GL command stream lead to a SIGSEGV on Windows w/ Nvidia driver where probably pending GL commands were still being processed concurrently.
* GLAutoDrawable: Refine API change of commit ↵Sven Gothel2012-11-052-3/+49
| | | | | | | | | | c002e04f848116922a1ed7bd96ead54961649bbd As suggested by Julien Gouesse, align 'enqueue(..)' method w/ 'invoke(..)': - public void enqueue(GLRunnable glRunnable); + public boolean invoke(boolean wait, List<GLRunnable> glRunnables);
* GLAutoDrawable: Fix GLEventListener lifecycle and expose more user control ↵Sven Gothel2012-11-042-70/+285
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (API Change) ; Added GLDrawableUtil A GLEventListener resides in two states, initialized and uninitialized. When added to a GLAutoDrawable, it is uninitialized. A first 'display()' will issue GLEventListener's 'init(..)' which renders it initialized. This is usually accompanied by 'reshape(..)' propagating the drawable's dimension. Destruction of the GLAutoDrawable will issue GLEventListener's 'dispose(..)' which renders it uninitialized. It turns our these means of GLEventListener controls are not sufficient in case the user requires to remove and add them during the lifecycle and rendering of their GLAutoDrawable host. GLAutoDrawable 'removeGLEventListener(..)' merely removes the GLEventListener from the list, but does not complete it's lifecycle, i.e. issues 'dispose(..)' if initialized to realease GL related resources. Hence the following essential API changes are made to complete the lifecycle: + public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove); disposing a single GLEventListener, allowing it's removal from the list being optional This is demonstrated via GLDrawableUtil.swapGLContextAndAllGLEventListener(GLAutoDrawable a, GLAutoDrawable b), see below. ++++++++ Further more the following API changes were made to expose complete control of GLEventListener to the user: - public void removeGLEventListener(GLEventListener listener); + public GLEventListener removeGLEventListener(GLEventListener listener); The return value allows simple pipelining, and also delivers information whether the passed listener was actually removed. - public GLEventListener removeGLEventListener(int index) throws IndexOutOfBoundsException; + public int getGLEventListenerCount(); + public GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException; Dropping the redundant removal by index, while adding count and get methods. + public boolean getGLEventListenerInitState(GLEventListener listener); + public void setGLEventListenerInitState(GLEventListener listener, boolean initialized); Allows retrieving and setting of listener states. All in all these API changes allows a user to experience all freedoms in dealing w/ GLEventListeners hosted by GLAutoDrawable impl. and shall be future proof. Note that we have avoided the Iterator pattern due to it's overhead of temporal objects creation. The simple indexed access allows us to implement each method as an atomic operation. +++++++++++ Further more a simple enqueue(..) method has been added, allowing to just enqueue a GLRunnable w/o provoking it's execution - as invoke(..) does. This method pleases a use case where GLRunnables are batched and shall be executed later on.. public boolean invoke(boolean wait, GLRunnable glRunnable); + public void enqueue(GLRunnable glRunnable); +++++++++++ Added GLDrawableUtil, exposes utility function to rearrange GLEventListener, modifiy GLAutoDrawable, etc. GLDrawableUtil.swapGLContextAndAllGLEventListener(GLAutoDrawable a, GLAutoDrawable b) is tested and demonstrated w/ TestGLContextDrawableSwitchNEWT. Manually tested on X11, OSX and Windows.
* MacOSXCGLContext[NSOpenGLLayer/NSView]: Propagate drawable changeSven Gothel2012-11-042-22/+57
| | | | | | | Propagate drawable change to MacOSXCGLContext where either context/NSView or context/NSOpenGLLayer association needs to get updated. Fixes drawable/context switch.
* MacOSXCGLContext: Fix ShaderCode instantiation .. (duh!) ; Tested via ↵Sven Gothel2012-10-311-22/+9
| | | | reparenting TestParentingFocusTraversal01AWT
* *FontLoader: Order fields in init-order, make private.Sven Gothel2012-10-312-11/+11
|
* Fix ProjectFloat (Bug 633): Adding missing offset of sliced buffer usage; ↵Sven Gothel2012-10-311-174/+153
| | | | | | reduce buffer usage (performance) in favor of float[]. Thomas De Bodt reported this error and provided the unit test.
* Add OSX CALayer OpenGL 3 (core) support: Derive pixelformat from parent ↵Sven Gothel2012-10-313-5/+109
| | | | | | | | (GL3), use GL3.2 compatible shader; Use VBO in general. Covered by: Auto unit tests: TestOffscreenLayer01GLCanvasAWT, TestOffscreenLayer02NewtCanvasAWT Manual: TestGearsES2AWT '-gl3 -layered'
* Shader: Add '#define texture2D texture' for GLSL >= 130 ; TestGearsES2AWT ↵Sven Gothel2012-10-311-0/+1
| | | | add forceGL3; TextureDraw01ES2Listener uses defaultShaderCustomization()
* ShaderProgram: Program name is valid if non zero; Add init(GL) return value ↵Sven Gothel2012-10-312-2/+6
| | | | for success.
* Fix regression of commit e5692f615a8c40e7ca750261baf5e8ecdb0a34b8: ↵Sven Gothel2012-10-301-1/+2
| | | | CGL/CGLExt Robustness ..
* WGL/WGLExt Robustness: Use NIODirectOnly for all bindings. For these ↵Sven Gothel2012-10-305-170/+188
| | | | internal APIs, critical array is not required, hence redundant.
* CGL/CGLExt Robustness: Use NIODirectOnly for all bindings. For these ↵Sven Gothel2012-10-303-95/+96
| | | | internal APIs, critical array is not required, hence redundant.
* GLX/GLXExt Robustness: Use NIODirectOnly for all bindings. For these ↵Sven Gothel2012-10-308-159/+185
| | | | internal APIs, critical array is not required, hence redundant.
* EGL/EGLExt Robustness: Use NIODirectOnly for all bindings. For these ↵Sven Gothel2012-10-305-93/+70
| | | | internal APIs, critical array is not required, hence redundant.
* GLRendererQuirks.RequiresBoundVAO: Removed, it _is_ in the GL 3.2 core spec ↵Sven Gothel2012-10-291-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Setting up default VAO for all GL >= 3.2 core ctx. Refines commit 9b6448b1d54716fd455c0cad0c6133c0edeb3bb8 Due to GL 3.2 core spec: E.2. DEPRECATED AND REMOVED FEATURES (p 331) "There is no more default VAO buffer 0 bound, hence generating and binding one to avoid INVALID_OPERATION at VertexAttribPointer." More clear is GL 4.3 core spec: 10.4 (p 307): "An INVALID_OPERATION error is generated by any commands which modify, draw from, or query vertex array state when no vertex array is bound. This occurs in the initial GL state, and may occur as a result of BindVertexAr- ray or a side effect of DeleteVertexArrays." +++ I just have read (same spec) 2.10 (p 46/47): "An INVALID_OPERATION error is generated if any of the *Pointer commands specifying the location and organization of vertex array data are called while zero is bound to the ARRAY_BUFFER buffer object binding point, and the pointer argu- ment is not NULL." .. which only constraints the *Pointer command use to _VBO_, not forcing a VAO. +++
* GLContextImpl GLRendererQuirks.RequiresBoundVAO: Use isGL3() instead of ↵Sven Gothel2012-10-291-1/+1
| | | | simple major version number check.
* FixedFuncPipeline: Use proper shader version and make GLSL code compatible ↵Sven Gothel2012-10-297-26/+57
| | | | w/ higher GLSL versions
* Graph Shader: Using default precision values (VP: highp, FP: mediump), ↵Sven Gothel2012-10-296-9/+9
| | | | except for sampler2D (mediump instead of lowp)
* GLRendererQuirks: Add RequiresBoundVAO (w/ impl.), GLSLBuggyDiscard (todo) ; ↵Sven Gothel2012-10-281-4/+25
| | | | | | | | | | | | | | | | GLContextImpl: Bind default VAO if having quirk RequiresBoundVAO. OSX w/ OpenGL >= 3 core context implementation requires a bound VAO for vertex attribute operations, i.e. VertexAttributePointer(..). This has been experienced on OSX 10.7.5, OpenGL 3.2 core w/ Nvidia GPU and in several forum posts. Such 'behavior' violates the GL 3.2 core specification, which does not state this requirement, hence it is a bug. (Please correct me if I am wrong!) GLContextImpl works around this quirk, by generating a default VAO and binds it at 1st makeCurrent (@creation) and deletes it at destroy. This is minimal invasive since no action is required for subsequent makeCurrent or release. We assume if a user uses and binds a VAO herself, she will mind this quirk. Note: We could enhance this workaround by quering for a currently bound VAO at makeCurrent() and bind our default if none. However, we refrain from this operation to minimize the workaround and complexity.
* GLContext: Produce and expose GLSL version as VersionNumber and version ↵Sven Gothel2012-10-241-1/+17
| | | | | | | | | string (for shader programs) Uses GL_SHADING_LANGUAGE_VERSION and parses it via VersionNumber, as well as having a static fallback using the GL context version. The value is valid and can be retrieved after ctx has been made current once.
* Adapt to GlueGen change 08a8defda8b6f49eb794cf787f688ba65bfe7b37 (VersionNumber)Sven Gothel2012-10-241-13/+13
|
* FixedFuncPipeline: Require GLSL 1.20 (GL 2.1) due to GL driver bugs in OSX ↵Sven Gothel2012-10-231-3/+1
| | | | (gl_PointCoords n/a otherwise); Add FFP Emul point test in TestPointNEWT/PointDemoES1.
* FixedFuncHook/ImmModeSink: Fix *Pointer 'normalized' parameterSven Gothel2012-10-221-11/+10
| | | | | | | | | All *Pointer methods used 'normalized:=false', but we cannot assume the fixed function code does use normalized (0f..1f) values. On the contrary, it usually uses the native format value range. Hence we have to pass normalized:=true for all fixed point data types and normalized:=false for floating point data types.
* FixedFuncPipeline GL_POINTS: Fix gl_PointSize (attribute data format), Add ↵Sven Gothel2012-10-224-97/+91
| | | | | | | | | | | | | | GL_POINT_SOFT and dist/fade attenuation (Adding basic POINT unit tests) gl_PointSize (and all other uniform array elems) was not propagated due to wrong usage of GLUniformData component param. Due to efficiency, we use vec4[2] now and #defines in shader to easy readability. GL_POINT_SOFT uses gl_PointCoord to determnine inside/outside circle position while adding a seam of 10% in/out. This almost matches 'other' implementations and gives a nice smooth circle. !GL_POINT_SOFT produces a proper square (billboard). Point-Vertex shader takes dist/fade attentuation into account.
* FFP-Emu: Adding simple POINTS shader ; Adding GLRunnable2 interface, ↵Sven Gothel2012-10-204-61/+241
| | | | | | | | | | | | allowing passing a GL action w/ custom argument and return value. Adding simple POINTS shader not regarding POINTS parameters and not using a texture (commented out). FIXME: Event thought it works using a texture and gl_PointCoord in frag shader, I don't see the point here (lol) if gl_PointSize must be 1.0 in vert shader .. otherwise nothing is seen on ES2.0. On Desktop POINTS are always shown as 1 pixel sized points!
* FixedFuncPipeline: Add GL_POINT* state tracking; Fix glDrawArrays(): Issued ↵Sven Gothel2012-10-193-49/+131
| | | | | | twice (duh!) almost halfed performance :) TODO: Create GL_POINT texture and render w/ glDraw*()
* Fix commit 48bcceaf611a17bb3795aa9fe25a0e0c726879f7, EGLDrawableFactory's ↵Sven Gothel2012-10-191-1/+0
| | | | | | ES1 impl. detection 'glBegin' is not ES1, duh!
* EGLDrawableFactory: Detect ES1 implementation within ES2 library, if not ↵Sven Gothel2012-10-191-2/+16
| | | | | | found in ES1 library This is the case in BCM-VC-IV blobs, tested on Raspeberry-Pi
* FixedFuncPipeline: Don't handle CullFace, ES2 impl. already takes care of ↵Sven Gothel2012-10-185-11/+20
| | | | discarding pixels of culled faces.
* FixedFuncPipeline: Cache current ShaderSelectionMode, update PMVMatrix ↵Sven Gothel2012-10-181-12/+25
| | | | according it's usage (update Mvi/Mvit only if lighting is being used)
* FixedFuncPipeline/Hook: Add glColor4ub() w/ value conversion, make ↵Sven Gothel2012-10-182-9/+24
| | | | glColor4f() more efficient, use pre-alloc NIO buffer
* Minor NEWT Display/Screen API docSven Gothel2012-10-171-2/+2
|
* Path2D: Reuse 'contains(..)' method, footprintSven Gothel2012-10-161-6/+1
|