summaryrefslogtreecommitdiffstats
path: root/src/demos/vertexProgRefract/VertexProgRefract.java
Commit message (Collapse)AuthorAgeFilesLines
* Removed GLU entry points for mipmapping and scaling routines taking Kenneth Russel2005-09-261-2/+2
| | | | | | | | | | primitive arrays in place of C void* arguments; now only variants are those taking Buffer, as in the rest of the API. Added new convenience routines to BufferUtils and made original copying convenience routines respect Buffer position and limits. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JSR-231@137 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Changed GLU to be a single class rather than a separate interface and Kenneth Russel2005-09-251-16/+15
| | | | | | | | | | | | | | | | | | | implementing class. Broke dependence from GLContext and GLAutoDrawable down to GLU package; removed getGLU()/setGLU() routines. A GLU object may now be instantiated via "new GLU()" at any point in the program. When routines on it are called which require an OpenGL context, the GLU implementation fetches the current GLContext and the GL object from within it to do its work via the new public API GLU.getCurrentGL(). This avoids needing to pass down a GL object everywhere or to tie the GLU object to a particular GL object. Restructured GLUT implementation similarly so GL and GLU objects do not need to be passed to it as arguments any more. Restructured all demos to conform to new APIs. Fixed bugs in GlueGen around new functionality of being able to emit only an implementing class with no associated interface. Deleted obsolete GLU-related .cfg files. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JSR-231@135 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Moved GLU-related classes into javax.media.opengl.glu package. Still Kenneth Russel2005-09-111-0/+1
| | | | | | | | | | | | | | | need to break dependence from GLContext / GLAutoDrawable classes' getGLU() method down into this new package; should make GLU a class rather than an interface and probably make it instantiatable with a target GL object in the constructor. Should also make GLU and GLUT interfaces look similar (i.e., probably accept GL and GLU objects in constructor of GLUT rather than taking them as arguments on each method call). Ignored GLUnurbs data type from glue code generation. Updated demos for new location of GLU. Fixed broken package of Version class. Minor javadoc cleanups. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JSR-231@129 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Initial integration of JOGL with the Java2D OpenGL pipeline in the Sun JDK. Kenneth Russel2005-09-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GLJPanel has a new rendering path which captures the Java2D back buffer via GLDrawableFactory.createExternalGLDrawable()/createExternalGLContext() and creates a new context on it for performing JOGL rendering. The new path is enabled by default in Mustang build 51 and later when the Java2D/OpenGL pipeline is turned on via -Dsun.java2d.opengl=true, and yields huge speedups relative to the previous pbuffer-based GLJPanel implementation. GLJPanel in the new configuration is nearly as fast as the GLCanvas, and still provides 100% correct Swing integration. No public API changes were required to JOGL in order to implement this integration with one exception in GLJPanel.isOGLPipelineEnabled(): see below. Issues still remain, such as the desire to run all (not just some) OpenGL work on the Java2D-internal Queue Flusher Thread to maintain single-threaded behavior of the library. Currently GLCanvas's OpenGL work is run on the EDT while GLJPanel's and GLPbuffer's OpenGL work is run on the QFT. Significant restructuring to the GLCanvas will be required to achieve this goal. There is some lag of mouse events with demos which are more expensive to render which needs to be investigated. It will not be possible to implement calling of display() on other non-pbuffer GLAutoDrawables from within the GLEventListener's display() callback in this model. There are other issues as well. GLJPanel falls back to using a pbuffer internally when the Java2D back buffer's pixel format is not suitable for rendering the JOGL demos (for example, the InfiniteShadowVolumes demo, which requires stencil bits). Added GLJPanel.isOGLPipelineEnabled() which applications can use to decide whether to clear the color buffer or leave prior Java2D rendering results in place for non-opaque GLJPanels. The JGears demo has been modified to query that flag to maintain the gradient behind it while rendering the gears directly into the Java2D back buffer. GLCanvas uses the pixel format specified by Java2D if one is already set. It turns out that when the Java2D OpenGL pipeline is enabled, one is always set by default even though no Java2D rendering is performed into it, because the AWT clears the background of Canvases by default in certain situations. This can be disabled (only globally, unfortunately) by specifying -Dsun.awt.noerasebackground=true. Fixed issues with HDR and HWShadowmapsSimple demos where they needed to pay attention to the x and y coordinates passed down in the reshape callback in order to set up the correct OpenGL viewport. Fixed minor shutdown-related issues with demos using gleem's ManipManager. Tested (on NVidia hardware only so far) on Windows and X11 platforms with Mustang build 51. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JSR-231@125 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Refactored demos to mostly subclass common Demo superclass providing Kenneth Russel2005-09-091-11/+14
| | | | | | | | | | | | | shutdown capabilities. Moved DemoListener to demos.common package. Added ManipManager removal code to demos using manipulators or ExaminerViewer to fix memory leak when run in JRefract harness. Added workaround for another seeming memory leak when run under current JDK 1.6 due to java.awt.Component now being finalizable and keeping data alive longer than previously. Made ManipManager.unregisterWindow more lenient with respect to null or invalid arguments. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JSR-231@122 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Added Vertex Buffer Object and Pixel Buffer Object variants of Kenneth Russel2005-09-031-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | routines affected by these extensions. New variants take long as argument instead of Buffer for void*. For these routines as well as the original versions, must check whether VBO/PBO is active or inactive. Added check to affected methods to guarantee they are not called within glBegin/glEnd pairs (which in most, if not all, cases is already a requirement) to avoid tracking OpenGL state manually. Added new JavaPrologue and JavaEpilogue commands to JavaConfiguration with optional signatures to differentiate overloaded methods. Added BufferObjectKind command to GLConfiguration which builds on JavaPrologue support. Deleted BufferUtils.bufferOffset() and associated native code. In order to reduce the number of extension routines, added IgnoreExtension directives for all extensions folded into OpenGL 1.1, 1.2 and 1.3 specifications; this means that if the core OpenGL version is less than 1.3 then these extensions are effectively unavailable. Updated demos for both new VBO/PBO API variants as well as extensions folded into core. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JSR-231@120 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Renamed all files to intended destination packages for JSR-231. The Kenneth Russel2005-08-301-2/+3
| | | | | | | | | | | only package specified by the JSR is "javax.media.opengl". The utility package com.sun.opengl.utils is Sun-specific and optional. The Cg binding has been moved into com.sun.opengl.cg. Moved Animator and FPSAnimator to com.sun.opengl.utils. Updated and tested demos with new source code locations. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JSR-231@118 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Restructured generation of MethodBindings and emitters to more closely Kenneth Russel2005-08-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | match desired new code generation style of mapping void* to Buffer and to support non-direct Buffers. Removed expansion of void* to multiple primitive array types. Primitive-type C pointers (such as int*) are now exposed as IntBuffer and (optionally) int[], if NioDirectOnly has not been specified. The int[] variant is a simple wrapper around the indirect buffer implementation. If desired, expansion of void* to other array types could be layered on this new support. Rewrote and simplified expandMethodBinding and split up creation of emitters into generatePublicEmitters and generatePrivateEmitters. Deleted JavaMethodBindingImplEmitter and CMethodBindingImplEmitter and folded their functionality into their superclasses, controlled under flags, which makes it more straightforward to tweak a given emitter to produce correct glue code. Restructured OpenGL-specific JavaGLPAWrapperEmitter and CGLPAWrapperEmitter and how they are created by the GLEmitter; these classes are now much simpler than before. Changed how data types are passed from MethodBindings to Emitters. Generally only two MethodBindings will be created, one which maps types like int* to IntBuffer and one which maps it to int[]. The version taking Buffers will be the only one for which glue code will be generated; the one taking int[] will call the native code for the indirect buffer case for the one taking Buffers. Compound types (representing C structs) and compound type arrays (represending arrays of C structs) are no longer mapped to NIO ByteBuffers and arrays of NIO ByteBuffers by the MethodBinding; erasure and lowering of types is now handled by the Emitters, to preserve more type information during the code generation process. It is unclear whether this is in the end a simplification or just pushing code around, but it does help reduce confusion over the number of MethodBindings floating around in the system and what purpose they served. Restructured cure JOGL code and demos to work with new APIs, in particular new glTexImage*D, glDrawElements, and glReadPixels Buffer arguments. Fixed performance problem in new Animator which occurred with VertexArrayRange demo. Added new gluPickMatrix entry point to be able to implement NIO variant in generated signatures. Some further simplifications of the new code may be possible (i.e., some new flags in JavaMethodBindingEmitter and MethodBinding removed) and it is possible more unused code remains to be deleted. As it stands the new GL.java is significantly smaller than before, as all of the expansions of void* to primitive arrays are gone, several areas of GlueGen are easier to understand, and while some functionality has been lost, the autogenerated APIs are basically in the final form specified by JSR-231. Tested with the JOGL demos on Windows and Linux. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JSR-231@116 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Refactored nearly all demos as GLEventListeners and imported most into Kenneth Russel2005-08-061-1/+2
| | | | | | | JRefract framework. Deleted duplicate Gears code in fullscreen demos. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JSR-231@107 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Refactored Gears, VertexProgRefract and Water demos to be more Kenneth Russel2005-08-051-440/+446
| | | | | | | | modular. Started rewriting other demos like JGears and JRefract in terms of others to share more code. Added Water demo to JRefract demo. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JSR-231@106 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Further context-related changes for the JSR-231 API. The GLContext Kenneth Russel2005-07-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | implementations on all platforms have been split into orthogonal GLDrawable and GLContext concepts. It is now possible to create more than one GLContet per GLDrawable (though this has not been tested yet). GLCanvas has been reimplemented in terms of GLDrawableFactory.getGLDrawable(). More functionality has been moved from GLDrawable to GLAutoDrawable. Reimplemented lazy sending of reshape GLEventListener events in GLCanvas and GLJPanel and deleted notion of deferred reshapes from GLDrawableHelper and elsewhere. Sharing of textures and display lists is now expressed in terms of GLContexts instead of GLDrawables. Still need to move pbuffer creation into GLDrawableFactory from the onscreen GLContext implementations. Added option to gleem ExaminerViewer to disable automatic redraws upon mouse events and respecified more of gleem to work on GLAutoDrawables rather than GLDrawables. Updated all JOGL demos to work with new APIs and slightly different initialization sequences (in particular, for pbuffers -- this will change with the addition of GLDrawableFactory.createGLPbuffer()). git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JSR-231@103 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Initial set of context-related changes for the JSR-231 API. GLContext Kenneth Russel2005-07-101-4/+4
| | | | | | | | | | | | | | | has been exposed in the public API. The GLEventListener callback mechanism has been removed from the core GLContext implementation and moved up to a higher level. GLAutoDrawable now contains the GLEventListener-related methods, and the GLEventListener's methods now receive a GLAutoDrawable as argument. All JOGL demos have been updated for the new APIs. Many FIXMEs and much unimplemented functionality remain. There is slightly different initialization behavior for the demos containing pbuffers, and the deferring of reshape callbacks needs to be rethought. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JSR-231@100 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Fixed Windows port after changes to GlueGen to include array offsets. Kenneth Russel2005-07-081-6/+6
| | | | | | | | | | | Ported all demos to new API. Temporarily added back in GLU entry points taking primitive arrays as the underlying APIs (in particular, glTexImage2D) do not yet support non-direct Buffers. Changed C code generation to only add in array offset if array is non-null. Fixed bug in GLU tesselator demo's vertex callback. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JSR-231@99 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Merged with main trunk (tag JOGL_PRE_1_1_1)Kenneth Russel2005-07-071-16/+14
| | | | git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JSR-231@98 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Took out debugging code from VertexProgRefract demoKenneth Russel2005-02-221-16/+1
| | | | git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@57 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Fixed problem in demos introduced in 1.1 b08 where windowClosing Kenneth Russel2005-02-141-2/+9
| | | | | | | events were not properly waiting for the Animator to stop. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@55 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Added JRefract demo to jogl-demos web pageKenneth Russel2005-02-071-1/+17
| | | | git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@48 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Ported VertexProgRefract demo to ARB_fragment_program from NV_register_combinersKenneth Russel2004-11-081-5/+75
| | | | git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@40 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Worked around 4764639/4892246Kenneth Russel2003-07-171-1/+2
| | | | git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@15 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Fixed bug in Animator where it would hang upon stopping if exceptionKenneth Russel2003-07-151-2/+10
| | | | | | | | | was thrown during init(). Fixed build.xml files to get javac to produce source file and line number information. Fixed demos to pop up a dialog box if an extension they need is unsupported. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@12 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Ported vertexProgRefract from NV_vertex_program to ARB_vertex_programKenneth Russel2003-06-261-89/+122
| | | | | | | | so it will work on NVidia hardware on Mac OS X. Added small workaround for driver bug on OS X. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@4 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
* Split up net.java.games.util; moved GLUT and BufferUtils intoKenneth Russel2003-06-251-0/+628
net.java.games.jogl.util, and moved demo-specific utility classes into jogl-demos project under demos.util. Added nearly all JavaOne demos into jogl-demos project; rewrote where necessary to use ClassLoader.getResourceAsStream() instead of flat files, put into packages and added to Makefile. Added gleem to jogl-demos project. Added jogl.jar build rule. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@3 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4