summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp
Commit message (Collapse)AuthorAgeFilesLines
* Frustum: Passing Mv*P (column major order)Sven Gothel2012-11-112-34/+34
|
* PMVMatrix: Add 'Frustum glGetFrustum()' adding same dirty/request ↵Sven Gothel2012-11-111-58/+81
| | | | | | | | | methodology as for Mvi and Mvit Allows user to derive Frustum from updated P + MV Clarify method name for clearing all update request: - disableMviMvitUpdate() -> clearAllUpdateRequests()
* Frustum: Simpler usage (ctor, update) no need for explicit compute() method. ↵Sven Gothel2012-11-111-102/+143
| | | | Don't store passing PMV reference. isInside() -> isOutside()
* AABBox: Add public direct setSize(..), skipping redundant reset() / resize(..)Sven Gothel2012-11-111-18/+31
|
* Cleanup Frustum Math Util: Independent / Compile Clean / Relocation ; ↵Sven Gothel2012-11-113-191/+194
| | | | | | | | | | | | PMVMatrix: Add getPreMultipliedPMV(..) - Independent / Compile Clean - Remove OpenMALI dependencies - Use basic float[] type and FloatUtil - Use AABBox - FIXME: May need BBox (no axis alignment ?!) - Relocation - Move to com.jogamp.opengl.math.geom (see commit 5fafc1ac360333645b807dcd8dff0c0a655ea439)
* Reorganize math code into: com.jogamp.opengl.math and ↵Sven Gothel2012-11-1114-63/+241
| | | | | | | | | | | | | | | | | | | | | | | 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-33/+50
|
* Fix Bug 636: Quaternion multiplication unexpected behaviorTek2012-11-111-4/+4
|
* Adding basic Frustum utility class interfacing w/ PMVMatrix. Still depending ↵Eduard White2012-11-111-0/+191
| | | | on OpenMALI - hence broken.
* 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
* Fix GLAutoDrawable.dispose(): Dispose drawable even w/o context; ↵Sven Gothel2012-11-081-27/+31
| | | | | | | | | | | | | | | | | | | 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
* 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.
* GLAutoDrawable: Refine API change of commit ↵Sven Gothel2012-11-052-22/+25
| | | | | | | | | | c002e04f848116922a1ed7bd96ead54961649bbd As suggested by Julien Gouesse, align 'enqueue(..)' method w/ 'invoke(..)': - public void enqueue(GLRunnable glRunnable); + public boolean invoke(boolean wait, List<GLRunnable> glRunnables);
* GLDrawableUtil.swapGLContextAndAllGLEventListener(..): Add glFinish() before ↵Sven Gothel2012-11-041-17/+36
| | | | | | and after ctx/drawable swap - sync'ing GL state Otherwise a driver crash may occur on Windows/NVidia.
* FPSAnimator: Wait '2 x period' or 20ms, whichever is greater in case of ↵Sven Gothel2012-11-041-5/+7
| | | | pause/stop - taking execution frequency into account
* GLAutoDrawable: Fix GLEventListener lifecycle and expose more user control ↵Sven Gothel2012-11-042-13/+301
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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.
* Fix ProjectFloat (Bug 633): Adding missing offset of sliced buffer usage; ↵Sven Gothel2012-10-311-7/+41
| | | | | | reduce buffer usage (performance) in favor of float[]. Thomas De Bodt reported this error and provided the unit test.
* ShaderProgram: Program name is valid if non zero; Add init(GL) return value ↵Sven Gothel2012-10-311-14/+23
| | | | for success.
* GLRendererQuirks.RequiresBoundVAO: Removed, it _is_ in the GL 3.2 core spec ↵Sven Gothel2012-10-291-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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. +++
* FixedFuncPipeline: Use proper shader version and make GLSL code compatible ↵Sven Gothel2012-10-291-0/+1
| | | | w/ higher GLSL versions
* GLRendererQuirks: Add RequiresBoundVAO (w/ impl.), GLSLBuggyDiscard (todo) ; ↵Sven Gothel2012-10-281-2/+9
| | | | | | | | | | | | | | | | 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.
* Minor edits FBObject/GearsObjectSven Gothel2012-10-281-1/+1
|
* ShaderCode: Add defaultShaderCustomization(..) to prelude shader source w/ ↵Sven Gothel2012-10-262-4/+35
| | | | GLSL version and default precision (if GLES) - Used by GearsES2/RedSquare/PointDemo (Made GLSL version proof)
* Fix Bug 630: packedDepthStencilAvail didn't check for ↵Sven Gothel2012-10-241-1/+3
| | | | EXT_packed_depth_stencil extension
* Fix regression of commit 40d01bef2a1db44533472c37961aabbef68de644: Test for ↵Sven Gothel2012-10-231-2/+2
| | | | fourth element was invalid
* ImmModeSink: Reduce DEBUG_* print a bit (no this.toString())Sven Gothel2012-10-231-10/+11
|
* FixedFuncHook/ImmModeSink: Fix *Pointer 'normalized' parameterSven Gothel2012-10-223-14/+33
| | | | | | | | | 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.
* Fix ImmModeSink Padding: Fourth element default value (vertex/color) is 1fSven Gothel2012-10-201-33/+47
|
* Add GenericGLCapabilitiesChooser: Dropping 'windowSystemRecommendedChoice' hintSven Gothel2012-10-191-0/+48
|
* ImmModeSink: Pretty'fying Ctor/Factory methods argument listSven Gothel2012-10-181-16/+21
|
* ImmModeSink: Add resizeElementCount, allowing user to set a lower additional ↵Sven Gothel2012-10-181-2/+20
| | | | resize element count
* ImmModeSink VBO: Update single buffers (vertex, color, ..) if once written ↵Sven Gothel2012-10-181-26/+58
| | | | | | | | and size gross-net > PAGE_SIZE Usually PAGE_SIZE is written within one DMA xfer command, so if the gross buffer bulk transfer contains more unused data than PAGE_SIZE we may win when transfering each single buffer at buffer update.
* ImmModeSink: Add glColor3ub(), glColor4ub(); Add proper value conversion of ↵Sven Gothel2012-10-182-103/+174
| | | | imm. gl* functions; Default color padding is 1f; Make fields private.
* Merge remote-tracking branch 'hharrison/master'Sven Gothel2012-10-161-1/+1
|\
| * jogl: fix bit shift error in LEDataInputStreamHarvey Harrison2012-10-151-1/+1
| | | | | | | | | | | | | | | | The readlong() method is attempting to build a 64bit value from two 32 bit reads. The problem is that shifting an int only uses the lower 5 bits of the shift value, so << 32 is the same as << 0. Cast to long and restore the original intention. Signed-off-by: Harvey Harrison <[email protected]>
* | ImmModeSink: Fix buffer grow (+1 element @ named buffer), enable DEBUG_* via ↵Sven Gothel2012-10-161-52/+68
|/ | | | properties, drawIndices QUAD w/ proper range and add uint; FixedFunctionHook: drawIndices QUAD w/ proper range and add uint
* FixedFuncPipeline: Optimize shader resource, if preset != ↵Sven Gothel2012-10-131-4/+8
| | | | ShaderSelectionMode.AUTO (good for mobile); Lazy shader instantiation.
* FBO ResetQuirk: Dump only brief information (OS, GL, JOGL sha1), the latter ↵Sven Gothel2012-10-131-0/+17
| | | | becomes public method to JoglVersion
* FixedFuncHook: Add ES2 alignment of certain GL functions, i.e. ↵Sven Gothel2012-10-121-2/+2
| | | | GL_QUAD_STRIP/GL_POLYGON/GL_QUADS mapping, glTexImage2D internalformat/format match.
* GLArrayDataClient.bindBuffer(gl, bind=true): checkSeal and init_vbo if ↵Sven Gothel2012-10-121-0/+5
| | | | required (similar sanity checks as enableBuffer())
* GLArrayData* VBO binding: Properly document and impl. bindBuffer(..) in ↵Sven Gothel2012-10-122-14/+42
| | | | | | | | | detail w/ data sync within GLArrayHandle, which also removed redundant code (VBO data sync and binding). Refines commit 8582ece7dc7f65271b3184261697a542766d9864 and f49f8e22953ed2426fd4264ee407e2dc3fc07cfc
* Enhance FixedFuncPipeline: Multi-Texture, Tex-Env, Alpha-Test, Lighting ↵Sven Gothel2012-10-123-12/+63
| | | | | | | | | (fix, incomplete still), ShaderSelectionMode, Fix default values Besides the above mentioned additional features towards completness of the FFP emu, the ShaderSelectionMode allows fixating a shader program configuration, i.e. AUTO switch (default) or choosing a static shader program to avoid heavy program switches incl. uniform/attribute updates.
* ShaderState: Clean-up debug / verbose output. attachShaderProgram(..) still ↵Sven Gothel2012-10-121-41/+70
| | | | | | | issues UseProgram is enable==true, but no program switch. More versatile toString(StringBuilder sb, boolean alsoUnlocated), by default don't dump uniforms/attributes w/o valid location.
* GLArrayData* VBO binding: Adding explicit bindBuffer(..) method, since VBO ↵Sven Gothel2012-10-122-4/+25
| | | | | | | | | is not more bound after enableBuffer(); Fix unit test (test VBO bound). Explicit bindBuffer(..) is required now, since enableBuffer() doesn't leave it bound. See fixed VBORegion* patch for use case, i.e. using a VBO index buffer for glDrawElements(). Complets commit 8582ece7dc7f65271b3184261697a542766d9864.
* Simplify GLArrayHandler and reduce VBO sideffectsSven Gothel2012-10-101-7/+1
| | | | | | | | | | VBO: Always unbind VBO ASAP after data transfer (glBufferData()) and assignment (glVertexPointer(..), glVertexAttribPointer()). It's a bug to leave it bound .. due to redundancy and other calls which could have change the VBO binding. Removed syncData(..), now it's only issued at enable and hence migrated into the enable method.
* ImmModeSink: Fix bugs (use glBufferUsage, vboUsage, GL_POLYGON, GL_QUADS) ↵Sven Gothel2012-10-102-234/+409
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and add API docs. (API Change) - Changed create*(..) factory methods (API Change) - Drop passing GL instance, not needed - allows creation of ImmModeSink as final field w/o GL context - Use 'glBufferUsage' to determine whether to use VBO or not ( 0 == glBufferUsage ) - Use glBufferUsage in glBufferData(..) call (oops) - Toggle vboUsage per object ( 0 == glBufferUsage ? nonVBO : VBO ) remove static VBO usage flag - Fix render mode - GL_POLYGON -> GL_TRIANGLE_FAN (not GL_LINES) - GL_QUADS -> Looped GL_TRIANGLE_FAN (is !GL2) in draw(..) w/ and w/o indices - Buffer usage - documented - allow creating sink w/ all components (vertices, color, normal and texCoords) bit render and grow only used parts. This allows proper usage of sink where it is not known which types are being used. - Added test case - Manually tested w/ Jake2 ES1 Jake2 uses the FFP immediate mode rendering, where we utilize this sink w/o rendering artifacts.
* GLBuffers.slice: Preserve parent buffer position/limit and the parent's ↵Sven Gothel2012-10-101-8/+19
| | | | byte-order for sliced result
* FloatUtil/PMVMatrix/GLUniformData: Move impl. of FloatBuffer matrix ↵Sven Gothel2012-10-102-53/+84
| | | | toString(..) from PMVMatrix to FloatUtil and make it more generic; GLUniformData toString() also dumps it's matrices.
* Refine GLDrawable.swapBuffer() fix (AWT/SWT GLCanvas and GLAutoDrawableBase) ↵Sven Gothel2012-10-081-1/+3
| | | | | | of commit 455fed40391afe10ce5ffb9146ca325af63b0a49 Add drawable null check before using.