diff options
Diffstat (limited to 'make')
29 files changed, 4001 insertions, 208 deletions
diff --git a/make/build.xml b/make/build.xml index 5e7bd006f..7119ce631 100644 --- a/make/build.xml +++ b/make/build.xml @@ -66,6 +66,27 @@ - Base initialization and detection of operating system. --> <target name="base.init" depends="gluegen.cpptasks.detect.os"> + <condition property="isGLES"> + <or> + <isset property="jogl.es1" /> + <isset property="jogl.es2" /> + </or> + </condition> + + <!-- Also set isCDCFP for the GlueGen build.xml to keep GL + references there to a minimum --> + <condition property="isCDCFP"> + <isset property="isGLES" /> + </condition> + + <condition property="isGLES1"> + <isset property="jogl.es1" /> + </condition> + + <condition property="isGLES2"> + <isset property="jogl.es2" /> + </condition> + <!-- Set the project root directory to be up one directory. --> <property name="project.root" value=".." /> @@ -115,7 +136,27 @@ <!-- - Declare all paths and user defined variables. --> - <target name="declare.common" description="Declare properties" depends="setup.java.home.dir, gluegen.cpptasks.detect.compiler"> + <target name="declare.gl.gles1" if="isGLES1"> + <property name="gl.headers" value="${stub.includes.dir}/opengl/GLES/*.h" /> <!-- NOTE: this MUST be relative for FileSet --> <!-- CHECK: this may need to be pruned for each platform --> + <property name="java.excludes.gles" value="javax/media/opengl/AWTGraphicsConfiguration.java, javax/media/opengl/AWTGraphicsDevice.java, javax/media/opengl/ComponentEvents.java, javax/media/opengl/GLCanvas.java, javax/media/opengl/GLJPanel.java, com/sun/opengl/util/j2d/**, com/sun/opengl/util/texture/**, com/sun/opengl/util/Animator.java, com/sun/opengl/util/FPSAnimator.java, com/sun/opengl/util/*Rec.java, com/sun/opengl/util/GLUT*.java, com/sun/opengl/util/Gamma.java, com/sun/opengl/util/ImageUtil.java, com/sun/opengl/util/JOGLAppletLauncher.java, com/sun/opengl/util/Screenshot.java, com/sun/opengl/util/TGAWriter.java, com/sun/opengl/util/TileRenderer.java, com/sun/opengl/impl/GLObjectTracker.java, com/sun/opengl/impl/GLPbufferImpl.java, com/sun/opengl/impl/GLUquadricImpl.java, com/sun/opengl/impl/Java2D.java, com/sun/opengl/impl/Java2DGLContext.java, com/sun/opengl/impl/JAWT_PlatformInfo.java, com/sun/opengl/impl/Project.java, com/sun/opengl/impl/Util.java, com/sun/opengl/impl/error/**, com/sun/opengl/impl/glue/**, com/sun/opengl/impl/mipmap/**, com/sun/opengl/impl/nurbs/**, com/sun/opengl/impl/packrect/**, com/sun/opengl/impl/registry/**, com/sun/opengl/impl/tessellator/**, com/sun/opengl/impl/windows/**, com/sun/opengl/impl/x11/**, com/sun/opengl/impl/macosx/**" /> + </target> + + <target name="declare.gl.gles2" if="isGLES2"> + <property name="gl.headers" value="${stub.includes.dir}/opengl/GLES2/*.h" /> <!-- NOTE: this MUST be relative for FileSet --> <!-- CHECK: this may need to be pruned for each platform --> + <property name="java.excludes.gles" value="javax/media/opengl/AWTGraphicsConfiguration.java, javax/media/opengl/AWTGraphicsDevice.java, javax/media/opengl/ComponentEvents.java, javax/media/opengl/GLCanvas.java, javax/media/opengl/GLJPanel.java, com/sun/opengl/util/j2d/**, com/sun/opengl/util/texture/**, com/sun/opengl/util/Animator.java, com/sun/opengl/util/FPSAnimator.java, com/sun/opengl/util/*Rec.java, com/sun/opengl/util/GLUT*.java, com/sun/opengl/util/Gamma.java, com/sun/opengl/util/ImageUtil.java, com/sun/opengl/util/JOGLAppletLauncher.java, com/sun/opengl/util/Screenshot.java, com/sun/opengl/util/TGAWriter.java, com/sun/opengl/util/TileRenderer.java, com/sun/opengl/impl/GLObjectTracker.java, com/sun/opengl/impl/GLPbufferImpl.java, com/sun/opengl/impl/GLUquadricImpl.java, com/sun/opengl/impl/Java2D.java, com/sun/opengl/impl/Java2DGLContext.java, com/sun/opengl/impl/JAWT_PlatformInfo.java, com/sun/opengl/impl/Project.java, com/sun/opengl/impl/ProjectES1.java, com/sun/opengl/impl/Util.java, com/sun/opengl/impl/error/**, com/sun/opengl/impl/glue/**, com/sun/opengl/impl/mipmap/**, com/sun/opengl/impl/nurbs/**, com/sun/opengl/impl/packrect/**, com/sun/opengl/impl/registry/**, com/sun/opengl/impl/tessellator/**, com/sun/opengl/impl/windows/**, com/sun/opengl/impl/x11/**, com/sun/opengl/impl/macosx/**" /> + </target> + + <target name="declare.gl.gles" if="isGLES" depends="declare.gl.gles1, declare.gl.gles2"> + <!-- Use the CDC / FP classes only if we're building for the embedded system --> + <property name="javac.bootclasspath.jar" value="../../gluegen/make/lib/cdc_fp.jar" /> + </target> + + <target name="declare.gl.desktop" unless="isGLES"> + <property name="gl.headers" value="${stub.includes.dir}/opengl/GL/*.h" /> <!-- NOTE: this MUST be relative for FileSet --> <!-- CHECK: this may need to be pruned for each platform --> + <property name="java.excludes.gles" value="com/sun/opengl/impl/egl/**, com/sun/opengl/impl/ProjectES1.java" /> + </target> + + <target name="declare.common" description="Declare properties" depends="setup.java.home.dir, gluegen.cpptasks.detect.compiler, declare.gl.gles, declare.gl.desktop"> <!-- The location and name of the configuration ANT file that will - validate to ensure that all user-define variables are set. --> <property name="validate.user.properties" value="${make}/validate-properties.xml" /> @@ -230,12 +271,13 @@ <property name="java.lib.dir.solaris" value="${java.home.dir}/jre/lib/${cpu}" /> <property name="java.lib.dir.macosx" value="/System/Library/Frameworks/JavaVM.framework/Libraries" /> - <property name="gl.headers" value="${stub.includes.dir}/opengl/**/*.h" /> <!-- NOTE: this MUST be relative for FileSet --> <!-- CHECK: this may need to be pruned for each platform --> <!-- Java files to exclude based on platform (relative to "src.java") --> - <property name="java.excludes.win32" value="com/sun/opengl/impl/x11/**, com/sun/opengl/impl/macosx/**" /> - <property name="java.excludes.x11" value="com/sun/opengl/impl/windows/**, com/sun/opengl/impl/macosx/**" /> - <property name="java.excludes.macosx" value="com/sun/opengl/impl/x11/**, com/sun/opengl/impl/windows/**" /> + <!-- NOTE: the OpenGL ES exclusions are due to references to unsupported APIs --> + <property name="java.excludes.win32.gles" value="com/sun/opengl/impl/windows/*.java" /> + <property name="java.excludes.win32" value="com/sun/opengl/impl/x11/**, com/sun/opengl/impl/macosx/**, ${java.excludes.gles}, ${java.excludes.win32.gles}" /> + <property name="java.excludes.x11" value="com/sun/opengl/impl/windows/**, com/sun/opengl/impl/macosx/**, ${java.excludes.gles}" /> + <property name="java.excludes.macosx" value="com/sun/opengl/impl/x11/**, com/sun/opengl/impl/windows/**, ${java.excludes.gles}" /> <!-- Create the classpath that includes GlueGen and - ANTLR. This requires the user-defined "antlr.jar" @@ -306,12 +348,29 @@ <property name="linker.cfg.id.core" value="linker.cfg.win32.mingw.jogl" /> </target> - <target name="declare.win32" depends="declare.win32.vc6,declare.win32.vc7,declare.win32.vc8,declare.win32.vc8_x64,declare.win32.mingw" if="isWindows"> - <!-- Set platform configuration files. --> + <target name="declare.win32.gles1" if="isGLES1"> + <property name="gl.cfg" value="${config}/gl-es1.cfg" /> + <property name="gl.c" value="${stub.includes.common}/gles1.c" /> + <property name="glu.cfg" value="${config}/glu-es1.cfg" /> + </target> + + <target name="declare.win32.gles2" if="isGLES2"> + <property name="gl.cfg" value="${config}/gl-es2.cfg" /> + <property name="gl.c" value="${stub.includes.common}/gles2.c" /> + </target> + + <target name="declare.win32.gles" depends="declare.win32.gles1, declare.win32.gles2" /> + + <target name="declare.win32.desktop" unless="isGLES"> <property name="gl.cfg" value="${config}/gl-win32.cfg" /> + <property name="gl.c" value="${stub.includes.common}/gl.c" /> + <property name="glu.cfg" value="${config}/glu-win32.cfg" /> + </target> + + <target name="declare.win32" depends="declare.win32.vc6,declare.win32.vc7,declare.win32.vc8,declare.win32.vc8_x64,declare.win32.mingw,declare.win32.gles,declare.win32.desktop" if="isWindows"> + <!-- Set platform configuration files. --> <property name="gl.cfg.nsig" value="${config}/gl-win32-nsig.cfg" /> <property name="glext.platform.cfg" value="${config}/wglext.cfg" /> - <property name="glu.cfg" value="${config}/glu-win32.cfg" /> <property name="jawt.cfg" value="${config}/jawt-win32.cfg" /> <property name="window.cfg" value="${config}/wingdi-win32.cfg" /> @@ -488,6 +547,7 @@ <propertyset> <propertyref name="antlr.jar" /> <propertyref name="gluegen.nsig" /> + <propertyref name="isCDCFP" /> </propertyset> </ant> </target> @@ -520,7 +580,7 @@ <target name="java.generate.gl" unless="gluegen.nsig"> <!-- Generate GL interface and implementation --> <echo message="Generating GL interface and implementation" /> - <gluegen src="${stub.includes.common}/gl.c" + <gluegen src="${gl.c}" config="${gl.cfg}" includeRefid="stub.includes.fileset.all" emitter="com.sun.gluegen.opengl.GLEmitter"> @@ -531,7 +591,7 @@ <target name="java.generate.gl.nsig" if="gluegen.nsig"> <!-- Generate GL interface and implementation --> <echo message="Generating GL interface and implementation" /> - <gluegen src="${stub.includes.common}/gl.c" + <gluegen src="${gl.c}" config="${gl.cfg.nsig}" includeRefid="stub.includes.fileset.all" emitter="com.sun.gluegen.nativesig.NativeSignatureEmitter"> @@ -539,25 +599,18 @@ </gluegen> </target> - <!-- - - Setup the generating ANT tasks and use it to generate the Java files - - from the C GL headers. This involves setting the taskdef and creating - - the classpath reference id then running the task on each header. - --> - <target name="java.generate" depends="build.gluegen, java.generate.check" unless="java.generate.skip"> - <!-- Add the GlueGen and BuildStaticGLInfo tasks to ANT --> - <taskdef name="gluegen" classname="com.sun.gluegen.ant.GlueGenTask" - classpathref="gluegen.classpath" /> - <taskdef name="staticglgen" classname="com.sun.gluegen.ant.StaticGLGenTask" - classpathref="gluegen.classpath" /> - - <!-- Use the GlueGen and BuildStaticGLInfo tasks to generate the - - Java files --> + <target name="java.generate.glu" unless="isGLES2"> + <echo message="Generating GLU class" /> + <gluegen src="${stub.includes.common}/glu.c" + config="${glu.cfg}" + includeRefid="stub.includes.fileset.all" + emitter="com.sun.gluegen.opengl.GLEmitter"> + <classpath refid="gluegen.classpath" /> + </gluegen> + </target> - <!-- Generate GL interface and implementation --> - <antcall target="java.generate.gl" inheritRefs="true" /> - <antcall target="java.generate.gl.nsig" inheritRefs="true" /> + <target name="java.generate.platform.glext" unless="isGLES"> <!-- Generate platform-specific extension class (WGLExt, GLXExt, etc.) --> <echo message="Generating platform-specific OpenGL extension class" /> <gluegen src="${glext.platform.header}" @@ -566,7 +619,9 @@ emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> + </target> + <target name="java.generate.window.system" unless="isGLES"> <!-- Generate WGL/GLX/CGL implementation class --> <echo message="Generating WGL/GLX/CGL implementation class" /> <dirset id="stub.includes.fileset.platform" dir="." includes="${stub.includes.fileset.platform.params}" /> @@ -576,8 +631,9 @@ emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> + </target> - <!-- Generate JAWT class --> + <target name="java.generate.jawt" unless="isGLES"> <!-- NOTE: the "literalInclude" in this GlueGen call is simply to - get around the fact that neither FileSet nor DirSet can - handle different drives in an effective manner. --> @@ -590,6 +646,35 @@ emitter="com.sun.gluegen.JavaEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> + </target> + + <!-- + - Setup the generating ANT tasks and use it to generate the Java files + - from the C GL headers. This involves setting the taskdef and creating + - the classpath reference id then running the task on each header. + --> + <target name="java.generate" depends="build.gluegen, java.generate.check" unless="java.generate.skip"> + <!-- Add the GlueGen and BuildStaticGLInfo tasks to ANT --> + <taskdef name="gluegen" classname="com.sun.gluegen.ant.GlueGenTask" + classpathref="gluegen.classpath" /> + <taskdef name="staticglgen" classname="com.sun.gluegen.ant.StaticGLGenTask" + classpathref="gluegen.classpath" /> + + <!-- Use the GlueGen and BuildStaticGLInfo tasks to generate the + - Java files --> + + <!-- Generate GL interface and implementation --> + <antcall target="java.generate.gl" inheritRefs="true" /> + <antcall target="java.generate.gl.nsig" inheritRefs="true" /> + + <!-- Generate platform-specific extension class (WGLExt, GLXExt, etc.) --> + <antcall target="java.generate.platform.glext" inheritRefs="true" /> + + <!-- Generate WGL/GLX/CGL implementation class --> + <antcall target="java.generate.window.system" inheritRefs="true" /> + + <!-- Generate JAWT class --> + <antcall target="java.generate.jawt" inheritRefs="true" /> <!-- Generate StaticGLInfo class --> <echo message="Generating StaticGLInfo class" /> @@ -599,14 +684,11 @@ <classpath refid="gluegen.classpath" /> </staticglgen> - <!-- Generate GLU class --> - <echo message="Generating GLU class" /> - <gluegen src="${stub.includes.common}/glu.c" - config="${glu.cfg}" - includeRefid="stub.includes.fileset.all" - emitter="com.sun.gluegen.opengl.GLEmitter"> - <classpath refid="gluegen.classpath" /> - </gluegen> + <!-- Generate GLU class --> + <!-- NOTE: massively stripped down for embedded OpenGL + because the implementation uses immediate mode calls not + available on GLES1 or GLES2 --> + <antcall target="java.generate.glu" inheritrefs="true" /> <!-- Inform the user that the generators have successfully created - the necessary Java files --> @@ -704,6 +786,7 @@ excludes="${java.excludes.platform}" source="${jogl.sourcelevel}" classpath="${gluegen-rt.jar}" + bootclasspath="${javac.bootclasspath.jar}" fork="yes" memoryMaximumSize="128m" debug="true" debuglevel="source,lines"> @@ -770,6 +853,8 @@ <linker id="linker.cfg.win32.msvc.jogl" extends="linker.cfg.win32.msvc"> <syslibset libs="opengl32, gdi32, user32, kernel32" /> <syslibset dir="${windows.cg.lib}" libs="cg, cgGL" if="c.compiler.use-cglib"/> + <!-- This is temporary --> + <syslibset libs="winmm" /> </linker> <linker id="linker.cfg.macosx.jogl" extends="linker.cfg.macosx"> @@ -789,7 +874,9 @@ <patternset id="c.src.files.jogl"> <include name="${rootrel.src.c.jogl}/InternalBufferUtils.c"/> <include name="${rootrel.src.c.jogl}/*.m" if="isOSX"/> - <include name="${rootrel.generated.c.jogl}/*GL*.c"/> + <!-- FIXME: the Mixer should be moved to another library --> + <include name="${rootrel.src.c.jogl}/Mixer.cpp" if="isWindows"/> + <include name="${rootrel.generated.c.jogl}/*GL*.c" unless="jogl.noglnatives"/> <include name="${rootrel.src.c.jogl}/XineramaHelper.c" if="isX11"/> <!-- Xinerama supporting functions for Linux only (for now) --> <!-- Also supported on Solaris, but works differently --> @@ -853,6 +940,10 @@ <sysincludepath path="${java.includes.dir.platform}"/> <includepath path="stub_includes/opengl"/> <includepath path="stub_includes/cg" if="c.compiler.use-cglib"/> + + <!-- This is for the generated headers for handwritten C code --> + <includepath path="${src.generated.c}" /> + <!-- This must come last to not override real include paths --> <!-- includepath path="stub_includes/macosx" if="isOSX" / --> </compiler> @@ -896,6 +987,14 @@ </target> <target name="c.build.jogl.core"> + <!-- Generate the EGLDrawableFactory header --> + <!-- FIXME: this is temporary until we fully autogenerate the EGL interface --> + <javah destdir="../build/gensrc/native/jogl" classpath="${jogl.jar}" class="com.sun.opengl.impl.egl.EGLDrawableFactory" /> + <!-- Generate the waveout Mixer header --> + <!-- FIXME: this is temporary until we move this to another workspace --> + <javah destdir="../build/gensrc/native/jogl" classpath="${jogl.jar}" class="com.sun.javafx.audio.windows.waveout.Mixer" /> + + <!-- Compile stuff --> <antcall target="c.build" inheritRefs="true"> <param name="c.compiler.src.files" value="c.src.files.jogl"/> <param name="output.lib.name" value="jogl"/> @@ -976,6 +1075,8 @@ <include name="javax/media/opengl/**" /> <include name="com/sun/gluegen/runtime/**" /> <include name="com/sun/opengl/**" /> + <!-- FIXME: this is temporary until we move these classes to another workspace --> + <include name="com/sun/javafx/**" /> </fileset> </jar> <delete file="tempversion"/> @@ -999,6 +1100,7 @@ <include name="javax/media/opengl/**" /> <include name="com/sun/gluegen/runtime/**" /> <include name="com/sun/opengl/**" /> + <include name="com/sun/javafx/**" /> </fileset> </jar> <delete file="tempversion"/> diff --git a/make/gl-common-es1.cfg b/make/gl-common-es1.cfg new file mode 100755 index 000000000..578312e79 --- /dev/null +++ b/make/gl-common-es1.cfg @@ -0,0 +1,7 @@ +# This .cfg file provides common options used among all GL glue code +# generated for Jogl on OpenGL ES 1. + +HierarchicalNativeOutput false +Include gl-common.cfg +JavaOutputDir ../build/gensrc/classes +NativeOutputDir ../build/gensrc/native/jogl diff --git a/make/gl-common-es2.cfg b/make/gl-common-es2.cfg new file mode 100755 index 000000000..e4765f00a --- /dev/null +++ b/make/gl-common-es2.cfg @@ -0,0 +1,7 @@ +# This .cfg file provides common options used among all GL glue code +# generated for Jogl on OpenGL ES 2. + +HierarchicalNativeOutput false +Include gl-common.cfg +JavaOutputDir ../build/gensrc/classes +NativeOutputDir ../build/gensrc/native/jogl diff --git a/make/gl-common.cfg b/make/gl-common.cfg index e33bba2e1..771b34526 100644 --- a/make/gl-common.cfg +++ b/make/gl-common.cfg @@ -10,10 +10,9 @@ Import java.util.* Import javax.media.opengl.* Import com.sun.opengl.impl.* -# Inform the glue code generator of the association between #defines -# and functions and the extensions in which they are defined -GLHeader GL/gl.h -GLHeader GL/glext.h +##################################################################### +# Mostly desktop OpenGL stuff below +# # Don't output #defines of GL version identifier strings as constants, # because we don't need them java-side. @@ -266,51 +265,6 @@ JavaEpilogue glBindBuffer bufferStateTracker.setBoundBufferObject({0}, {1} JavaEpilogue glBindBufferARB bufferStateTracker.setBoundBufferObject({0}, {1}); JavaEpilogue glPushClientAttrib bufferStateTracker.clearBufferObjectState(); JavaEpilogue glPopClientAttrib bufferStateTracker.clearBufferObjectState(); -JavaEpilogue glBufferData bufferSizeTracker.setBufferSize(bufferStateTracker, {0}, this, {1}); -JavaEpilogue glBufferDataARB bufferSizeTracker.setBufferSize(bufferStateTracker, {0}, this, {1}); -BufferObjectKind UnpackPixel glBitmap -BufferObjectKind UnpackPixel glColorTable -BufferObjectKind UnpackPixel glColorSubTable -BufferObjectKind UnpackPixel glCompressedTexImage1D -BufferObjectKind UnpackPixel glCompressedTexImage1DARB -BufferObjectKind UnpackPixel glCompressedTexImage2D -BufferObjectKind UnpackPixel glCompressedTexImage2DARB -BufferObjectKind UnpackPixel glCompressedTexImage3D -BufferObjectKind UnpackPixel glCompressedTexImage3DARB -BufferObjectKind UnpackPixel glCompressedTexSubImage1D -BufferObjectKind UnpackPixel glCompressedTexSubImage1DARB -BufferObjectKind UnpackPixel glCompressedTexSubImage2D -BufferObjectKind UnpackPixel glCompressedTexSubImage2DARB -BufferObjectKind UnpackPixel glCompressedTexSubImage3D -BufferObjectKind UnpackPixel glCompressedTexSubImage3DARB -BufferObjectKind UnpackPixel glConvolutionFilter1D -BufferObjectKind UnpackPixel glConvolutionFilter2D -BufferObjectKind UnpackPixel glDrawPixels -BufferObjectKind UnpackPixel glPixelMapfv -BufferObjectKind UnpackPixel glPixelMapuiv -BufferObjectKind UnpackPixel glPixelMapusv -BufferObjectKind UnpackPixel glPolygonStipple -BufferObjectKind UnpackPixel glSeparableFilter2D -BufferObjectKind UnpackPixel glTexImage1D -BufferObjectKind UnpackPixel glTexImage2D -BufferObjectKind UnpackPixel glTexImage3D -BufferObjectKind UnpackPixel glTexSubImage1D -BufferObjectKind UnpackPixel glTexSubImage2D -BufferObjectKind UnpackPixel glTexSubImage3D - -BufferObjectKind PackPixel glGetColorTable -BufferObjectKind PackPixel glGetCompressedTexImage -BufferObjectKind PackPixel glGetCompressedTexImageARB -BufferObjectKind PackPixel glGetConvolutionFilter -BufferObjectKind PackPixel glGetHistogram -BufferObjectKind PackPixel glGetMinmax -BufferObjectKind PackPixel glGetPixelMapfv -BufferObjectKind PackPixel glGetPixelMapuiv -BufferObjectKind PackPixel glGetPixelMapusv -BufferObjectKind PackPixel glGetPolygonStipple -BufferObjectKind PackPixel glGetSeparableFilter -BufferObjectKind PackPixel glGetTexImage -BufferObjectKind PackPixel glReadPixels BufferObjectKind Array glColorPointer BufferObjectKind Array glEdgeFlagPointer @@ -408,49 +362,6 @@ RangeCheck glDeleteTextures 1 {0} RangeCheck glGenVertexArraysAPPLE 1 {0} RangeCheck glDeleteVertexArraysAPPLE 1 {0} -# Track server-side object creation and deletion when necessary -JavaEpilogue glGenBuffers if (tracker != null) tracker.addBuffers({0}, {1}); -JavaEpilogue glGenBuffersARB if (tracker != null) tracker.addBuffersARB({0}, {1}); -JavaEpilogue glGenFencesAPPLE if (tracker != null) tracker.addFencesAPPLE({0}, {1}); -JavaEpilogue glGenFencesNV if (tracker != null) tracker.addFencesNV({0}, {1}); -JavaEpilogue glGenFragmentShadersATI if (tracker != null) tracker.addFragmentShadersATI(_res, {0}); -JavaEpilogue glGenFramebuffersEXT if (tracker != null) tracker.addFramebuffersEXT({0}, {1}); -JavaEpilogue glGenLists if (tracker != null) tracker.addLists(_res, {0}); -JavaEpilogue glGenOcclusionQueriesNV if (tracker != null) tracker.addOcclusionQueriesNV({0}, {1}); -JavaEpilogue glCreateProgram if (tracker != null) tracker.addProgramObject(_res); -JavaEpilogue glCreateProgramObjectARB if (tracker != null) tracker.addProgramObjectARB(_res); -JavaEpilogue glGenProgramsARB if (tracker != null) tracker.addProgramsARB({0}, {1}); -JavaEpilogue glGenProgramsNV if (tracker != null) tracker.addProgramsNV({0}, {1}); -JavaEpilogue glGenQueries if (tracker != null) tracker.addQueries({0}, {1}); -JavaEpilogue glGenQueriesARB if (tracker != null) tracker.addQueriesARB({0}, {1}); -JavaEpilogue glGenRenderbuffersEXT if (tracker != null) tracker.addRenderbuffersEXT({0}, {1}); -JavaEpilogue glCreateShader if (tracker != null) tracker.addShaderObject(_res); -JavaEpilogue glCreateShaderObjectARB if (tracker != null) tracker.addShaderObjectARB(_res); -JavaEpilogue glGenTextures if (tracker != null) tracker.addTextures({0}, {1}); -JavaEpilogue glGenVertexArraysAPPLE if (tracker != null) tracker.addVertexArraysAPPLE({0}, {1}); -JavaEpilogue glGenVertexShadersEXT if (tracker != null) tracker.addVertexShadersEXT(_res, {0}); - -JavaEpilogue glDeleteBuffers if (tracker != null) tracker.removeBuffers({0}, {1}); -JavaEpilogue glDeleteBuffersARB if (tracker != null) tracker.removeBuffersARB({0}, {1}); -JavaEpilogue glDeleteFencesAPPLE if (tracker != null) tracker.removeFencesAPPLE({0}, {1}); -JavaEpilogue glDeleteFencesNV if (tracker != null) tracker.removeFencesNV({0}, {1}); -JavaEpilogue glDeleteFragmentShaderATI if (tracker != null) tracker.removeFragmentShaderATI({0}); -JavaEpilogue glDeleteFramebuffersEXT if (tracker != null) tracker.removeFramebuffersEXT({0}, {1}); -JavaEpilogue glDeleteLists if (tracker != null) tracker.removeLists({0}, {1}); -JavaEpilogue glDeleteOcclusionQueriesNV if (tracker != null) tracker.removeOcclusionQueriesNV({0}, {1}); -JavaEpilogue glDeleteProgram if (tracker != null) tracker.removeProgramObject({0}); -JavaEpilogue glDeleteObjectARB if (tracker != null) tracker.removeProgramOrShaderObjectARB({0}); -JavaEpilogue glDeleteProgramsARB if (tracker != null) tracker.removeProgramsARB({0}, {1}); -JavaEpilogue glDeleteProgramsNV if (tracker != null) tracker.removeProgramsNV({0}, {1}); -JavaEpilogue glDeleteQueries if (tracker != null) tracker.removeQueries({0}, {1}); -JavaEpilogue glDeleteQueriesARB if (tracker != null) tracker.removeQueriesARB({0}, {1}); -JavaEpilogue glDeleteRenderbuffersEXT if (tracker != null) tracker.removeRenderbuffersEXT({0}, {1}); -JavaEpilogue glDeleteShader if (tracker != null) tracker.removeShaderObject({0}); -JavaEpilogue glDeleteTextures if (tracker != null) tracker.removeTextures({0}, {1}); -JavaEpilogue glDeleteVertexArraysAPPLE if (tracker != null) tracker.removeVertexArraysAPPLE({0}, {1}); -JavaEpilogue glDeleteVertexShaderEXT if (tracker != null) tracker.removeVertexShaderEXT({0}); - - # Javadoc for the GL class ClassJavadoc GL /** ClassJavadoc GL * <P> The basic interface to OpenGL, providing access to core diff --git a/make/gl-desktop.cfg b/make/gl-desktop.cfg new file mode 100755 index 000000000..808f02f94 --- /dev/null +++ b/make/gl-desktop.cfg @@ -0,0 +1,101 @@ +# This .cfg file provides common options used by the desktop OpenGL +# implementation on all platforms. + +# Inform the glue code generator of the association between #defines +# and functions and the extensions in which they are defined +GLHeader GL/gl.h +GLHeader GL/glext.h + +# Right now the implementations for these don't work on the embedded +# OpenGL variants (FIXME) +JavaEpilogue glBufferData bufferSizeTracker.setBufferSize(bufferStateTracker, {0}, this, {1}); +JavaEpilogue glBufferDataARB bufferSizeTracker.setBufferSize(bufferStateTracker, {0}, this, {1}); + +# There are no PBOs in the embedded OpenGL variants right now +BufferObjectKind UnpackPixel glBitmap +BufferObjectKind UnpackPixel glColorTable +BufferObjectKind UnpackPixel glColorSubTable +BufferObjectKind UnpackPixel glCompressedTexImage1D +BufferObjectKind UnpackPixel glCompressedTexImage1DARB +BufferObjectKind UnpackPixel glCompressedTexImage2D +BufferObjectKind UnpackPixel glCompressedTexImage2DARB +BufferObjectKind UnpackPixel glCompressedTexImage3D +BufferObjectKind UnpackPixel glCompressedTexImage3DARB +BufferObjectKind UnpackPixel glCompressedTexSubImage1D +BufferObjectKind UnpackPixel glCompressedTexSubImage1DARB +BufferObjectKind UnpackPixel glCompressedTexSubImage2D +BufferObjectKind UnpackPixel glCompressedTexSubImage2DARB +BufferObjectKind UnpackPixel glCompressedTexSubImage3D +BufferObjectKind UnpackPixel glCompressedTexSubImage3DARB +BufferObjectKind UnpackPixel glConvolutionFilter1D +BufferObjectKind UnpackPixel glConvolutionFilter2D +BufferObjectKind UnpackPixel glDrawPixels +BufferObjectKind UnpackPixel glPixelMapfv +BufferObjectKind UnpackPixel glPixelMapuiv +BufferObjectKind UnpackPixel glPixelMapusv +BufferObjectKind UnpackPixel glPolygonStipple +BufferObjectKind UnpackPixel glSeparableFilter2D +BufferObjectKind UnpackPixel glTexImage1D +BufferObjectKind UnpackPixel glTexImage2D +BufferObjectKind UnpackPixel glTexImage3D +BufferObjectKind UnpackPixel glTexSubImage1D +BufferObjectKind UnpackPixel glTexSubImage2D +BufferObjectKind UnpackPixel glTexSubImage3D + +BufferObjectKind PackPixel glGetColorTable +BufferObjectKind PackPixel glGetCompressedTexImage +BufferObjectKind PackPixel glGetCompressedTexImageARB +BufferObjectKind PackPixel glGetConvolutionFilter +BufferObjectKind PackPixel glGetHistogram +BufferObjectKind PackPixel glGetMinmax +BufferObjectKind PackPixel glGetPixelMapfv +BufferObjectKind PackPixel glGetPixelMapuiv +BufferObjectKind PackPixel glGetPixelMapusv +BufferObjectKind PackPixel glGetPolygonStipple +BufferObjectKind PackPixel glGetSeparableFilter +BufferObjectKind PackPixel glGetTexImage +BufferObjectKind PackPixel glReadPixels + +# Track server-side object creation and deletion when necessary +# Note that this is only necessary when the Java 2D / JOGL bridge is active, +# so will never be needed for the embedded OpenGL variants +JavaEpilogue glGenBuffers if (tracker != null) tracker.addBuffers({0}, {1}); +JavaEpilogue glGenBuffersARB if (tracker != null) tracker.addBuffersARB({0}, {1}); +JavaEpilogue glGenFencesAPPLE if (tracker != null) tracker.addFencesAPPLE({0}, {1}); +JavaEpilogue glGenFencesNV if (tracker != null) tracker.addFencesNV({0}, {1}); +JavaEpilogue glGenFragmentShadersATI if (tracker != null) tracker.addFragmentShadersATI(_res, {0}); +JavaEpilogue glGenFramebuffersEXT if (tracker != null) tracker.addFramebuffersEXT({0}, {1}); +JavaEpilogue glGenLists if (tracker != null) tracker.addLists(_res, {0}); +JavaEpilogue glGenOcclusionQueriesNV if (tracker != null) tracker.addOcclusionQueriesNV({0}, {1}); +JavaEpilogue glCreateProgram if (tracker != null) tracker.addProgramObject(_res); +JavaEpilogue glCreateProgramObjectARB if (tracker != null) tracker.addProgramObjectARB(_res); +JavaEpilogue glGenProgramsARB if (tracker != null) tracker.addProgramsARB({0}, {1}); +JavaEpilogue glGenProgramsNV if (tracker != null) tracker.addProgramsNV({0}, {1}); +JavaEpilogue glGenQueries if (tracker != null) tracker.addQueries({0}, {1}); +JavaEpilogue glGenQueriesARB if (tracker != null) tracker.addQueriesARB({0}, {1}); +JavaEpilogue glGenRenderbuffersEXT if (tracker != null) tracker.addRenderbuffersEXT({0}, {1}); +JavaEpilogue glCreateShader if (tracker != null) tracker.addShaderObject(_res); +JavaEpilogue glCreateShaderObjectARB if (tracker != null) tracker.addShaderObjectARB(_res); +JavaEpilogue glGenTextures if (tracker != null) tracker.addTextures({0}, {1}); +JavaEpilogue glGenVertexArraysAPPLE if (tracker != null) tracker.addVertexArraysAPPLE({0}, {1}); +JavaEpilogue glGenVertexShadersEXT if (tracker != null) tracker.addVertexShadersEXT(_res, {0}); + +JavaEpilogue glDeleteBuffers if (tracker != null) tracker.removeBuffers({0}, {1}); +JavaEpilogue glDeleteBuffersARB if (tracker != null) tracker.removeBuffersARB({0}, {1}); +JavaEpilogue glDeleteFencesAPPLE if (tracker != null) tracker.removeFencesAPPLE({0}, {1}); +JavaEpilogue glDeleteFencesNV if (tracker != null) tracker.removeFencesNV({0}, {1}); +JavaEpilogue glDeleteFragmentShaderATI if (tracker != null) tracker.removeFragmentShaderATI({0}); +JavaEpilogue glDeleteFramebuffersEXT if (tracker != null) tracker.removeFramebuffersEXT({0}, {1}); +JavaEpilogue glDeleteLists if (tracker != null) tracker.removeLists({0}, {1}); +JavaEpilogue glDeleteOcclusionQueriesNV if (tracker != null) tracker.removeOcclusionQueriesNV({0}, {1}); +JavaEpilogue glDeleteProgram if (tracker != null) tracker.removeProgramObject({0}); +JavaEpilogue glDeleteObjectARB if (tracker != null) tracker.removeProgramOrShaderObjectARB({0}); +JavaEpilogue glDeleteProgramsARB if (tracker != null) tracker.removeProgramsARB({0}, {1}); +JavaEpilogue glDeleteProgramsNV if (tracker != null) tracker.removeProgramsNV({0}, {1}); +JavaEpilogue glDeleteQueries if (tracker != null) tracker.removeQueries({0}, {1}); +JavaEpilogue glDeleteQueriesARB if (tracker != null) tracker.removeQueriesARB({0}, {1}); +JavaEpilogue glDeleteRenderbuffersEXT if (tracker != null) tracker.removeRenderbuffersEXT({0}, {1}); +JavaEpilogue glDeleteShader if (tracker != null) tracker.removeShaderObject({0}); +JavaEpilogue glDeleteTextures if (tracker != null) tracker.removeTextures({0}, {1}); +JavaEpilogue glDeleteVertexArraysAPPLE if (tracker != null) tracker.removeVertexArraysAPPLE({0}, {1}); +JavaEpilogue glDeleteVertexShaderEXT if (tracker != null) tracker.removeVertexShaderEXT({0}); diff --git a/make/gl-es1.cfg b/make/gl-es1.cfg new file mode 100755 index 000000000..4a3832bce --- /dev/null +++ b/make/gl-es1.cfg @@ -0,0 +1,39 @@ +# This .cfg file is used to generate the GL interface and implementing class. +Package javax.media.opengl +Style InterfaceAndImpl +JavaClass GL +ImplPackage com.sun.opengl.impl +ImplJavaClass GLImpl +Include gl-common-es1.cfg + +EmitProcAddressTable true +ProcAddressTableClassName GLProcAddressTable +GetProcAddressTableExpr _context.getGLProcAddressTable() + +# Inform the glue code generator of the association between #defines +# and functions and the extensions in which they are defined +GLHeader GLES/gl.h +GLHeader GLES/glext.h + +# For the time being, ignore glMapBufferOES (FIXME) +Ignore glMapBufferOES + +# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums +TagNativeBinding true + +CustomCCode /* Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in +CustomCCode "glext.h" are parsed. */ +CustomCCode #define GL_GLEXT_PROTOTYPES + +CustomCCode /* Include the OpenGL headers */ +CustomCCode #define GL_APICALL __declspec(dllimport) +CustomCCode #include <GLES/gl.h> +CustomCCode #include <GLES/glext.h> +CustomCCode #include <stdlib.h> +CustomCCode /* Include missing function pointer typedef */ +CustomCCode typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); + +CustomCCode typedef int intptr_t; + +IncludeAs CustomJavaCode GLImpl gl-impl-CustomJavaCode-gles1.java +IncludeAs CustomCCode gl-impl-CustomCCode.c diff --git a/make/gl-es2.cfg b/make/gl-es2.cfg new file mode 100755 index 000000000..aa1ad8e26 --- /dev/null +++ b/make/gl-es2.cfg @@ -0,0 +1,38 @@ +# This .cfg file is used to generate the GL interface and implementing class. +Package javax.media.opengl +Style InterfaceAndImpl +JavaClass GL +ImplPackage com.sun.opengl.impl +ImplJavaClass GLImpl +Include gl-common-es2.cfg + +EmitProcAddressTable true +ProcAddressTableClassName GLProcAddressTable +GetProcAddressTableExpr _context.getGLProcAddressTable() + +# Inform the glue code generator of the association between #defines +# and functions and the extensions in which they are defined +GLHeader GLES2/gl2.h +GLHeader GLES2/gl2ext.h + +# For the time being, ignore glMapBufferOES (FIXME) +Ignore glMapBufferOES + +# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums +TagNativeBinding true + +CustomCCode /* Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in +CustomCCode "glext.h" are parsed. */ +CustomCCode #define GL_GLEXT_PROTOTYPES + +CustomCCode /* Include the OpenGL headers */ +CustomCCode #define GL_APICALL __declspec(dllimport) +CustomCCode #include <GLES2/gl2ext.h> +CustomCCode #include <stdlib.h> +CustomCCode /* Include missing function pointer typedef */ +CustomCCode typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); + +CustomCCode typedef int intptr_t; + +IncludeAs CustomJavaCode GLImpl gl-impl-CustomJavaCode-gles2.java +IncludeAs CustomCCode gl-impl-CustomCCode.c diff --git a/make/gl-impl-CustomCCode.c b/make/gl-impl-CustomCCode.c index 2ea5376e7..20d4b0430 100644 --- a/make/gl-impl-CustomCCode.c +++ b/make/gl-impl-CustomCCode.c @@ -3,6 +3,7 @@ * Java method: long dispatch_glMapBuffer(int target, int access) * C function: LPVOID glMapBuffer(GLenum target, GLenum access); */ +/* JNIEXPORT jlong JNICALL Java_com_sun_opengl_impl_GLImpl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) { PFNGLMAPBUFFERPROC ptr_glMapBuffer; @@ -12,12 +13,14 @@ Java_com_sun_opengl_impl_GLImpl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unus _res = (* ptr_glMapBuffer) ((GLenum) target, (GLenum) access); return (jlong) (intptr_t) _res; } +*/ /* Java->C glue code: * Java package: net.java.games.jogl.impl.GLImpl * Java method: long dispatch_glMapBufferARB(int target, int access) * C function: LPVOID glMapBufferARB(GLenum target, GLenum access); */ +/* JNIEXPORT jlong JNICALL Java_com_sun_opengl_impl_GLImpl_dispatch_1glMapBufferARB(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) { PFNGLMAPBUFFERARBPROC ptr_glMapBufferARB; @@ -27,3 +30,4 @@ Java_com_sun_opengl_impl_GLImpl_dispatch_1glMapBufferARB(JNIEnv *env, jobject _u _res = (* ptr_glMapBufferARB) ((GLenum) target, (GLenum) access); return (jlong) (intptr_t) _res; } +*/ diff --git a/make/gl-impl-CustomJavaCode-gles1.java b/make/gl-impl-CustomJavaCode-gles1.java new file mode 100755 index 000000000..7f10c661b --- /dev/null +++ b/make/gl-impl-CustomJavaCode-gles1.java @@ -0,0 +1,301 @@ +// Tracks glBegin/glEnd calls to determine whether it is legal to +// query Vertex Buffer Object state +private boolean inBeginEndPair; + +public GLImpl(GLContextImpl context) { + this._context = context; + this.bufferSizeTracker = context.getBufferSizeTracker(); +} + +public boolean isFunctionAvailable(String glFunctionName) { + return _context.isFunctionAvailable(glFunctionName); +} + +public boolean isExtensionAvailable(String glExtensionName) { + return _context.isExtensionAvailable(glExtensionName); +} + +public Object getExtension(String extensionName) { + // At this point we don't expose any extensions using this mechanism + return null; +} + +/** Returns the context this GL object is associated with for better + error checking by DebugGL. */ +public GLContext getContext() { + return _context; +} + +private GLContextImpl _context; + +/** + * Provides platform-independent access to the wglAllocateMemoryNV / + * glXAllocateMemoryNV extension. + */ +public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) { + return _context.glAllocateMemoryNV(arg0, arg1, arg2, arg3); +} + +public void setSwapInterval(int interval) { + _context.setSwapInterval(interval); +} + +public Object getPlatformGLExtensions() { + return _context.getPlatformGLExtensions(); +} + +// +// Helpers for ensuring the correct amount of texture data +// + +/** Returns the number of bytes required to fill in the appropriate + texture. This is regrettably a lower bound as in certain + circumstances OpenGL state such as unpack alignment can cause more + data to be required. However this should be close enough that it + should catch most crashes. The logic in this routine is based on + code in the SGI OpenGL sample implementation. */ + +private int imageSizeInBytes(int format, int type, int w, int h, int d) { + int elements = 0; + int esize = 0; + + if (w < 0) return 0; + if (h < 0) return 0; + if (d < 0) return 0; + switch (format) { + case GL_ALPHA: + case GL_LUMINANCE: + elements = 1; + break; + case GL_LUMINANCE_ALPHA: + elements = 2; + break; + case GL_RGB: + elements = 3; + break; + case GL_RGBA: + elements = 4; + break; + default: + return 0; + } + switch (type) { + case GL_BYTE: + case GL_UNSIGNED_BYTE: + esize = 1; + break; + case GL_SHORT: + case GL_UNSIGNED_SHORT: + esize = 2; + break; + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_5_5_5_1: + esize = 2; + elements = 1; + break; + case GL_FLOAT: + esize = 4; + break; + default: + return 0; + } + return (elements * esize * w * h * d); +} + +private boolean bufferObjectExtensionsInitialized = false; +private boolean haveARBPixelBufferObject; +private boolean haveEXTPixelBufferObject; +private boolean haveGL15; +private boolean haveGL21; +private boolean haveARBVertexBufferObject; +private GLBufferStateTracker bufferStateTracker = new GLBufferStateTracker(); +private GLBufferSizeTracker bufferSizeTracker; + +private void initBufferObjectExtensionChecks() { + if (bufferObjectExtensionsInitialized) + return; + bufferObjectExtensionsInitialized = true; + haveARBPixelBufferObject = isExtensionAvailable("GL_ARB_pixel_buffer_object"); + haveEXTPixelBufferObject = isExtensionAvailable("GL_EXT_pixel_buffer_object"); + haveGL15 = isExtensionAvailable("GL_VERSION_1_5"); + haveGL21 = isExtensionAvailable("GL_VERSION_2_1"); + haveARBVertexBufferObject = isExtensionAvailable("GL_ARB_vertex_buffer_object"); +} + +// +// FIXME: all of these error checking routines had to be disabled +// because our version and extension querying mechanisms aren't +// working on the device yet +// + + +private void checkBufferObject(boolean extension1, + boolean extension2, + boolean extension3, + boolean enabled, + int state, + String kind) { + /* + if (inBeginEndPair) { + throw new GLException("May not call this between glBegin and glEnd"); + } + boolean avail = (extension1 || extension2 || extension3); + if (!avail) { + if (!enabled) + return; + throw new GLException("Required extensions not available to call this function"); + } + int buffer = bufferStateTracker.getBoundBufferObject(state, this); + if (enabled) { + if (buffer == 0) { + throw new GLException(kind + " must be enabled to call this method"); + } + } else { + if (buffer != 0) { + throw new GLException(kind + " must be disabled to call this method"); + } + } + */ +} + +private void checkArrayVBODisabled() { + /* + initBufferObjectExtensionChecks(); + checkBufferObject(haveGL15, + haveARBVertexBufferObject, + false, + false, + GL.GL_ARRAY_BUFFER, + "array vertex_buffer_object"); + */ +} + +private void checkArrayVBOEnabled() { + /* + initBufferObjectExtensionChecks(); + checkBufferObject(haveGL15, + haveARBVertexBufferObject, + false, + true, + GL.GL_ARRAY_BUFFER, + "array vertex_buffer_object"); + */ +} + +private void checkElementVBODisabled() { + /* + initBufferObjectExtensionChecks(); + checkBufferObject(haveGL15, + haveARBVertexBufferObject, + false, + false, + GL.GL_ELEMENT_ARRAY_BUFFER, + "element vertex_buffer_object"); + */ +} + +private void checkElementVBOEnabled() { + /* + initBufferObjectExtensionChecks(); + checkBufferObject(haveGL15, + haveARBVertexBufferObject, + false, + true, + GL.GL_ELEMENT_ARRAY_BUFFER, + "element vertex_buffer_object"); + */ +} + +// FIXME: bind this up to glMapBufferOES + +/* + +// Attempt to return the same ByteBuffer object from glMapBufferARB if +// the vertex buffer object's base address and size haven't changed +private static class ARBVBOKey { + private long addr; + private int capacity; + + ARBVBOKey(long addr, int capacity) { + this.addr = addr; + this.capacity = capacity; + } + + public int hashCode() { + return (int) addr; + } + + public boolean equals(Object o) { + if ((o == null) || (!(o instanceof ARBVBOKey))) { + return false; + } + + ARBVBOKey other = (ARBVBOKey) o; + return ((addr == other.addr) && (capacity == other.capacity)); + } +} + +*/ + +//private Map/*<ARBVBOKey, ByteBuffer>*/ arbVBOCache = new HashMap(); + +/** Entry point to C language function: <br> <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */ +/* +public java.nio.ByteBuffer glMapBuffer(int target, int access) { + final long __addr_ = _context.getGLProcAddressTable()._addressof_glMapBuffer; + if (__addr_ == 0) { + throw new GLException("Method \"glMapBuffer\" not available"); + } + int sz = bufferSizeTracker.getBufferSize(bufferStateTracker, + target, + this); + long addr; + addr = dispatch_glMapBuffer(target, access, __addr_); + if (addr == 0 || sz == 0) { + return null; + } + ARBVBOKey key = new ARBVBOKey(addr, sz); + java.nio.ByteBuffer _res = (java.nio.ByteBuffer) arbVBOCache.get(key); + if (_res == null) { + _res = InternalBufferUtils.newDirectByteBuffer(addr, sz); + _res.order(java.nio.ByteOrder.nativeOrder()); + arbVBOCache.put(key, _res); + } + _res.position(0); + return _res; +} +*/ + +/** Entry point to C language function: <br> <code> LPVOID glMapBufferARB(GLenum target, GLenum access); </code> */ +/* +public java.nio.ByteBuffer glMapBufferARB(int target, int access) { + final long __addr_ = _context.getGLProcAddressTable()._addressof_glMapBufferARB; + if (__addr_ == 0) { + throw new GLException("Method \"glMapBufferARB\" not available"); + } + int sz = bufferSizeTracker.getBufferSize(bufferStateTracker, + target, + this); + long addr; + addr = dispatch_glMapBufferARB(target, access, __addr_); + if (addr == 0 || sz == 0) { + return null; + } + ARBVBOKey key = new ARBVBOKey(addr, sz); + java.nio.ByteBuffer _res = (java.nio.ByteBuffer) arbVBOCache.get(key); + if (_res == null) { + _res = InternalBufferUtils.newDirectByteBuffer(addr, sz); + _res.order(java.nio.ByteOrder.nativeOrder()); + arbVBOCache.put(key, _res); + } + _res.position(0); + return _res; +} +*/ + +/** Encapsulates function pointer for OpenGL function <br>: <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */ +//native private long dispatch_glMapBuffer(int target, int access, long glProcAddress); + +/** Encapsulates function pointer for OpenGL function <br>: <code> LPVOID glMapBufferARB(GLenum target, GLenum access); </code> */ +//native private long dispatch_glMapBufferARB(int target, int access, long glProcAddress); diff --git a/make/gl-impl-CustomJavaCode-gles2.java b/make/gl-impl-CustomJavaCode-gles2.java new file mode 100755 index 000000000..99b2b9267 --- /dev/null +++ b/make/gl-impl-CustomJavaCode-gles2.java @@ -0,0 +1,290 @@ +// Tracks glBegin/glEnd calls to determine whether it is legal to +// query Vertex Buffer Object state +private boolean inBeginEndPair; + +public GLImpl(GLContextImpl context) { + this._context = context; + this.bufferSizeTracker = context.getBufferSizeTracker(); +} + +public boolean isFunctionAvailable(String glFunctionName) { + return _context.isFunctionAvailable(glFunctionName); +} + +public boolean isExtensionAvailable(String glExtensionName) { + return _context.isExtensionAvailable(glExtensionName); +} + +public Object getExtension(String extensionName) { + // At this point we don't expose any extensions using this mechanism + return null; +} + +/** Returns the context this GL object is associated with for better + error checking by DebugGL. */ +public GLContext getContext() { + return _context; +} + +private GLContextImpl _context; + +/** + * Provides platform-independent access to the wglAllocateMemoryNV / + * glXAllocateMemoryNV extension. + */ +public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) { + return _context.glAllocateMemoryNV(arg0, arg1, arg2, arg3); +} + +public void setSwapInterval(int interval) { + _context.setSwapInterval(interval); +} + +public Object getPlatformGLExtensions() { + return _context.getPlatformGLExtensions(); +} + +// +// Helpers for ensuring the correct amount of texture data +// + +/** Returns the number of bytes required to fill in the appropriate + texture. This is regrettably a lower bound as in certain + circumstances OpenGL state such as unpack alignment can cause more + data to be required. However this should be close enough that it + should catch most crashes. The logic in this routine is based on + code in the SGI OpenGL sample implementation. */ + +private int imageSizeInBytes(int format, int type, int w, int h, int d) { + int elements = 0; + int esize = 0; + + if (w < 0) return 0; + if (h < 0) return 0; + if (d < 0) return 0; + switch (format) { + case GL_STENCIL_INDEX: + elements = 1; + break; + case GL_ALPHA: + case GL_LUMINANCE: + case GL_DEPTH_COMPONENT: + elements = 1; + break; + case GL_LUMINANCE_ALPHA: + elements = 2; + break; + case GL_RGB: + elements = 3; + break; + case GL_RGBA: + elements = 4; + break; + default: + return 0; + } + switch (type) { + case GL_BYTE: + case GL_UNSIGNED_BYTE: + esize = 1; + break; + case GL_SHORT: + case GL_UNSIGNED_SHORT: + esize = 2; + break; + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_5_5_5_1: + esize = 2; + elements = 1; + break; + case GL_INT: + case GL_UNSIGNED_INT: + case GL_FLOAT: + esize = 4; + break; + default: + return 0; + } + return (elements * esize * w * h * d); +} + +private boolean bufferObjectExtensionsInitialized = false; +private boolean haveARBPixelBufferObject; +private boolean haveEXTPixelBufferObject; +private boolean haveGL15; +private boolean haveGL21; +private boolean haveARBVertexBufferObject; +private GLBufferStateTracker bufferStateTracker = new GLBufferStateTracker(); +private GLBufferSizeTracker bufferSizeTracker; + +private void initBufferObjectExtensionChecks() { + if (bufferObjectExtensionsInitialized) + return; + bufferObjectExtensionsInitialized = true; + haveARBPixelBufferObject = isExtensionAvailable("GL_ARB_pixel_buffer_object"); + haveEXTPixelBufferObject = isExtensionAvailable("GL_EXT_pixel_buffer_object"); + haveGL15 = isExtensionAvailable("GL_VERSION_1_5"); + haveGL21 = isExtensionAvailable("GL_VERSION_2_1"); + haveARBVertexBufferObject = isExtensionAvailable("GL_ARB_vertex_buffer_object"); +} + +private void checkBufferObject(boolean extension1, + boolean extension2, + boolean extension3, + boolean enabled, + int state, + String kind) { + if (inBeginEndPair) { + throw new GLException("May not call this between glBegin and glEnd"); + } + boolean avail = (extension1 || extension2 || extension3); + if (!avail) { + if (!enabled) + return; + throw new GLException("Required extensions not available to call this function"); + } + int buffer = bufferStateTracker.getBoundBufferObject(state, this); + if (enabled) { + if (buffer == 0) { + throw new GLException(kind + " must be enabled to call this method"); + } + } else { + if (buffer != 0) { + throw new GLException(kind + " must be disabled to call this method"); + } + } +} + +private void checkArrayVBODisabled() { + initBufferObjectExtensionChecks(); + checkBufferObject(haveGL15, + haveARBVertexBufferObject, + false, + false, + GL.GL_ARRAY_BUFFER, + "array vertex_buffer_object"); +} + +private void checkArrayVBOEnabled() { + initBufferObjectExtensionChecks(); + checkBufferObject(haveGL15, + haveARBVertexBufferObject, + false, + true, + GL.GL_ARRAY_BUFFER, + "array vertex_buffer_object"); +} + +private void checkElementVBODisabled() { + initBufferObjectExtensionChecks(); + checkBufferObject(haveGL15, + haveARBVertexBufferObject, + false, + false, + GL.GL_ELEMENT_ARRAY_BUFFER, + "element vertex_buffer_object"); +} + +private void checkElementVBOEnabled() { + initBufferObjectExtensionChecks(); + checkBufferObject(haveGL15, + haveARBVertexBufferObject, + false, + true, + GL.GL_ELEMENT_ARRAY_BUFFER, + "element vertex_buffer_object"); +} + +// FIXME: bind this up to glMapBufferOES + +/* + +// Attempt to return the same ByteBuffer object from glMapBufferARB if +// the vertex buffer object's base address and size haven't changed +private static class ARBVBOKey { + private long addr; + private int capacity; + + ARBVBOKey(long addr, int capacity) { + this.addr = addr; + this.capacity = capacity; + } + + public int hashCode() { + return (int) addr; + } + + public boolean equals(Object o) { + if ((o == null) || (!(o instanceof ARBVBOKey))) { + return false; + } + + ARBVBOKey other = (ARBVBOKey) o; + return ((addr == other.addr) && (capacity == other.capacity)); + } +} + +*/ + +//private Map/*<ARBVBOKey, ByteBuffer>*/ arbVBOCache = new HashMap(); + +/** Entry point to C language function: <br> <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */ +/* +public java.nio.ByteBuffer glMapBuffer(int target, int access) { + final long __addr_ = _context.getGLProcAddressTable()._addressof_glMapBuffer; + if (__addr_ == 0) { + throw new GLException("Method \"glMapBuffer\" not available"); + } + int sz = bufferSizeTracker.getBufferSize(bufferStateTracker, + target, + this); + long addr; + addr = dispatch_glMapBuffer(target, access, __addr_); + if (addr == 0 || sz == 0) { + return null; + } + ARBVBOKey key = new ARBVBOKey(addr, sz); + java.nio.ByteBuffer _res = (java.nio.ByteBuffer) arbVBOCache.get(key); + if (_res == null) { + _res = InternalBufferUtils.newDirectByteBuffer(addr, sz); + _res.order(java.nio.ByteOrder.nativeOrder()); + arbVBOCache.put(key, _res); + } + _res.position(0); + return _res; +} +*/ + +/** Entry point to C language function: <br> <code> LPVOID glMapBufferARB(GLenum target, GLenum access); </code> */ +/* +public java.nio.ByteBuffer glMapBufferARB(int target, int access) { + final long __addr_ = _context.getGLProcAddressTable()._addressof_glMapBufferARB; + if (__addr_ == 0) { + throw new GLException("Method \"glMapBufferARB\" not available"); + } + int sz = bufferSizeTracker.getBufferSize(bufferStateTracker, + target, + this); + long addr; + addr = dispatch_glMapBufferARB(target, access, __addr_); + if (addr == 0 || sz == 0) { + return null; + } + ARBVBOKey key = new ARBVBOKey(addr, sz); + java.nio.ByteBuffer _res = (java.nio.ByteBuffer) arbVBOCache.get(key); + if (_res == null) { + _res = InternalBufferUtils.newDirectByteBuffer(addr, sz); + _res.order(java.nio.ByteOrder.nativeOrder()); + arbVBOCache.put(key, _res); + } + _res.position(0); + return _res; +} +*/ + +/** Encapsulates function pointer for OpenGL function <br>: <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */ +//native private long dispatch_glMapBuffer(int target, int access, long glProcAddress); + +/** Encapsulates function pointer for OpenGL function <br>: <code> LPVOID glMapBufferARB(GLenum target, GLenum access); </code> */ +//native private long dispatch_glMapBufferARB(int target, int access, long glProcAddress); diff --git a/make/gl-macosx.cfg b/make/gl-macosx.cfg index dc8d41ac8..58883ebec 100644 --- a/make/gl-macosx.cfg +++ b/make/gl-macosx.cfg @@ -5,6 +5,7 @@ JavaClass GL ImplPackage com.sun.opengl.impl ImplJavaClass GLImpl Include gl-common-macosx.cfg +Include gl-desktop.cfg EmitProcAddressTable true ProcAddressTableClassName GLProcAddressTable diff --git a/make/gl-win32.cfg b/make/gl-win32.cfg index 96234241c..5c1c9e26a 100644 --- a/make/gl-win32.cfg +++ b/make/gl-win32.cfg @@ -5,6 +5,7 @@ JavaClass GL ImplPackage com.sun.opengl.impl ImplJavaClass GLImpl Include gl-common-win32.cfg +Include gl-desktop.cfg EmitProcAddressTable true ProcAddressTableClassName GLProcAddressTable diff --git a/make/gl-x11.cfg b/make/gl-x11.cfg index eaa968cbe..6470ce5b8 100644 --- a/make/gl-x11.cfg +++ b/make/gl-x11.cfg @@ -5,6 +5,7 @@ JavaClass GL ImplPackage com.sun.opengl.impl ImplJavaClass GLImpl Include gl-common-x11.cfg +Include gl-desktop.cfg EmitProcAddressTable true ProcAddressTableClassName GLProcAddressTable diff --git a/make/glu-CustomJavaCode-gles1.java b/make/glu-CustomJavaCode-gles1.java new file mode 100755 index 000000000..d0b1f03de --- /dev/null +++ b/make/glu-CustomJavaCode-gles1.java @@ -0,0 +1,480 @@ +/* +private static boolean useJavaMipmapCode = true; + +static { + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + String val = System.getProperty("jogl.glu.nojava"); + if (val != null && !val.toLowerCase().equals("false")) { + useJavaMipmapCode = false; + } + return null; + } + }); +} +*/ + +/** + * Instantiates a new OpenGL Utility Library object. A GLU object may + * be instantiated at any point in the application and is not + * inherently tied to any particular OpenGL context; however, the GLU + * object may only be used when an OpenGL context is current on the + * current thread. Attempts to call most of the methods in the GLU + * library when no OpenGL context is current will cause an exception + * to be thrown. + * + * <P> + * + * The returned GLU object is not guaranteed to be thread-safe and + * should only be used from one thread at a time. Multiple GLU objects + * may be instantiated to be used from different threads + * simultaneously. + */ + +public GLU() +{ + this.project = new ProjectES1(); +} + +//---------------------------------------------------------------------- +// Utility routines +// + +/** + * Returns the GL object associated with the OpenGL context current on + * the current thread. Throws GLException if no OpenGL context is + * current. + */ + +public static GL getCurrentGL() throws GLException { + GLContext curContext = GLContext.getCurrent(); + if (curContext == null) { + throw new GLException("No OpenGL context current on this thread"); + } + return curContext.getGL(); +} + +/* +public String gluErrorString(int errorCode) { + return Error.gluErrorString(errorCode); +} +*/ + +/* extName is an extension name. + * extString is a string of extensions separated by blank(s). There may or + * may not be leading or trailing blank(s) in extString. + * This works in cases of extensions being prefixes of another like + * GL_EXT_texture and GL_EXT_texture3D. + * Returns true if extName is found otherwise it returns false. + */ +/* +public boolean gluCheckExtension(java.lang.String extName, java.lang.String extString) { + return Registry.gluCheckExtension(extName, extString); +} +*/ + +/* +public String gluGetString(int name) { + return Registry.gluGetString(name); +} +*/ + +/** + * Returns true if the specified GLU core- or extension-function can be + * successfully used through this GLU instance. By "successfully" we mean + * that the function is both <i>callable</i> on the machine running the + * program and <i>available</i> on the current display.<P> + * + * A GLU function is <i>callable</i> if it is a GLU core- or extension-function + * that is supported by the underlying GLU implementation. The function is + * <i>available</i> if the OpenGL implementation on the display meets the + * requirements of the GLU function being called (because GLU functions utilize + * OpenGL functions). <P> + * + * Whether or not a GLU function is <i>callable</i> is determined as follows: + * <ul> + * <li>If the function is a GLU core function (i.e., not an + * extension), <code>gluGetString(GLU_VERSION)</code> is used to determine the + * version number of the underlying GLU implementation on the host. + * then the function name is cross-referenced with that specification to + * see if it is part of that version's specification. + * + * <li> If the function is a GLU extension, the function name is + * cross-referenced with the list returned by + * <code>gluGetString(GLU_EXTENSIONS)</code> to see if the function is one of + * the extensions that is supported by the underlying GLU implementation. + * </ul> + * + * Whether or not a GLU function is <i>available</i> is determined as follows: + * <ul> + * <li>If the function is a GLU core function then the function is first + * cross-referenced with the GLU specifications to find the minimum GLU + * version required to <i>call</i> that GLU function. Then the following table + * is consulted to determine the minimum GL version required for that version + * of GLU: + * <ul> + * <li> GLU 1.0 requires OpenGL 1.0 + * <li> GLU 1.1 requires OpenGL 1.0 + * <li> GLU 1.2 requires OpenGL 1.1 + * <li> GLU 1.3 requires OpenGL 1.2 + * </ul> + * Finally, <code>glGetString(GL_VERSION)</code> is used to determine the + * highest OpenGL version that both host and display support, and from that it + * is possible to determine if the GL facilities required by the GLU function + * are <i>available</i> on the display. + * + * <li> If the function is a GLU extension, the function name is + * cross-referenced with the list returned by + * <code>gluGetString(GLU_EXTENSIONS)</code> to see if the function is one of + * the extensions that is supported by the underlying GLU implementation. + * </ul> + * + * <b>NOTE:</b>The availability of a function may change at runtime in + * response to changes in the display environment. For example, when a window + * is dragged from one display to another on a multi-display system, or when + * the properties of the display device are modified (e.g., changing the color + * depth of the display). Any application that is concerned with handling + * these situations correctly should confirm availability after a display + * change before calling a questionable OpenGL function. To detect a change in + * the display device, please see {@link + * GLEventListener#displayChanged(GLAutoDrawable,boolean,boolean)}. + * + * @param gluFunctionName the name of the OpenGL function (e.g., use + * "gluNurbsCallbackDataEXT" to check if the <code> + * gluNurbsCallbackDataEXT(GLUnurbs, GLvoid)</code> extension is available). + */ +public boolean isFunctionAvailable(String gluFunctionName) +{ + // if (useJavaMipmapCode) { + // All GLU functions are available in Java port + return true; + // } + // return (gluProcAddressTable.getAddressFor(gluFunctionName) != 0); +} + +//---------------------------------------------------------------------- +// Projection routines +// + +private ProjectES1 project; + +public void gluOrtho2D(float left, float right, float bottom, float top) { + project.gluOrtho2D(getCurrentGL(), left, right, bottom, top); +} + +public void gluPerspective(float fovy, float aspect, float zNear, float zFar) { + project.gluPerspective(getCurrentGL(), fovy, aspect, zNear, zFar); +} + +public void gluLookAt(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ) { + project.gluLookAt(getCurrentGL(), eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ); +} + +/** Interface to C language function: <br> <code> GLint gluProject(GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * winX, GLdouble * winY, GLdouble * winZ); </code> + * <P> Accepts the outgoing window coordinates as a single array. + */ +public boolean gluProject(float objX, float objY, float objZ, float[] model, int model_offset, float[] proj, int proj_offset, int[] view, int view_offset, float[] winPos, int winPos_offset) { + return project.gluProject(objX, objY, objZ, model, model_offset, proj, proj_offset, view, view_offset, winPos, winPos_offset); +} + +/** Interface to C language function: <br> <code> GLint gluProject(GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * winX, GLdouble * winY, GLdouble * winZ); </code> + * <P> Accepts the outgoing window coordinates as a single buffer. + */ +public boolean gluProject(float objX, float objY, float objZ, java.nio.FloatBuffer model, java.nio.FloatBuffer proj, java.nio.IntBuffer view, java.nio.FloatBuffer winPos) { + return project.gluProject(objX, objY, objZ, model, proj, view, winPos); +} + +/** Interface to C language function: <br> <code> GLint gluUnProject(GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * objX, GLdouble * objY, GLdouble * objZ); </code> + * <P> Accepts the outgoing object coordinates (a 3-vector) as a single array. + */ +public boolean gluUnProject(float winX, float winY, float winZ, float[] model, int model_offset, float[] proj, int proj_offset, int[] view, int view_offset, float[] objPos, int objPos_offset) { + return project.gluUnProject(winX, winY, winZ, model, model_offset, proj, proj_offset, view, view_offset, objPos, objPos_offset); +} + +/** Interface to C language function: <br> <code> GLint gluUnProject(GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * objX, GLdouble * objY, GLdouble * objZ); </code> + * <P> Accepts the outgoing object coordinates (a 3-vector) as a single buffer. + */ +public boolean gluUnProject(float winX, float winY, float winZ, java.nio.FloatBuffer model, java.nio.FloatBuffer proj, java.nio.IntBuffer view, java.nio.FloatBuffer objPos) { + return project.gluUnProject(winX, winY, winZ, model, proj, view, objPos); +} + +/** Interface to C language function: <br> <code> GLint gluUnProject4(GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble nearVal, GLdouble farVal, GLdouble * objX, GLdouble * objY, GLdouble * objZ, GLdouble * objW); </code> + * <P> Accepts the outgoing object coordinates (a 4-vector) as a single array. + */ +public boolean gluUnProject4(float winX, float winY, float winZ, float clipW, float[] model, int model_offset, float[] proj, int proj_offset, int[] view, int view_offset, float nearVal, float farVal, float[] objPos, int objPos_offset) { + return project.gluUnProject4(winX, winY, winZ, clipW, model, model_offset, proj, proj_offset, view, view_offset, nearVal, farVal, objPos, objPos_offset); +} + +/** Interface to C language function: <br> <code> GLint gluUnProject4(GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble nearVal, GLdouble farVal, GLdouble * objX, GLdouble * objY, GLdouble * objZ, GLdouble * objW); </code> + * <P> Accepts the outgoing object coordinates (a 4-vector) as a single buffer. + */ +public boolean gluUnProject4(float winX, float winY, float winZ, float clipW, java.nio.FloatBuffer model, java.nio.FloatBuffer proj, java.nio.IntBuffer view, float nearVal, float farVal, java.nio.FloatBuffer objPos) { + return project.gluUnProject4(winX, winY, winZ, clipW, model, proj, view, nearVal, farVal, objPos); +} + +public void gluPickMatrix(float x, float y, float delX, float delY, int[] viewport, int viewport_offset) { + project.gluPickMatrix(getCurrentGL(), x, y, delX, delY, viewport, viewport_offset); +} + +public void gluPickMatrix(float x, float y, float delX, float delY, java.nio.IntBuffer viewport) { + project.gluPickMatrix(getCurrentGL(), x, y, delX, delY, viewport); +} + +// Boolean +public static final int GLU_FALSE = 0; +public static final int GLU_TRUE = 1; + +// String Name +public static final int GLU_VERSION = 100800; +public static final int GLU_EXTENSIONS = 100801; + +// Extensions +public static final String versionString = "1.3"; +public static final String extensionString = "GLU_EXT_nurbs_tessellator " + + "GLU_EXT_object_space_tess "; + +// ErrorCode +public static final int GLU_INVALID_ENUM = 100900; +public static final int GLU_INVALID_VALUE = 100901; +public static final int GLU_OUT_OF_MEMORY = 100902; +public static final int GLU_INVALID_OPERATION = 100904; + +/************* + +//---------------------------------------------------------------------- +// Mipmap and image scaling functionality + + +// Boolean +public static final int GLU_FALSE = 0; +public static final int GLU_TRUE = 1; + +// String Name +public static final int GLU_VERSION = 100800; +public static final int GLU_EXTENSIONS = 100801; + +// Extensions +public static final String versionString = "1.3"; +public static final String extensionString = "GLU_EXT_nurbs_tessellator " + + "GLU_EXT_object_space_tess "; + +// ErrorCode +public static final int GLU_INVALID_ENUM = 100900; +public static final int GLU_INVALID_VALUE = 100901; +public static final int GLU_OUT_OF_MEMORY = 100902; +public static final int GLU_INVALID_OPERATION = 100904; + +private java.nio.ByteBuffer copyToByteBuffer(java.nio.Buffer buf) { + if (buf instanceof java.nio.ByteBuffer) { + if (buf.position() == 0) { + return (java.nio.ByteBuffer) buf; + } + return BufferUtil.copyByteBuffer((java.nio.ByteBuffer) buf); + } else if (buf instanceof java.nio.ShortBuffer) { + return BufferUtil.copyShortBufferAsByteBuffer((java.nio.ShortBuffer) buf); + } else if (buf instanceof java.nio.IntBuffer) { + return BufferUtil.copyIntBufferAsByteBuffer((java.nio.IntBuffer) buf); + } else if (buf instanceof java.nio.FloatBuffer) { + return BufferUtil.copyFloatBufferAsByteBuffer((java.nio.FloatBuffer) buf); + } else { + throw new IllegalArgumentException("Unsupported buffer type (must be one of byte, short, int, or float)"); + } +} + +private int gluScaleImageJava( int format, int widthin, int heightin, + int typein, java.nio.Buffer datain, int widthout, int heightout, + int typeout, java.nio.Buffer dataout ) { + java.nio.ByteBuffer in = null; + java.nio.ByteBuffer out = null; + in = copyToByteBuffer(datain); + if( dataout instanceof java.nio.ByteBuffer ) { + out = (java.nio.ByteBuffer)dataout; + } else if( dataout instanceof java.nio.ShortBuffer ) { + out = BufferUtil.newByteBuffer(dataout.remaining() * BufferUtil.SIZEOF_SHORT); + } else if ( dataout instanceof java.nio.IntBuffer ) { + out = BufferUtil.newByteBuffer(dataout.remaining() * BufferUtil.SIZEOF_INT); + } else if ( dataout instanceof java.nio.FloatBuffer ) { + out = BufferUtil.newByteBuffer(dataout.remaining() * BufferUtil.SIZEOF_FLOAT); + } else { + throw new IllegalArgumentException("Unsupported destination buffer type (must be byte, short, int, or float)"); + } + int errno = Mipmap.gluScaleImage( getCurrentGL(), format, widthin, heightin, typein, in, + widthout, heightout, typeout, out ); + if( errno == 0 ) { + out.rewind(); + if (out != dataout) { + if( dataout instanceof java.nio.ShortBuffer ) { + ((java.nio.ShortBuffer) dataout).put(out.asShortBuffer()); + } else if( dataout instanceof java.nio.IntBuffer ) { + ((java.nio.IntBuffer) dataout).put(out.asIntBuffer()); + } else if( dataout instanceof java.nio.FloatBuffer ) { + ((java.nio.FloatBuffer) dataout).put(out.asFloatBuffer()); + } else { + throw new RuntimeException("Should not reach here"); + } + } + } + return( errno ); +} + + +private int gluBuild1DMipmapLevelsJava( int target, int internalFormat, int width, + int format, int type, int userLevel, int baseLevel, int maxLevel, + java.nio.Buffer data ) { + java.nio.ByteBuffer buffer = copyToByteBuffer(data); + return( Mipmap.gluBuild1DMipmapLevels( getCurrentGL(), target, internalFormat, width, + format, type, userLevel, baseLevel, maxLevel, buffer ) ); +} + + +private int gluBuild1DMipmapsJava( int target, int internalFormat, int width, + int format, int type, java.nio.Buffer data ) { + java.nio.ByteBuffer buffer = copyToByteBuffer(data); + return( Mipmap.gluBuild1DMipmaps( getCurrentGL(), target, internalFormat, width, format, + type, buffer ) ); +} + + +private int gluBuild2DMipmapLevelsJava( int target, int internalFormat, int width, + int height, int format, int type, int userLevel, int baseLevel, + int maxLevel, java.nio.Buffer data ) { + // While the code below handles other data types, it doesn't handle non-ByteBuffers + data = copyToByteBuffer(data); + return( Mipmap.gluBuild2DMipmapLevels( getCurrentGL(), target, internalFormat, width, + height, format, type, userLevel, baseLevel, maxLevel, data ) ); +} + +private int gluBuild2DMipmapsJava( int target, int internalFormat, int width, + int height, int format, int type, java.nio.Buffer data ) { + // While the code below handles other data types, it doesn't handle non-ByteBuffers + data = copyToByteBuffer(data); + return( Mipmap.gluBuild2DMipmaps( getCurrentGL(), target, internalFormat, width, height, + format, type, data) ); +} + +private int gluBuild3DMipmapLevelsJava( int target, int internalFormat, int width, + int height, int depth, int format, int type, int userLevel, int baseLevel, + int maxLevel, java.nio.Buffer data) { + java.nio.ByteBuffer buffer = copyToByteBuffer(data); + return( Mipmap.gluBuild3DMipmapLevels( getCurrentGL(), target, internalFormat, width, + height, depth, format, type, userLevel, baseLevel, maxLevel, buffer) ); +} + +private int gluBuild3DMipmapsJava( int target, int internalFormat, int width, + int height, int depth, int format, int type, java.nio.Buffer data ) { + java.nio.ByteBuffer buffer = copyToByteBuffer(data); + return( Mipmap.gluBuild3DMipmaps( getCurrentGL(), target, internalFormat, width, height, + depth, format, type, buffer ) ); +} + +*********************/ + +//---------------------------------------------------------------------- +// Wrappers for mipmap and image scaling entry points which dispatch either +// to the Java or C versions. +// + +/** Interface to C language function: <br> <code> GLint gluBuild1DMipmapLevels(GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void * data); </code> */ +/* +public int gluBuild1DMipmapLevels(int target, int internalFormat, int width, int format, int type, int level, int base, int max, java.nio.Buffer data) { + if (useJavaMipmapCode) { + return gluBuild1DMipmapLevelsJava(target, internalFormat, width, format, type, level, base, max, data); + } else { + return gluBuild1DMipmapLevelsC(target, internalFormat, width, format, type, level, base, max, data); + } +} +*/ + +/** Interface to C language function: <br> <code> GLint gluBuild1DMipmaps(GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void * data); </code> */ +/* +public int gluBuild1DMipmaps(int target, int internalFormat, int width, int format, int type, java.nio.Buffer data) { + if (useJavaMipmapCode) { + return gluBuild1DMipmapsJava(target, internalFormat, width, format, type, data); + } else { + return gluBuild1DMipmapsC(target, internalFormat, width, format, type, data); + } +} +*/ + +/** Interface to C language function: <br> <code> GLint gluBuild2DMipmapLevels(GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void * data); </code> */ +/* +public int gluBuild2DMipmapLevels(int target, int internalFormat, int width, int height, int format, int type, int level, int base, int max, java.nio.Buffer data) { + if (useJavaMipmapCode) { + return gluBuild2DMipmapLevelsJava(target, internalFormat, width, height, format, type, level, base, max, data); + } else { + return gluBuild2DMipmapLevelsC(target, internalFormat, width, height, format, type, level, base, max, data); + } +} +*/ + +/** Interface to C language function: <br> <code> GLint gluBuild2DMipmaps(GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * data); </code> */ +/* +public int gluBuild2DMipmaps(int target, int internalFormat, int width, int height, int format, int type, java.nio.Buffer data) { + if (useJavaMipmapCode) { + return gluBuild2DMipmapsJava(target, internalFormat, width, height, format, type, data); + } else { + return gluBuild2DMipmapsC(target, internalFormat, width, height, format, type, data); + } +} +*/ + +/** Interface to C language function: <br> <code> GLint gluBuild3DMipmapLevels(GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void * data); </code> */ +/* +public int gluBuild3DMipmapLevels(int target, int internalFormat, int width, int height, int depth, int format, int type, int level, int base, int max, java.nio.Buffer data) { + if (useJavaMipmapCode) { + return gluBuild3DMipmapLevelsJava(target, internalFormat, width, height, depth, format, type, level, base, max, data); + } else { + return gluBuild3DMipmapLevelsC(target, internalFormat, width, height, depth, format, type, level, base, max, data); + } +} +*/ + +/** Interface to C language function: <br> <code> GLint gluBuild3DMipmaps(GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * data); </code> */ +/* +public int gluBuild3DMipmaps(int target, int internalFormat, int width, int height, int depth, int format, int type, java.nio.Buffer data) { + if (useJavaMipmapCode) { + return gluBuild3DMipmapsJava(target, internalFormat, width, height, depth, format, type, data); + } else { + return gluBuild3DMipmapsC(target, internalFormat, width, height, depth, format, type, data); + } +} +*/ + +/** Interface to C language function: <br> <code> GLint gluScaleImage(GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void * dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid * dataOut); </code> */ +/* +public int gluScaleImage(int format, int wIn, int hIn, int typeIn, java.nio.Buffer dataIn, int wOut, int hOut, int typeOut, java.nio.Buffer dataOut) { + if (useJavaMipmapCode) { + return gluScaleImageJava(format, wIn, hIn, typeIn, dataIn, wOut, hOut, typeOut, dataOut); + } else { + return gluScaleImageC(format, wIn, hIn, typeIn, dataIn, wOut, hOut, typeOut, dataOut); + } +} +*/ + +//---------------------------------------------------------------------- +// GLUProcAddressTable handling +// + +/* +private static GLUProcAddressTable gluProcAddressTable; +private static volatile boolean gluLibraryLoaded; + +private static GLUProcAddressTable getGLUProcAddressTable() { + if (!gluLibraryLoaded) { + loadGLULibrary(); + } + if (gluProcAddressTable == null) { + GLUProcAddressTable tmp = new GLUProcAddressTable(); + ProcAddressHelper.resetProcAddressTable(tmp, GLDrawableFactoryImpl.getFactoryImpl()); + gluProcAddressTable = tmp; + } + return gluProcAddressTable; +} + +private static synchronized void loadGLULibrary() { + if (!gluLibraryLoaded) { + GLDrawableFactoryImpl.getFactoryImpl().loadGLULibrary(); + gluLibraryLoaded = true; + } +} +*/ diff --git a/make/glu-CustomJavaCode-gles2.java b/make/glu-CustomJavaCode-gles2.java new file mode 100755 index 000000000..dc036ac1a --- /dev/null +++ b/make/glu-CustomJavaCode-gles2.java @@ -0,0 +1,38 @@ +/** + * Instantiates a new OpenGL Utility Library object. A GLU object may + * be instantiated at any point in the application and is not + * inherently tied to any particular OpenGL context; however, the GLU + * object may only be used when an OpenGL context is current on the + * current thread. Attempts to call most of the methods in the GLU + * library when no OpenGL context is current will cause an exception + * to be thrown. + * + * <P> + * + * The returned GLU object is not guaranteed to be thread-safe and + * should only be used from one thread at a time. Multiple GLU objects + * may be instantiated to be used from different threads + * simultaneously. + */ + +public GLU() +{ +} + +//---------------------------------------------------------------------- +// Utility routines +// + +/** + * Returns the GL object associated with the OpenGL context current on + * the current thread. Throws GLException if no OpenGL context is + * current. + */ + +public static GL getCurrentGL() throws GLException { + GLContext curContext = GLContext.getCurrent(); + if (curContext == null) { + throw new GLException("No OpenGL context current on this thread"); + } + return curContext.getGL(); +} diff --git a/make/glu-common.cfg b/make/glu-common.cfg index 679e4aef4..b5a92819b 100644 --- a/make/glu-common.cfg +++ b/make/glu-common.cfg @@ -7,11 +7,6 @@ JavaOutputDir ../build/gensrc/classes NativeOutputDir ../build/gensrc/native/jogl HierarchicalNativeOutput false -EmitProcAddressTable true -ProcAddressTablePackage com.sun.opengl.impl -ProcAddressTableClassName GLUProcAddressTable -GetProcAddressTableExpr getGLUProcAddressTable() - # Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums TagNativeBinding true @@ -23,23 +18,6 @@ Import javax.media.opengl.* Import javax.media.opengl.glu.* Import com.sun.opengl.impl.* -# GLU needs access to the GLUtesselatorImpl class for GLUtesselator, -# to the Mipmap class for scaling and mipmap generation, -# and to the nurbs.* package for the NURBS functionality -Import com.sun.opengl.impl.tessellator.GLUtessellatorImpl -Import com.sun.opengl.impl.error.Error -Import com.sun.opengl.impl.mipmap.Mipmap -Import com.sun.opengl.impl.registry.Registry -Import com.sun.opengl.impl.nurbs.* -Import com.sun.opengl.util.* -Import java.security.* - -# Custom Java code for GLU class -IncludeAs CustomJavaCode GLU glu-CustomJavaCode.java - -CustomCCode /* Include the OpenGL GLU header */ -CustomCCode #include <GL/glu.h> - # Raise GLException instead of RuntimeException in glue code RuntimeExceptionType GLException @@ -199,56 +177,3 @@ Ignore gluOrtho2D Ignore gluPerspective Ignore gluLookAt Ignore gluPickMatrix - - - - - -# -# Some functions that return native byte pointers or accept them as -# arguments should have them auto-converted to Java Strings -# -# ReturnsString gluGetString -# ReturnsString gluErrorString -# ArgumentIsString gluCheckExtension 0 1 - -# -# Some routines should only use the Java New IO package -# -#NIOOnly gluScaleImage -#NIOOnly gluBuild1DMipmaps -#NIOOnly gluBuild2DMipmaps -#NIOOnly gluBuild3DMipmaps -#NIOOnly gluBuild1DMipmapLevels -#NIOOnly gluBuild2DMipmapLevels -#NIOOnly gluBuild3DMipmapLevels - -# -# ------------------------ -# Mipmaps -# ------------------------ -# -# Ignore the C versions of the mipmap code in the public interface and -# use GKW's Java port instead. The bindings to the C entry points are -# still being left in for now, but only for debugging purposes and the -# intent is to remove them in a future release. - -# Emit these entry points as private - -AccessControl gluBuild1DMipmapLevels PRIVATE -AccessControl gluBuild1DMipmaps PRIVATE -AccessControl gluBuild2DMipmapLevels PRIVATE -AccessControl gluBuild2DMipmaps PRIVATE -AccessControl gluBuild3DMipmapLevels PRIVATE -AccessControl gluBuild3DMipmaps PRIVATE -AccessControl gluScaleImage PRIVATE - -# Rename these methods in the implementing class - -RenameJavaMethod gluBuild1DMipmapLevels gluBuild1DMipmapLevelsC -RenameJavaMethod gluBuild1DMipmaps gluBuild1DMipmapsC -RenameJavaMethod gluBuild2DMipmapLevels gluBuild2DMipmapLevelsC -RenameJavaMethod gluBuild2DMipmaps gluBuild2DMipmapsC -RenameJavaMethod gluBuild3DMipmapLevels gluBuild3DMipmapLevelsC -RenameJavaMethod gluBuild3DMipmaps gluBuild3DMipmapsC -RenameJavaMethod gluScaleImage gluScaleImageC diff --git a/make/glu-desktop.cfg b/make/glu-desktop.cfg new file mode 100755 index 000000000..6ff160e80 --- /dev/null +++ b/make/glu-desktop.cfg @@ -0,0 +1,53 @@ +EmitProcAddressTable true +ProcAddressTablePackage com.sun.opengl.impl +ProcAddressTableClassName GLUProcAddressTable +GetProcAddressTableExpr getGLUProcAddressTable() + +CustomCCode /* Include the OpenGL GLU header */ +CustomCCode #include <GL/glu.h> + +# Custom Java code for GLU class +IncludeAs CustomJavaCode GLU glu-CustomJavaCode.java + +# GLU needs access to the GLUtesselatorImpl class for GLUtesselator, +# to the Mipmap class for scaling and mipmap generation, +# and to the nurbs.* package for the NURBS functionality +Import com.sun.opengl.impl.tessellator.GLUtessellatorImpl +Import com.sun.opengl.impl.error.Error +Import com.sun.opengl.impl.mipmap.Mipmap +Import com.sun.opengl.impl.registry.Registry +Import com.sun.opengl.impl.nurbs.* +Import com.sun.opengl.util.* +Import java.security.* + +# +# ------------------------ +# Mipmaps +# ------------------------ +# +# Ignore the C versions of the mipmap code in the public interface and +# use GKW's Java port instead. The bindings to the C entry points are +# still being left in for now, but only for debugging purposes and the +# intent is to remove them in a future release. + +# Emit these entry points as private + +AccessControl gluBuild1DMipmapLevels PRIVATE +AccessControl gluBuild1DMipmaps PRIVATE +AccessControl gluBuild2DMipmapLevels PRIVATE +AccessControl gluBuild2DMipmaps PRIVATE +AccessControl gluBuild3DMipmapLevels PRIVATE +AccessControl gluBuild3DMipmaps PRIVATE +AccessControl gluScaleImage PRIVATE + +# Rename these methods in the implementing class + +RenameJavaMethod gluBuild1DMipmapLevels gluBuild1DMipmapLevelsC +RenameJavaMethod gluBuild1DMipmaps gluBuild1DMipmapsC +RenameJavaMethod gluBuild2DMipmapLevels gluBuild2DMipmapLevelsC +RenameJavaMethod gluBuild2DMipmaps gluBuild2DMipmapsC +RenameJavaMethod gluBuild3DMipmapLevels gluBuild3DMipmapLevelsC +RenameJavaMethod gluBuild3DMipmaps gluBuild3DMipmapsC +RenameJavaMethod gluScaleImage gluScaleImageC + +Include glu-common.cfg diff --git a/make/glu-es1.cfg b/make/glu-es1.cfg new file mode 100755 index 000000000..4aa982ecf --- /dev/null +++ b/make/glu-es1.cfg @@ -0,0 +1,15 @@ +# This .cfg file is used to generate the GLU implementation for OpenGL ES 1.0, +# where it is pure Java. + +Ignore gluBuild1DMipmapLevels +Ignore gluBuild1DMipmaps +Ignore gluBuild2DMipmapLevels +Ignore gluBuild2DMipmaps +Ignore gluBuild3DMipmapLevels +Ignore gluBuild3DMipmaps +Ignore gluScaleImage + +# Custom Java code for GLU class +IncludeAs CustomJavaCode GLU glu-CustomJavaCode-gles1.java + +Include glu-common.cfg diff --git a/make/glu-macosx.cfg b/make/glu-macosx.cfg index ef106a3eb..85d75b3c5 100755 --- a/make/glu-macosx.cfg +++ b/make/glu-macosx.cfg @@ -6,4 +6,4 @@ CustomCCode #include <jni.h> CustomCCode #include </usr/include/machine/types.h> -Include glu-common.cfg +Include glu-desktop.cfg diff --git a/make/glu-win32.cfg b/make/glu-win32.cfg index 5221a5c01..341a88e98 100755 --- a/make/glu-win32.cfg +++ b/make/glu-win32.cfg @@ -11,5 +11,4 @@ CustomCCode #if _MSC_VER <= 1200 CustomCCode typedef int intptr_t; CustomCCode #endif -Include glu-common.cfg - +Include glu-desktop.cfg diff --git a/make/glu-x11.cfg b/make/glu-x11.cfg index ec7b1bce4..8b204fe2c 100755 --- a/make/glu-x11.cfg +++ b/make/glu-x11.cfg @@ -3,5 +3,5 @@ CustomCCode #include <inttypes.h> -Include glu-common.cfg +Include glu-desktop.cfg diff --git a/make/stub_includes/common/gles1.c b/make/stub_includes/common/gles1.c new file mode 100755 index 000000000..63df1c967 --- /dev/null +++ b/make/stub_includes/common/gles1.c @@ -0,0 +1,9 @@ +#define GLAPI +#define GL_APICALL + +// Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in +// "glext.h" are parsed. +#define GL_GLEXT_PROTOTYPES + +#include <GLES/gl.h> +#include <GLES/glext.h> diff --git a/make/stub_includes/common/gles2.c b/make/stub_includes/common/gles2.c new file mode 100755 index 000000000..d0b44a46f --- /dev/null +++ b/make/stub_includes/common/gles2.c @@ -0,0 +1,8 @@ +#define GLAPI +#define GL_APICALL + +// Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in +// "glext.h" are parsed. +#define GL_GLEXT_PROTOTYPES + +#include <GLES2/gl2ext.h> diff --git a/make/stub_includes/opengl/GLES/gl.h b/make/stub_includes/opengl/GLES/gl.h new file mode 100755 index 000000000..da71230b5 --- /dev/null +++ b/make/stub_includes/opengl/GLES/gl.h @@ -0,0 +1,801 @@ +#ifndef __gl_h_ +#define __gl_h_ + +/* $Id$ */ + +#include <GLES/glplatform.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.0 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. This software +** was created using the OpenGL(R) version 1.2.1 Sample Implementation +** published by SGI, but has not been independently verified as being +** compliant with the OpenGL(R) version 1.2.1 Specification. +*/ + +typedef unsigned int GLenum; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef signed char GLbyte; +typedef short GLshort; +typedef int GLint; +typedef int GLsizei; +typedef unsigned char GLubyte; +typedef unsigned short GLushort; +typedef unsigned int GLuint; +typedef float GLfloat; +typedef float GLclampf; +typedef void GLvoid; +typedef int GLfixed; +typedef int GLclampx; + +typedef int GLintptr; +typedef int GLsizeiptr; + + +/*************************************************************/ + +/* OpenGL ES core versions */ +#define GL_VERSION_ES_CM_1_0 1 +#define GL_VERSION_ES_CL_1_0 1 +#define GL_VERSION_ES_CM_1_1 1 +#define GL_VERSION_ES_CL_1_1 1 + +/* ClearBufferMask */ +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_COLOR_BUFFER_BIT 0x00004000 + +/* Boolean */ +#define GL_FALSE 0 +#define GL_TRUE 1 + +/* BeginMode */ +#define GL_POINTS 0x0000 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_LINE_STRIP 0x0003 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 + +/* AlphaFunction */ +#define GL_NEVER 0x0200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 + +/* BlendingFactorDest */ +#define GL_ZERO 0 +#define GL_ONE 1 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 + +/* BlendingFactorSrc */ +/* GL_ZERO */ +/* GL_ONE */ +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +/* GL_SRC_ALPHA */ +/* GL_ONE_MINUS_SRC_ALPHA */ +/* GL_DST_ALPHA */ +/* GL_ONE_MINUS_DST_ALPHA */ + +/* ClipPlaneName */ +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 + +/* ColorMaterialFace */ +/* GL_FRONT_AND_BACK */ + +/* ColorMaterialParameter */ +/* GL_AMBIENT_AND_DIFFUSE */ + +/* ColorPointerType */ +/* GL_UNSIGNED_BYTE */ +/* GL_FLOAT */ +/* GL_FIXED */ + +/* CullFaceMode */ +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_FRONT_AND_BACK 0x0408 + +/* DepthFunction */ +/* GL_NEVER */ +/* GL_LESS */ +/* GL_EQUAL */ +/* GL_LEQUAL */ +/* GL_GREATER */ +/* GL_NOTEQUAL */ +/* GL_GEQUAL */ +/* GL_ALWAYS */ + +/* EnableCap */ +#define GL_FOG 0x0B60 +#define GL_LIGHTING 0x0B50 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_CULL_FACE 0x0B44 +#define GL_ALPHA_TEST 0x0BC0 +#define GL_BLEND 0x0BE2 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_DITHER 0x0BD0 +#define GL_STENCIL_TEST 0x0B90 +#define GL_DEPTH_TEST 0x0B71 +/* GL_LIGHT0 */ +/* GL_LIGHT1 */ +/* GL_LIGHT2 */ +/* GL_LIGHT3 */ +/* GL_LIGHT4 */ +/* GL_LIGHT5 */ +/* GL_LIGHT6 */ +/* GL_LIGHT7 */ +#define GL_POINT_SMOOTH 0x0B10 +#define GL_LINE_SMOOTH 0x0B20 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_NORMALIZE 0x0BA1 +#define GL_RESCALE_NORMAL 0x803A +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 + +/* ErrorCode */ +#define GL_NO_ERROR 0 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 + +/* FogMode */ +/* GL_LINEAR */ +#define GL_EXP 0x0800 +#define GL_EXP2 0x0801 + +/* FogParameter */ +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_COLOR 0x0B66 + +/* FrontFaceDirection */ +#define GL_CW 0x0900 +#define GL_CCW 0x0901 + +/* GetPName */ +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_LINE_WIDTH 0x0B21 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_SHADE_MODEL 0x0B54 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_MATRIX_MODE 0x0BA0 +#define GL_VIEWPORT 0x0BA2 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_ALPHA_TEST_FUNC 0x0BC1 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_BLEND_DST 0x0BE0 +#define GL_BLEND_SRC 0x0BE1 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB + +/* GetTextureParameter */ +/* GL_TEXTURE_MAG_FILTER */ +/* GL_TEXTURE_MIN_FILTER */ +/* GL_TEXTURE_WRAP_S */ +/* GL_TEXTURE_WRAP_T */ + +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 + +/* HintMode */ +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 + +/* HintTarget */ +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_FOG_HINT 0x0C54 +#define GL_GENERATE_MIPMAP_HINT 0x8192 + +/* LightModelParameter */ +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 + +/* LightParameter */ +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 + +/* DataType */ +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_FLOAT 0x1406 +#define GL_FIXED 0x140C + +/* LogicOp */ +#define GL_CLEAR 0x1500 +#define GL_AND 0x1501 +#define GL_AND_REVERSE 0x1502 +#define GL_COPY 0x1503 +#define GL_AND_INVERTED 0x1504 +#define GL_NOOP 0x1505 +#define GL_XOR 0x1506 +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_EQUIV 0x1509 +#define GL_INVERT 0x150A +#define GL_OR_REVERSE 0x150B +#define GL_COPY_INVERTED 0x150C +#define GL_OR_INVERTED 0x150D +#define GL_NAND 0x150E +#define GL_SET 0x150F + +/* MaterialFace */ +/* GL_FRONT_AND_BACK */ + +/* MaterialParameter */ +#define GL_EMISSION 0x1600 +#define GL_SHININESS 0x1601 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +/* GL_AMBIENT */ +/* GL_DIFFUSE */ +/* GL_SPECULAR */ + +/* MatrixMode */ +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 + +/* NormalPointerType */ +/* GL_BYTE */ +/* GL_SHORT */ +/* GL_FLOAT */ +/* GL_FIXED */ + +/* PixelFormat */ +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A + +/* PixelStoreParameter */ +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_ALIGNMENT 0x0D05 + +/* PixelType */ +/* GL_UNSIGNED_BYTE */ +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 + +/* ShadingModel */ +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 + +/* StencilFunction */ +/* GL_NEVER */ +/* GL_LESS */ +/* GL_EQUAL */ +/* GL_LEQUAL */ +/* GL_GREATER */ +/* GL_NOTEQUAL */ +/* GL_GEQUAL */ +/* GL_ALWAYS */ + +/* StencilOp */ +/* GL_ZERO */ +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +/* GL_INVERT */ + +/* StringName */ +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 + +/* TexCoordPointerType */ +/* GL_SHORT */ +/* GL_FLOAT */ +/* GL_FIXED */ +/* GL_BYTE */ + +/* TextureEnvMode */ +#define GL_MODULATE 0x2100 +#define GL_DECAL 0x2101 +/* GL_BLEND */ +#define GL_ADD 0x0104 +/* GL_REPLACE */ + +/* TextureEnvParameter */ +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_ENV_COLOR 0x2201 + +/* TextureEnvTarget */ +#define GL_TEXTURE_ENV 0x2300 + +/* TextureMagFilter */ +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 + +/* TextureMinFilter */ +/* GL_NEAREST */ +/* GL_LINEAR */ +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 + +/* TextureParameterName */ +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_GENERATE_MIPMAP 0x8191 + +/* TextureTarget */ +/* GL_TEXTURE_2D */ + +/* TextureUnit */ +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 + +/* TextureWrapMode */ +#define GL_REPEAT 0x2901 +#define GL_CLAMP_TO_EDGE 0x812F + +/* VertexPointerType */ +/* GL_SHORT */ +/* GL_FLOAT */ +/* GL_FIXED */ +/* GL_BYTE */ + +/* LightName */ +#define GL_LIGHT0 0x4000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 + +/* Buffer Objects */ +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 + +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A + +#define GL_STATIC_DRAW 0x88E4 +#define GL_DYNAMIC_DRAW 0x88E8 + +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 + +/* Texture combine + dot3 */ +#define GL_SUBTRACT 0x84E7 +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A + +#define GL_ALPHA_SCALE 0x0D1C + +#define GL_SRC0_RGB 0x8580 +#define GL_SRC1_RGB 0x8581 +#define GL_SRC2_RGB 0x8582 +#define GL_SRC0_ALPHA 0x8588 +#define GL_SRC1_ALPHA 0x8589 +#define GL_SRC2_ALPHA 0x858A + +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF + +/*------------------------------------------------------------------------* + * required OES extension tokens + *------------------------------------------------------------------------*/ + +/* OES_read_format */ +#ifndef GL_OES_read_format +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B +#endif + +/* GL_OES_compressed_paletted_texture */ +#ifndef GL_OES_compressed_paletted_texture +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 +#endif + +/* OES_point_size_array */ +#ifndef GL_OES_point_size_array +#define GL_POINT_SIZE_ARRAY_OES 0x8B9C +#define GL_POINT_SIZE_ARRAY_TYPE_OES 0x898A +#define GL_POINT_SIZE_ARRAY_STRIDE_OES 0x898B +#define GL_POINT_SIZE_ARRAY_POINTER_OES 0x898C +#define GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES 0x8B9F +#endif + +/* GL_OES_point_sprite */ +#ifndef GL_OES_point_sprite +#define GL_POINT_SPRITE_OES 0x8861 +#define GL_COORD_REPLACE_OES 0x8862 +#endif + +/*************************************************************/ + +/* Available only in Common profile */ +GL_API void GL_APIENTRY glAlphaFunc (GLenum func, GLclampf ref); +GL_API void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GL_API void GL_APIENTRY glClearDepthf (GLclampf depth); +GL_API void GL_APIENTRY glClipPlanef (GLenum plane, const GLfloat *equation); +GL_API void GL_APIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GL_API void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar); +GL_API void GL_APIENTRY glFogf (GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glFogfv (GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glFrustumf (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +/* FIXME: GlueGen generates incorrect code for this one */ +/* GL_API void GL_APIENTRY glGetClipPlanef (GLenum pname, GLfloat eqn[4]); */ +GL_API void GL_APIENTRY glGetClipPlanef (GLenum pname, GLfloat* eqn); +GL_API void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glGetTexEnvfv (GLenum tenv, GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glLightModelf (GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glLightModelfv (GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glLineWidth (GLfloat width); +GL_API void GL_APIENTRY glLoadMatrixf (const GLfloat *m); +GL_API void GL_APIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glMultMatrixf (const GLfloat *m); +GL_API void GL_APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GL_API void GL_APIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); +GL_API void GL_APIENTRY glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +GL_API void GL_APIENTRY glPointParameterf (GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glPointSize (GLfloat size); +GL_API void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GL_API void GL_APIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GL_API void GL_APIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); +GL_API void GL_APIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); + +/* Available in both Common and Common-Lite profiles */ +GL_API void GL_APIENTRY glActiveTexture (GLenum texture); +GL_API void GL_APIENTRY glAlphaFuncx (GLenum func, GLclampx ref); +GL_API void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); +GL_API void GL_APIENTRY glBindTexture (GLenum target, GLuint texture); +GL_API void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GL_API void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +GL_API void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +GL_API void GL_APIENTRY glClear (GLbitfield mask); +GL_API void GL_APIENTRY glClearColorx (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); +GL_API void GL_APIENTRY glClearDepthx (GLclampx depth); +GL_API void GL_APIENTRY glClearStencil (GLint s); +GL_API void GL_APIENTRY glClientActiveTexture (GLenum texture); +GL_API void GL_APIENTRY glClipPlanex (GLenum plane, const GLfixed *equation); +GL_API void GL_APIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +GL_API void GL_APIENTRY glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GL_API void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GL_API void GL_APIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GL_API void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +GL_API void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +GL_API void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GL_API void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GL_API void GL_APIENTRY glCullFace (GLenum mode); +GL_API void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); +GL_API void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); +GL_API void GL_APIENTRY glDepthFunc (GLenum func); +GL_API void GL_APIENTRY glDepthMask (GLboolean flag); +GL_API void GL_APIENTRY glDepthRangex (GLclampx zNear, GLclampx zFar); +GL_API void GL_APIENTRY glDisable (GLenum cap); +GL_API void GL_APIENTRY glDisableClientState (GLenum array); +GL_API void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GL_API void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); +GL_API void GL_APIENTRY glEnable (GLenum cap); +GL_API void GL_APIENTRY glEnableClientState (GLenum array); +GL_API void GL_APIENTRY glFinish (void); +GL_API void GL_APIENTRY glFlush (void); +GL_API void GL_APIENTRY glFogx (GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glFogxv (GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glFrontFace (GLenum mode); +GL_API void GL_APIENTRY glFrustumx (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +GL_API void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *params); +GL_API void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); +/* FIXME: GlueGen generates incorrect code for this one */ +/* GL_API void GL_APIENTRY glGetClipPlanex (GLenum pname, GLfixed eqn[4]); */ +GL_API void GL_APIENTRY glGetClipPlanex (GLenum pname, GLfixed* eqn); +GL_API void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); +GL_API void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures); +GL_API GLenum GL_APIENTRY glGetError (void); +GL_API void GL_APIENTRY glGetFixedv (GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *params); +GL_API void GL_APIENTRY glGetLightxv (GLenum light, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetMaterialxv (GLenum face, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetPointerv (GLenum pname, void **params); +GL_API const GLubyte * GL_APIENTRY glGetString (GLenum name); +GL_API void GL_APIENTRY glGetTexEnviv (GLenum tenv, GLenum pname, GLint *params); +GL_API void GL_APIENTRY glGetTexEnvxv (GLenum tenv, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); +GL_API void GL_APIENTRY glGetTexParameterxv (GLenum target, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glHint (GLenum target, GLenum mode); +GL_API GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); +GL_API GLboolean GL_APIENTRY glIsEnabled (GLenum cap); +GL_API GLboolean GL_APIENTRY glIsTexture (GLuint texture); +GL_API void GL_APIENTRY glLightModelx (GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glLightModelxv (GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glLightx (GLenum light, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glLightxv (GLenum light, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glLineWidthx (GLfixed width); +GL_API void GL_APIENTRY glLoadIdentity (void); +GL_API void GL_APIENTRY glLoadMatrixx (const GLfixed *m); +GL_API void GL_APIENTRY glLogicOp (GLenum opcode); +GL_API void GL_APIENTRY glMaterialx (GLenum face, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glMaterialxv (GLenum face, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glMatrixMode (GLenum mode); +GL_API void GL_APIENTRY glMultMatrixx (const GLfixed *m); +GL_API void GL_APIENTRY glMultiTexCoord4x (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +GL_API void GL_APIENTRY glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz); +GL_API void GL_APIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GL_API void GL_APIENTRY glOrthox (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +GL_API void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); +GL_API void GL_APIENTRY glPointParameterx (GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glPointParameterxv (GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glPointSizex (GLfixed size); +GL_API void GL_APIENTRY glPolygonOffsetx (GLfixed factor, GLfixed units); +GL_API void GL_APIENTRY glPopMatrix (void); +GL_API void GL_APIENTRY glPushMatrix (void); +GL_API void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); +GL_API void GL_APIENTRY glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +GL_API void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert); +GL_API void GL_APIENTRY glSampleCoveragex (GLclampx value, GLboolean invert); +GL_API void GL_APIENTRY glScalex (GLfixed x, GLfixed y, GLfixed z); +GL_API void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GL_API void GL_APIENTRY glShadeModel (GLenum mode); +GL_API void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GL_API void GL_APIENTRY glStencilMask (GLuint mask); +GL_API void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GL_API void GL_APIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GL_API void GL_APIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); +GL_API void GL_APIENTRY glTexEnvx (GLenum target, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); +GL_API void GL_APIENTRY glTexEnvxv (GLenum target, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GL_API void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GL_API void GL_APIENTRY glTexParameterx (GLenum target, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); +GL_API void GL_APIENTRY glTexParameterxv (GLenum target, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GL_API void GL_APIENTRY glTranslatex (GLfixed x, GLfixed y, GLfixed z); +GL_API void GL_APIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GL_API void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); + +/*------------------------------------------------------------------------* + * Required OES extension functions + *------------------------------------------------------------------------*/ + +/* GL_OES_read_format */ +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 +#endif + +/* GL_OES_compressed_paletted_texture */ +#ifndef GL_OES_compressed_paletted_texture +#define GL_OES_compressed_paletted_texture 1 +#endif + +/* GL_OES_point_size_array */ +#ifndef GL_OES_point_size_array +#define GL_OES_point_size_array 1 +GL_API void GL_APIENTRY glPointSizePointerOES (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +/* GL_OES_point_sprite */ +#ifndef GL_OES_point_sprite +#define GL_OES_point_sprite 1 +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __gl_h_ */ diff --git a/make/stub_includes/opengl/GLES/glext.h b/make/stub_includes/opengl/GLES/glext.h new file mode 100755 index 000000000..ee6ebae20 --- /dev/null +++ b/make/stub_includes/opengl/GLES/glext.h @@ -0,0 +1,662 @@ +/* + * Copyright (c) 2007 NVIDIA Corporation. All rights reserved. + * + * NVIDIA Corporation and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA Corporation is strictly prohibited. + */ + +#ifndef __glext_h_ +#define __glext_h_ + +/* $Id$ */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.0 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. This software +** was created using the OpenGL(R) version 1.2.1 Sample Implementation +** published by SGI, but has not been independently verified as being +** compliant with the OpenGL(R) version 1.2.1 Specification. +*/ + +#ifndef GL_APIENTRYP +# define GL_APIENTRYP GL_APIENTRY* +#endif + +/*------------------------------------------------------------------------* + * OES extension tokens + *------------------------------------------------------------------------*/ + +/* GL_OES_blend_equation_separate */ +#ifndef GL_OES_blend_equation_separate +/* BLEND_EQUATION_RGB_OES same as BLEND_EQUATION_OES */ +#define GL_BLEND_EQUATION_RGB_OES 0x8009 +#define GL_BLEND_EQUATION_ALPHA_OES 0x883D +#endif + +/* GL_OES_blend_func_separate */ +#ifndef GL_OES_blend_func_separate +#define GL_BLEND_DST_RGB_OES 0x80C8 +#define GL_BLEND_SRC_RGB_OES 0x80C9 +#define GL_BLEND_DST_ALPHA_OES 0x80CA +#define GL_BLEND_SRC_ALPHA_OES 0x80CB +#endif + +/* GL_OES_blend_subtract */ +#ifndef GL_OES_blend_subtract +#define GL_BLEND_EQUATION_OES 0x8009 +#define GL_FUNC_ADD_OES 0x8006 +#define GL_FUNC_SUBTRACT_OES 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_OES 0x800B +#endif + +/* GL_OES_compressed_ETC1_RGB8_texture */ +#ifndef GL_OES_compressed_ETC1_RGB8_texture +#define GL_ETC1_RGB8_OES 0x8D64 +#endif + +/* OES_draw_texture */ +#ifndef GL_OES_draw_texture +#define GL_TEXTURE_CROP_RECT_OES 0x8B9D +#endif + +/* OES_fixed_point */ +#ifndef GL_OES_fixed_point +#define GL_FIXED_OES 0x140C +#endif + +/* OES_framebuffer_object */ +#ifndef GL_OES_framebuffer_object +#define GL_NONE_OES 0 +#define GL_FRAMEBUFFER_OES 0x8D40 +#define GL_RENDERBUFFER_OES 0x8D41 +#define GL_RGBA4_OES 0x8056 +#define GL_RGB5_A1_OES 0x8057 +#define GL_RGB565_OES 0x8D62 +#define GL_DEPTH_COMPONENT16_OES 0x81A5 +#define GL_RENDERBUFFER_WIDTH_OES 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_OES 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_OES 0x8D44 +#define GL_RENDERBUFFER_RED_SIZE_OES 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_OES 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_OES 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_OES 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_OES 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_OES 0x8D55 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES 0x8CD3 +#define GL_COLOR_ATTACHMENT0_OES 0x8CE0 +#define GL_DEPTH_ATTACHMENT_OES 0x8D00 +#define GL_STENCIL_ATTACHMENT_OES 0x8D20 +#define GL_FRAMEBUFFER_COMPLETE_OES 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES 0x8CDA +#define GL_FRAMEBUFFER_UNSUPPORTED_OES 0x8CDD +#define GL_FRAMEBUFFER_BINDING_OES 0x8CA6 +#define GL_RENDERBUFFER_BINDING_OES 0x8CA7 +#define GL_MAX_RENDERBUFFER_SIZE_OES 0x84E8 +#define GL_INVALID_FRAMEBUFFER_OPERATION_OES 0x0506 +#endif + +/* OES_matrix_get */ +#ifndef GL_OES_matrix_get +#define GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES 0x898D +#define GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES 0x898E +#define GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES 0x898F +#endif + +/* OES_matrix_palette */ +#ifndef GL_OES_matrix_palette +#define GL_MAX_VERTEX_UNITS_OES 0x86A4 +#define GL_MAX_PALETTE_MATRICES_OES 0x8842 +#define GL_MATRIX_PALETTE_OES 0x8840 +#define GL_MATRIX_INDEX_ARRAY_OES 0x8844 +#define GL_WEIGHT_ARRAY_OES 0x86AD +#define GL_CURRENT_PALETTE_MATRIX_OES 0x8843 +#define GL_MATRIX_INDEX_ARRAY_SIZE_OES 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_OES 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_OES 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_OES 0x8849 +#define GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES 0x8B9E +#define GL_WEIGHT_ARRAY_SIZE_OES 0x86AB +#define GL_WEIGHT_ARRAY_TYPE_OES 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_OES 0x86AA +#define GL_WEIGHT_ARRAY_POINTER_OES 0x86AC +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_OES 0x889E +#endif + +/* GL_OES_stencil_wrap */ +#ifndef GL_OES_stencil_wrap +#define GL_INCR_WRAP_OES 0x8507 +#define GL_DECR_WRAP_OES 0x8508 +#endif + +/* GL_OES_texture_cube_map */ +#ifndef GL_OES_texture_cube_map +#define GL_NORMAL_MAP_OES 0x8511 +#define GL_REFLECTION_MAP_OES 0x8512 +#define GL_TEXTURE_CUBE_MAP_OES 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_OES 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES 0x851A +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES 0x851C +#define GL_TEXTURE_GEN_MODE_OES 0x2500 +#define GL_TEXTURE_GEN_STR_OES 0x8D60 +#endif + +/* GL_OES_texture_mirrored_repeat */ +#ifndef GL_OES_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_OES 0x8370 +#endif + +/* GL_OES_EGL_image */ +#ifndef GL_OES_EGL_image +typedef void* GLeglImageOES; +#endif + +/* GL_OES_depth24 */ +#ifndef GL_OES_depth24 +#define GL_DEPTH_COMPONENT24_OES 0x81A6 +#endif + +/* GL_OES_depth32 */ +#ifndef GL_OES_depth32 +#define GL_DEPTH_COMPONENT32_OES 0x81A7 +#endif + +/* GL_OES_mapbuffer */ +#ifndef GL_OES_mapbuffer +#define GL_WRITE_ONLY_OES 0x88B9 +#define GL_BUFFER_ACCESS_OES 0x88BB +#define GL_BUFFER_MAPPED_OES 0x88BC +#define GL_BUFFER_MAP_POINTER_OES 0x88BD +#endif + +/* GL_OES_rgb8_rgba8 */ +#ifndef GL_OES_rgb8_rgba8 +#define GL_RGB8_OES 0x8051 +#define GL_RGBA8_OES 0x8058 +#endif + +/* GL_OES_stencil1 */ +#ifndef GL_OES_stencil1 +#define GL_STENCIL_INDEX1_OES 0x8D46 +#endif + +/* GL_OES_stencil4 */ +#ifndef GL_OES_stencil4 +#define GL_STENCIL_INDEX4_OES 0x8D47 +#endif + +/* GL_OES_stencil8 */ +#ifndef GL_OES_stencil8 +#define GL_STENCIL_INDEX8_OES 0x8D48 +#endif + +/* GL_OES_vertex_half_float */ +#ifndef GL_OES_vertex_half_float +#define GL_HALF_FLOAT_OES 0x8D61 +#endif + +/* GL_AMD_compressed_3DC_texture */ +#ifndef GL_AMD_compressed_3DC_texture +#define GL_3DC_X_AMD 0x87F9 +#define GL_3DC_XY_AMD 0x87FA +#endif + +/* GL_AMD_compressed_ATC_texture */ +#ifndef GL_AMD_compressed_ATC_texture +#define GL_ATC_RGB_AMD 0x8C92 +#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 +#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE +#endif + +/* GL_EXT_texture_filter_anisotropic */ +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif + +/* GL_EXT_texture_compression_dxt1 */ +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#endif + +/* GL_EXT_texture_compression_s3tc */ +#ifndef GL_EXT_texture_compression_s3tc +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#endif + +/*------------------------------------------------------------------------* + * OES extension functions + *------------------------------------------------------------------------*/ + +/* GL_OES_blend_equation_separate */ +#ifndef GL_OES_blend_equation_separate +#define GL_OES_blend_equation_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glBlendEquationSeparateOES (GLenum modeRGB, GLenum modeAlpha); +#endif +typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEOESPROC) (GLenum modeRGB, GLenum modeAlpha); +#endif + +/* GL_OES_blend_func_separate */ +#ifndef GL_OES_blend_func_separate +#define GL_OES_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glBlendFuncSeparateOES (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif +typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEOESPROC) (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif + +/* GL_OES_blend_subtract */ +#ifndef GL_OES_blend_subtract +#define GL_OES_blend_subtract 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glBlendEquationOES (GLenum mode); +#endif +typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONOESPROC) (GLenum mode); +#endif + +/* GL_OES_byte_coordinates */ +#ifndef GL_OES_byte_coordinates +#define GL_OES_byte_coordinates 1 +#endif + +/* GL_OES_compressed_ETC1_RGB8_texture */ +#ifndef GL_OES_compressed_ETC1_RGB8_texture +#define GL_OES_compressed_ETC1_RGB8_texture 1 +#endif + +/* GL_OES_draw_texture */ +#ifndef GL_OES_draw_texture +#define GL_OES_draw_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glDrawTexsOES (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height); +GL_API void GL_APIENTRY glDrawTexiOES (GLint x, GLint y, GLint z, GLint width, GLint height); +GL_API void GL_APIENTRY glDrawTexxOES (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height); +GL_API void GL_APIENTRY glDrawTexsvOES (const GLshort *coords); +GL_API void GL_APIENTRY glDrawTexivOES (const GLint *coords); +GL_API void GL_APIENTRY glDrawTexxvOES (const GLfixed *coords); +GL_API void GL_APIENTRY glDrawTexfOES (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height); +GL_API void GL_APIENTRY glDrawTexfvOES (const GLfloat *coords); +#endif +typedef void (GL_APIENTRYP PFNGLDRAWTEXSOESPROC) (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height); +typedef void (GL_APIENTRYP PFNGLDRAWTEXIOESPROC) (GLint x, GLint y, GLint z, GLint width, GLint height); +typedef void (GL_APIENTRYP PFNGLDRAWTEXXOESPROC) (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height); +typedef void (GL_APIENTRYP PFNGLDRAWTEXSVOESPROC) (const GLshort *coords); +typedef void (GL_APIENTRYP PFNGLDRAWTEXIVOESPROC) (const GLint *coords); +typedef void (GL_APIENTRYP PFNGLDRAWTEXXVOESPROC) (const GLfixed *coords); +typedef void (GL_APIENTRYP PFNGLDRAWTEXFOESPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height); +typedef void (GL_APIENTRYP PFNGLDRAWTEXFVOESPROC) (const GLfloat *coords); +#endif + +/* GL_OES_extended_matrix_palette */ +#ifndef GL_OES_extended_matrix_palette +#define GL_OES_extended_matrix_palette 1 +#endif + +/* GL_OES_fixed_point */ +#ifndef GL_OES_fixed_point +#define GL_OES_fixed_point 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glAlphaFuncxOES (GLenum func, GLclampx ref); +GL_API void GL_APIENTRY glClearColorxOES (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); +GL_API void GL_APIENTRY glClearDepthxOES (GLclampx depth); +GL_API void GL_APIENTRY glClipPlanexOES (GLenum plane, const GLfixed *equation); +GL_API void GL_APIENTRY glColor4xOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GL_API void GL_APIENTRY glDepthRangexOES (GLclampx zNear, GLclampx zFar); +GL_API void GL_APIENTRY glFogxOES (GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glFogxvOES (GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glFrustumxOES (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +/* FIXME: GlueGen generates incorrect code for this one */ +/* GL_API void GL_APIENTRY glGetClipPlanexOES (GLenum pname, GLfixed eqn[4]); */ +GL_API void GL_APIENTRY glGetClipPlanexOES (GLenum pname, GLfixed* eqn); +GL_API void GL_APIENTRY glGetFixedvOES (GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetLightxvOES (GLenum light, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetMaterialxvOES (GLenum face, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetTexEnvxvOES (GLenum tenv, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetTexParameterxvOES (GLenum target, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glLightModelxOES (GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glLightModelxvOES (GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glLightxOES (GLenum light, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glLightxvOES (GLenum light, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glLineWidthxOES (GLfixed width); +GL_API void GL_APIENTRY glLoadMatrixxOES (const GLfixed *m); +GL_API void GL_APIENTRY glMaterialxOES (GLenum face, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glMaterialxvOES (GLenum face, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glMultMatrixxOES (const GLfixed *m); +GL_API void GL_APIENTRY glMultiTexCoord4xOES (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +GL_API void GL_APIENTRY glNormal3xOES (GLfixed nx, GLfixed ny, GLfixed nz); +GL_API void GL_APIENTRY glOrthoxOES (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +GL_API void GL_APIENTRY glPointParameterxOES (GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glPointParameterxvOES (GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glPointSizexOES (GLfixed size); +GL_API void GL_APIENTRY glPolygonOffsetxOES (GLfixed factor, GLfixed units); +GL_API void GL_APIENTRY glRotatexOES (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +GL_API void GL_APIENTRY glSampleCoveragexOES (GLclampx value, GLboolean invert); +GL_API void GL_APIENTRY glScalexOES (GLfixed x, GLfixed y, GLfixed z); +GL_API void GL_APIENTRY glTexEnvxOES (GLenum target, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glTexEnvxvOES (GLenum target, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glTexParameterxOES (GLenum target, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glTexParameterxvOES (GLenum target, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glTranslatexOES (GLfixed x, GLfixed y, GLfixed z); +#endif +typedef void (GL_APIENTRYP PFNGLALPHAFUNCXOESPROC) (GLenum func, GLclampx ref); +typedef void (GL_APIENTRYP PFNGLCLEARCOLORXOESPROC) (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); +typedef void (GL_APIENTRYP PFNGLCLEARDEPTHXOESPROC) (GLclampx depth); +typedef void (GL_APIENTRYP PFNGLCLIPPLANEXOESPROC) (GLenum plane, const GLfixed *equation); +typedef void (GL_APIENTRYP PFNGLCOLOR4XOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (GL_APIENTRYP PFNGLDEPTHRANGEXOESPROC) (GLclampx zNear, GLclampx zFar); +typedef void (GL_APIENTRYP PFNGLFOGXOESPROC) (GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLFOGXVOESPROC) (GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLFRUSTUMXOESPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +/* FIXME: GlueGen generates incorrect code for this one */ +/* typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEXOESPROC) (GLenum pname, GLfixed eqn[4]); */ +typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEXOESPROC) (GLenum pname, GLfixed* eqn); +typedef void (GL_APIENTRYP PFNGLGETFIXEDVOESPROC) (GLenum pname, GLfixed *params); +typedef void (GL_APIENTRYP PFNGLGETLIGHTXVOESPROC) (GLenum light, GLenum pname, GLfixed *params); +typedef void (GL_APIENTRYP PFNGLGETMATERIALXVOESPROC) (GLenum face, GLenum pname, GLfixed *params); +typedef void (GL_APIENTRYP PFNGLGETTEXENVXVOESPROC) (GLenum tenv, GLenum pname, GLfixed *params); +typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); +typedef void (GL_APIENTRYP PFNGLLIGHTMODELXOESPROC) (GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLLIGHTMODELXVOESPROC) (GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLLIGHTXVOESPROC) (GLenum light, GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLLINEWIDTHXOESPROC) (GLfixed width); +typedef void (GL_APIENTRYP PFNGLLOADMATRIXXOESPROC) (const GLfixed *m); +typedef void (GL_APIENTRYP PFNGLMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLMATERIALXVOESPROC) (GLenum face, GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLMULTMATRIXXOESPROC) (const GLfixed *m); +typedef void (GL_APIENTRYP PFNGLMULTITEXCOORD4XOESPROC) (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +typedef void (GL_APIENTRYP PFNGLNORMAL3XOESPROC) (GLfixed nx, GLfixed ny, GLfixed nz); +typedef void (GL_APIENTRYP PFNGLORTHOXOESPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXOESPROC) (GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXVOESPROC) (GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLPOINTSIZEXOESPROC) (GLfixed size); +typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETXOESPROC) (GLfixed factor, GLfixed units); +typedef void (GL_APIENTRYP PFNGLROTATEXOESPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEXOESPROC) (GLclampx value, GLboolean invert); +typedef void (GL_APIENTRYP PFNGLSCALEXOESPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (GL_APIENTRYP PFNGLTEXENVXOESPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLTEXENVXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLTRANSLATEXOESPROC) (GLfixed x, GLfixed y, GLfixed z); +#endif + +/* GL_OES_framebuffer_object */ +#ifndef GL_OES_framebuffer_object +#define GL_OES_framebuffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API GLboolean GL_APIENTRY glIsRenderbufferOES (GLuint renderbuffer); +GL_API void GL_APIENTRY glBindRenderbufferOES (GLenum target, GLuint renderbuffer); +GL_API void GL_APIENTRY glDeleteRenderbuffersOES (GLsizei n, const GLuint* renderbuffers); +GL_API void GL_APIENTRY glGenRenderbuffersOES (GLsizei n, GLuint* renderbuffers); +GL_API void GL_APIENTRY glRenderbufferStorageOES (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GL_API void GL_APIENTRY glGetRenderbufferParameterivOES (GLenum target, GLenum pname, GLint* params); +GL_API GLboolean GL_APIENTRY glIsFramebufferOES (GLuint framebuffer); +GL_API void GL_APIENTRY glBindFramebufferOES (GLenum target, GLuint framebuffer); +GL_API void GL_APIENTRY glDeleteFramebuffersOES (GLsizei n, const GLuint* framebuffers); +GL_API void GL_APIENTRY glGenFramebuffersOES (GLsizei n, GLuint* framebuffers); +GL_API GLenum GL_APIENTRY glCheckFramebufferStatusOES (GLenum target); +GL_API void GL_APIENTRY glFramebufferRenderbufferOES (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GL_API void GL_APIENTRY glFramebufferTexture2DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GL_API void GL_APIENTRY glGetFramebufferAttachmentParameterivOES (GLenum target, GLenum attachment, GLenum pname, GLint* params); +GL_API void GL_APIENTRY glGenerateMipmapOES (GLenum target); +#endif +typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFEROESPROC) (GLuint renderbuffer); +typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFEROESPROC) (GLenum target, GLuint renderbuffer); +typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSOESPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSOESPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVOESPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFEROESPROC) (GLuint framebuffer); +typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFEROESPROC) (GLenum target, GLuint framebuffer); +typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSOESPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSOESPROC) (GLsizei n, GLuint* framebuffers); +typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSOESPROC) (GLenum target); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEROESPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVOESPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPOESPROC) (GLenum target); +#endif + +/* GL_OES_matrix_get */ +#ifndef GL_OES_matrix_get +#define GL_OES_matrix_get 1 +#endif + +/* GL_OES_matrix_palette */ +#ifndef GL_OES_matrix_palette +#define GL_OES_matrix_palette 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glCurrentPaletteMatrixOES (GLuint matrixpaletteindex); +GL_API void GL_APIENTRY glLoadPaletteFromModelViewMatrixOES (void); +GL_API void GL_APIENTRY glMatrixIndexPointerOES (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GL_API void GL_APIENTRY glWeightPointerOES (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif +typedef void (GL_APIENTRYP PFNGLCURRENTPALETTEMATRIXOESPROC) (GLuint matrixpaletteindex); +typedef void (GL_APIENTRYP PFNGLLOADPALETTEFROMMODELVIEWMATRIXOESPROC) (void); +typedef void (GL_APIENTRYP PFNGLMATRIXINDEXPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GL_APIENTRYP PFNGLWEIGHTPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +/* GL_OES_query_matrix */ +#ifndef GL_OES_query_matrix +#define GL_OES_query_matrix 1 +#ifdef GL_GLEXT_PROTOTYPES +/* FIXME: GlueGen generates incorrect code for this one */ +/* GL_API GLbitfield GL_APIENTRY glQueryMatrixxOES (GLfixed mantissa[16], GLint exponent[16]); */ +GL_API GLbitfield GL_APIENTRY glQueryMatrixxOES (GLfixed* mantissa, GLint* exponent); +#endif +/* FIXME: GlueGen generates incorrect code for this one */ +/* typedef GLbitfield (GL_APIENTRYP PFNGLQUERYMATRIXXOESPROC) (GLfixed mantissa[16], GLint exponent[16]); */ +typedef GLbitfield (GL_APIENTRYP PFNGLQUERYMATRIXXOESPROC) (GLfixed* mantissa, GLint* exponent); +#endif + +/* GL_OES_single_precision */ +#ifndef GL_OES_single_precision +#define GL_OES_single_precision 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glDepthRangefOES (GLclampf zNear, GLclampf zFar); +GL_API void GL_APIENTRY glFrustumfOES (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +GL_API void GL_APIENTRY glOrthofOES (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +GL_API void GL_APIENTRY glClipPlanefOES (GLenum plane, const GLfloat *equation); +/* FIXME: GlueGen generates incorrect code for this one */ +/* GL_API void GL_APIENTRY glGetClipPlanefOES (GLenum pname, GLfloat eqn[4]); */ +GL_API void GL_APIENTRY glGetClipPlanefOES (GLenum pname, GLfloat* eqn); +GL_API void GL_APIENTRY glClearDepthfOES (GLclampf depth); +#endif +typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFOESPROC) (GLclampf zNear, GLclampf zFar); +typedef void (GL_APIENTRYP PFNGLFRUSTUMFOESPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GL_APIENTRYP PFNGLORTHOFOESPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GL_APIENTRYP PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat *equation); +/* FIXME: GlueGen generates incorrect code for this one */ +/* typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum pname, GLfloat eqn[4]); */ +typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum pname, GLfloat* eqn); +typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampf depth); +#endif + +/* GL_OES_stencil_wrap */ +#ifndef GL_OES_stencil_wrap +#define GL_OES_stencil_wrap 1 +#endif + +/* GL_OES_texture_cube_map */ +#ifndef GL_OES_texture_cube_map +#define GL_OES_texture_cube_map 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glTexGenfOES (GLenum coord, GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glTexGenfvOES (GLenum coord, GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glTexGeniOES (GLenum coord, GLenum pname, GLint param); +GL_API void GL_APIENTRY glTexGenivOES (GLenum coord, GLenum pname, const GLint *params); +GL_API void GL_APIENTRY glTexGenxOES (GLenum coord, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glTexGenxvOES (GLenum coord, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glGetTexGenfvOES (GLenum coord, GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glGetTexGenivOES (GLenum coord, GLenum pname, GLint *params); +GL_API void GL_APIENTRY glGetTexGenxvOES (GLenum coord, GLenum pname, GLfixed *params); +#endif +typedef void (GL_APIENTRYP PFNGLTEXGENFOESPROC) (GLenum coord, GLenum pname, GLfloat param); +typedef void (GL_APIENTRYP PFNGLTEXGENFVOESPROC) (GLenum coord, GLenum pname, const GLfloat *params); +typedef void (GL_APIENTRYP PFNGLTEXGENIOESPROC) (GLenum coord, GLenum pname, GLint param); +typedef void (GL_APIENTRYP PFNGLTEXGENIVOESPROC) (GLenum coord, GLenum pname, const GLint *params); +typedef void (GL_APIENTRYP PFNGLTEXGENXOESPROC) (GLenum coord, GLenum pname, GLfixed param); +typedef void (GL_APIENTRYP PFNGLTEXGENXVOESPROC) (GLenum coord, GLenum pname, const GLfixed *params); +typedef void (GL_APIENTRYP PFNGLGETTEXGENFVOESPROC) (GLenum coord, GLenum pname, GLfloat *params); +typedef void (GL_APIENTRYP PFNGLGETTEXGENIVOESPROC) (GLenum coord, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params); +#endif + +/* GL_OES_texture_env_crossbar */ +#ifndef GL_OES_texture_env_crossbar +#define GL_OES_texture_env_crossbar 1 +#endif + +/* GL_OES_texture_mirrored_repeat */ +#ifndef GL_OES_texture_mirrored_repeat +#define GL_OES_texture_mirrored_repeat 1 +#endif + +/* GL_OES_EGL_image */ +#ifndef GL_OES_EGL_image +#define GL_OES_EGL_image 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); +GL_API void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); +#endif +typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); +typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); +#endif + +/* GL_OES_depth24 */ +#ifndef GL_OES_depth24 +#define GL_OES_depth24 1 +#endif + +/* GL_OES_depth32 */ +#ifndef GL_OES_depth32 +#define GL_OES_depth32 1 +#endif + +/* GL_OES_element_index_uint */ +#ifndef GL_OES_element_index_uint +#define GL_OES_element_index_uint 1 +#endif + +/* GL_OES_fbo_render_mipmap */ +#ifndef GL_OES_fbo_render_mipmap +#define GL_OES_fbo_render_mipmap 1 +#endif + +/* GL_OES_mapbuffer */ +#ifndef GL_OES_mapbuffer +#define GL_OES_mapbuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access); +GL_API GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target); +GL_API void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, void** params); +#endif +typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); +typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target); +typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void** params); +#endif + +/* GL_OES_rgb8_rgba8 */ +#ifndef GL_OES_rgb8_rgba8 +#define GL_OES_rgb8_rgba8 1 +#endif + +/* GL_OES_stencil1 */ +#ifndef GL_OES_stencil1 +#define GL_OES_stencil1 1 +#endif + +/* GL_OES_stencil4 */ +#ifndef GL_OES_stencil4 +#define GL_OES_stencil4 1 +#endif + +/* GL_OES_stencil8 */ +#ifndef GL_OES_stencil8 +#define GL_OES_stencil8 1 +#endif + +/* GL_OES_vertex_half_float */ +#ifndef GL_OES_vertex_half_float +#define GL_OES_vertex_half_float 1 +#endif + +/* GL_AMD_compressed_3DC_texture */ +#ifndef GL_AMD_compressed_3DC_texture +#define GL_AMD_compressed_3DC_texture 1 +#endif + +/* GL_AMD_compressed_ATC_texture */ +#ifndef GL_AMD_compressed_ATC_texture +#define GL_AMD_compressed_ATC_texture 1 +#endif + +/* GL_EXT_texture_filter_anisotropic */ +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#endif + +/* GL_EXT_texture_compression_dxt1 */ +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_EXT_texture_compression_dxt1 1 +#endif + +/* GL_EXT_texture_compression_s3tc */ +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __glext_h_ */ + diff --git a/make/stub_includes/opengl/GLES/glplatform.h b/make/stub_includes/opengl/GLES/glplatform.h new file mode 100755 index 000000000..dd2f20ec3 --- /dev/null +++ b/make/stub_includes/opengl/GLES/glplatform.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2007 NVIDIA Corporation. All rights reserved. + * + * NVIDIA Corporation and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA Corporation is strictly prohibited. + */ + +#ifndef __glplatform_h_ +#define __glplatform_h_ + +/* $Id$ */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.0 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. This software +** was created using the OpenGL(R) version 1.2.1 Sample Implementation +** published by SGI, but has not been independently verified as being +** compliant with the OpenGL(R) version 1.2.1 Specification. +*/ + +/*------------------------------------------------------------------------- + * Definition of GL_API and GL_APIENTRY + *-----------------------------------------------------------------------*/ + +#if defined(AEE_SIMULATOR) +#define __GL_EXPORTS +#endif + +#ifdef __GL_EXPORTS +# define GL_API +#else +# define GL_API extern +#endif + +#define GL_APIENTRY + +#ifdef __cplusplus +} +#endif + +#endif /* __glplatform_h_ */ diff --git a/make/stub_includes/opengl/GLES/glu.h b/make/stub_includes/opengl/GLES/glu.h new file mode 100755 index 000000000..50a94f34e --- /dev/null +++ b/make/stub_includes/opengl/GLES/glu.h @@ -0,0 +1 @@ +// Empty glu.h so that we pick up only the Java routines diff --git a/make/stub_includes/opengl/GLES2/gl2.h b/make/stub_includes/opengl/GLES2/gl2.h new file mode 100755 index 000000000..172c5adb0 --- /dev/null +++ b/make/stub_includes/opengl/GLES2/gl2.h @@ -0,0 +1,677 @@ +#ifndef __gl2_h_ +#define __gl2_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.0 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. This software +** was created using the OpenGL(R) version 1.2.1 Sample Implementation +** published by SGI, but has not been independently verified as being +** compliant with the OpenGL(R) version 1.2.1 Specification. +*/ + +/*------------------------------------------------------------------------- + * Definition of GL_APICALL and GL_APIENTRY + *-----------------------------------------------------------------------*/ + +/* +#if defined(_WIN32) || defined(__VC32__) // Win32 +# if defined (_DLL_EXPORTS) +# define GL_APICALL __declspec(dllexport) +# else +# define GL_APICALL __declspec(dllimport) +# endif +#elif defined (__ARMCC_VERSION) // ADS +# define GL_APICALL +#elif defined (__SYMBIAN32__) && defined (__GCC32__) // Symbian GCC +# define GL_APICALL __declspec(dllexport) +#elif defined (__GNUC__) // GCC dependencies (kludge) +# define GL_APICALL +#endif + +#if !defined (GL_APICALL) +# error Unsupported platform! +#endif +*/ + +#define GL_APIENTRY + +/*------------------------------------------------------------------------- + * Data type definitions + *-----------------------------------------------------------------------*/ + +typedef void GLvoid; +typedef unsigned int GLenum; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef signed char GLbyte; +typedef short GLshort; +typedef int GLint; +typedef int GLsizei; +typedef unsigned char GLubyte; +typedef unsigned short GLushort; +typedef unsigned int GLuint; +typedef float GLfloat; +typedef float GLclampf; +typedef int GLfixed; +typedef int GLclampx; + +/* GL types for handling large vertex buffer objects */ +typedef int GLintptr; +typedef int GLsizeiptr; + +/* OpenGL ES core versions */ +#define GL_ES_VERSION_2_0 1 + +/* ClearBufferMask */ +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_COLOR_BUFFER_BIT 0x00004000 + +/* Boolean */ +#define GL_FALSE 0 +#define GL_TRUE 1 + +/* \todo check that this should be in core. */ +#define GL_NONE 0 + +/* BeginMode */ +#define GL_POINTS 0x0000 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_LINE_STRIP 0x0003 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 + +/* AlphaFunction (not supported in ES20) */ +/* GL_NEVER */ +/* GL_LESS */ +/* GL_EQUAL */ +/* GL_LEQUAL */ +/* GL_GREATER */ +/* GL_NOTEQUAL */ +/* GL_GEQUAL */ +/* GL_ALWAYS */ + +/* BlendingFactorDest */ +#define GL_ZERO 0 +#define GL_ONE 1 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 + +/* BlendingFactorSrc */ +/* GL_ZERO */ +/* GL_ONE */ +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +/* GL_SRC_ALPHA */ +/* GL_ONE_MINUS_SRC_ALPHA */ +/* GL_DST_ALPHA */ +/* GL_ONE_MINUS_DST_ALPHA */ + +/* BlendEquationSeparate */ +#define GL_FUNC_ADD 0x8006 +#define GL_BLEND_EQUATION 0x8009 +#define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */ +#define GL_BLEND_EQUATION_ALPHA 0x883D + +/* BlendSubtract */ +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B + +/* Separate Blend Functions */ +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 + +/* Buffer Objects */ +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 + +#define GL_STREAM_DRAW 0x88E0 +#define GL_STATIC_DRAW 0x88E4 +#define GL_DYNAMIC_DRAW 0x88E8 + +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 + +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 + +/* CullFaceMode */ +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_FRONT_AND_BACK 0x0408 + +/* DepthFunction */ +/* GL_NEVER */ +/* GL_LESS */ +/* GL_EQUAL */ +/* GL_LEQUAL */ +/* GL_GREATER */ +/* GL_NOTEQUAL */ +/* GL_GEQUAL */ +/* GL_ALWAYS */ + +/* EnableCap */ +#define GL_TEXTURE_2D 0x0DE1 +#define GL_CULL_FACE 0x0B44 +#define GL_BLEND 0x0BE2 +#define GL_DITHER 0x0BD0 +#define GL_STENCIL_TEST 0x0B90 +#define GL_DEPTH_TEST 0x0B71 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_COVERAGE 0x80A0 + +/* ErrorCode */ +#define GL_NO_ERROR 0 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_OUT_OF_MEMORY 0x0505 + +/* FrontFaceDirection */ +#define GL_CW 0x0900 +#define GL_CCW 0x0901 + +/* GetPName */ +#define GL_LINE_WIDTH 0x0B21 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 +#define GL_VIEWPORT 0x0BA2 +#define GL_SCISSOR_BOX 0x0C10 +/* GL_SCISSOR_TEST */ +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +/* GL_POLYGON_OFFSET_FILL */ +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB + +/* GetTextureParameter */ +/* GL_TEXTURE_MAG_FILTER */ +/* GL_TEXTURE_MIN_FILTER */ +/* GL_TEXTURE_WRAP_S */ +/* GL_TEXTURE_WRAP_T */ + +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 + +/* HintMode */ +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 + +/* HintTarget */ +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B + +/* DataType */ +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_FIXED 0x140C + +/* PixelFormat */ +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A + +/* PixelType */ +/* GL_UNSIGNED_BYTE */ +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 + +/* Shaders */ +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD +#define GL_SHADER_TYPE 0x8B4F +#define GL_DELETE_STATUS 0x8B80 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D + +/* StencilFunction */ +#define GL_NEVER 0x0200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 + +/* StencilOp */ +/* GL_ZERO */ +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_INVERT 0x150A +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 + +/* StringName */ +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 + +/* TextureMagFilter */ +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 + +/* TextureMinFilter */ +/* GL_NEAREST */ +/* GL_LINEAR */ +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 + +/* TextureParameterName */ +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 + +/* TextureTarget */ +/* GL_TEXTURE_2D */ +#define GL_TEXTURE 0x1702 + +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C + +/* TextureUnit */ +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 + +/* TextureWrapMode */ +#define GL_REPEAT 0x2901 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_MIRRORED_REPEAT 0x8370 + +/* Uniform Types */ +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_CUBE 0x8B60 + +/* Vertex Arrays */ +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F + +/* Read Format */ +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B + +/* Shader Source */ +#define GL_COMPILE_STATUS 0x8B81 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_SHADER_COMPILER 0x8DFA + +/* Shader Binary */ +#define GL_PLATFORM_BINARY 0x8D63 +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 + +/* Shader Precision-Specified Types */ +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 + +/* Framebuffer Object. */ +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 + +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGB565 0x8D62 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_STENCIL_INDEX 0x1901 +#define GL_STENCIL_INDEX8 0x8D48 + +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 + +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 + +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 + +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS 0x8CDA +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD + +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 + +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 + +/*------------------------------------------------------------------------- + * GL core functions. + *-----------------------------------------------------------------------*/ + +GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture); +GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader); +GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const char* name); +GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); +GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); +GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); +GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture); +GL_APICALL void GL_APIENTRY glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GL_APICALL void GL_APIENTRY glBlendEquation( GLenum mode ); +GL_APICALL void GL_APIENTRY glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha); +GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void* data, GLenum usage); +GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void* data); +GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target); +GL_APICALL void GL_APIENTRY glClear (GLbitfield mask); +GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth); +GL_APICALL void GL_APIENTRY glClearStencil (GLint s); +GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader); +GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); +GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); +GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GL_APICALL GLuint GL_APIENTRY glCreateProgram (void); +GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type); +GL_APICALL void GL_APIENTRY glCullFace (GLenum mode); +GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers); +GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers); +GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures); +GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program); +GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers); +GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader); +GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader); +GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func); +GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag); +GL_APICALL void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar); +GL_APICALL void GL_APIENTRY glDisable (GLenum cap); +GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index); +GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void* indices); +GL_APICALL void GL_APIENTRY glEnable (GLenum cap); +GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index); +GL_APICALL void GL_APIENTRY glFinish (void); +GL_APICALL void GL_APIENTRY glFlush (void); +GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode); +GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers); +GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target); +GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers); +GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers); +GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures); +GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name); +GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name); +GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders); +GL_APICALL int GL_APIENTRY glGetAttribLocation (GLuint program, const char* name); +GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params); +GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params); +GL_APICALL GLenum GL_APIENTRY glGetError (void); +GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params); +GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params); +GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params); +GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params); +GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, char* infolog); +GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params); +GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params); +GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog); +GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); +GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, char* source); +GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name); +GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params); +GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params); +GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params); +GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params); +GL_APICALL int GL_APIENTRY glGetUniformLocation (GLuint program, const char* name); +GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params); +GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params); +GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void** pointer); +GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode); +GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); +GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap); +GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer); +GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program); +GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer); +GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader); +GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture); +GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width); +GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program); +GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); +GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels); +GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void); +GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert); +GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glShaderBinary (GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length); +GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const char** string, const GLint* length); +GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); +GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask); +GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); +GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass); +GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); +GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params); +GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params); +GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); +GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x); +GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v); +GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x); +GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v); +GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y); +GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v); +GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y); +GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v); +GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z); +GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v); +GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z); +GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v); +GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v); +GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w); +GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v); +GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GL_APICALL void GL_APIENTRY glUseProgram (GLuint program); +GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program); +GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x); +GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values); +GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y); +GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values); +GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z); +GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values); +GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values); +GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr); +GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); + +#ifdef __cplusplus +} +#endif + +#endif /* __gl2_h_ */ + diff --git a/make/stub_includes/opengl/GLES2/gl2ext.h b/make/stub_includes/opengl/GLES2/gl2ext.h new file mode 100755 index 000000000..b531df2fb --- /dev/null +++ b/make/stub_includes/opengl/GLES2/gl2ext.h @@ -0,0 +1,248 @@ +/* + * Copyright (c) 2005-2007 NVIDIA Corporation. All rights reserved. + * + * NVIDIA Corporation and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA Corporation is strictly prohibited. + */ + +#ifndef __gl2ext_h_ +#define __gl2ext_h_ + +#ifndef __gl2_h_ +# include <GLES2/gl2.h> +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.0 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. This software +** was created using the OpenGL(R) version 1.2.1 Sample Implementation +** published by SGI, but has not been independently verified as being +** compliant with the OpenGL(R) version 1.2.1 Specification. +*/ + +#ifndef GL_APIENTRYP +# define GL_APIENTRYP GL_APIENTRY* +#endif + +#define GL_GLEXT_PROTOTYPES + +#define GL_NVIDIA_PLATFORM_BINARY_NV 0x890B + +#define GL_OES_EGL_image 1 + +#ifdef GL_OES_EGL_image +#define GL_TEXTURE_2D_OES 0x1 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES 0x3 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES 0x4 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES 0x5 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES 0x6 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES 0x7 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES 0x8 +#define GL_RENDERBUFFER_OES 0x9 +#define GL_TEXTURE_RECTANGLE_NV_OES 0xb + +typedef void *GLeglImageOES; +GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image); +#ifdef GL_GLEXT_PROTOTYPES +typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); + +#endif +#endif + + +/*------------------------------------------------------------------------* + * OES extension tokens + *------------------------------------------------------------------------*/ + +#ifndef GL_OES_texture_half_float +#define GL_OES_texture_half_float 1 +#define GL_HALF_FLOAT_OES 0x8D61 +#endif + +/* GL_OES_mapbuffer */ +#ifndef GL_OES_mapbuffer +#define GL_BUFFER_MAPPED_OES 0x88BC +#define GL_BUFFER_MAP_POINTER_OES 0x88BD +#endif + +/* GL_OES_rgb8_rgba8 */ +#ifndef GL_OES_rgb8_rgba8 +#define GL_RGB8_OES 0x8051 +#define GL_RGBA8_OES 0x8058 +#endif + +/* GL_OES_mapbuffer */ +#ifndef GL_OES_mapbuffer +#define GL_OES_mapbuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access); +GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target); +GL_APICALL void GL_APIENTRY glGetBufferPointerivNV (GLenum target, GLenum pname, void **params ); +#endif +typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); +typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target); +typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERIVNVPROC) (GLenum target, GLenum pname, void **params ); +#endif + +/* GL_OES_rgb8_rgba8 */ +#ifndef GL_OES_rgb8_rgba8 +#define GL_OES_rgb8_rgba8 1 +#endif + +/*------------------------------------------------------------------------* + * EXT extension tokens + *------------------------------------------------------------------------*/ + +/* GL_EXT_framebuffer_mixed_formats */ +#ifndef GL_EXT_framebuffer_mixed_formats +#define GL_EXT_framebuffer_mixed_formats 1 +#endif + +/* GL_EXT_packed_float */ +#ifndef GL_EXT_packed_float +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C +#endif + +/* GL_EXT_texture_array */ +#ifndef GL_EXT_texture_array +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#endif + + +/* GL_EXT_texture_compression_dxt1 */ +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#endif + +/* GL_EXT_texture_compression_s3tc */ +#ifndef GL_EXT_texture_compression_s3tc +/* GL_COMPRESSED_RGB_S3TC_DXT1_EXT defined in GL_EXT_texture_compression_dxt1 already. */ +/* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT defined in GL_EXT_texture_compression_dxt1 already. */ +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#endif + +/* GL_EXT_texture_filter_anisotropic */ +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif + + +/* GL_EXT_texture_compression_dxt1 */ +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_EXT_texture_compression_dxt1 1 +#endif + +/* GL_EXT_texture_compression_s3tc */ +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 +#endif + +/* GL_EXT_texture_filter_anisotropic */ +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#endif + +#define GL_TEXTURE_MAX_LEVEL_NV 0x813D + +/* GL_NV_coverage_sample */ +#ifndef GL_NV_coverage_sample +#define GL_COVERAGE_COMPONENT_NV 0x8522 +#define GL_COVERAGE_COMPONENT4_NV 0x8523 +#define GL_COVERAGE_ATTACHMENT_NV 0x8527 +#define GL_COVERAGE_BUFFER_BIT_NV 0x8000 +#define GL_COVERAGE_BUFFERS_NV 0x8528 +#define GL_COVERAGE_SAMPLES_NV 0x8529 +#define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8524 +#define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8525 +#define GL_COVERAGE_AUTOMATIC_NV 0x8526 +#endif + + +/* GL_NV_framebuffer_vertex_attrib_array */ +#ifndef GL_NV_framebuffer_vertex_attrib_array +#define GL_FRAMEBUFFER_ATTACHABLE_NV 0x852A +#define GL_VERTEX_ATTRIB_ARRAY_NV 0x852B +#define GL_FRAMEBUFFER_ATTACHMENT_VERTEX_ATTRIB_ARRAY_SIZE_NV 0x852C +#define GL_FRAMEBUFFER_ATTACHMENT_VERTEX_ATTRIB_ARRAY_TYPE_NV 0x852D +#define GL_FRAMEBUFFER_ATTACHMENT_VERTEX_ATTRIB_ARRAY_NORMALIZED_NV 0x852E +#define GL_FRAMEBUFFER_ATTACHMENT_VERTEX_ATTRIB_ARRAY_OFFSET_NV 0x852F +#define GL_FRAMEBUFFER_ATTACHMENT_VERTEX_ATTRIB_ARRAY_WIDTH_NV 0x8530 +#define GL_FRAMEBUFFER_ATTACHMENT_VERTEX_ATTRIB_ARRAY_STRIDE_NV 0x8531 +#define GL_FRAMEBUFFER_ATTACHMENT_VERTEX_ATTRIB_ARRAY_HEIGHT_NV 0x8532 +#endif + + +/* GL_NV_framebuffer_vertex_attrib_array */ +#ifndef GL_NV_framebuffer_vertex_attrib_array +#define GL_NV_framebuffer_vertex_attrib_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glFramebufferVertexAttribArrayNV (GLenum target, GLenum attachment, GLenum buffertarget, GLuint bufferobject, GLint size, GLenum type, GLboolean normalized, GLintptr offset, GLsizeiptr width, GLsizeiptr height, GLsizei stride); +#endif +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERVERTEXATTRIBARRAYNVPROC) (GLenum target, GLenum attachment, GLenum buffertarget, GLuint bufferobject, GLint size, GLenum type, GLboolean normalized, GLintptr offset, GLsizeiptr width, GLsizeiptr height, GLsizei stride); +#endif + +/* GL_NV_coverage_sample */ +#ifndef GL_NV_coverage_sample +#define GL_NV_coverage_sample 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask); +GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation); +#endif +typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask); +typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation); +#endif + + + +/*------------------------------------------------------------------------* + * NV extension tokens + *------------------------------------------------------------------------*/ + + +#ifdef __cplusplus +} +#endif + +#endif /* __gl2ext_h_ */ |