├── .clang-format ├── .gitattributes ├── .gitignore ├── .gitmodules ├── CMakeLists.txt ├── CMakePresets.json ├── LICENSE ├── README.md ├── bindings ├── CMakeLists.txt └── python │ └── monkvg_py.cpp ├── docs └── openvg-1.1.pdf ├── examples ├── CMakeLists.txt ├── __pycache__ │ └── python_opengl.cpython-312.pyc ├── assets │ ├── arial.fnt │ ├── arial.png │ ├── arial.ttf │ ├── roy.png │ └── shaders │ │ ├── test.frag │ │ ├── test.frag.spv │ │ ├── test.vert │ │ └── test.vert.spv ├── font_example.cpp ├── glfw_hello_world.cpp ├── python_opengl.py ├── tiger.cpp ├── tiger_paths.c ├── tiger_paths.h └── vulkan_hello_world.cpp ├── include └── MonkVG │ ├── openvg.h │ ├── vgext.h │ ├── vgplatform.h │ └── vgu.h ├── projects └── MonkVG-Test-iOS-OpenGL-DEPRECATED │ ├── Classes │ ├── EAGLView.h │ ├── EAGLView.m │ ├── ES1Renderer.h │ ├── ES1Renderer.mm │ ├── ES2Renderer.h │ ├── ES2Renderer.m │ ├── ESRenderer.h │ ├── MonkVGExample.h │ ├── MonkVGExample.mm │ ├── MonkVG_Test_iOS_OpenGLAppDelegate.h │ ├── MonkVG_Test_iOS_OpenGLAppDelegate.m │ ├── RootViewController.h │ └── RootViewController.m │ ├── Default-568h@2x.png │ ├── Main.storyboard │ ├── MainWindow.xib │ ├── MonkVG-Test-iOS-OpenGL.xcodeproj │ └── project.pbxproj │ ├── MonkVG_Test_iOS_OpenGL-Info.plist │ ├── MonkVG_Test_iOS_OpenGL_Prefix.pch │ ├── Shaders │ ├── Shader.fsh │ └── Shader.vsh │ ├── arial.fnt │ ├── arial.png │ ├── circle_poly.svg │ ├── delorean.png │ ├── iPad │ └── MainWindow-iPad.xib │ ├── main.m │ ├── square.svg │ ├── testfont.fnt │ ├── testfont.png │ ├── tiger │ ├── test.c │ ├── test.h │ ├── test_tiger.c │ └── test_tiger_paths.c │ └── zero.png ├── setup.py ├── src ├── Quartz_DEPRECATED │ ├── qzContext.h │ ├── qzContext.mm │ ├── qzPaint.cpp │ ├── qzPaint.h │ ├── qzPath.h │ └── qzPath.mm ├── glu-tessellator │ ├── gluTessellator.cpp │ └── gluTessellator.h ├── mkBaseObject.cpp ├── mkBaseObject.h ├── mkBatch.cpp ├── mkBatch.h ├── mkBmpFnt.cpp ├── mkCommon.h ├── mkContext.cpp ├── mkContext.h ├── mkFont.cpp ├── mkFont.h ├── mkGradient.cpp ├── mkGradient.h ├── mkImage.cpp ├── mkImage.h ├── mkMath.cpp ├── mkMath.h ├── mkPaint.cpp ├── mkPaint.h ├── mkParameter.cpp ├── mkPath.cpp ├── mkPath.h ├── mkTessellator.cpp ├── mkTessellator.h ├── mkTypes.h ├── mkVGU.cpp ├── opengl │ ├── glBatch.cpp │ ├── glBatch.h │ ├── glContext.cpp │ ├── glContext.h │ ├── glFont.cpp │ ├── glFont.h │ ├── glImage.cpp │ ├── glImage.h │ ├── glPaint.cpp │ ├── glPaint.h │ ├── glPath.cpp │ ├── glPath.h │ ├── glPlatform.h │ ├── glShader.cpp │ ├── glShader.h │ └── shaders │ │ ├── color_frag.glsl │ │ ├── color_vert.glsl │ │ ├── texture_frag.glsl │ │ └── texture_vert.glsl ├── opengl_es_DEPRECATED │ ├── glesBatch.cpp │ ├── glesBatch.h │ ├── glesContext.cpp │ ├── glesContext.h │ ├── glesFont.cpp │ ├── glesFont.h │ ├── glesImage.cpp │ ├── glesImage.h │ ├── glesPaint.cpp │ ├── glesPaint.h │ ├── glesPath.cpp │ ├── glesPath.h │ └── glesPlatform.h └── vulkan │ ├── shaders │ ├── color.frag │ ├── color.frag.h │ ├── color.vert │ ├── color.vert.h │ ├── test.frag │ ├── test.frag.h │ ├── test.vert │ ├── test.vert.h │ ├── texture.frag │ ├── texture.frag.h │ ├── texture.vert │ └── texture.vert.h │ ├── vkBatch.cpp │ ├── vkBatch.h │ ├── vkColorPipeline.cpp │ ├── vkColorPipeline.h │ ├── vkContext.cpp │ ├── vkContext.h │ ├── vkFont.cpp │ ├── vkFont.h │ ├── vkGraphicsPipeline.h │ ├── vkImage.cpp │ ├── vkImage.h │ ├── vkPaint.cpp │ ├── vkPaint.h │ ├── vkPath.cpp │ ├── vkPath.h │ ├── vkPlatform.h │ ├── vkTexturePipeline.cpp │ ├── vkTexturePipeline.h │ └── vkVmaUsage.cpp ├── thirdparty ├── gles2-bc │ ├── CMakeLists.txt │ ├── Samples │ │ └── iPhone │ │ │ └── SampleProject │ │ │ ├── Classes │ │ │ ├── EAGLView.h │ │ │ ├── EAGLView.mm │ │ │ ├── SampleProjectAppDelegate.h │ │ │ └── SampleProjectAppDelegate.mm │ │ │ ├── main.m │ │ │ └── readme.txt │ └── Sources │ │ └── OpenGLES │ │ ├── OpenGLES.pro │ │ ├── OpenGLES11 │ │ ├── OpenGLES11Context.cpp │ │ ├── OpenGLES11Context.h │ │ ├── OpenGLES11Implementation.cpp │ │ └── OpenGLES11Implementation.h │ │ ├── OpenGLES20 │ │ ├── Attribute.cpp │ │ ├── Attribute.h │ │ ├── MatrixStack.cpp │ │ ├── MatrixStack.h │ │ ├── OpenGLES20Context.cpp │ │ ├── OpenGLES20Context.h │ │ ├── OpenGLES20Implementation.cpp │ │ ├── OpenGLES20Implementation.h │ │ ├── OpenGLESState.cpp │ │ ├── OpenGLESState.h │ │ ├── Shader.cpp │ │ ├── Shader.h │ │ ├── ShaderFile.cpp │ │ ├── ShaderFile.h │ │ ├── ShaderProgram.cpp │ │ ├── ShaderProgram.h │ │ ├── ShaderSource.cpp │ │ ├── ShaderSource.h │ │ ├── Uniform.cpp │ │ ├── Uniform.h │ │ └── shaders │ │ │ ├── all_shaders.h │ │ │ ├── alphaTest.frag │ │ │ ├── alphaTest.frag.h │ │ │ ├── clipPlane.frag │ │ │ ├── clipPlane.frag.h │ │ │ ├── clipPlane.vert │ │ │ ├── clipPlane.vert.h │ │ │ ├── fog.glsl │ │ │ ├── fog.glsl.h │ │ │ ├── lighting.frag │ │ │ ├── lighting.frag.h │ │ │ ├── lighting.vert │ │ │ ├── lighting.vert.h │ │ │ ├── lightingPerFragment.frag │ │ │ ├── lightingPerFragment.frag.h │ │ │ ├── lightingPerFragment.vert │ │ │ ├── lightingPerFragment.vert.h │ │ │ ├── lightingPerVertex.vert │ │ │ ├── lightingPerVertex.vert.h │ │ │ ├── main.frag │ │ │ ├── main.frag.h │ │ │ ├── main.vert │ │ │ ├── main.vert.h │ │ │ ├── postprocess.frag │ │ │ ├── postprocess.frag.h │ │ │ ├── postprocess.vert │ │ │ ├── postprocess.vert.h │ │ │ ├── texture.frag │ │ │ ├── texture.frag.h │ │ │ ├── texture.vert │ │ │ ├── texture.vert.h │ │ │ ├── texture0.frag │ │ │ ├── texture0.frag.h │ │ │ ├── texture0.vert │ │ │ ├── texture0.vert.h │ │ │ ├── texture1.frag │ │ │ ├── texture1.frag.h │ │ │ ├── texture1.vert │ │ │ ├── texture1.vert.h │ │ │ ├── texture2.frag │ │ │ ├── texture2.frag.h │ │ │ ├── texture2.vert │ │ │ ├── texture2.vert.h │ │ │ └── update │ │ ├── OpenGLESConfig.cpp │ │ ├── OpenGLESConfig.h │ │ ├── OpenGLESContext.cpp │ │ ├── OpenGLESContext.h │ │ ├── OpenGLESFile.cpp │ │ ├── OpenGLESFile.h │ │ ├── OpenGLESImplementation.cpp │ │ ├── OpenGLESImplementation.h │ │ ├── OpenGLESMath.h │ │ ├── OpenGLESPlatform.h │ │ ├── OpenGLESString.cpp │ │ ├── OpenGLESString.h │ │ ├── OpenGLESUtil.cpp │ │ └── OpenGLESUtil.h └── glu │ ├── .editorconfig │ ├── .gitignore │ ├── CMakeLists.txt │ ├── Makefile.am │ ├── autogen.sh │ ├── configure.ac │ ├── include │ └── GL │ │ └── glu.h │ ├── meson.build │ ├── meson_options.txt │ └── src │ ├── include │ └── gluos.h │ ├── libnurbs │ ├── interface │ │ ├── bezierEval.cc │ │ ├── bezierEval.h │ │ ├── bezierPatch.cc │ │ ├── bezierPatch.h │ │ ├── bezierPatchMesh.cc │ │ ├── bezierPatchMesh.h │ │ ├── glcurveval.cc │ │ ├── glcurveval.h │ │ ├── glimports.h │ │ ├── glinterface.cc │ │ ├── glrenderer.cc │ │ ├── glrenderer.h │ │ ├── glsurfeval.cc │ │ ├── glsurfeval.h │ │ ├── incurveeval.cc │ │ ├── insurfeval.cc │ │ ├── mystdio.h │ │ └── mystdlib.h │ ├── internals │ │ ├── arc.cc │ │ ├── arc.h │ │ ├── arcsorter.cc │ │ ├── arcsorter.h │ │ ├── arctess.cc │ │ ├── arctess.h │ │ ├── backend.cc │ │ ├── backend.h │ │ ├── basiccrveval.cc │ │ ├── basiccrveval.h │ │ ├── basicsurfeval.cc │ │ ├── basicsurfeval.h │ │ ├── bezierarc.h │ │ ├── bin.cc │ │ ├── bin.h │ │ ├── bufpool.cc │ │ ├── bufpool.h │ │ ├── cachingeval.cc │ │ ├── cachingeval.h │ │ ├── ccw.cc │ │ ├── coveandtiler.cc │ │ ├── coveandtiler.h │ │ ├── curve.cc │ │ ├── curve.h │ │ ├── curvelist.cc │ │ ├── curvelist.h │ │ ├── curvesub.cc │ │ ├── dataTransform.cc │ │ ├── dataTransform.h │ │ ├── defines.h │ │ ├── displaylist.cc │ │ ├── displaylist.h │ │ ├── displaymode.h │ │ ├── flist.cc │ │ ├── flist.h │ │ ├── flistsorter.cc │ │ ├── flistsorter.h │ │ ├── gridline.h │ │ ├── gridtrimvertex.h │ │ ├── gridvertex.h │ │ ├── hull.cc │ │ ├── hull.h │ │ ├── intersect.cc │ │ ├── jarcloc.h │ │ ├── knotvector.cc │ │ ├── knotvector.h │ │ ├── mapdesc.cc │ │ ├── mapdesc.h │ │ ├── mapdescv.cc │ │ ├── maplist.cc │ │ ├── maplist.h │ │ ├── mesher.cc │ │ ├── mesher.h │ │ ├── monoTriangulationBackend.cc │ │ ├── monotonizer.cc │ │ ├── monotonizer.h │ │ ├── myassert.h │ │ ├── mycode.cc │ │ ├── mymath.h │ │ ├── mysetjmp.h │ │ ├── mystring.h │ │ ├── nurbsconsts.h │ │ ├── nurbsinterfac.cc │ │ ├── nurbstess.cc │ │ ├── nurbstess.h │ │ ├── patch.cc │ │ ├── patch.h │ │ ├── patchlist.cc │ │ ├── patchlist.h │ │ ├── pwlarc.h │ │ ├── quilt.cc │ │ ├── quilt.h │ │ ├── reader.cc │ │ ├── reader.h │ │ ├── renderhints.cc │ │ ├── renderhints.h │ │ ├── simplemath.h │ │ ├── slicer.cc │ │ ├── slicer.h │ │ ├── sorter.cc │ │ ├── sorter.h │ │ ├── splitarcs.cc │ │ ├── subdivider.cc │ │ ├── subdivider.h │ │ ├── tobezier.cc │ │ ├── trimline.cc │ │ ├── trimline.h │ │ ├── trimregion.cc │ │ ├── trimregion.h │ │ ├── trimvertex.h │ │ ├── trimvertpool.cc │ │ ├── trimvertpool.h │ │ ├── types.h │ │ ├── uarray.cc │ │ ├── uarray.h │ │ ├── varray.cc │ │ └── varray.h │ └── nurbtess │ │ ├── definitions.h │ │ ├── directedLine.cc │ │ ├── directedLine.h │ │ ├── glimports.h │ │ ├── gridWrap.cc │ │ ├── gridWrap.h │ │ ├── monoChain.cc │ │ ├── monoChain.h │ │ ├── monoPolyPart.cc │ │ ├── monoPolyPart.h │ │ ├── monoTriangulation.cc │ │ ├── monoTriangulation.h │ │ ├── mystdio.h │ │ ├── mystdlib.h │ │ ├── partitionX.cc │ │ ├── partitionX.h │ │ ├── partitionY.cc │ │ ├── partitionY.h │ │ ├── polyDBG.cc │ │ ├── polyDBG.h │ │ ├── polyUtil.cc │ │ ├── polyUtil.h │ │ ├── primitiveStream.cc │ │ ├── primitiveStream.h │ │ ├── quicksort.cc │ │ ├── quicksort.h │ │ ├── rectBlock.cc │ │ ├── rectBlock.h │ │ ├── sampleComp.cc │ │ ├── sampleComp.h │ │ ├── sampleCompBot.cc │ │ ├── sampleCompBot.h │ │ ├── sampleCompRight.cc │ │ ├── sampleCompRight.h │ │ ├── sampleCompTop.cc │ │ ├── sampleCompTop.h │ │ ├── sampleMonoPoly.cc │ │ ├── sampleMonoPoly.h │ │ ├── sampledLine.cc │ │ ├── sampledLine.h │ │ ├── searchTree.cc │ │ ├── searchTree.h │ │ └── zlassert.h │ ├── libtess │ ├── README │ ├── alg-outline │ ├── dict-list.h │ ├── dict.c │ ├── dict.h │ ├── geom.c │ ├── geom.h │ ├── memalloc.c │ ├── memalloc.h │ ├── mesh.c │ ├── mesh.h │ ├── normal.c │ ├── normal.h │ ├── priorityq-heap.c │ ├── priorityq-heap.h │ ├── priorityq-sort.h │ ├── priorityq.c │ ├── priorityq.h │ ├── render.c │ ├── render.h │ ├── sweep.c │ ├── sweep.h │ ├── tess.c │ ├── tess.h │ ├── tessmono.c │ └── tessmono.h │ ├── libutil │ ├── error.c │ ├── glue.c │ ├── gluint.h │ ├── mipmap.c │ ├── project.c │ ├── quad.c │ └── registry.c │ └── meson.build └── tiger.png /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pdf filter=lfs diff=lfs merge=lfs -text 2 | *.png filter=lfs diff=lfs merge=lfs -text 3 | *.jpg filter=lfs diff=lfs merge=lfs -text 4 | *.ttf filter=lfs diff=lfs merge=lfs -text 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Mac OS X Finder and whatnot 2 | .DS_Store 3 | 4 | # vscode 5 | .vscode/ 6 | 7 | # python 8 | dist/ 9 | __pycache__/ 10 | *.egg-info/ 11 | 12 | # XCode (and ancestors) per-user config (very noisy, and not relevant) 13 | *.mode1 14 | *.mode1v3 15 | *.mode2v3 16 | *.perspective 17 | *.perspectivev3 18 | *.pbxuser 19 | project.xcworkspace/ 20 | xcuserdata/ 21 | 22 | # Generated files 23 | VersionX-revision.h 24 | 25 | #ndk noise 26 | obj/ 27 | libs/ 28 | 29 | # build products 30 | build/ 31 | *.[oa] 32 | 33 | # Other source repository archive directories (protects when importing) 34 | .hg 35 | .svn 36 | CVS 37 | 38 | 39 | # automatic backup files 40 | *~.nib 41 | *.swp 42 | *~ 43 | *(Autosaved).rtfd/ 44 | Backup[ ]of[ ]*.pages/ 45 | Backup[ ]of[ ]*.key/ 46 | Backup[ ]of[ ]*.numbers/ 47 | 48 | # autotools stuff 49 | configure 50 | missing 51 | install-sh 52 | Makefile 53 | *.in 54 | *.m4 55 | *.cache 56 | config.* 57 | ltmain.sh 58 | depcomp 59 | *.la 60 | *.lo 61 | .libs/ 62 | .deps/ 63 | libtool 64 | # thirdparty/glu/** 65 | # thirdparty/glfw/** 66 | # thirdparty/glm/** 67 | # thirdparty/glew/** 68 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "thirdparty/stb"] 2 | path = thirdparty/stb 3 | url = https://github.com/nothings/stb.git 4 | [submodule "thirdparty/glm"] 5 | path = thirdparty/glm 6 | url = git@github.com:g-truc/glm.git 7 | [submodule "thirdparty/vma"] 8 | path = thirdparty/vma 9 | url = git@github.com:GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git 10 | [submodule "thirdparty/pybind"] 11 | path = thirdparty/pybind 12 | url = git@github.com:pybind/pybind11.git 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | opyright (c) 2010, Micah Pearlman 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | Neither the name of the nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 9 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10 | -------------------------------------------------------------------------------- /docs/openvg-1.1.pdf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:560ae1e79c34d574230c0cbf4e63bf2372deeff1b55b896aab1ed119b866aa23 3 | size 1747492 4 | -------------------------------------------------------------------------------- /examples/__pycache__/python_opengl.cpython-312.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micahpearlman/MonkVG/8fb5de3b4a82ae13a243aa70ca74dfabe17bb164/examples/__pycache__/python_opengl.cpython-312.pyc -------------------------------------------------------------------------------- /examples/assets/arial.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7edee219ecc2e7f71dee0756a436f08ac17da4a4bc1b0b66aedb360cbfcdff00 3 | size 67840 4 | -------------------------------------------------------------------------------- /examples/assets/arial.ttf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:35c0f3559d8db569e36c31095b8a60d441643d95f59139de40e23fada819b833 3 | size 275572 4 | -------------------------------------------------------------------------------- /examples/assets/roy.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7e17acd96cbe05aa6d050d9b3ba89474e739630338a3a4c304c84caa5ae43653 3 | size 529163 4 | -------------------------------------------------------------------------------- /examples/assets/shaders/test.frag: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(location = 0) in vec3 fragColor; 4 | 5 | layout(location = 0) out vec4 outColor; 6 | 7 | void main() { 8 | outColor = vec4(fragColor, 1.0); 9 | } 10 | -------------------------------------------------------------------------------- /examples/assets/shaders/test.frag.spv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micahpearlman/MonkVG/8fb5de3b4a82ae13a243aa70ca74dfabe17bb164/examples/assets/shaders/test.frag.spv -------------------------------------------------------------------------------- /examples/assets/shaders/test.vert: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(location = 0) out vec3 fragColor; 4 | 5 | vec2 positions[3] = vec2[]( 6 | vec2(0.0, -0.5), 7 | vec2(0.5, 0.5), 8 | vec2(-0.5, 0.5) 9 | ); 10 | 11 | vec3 colors[3] = vec3[]( 12 | vec3(1.0, 0.0, 0.0), 13 | vec3(0.0, 1.0, 0.0), 14 | vec3(0.0, 0.0, 1.0) 15 | ); 16 | 17 | void main() { 18 | gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0); 19 | fragColor = colors[gl_VertexIndex]; 20 | } -------------------------------------------------------------------------------- /examples/assets/shaders/test.vert.spv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micahpearlman/MonkVG/8fb5de3b4a82ae13a243aa70ca74dfabe17bb164/examples/assets/shaders/test.vert.spv -------------------------------------------------------------------------------- /examples/tiger_paths.h: -------------------------------------------------------------------------------- 1 | #ifndef __TIGER_PATHS__ 2 | #define __TIGER_PATHS__ 3 | 4 | // MonkVG OpenVG interface 5 | #include 6 | 7 | extern const VGint pathCount; 8 | extern const VGint commandCounts[]; 9 | extern const VGubyte* commandArrays[]; 10 | extern const VGfloat* dataArrays[]; 11 | extern const VGfloat* styleArrays[]; 12 | 13 | #endif -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/Classes/EAGLView.h: -------------------------------------------------------------------------------- 1 | // 2 | // EAGLView.h 3 | // MonkVG-Test-iOS-OpenGL 4 | // 5 | // Created by Micah Pearlman on 8/11/10. 6 | // Copyright Zero Vision 2010. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | #import "ESRenderer.h" 13 | 14 | // This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. 15 | // The view content is basically an EAGL surface you render your OpenGL scene into. 16 | // Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. 17 | @interface EAGLView : UIView 18 | { 19 | @private 20 | id renderer; 21 | 22 | BOOL animating; 23 | BOOL displayLinkSupported; 24 | NSInteger animationFrameInterval; 25 | // Use of the CADisplayLink class is the preferred method for controlling your animation timing. 26 | // CADisplayLink will link to the main display and fire every vsync when added to a given run-loop. 27 | // The NSTimer class is used only as fallback when running on a pre 3.1 device where CADisplayLink 28 | // isn't available. 29 | id displayLink; 30 | NSTimer *animationTimer; 31 | } 32 | 33 | @property (readonly, nonatomic, getter=isAnimating) BOOL animating; 34 | @property (nonatomic) NSInteger animationFrameInterval; 35 | 36 | - (void)startAnimation; 37 | - (void)stopAnimation; 38 | - (void)drawView:(id)sender; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/Classes/ES1Renderer.h: -------------------------------------------------------------------------------- 1 | // 2 | // ES1Renderer.h 3 | // MonkVG-Test-iOS-OpenGL 4 | // 5 | // Created by Micah Pearlman on 8/11/10. 6 | // Copyright Zero Vision 2010. All rights reserved. 7 | // 8 | 9 | #import "ESRenderer.h" 10 | 11 | #import 12 | #import 13 | 14 | //class SVGHandler; 15 | 16 | @interface ES1Renderer : NSObject 17 | { 18 | @private 19 | EAGLContext *context; 20 | 21 | // The pixel dimensions of the CAEAGLLayer 22 | GLint backingWidth; 23 | GLint backingHeight; 24 | 25 | // The OpenGL ES names for the framebuffer and renderbuffer used to render to this view 26 | GLuint defaultFramebuffer, colorRenderbuffer; 27 | 28 | 29 | } 30 | 31 | - (void)render; 32 | - (BOOL)resizeFromLayer:(CAEAGLLayer *)layer; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/Classes/ES2Renderer.h: -------------------------------------------------------------------------------- 1 | // 2 | // ES2Renderer.h 3 | // MonkVG-Test-iOS-OpenGL 4 | // 5 | // Created by Micah Pearlman on 8/11/10. 6 | // Copyright Zero Vision 2010. All rights reserved. 7 | // 8 | 9 | #import "ESRenderer.h" 10 | 11 | #import 12 | #import 13 | 14 | @interface ES2Renderer : NSObject 15 | { 16 | @private 17 | EAGLContext *context; 18 | 19 | // The pixel dimensions of the CAEAGLLayer 20 | GLint backingWidth; 21 | GLint backingHeight; 22 | 23 | // The OpenGL ES names for the framebuffer and renderbuffer used to render to this view 24 | GLuint defaultFramebuffer, colorRenderbuffer; 25 | 26 | GLuint program; 27 | } 28 | 29 | - (void)render; 30 | - (BOOL)resizeFromLayer:(CAEAGLLayer *)layer; 31 | 32 | @end 33 | 34 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/Classes/ESRenderer.h: -------------------------------------------------------------------------------- 1 | // 2 | // ESRenderer.h 3 | // MonkVG-Test-iOS-OpenGL 4 | // 5 | // Created by Micah Pearlman on 8/11/10. 6 | // Copyright Zero Vision 2010. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import 12 | #import 13 | 14 | @protocol ESRenderer 15 | 16 | - (void)render; 17 | - (BOOL)resizeFromLayer:(CAEAGLLayer *)layer; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/Classes/MonkVGExample.h: -------------------------------------------------------------------------------- 1 | // 2 | // MonkVGExample.h 3 | // MonkVG-Test-iOS-OpenGL 4 | // 5 | // Created by Micah Pearlman on 1/19/13. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface MonkVGExample : NSObject 12 | 13 | - (id) init; 14 | - (void) render; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/Classes/MonkVG_Test_iOS_OpenGLAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // MonkVG_Test_iOS_OpenGLAppDelegate.h 3 | // MonkVG-Test-iOS-OpenGL 4 | // 5 | // Created by Micah Pearlman on 8/11/10. 6 | // Copyright Zero Vision 2010. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class EAGLView; 12 | 13 | @interface MonkVG_Test_iOS_OpenGLAppDelegate : NSObject { 14 | UIWindow *window; 15 | EAGLView *glView; 16 | } 17 | 18 | @property (nonatomic, retain) IBOutlet UIWindow *window; 19 | @property (nonatomic, retain) IBOutlet EAGLView *glView; 20 | 21 | @end 22 | 23 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/Classes/MonkVG_Test_iOS_OpenGLAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // MonkVG_Test_iOS_OpenGLAppDelegate.m 3 | // MonkVG-Test-iOS-OpenGL 4 | // 5 | // Created by Micah Pearlman on 8/11/10. 6 | // Copyright Zero Vision 2010. All rights reserved. 7 | // 8 | 9 | #import "MonkVG_Test_iOS_OpenGLAppDelegate.h" 10 | #import "EAGLView.h" 11 | 12 | @implementation MonkVG_Test_iOS_OpenGLAppDelegate 13 | 14 | @synthesize window; 15 | @synthesize glView; 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | [glView startAnimation]; 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application 24 | { 25 | [glView stopAnimation]; 26 | } 27 | 28 | - (void)applicationDidBecomeActive:(UIApplication *)application 29 | { 30 | [glView startAnimation]; 31 | } 32 | 33 | - (void)applicationWillTerminate:(UIApplication *)application 34 | { 35 | [glView stopAnimation]; 36 | } 37 | 38 | - (void)dealloc 39 | { 40 | [window release]; 41 | [glView release]; 42 | 43 | [super dealloc]; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/Classes/RootViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RootViewController.h 3 | // MonkVG-Test-iOS-OpenGL 4 | // 5 | // Created by Micah Pearlman on 5/29/17. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface RootViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/Classes/RootViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RootViewController.m 3 | // MonkVG-Test-iOS-OpenGL 4 | // 5 | // Created by Micah Pearlman on 5/29/17. 6 | // 7 | // 8 | 9 | #import "RootViewController.h" 10 | 11 | @interface RootViewController () 12 | 13 | @end 14 | 15 | @implementation RootViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | /* 28 | #pragma mark - Navigation 29 | 30 | // In a storyboard-based application, you will often want to do a little preparation before navigation 31 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 32 | // Get the new view controller using [segue destinationViewController]. 33 | // Pass the selected object to the new view controller. 34 | } 35 | */ 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/Default-568h@2x.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cff22ecf70a2ac5432c55cc83711992c766ce8c7a42613b4f1771bdb8393cb1e 3 | size 18594 4 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/MonkVG_Test_iOS_OpenGL-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | MainWindow 29 | NSMainNibFile~ipad 30 | MainWindow-iPad 31 | UIStatusBarHidden 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/MonkVG_Test_iOS_OpenGL_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'MonkVG-Test-iOS-OpenGL' target in the 'MonkVG-Test-iOS-OpenGL' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/Shaders/Shader.fsh: -------------------------------------------------------------------------------- 1 | // 2 | // Shader.fsh 3 | // MonkVG-Test-iOS-OpenGL 4 | // 5 | // Created by Micah Pearlman on 8/11/10. 6 | // Copyright Zero Vision 2010. All rights reserved. 7 | // 8 | 9 | varying lowp vec4 colorVarying; 10 | 11 | void main() 12 | { 13 | gl_FragColor = colorVarying; 14 | } 15 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/Shaders/Shader.vsh: -------------------------------------------------------------------------------- 1 | // 2 | // Shader.vsh 3 | // MonkVG-Test-iOS-OpenGL 4 | // 5 | // Created by Micah Pearlman on 8/11/10. 6 | // Copyright Zero Vision 2010. All rights reserved. 7 | // 8 | 9 | attribute vec4 position; 10 | attribute vec4 color; 11 | 12 | varying vec4 colorVarying; 13 | 14 | uniform float translate; 15 | 16 | void main() 17 | { 18 | gl_Position = position; 19 | gl_Position.y += sin(translate) / 2.0; 20 | 21 | colorVarying = color; 22 | } 23 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/arial.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:68341b4572fdae6b47b48a0251ee747686f5e3ed60743c20c6f6da16fac70cd4 3 | size 184102 4 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/circle_poly.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/delorean.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1f66faf4b57e81d99658e4065fe7fc3b251b6230fd5873a170780f8d20ddfaa5 3 | size 25751 4 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MonkVG-Test-iOS-OpenGL 4 | // 5 | // Created by Micah Pearlman on 8/11/10. 6 | // Copyright Zero Vision 2010. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) { 12 | 13 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/square.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/testfont.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:75d56715b68273650ab00437954789d4390bc04ad3131393bed98802888aaec9 3 | size 30638 4 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/tiger/test.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | 7 | #include 8 | #include 9 | 10 | 11 | VGPath testCreatePath(); 12 | void testMoveTo(VGPath p, float x, float y, VGPathAbsRel absrel); 13 | void testLineTo(VGPath p, float x, float y, VGPathAbsRel absrel); 14 | void testHlineTo(VGPath p, float x, VGPathAbsRel absrel); 15 | void testVlineTo(VGPath p, float y, VGPathAbsRel absrel); 16 | 17 | void testQuadTo(VGPath p, float x1, float y1, float x2, float y2, 18 | VGPathAbsRel absrel); 19 | 20 | void testCubicTo(VGPath p, float x1, float y1, float x2, float y2, float x3, float y3, 21 | VGPathAbsRel absrel); 22 | 23 | void testSquadTo(VGPath p, float x2, float y2,VGPathAbsRel absrel); 24 | 25 | void testScubicTo(VGPath p, float x2, float y2, float x3, float y3, 26 | VGPathAbsRel absrel); 27 | 28 | void testArcTo(VGPath p, float rx, float ry, float rot, float x, float y, 29 | VGPathSegment type, VGPathAbsRel absrel); 30 | 31 | void testClosePath(VGPath p); 32 | 33 | void testOverlayString(const char *format, ...); 34 | 35 | void testOverlayColor(float r, float g, float b, float a); 36 | 37 | 38 | VGint testWidth(); 39 | VGint testHeight(); 40 | 41 | -------------------------------------------------------------------------------- /projects/MonkVG-Test-iOS-OpenGL-DEPRECATED/zero.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3e234c58efa48535e92c64fe7c626c4b027617f48d1dd7fdbd83b1b6b324ac8b 3 | size 35255 4 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, Extension 2 | from setuptools.command.build_ext import build_ext 3 | import os 4 | import subprocess 5 | import sys 6 | 7 | 8 | class CMakeBuild(build_ext): 9 | 10 | def run(self): 11 | # make sure cmake is run first 12 | if not os.path.exists(self.build_temp): 13 | os.makedirs(self.build_temp) 14 | 15 | source_dir = os.path.abspath(os.path.dirname(__file__)) 16 | 17 | cmake_args = [ 18 | '-DCMAKE_BUILD_TYPE=Release', 19 | '-DPYTHON_EXECUTABLE=' + sys.executable, 20 | '-DMKVG_DO_PYTHON_BINDINGS=ON', 21 | ] 22 | 23 | build_args = ['--config', 'Release', '--', '-j8'] 24 | subprocess.check_call(['cmake', source_dir] + cmake_args, 25 | cwd=self.build_temp) 26 | subprocess.check_call(['cmake', '--build', '.'] + build_args, 27 | cwd=self.build_temp) 28 | 29 | 30 | setup( 31 | name='monkvg_py', 32 | version='0.0.1', 33 | author='Micah Pearlman', 34 | author_email='micahpearlman@gmail.com', 35 | description='Python bindings for monkvg', 36 | ext_modules=[Extension('monkvg_py', ['bindings/python/monkvg_py.cpp'])], 37 | cmdclass=dict(build_ext=CMakeBuild), 38 | zip_safe=False, 39 | ) 40 | -------------------------------------------------------------------------------- /src/Quartz_DEPRECATED/qzContext.h: -------------------------------------------------------------------------------- 1 | /* 2 | * qzContext.h 3 | * MonkVG-Quartz 4 | * 5 | * Created by Micah Pearlman on 3/2/09. 6 | * Copyright 2009 Monk Games. All rights reserved. 7 | * 8 | */ 9 | 10 | #ifndef __qzContext_h__ 11 | #define __qzContext_h__ 12 | 13 | #include "mkContext.h" 14 | #include 15 | //#include 16 | 17 | namespace MonkVG { 18 | 19 | class QuartzContext : public IContext { 20 | public: 21 | 22 | QuartzContext(); 23 | 24 | virtual bool Initialize(); 25 | virtual bool Terminate(); 26 | 27 | //// factories //// 28 | virtual IPath* createPath( VGint pathFormat, VGPathDatatype datatype, VGfloat scale, VGfloat bias, VGint segmentCapacityHint, VGint coordCapacityHint, VGbitfield capabilities ); 29 | virtual void destroyPath( IPath* path ); 30 | virtual IPaint* createPaint(); 31 | 32 | //// platform specific execution of stroke and fill //// 33 | virtual void stroke(); 34 | virtual void fill(); 35 | 36 | //// platform specific execution of Masking and Clearing //// 37 | virtual void clear(VGint x, VGint y, VGint width, VGint height); 38 | 39 | //// platform specific implementation of transform //// 40 | virtual void setIdentity(); 41 | virtual void transform(); 42 | virtual void scale( VGfloat sx, VGfloat sy ); 43 | virtual void translate( VGfloat x, VGfloat y ); 44 | virtual void rotate( VGfloat angle ); 45 | 46 | 47 | CGContextRef getNativeContext(); 48 | 49 | private: 50 | 51 | CGContextRef _context; // the CoreGraphics context 52 | // std::stack _context_stack; 53 | 54 | }; 55 | } 56 | 57 | #endif // __qzContext_h__ -------------------------------------------------------------------------------- /src/Quartz_DEPRECATED/qzPaint.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * qzPaint.cpp 3 | * MonkVG-Quartz 4 | * 5 | * Created by Micah Pearlman on 3/3/09. 6 | * Copyright 2009 Monk Games. All rights reserved. 7 | * 8 | */ 9 | 10 | #include "qzPaint.h" 11 | 12 | -------------------------------------------------------------------------------- /src/Quartz_DEPRECATED/qzPaint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * qzPaint.h 3 | * MonkVG-Quartz 4 | * 5 | * Created by Micah Pearlman on 3/3/09. 6 | * Copyright 2009 Monk Games. All rights reserved. 7 | * 8 | */ 9 | 10 | #ifndef __qzPaint_h__ 11 | #define __qzPaint_h__ 12 | 13 | #include "mkPaint.h" 14 | 15 | namespace MonkVG { 16 | 17 | class QuartzPaint : public IPaint { 18 | public: 19 | }; 20 | } 21 | #endif // __qzPaint_h__ -------------------------------------------------------------------------------- /src/Quartz_DEPRECATED/qzPath.h: -------------------------------------------------------------------------------- 1 | /* 2 | * qzPath.h 3 | * MonkVG-Quartz 4 | * 5 | * Created by Micah Pearlman on 3/3/09. 6 | * Copyright 2009 Monk Games. All rights reserved. 7 | * 8 | */ 9 | 10 | #ifndef __qzPath_h__ 11 | #define __qzPath_h__ 12 | 13 | #include "mkPath.h" 14 | #include 15 | namespace MonkVG { 16 | 17 | class QuartzPath : public IPath { 18 | public: 19 | 20 | QuartzPath( VGint pathFormat, VGPathDatatype datatype, VGfloat scale, VGfloat bias, VGint segmentCapacityHint, VGint coordCapacityHint, VGbitfield capabilities ) 21 | : IPath( pathFormat, datatype, scale, bias, segmentCapacityHint, coordCapacityHint, capabilities ) 22 | // , _uibezeirpath( nil ) 23 | { 24 | 25 | } 26 | virtual ~QuartzPath() { 27 | 28 | } 29 | 30 | 31 | virtual bool draw( VGbitfield paintModes ); 32 | 33 | private: 34 | //UIBezierPath* _uibezeirpath; 35 | }; 36 | } 37 | 38 | #endif // __qzPath_h__ -------------------------------------------------------------------------------- /src/mkBaseObject.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * mkBaseObject.cpp 3 | * MonkVG-XCode 4 | * 5 | * Created by Micah Pearlman on 2/22/09. 6 | * Copyright 2009 Monk Games. All rights reserved. 7 | * 8 | */ 9 | 10 | #include "mkBaseObject.h" 11 | 12 | -------------------------------------------------------------------------------- /src/mkBaseObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mkBaseObject.h 3 | * MonkVG-XCode 4 | * 5 | * Created by Micah Pearlman on 2/22/09. 6 | * Copyright 2009 Monk Games. All rights reserved. 7 | * 8 | */ 9 | 10 | #ifndef __mkBaseObject_h__ 11 | #define __mkBaseObject_h__ 12 | 13 | #include "MonkVG/openvg.h" 14 | 15 | 16 | namespace MonkVG { 17 | 18 | class IContext; 19 | 20 | /** 21 | * @brief Base object class that all MonkVG objects derive from. This class 22 | * provides the interface for all objects to be able to set and get parameters 23 | * as used by the OpenVG API. 24 | */ 25 | class BaseObject { 26 | public: 27 | //// object types //// 28 | enum Type { 29 | kPathType, 30 | kPaintType, 31 | kImageType, 32 | kMaskLayerType, 33 | kFontType, 34 | kBatchType, 35 | 36 | kMAXIMUM_TYPE 37 | }; 38 | 39 | BaseObject(IContext &context) : _context(context) { incRef(); } 40 | virtual ~BaseObject() = default; 41 | 42 | /** 43 | * @brief Get the Type object 44 | * 45 | * @return BaseObject::Type 46 | */ 47 | virtual BaseObject::Type getType() const = 0; 48 | 49 | //// parameter accessors/mutators //// 50 | virtual VGint getParameteri(const VGint p) const = 0; 51 | virtual VGfloat getParameterf(const VGint f) const = 0; 52 | virtual void getParameterfv(const VGint p, VGfloat *fv) const = 0; 53 | virtual void setParameter(const VGint p, const VGfloat f) = 0; 54 | virtual void setParameter(const VGint p, const VGint i) = 0; 55 | virtual void setParameter(const VGint p, const VGfloat *fv, 56 | const VGint cnt) = 0; 57 | 58 | //// reference counting //// 59 | void incRef() { ++_ref_count; } 60 | void decRef() { 61 | if (--_ref_count == 0) 62 | delete this; 63 | } 64 | 65 | /** 66 | * @brief Get the global context. 67 | * 68 | * @return IContext& 69 | */ 70 | IContext &getContext() { return _context; } 71 | 72 | protected: 73 | IContext &_context; 74 | 75 | private: 76 | int _ref_count = 0; 77 | }; 78 | 79 | void SetError(const VGErrorCode e); 80 | } // namespace MonkVG 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /src/mkBatch.h: -------------------------------------------------------------------------------- 1 | // 2 | // mkBatch.h 3 | // MonkVG-iOS 4 | // 5 | // Created by Micah Pearlman on 6/27/11. 6 | // Copyright 2011 Zero Vision. All rights reserved. 7 | // 8 | #ifndef __mkBatch_h__ 9 | #define __mkBatch_h__ 10 | 11 | #include 12 | #include "mkBaseObject.h" 13 | 14 | namespace MonkVG { 15 | 16 | class IBatch : public BaseObject { 17 | public: 18 | 19 | inline BaseObject::Type getType() const override { 20 | return BaseObject::kBatchType; 21 | } 22 | 23 | virtual ~IBatch() = default; 24 | 25 | 26 | //// parameter accessors/mutators //// 27 | virtual VGint getParameteri(const VGint p) const override; 28 | virtual VGfloat getParameterf(const VGint f) const override; 29 | virtual void getParameterfv(const VGint p, VGfloat *fv) const override; 30 | virtual void setParameter(const VGint p, const VGfloat f) override; 31 | virtual void setParameter(const VGint p, const VGint i) override; 32 | virtual void setParameter(const VGint p, const VGfloat *fv, 33 | const VGint cnt) override; 34 | 35 | virtual void draw() = 0; 36 | virtual void dump(void **vertices, size_t *size) = 0; 37 | virtual void finalize() = 0; 38 | 39 | protected: 40 | IBatch(IContext &context) : BaseObject(context) {} 41 | }; 42 | 43 | } // namespace MonkVG 44 | 45 | #endif // __mkBatch_h__ 46 | -------------------------------------------------------------------------------- /src/mkCommon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mkCommon.h 3 | * MonkVG-XCode 4 | * 5 | * Created by Micah Pearlman on 2/22/09. 6 | * Copyright 2009 Monk Games. All rights reserved. 7 | * 8 | */ 9 | 10 | #ifndef __mkCommon_h__ 11 | #define __mkCommon_h__ 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #if defined(ANDROID) 18 | #include 19 | #endif 20 | 21 | #if defined(ANDROID) 22 | #define MK_LOG(...) __android_log_print(ANDROID_LOG_INFO, "MonkVG", __VA_ARGS__) 23 | #else 24 | #define MK_LOG(...) printf(__VA_ARGS__) 25 | #endif 26 | 27 | #if defined(NDEBUG) 28 | #define MK_ASSERT(x) ((void)0) 29 | #else 30 | #define MK_ASSERT(x) assert(x) 31 | #endif 32 | 33 | #endif // __mkCommon_h__ 34 | -------------------------------------------------------------------------------- /src/mkGradient.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file mkGradient.h 3 | * @author Micah Pearlman (micahpearlman@gmail.com) 4 | * @brief Generate gradient images for use in paints. 5 | * @version 0.1 6 | * @date 2024-10-21 7 | * 8 | * @copyright Copyright (c) 2024 9 | * 10 | */ 11 | #ifndef __MK_GRADIENT_H__ 12 | #define __MK_GRADIENT_H__ 13 | 14 | #include "mkTypes.h" 15 | #include 16 | #include 17 | #include 18 | 19 | namespace MonkVG { 20 | 21 | VGImage buildLinearGradientImage(const std::array &linear_gradient, 22 | const std::vector &stops, 23 | const VGColorRampSpreadMode spread_mode, 24 | const VGfloat path_width, 25 | const VGfloat path_height); 26 | VGImage buildRadialGradientImage(const std::array &radial_gradient, 27 | const std::vector &stops, 28 | const VGColorRampSpreadMode spread_mode, 29 | const VGfloat path_width, 30 | const VGfloat path_height); 31 | VGImage buildLinear2x3GradientImage(const std::array &gradient_2x3, 32 | const std::vector &stops, 33 | const VGColorRampSpreadMode spread_mode, 34 | const VGfloat path_width, 35 | const VGfloat path_height); 36 | VGImage buildRadial2x3GradientImage(const std::array &gradient_2x3, 37 | const std::vector &stops, 38 | const VGColorRampSpreadMode spread_mode, 39 | const VGfloat path_width, 40 | const VGfloat path_height); 41 | 42 | } // namespace MonkVG 43 | 44 | #endif // __MK_GRADIENT_H__ -------------------------------------------------------------------------------- /src/mkTypes.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file mkTypes.h 3 | * @author Micah Pearlman (micahpearlman@gmail.com) 4 | * @brief MonkVG types 5 | * @version 0.1 6 | * @date 2024-10-14 7 | * 8 | * @copyright Copyright (c) 2024 9 | * 10 | */ 11 | #ifndef __MK_TYPES_H__ 12 | #define __MK_TYPES_H__ 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | namespace MonkVG { 19 | 20 | /** 21 | * @brief A "plain" 2d position vertex. 22 | * 23 | */ 24 | union vertex_2d_t { 25 | struct { 26 | float x, y; 27 | }; 28 | float v[2]; 29 | }; 30 | 31 | /** 32 | * @brief A 2d position + texture coordinate vertex. 33 | * 34 | */ 35 | struct textured_vertex_2d_t { 36 | vertex_2d_t vert; 37 | union { 38 | float uv[2]; 39 | struct { 40 | float u, v; 41 | }; 42 | }; 43 | }; 44 | 45 | /** 46 | * @brief Bounding box with min x, min y, width, and height. 47 | * NOTE: OpenVG origin is lower left corner. 48 | * 49 | */ 50 | struct bounding_box_t { 51 | float min_x = 0; 52 | float min_y = 0; 53 | float width = 0; 54 | float height = 0; 55 | 56 | bounding_box_t() = default; 57 | bounding_box_t(float x, float y, float w, float h) 58 | : min_x(x), min_y(y), width(w), height(h) {} 59 | 60 | /** 61 | * @brief Add a point that the bounding box should contain and 62 | * expand the bounding box if necessary. 63 | * 64 | * @param x 65 | * @param y 66 | */ 67 | void update(float x, float y) { 68 | min_x = std::min(min_x, x); 69 | min_y = std::min(min_y, y); 70 | width = std::max(width, x - min_x); 71 | height = std::max(height, y - min_y); 72 | } 73 | }; 74 | 75 | /** 76 | * @brief a gradient stop is a position (index 0) and a color (index 1-4) 77 | * 78 | */ 79 | using gradient_stop_t = std::array; 80 | 81 | /** 82 | * @brief a color is a 4 element array of floats 83 | * 84 | */ 85 | using color_t = std::array; 86 | 87 | } // namespace MonkVG 88 | #endif // __MK_TYPES_H__ 89 | -------------------------------------------------------------------------------- /src/opengl/glBatch.h: -------------------------------------------------------------------------------- 1 | // 2 | // glBatch.h 3 | // MonkVG-iOS 4 | // 5 | // Created by Micah Pearlman on 6/27/11. 6 | // Copyright 2011 Zero Vision. All rights reserved. 7 | // 8 | #ifndef __glBatch_h__ 9 | #define __glBatch_h__ 10 | 11 | #include "mkBatch.h" 12 | 13 | #include "glPlatform.h" 14 | 15 | #include 16 | 17 | namespace MonkVG { 18 | class OpenGLBatch : public IBatch { 19 | public: 20 | OpenGLBatch(IContext &context); 21 | virtual ~OpenGLBatch(); 22 | 23 | virtual void draw(); 24 | virtual void dump(void **vertices, size_t *size); 25 | virtual void finalize(); 26 | 27 | void addPathVertexData(GLfloat *fill_verts, size_t fill_vert_cnt, 28 | GLfloat *stroke_verts, size_t stroke_vert_cnt, 29 | VGbitfield paint_modes); 30 | 31 | public: 32 | struct vertex_t { 33 | GLfloat v[2]; 34 | GLuint color; 35 | }; 36 | 37 | private: 38 | std::vector _vertices; 39 | size_t _vertexCount; 40 | GLuint _vbo; 41 | }; 42 | } // namespace MonkVG 43 | 44 | #endif // __glBatch_h__ 45 | -------------------------------------------------------------------------------- /src/opengl/glFont.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // glFont.cpp 3 | // MonkVG-iOS 4 | // 5 | // Created by Micah Pearlman on 6/29/11. 6 | // Copyright 2011 Zero Vision. All rights reserved. 7 | // 8 | 9 | #include "glFont.h" 10 | #include "glContext.h" 11 | 12 | namespace MonkVG { 13 | 14 | OpenGLFont::OpenGLFont(IContext& context) 15 | : IFont(context) 16 | { 17 | } 18 | 19 | OpenGLFont::~OpenGLFont() { 20 | } 21 | 22 | 23 | } -------------------------------------------------------------------------------- /src/opengl/glFont.h: -------------------------------------------------------------------------------- 1 | // 2 | // glFont.h 3 | // MonkVG-iOS 4 | // 5 | // Created by Micah Pearlman on 6/29/11. 6 | // Copyright 2011 Zero Vision. All rights reserved. 7 | // 8 | // 9 | #ifndef __glFont_h__ 10 | #define __glFont_h__ 11 | 12 | #include "mkFont.h" 13 | 14 | namespace MonkVG { 15 | class OpenGLFont : public IFont { 16 | public: 17 | 18 | OpenGLFont(IContext& context); 19 | virtual ~OpenGLFont(); 20 | 21 | }; 22 | } 23 | 24 | #endif // __glFont_h__ 25 | -------------------------------------------------------------------------------- /src/opengl/glImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // glImage.h 3 | // MonkVG-iOS 4 | // 5 | // Created by Micah Pearlman on 6/28/11. 6 | // Copyright 2011 Zero Vision. All rights reserved. 7 | // 8 | #ifndef __glImage_h__ 9 | #define __glImage_h__ 10 | 11 | #include "mkImage.h" 12 | #include "glPlatform.h" 13 | #include 14 | 15 | namespace MonkVG { 16 | class OpenGLImage : public IImage { 17 | public: 18 | OpenGLImage(VGImageFormat format, VGint width, VGint height, 19 | VGbitfield allowedQuality, IContext &context); 20 | OpenGLImage(OpenGLImage &other); 21 | 22 | virtual ~OpenGLImage(); 23 | 24 | virtual IImage *createChild(VGint x, VGint y, VGint w, VGint h); 25 | 26 | // drawing 27 | virtual void draw(); 28 | virtual void drawSubRect(VGint ox, VGint oy, VGint w, VGint h, 29 | VGbitfield paintModes); 30 | virtual void drawToRect(VGint x, VGint y, VGint w, VGint h, 31 | VGbitfield paintModes); 32 | virtual void drawAtPoint(VGint x, VGint y, VGbitfield paintModes); 33 | 34 | virtual void setSubData(const void *data, VGint dataStride, 35 | VGImageFormat dataFormat, VGint x, VGint y, 36 | VGint width, VGint height); 37 | 38 | void bind(); 39 | void unbind(); 40 | 41 | private: 42 | GLuint _gl_texture = GL_UNDEFINED; 43 | GLuint _vao = GL_UNDEFINED; 44 | GLuint _vbo = GL_UNDEFINED; 45 | }; 46 | } // namespace MonkVG 47 | 48 | #endif // __glImage_h__ 49 | -------------------------------------------------------------------------------- /src/opengl/glPaint.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * glPaint.cpp 3 | * MonkVG-OpenGL 4 | * 5 | * Created by Micah Pearlman on 8/6/10. 6 | * Copyright 2010 MP Engineering. All rights reserved. 7 | * 8 | */ 9 | 10 | #include "glPaint.h" 11 | #include 12 | #include 13 | #include "glContext.h" 14 | 15 | 16 | namespace MonkVG { 17 | 18 | OpenGLPaint::OpenGLPaint(IContext &context) 19 | : IPaint(context) {} 20 | 21 | OpenGLPaint::~OpenGLPaint() { 22 | } 23 | 24 | 25 | 26 | } // namespace MonkVG 27 | -------------------------------------------------------------------------------- /src/opengl/glPaint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * glPaint.h 3 | * MonkVG-OpenGL 4 | * 5 | * Created by Micah Pearlman on 8/6/10. 6 | * Copyright 2010 MP Engineering. All rights reserved. 7 | * 8 | */ 9 | 10 | #ifndef __glPaint_h__ 11 | #define __glPaint_h__ 12 | 13 | #include "mkPaint.h" 14 | #include "glPlatform.h" 15 | #include "glImage.h" 16 | 17 | namespace MonkVG { 18 | 19 | class OpenGLPaint : public IPaint { 20 | public: 21 | OpenGLPaint(IContext& context); 22 | virtual ~OpenGLPaint(); 23 | 24 | }; 25 | } // namespace MonkVG 26 | #endif // __qzPaint_h__ 27 | -------------------------------------------------------------------------------- /src/opengl/glPath.h: -------------------------------------------------------------------------------- 1 | /* 2 | * glPath.h 3 | * MonkVG-OpenGL 4 | * 5 | * Created by Micah Pearlman on 8/6/10. 6 | * Copyright 2010 MP Engineering. All rights reserved. 7 | * 8 | */ 9 | 10 | #ifndef __glPath_h__ 11 | #define __glPath_h__ 12 | 13 | #include "mkPath.h" 14 | #include "mkTessellator.h" 15 | #include "glPlatform.h" 16 | #include "glPaint.h" 17 | #include 18 | #include 19 | 20 | namespace MonkVG { 21 | 22 | class OpenGLPath : public IPath { 23 | public: 24 | OpenGLPath(VGint pathFormat, VGPathDatatype datatype, VGfloat scale, 25 | VGfloat bias, VGint segmentCapacityHint, VGint coordCapacityHint, 26 | VGbitfield capabilities, IContext &context); 27 | virtual ~OpenGLPath(); 28 | 29 | bool draw(VGbitfield paintModes) override; 30 | void clear(VGbitfield caps) override; 31 | void buildFillIfDirty() override; 32 | void buildStrokeIfDirty() override; 33 | 34 | private: 35 | // struct v2_t { 36 | // GLfloat x, y; 37 | // }; 38 | 39 | // struct textured_vertex_t { 40 | // GLfloat v[2]; 41 | // GLfloat uv[2]; 42 | // }; 43 | 44 | private: 45 | std::vector _fill_vertices = {}; 46 | std::vector _stroke_verts = {}; 47 | 48 | GLuint _fill_vbo = GL_UNDEFINED; 49 | GLuint _fill_vao = GL_UNDEFINED; 50 | GLuint _stroke_vbo = GL_UNDEFINED; 51 | GLuint _stroke_vao = GL_UNDEFINED; 52 | 53 | int _num_fill_verts = 0; 54 | int _num_stroke_verts = 0; 55 | OpenGLPaint *_fill_paint = nullptr; 56 | OpenGLPaint *_stroke_paint = nullptr; 57 | 58 | void buildOpenGLBuffers(VGbitfield paintModes); 59 | }; 60 | } // namespace MonkVG 61 | 62 | #endif // __glPath_h__ 63 | -------------------------------------------------------------------------------- /src/opengl/glPlatform.h: -------------------------------------------------------------------------------- 1 | // 2 | // glPlatform.h 3 | // MonkVG-iOS 4 | // 5 | // Created by Micah Pearlman on 8/6/11. 6 | // Copyright 2011 Zero Vision. All rights reserved. 7 | // 8 | 9 | #ifndef __GLPLATFORM_H__ 10 | #define __GLPLATFORM_H__ 11 | 12 | #ifndef GL_UNDEFINED 13 | #define GL_UNDEFINED 0 14 | #endif // GL_UNDEFINED 15 | 16 | #if defined(__APPLE__) 17 | // turn off opengl deprecated warnings 18 | #define GL_SILENCE_DEPRECATION 19 | 20 | #include "TargetConditionals.h" 21 | #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR 22 | #error "iOS not supported. TODO: Add support for iOS" 23 | #include "glu.h" 24 | #else // macos 25 | #include 26 | #include 27 | #endif 28 | 29 | #elif ANDROID 30 | 31 | #include "glu.h" 32 | 33 | #elif WIN32 34 | 35 | #define WIN32_LEAN_AND_MEAN 36 | #include 37 | #include 38 | #include 39 | #pragma comment(lib,"glew32.lib") 40 | 41 | #elif __linux__ 42 | 43 | #if defined(USE_OPENGL) 44 | #define PLATFORM_IS_GLES 0 45 | #define GL_GLEXT_PROTOTYPES 1 46 | #include 47 | #include 48 | // #include 49 | #define glOrthof glOrthofOES 50 | #include 51 | #include 52 | #include 53 | 54 | #else 55 | #define PLATFORM_IS_GLES 1 56 | #define GL_GLEXT_PROTOTYPES 1 57 | #if INCLUDE_ES1_HEADERS 58 | #include 59 | #include 60 | #else 61 | #include 62 | #include 63 | #endif // #if INCLUDE_ES1_HEADERS 64 | 65 | #include 66 | #endif // #if defined(USE_OPENGL) 67 | 68 | 69 | #endif // #if defined(__APPLE__) 70 | 71 | #ifndef APIENTRY 72 | #define APIENTRY 73 | #endif // APIENTRY 74 | 75 | #endif // __GLPLATFORM_H__ 76 | -------------------------------------------------------------------------------- /src/opengl/glShader.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file glShader.h 3 | * @author Micah Pearlman (you@domain.com) 4 | * @brief 5 | * @version 0.1 6 | * @date 2024-09-03 7 | * 8 | * @copyright Copyright Zero Engineering (c) 2024 9 | * 10 | */ 11 | #ifndef __glShader_h__ 12 | #define __glShader_h__ 13 | 14 | #include "glPlatform.h" 15 | #include 16 | 17 | namespace MonkVG { 18 | class OpenGLShader { 19 | public: 20 | OpenGLShader(); 21 | virtual ~OpenGLShader(); 22 | 23 | /** 24 | * @brief Compile a shader given the vertex and fragment source text. 25 | * NOTE: NOT file path 26 | * 27 | * @param vertex_src 28 | * @param fragment_src 29 | * @return true if successful 30 | */ 31 | bool compile(const char *vertex_src, const char *fragment_src); 32 | 33 | /** 34 | * @brief Bind the shader program 35 | * 36 | */ 37 | void bind(); 38 | 39 | /** 40 | * @brief Unbind the shader program 41 | * 42 | */ 43 | void unbind(); 44 | 45 | // uniform setters 46 | void setUniform1i(const char *name, int value); 47 | void setUniform1f(const char *name, float value); 48 | void setUniform2f(const char *name, float x, float y); 49 | void setUniform3f(const char *name, float x, float y, float z); 50 | void setUniform4f(const char *name, float x, float y, float z, float w); 51 | void setUniformMatrix4fv(const char *name, float *matrix); 52 | 53 | // uniform getters 54 | GLuint getUniformLocation(const char *name); 55 | 56 | // projection and modelview setters 57 | // NOTE: this assumes there is a uniform in the shader called "u_projection" 58 | // and "u_model_view" 59 | void setProjectionMatrix(const glm::mat4 &matrix); 60 | void setModelViewMatrix(const glm::mat4 &matrix); 61 | 62 | // color setter 63 | // NOTE: this assumes there is a uniform in the shader called "u_color" 64 | void setColor(const glm::vec4 &color); 65 | 66 | private: 67 | GLuint _program = -1; 68 | GLuint _vertex_shader = -1; 69 | GLuint _fragment_shader = -1; 70 | 71 | GLint _u_projection = -1; 72 | GLint _u_model_view = -1; 73 | GLint _u_color = -1; 74 | }; 75 | } // namespace MonkVG 76 | #endif // __glShader_h__ 77 | -------------------------------------------------------------------------------- /src/opengl/shaders/color_frag.glsl: -------------------------------------------------------------------------------- 1 | #ifdef CPP_GLSL_INCLUDE 2 | std::string color_frag = R"( 3 | #version 330 core 4 | 5 | layout (location = 0) out vec4 fragmentColor; 6 | 7 | in vec4 out_color; 8 | 9 | void main() { 10 | // simple pass through 11 | fragmentColor = out_color; 12 | } 13 | 14 | )"; 15 | #endif 16 | -------------------------------------------------------------------------------- /src/opengl/shaders/color_vert.glsl: -------------------------------------------------------------------------------- 1 | #ifdef CPP_GLSL_INCLUDE 2 | std::string color_vert = R"( 3 | #version 330 core 4 | 5 | uniform mat4 u_model_view; 6 | uniform mat4 u_projection; 7 | uniform vec4 u_color; 8 | 9 | layout (location = 0) in vec2 coords2d; 10 | 11 | out vec4 out_color; 12 | void main() { 13 | gl_Position = u_projection * u_model_view * vec4(coords2d, 1.0, 1.0); 14 | out_color = u_color; 15 | } 16 | 17 | )"; 18 | #endif -------------------------------------------------------------------------------- /src/opengl/shaders/texture_frag.glsl: -------------------------------------------------------------------------------- 1 | #ifdef CPP_GLSL_INCLUDE 2 | std::string texture_frag = R"( 3 | #version 330 core 4 | 5 | layout (location = 0) out vec4 fragmentColor; 6 | 7 | in vec2 tex_coord_out; 8 | 9 | uniform sampler2D tex1; 10 | uniform vec4 u_color; 11 | 12 | 13 | void main() { 14 | fragmentColor = texture(tex1, tex_coord_out) * u_color; 15 | } 16 | 17 | )"; 18 | #endif 19 | -------------------------------------------------------------------------------- /src/opengl/shaders/texture_vert.glsl: -------------------------------------------------------------------------------- 1 | #ifdef CPP_GLSL_INCLUDE 2 | std::string texture_vert = R"( 3 | #version 330 core 4 | 5 | uniform mat4 u_model_view; 6 | uniform mat4 u_projection; 7 | 8 | layout (location = 0) in vec2 position; 9 | layout (location = 1) in vec2 tex_coords; 10 | 11 | out vec2 tex_coord_out; 12 | void main() { 13 | gl_Position = u_projection * u_model_view * vec4(position, 1.0, 1.0); 14 | tex_coord_out = tex_coords; 15 | } 16 | 17 | )"; 18 | #endif -------------------------------------------------------------------------------- /src/opengl_es_DEPRECATED/glesBatch.h: -------------------------------------------------------------------------------- 1 | // 2 | // glBatch.h 3 | // MonkVG-iOS 4 | // 5 | // Created by Micah Pearlman on 6/27/11. 6 | // Copyright 2011 Zero Vision. All rights reserved. 7 | // 8 | #ifndef __glesBatch_h__ 9 | #define __glesBatch_h__ 10 | 11 | #include "mkBatch.h" 12 | 13 | #include "glesPlatform.h" 14 | 15 | #include 16 | 17 | namespace MonkVG { 18 | class OpenGLBatch : public IBatch { 19 | public: 20 | 21 | OpenGLBatch(); 22 | virtual ~OpenGLBatch(); 23 | 24 | virtual void draw(); 25 | virtual void dump( void **vertices, size_t *size ); 26 | virtual void finalize(); 27 | 28 | void addPathVertexData( GLfloat* fillVerts, size_t fillVertCnt, GLfloat* strokeVerts, size_t strokeVertCnt, VGbitfield paintModes ); 29 | 30 | public: 31 | struct vertex_t { 32 | GLfloat v[2]; 33 | GLuint color; 34 | }; 35 | private: 36 | 37 | std::vector _vertices; 38 | size_t _vertexCount; 39 | GLuint _vbo; 40 | 41 | 42 | }; 43 | } 44 | 45 | #endif // __glesBatch_h__ 46 | -------------------------------------------------------------------------------- /src/opengl_es_DEPRECATED/glesFont.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // glFont.cpp 3 | // MonkVG-iOS 4 | // 5 | // Created by Micah Pearlman on 6/29/11. 6 | // Copyright 2011 Zero Vision. All rights reserved. 7 | // 8 | 9 | #include "glesFont.h" 10 | #include "glesContext.h" 11 | 12 | namespace MonkVG { 13 | 14 | OpenGLFont::OpenGLFont( ) 15 | : IFont( ) 16 | { 17 | } 18 | 19 | OpenGLFont::~OpenGLFont() { 20 | } 21 | 22 | 23 | } -------------------------------------------------------------------------------- /src/opengl_es_DEPRECATED/glesFont.h: -------------------------------------------------------------------------------- 1 | // 2 | // glFont.h 3 | // MonkVG-iOS 4 | // 5 | // Created by Micah Pearlman on 6/29/11. 6 | // Copyright 2011 Zero Vision. All rights reserved. 7 | // 8 | // 9 | #ifndef __glesFont_h__ 10 | #define __glesFont_h__ 11 | 12 | #include "mkFont.h" 13 | 14 | namespace MonkVG { 15 | class OpenGLFont : public IFont { 16 | public: 17 | 18 | OpenGLFont(); 19 | 20 | virtual ~OpenGLFont(); 21 | 22 | private: 23 | 24 | }; 25 | } 26 | 27 | #endif // __glesFont_h__ 28 | -------------------------------------------------------------------------------- /src/opengl_es_DEPRECATED/glesImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // glImage.h 3 | // MonkVG-iOS 4 | // 5 | // Created by Micah Pearlman on 6/28/11. 6 | // Copyright 2011 Zero Vision. All rights reserved. 7 | // 8 | #ifndef __glesImage_h__ 9 | #define __glesImage_h__ 10 | 11 | #include "mkImage.h" 12 | #include "glesPlatform.h" 13 | #include 14 | 15 | namespace MonkVG { 16 | class OpenGLImage : public IImage { 17 | public: 18 | 19 | OpenGLImage( VGImageFormat format, 20 | VGint width, VGint height, 21 | VGbitfield allowedQuality ); 22 | OpenGLImage( OpenGLImage& other ); 23 | 24 | virtual ~OpenGLImage(); 25 | 26 | virtual IImage* createChild( VGint x, VGint y, VGint w, VGint h ); 27 | 28 | // drawing 29 | virtual void draw(); 30 | virtual void drawSubRect( VGint ox, VGint oy, VGint w, VGint h, VGbitfield paintModes ); 31 | virtual void drawToRect( VGint x, VGint y, VGint w, VGint h, VGbitfield paintModes ); 32 | virtual void drawAtPoint( VGint x, VGint y, VGbitfield paintModes ); 33 | 34 | virtual void setSubData( const void * data, VGint dataStride, 35 | VGImageFormat dataFormat, 36 | VGint x, VGint y, VGint width, VGint height ); 37 | 38 | void bind(); 39 | void unbind(); 40 | 41 | private: 42 | GLuint _name; 43 | }; 44 | } 45 | 46 | #endif // __glesImage_h__ 47 | -------------------------------------------------------------------------------- /src/opengl_es_DEPRECATED/glesPaint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * glPaint.h 3 | * MonkVG-OpenGL 4 | * 5 | * Created by Micah Pearlman on 8/6/10. 6 | * Copyright 2010 MP Engineering. All rights reserved. 7 | * 8 | */ 9 | 10 | #ifndef __glesPaint_h__ 11 | #define __glesPaint_h__ 12 | 13 | #include "mkPaint.h" 14 | #include "glesPlatform.h" 15 | #include "glesImage.h" 16 | 17 | namespace MonkVG { 18 | 19 | 20 | class OpenGLPaint : public IPaint { 21 | public: 22 | OpenGLPaint(); 23 | virtual ~OpenGLPaint(); 24 | void setGLState(); 25 | void buildLinearGradientImage( VGfloat pathWidth, VGfloat pathHeight ); 26 | void buildRadialGradientImage( VGfloat pathWidth, VGfloat pathHeight ); 27 | void buildLinear2x3GradientImage( VGfloat pathWidth, VGfloat pathHeight ); 28 | void buildRadial2x3GradientImage( VGfloat pathWidth, VGfloat pathHeight ); 29 | void buildGradientImage( VGfloat pathWidth, VGfloat pathHeight ); 30 | virtual bool isDirty() { return _isDirty; } 31 | virtual void setIsDirty( bool b ) { _isDirty = b; } 32 | 33 | OpenGLImage* getGradientImage() { return (OpenGLImage*)_gradientImage; } 34 | 35 | private: 36 | bool _isDirty; 37 | VGImage _gradientImage; 38 | 39 | void calcStops(float ** stop0, float ** stop1, float g); 40 | void lerpColor(float * dst, float * stop0, float * stop1, float g); 41 | 42 | }; 43 | } 44 | #endif // __glesPaint_h__ 45 | -------------------------------------------------------------------------------- /src/opengl_es_DEPRECATED/glesPlatform.h: -------------------------------------------------------------------------------- 1 | // 2 | // glPlatform.h 3 | // MonkVG-iOS 4 | // 5 | // Created by Micah Pearlman on 8/6/11. 6 | // Copyright 2011 Zero Vision. All rights reserved. 7 | // 8 | 9 | #ifndef __glesPlatform_h__ 10 | #define __glesPlatform_h__ 11 | 12 | #if defined(__APPLE__) 13 | // turn off opengl deprecated warnings 14 | #define GL_SILENCE_DEPRECATION 15 | 16 | #include "TargetConditionals.h" 17 | #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR 18 | #include "glu.h" 19 | #else // OSX 20 | #include 21 | #define glOrthof glOrtho 22 | #endif 23 | 24 | #elif ANDROID 25 | 26 | #include "glu.h" 27 | 28 | #elif WIN32 29 | 30 | #define WIN32_LEAN_AND_MEAN 31 | #include 32 | #include 33 | #include 34 | #pragma comment(lib,"glew32.lib") 35 | 36 | #elif __linux__ 37 | 38 | #if defined(USE_OPENGL) 39 | #define PLATFORM_IS_GLES 0 40 | #define GL_GLEXT_PROTOTYPES 1 41 | #include 42 | #include 43 | // #include 44 | #define glOrthof glOrthofOES 45 | #include 46 | #include 47 | #include 48 | 49 | #else 50 | #define PLATFORM_IS_GLES 1 51 | #define GL_GLEXT_PROTOTYPES 1 52 | #if INCLUDE_ES1_HEADERS 53 | #include 54 | #include 55 | #else 56 | #include 57 | #include 58 | #endif // #if INCLUDE_ES1_HEADERS 59 | 60 | #include 61 | #endif // #if defined(USE_OPENGL) 62 | 63 | 64 | #endif // #if defined(__APPLE__) 65 | 66 | #ifndef APIENTRY 67 | #define APIENTRY 68 | #endif // APIENTRY 69 | 70 | #endif // __glesPlatform_h__ 71 | -------------------------------------------------------------------------------- /src/vulkan/shaders/color.frag: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout (location = 0) out vec4 fragmentColor; 4 | 5 | layout (location = 0) in vec4 out_color; 6 | 7 | void main() { 8 | // simple pass through 9 | fragmentColor = out_color; 10 | } 11 | -------------------------------------------------------------------------------- /src/vulkan/shaders/color.frag.h: -------------------------------------------------------------------------------- 1 | {0x07230203,0x00010000,0x000d000b,0x0000000d, 2 | 0x00000000,0x00020011,0x00000001,0x0006000b, 3 | 0x00000001,0x4c534c47,0x6474732e,0x3035342e, 4 | 0x00000000,0x0003000e,0x00000000,0x00000001, 5 | 0x0007000f,0x00000004,0x00000004,0x6e69616d, 6 | 0x00000000,0x00000009,0x0000000b,0x00030010, 7 | 0x00000004,0x00000007,0x00030003,0x00000002, 8 | 0x000001c2,0x000a0004,0x475f4c47,0x4c474f4f, 9 | 0x70635f45,0x74735f70,0x5f656c79,0x656e696c, 10 | 0x7269645f,0x69746365,0x00006576,0x00080004, 11 | 0x475f4c47,0x4c474f4f,0x6e695f45,0x64756c63, 12 | 0x69645f65,0x74636572,0x00657669,0x00040005, 13 | 0x00000004,0x6e69616d,0x00000000,0x00060005, 14 | 0x00000009,0x67617266,0x746e656d,0x6f6c6f43, 15 | 0x00000072,0x00050005,0x0000000b,0x5f74756f, 16 | 0x6f6c6f63,0x00000072,0x00040047,0x00000009, 17 | 0x0000001e,0x00000000,0x00040047,0x0000000b, 18 | 0x0000001e,0x00000000,0x00020013,0x00000002, 19 | 0x00030021,0x00000003,0x00000002,0x00030016, 20 | 0x00000006,0x00000020,0x00040017,0x00000007, 21 | 0x00000006,0x00000004,0x00040020,0x00000008, 22 | 0x00000003,0x00000007,0x0004003b,0x00000008, 23 | 0x00000009,0x00000003,0x00040020,0x0000000a, 24 | 0x00000001,0x00000007,0x0004003b,0x0000000a, 25 | 0x0000000b,0x00000001,0x00050036,0x00000002, 26 | 0x00000004,0x00000000,0x00000003,0x000200f8, 27 | 0x00000005,0x0004003d,0x00000007,0x0000000c, 28 | 0x0000000b,0x0003003e,0x00000009,0x0000000c, 29 | 0x000100fd,0x00010038} 30 | -------------------------------------------------------------------------------- /src/vulkan/shaders/color.vert: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(push_constant) uniform PushConstants { 4 | mat4 u_model_view; 5 | mat4 u_projection; 6 | vec4 u_color; 7 | } push_constants; 8 | 9 | layout(location = 0) in vec2 coords2d; 10 | 11 | layout(location = 0) out vec4 out_color; 12 | 13 | 14 | void main() { 15 | gl_Position = push_constants.u_projection * push_constants.u_model_view * vec4(coords2d, 0.0, 1.0); 16 | out_color = push_constants.u_color; 17 | } 18 | -------------------------------------------------------------------------------- /src/vulkan/shaders/test.frag: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(location = 0) in vec3 fragColor; 4 | 5 | layout(location = 0) out vec4 outColor; 6 | 7 | void main() { 8 | outColor = vec4(fragColor, 1.0); 9 | } 10 | -------------------------------------------------------------------------------- /src/vulkan/shaders/test.frag.h: -------------------------------------------------------------------------------- 1 | {0x07230203,0x00010000,0x000d000b,0x00000013, 2 | 0x00000000,0x00020011,0x00000001,0x0006000b, 3 | 0x00000001,0x4c534c47,0x6474732e,0x3035342e, 4 | 0x00000000,0x0003000e,0x00000000,0x00000001, 5 | 0x0007000f,0x00000004,0x00000004,0x6e69616d, 6 | 0x00000000,0x00000009,0x0000000c,0x00030010, 7 | 0x00000004,0x00000007,0x00030003,0x00000002, 8 | 0x000001c2,0x000a0004,0x475f4c47,0x4c474f4f, 9 | 0x70635f45,0x74735f70,0x5f656c79,0x656e696c, 10 | 0x7269645f,0x69746365,0x00006576,0x00080004, 11 | 0x475f4c47,0x4c474f4f,0x6e695f45,0x64756c63, 12 | 0x69645f65,0x74636572,0x00657669,0x00040005, 13 | 0x00000004,0x6e69616d,0x00000000,0x00050005, 14 | 0x00000009,0x4374756f,0x726f6c6f,0x00000000, 15 | 0x00050005,0x0000000c,0x67617266,0x6f6c6f43, 16 | 0x00000072,0x00040047,0x00000009,0x0000001e, 17 | 0x00000000,0x00040047,0x0000000c,0x0000001e, 18 | 0x00000000,0x00020013,0x00000002,0x00030021, 19 | 0x00000003,0x00000002,0x00030016,0x00000006, 20 | 0x00000020,0x00040017,0x00000007,0x00000006, 21 | 0x00000004,0x00040020,0x00000008,0x00000003, 22 | 0x00000007,0x0004003b,0x00000008,0x00000009, 23 | 0x00000003,0x00040017,0x0000000a,0x00000006, 24 | 0x00000003,0x00040020,0x0000000b,0x00000001, 25 | 0x0000000a,0x0004003b,0x0000000b,0x0000000c, 26 | 0x00000001,0x0004002b,0x00000006,0x0000000e, 27 | 0x3f800000,0x00050036,0x00000002,0x00000004, 28 | 0x00000000,0x00000003,0x000200f8,0x00000005, 29 | 0x0004003d,0x0000000a,0x0000000d,0x0000000c, 30 | 0x00050051,0x00000006,0x0000000f,0x0000000d, 31 | 0x00000000,0x00050051,0x00000006,0x00000010, 32 | 0x0000000d,0x00000001,0x00050051,0x00000006, 33 | 0x00000011,0x0000000d,0x00000002,0x00070050, 34 | 0x00000007,0x00000012,0x0000000f,0x00000010, 35 | 0x00000011,0x0000000e,0x0003003e,0x00000009, 36 | 0x00000012,0x000100fd,0x00010038} 37 | -------------------------------------------------------------------------------- /src/vulkan/shaders/test.vert: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(location = 0) out vec3 fragColor; 4 | 5 | vec2 positions[3] = vec2[]( 6 | vec2(0.0, -0.5), 7 | vec2(0.5, 0.5), 8 | vec2(-0.5, 0.5) 9 | ); 10 | 11 | vec3 colors[3] = vec3[]( 12 | vec3(1.0, 0.0, 0.0), 13 | vec3(0.0, 1.0, 0.0), 14 | vec3(0.0, 0.0, 1.0) 15 | ); 16 | 17 | void main() { 18 | gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0); 19 | fragColor = colors[gl_VertexIndex]; 20 | } -------------------------------------------------------------------------------- /src/vulkan/shaders/texture.frag: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | // layout(set = 0, binding = 0) uniform UBO { 4 | // vec4 u_color; 5 | // }; 6 | 7 | layout (set = 0, binding = 1) uniform sampler2D tex1; 8 | 9 | layout(location = 0) out vec4 fragmentColor; 10 | layout(location = 0) in vec2 out_tex_coords; 11 | 12 | 13 | void main() { 14 | // fragmentColor = vec4(0.6353, 0.9725, 0.6118, 1.0);// texture(tex1, tex_coord_out);// * u_color; 15 | fragmentColor = texture(tex1, out_tex_coords);// * u_color; 16 | } 17 | -------------------------------------------------------------------------------- /src/vulkan/shaders/texture.frag.h: -------------------------------------------------------------------------------- 1 | {0x07230203,0x00010000,0x000d000b,0x00000014, 2 | 0x00000000,0x00020011,0x00000001,0x0006000b, 3 | 0x00000001,0x4c534c47,0x6474732e,0x3035342e, 4 | 0x00000000,0x0003000e,0x00000000,0x00000001, 5 | 0x0007000f,0x00000004,0x00000004,0x6e69616d, 6 | 0x00000000,0x00000009,0x00000011,0x00030010, 7 | 0x00000004,0x00000007,0x00030003,0x00000002, 8 | 0x000001c2,0x000a0004,0x475f4c47,0x4c474f4f, 9 | 0x70635f45,0x74735f70,0x5f656c79,0x656e696c, 10 | 0x7269645f,0x69746365,0x00006576,0x00080004, 11 | 0x475f4c47,0x4c474f4f,0x6e695f45,0x64756c63, 12 | 0x69645f65,0x74636572,0x00657669,0x00040005, 13 | 0x00000004,0x6e69616d,0x00000000,0x00060005, 14 | 0x00000009,0x67617266,0x746e656d,0x6f6c6f43, 15 | 0x00000072,0x00040005,0x0000000d,0x31786574, 16 | 0x00000000,0x00060005,0x00000011,0x5f74756f, 17 | 0x5f786574,0x726f6f63,0x00007364,0x00040047, 18 | 0x00000009,0x0000001e,0x00000000,0x00040047, 19 | 0x0000000d,0x00000022,0x00000000,0x00040047, 20 | 0x0000000d,0x00000021,0x00000001,0x00040047, 21 | 0x00000011,0x0000001e,0x00000000,0x00020013, 22 | 0x00000002,0x00030021,0x00000003,0x00000002, 23 | 0x00030016,0x00000006,0x00000020,0x00040017, 24 | 0x00000007,0x00000006,0x00000004,0x00040020, 25 | 0x00000008,0x00000003,0x00000007,0x0004003b, 26 | 0x00000008,0x00000009,0x00000003,0x00090019, 27 | 0x0000000a,0x00000006,0x00000001,0x00000000, 28 | 0x00000000,0x00000000,0x00000001,0x00000000, 29 | 0x0003001b,0x0000000b,0x0000000a,0x00040020, 30 | 0x0000000c,0x00000000,0x0000000b,0x0004003b, 31 | 0x0000000c,0x0000000d,0x00000000,0x00040017, 32 | 0x0000000f,0x00000006,0x00000002,0x00040020, 33 | 0x00000010,0x00000001,0x0000000f,0x0004003b, 34 | 0x00000010,0x00000011,0x00000001,0x00050036, 35 | 0x00000002,0x00000004,0x00000000,0x00000003, 36 | 0x000200f8,0x00000005,0x0004003d,0x0000000b, 37 | 0x0000000e,0x0000000d,0x0004003d,0x0000000f, 38 | 0x00000012,0x00000011,0x00050057,0x00000007, 39 | 0x00000013,0x0000000e,0x00000012,0x0003003e, 40 | 0x00000009,0x00000013,0x000100fd,0x00010038} 41 | -------------------------------------------------------------------------------- /src/vulkan/shaders/texture.vert: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | layout(push_constant) uniform PushConstants { 4 | mat4 u_model_view; 5 | mat4 u_projection; 6 | } push_constants; 7 | 8 | layout (location = 0) in vec2 in_position; 9 | layout (location = 1) in vec2 in_tex_coords; 10 | 11 | layout (location = 0) out vec2 out_tex_coords; 12 | 13 | void main() { 14 | gl_Position = push_constants.u_projection * push_constants.u_model_view * vec4(in_position, 0.0, 1.0); 15 | out_tex_coords = in_tex_coords; 16 | } 17 | -------------------------------------------------------------------------------- /src/vulkan/vkBatch.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micahpearlman/MonkVG/8fb5de3b4a82ae13a243aa70ca74dfabe17bb164/src/vulkan/vkBatch.cpp -------------------------------------------------------------------------------- /src/vulkan/vkBatch.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micahpearlman/MonkVG/8fb5de3b4a82ae13a243aa70ca74dfabe17bb164/src/vulkan/vkBatch.h -------------------------------------------------------------------------------- /src/vulkan/vkColorPipeline.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file vkColorPipeline.h 3 | * @author Micah Pearlman (micahpearlman@gmail.com) 4 | * @brief A color pipeline using the color.vert and color.frag shaders 5 | * @version 0.1 6 | * @date 2024-10-18 7 | * 8 | * @copyright Copyright (c) 2024 9 | * 10 | */ 11 | 12 | #ifndef __VK_COLOR_PIPELINE_H__ 13 | #define __VK_COLOR_PIPELINE_H__ 14 | 15 | #include "vkGraphicsPipeline.h" 16 | 17 | namespace MonkVG { 18 | struct ColorPipeline_VertUBO { 19 | glm::mat4 u_model_view; 20 | glm::mat4 u_projection; 21 | glm::vec4 u_color; 22 | }; 23 | 24 | struct ColorPipeline_FragUBO { 25 | // empty 26 | }; 27 | 28 | class ColorPipeline : public VulkanGraphicsPipeline { 29 | public: 30 | ColorPipeline(VulkanContext &context, VkPrimitiveTopology topology); 31 | ~ColorPipeline(); 32 | 33 | void setColor(const glm::vec4 &color) { _vert_ubo_data.u_color = color; } 34 | void setColor(const color_t& color) { 35 | _vert_ubo_data.u_color = glm::vec4(color[0], color[1], color[2], color[3]); 36 | } 37 | const glm::vec4 &getColor() const { return _vert_ubo_data.u_color; } 38 | }; 39 | } // namespace MonkVG 40 | #endif // __VK_COLOR_PIPELINE_H__ -------------------------------------------------------------------------------- /src/vulkan/vkFont.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micahpearlman/MonkVG/8fb5de3b4a82ae13a243aa70ca74dfabe17bb164/src/vulkan/vkFont.cpp -------------------------------------------------------------------------------- /src/vulkan/vkFont.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micahpearlman/MonkVG/8fb5de3b4a82ae13a243aa70ca74dfabe17bb164/src/vulkan/vkFont.h -------------------------------------------------------------------------------- /src/vulkan/vkImage.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file vkImage.h 3 | * @author Micah Pearlman (micahpearlman@gmail.com) 4 | * @brief OpenVG image implementation 5 | * @version 0.1 6 | * @date 2024-10-23 7 | * 8 | * @copyright Copyright (c) 2024 9 | * 10 | */ 11 | #ifndef __VKIMAGE_H__ 12 | #define __VKIMAGE_H__ 13 | #include "mkImage.h" 14 | #include "vkPlatform.h" 15 | #include 16 | namespace MonkVG { 17 | class VulkanContext; 18 | class VulkanImage : public IImage { 19 | public: 20 | VulkanImage(VGImageFormat format, VGint width, VGint height, 21 | VGbitfield allowedQuality, IContext &context); 22 | VulkanImage(VulkanImage &other); 23 | virtual ~VulkanImage(); 24 | 25 | virtual IImage *createChild(VGint x, VGint y, VGint w, VGint h); 26 | 27 | // drawing 28 | virtual void draw(); 29 | virtual void drawSubRect(VGint ox, VGint oy, VGint w, VGint h, 30 | VGbitfield paintModes); 31 | virtual void drawToRect(VGint x, VGint y, VGint w, VGint h, 32 | VGbitfield paintModes); 33 | virtual void drawAtPoint(VGint x, VGint y, VGbitfield paintModes); 34 | 35 | virtual void setSubData(const void *data, VGint dataStride, 36 | VGImageFormat dataFormat, VGint x, VGint y, 37 | VGint width, VGint height); 38 | 39 | void bind(); 40 | void unbind(); 41 | 42 | VulkanContext &getVulkanContext() { return (VulkanContext &)getContext(); } 43 | 44 | const uint32_t getPixelSizeBytes() const { return _pixel_size_bytes; } 45 | 46 | protected: 47 | VkImage _image = VK_NULL_HANDLE; 48 | VkImageView _image_view = VK_NULL_HANDLE; 49 | VmaAllocation _image_allocation = VK_NULL_HANDLE; 50 | uint32_t _pixel_size_bytes = 0; 51 | 52 | // vertex buffer 53 | VkBuffer _vertex_buffer = VK_NULL_HANDLE; 54 | VmaAllocation _vertex_buffer_allocation = VK_NULL_HANDLE; 55 | }; 56 | } // namespace MonkVG 57 | #endif // __VKIMAGE_H__ 58 | -------------------------------------------------------------------------------- /src/vulkan/vkPaint.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file vkPaint.cpp 3 | * @author Micah Pearlman (micahpearlman@gmail.com) 4 | * @brief Vulkan VG Paint implementation 5 | * @version 0.1 6 | * @date 2024-10-16 7 | * 8 | * @copyright Copyright (c) 2024 9 | * 10 | */ 11 | #include "vkPaint.h" 12 | 13 | namespace MonkVG { 14 | VulkanPaint::VulkanPaint(IContext &context) : IPaint(context) {} 15 | 16 | VulkanPaint::~VulkanPaint() {} 17 | } // namespace MonkVG 18 | -------------------------------------------------------------------------------- /src/vulkan/vkPaint.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file vkPaint.h 3 | * @author Micah Pearlman (micahpearlman@gmail.com) 4 | * @brief Vulkan VG Paint implementation 5 | * @version 0.1 6 | * @date 2024-10-16 7 | * 8 | * @copyright Copyright (c) 2024 9 | * 10 | */ 11 | #ifndef __VK_PAINT_H__ 12 | #define __VK_PAINT_H__ 13 | #include "mkPaint.h" 14 | namespace MonkVG { 15 | class VulkanPaint : public IPaint { 16 | public: 17 | VulkanPaint(IContext &context); 18 | virtual ~VulkanPaint(); 19 | }; // VulkanPaint 20 | } // namespace MonkVG 21 | #endif // __VK_PAINT_H__ 22 | -------------------------------------------------------------------------------- /src/vulkan/vkPath.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file vkPath.h 3 | * @author Micah Pearlman (micahpearlman@gmail.com) 4 | * @brief Vulkan VG Path implementation 5 | * @version 0.1 6 | * @date 2024-10-14 7 | * 8 | * @copyright Copyright (c) 2024 9 | * 10 | */ 11 | #ifndef __VK_PATH_H__ 12 | #define __VK_PATH_H__ 13 | #include "mkPath.h" 14 | #include "vkPaint.h" 15 | #include 16 | 17 | namespace MonkVG { 18 | class VulkanContext; 19 | class VulkanPath : public IPath { 20 | public: 21 | VulkanPath(VGint pathFormat, VGPathDatatype datatype, VGfloat scale, 22 | VGfloat bias, VGint segmentCapacityHint, VGint coordCapacityHint, 23 | VGbitfield capabilities, IContext &context); 24 | virtual ~VulkanPath(); 25 | 26 | bool draw(VGbitfield paintModes) override; 27 | void clear(VGbitfield caps) override; 28 | void buildFillIfDirty() override; 29 | void buildStrokeIfDirty() override; 30 | 31 | private: 32 | VulkanContext &getVulkanContext(); 33 | 34 | private: 35 | std::vector _fill_vertices = {}; 36 | std::vector _stroke_vertices = {}; 37 | 38 | VulkanPaint *_fill_paint = nullptr; 39 | VulkanPaint *_stroke_paint = nullptr; 40 | 41 | private: 42 | VkBuffer _fill_vertex_buffer = VK_NULL_HANDLE; 43 | VkBuffer _stroke_vertex_buffer = VK_NULL_HANDLE; 44 | VmaAllocation _fill_vertex_buffer_allocation = VK_NULL_HANDLE; 45 | VmaAllocation _stroke_vertex_buffer_allocation = VK_NULL_HANDLE; 46 | 47 | }; // VulkanPath 48 | 49 | } // namespace MonkVG 50 | #endif // __VK_PATH_H__ 51 | -------------------------------------------------------------------------------- /src/vulkan/vkPlatform.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file vkPlatform.h 3 | * @author Micah Pearlman (micahpearlman@gmail.com) 4 | * @brief Vulkan specific platform header and definitions 5 | * @version 0.1 6 | * @date 2024-10-14 7 | * 8 | * @copyright Copyright (c) 2024 9 | * 10 | */ 11 | #ifndef __VKPLATFORM_H__ 12 | #define __VKPLATFORM_H__ 13 | 14 | #include 15 | 16 | #endif // __VKPLATFORM_H__ -------------------------------------------------------------------------------- /src/vulkan/vkTexturePipeline.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file vkTexturePipeline.h 3 | * @author Micah Pearlman (micahpearlman@gmail.com) 4 | * @brief 5 | * @version 0.1 6 | * @date 2024-10-18 7 | * 8 | * @copyright Copyright (c) 2024 9 | * 10 | */ 11 | #ifndef __VK_TEXTURE_PIPELINE_H__ 12 | #define __VK_TEXTURE_PIPELINE_H__ 13 | 14 | #include "vkGraphicsPipeline.h" 15 | 16 | namespace MonkVG { 17 | 18 | struct TexturePipeline_VertUBO { 19 | glm::mat4 u_model_view; 20 | glm::mat4 u_projection; 21 | }; 22 | 23 | struct TexturePipeline_FragUBO { 24 | glm::vec4 u_color; 25 | }; 26 | 27 | class TexturePipeline : public VulkanGraphicsPipeline { 29 | public: 30 | TexturePipeline(VulkanContext &context, VkPrimitiveTopology topology); 31 | ~TexturePipeline(); 32 | 33 | void bind() override; 34 | 35 | // this pipeline uses a texture so we need to pass in the image info 36 | // VkDescriptorImageInfo *getDescriptorImageInfo() override { 37 | // return &_descriptor_image_info; 38 | // } 39 | 40 | /** 41 | * @brief Set the Texture object. Will update the descriptor set 42 | * with the new texture. 43 | * 44 | * @param texture 45 | */ 46 | void setTexture(VkImageView texture); 47 | 48 | /** 49 | * @brief Get the Texture object 50 | * 51 | * @return VkImageView 52 | */ 53 | VkImageView getTexture() const { return _texture; } 54 | 55 | protected: 56 | VkImageView _texture = VK_NULL_HANDLE; 57 | VkSampler _sampler = VK_NULL_HANDLE; 58 | }; 59 | 60 | } // namespace MonkVG 61 | 62 | #endif // __VK_TEXTURE_PIPELINE_H__ 63 | -------------------------------------------------------------------------------- /src/vulkan/vkVmaUsage.cpp: -------------------------------------------------------------------------------- 1 | #define VMA_IMPLEMENTATION 2 | #include 3 | 4 | // For why this is here, see: 5 | // See: "Project Setup" in https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/quick_start.html -------------------------------------------------------------------------------- /thirdparty/gles2-bc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0.0) 2 | project(gles2-bc VERSION 0.1.0) 3 | 4 | add_library(gles2-bc 5 | ./Sources/OpenGLES/OpenGLESConfig.cpp 6 | ./Sources/OpenGLES/OpenGLESContext.cpp 7 | ./Sources/OpenGLES/OpenGLESFile.cpp 8 | ./Sources/OpenGLES/OpenGLESImplementation.cpp 9 | ./Sources/OpenGLES/OpenGLESString.cpp 10 | ./Sources/OpenGLES/OpenGLESUtil.cpp 11 | ./Sources/OpenGLES/OpenGLES11/OpenGLES11Context.cpp 12 | ./Sources/OpenGLES/OpenGLES11/OpenGLES11Implementation.cpp 13 | ./Sources/OpenGLES/OpenGLES20/Attribute.cpp 14 | ./Sources/OpenGLES/OpenGLES20/MatrixStack.cpp 15 | ./Sources/OpenGLES/OpenGLES20/OpenGLES20Context.cpp 16 | ./Sources/OpenGLES/OpenGLES20/OpenGLES20Implementation.cpp 17 | ./Sources/OpenGLES/OpenGLES20/OpenGLESState.cpp 18 | ./Sources/OpenGLES/OpenGLES20/Shader.cpp 19 | ./Sources/OpenGLES/OpenGLES20/ShaderFile.cpp 20 | ./Sources/OpenGLES/OpenGLES20/ShaderProgram.cpp 21 | ./Sources/OpenGLES/OpenGLES20/ShaderSource.cpp 22 | ./Sources/OpenGLES/OpenGLES20/Uniform.cpp 23 | ) 24 | 25 | target_include_directories(gles2-bc PUBLIC ./Sources/OpenGLES ./Sources/OpenGLES/OpenGLES20 OpenGLES11) -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Samples/iPhone/SampleProject/Classes/EAGLView.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #import 18 | #import 19 | #import 20 | #import 21 | #include "OpenGLES11Context.h" 22 | #include "OpenGLES20Context.h" 23 | 24 | /* 25 | This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. 26 | The view content is basically an EAGL surface you render your OpenGL scene into. 27 | Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. 28 | */ 29 | @interface EAGLView : UIView { 30 | 31 | @private 32 | /* The pixel dimensions of the backbuffer */ 33 | GLint backingWidth; 34 | GLint backingHeight; 35 | 36 | EAGLContext *context; 37 | OpenGLES::OpenGLESContext *gl; 38 | 39 | /* OpenGL names for the renderbuffer and framebuffers used to render to this view */ 40 | GLuint viewRenderbuffer, viewFramebuffer; 41 | 42 | /* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */ 43 | GLuint depthRenderbuffer; 44 | 45 | NSTimer *animationTimer; 46 | NSTimeInterval animationInterval; 47 | } 48 | 49 | @property NSTimeInterval animationInterval; 50 | 51 | - (void)startAnimation; 52 | - (void)stopAnimation; 53 | - (void)drawView; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Samples/iPhone/SampleProject/Classes/SampleProjectAppDelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #import 18 | 19 | @class EAGLView; 20 | 21 | @interface SampleProjectAppDelegate : NSObject { 22 | UIWindow *window; 23 | EAGLView *glView; 24 | } 25 | 26 | @property (nonatomic, retain) IBOutlet UIWindow *window; 27 | @property (nonatomic, retain) IBOutlet EAGLView *glView; 28 | 29 | @end 30 | 31 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Samples/iPhone/SampleProject/Classes/SampleProjectAppDelegate.mm: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #import "SampleProjectAppDelegate.h" 18 | #import "EAGLView.h" 19 | 20 | @implementation SampleProjectAppDelegate 21 | 22 | @synthesize window; 23 | @synthesize glView; 24 | 25 | - (void)applicationDidFinishLaunching:(UIApplication *)application { 26 | 27 | glView.animationInterval = 1.0 / 60.0; 28 | [glView startAnimation]; 29 | } 30 | 31 | 32 | - (void)applicationWillResignActive:(UIApplication *)application { 33 | glView.animationInterval = 1.0 / 5.0; 34 | } 35 | 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | glView.animationInterval = 1.0 / 60.0; 39 | } 40 | 41 | 42 | - (void)dealloc { 43 | [window release]; 44 | [glView release]; 45 | [super dealloc]; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Samples/iPhone/SampleProject/main.m: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #import 18 | 19 | int main(int argc, char *argv[]) { 20 | 21 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 22 | int retVal = UIApplicationMain(argc, argv, nil, nil); 23 | [pool release]; 24 | return retVal; 25 | } 26 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Samples/iPhone/SampleProject/readme.txt: -------------------------------------------------------------------------------- 1 | Using the sample application 2 | ---------------------------- 3 | 1. Create a new OpenGL ES Xcode application called SampleProject. 4 | 2. Overwrite the sources from the newly created project directory with the sources from this directory 5 | 3. Delete the EAGLView.m and SampleProjectAppDelegate.m files from the Classes directory 6 | 4. In Xcode, Add the EAGLView.mm and SampleProjectAppDelegate.mm files to the project 7 | 5. In Xcode, Add the Sources/OpenGLES directory from the repository the the project 8 | 6. In Xcode, add all the shader files from OpenGLES/OpenGLES20/shaders to the build resources 9 | 7. Build and go 10 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES11/OpenGLES11Implementation.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "OpenGLES11Implementation.h" 18 | 19 | using namespace OpenGLES::OpenGLES1; 20 | 21 | OpenGLES11Implementation::OpenGLES11Implementation() : OpenGLESImplementation() { 22 | 23 | } 24 | 25 | OpenGLES11Implementation::~OpenGLES11Implementation() 26 | { 27 | 28 | } 29 | 30 | void OpenGLES11Implementation::init() { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES11/OpenGLES11Implementation.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef OpenGLES11Implementation_H_ 18 | #define OpenGLES11Implementation_H_ 19 | 20 | #include "OpenGLESImplementation.h" 21 | 22 | namespace OpenGLES { 23 | namespace OpenGLES1 { 24 | 25 | class OpenGLES11Implementation : public OpenGLESImplementation { 26 | public: 27 | OpenGLES11Implementation(); 28 | ~OpenGLES11Implementation(); 29 | 30 | void init(); 31 | private: 32 | }; 33 | 34 | } 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES20/Attribute.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef Attribute_H_ 18 | #define Attribute_H_ 19 | 20 | #include "OpenGLESPlatform.h" 21 | #include 22 | 23 | namespace OpenGLES { 24 | namespace OpenGLES2 { 25 | 26 | class ShaderProgram; 27 | 28 | class AttributeSimple { 29 | public: 30 | AttributeSimple(int id, GLint location); 31 | const int getId(); 32 | const GLint getLocation(); 33 | 34 | private: 35 | int id; 36 | GLint location; 37 | }; 38 | 39 | class Attribute { 40 | public: 41 | Attribute(); 42 | ~Attribute(); 43 | 44 | const GLint getLocation(); 45 | void setEnabled(bool enabled); 46 | void setLocation(GLint loc); 47 | void upload(ShaderProgram *program); 48 | void setValues(GLint size, GLenum type, GLsizei stride, const void *pointer); 49 | void setSize(GLint size); 50 | void setType(GLenum type); 51 | void setNormalized(GLboolean normalized); 52 | void setStride(GLsizei stride); 53 | void setPointer(const void *pointer); 54 | 55 | private: 56 | GLint location; 57 | bool enabled; 58 | bool uploaded; 59 | 60 | GLint size; 61 | GLenum type; 62 | GLboolean normalized; 63 | GLsizei stride; 64 | const void *pointer; 65 | }; 66 | 67 | } 68 | } 69 | 70 | #endif -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES20/MatrixStack.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef MatrixStack_H_ 18 | #define MatrixStack_H_ 19 | 20 | #include "OpenGLESMath.h" 21 | #include 22 | 23 | namespace OpenGLES { 24 | 25 | class OpenGLESImplementation; 26 | 27 | namespace OpenGLES2 { 28 | 29 | class OpenGLESState; 30 | 31 | class MatrixStack { 32 | public: 33 | MatrixStack(OpenGLESState *openGLESState, OpenGLESImplementation *impl); 34 | ~MatrixStack(); 35 | 36 | void init(); 37 | void setMatrixMode(GLenum mode); 38 | void pushMatrix(); 39 | void popMatrix(); 40 | 41 | void loadIdentity(); 42 | void loadMatrix(const GLfloat *newMat); 43 | void translate(GLfloat x, GLfloat y, GLfloat z); 44 | void rotate(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); 45 | void scale(GLfloat x, GLfloat y, GLfloat z); 46 | void frustum(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); 47 | void ortho( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ); 48 | void multiply(const GLfloat *m); 49 | 50 | Matrix4x4* getModelViewMatrix(); 51 | Matrix4x4* getProjectionMatrix(); 52 | Matrix4x4* getTextureMatrix(int index); 53 | 54 | private: 55 | OpenGLESState *openGLESState; 56 | OpenGLESImplementation * implementation; 57 | GLenum mode; 58 | std::vector *> modelViewStack; 59 | std::vector *> projectionStack; 60 | std::vector *> *textureStacks; 61 | std::vector *> *currentStack; 62 | }; 63 | } 64 | } 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES20/OpenGLES20Implementation.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef OpenGLES20Implementation_H_ 18 | #define OpenGLES20Implementation_H_ 19 | 20 | #include "OpenGLESImplementation.h" 21 | 22 | namespace OpenGLES { 23 | namespace OpenGLES2 { 24 | 25 | class OpenGLES20Implementation : public OpenGLES::OpenGLESImplementation { 26 | public: 27 | OpenGLES20Implementation(); 28 | ~OpenGLES20Implementation(); 29 | 30 | void init(); 31 | private: 32 | }; 33 | 34 | } 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES20/Shader.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef Shader_H_ 18 | #define Shader_H_ 19 | 20 | //#include 21 | #define INCLUDE_ES1_HEADERS 0 22 | #include "OpenGLESPlatform.h" 23 | #include 24 | 25 | namespace OpenGLES { 26 | namespace OpenGLES2 { 27 | 28 | class ShaderSource; 29 | 30 | class Shader { 31 | public: 32 | Shader(GLenum type, std::vector &sources); 33 | ~Shader(); 34 | 35 | GLuint compile(); 36 | private: 37 | bool readShaderSource(); 38 | 39 | GLenum type; 40 | std::vector &sources; 41 | GLuint id; 42 | }; 43 | } 44 | } 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES20/ShaderFile.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "ShaderFile.h" 18 | #include "OpenGLESUtil.h" 19 | 20 | using namespace OpenGLES::OpenGLES2; 21 | 22 | ShaderFile::ShaderFile( GLenum type, std::string name ) : OpenGLESFile(name), type(type) 23 | { 24 | 25 | } 26 | 27 | GLenum ShaderFile::getType() 28 | { 29 | return type; 30 | } 31 | 32 | void ShaderFile::setType(GLenum t) 33 | { 34 | type = t; 35 | } 36 | 37 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES20/ShaderFile.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef ShaderFile_H_ 18 | #define ShaderFile_H_ 19 | 20 | //#include 21 | #define INCLUDE_ES1_HEADERS 0 22 | #include "OpenGLESPlatform.h" 23 | #include 24 | #include "OpenGLESFile.h" 25 | 26 | namespace OpenGLES { 27 | namespace OpenGLES2 { 28 | 29 | class ShaderFile : public OpenGLESFile { 30 | public: 31 | ShaderFile(GLenum type, std::string name); 32 | GLenum getType(); 33 | void setType(GLenum type); 34 | private: 35 | GLenum type; 36 | }; 37 | } 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES20/ShaderSource.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef ShaderSource_H_ 18 | #define ShaderSource_H_ 19 | 20 | //#include 21 | #define INCLUDE_ES1_HEADERS 0 22 | #include "OpenGLESPlatform.h" 23 | #include 24 | 25 | namespace OpenGLES { 26 | namespace OpenGLES2 { 27 | 28 | class ShaderFile; 29 | 30 | class ShaderSource { 31 | public: 32 | ShaderSource(ShaderFile *file); 33 | ShaderSource(ShaderFile *file, std::string additionalSource); 34 | 35 | void appendAdditionalSource(std::string additionalSource); 36 | ShaderFile *getFile(); 37 | std::string getSource(); 38 | 39 | private: 40 | bool expandSource(); 41 | 42 | ShaderFile *file; 43 | std::string additionalSource; 44 | std::string source; 45 | bool sourceExpanded; 46 | }; 47 | } 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES20/shaders/alphaTest.frag: -------------------------------------------------------------------------------- 1 | 2 | #define EPSILON 0.0000001 // TODO: depends on precision 3 | 4 | #define GL_NEVER 0x0200 5 | #define GL_LESS 0x0201 6 | #define GL_EQUAL 0x0202 7 | #define GL_LEQUAL 0x0203 8 | #define GL_GREATER 0x0204 9 | #define GL_NOTEQUAL 0x0205 10 | #define GL_GEQUAL 0x0206 11 | #define GL_ALWAYS 0x0207 12 | 13 | #if !defined(ALPHA_FUNC) 14 | #define ALPHA_FUNC -1 15 | #endif 16 | 17 | // Uniforms 18 | uniform int u_alphaFunc; 19 | uniform float u_alphaFuncValue; 20 | 21 | void alphaTest(float alpha) 22 | { 23 | #if ALPHA_FUNC == GL_ALWAYS 24 | return; 25 | #elif ALPHA_FUNC == GL_LESS 26 | if (alpha >= u_alphaFuncValue) { 27 | discard; 28 | } 29 | #elif ALPHA_FUNC == GL_EQUAL 30 | if (u_alphaFuncValue - EPSILON > alpha || alpha > u_alphaFuncValue + EPSILON) { 31 | discard; 32 | } 33 | #elif ALPHA_FUNC == GL_LEQUAL 34 | if (alpha > u_alphaFuncValue) { 35 | discard; 36 | } 37 | #elif ALPHA_FUNC == GL_GREATER 38 | if (alpha <= u_alphaFuncValue) { 39 | discard; 40 | } 41 | #elif ALPHA_FUNC == GL_NOTEQUAL 42 | if (u_alphaFuncValue - EPSILON <= alpha && alpha <= u_alphaFuncValue + EPSILON) { 43 | discard; 44 | } 45 | #elif ALPHA_FUNC == GL_GEQUAL 46 | if (alpha < u_alphaFuncValue) { 47 | discard; 48 | } 49 | #elif ALPHA_FUNC == GL_NEVER 50 | discard; 51 | #elif ALPHA_FUNC == -1 52 | if (u_alphaFunc == GL_ALWAYS) { 53 | return; 54 | } else if (u_alphaFunc == GL_LESS) { 55 | if (alpha >= u_alphaFuncValue) { 56 | discard; 57 | } 58 | } else if (u_alphaFunc == GL_EQUAL) { 59 | if (u_alphaFuncValue - EPSILON > alpha || alpha > u_alphaFuncValue + EPSILON) { 60 | discard; 61 | } 62 | } else if (u_alphaFunc == GL_LEQUAL) { 63 | if (alpha > u_alphaFuncValue) { 64 | discard; 65 | } 66 | } else if (u_alphaFunc == GL_GREATER) { 67 | if (alpha <= u_alphaFuncValue) { 68 | discard; 69 | } 70 | } else if (u_alphaFunc == GL_NOTEQUAL) { 71 | if (u_alphaFuncValue - EPSILON <= alpha && alpha <= u_alphaFuncValue + EPSILON) { 72 | discard; 73 | } 74 | } else if (u_alphaFunc == GL_GEQUAL) { 75 | if (alpha < u_alphaFuncValue) { 76 | discard; 77 | } 78 | } else if (u_alphaFunc == GL_NEVER) { 79 | discard; 80 | } 81 | #endif 82 | } 83 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES20/shaders/clipPlane.frag: -------------------------------------------------------------------------------- 1 | 2 | // Uniforms 3 | uniform bool u_clipPlane0Enabled; 4 | uniform bool u_clipPlane1Enabled; 5 | uniform bool u_clipPlane2Enabled; 6 | uniform bool u_clipPlane3Enabled; 7 | uniform bool u_clipPlane4Enabled; 8 | uniform bool u_clipPlane5Enabled; 9 | 10 | // Varyings 11 | varying float v_clipPlane0Distance; 12 | varying float v_clipPlane1Distance; 13 | varying float v_clipPlane2Distance; 14 | varying float v_clipPlane3Distance; 15 | varying float v_clipPlane4Distance; 16 | varying float v_clipPlane5Distance; 17 | 18 | void clipPlanesTest() 19 | { 20 | #if CLIP_PLANE0_ENABLED == 1 || CLIP_PLANE0_ENABLED == -1 21 | #if CLIP_PLANE0_ENABLED == -1 22 | if (u_clipPlane0Enabled) { 23 | #endif 24 | if (v_clipPlane0Distance < 0.0) { 25 | discard; 26 | } 27 | #if CLIP_PLANE0_ENABLED == -1 28 | } 29 | #endif 30 | #endif 31 | 32 | #if CLIP_PLANE1_ENABLED == 1 || CLIP_PLANE1_ENABLED == -1 33 | #if CLIP_PLANE1_ENABLED == -1 34 | if (u_clipPlane1Enabled) { 35 | #endif 36 | if (v_clipPlane1Distance < 0.0) { 37 | discard; 38 | } 39 | #if CLIP_PLANE1_ENABLED == -1 40 | } 41 | #endif 42 | #endif 43 | 44 | #if CLIP_PLANE2_ENABLED == 1 || CLIP_PLANE2_ENABLED == -1 45 | #if CLIP_PLANE2_ENABLED == -1 46 | if (u_clipPlane2Enabled) { 47 | #endif 48 | if (v_clipPlane2Distance < 0.0) { 49 | discard; 50 | } 51 | #if CLIP_PLANE2_ENABLED == -1 52 | } 53 | #endif 54 | #endif 55 | 56 | #if CLIP_PLANE3_ENABLED == 1 || CLIP_PLANE3_ENABLED == -1 57 | #if CLIP_PLANE3_ENABLED == -1 58 | if (u_clipPlane3Enabled) { 59 | #endif 60 | if (v_clipPlane3Distance < 0.0) { 61 | discard; 62 | } 63 | #if CLIP_PLANE3_ENABLED == -1 64 | } 65 | #endif 66 | #endif 67 | 68 | #if CLIP_PLANE4_ENABLED == 1 || CLIP_PLANE4_ENABLED == -1 69 | #if CLIP_PLANE4_ENABLED == -1 70 | if (u_clipPlane4Enabled) { 71 | #endif 72 | if (v_clipPlane4Distance < 0.0) { 73 | discard; 74 | } 75 | #if CLIP_PLANE4_ENABLED == -1 76 | } 77 | #endif 78 | #endif 79 | 80 | #if CLIP_PLANE5_ENABLED == 1 || CLIP_PLANE5_ENABLED == -1 81 | #if CLIP_PLANE5_ENABLED == -1 82 | if (u_clipPlane5Enabled) { 83 | #endif 84 | if (v_clipPlane5Distance < 0.0) { 85 | discard; 86 | } 87 | #if CLIP_PLANE5_ENABLED == -1 88 | } 89 | #endif 90 | #endif 91 | } 92 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES20/shaders/fog.glsl: -------------------------------------------------------------------------------- 1 | 2 | #define _GL_LINEAR 0x2601 3 | #define _GL_EXP 0x0800 4 | #define _GL_EXP2 0x0801 5 | 6 | #if !defined(FOG_MODE) 7 | #define FOG_MODE -1 8 | #endif 9 | 10 | // Uniforms 11 | uniform int u_fogMode; 12 | uniform float u_fogDensity; 13 | uniform float u_fogStart; 14 | uniform float u_fogEnd; 15 | 16 | // Functions 17 | float calcFogLinear(float distanceToEye); 18 | float calcFogExp(float distanceToEye); 19 | float calcFogExp2(float distanceToEye); 20 | 21 | 22 | float calcFogFactor(float distanceToEye) 23 | { 24 | float fogFactor; 25 | #if FOG_MODE == _GL_LINEAR 26 | fogFactor = calcFogLinear(distanceToEye); 27 | #elif FOG_MODE == _GL_EXP 28 | fogFactor = calcFogExp(distanceToEye); 29 | #elif FOG_MODE == _GL_EXP2 30 | fogFactor = calcFogExp2(distanceToEye); 31 | #elif FOG_MODE == -1 32 | if (u_fogMode == _GL_LINEAR) { 33 | fogFactor = calcFogLinear(distanceToEye); 34 | } else if (u_fogMode == _GL_EXP) { 35 | fogFactor = calcFogExp(distanceToEye); 36 | } else { 37 | fogFactor = calcFogExp2(distanceToEye); 38 | } 39 | #endif 40 | 41 | return fogFactor; 42 | } 43 | 44 | float calcFogLinear(float distanceToEye) 45 | { 46 | float f = (u_fogEnd - distanceToEye) / (u_fogEnd - u_fogStart); 47 | return clamp(f, c_zerof, c_onef); 48 | } 49 | 50 | float calcFogExp(float distanceToEye) 51 | { 52 | float f = exp(-(distanceToEye * u_fogDensity)); 53 | return clamp(f, c_zerof, c_onef); 54 | } 55 | 56 | float calcFogExp2(float distanceToEye) 57 | { 58 | float f = distanceToEye * u_fogDensity; 59 | f = exp(-(f*f)); 60 | return clamp(f, c_zerof, c_onef); 61 | } 62 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES20/shaders/lighting.frag: -------------------------------------------------------------------------------- 1 | 2 | #if !defined(LIGHTING_HINT) 3 | #define LIGHTING_HINT -1 4 | #endif 5 | 6 | #if !defined(LIGHT_MODEL_TWO_SIDE_ENABLED) 7 | #define LIGHT_MODEL_TWO_SIDE_ENABLED -1 8 | #endif 9 | 10 | // Uniforms 11 | uniform int u_lightingHint; 12 | uniform bool u_lightModelTwoSideEnabled; 13 | uniform int u_lightingAccuracy; 14 | 15 | // Varyings 16 | varying vec4 v_backColor; 17 | 18 | // Functions 19 | vec4 calcPerFragmentLighting(); 20 | 21 | 22 | void calcLighting(out vec4 color) 23 | { 24 | #if LIGHT_MODEL_TWO_SIDE_ENABLED == 1 || LIGHT_MODEL_TWO_SIDE_ENABLED == -1 25 | #if LIGHT_MODEL_TWO_SIDE_ENABLED == -1 26 | if (u_lightModelTwoSideEnabled) { 27 | #endif 28 | if (gl_FrontFacing) { 29 | #if LIGHTING_HINT == _GL_FASTEST 30 | color = v_frontColor; 31 | #elif LIGHTING_HINT == _GL_NICEST 32 | color = calcPerFragmentLighting(); 33 | #elif LIGHTING_HINT == -1 34 | if (u_lightingAccuracy == _GL_FASTEST) { 35 | color = v_frontColor; 36 | } else if (u_lightingAccuracy == _GL_NICEST) { 37 | color = calcPerFragmentLighting(); 38 | } 39 | #endif 40 | } else { 41 | #if LIGHTING_HINT == _GL_FASTEST 42 | color = v_backColor; 43 | #elif LIGHTING_HINT == _GL_NICEST 44 | color = calcPerFragmentLighting(); 45 | #elif LIGHTING_HINT == -1 46 | if (u_lightingAccuracy == _GL_FASTEST) { 47 | color = v_backColor; 48 | } else if (u_lightingAccuracy == _GL_NICEST) { 49 | color = calcPerFragmentLighting(); 50 | } 51 | #endif 52 | } 53 | #if LIGHT_MODEL_TWO_SIDE_ENABLED == -1 54 | } else { 55 | #if LIGHTING_HINT == _GL_FASTEST 56 | color = v_frontColor; 57 | #elif LIGHTING_HINT == _GL_NICEST 58 | color = calcPerFragmentLighting(); 59 | #elif LIGHTING_HINT == -1 60 | if (u_lightingAccuracy == _GL_FASTEST) { 61 | color = v_frontColor; 62 | } else if (u_lightingAccuracy == _GL_NICEST) { 63 | color = calcPerFragmentLighting(); 64 | } 65 | #endif 66 | } 67 | #endif 68 | #elif LIGHT_MODEL_TWO_SIDE_ENABLED == 0 69 | #if LIGHTING_HINT == _GL_FASTEST 70 | color = v_frontColor; 71 | #elif LIGHTING_HINT == _GL_NICEST 72 | color = calcPerFragmentLighting(); 73 | #elif LIGHTING_HINT == -1 74 | if (u_lightingAccuracy == _GL_FASTEST) { 75 | color = v_frontColor; 76 | } else if (u_lightingAccuracy == _GL_NICEST) { 77 | color = calcPerFragmentLighting(); 78 | } 79 | #endif 80 | #endif 81 | } 82 | 83 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES20/shaders/lightingPerFragment.vert: -------------------------------------------------------------------------------- 1 | 2 | // Varyings 3 | varying vec4 v_ambientAndEmission; 4 | varying vec3 v_normal; 5 | varying vec3 v_light0Vector; 6 | varying vec3 v_light0HalfVector; 7 | varying vec3 v_light1Vector; 8 | varying vec3 v_light1HalfVector; 9 | varying vec3 v_light2Vector; 10 | varying vec3 v_light2HalfVector; 11 | 12 | // Functions 13 | void calcLightVaryingsForFragmentShader(Light light, vec3 eyeVector, out vec3 lightVector, out vec3 halfVector); 14 | 15 | 16 | void calcLightingVaryingsForFragmentShader() 17 | { 18 | v_normal = normal; 19 | 20 | vec3 eyeVector; 21 | #if LIGHT_MODEL_LOCAL_VIEWER_ENABLED == 1 22 | eyeVector = normalize(-vertexPositionInEye.xyz); 23 | #elif LIGHT_MODEL_LOCAL_VIEWER_ENABLED == 0 24 | eyeVector = vec3(c_zerof, c_zerof, c_onef); 25 | #else 26 | if (u_lightModelLocalViewerEnabled) { 27 | eyeVector = normalize(-vertexPositionInEye.xyz); 28 | } else { 29 | eyeVector = vec3(c_zerof, c_zerof, c_onef); 30 | } 31 | #endif 32 | 33 | v_ambientAndEmission = u_material.ambient * u_globalAmbientColor; 34 | v_ambientAndEmission += u_material.emission; 35 | 36 | #if LIGHT0_ENABLED == 1 37 | calcLightVaryingsForFragmentShader(u_light0, eyeVector, v_light0Vector, v_light0HalfVector); 38 | #elif LIGHT0_ENABLED == -1 39 | if (u_light0Enabled) { 40 | calcLightVaryingsForFragmentShader(u_light0, eyeVector, v_light0Vector, v_light0HalfVector); 41 | } 42 | #endif 43 | 44 | #if LIGHT1_ENABLED == 1 45 | calcLightVaryingsForFragmentShader(u_light1, eyeVector, v_light1Vector, v_light1HalfVector); 46 | #elif LIGHT1_ENABLED == -1 47 | if (u_light1Enabled) { 48 | calcLightVaryingsForFragmentShader(u_light1, eyeVector, v_light1Vector, v_light1HalfVector); 49 | } 50 | #endif 51 | 52 | #if LIGHT2_ENABLED == 1 53 | calcLightVaryingsForFragmentShader(u_light2, eyeVector, v_light2Vector, v_light2HalfVector); 54 | #elif LIGHT2_ENABLED == -1 55 | if (u_light2Enabled) { 56 | calcLightVaryingsForFragmentShader(u_light2, eyeVector, v_light2Vector, v_light2HalfVector); 57 | } 58 | #endif 59 | 60 | } 61 | 62 | void calcLightVaryingsForFragmentShader(Light light, vec3 eyeVector, out vec3 lightVector, out vec3 halfVector) 63 | { 64 | v_ambientAndEmission += light.ambient * u_material.ambient; 65 | if (light.position.w != c_zerof) { 66 | lightVector = light.position.xyz - vertexPositionInEye.xyz; 67 | } else { 68 | lightVector = light.position.xyz; 69 | } 70 | halfVector = normalize(eyeVector + lightVector); 71 | } 72 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES20/shaders/postprocess.frag: -------------------------------------------------------------------------------- 1 | #ifdef GL_FRAGMENT_PRECISION_HIGH 2 | precision highp float; 3 | #else 4 | precision mediump float; 5 | #endif 6 | 7 | 8 | // Uniforms 9 | uniform sampler2D u_texture; 10 | 11 | // Varyings 12 | varying vec2 v_texCoord; 13 | 14 | void main() 15 | { 16 | gl_FragColor = texture2D(u_texture, v_texCoord); 17 | } 18 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES20/shaders/postprocess.frag.h: -------------------------------------------------------------------------------- 1 | unsigned char postprocess_frag[] = { 2 | 0x23, 0x69, 0x66, 0x64, 0x65, 0x66, 0x20, 0x47, 0x4c, 0x5f, 0x46, 0x52, 3 | 0x41, 0x47, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x50, 0x52, 0x45, 0x43, 0x49, 4 | 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x48, 0x49, 0x47, 0x48, 0x0a, 0x09, 0x70, 5 | 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x69, 0x67, 6 | 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x23, 0x65, 7 | 0x6c, 0x73, 0x65, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 8 | 0x6f, 0x6e, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x66, 9 | 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, 0x69, 0x66, 10 | 0x0a, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 11 | 0x6d, 0x73, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 12 | 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, 0x75, 0x5f, 0x74, 13 | 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 14 | 0x56, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x73, 0x0a, 0x76, 0x61, 0x72, 15 | 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 16 | 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x3b, 0x0a, 0x0a, 0x76, 17 | 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x29, 0x20, 0x0a, 18 | 0x7b, 0x0a, 0x09, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 19 | 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 20 | 0x65, 0x32, 0x44, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 21 | 0x65, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6f, 0x72, 22 | 0x64, 0x29, 0x3b, 0x0a, 0x7d, 0x0a 23 | }; 24 | unsigned int postprocess_frag_len = 246; 25 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES20/shaders/postprocess.vert: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Attributes 4 | attribute vec4 a_position; 5 | attribute vec2 a_texCoord; 6 | 7 | // Varyings 8 | varying vec2 v_texCoord; 9 | 10 | void main() 11 | { 12 | gl_Position = u_modelViewProjectionMatrix * a_position; 13 | v_texCoord = a_texCoord; 14 | } -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES20/shaders/postprocess.vert.h: -------------------------------------------------------------------------------- 1 | unsigned char postprocess_vert[] = { 2 | 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 3 | 0x74, 0x65, 0x73, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 4 | 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 5 | 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 6 | 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 7 | 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x3b, 0x0a, 0x0a, 0x2f, 8 | 0x2f, 0x20, 0x56, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x73, 0x0a, 0x76, 9 | 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 10 | 0x76, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x3b, 0x0a, 11 | 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x29, 12 | 0x20, 0x0a, 0x7b, 0x0a, 0x09, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 13 | 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 14 | 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 15 | 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x20, 0x2a, 16 | 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 17 | 0x0a, 0x09, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6f, 0x72, 0x64, 18 | 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6f, 0x72, 19 | 0x64, 0x3b, 0x09, 0x0a, 0x7d 20 | }; 21 | unsigned int postprocess_vert_len = 209; 22 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES20/shaders/texture.vert: -------------------------------------------------------------------------------- 1 | 2 | // Uniforms 3 | uniform bool u_texture0Enabled; 4 | uniform bool u_texture1Enabled; 5 | uniform bool u_texture2Enabled; 6 | uniform bool u_texCoord0Enabled; 7 | uniform bool u_texCoord1Enabled; 8 | uniform bool u_texCoord2Enabled; 9 | 10 | // Functions 11 | void calcTexture0Coordinates(); 12 | void calcTexture1Coordinates(); 13 | void calcTexture2Coordinates(); 14 | 15 | void calcTextureCoordinates() 16 | { 17 | #if TEXCOORD0_ENABLED == 1 && TEXTURE0_ENABLED == 1 18 | calcTexture0Coordinates(); 19 | #elif TEXCOORD0_ENABLED == 1 && TEXTURE0_ENABLED == -1 20 | if (u_texture0Enabled) { 21 | calcTexture0Coordinates(); 22 | } 23 | #elif TEXCOORD0_ENABLED == -1 && TEXTURE0_ENABLED == 1 24 | if (u_texCoord0Enabled) { 25 | calcTexture0Coordinates(); 26 | } 27 | #elif TEXCOORD0_ENABLED == -1 && TEXTURE0_ENABLED == -1 28 | if (u_texture0Enabled && u_texCoord0Enabled) { 29 | calcTexture0Coordinates(); 30 | } 31 | #endif 32 | 33 | #if TEXCOORD1_ENABLED == 1 && TEXTURE1_ENABLED == 1 34 | calcTexture1Coordinates(); 35 | #elif TEXCOORD1_ENABLED == 1 && TEXTURE1_ENABLED == -1 36 | if (u_texture1Enabled) { 37 | calcTexture1Coordinates(); 38 | } 39 | #elif TEXCOORD1_ENABLED == -1 && TEXTURE1_ENABLED == 1 40 | if (u_texCoord1Enabled) { 41 | calcTexture1Coordinates(); 42 | } 43 | #elif TEXCOORD1_ENABLED == -1 && TEXTURE1_ENABLED == -1 44 | if (u_texture1Enabled && u_texCoord1Enabled) { 45 | calcTexture1Coordinates(); 46 | } 47 | #endif 48 | 49 | #if TEXCOORD2_ENABLED == 1 && TEXTURE2_ENABLED == 1 50 | calcTexture2Coordinates(); 51 | #elif TEXCOORD2_ENABLED == 1 && TEXTURE2_ENABLED == -1 52 | if (u_texture2Enabled) { 53 | calcTexture2Coordinates(); 54 | } 55 | #elif TEXCOORD2_ENABLED == -1 && TEXTURE2_ENABLED == 1 56 | if (u_texCoord2Enabled) { 57 | calcTexture2Coordinates(); 58 | } 59 | #elif TEXCOORD2_ENABLED == -1 && TEXTURE2_ENABLED == -1 60 | if (u_texture2Enabled && u_texCoord2Enabled) { 61 | calcTexture2Coordinates(); 62 | } 63 | #endif 64 | } 65 | 66 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES20/shaders/texture0.vert: -------------------------------------------------------------------------------- 1 | 2 | #if TEXCOORD0_ENABLED != 0 && TEXTURE0_ENABLED != 0 3 | 4 | #if !defined(TEXTURE0_MATRIX_ENABLED) 5 | #define TEXTURE0_MATRIX_ENABLED -1 6 | #endif 7 | 8 | // Attributes 9 | attribute vec4 a_texCoord0; 10 | 11 | // Uniforms 12 | uniform bool u_texture0MatrixEnabled; 13 | uniform mat4 u_texture0Matrix; 14 | 15 | // Varyings 16 | varying vec4 v_texCoord0; 17 | 18 | void calcTexture0Coordinates() 19 | { 20 | #if TEXTURE0_MATRIX_ENABLED == 1 || TEXTURE0_MATRIX_ENABLED == -1 21 | #if TEXTURE0_MATRIX_ENABLED == -1 22 | if (u_texture0MatrixEnabled) { 23 | #endif 24 | v_texCoord0 = u_texture0Matrix * a_texCoord0; 25 | #if TEXTURE0_MATRIX_ENABLED == -1 26 | } else { 27 | v_texCoord0 = a_texCoord0; 28 | } 29 | #endif 30 | #else 31 | v_texCoord0 = a_texCoord0; 32 | #endif 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES20/shaders/texture1.vert: -------------------------------------------------------------------------------- 1 | 2 | #if TEXCOORD1_ENABLED != 0 && TEXTURE1_ENABLED != 0 3 | 4 | #if !defined(TEXTURE1_MATRIX_ENABLED) 5 | #define TEXTURE1_MATRIX_ENABLED -1 6 | #endif 7 | 8 | // Attributes 9 | attribute vec4 a_texCoord1; 10 | 11 | // Uniforms 12 | uniform bool u_texture1MatrixEnabled; 13 | uniform mat4 u_texture1Matrix; 14 | 15 | // Varyings 16 | varying vec4 v_texCoord1; 17 | 18 | void calcTexture1Coordinates() 19 | { 20 | #if TEXTURE1_MATRIX_ENABLED == 1 || TEXTURE1_MATRIX_ENABLED == -1 21 | #if TEXTURE1_MATRIX_ENABLED == -1 22 | if (u_texture1MatrixEnabled) { 23 | #endif 24 | v_texCoord1 = u_texture1Matrix * a_texCoord1; 25 | #if TEXTURE1_MATRIX_ENABLED == -1 26 | } else { 27 | v_texCoord1 = a_texCoord1; 28 | } 29 | #endif 30 | #else 31 | v_texCoord1 = a_texCoord1; 32 | #endif 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES20/shaders/texture2.vert: -------------------------------------------------------------------------------- 1 | 2 | #if TEXCOORD2_ENABLED != 0 && TEXTURE2_ENABLED != 0 3 | 4 | #if !defined(TEXTURE2_MATRIX_ENABLED) 5 | #define TEXTURE2_MATRIX_ENABLED -1 6 | #endif 7 | 8 | // Attributes 9 | attribute vec4 a_texCoord2; 10 | 11 | // Uniforms 12 | uniform bool u_texture2MatrixEnabled; 13 | uniform mat4 u_texture2Matrix; 14 | 15 | // Varyings 16 | varying vec4 v_texCoord2; 17 | 18 | void calcTexture2Coordinates() 19 | { 20 | #if TEXTURE2_MATRIX_ENABLED == 1 || TEXTURE2_MATRIX_ENABLED == -1 21 | #if TEXTURE2_MATRIX_ENABLED == -1 22 | if (u_texture2MatrixEnabled) { 23 | #endif 24 | v_texCoord2 = u_texture2Matrix * a_texCoord2; 25 | #if TEXTURE2_MATRIX_ENABLED == -1 26 | } else { 27 | v_texCoord2 = a_texCoord2; 28 | } 29 | #endif 30 | #else 31 | v_texCoord2 = a_texCoord2; 32 | #endif 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLES20/shaders/update: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | for i in *.frag *.vert *.glsl; do xxd -i $i > $i.h; done 3 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLESConfig.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "OpenGLESConfig.h" 18 | 19 | using namespace OpenGLES; 20 | 21 | const bool OpenGLESConfig::USE_ONLY_UBER_SHADER = false; 22 | #ifdef OPENGLES_DEBUG 23 | const bool OpenGLESConfig::DEBUG = true; 24 | #else 25 | const bool OpenGLESConfig::DEBUG = false; 26 | #endif 27 | 28 | // TODO: read from file 29 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLESConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef OpenGLESConfig_H__ 18 | #define OpenGLESConfig_H__ 19 | 20 | #include 21 | 22 | namespace OpenGLES { 23 | 24 | class OpenGLESConfig 25 | { 26 | public: 27 | static const bool USE_ONLY_UBER_SHADER; 28 | static const bool DEBUG; 29 | }; 30 | 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLESContext.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "OpenGLESContext.h" 18 | #include "OpenGLESImplementation.h" 19 | 20 | using namespace OpenGLES; 21 | 22 | OpenGLESContext::OpenGLESContext(int v, OpenGLESImplementation *impl) : version(v), implementation(impl) 23 | { 24 | 25 | } 26 | 27 | OpenGLESContext::~OpenGLESContext() 28 | { 29 | delete implementation; 30 | } 31 | 32 | int OpenGLESContext::getOpenGLESVersion() 33 | { 34 | return version; 35 | } 36 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLESFile.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "OpenGLESFile.h" 18 | #include 19 | 20 | using namespace OpenGLES; 21 | 22 | std::string OpenGLESFile::rootPath( "/" ); 23 | 24 | OpenGLESFile::OpenGLESFile(std::string n) : name() 25 | { 26 | name = n; 27 | } 28 | 29 | bool OpenGLESFile::open() 30 | { 31 | std::string p = getPath(); 32 | fp = fopen(p.c_str(), "r"); 33 | 34 | return fp; 35 | } 36 | 37 | char * OpenGLESFile::gets(char * buf, int size) 38 | { 39 | return fgets(buf, size, fp); 40 | } 41 | 42 | int OpenGLESFile::seek(long int offset, int origin) 43 | { 44 | return fseek(fp, offset, origin); 45 | } 46 | 47 | long int OpenGLESFile::tell() 48 | { 49 | return ftell(fp); 50 | } 51 | 52 | size_t OpenGLESFile::read(void *ptr, size_t size, size_t count) 53 | { 54 | return fread(ptr, size, count, fp); 55 | } 56 | 57 | void OpenGLESFile::close() 58 | { 59 | fclose(fp); 60 | } 61 | 62 | std::string OpenGLESFile::getPath() const 63 | { 64 | return OpenGLESFile::rootPath + name; 65 | } 66 | 67 | std::string OpenGLESFile::getName() const 68 | { 69 | return name; 70 | } 71 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLESFile.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef OpenGLESFile_H_ 18 | #define OpenGLESFile_H_ 19 | 20 | #include 21 | 22 | namespace OpenGLES { 23 | 24 | class OpenGLESFile { 25 | public: 26 | OpenGLESFile(std::string name); 27 | 28 | bool open(); 29 | char *gets(char * buf, int size); 30 | int seek(long int offset, int origin); 31 | long int tell(); 32 | size_t read(void *ptr, size_t size, size_t count); 33 | void close(); 34 | std::string getName() const; 35 | std::string getPath() const; // rootPath + getName() 36 | 37 | static void setRootPath( const std::string& rp ) { 38 | OpenGLESFile::rootPath = rp; 39 | } 40 | 41 | private: 42 | std::string name; 43 | FILE *fp; 44 | int inMemoryIdx; 45 | 46 | static std::string rootPath; 47 | }; 48 | 49 | } 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLESImplementation.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef OpenGLESImplementation_H_ 18 | #define OpenGLESImplementation_H_ 19 | 20 | namespace OpenGLES { 21 | class OpenGLESImplementation { 22 | public: 23 | OpenGLESImplementation(); 24 | virtual ~OpenGLESImplementation(); 25 | 26 | virtual void init() = 0; 27 | void print(); 28 | 29 | //protected: 30 | int colorReadFormat; 31 | int colorReadType; 32 | int maxCombinedTextureImageUnits; 33 | int maxCubeMapTextureSize; 34 | int maxFragmentUniformVectors; 35 | int maxRenderBufferSize; 36 | int maxTextureImageUnits; 37 | int maxTextureSize; 38 | int maxVaryingVectors; 39 | int maxVertexAttribs; 40 | int maxVertexTextureImageUnits; 41 | int maxVertexUniformVectors; 42 | int maxViewportDims[2]; 43 | int numCompressedTextureFormats; 44 | int numShaderBinaryFormats; 45 | int* shaderBinaryFormats; 46 | bool shaderCompilerSupported; 47 | int depthBits; 48 | int stencilBits; 49 | 50 | // TODO: extensions? 51 | }; 52 | } 53 | #endif 54 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLESPlatform.h: -------------------------------------------------------------------------------- 1 | // 2 | // OpenGLESPlatform.h 3 | // MonkVG-OSX 4 | // 5 | // Created by Micah Pearlman on 2/3/13. 6 | // 7 | // 8 | 9 | #ifndef MonkVG_OSX_OpenGLESPlatform_h 10 | #define MonkVG_OSX_OpenGLESPlatform_h 11 | 12 | 13 | #if defined(__APPLE__) 14 | // turn off opengl deprecated warnings 15 | #define GL_SILENCE_DEPRECATION 16 | 17 | #include "TargetConditionals.h" 18 | #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR 19 | #if INCLUDE_ES1_HEADERS 20 | #include 21 | #include 22 | #else // GLES 2 23 | #include 24 | #include 25 | #endif // INCLUDE_ES1_HEADERS 26 | #define PLATFORM_IS_GLES 1 27 | #else // OSX 28 | #include 29 | #define GL_GLEXT_PROTOTYPES 1 30 | #define PLATFORM_IS_GLES 0 31 | #include 32 | 33 | #endif 34 | 35 | #elif ANDROID 36 | #define PLATFORM_IS_GLES 1 37 | #define GL_GLEXT_PROTOTYPES 1 38 | #if INCLUDE_ES1_HEADERS 39 | #include 40 | #include 41 | #else 42 | #include 43 | #include 44 | #endif // #if INCLUDE_ES1_HEADERS 45 | #include "glu.h" 46 | 47 | #elif WIN32 48 | #define PLATFORM_IS_GLES 0 49 | #define WIN32_LEAN_AND_MEAN 50 | #include 51 | #include 52 | #include 53 | #pragma comment(lib,"glew32.lib") 54 | 55 | #elif __linux__ 56 | 57 | #if defined(USE_OPENGL) 58 | #define PLATFORM_IS_GLES 0 59 | #define GL_GLEXT_PROTOTYPES 1 60 | #include 61 | #include 62 | #include 63 | #include 64 | #include 65 | 66 | #else 67 | #define PLATFORM_IS_GLES 1 68 | #define PLATFORM_IS_MESA 1 69 | #define GL_GLEXT_PROTOTYPES 1 70 | #if INCLUDE_ES1_HEADERS 71 | #include 72 | #include 73 | #else 74 | #include 75 | #include 76 | #endif // #if INCLUDE_ES1_HEADERS 77 | #endif // #if defined(USE_OPENGL) 78 | 79 | #endif // #if defined(__APPLE__) 80 | 81 | #ifndef APIENTRY 82 | #define APIENTRY 83 | #endif // APIENTRY 84 | 85 | 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLESString.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "OpenGLESString.h" 18 | #include 19 | 20 | using namespace OpenGLES; 21 | 22 | OpenGLESString::OpenGLESString(const char *str) : string(str) 23 | { 24 | 25 | } 26 | 27 | OpenGLESString::OpenGLESString(std::string str) : string(str) 28 | { 29 | 30 | } 31 | 32 | OpenGLESString::OpenGLESString(int val) : string() 33 | { 34 | std::stringstream out; 35 | out << val; 36 | string += out.str(); 37 | } 38 | 39 | OpenGLESString OpenGLESString::operator+ (const char *val) 40 | { 41 | return OpenGLESString(string + val); 42 | } 43 | 44 | OpenGLESString OpenGLESString::operator+ (std::string val) 45 | { 46 | return OpenGLESString(string + val); 47 | } 48 | 49 | OpenGLESString OpenGLESString::operator+ (OpenGLESString val) 50 | { 51 | return OpenGLESString(string + val()); 52 | } 53 | 54 | OpenGLESString OpenGLESString::operator+ (int val) 55 | { 56 | std::stringstream out; 57 | out << val; 58 | return OpenGLESString(string + out.str()); 59 | } 60 | 61 | #if !defined(ANDROID) 62 | OpenGLESString OpenGLESString::operator+ (size_t val) 63 | { 64 | std::stringstream out; 65 | out << (int)val; 66 | return OpenGLESString(string + out.str()); 67 | } 68 | #endif 69 | 70 | OpenGLESString OpenGLESString::operator+ (unsigned int val) 71 | { 72 | std::stringstream out; 73 | out << val; 74 | return OpenGLESString(string + out.str()); 75 | } 76 | 77 | OpenGLESString OpenGLESString::operator+ (float val) 78 | { 79 | std::stringstream out; 80 | out << val; 81 | return OpenGLESString(string + out.str()); 82 | } 83 | 84 | OpenGLESString OpenGLESString::operator+ (double val) 85 | { 86 | std::stringstream out; 87 | out << val; 88 | return OpenGLESString(string + out.str()); 89 | } 90 | 91 | std::string OpenGLESString::operator()() 92 | { 93 | return string; 94 | } 95 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLESString.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef OpenGLESString_H_ 18 | #define OpenGLESString_H_ 19 | 20 | #include 21 | 22 | namespace OpenGLES { 23 | 24 | class OpenGLESString { 25 | public: 26 | OpenGLESString(const char *str); 27 | OpenGLESString(std::string str); 28 | OpenGLESString(int val); 29 | 30 | OpenGLESString operator+ (const char *val); 31 | OpenGLESString operator+ (std::string val); 32 | OpenGLESString operator+ (OpenGLESString val); 33 | #if !defined(ANDROID) 34 | OpenGLESString operator+ (size_t val); 35 | #endif 36 | OpenGLESString operator+ (int val); 37 | OpenGLESString operator+ (unsigned int val); 38 | OpenGLESString operator+ (float val); 39 | OpenGLESString operator+ (double val); 40 | size_t size() const { return string.size(); } 41 | std::string operator()(); 42 | private: 43 | std::string string; 44 | }; 45 | 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /thirdparty/gles2-bc/Sources/OpenGLES/OpenGLESUtil.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009 Johannes Vuorinen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #ifndef OpenGLESUtil_H_ 18 | #define OpenGLESUtil_H_ 19 | 20 | #define OPENGLES_DEBUG 1 21 | 22 | #ifdef OPENGLES_DEBUG 23 | #define CHECK_GL_ERROR(X, Y, Z) OpenGLESUtil::checkGlError(X, Y, Z) 24 | #define LOG_DEBUG_MESSAGE(...) OpenGLESUtil::logMessage(__VA_ARGS__) 25 | #define PRINT(...) OpenGLESUtil::print(__VA_ARGS__) 26 | #define PRINT_BITS(X) OpenGLESUtil::printBits(X) 27 | #else 28 | #define CHECK_GL_ERROR(X, Y, Z) 29 | #define LOG_DEBUG_MESSAGE(...) 30 | #define PRINT(...) 31 | #define PRINT_BITS(X) 32 | #endif 33 | 34 | #ifdef OPENGLES_DEBUG 35 | #pragma clang diagnostic push 36 | #pragma clang diagnostic ignored "-Wunused-value" 37 | #define LOG_MESSAGE(...) OpenGLESUtil::logMessage(__VA_ARGS__); 38 | #pragma clang diagnostic pop 39 | #else 40 | #define LOG_MESSAGE(...) 41 | #endif 42 | 43 | #include "OpenGLESContext.h" 44 | #include "OpenGLESString.h" 45 | #include 46 | #include 47 | #include 48 | 49 | namespace OpenGLES { 50 | 51 | class OpenGLESUtil { 52 | public: 53 | static void checkGlError(GLenum errorCode, const char *file, const unsigned int line); 54 | static void logMessage(const char *file, int line, OpenGLESString msg); 55 | static void logMessage(OpenGLESString msg); 56 | static void print( const char* format, ... ); 57 | static void printBits(int val); 58 | }; 59 | 60 | } 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /thirdparty/glu/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [{meson.build,meson_options.txt}] 4 | indent_size = 2 5 | indent_style = space 6 | insert_final_newline = true -------------------------------------------------------------------------------- /thirdparty/glu/.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.dll 3 | *.exe 4 | *.ilk 5 | *.la 6 | *.lo 7 | *.o 8 | *.obj 9 | *.os 10 | *.pc 11 | *.pdb 12 | *.pyc 13 | *.pyo 14 | *.so 15 | *.so.* 16 | *.sw[a-z] 17 | *.tar 18 | *.tar.bz2 19 | *.tar.gz 20 | *.zip 21 | *~ 22 | depend 23 | depend.bak 24 | bin/ltmain.sh 25 | lib 26 | lib64 27 | configure 28 | configure.lineno 29 | autom4te.cache 30 | aclocal.m4 31 | config.log 32 | config.status 33 | cscope* 34 | build 35 | libtool 36 | manifest.txt 37 | Makefile.in 38 | .dir-locals.el 39 | .deps/ 40 | .libs/ 41 | Makefile 42 | .dirstamp 43 | missing 44 | config.guess 45 | config.sub 46 | depcomp 47 | install-sh 48 | ltmain.sh 49 | -------------------------------------------------------------------------------- /thirdparty/glu/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0.0) 2 | project(glu VERSION 0.1.0) 3 | 4 | find_package(OpenGL REQUIRED) 5 | 6 | ## Tesselation Library 7 | add_library(glu_tess 8 | ${PROJECT_SOURCE_DIR}/src/libtess/dict.c 9 | ${PROJECT_SOURCE_DIR}/src/libtess/geom.c 10 | ${PROJECT_SOURCE_DIR}/src/libtess/memalloc.c 11 | ${PROJECT_SOURCE_DIR}/src/libtess/mesh.c 12 | ${PROJECT_SOURCE_DIR}/src/libtess/normal.c 13 | ${PROJECT_SOURCE_DIR}/src/libtess/priorityq-heap.c 14 | ${PROJECT_SOURCE_DIR}/src/libtess/priorityq.c 15 | ${PROJECT_SOURCE_DIR}/src/libtess/render.c 16 | ${PROJECT_SOURCE_DIR}/src/libtess/sweep.c 17 | ${PROJECT_SOURCE_DIR}/src/libtess/tess.c 18 | ${PROJECT_SOURCE_DIR}/src/libtess/tessmono.c 19 | ) 20 | 21 | 22 | target_include_directories(glu_tess PRIVATE 23 | ${PROJECT_SOURCE_DIR}/src/libtess 24 | ${PROJECT_SOURCE_DIR}/src/include 25 | ${PROJECT_SOURCE_DIR}/include) 26 | 27 | add_library(glu_util 28 | ${PROJECT_SOURCE_DIR}/src/libutil/error.c 29 | ${PROJECT_SOURCE_DIR}/src/libutil/glue.c 30 | ) 31 | 32 | target_include_directories(glu_util PRIVATE 33 | ${PROJECT_SOURCE_DIR}/src/libutil 34 | ${PROJECT_SOURCE_DIR}/src/include 35 | ${PROJECT_SOURCE_DIR}/include) 36 | -------------------------------------------------------------------------------- /thirdparty/glu/autogen.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | test -n "$srcdir" || srcdir=`dirname "$0"` 4 | test -n "$srcdir" || srcdir=. 5 | autoreconf --force --install --verbose "$srcdir" 6 | test -n "$NOCONFIGURE" || "$srcdir/configure" "$@" 7 | -------------------------------------------------------------------------------- /thirdparty/glu/meson.build: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: MIT 2 | # Copyright © 2021 Intel Corporation 3 | 4 | project( 5 | 'glu', 6 | ['c', 'cpp'], 7 | version : '9.0.2', 8 | meson_version : '>= 0.52.0', 9 | license : 'SGI-B-1.1 AND SGI-B-2.0 AND MIT', 10 | default_options : ['default_library=both', 'b_ndebug=if-release'] 11 | ) 12 | 13 | if get_option('debug') 14 | add_project_arguments('-DDEBUG', language : ['c', 'cpp']) 15 | endif 16 | 17 | gl_provider = get_option('gl_provider') 18 | if gl_provider == 'glvnd' 19 | gl_provider = 'opengl' 20 | endif 21 | dep_gl = dependency(gl_provider) 22 | 23 | inc_include = include_directories('include') 24 | 25 | subdir('src') 26 | 27 | install_headers( 28 | 'include/GL/glu.h', 29 | subdir : 'GL', 30 | ) 31 | 32 | pkgconf = import('pkgconfig') 33 | pkgconf.generate( 34 | libglu, 35 | name : 'glu', 36 | description : 'Mesa OpenGL Utility Library', 37 | requires: 'opengl' 38 | ) 39 | -------------------------------------------------------------------------------- /thirdparty/glu/meson_options.txt: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: MIT 2 | # Copyright © 2021 Intel Corporation 3 | 4 | option( 5 | 'gl_provider', 6 | type : 'combo', 7 | choices : ['glvnd', 'gl', 'osmesa'], 8 | value : 'glvnd', 9 | description : 'Which OpenGL to link with' 10 | ) 11 | -------------------------------------------------------------------------------- /thirdparty/glu/src/include/gluos.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** gluos.h - operating system dependencies for GLU 3 | ** 4 | */ 5 | #ifdef __VMS 6 | #ifdef __cplusplus 7 | #pragma message disable nocordel 8 | #pragma message disable codeunreachable 9 | #pragma message disable codcauunr 10 | #endif 11 | #endif 12 | 13 | #ifdef __WATCOMC__ 14 | /* Disable *lots* of warnings to get a clean build. I can't be bothered fixing the 15 | * code at the moment, as it is pretty ugly. 16 | */ 17 | #pragma warning 7 10 18 | #pragma warning 13 10 19 | #pragma warning 14 10 20 | #pragma warning 367 10 21 | #pragma warning 379 10 22 | #pragma warning 726 10 23 | #pragma warning 836 10 24 | #endif 25 | 26 | #ifdef BUILD_FOR_SNAP 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | #elif defined(_WIN32) 33 | 34 | #include /* For _MAX_PATH definition */ 35 | #include 36 | #include 37 | 38 | #define WIN32_LEAN_AND_MEAN 39 | #define NOGDI 40 | #define NOIME 41 | #define NOMINMAX 42 | 43 | #ifdef __MINGW64_VERSION_MAJOR 44 | #undef _WIN32_WINNT 45 | #endif 46 | 47 | #ifndef _WIN32_WINNT 48 | /* XXX: Workaround a bug in mingw-w64's headers when NOGDI is set and 49 | * _WIN32_WINNT >= 0x0600 */ 50 | #define _WIN32_WINNT 0x0400 51 | #endif 52 | #ifndef STRICT 53 | #define STRICT 1 54 | #endif 55 | 56 | #include 57 | 58 | /* Disable warnings */ 59 | #if defined(_MSC_VER) 60 | #pragma warning(disable : 4101) 61 | #pragma warning(disable : 4244) 62 | #pragma warning(disable : 4761) 63 | #endif 64 | 65 | #if defined(_MSC_VER) && _MSC_VER >= 1200 && _MSC_VER < 1300 66 | #pragma comment(linker, "/OPT:NOWIN98") 67 | #endif 68 | 69 | #ifndef WINGDIAPI 70 | #define WINGDIAPI 71 | #endif 72 | 73 | #elif defined(__OS2__) 74 | 75 | #include 76 | #include 77 | #include 78 | #define WINGDIAPI 79 | 80 | #else 81 | 82 | /* Disable Microsoft-specific keywords */ 83 | #define GLAPIENTRY 84 | #define WINGDIAPI 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/interface/glimports.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * glimports.h 33 | * 34 | */ 35 | 36 | #ifndef __gluimports_h_ 37 | #define __gluimports_h_ 38 | 39 | #include "mystdlib.h" 40 | #include "mystdio.h" 41 | 42 | #endif /* __gluimports_h_ */ 43 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/interface/mystdio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * mystdio.h 33 | * 34 | */ 35 | 36 | #ifndef __glumystdio_h_ 37 | #define __glumystdio_h_ 38 | 39 | #ifdef STANDALONE 40 | inline void _glu_dprintf( const char *, ... ) { } 41 | #endif 42 | 43 | #ifdef LIBRARYBUILD 44 | #ifndef NDEBUG 45 | #include 46 | #define _glu_dprintf printf 47 | #else 48 | inline void _glu_dprintf( const char *, ... ) { } 49 | #endif 50 | #endif 51 | 52 | #ifdef GLBUILD 53 | inline void _glu_dprintf( const char *, ... ) { } 54 | #endif 55 | 56 | #ifndef NULL 57 | #define NULL 0 58 | #endif 59 | 60 | #endif /* __glumystdio_h_ */ 61 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/interface/mystdlib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * mystdlib.h 33 | * 34 | */ 35 | 36 | #ifndef __glumystdlib_h_ 37 | #define __glumystdlib_h_ 38 | 39 | #ifdef STANDALONE 40 | typedef unsigned int size_t; 41 | extern "C" void abort( void ); 42 | extern "C" void * malloc( size_t ); 43 | extern "C" void free( void * ); 44 | #endif 45 | 46 | #ifdef LIBRARYBUILD 47 | #include 48 | #endif 49 | 50 | #ifdef GLBUILD 51 | typedef unsigned int size_t; 52 | extern "C" void abort( void ); 53 | extern "C" void * malloc( size_t ); 54 | extern "C" void free( void * ); 55 | #endif 56 | 57 | #endif /* __glumystdlib_h_ */ 58 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/internals/bezierarc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * bezierarc.h 33 | * 34 | */ 35 | 36 | #ifndef __glubezierarc_h 37 | #define __glubezierarc_h 38 | 39 | #include "myassert.h" 40 | 41 | class Mapdesc; 42 | 43 | struct BezierArc : public PooledObj { /* a bezier arc */ 44 | REAL * cpts; /* control points of arc */ 45 | int order; /* order of arc */ 46 | int stride; /* REAL distance between points */ 47 | long type; /* curve type */ 48 | Mapdesc * mapdesc; 49 | }; 50 | 51 | #endif /* __glubezierarc_h */ 52 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/internals/cachingeval.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * cachingeval.h 33 | * 34 | */ 35 | 36 | #ifndef __glucachingval_h_ 37 | #define __glucachingval_h_ 38 | 39 | class CachingEvaluator { 40 | public: 41 | virtual ~CachingEvaluator() { /* silence warning*/ } 42 | enum ServiceMode { play, record, playAndRecord }; 43 | virtual int canRecord( void ); 44 | virtual int canPlayAndRecord( void ); 45 | virtual int createHandle( int handle ); 46 | virtual void beginOutput( ServiceMode, int handle ); 47 | virtual void endOutput( void ); 48 | virtual void discardRecording( int handle ); 49 | virtual void playRecording( int handle ); 50 | }; 51 | #endif /* __glucachingval_h_ */ 52 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/internals/curvelist.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * curvelist.h 33 | * 34 | */ 35 | 36 | #ifndef __glucurvelist_h_ 37 | #define __glucurvelist_h_ 38 | 39 | #include "types.h" 40 | #include "defines.h" 41 | 42 | class Mapdesc; 43 | class Quilt; 44 | class Curve; 45 | 46 | class Curvelist 47 | { 48 | friend class Subdivider; 49 | public: 50 | Curvelist( Quilt *, REAL, REAL ); 51 | Curvelist( Curvelist &, REAL ); 52 | ~Curvelist( void ); 53 | int cullCheck( void ); 54 | void getstepsize( void ); 55 | int needsSamplingSubdivision(); 56 | private: 57 | Curve *curve; 58 | float range[3]; 59 | int needsSubdivision; 60 | float stepsize; 61 | }; 62 | #endif /* __glucurvelist_h_ */ 63 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/internals/defines.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * defines.h 33 | * 34 | */ 35 | 36 | #ifndef __gludefines_h_ 37 | #define __gludefines_h_ 38 | 39 | /* culling constants */ 40 | #define CULL_TRIVIAL_REJECT 0 41 | #define CULL_TRIVIAL_ACCEPT 1 42 | #define CULL_ACCEPT 2 43 | 44 | /* maximum order of a B-Spline */ 45 | #define MAXORDER 24 46 | 47 | /* maximum dimension of any B-spline range space */ 48 | #define MAXCOORDS 5 49 | 50 | #endif /* __gludefines_h_ */ 51 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/internals/displaymode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | /* 31 | */ 32 | 33 | #ifndef __gludisplaymode_h_ 34 | #define __gludisplaymode_h_ 35 | 36 | #define N_MESHFILL 0 37 | #define N_MESHLINE 1 38 | #define N_MESHPOINT 2 39 | 40 | #endif /* __gludisplaymode_h_ */ 41 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/internals/flist.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * flist.h 33 | * 34 | */ 35 | 36 | #ifndef __gluflist_h_ 37 | #define __gluflist_h_ 38 | 39 | #include "types.h" 40 | #include "flistsorter.h" 41 | 42 | class Flist { 43 | public: 44 | REAL * pts; /* head of array */ 45 | int npts; /* number of points in array */ 46 | int start; /* first important point index */ 47 | int end; /* last important point index */ 48 | 49 | Flist( void ); 50 | ~Flist( void ); 51 | void add( REAL x ); 52 | void filter( void ); 53 | void grow( int); 54 | void taper( REAL , REAL ); 55 | protected: 56 | FlistSorter sorter; 57 | }; 58 | 59 | #endif /* __gluflist_h_ */ 60 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/internals/flistsorter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * flistsorter.h 33 | * 34 | */ 35 | 36 | #ifndef __gluflistsorter_h_ 37 | #define __gluflistsorter_h_ 38 | 39 | #include "sorter.h" 40 | #include "types.h" 41 | 42 | class FlistSorter : public Sorter { 43 | public: 44 | FlistSorter(void); 45 | virtual ~FlistSorter() { /* silence warning*/ } 46 | void qsort( REAL *a, int n ); 47 | 48 | protected: 49 | virtual int qscmp( char *, char * ); 50 | virtual void qsexc( char *i, char *j ); // i<-j, j<-i 51 | virtual void qstexc( char *i, char *j, char *k ); // i<-k, k<-j, j<-i 52 | }; 53 | #endif /* __gluflistsorter_h_ */ 54 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/internals/gridline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * gridline.h 33 | * 34 | */ 35 | 36 | #ifndef __glugridline_h_ 37 | #define __glugridline_h_ 38 | 39 | struct Gridline { 40 | long v; 41 | REAL vval; 42 | long vindex; 43 | long ustart; 44 | long uend; 45 | }; 46 | #endif /* __glugridline_h_ */ 47 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/internals/gridvertex.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * gridvertex.h 33 | * 34 | */ 35 | 36 | #ifndef __glugridvertex_h_ 37 | #define __glugridvertex_h_ 38 | 39 | struct GridVertex { 40 | long gparam[2]; 41 | GridVertex( void ) { gparam[0] = 0, gparam[1] = 0; } 42 | GridVertex( long u, long v ) { gparam[0] = u, gparam[1] = v; } 43 | void set( long u, long v ) { gparam[0] = u, gparam[1] = v; } 44 | long nextu() { return gparam[0]++; } 45 | long prevu() { return gparam[0]--; } 46 | }; 47 | 48 | #endif /* __glugridvertex_h_ */ 49 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/internals/hull.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * hull.h 33 | * 34 | */ 35 | 36 | #ifndef __gluhull_h_ 37 | #define __gluhull_h_ 38 | 39 | #include "trimline.h" 40 | #include "trimregion.h" 41 | #include "trimvertex.h" 42 | #include "gridtrimvertex.h" 43 | 44 | struct Gridline; 45 | class Uarray; 46 | 47 | class Hull : virtual public TrimRegion { 48 | public: 49 | Hull( void ); 50 | ~Hull( void ); 51 | void init( void ); 52 | GridTrimVertex * nextlower( GridTrimVertex * ); 53 | GridTrimVertex * nextupper( GridTrimVertex * ); 54 | private: 55 | struct Side { 56 | Trimline *left; 57 | Gridline *line; 58 | Trimline *right; 59 | long index; 60 | }; 61 | 62 | Side lower; 63 | Side upper; 64 | Trimline fakeleft; 65 | Trimline fakeright; 66 | }; 67 | 68 | 69 | #endif /* __gluhull_h_ */ 70 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/internals/knotvector.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * knotvector.h 33 | * 34 | */ 35 | 36 | #ifndef __gluknotvector_h_ 37 | #define __gluknotvector_h_ 38 | 39 | #include "types.h" 40 | 41 | struct Knotvector { /* a knot vector */ 42 | Knotvector( void ); 43 | ~Knotvector( void ); 44 | void init( long, long, long, INREAL * ); 45 | int validate( void ); 46 | void show( const char * ); 47 | 48 | long order; /* order of spline */ 49 | long knotcount; /* number of knots */ 50 | long stride; /* bytes between points */ 51 | Knot * knotlist; /* global knot vector */ 52 | }; 53 | 54 | /* tolerance to test knot coincidence */ 55 | #define TOLERANCE 1.0e-5 56 | 57 | inline int 58 | identical( Knot x, Knot y ) 59 | { 60 | return ((x-y) < TOLERANCE) ? 1 : 0; 61 | } 62 | #endif /* __gluknotvector_h_ */ 63 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/internals/myassert.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * myassert.h 33 | * 34 | */ 35 | 36 | #ifndef __glumyassert_h_ 37 | #define __glumyassert_h_ 38 | 39 | #ifdef STANDALONE 40 | #define assert(EX) ((void)0) 41 | #endif 42 | 43 | #ifdef LIBRARYBUILD 44 | #include 45 | #endif 46 | 47 | #ifdef GLBUILD 48 | #define assert(EX) ((void)0) 49 | #endif 50 | 51 | #endif /* __glumyassert_h_ */ 52 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/internals/mystring.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * mystring.h 33 | * 34 | */ 35 | 36 | #ifndef __glumystring_h_ 37 | #define __glumystring_h_ 38 | 39 | #ifdef STANDALONE 40 | typedef unsigned int size_t; 41 | extern "C" void * memcpy(void *, const void *, size_t); 42 | extern "C" void * memset(void *, int, size_t); 43 | #endif 44 | 45 | #ifdef GLBUILD 46 | #define memcpy(a,b,c) bcopy(b,a,c) 47 | #define memset(a,b,c) bzero(a,c) 48 | extern "C" void bcopy(const void *, void *, int); 49 | extern "C" void bzero(void *, int); 50 | #endif 51 | 52 | #ifdef LIBRARYBUILD 53 | #include 54 | #endif 55 | 56 | #endif /* __glumystring_h_ */ 57 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/internals/renderhints.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * renderhints.h 33 | * 34 | */ 35 | 36 | #ifndef __glurenderhints_h_ 37 | #define __glurenderhints_h_ 38 | 39 | #include "types.h" 40 | 41 | class Renderhints { 42 | public: 43 | Renderhints( void ); 44 | void init( void ); 45 | int isProperty( long ); 46 | REAL getProperty( long ); 47 | void setProperty( long, REAL ); 48 | 49 | REAL display_method; /* display mode */ 50 | REAL errorchecking; /* activate error checking */ 51 | REAL subdivisions; /* maximum number of subdivisions per patch */ 52 | REAL tmp1; /* unused */ 53 | 54 | int displaydomain; 55 | int maxsubdivisions; 56 | int wiretris; 57 | int wirequads; 58 | }; 59 | 60 | #endif /* __glurenderhints_h_ */ 61 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/internals/simplemath.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * simplemath.h 33 | * 34 | */ 35 | 36 | #ifndef __glusimplemath_h_ 37 | #define __glusimplemath_h_ 38 | 39 | /* simple inline routines */ 40 | 41 | #include "types.h" 42 | 43 | inline int 44 | max( int x, int y ) { return ( x < y ) ? y : x; } 45 | 46 | inline REAL 47 | min( REAL x, REAL y ) { return ( x > y ) ? y : x; } 48 | 49 | inline REAL 50 | glu_abs( REAL x ) { return ( x < 0.0 ) ? -x : x; } 51 | 52 | #endif /* __glusimplemath_h_ */ 53 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/internals/sorter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | /* 31 | */ 32 | 33 | #ifndef __glusorter_h_ 34 | #define __glusorter_h_ 35 | 36 | class Sorter { 37 | public: 38 | Sorter( int es ); 39 | virtual ~Sorter() { /* silence warning*/ } 40 | void qsort( void *a, int n ); 41 | 42 | protected: 43 | virtual int qscmp( char *, char * ); 44 | virtual void qsexc( char *i, char *j ); // i<-j, j<-i 45 | virtual void qstexc( char *i, char *j, char *k ); // i<-k, k<-j, j<-i 46 | 47 | private: 48 | void qs1( char *, char * ); 49 | int es; 50 | }; 51 | #endif /* __glusorter_h_ */ 52 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/internals/trimvertpool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * trimvertexpool.h 33 | * 34 | */ 35 | 36 | #ifndef __glutrimvertpool_h_ 37 | #define __glutrimvertpool_h_ 38 | 39 | #include "bufpool.h" 40 | 41 | class TrimVertex; 42 | 43 | #define INIT_VERTLISTSIZE 200 44 | 45 | class TrimVertexPool { 46 | public: 47 | TrimVertexPool( void ); 48 | ~TrimVertexPool( void ); 49 | void clear( void ); 50 | TrimVertex * get( int ); 51 | private: 52 | Pool pool; 53 | TrimVertex ** vlist; 54 | int nextvlistslot; 55 | int vlistsize; 56 | }; 57 | #endif /* __glutrimvertpool_h_ */ 58 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/internals/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * types.h 33 | * 34 | */ 35 | 36 | #ifndef __glutypes_h_ 37 | #define __glutypes_h_ 38 | 39 | //typedef double INREAL; 40 | #define INREAL float 41 | typedef float REAL; 42 | typedef void (*Pfvv)( void ); 43 | typedef void (*Pfvf)( float * ); 44 | typedef int (*cmpfunc)(const void *, const void *); 45 | typedef REAL Knot, *Knot_ptr;/* knot values */ 46 | 47 | #endif /* __glutypes_h_ */ 48 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/internals/uarray.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * uarray.h 33 | * 34 | */ 35 | 36 | #ifndef __gluuarray_h_ 37 | #define __gluuarray_h_ 38 | 39 | #include "types.h" 40 | 41 | class Arc; 42 | typedef class Arc *Arc_ptr; 43 | 44 | class Uarray { 45 | private: 46 | long size; 47 | long ulines; 48 | public: 49 | Uarray(); 50 | ~Uarray(); 51 | long init( REAL, Arc_ptr, Arc_ptr ); 52 | REAL * uarray; 53 | }; 54 | 55 | #endif /* __gluuarray_h_ */ 56 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/internals/varray.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * varray.h 33 | * 34 | */ 35 | 36 | #ifndef __gluvarray_h_ 37 | #define __gluvarray_h_ 38 | 39 | #include "types.h" 40 | 41 | class Arc; 42 | 43 | class Varray { 44 | public: 45 | Varray(); 46 | ~Varray(); 47 | long init( REAL, Arc *, Arc * ); 48 | REAL * varray; 49 | REAL vval[1000]; 50 | long voffset[1000]; 51 | long numquads; 52 | 53 | private: 54 | long size; 55 | inline void update( Arc *, long[2], REAL ); 56 | void grow( long ); 57 | inline void append( REAL ); 58 | }; 59 | 60 | inline void 61 | Varray::append( REAL v ) 62 | { 63 | if( v != vval[numquads] ) 64 | vval[++numquads] = v; 65 | } 66 | 67 | 68 | #endif /* __gluvarray_h_ */ 69 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/nurbtess/definitions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | /* 31 | */ 32 | 33 | #ifndef _DEFINITIONS_H 34 | #define _DEFINITIONS_H 35 | 36 | typedef float Real; 37 | typedef int Int; 38 | typedef Real Real2[2]; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/nurbtess/glimports.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * glimports.h 33 | * 34 | */ 35 | 36 | #ifndef __gluimports_h_ 37 | #define __gluimports_h_ 38 | 39 | #include "mystdlib.h" 40 | #include "mystdio.h" 41 | 42 | #endif /* __gluimports_h_ */ 43 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/nurbtess/monoPolyPart.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | /* 31 | *monoPolyPart.h 32 | */ 33 | 34 | #ifndef _MONO_POLY_PART_H 35 | #define _MONO_POLY_PART_H 36 | 37 | class directedLine; 38 | 39 | directedLine* monoPolyPart(directedLine* polygon); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/nurbtess/mystdio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * mystdio.h 33 | * 34 | */ 35 | 36 | #ifndef __glumystdio_h_ 37 | #define __glumystdio_h_ 38 | 39 | #ifdef STANDALONE 40 | inline void _glu_dprintf( char *, ... ) { } 41 | #endif 42 | 43 | #ifdef LIBRARYBUILD 44 | #ifndef NDEBUG 45 | #include 46 | #define _glu_dprintf printf 47 | #else 48 | inline void _glu_dprintf( char *, ... ) { } 49 | #endif 50 | #endif 51 | 52 | #ifdef GLBUILD 53 | inline void _glu_dprintf( char *, ... ) { } 54 | #endif 55 | 56 | #ifndef NULL 57 | #define NULL 0 58 | #endif 59 | 60 | #endif /* __glumystdio_h_ */ 61 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/nurbtess/mystdlib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | /* 32 | * mystdlib.h 33 | * 34 | */ 35 | 36 | #ifndef __glumystdlib_h_ 37 | #define __glumystdlib_h_ 38 | 39 | #ifdef STANDALONE 40 | typedef unsigned int size_t; 41 | extern "C" void abort( void ); 42 | extern "C" void * malloc( size_t ); 43 | extern "C" void free( void * ); 44 | #endif 45 | 46 | #ifdef LIBRARYBUILD 47 | #include 48 | #endif 49 | 50 | #ifdef GLBUILD 51 | typedef unsigned int size_t; 52 | extern "C" void abort( void ); 53 | extern "C" void * malloc( size_t ); 54 | extern "C" void free( void * ); 55 | #endif 56 | 57 | #endif /* __glumystdlib_h_ */ 58 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/nurbtess/partitionX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | /* 31 | */ 32 | 33 | #ifndef _PARTITIONX_H 34 | #define _PARTITIONX_H 35 | 36 | #include "directedLine.h" 37 | 38 | Int isCuspX(directedLine *v); 39 | Int isReflexX(directedLine *v); 40 | Int cuspTypeX(directedLine *v); 41 | 42 | //assuming the array of ret_interior_cusps has been allocated 43 | void findInteriorCuspsX(directedLine* polygon, Int& ret_n_interior_cusps, 44 | directedLine** ret_interior_cusps); 45 | 46 | Int numInteriorCuspsX(directedLine* polygon); 47 | 48 | /*a single polygon with a single cusp 49 | *return the diagonal vertex corresponding to this cusp 50 | */ 51 | directedLine* findDiagonal_singleCuspX(directedLine* cusp); 52 | 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/nurbtess/polyUtil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | /* 31 | */ 32 | 33 | #ifndef _POLYUTIL_H 34 | #define _POLYUTIL_H 35 | 36 | #include "definitions.h" 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | Real area(Real A[2], Real B[2], Real C[2]); 41 | 42 | Int pointLeftLine(Real A[2], Real B[2], Real P[2]); 43 | Int pointLeft2Lines(Real A[2], Real B[2], Real C[2], Real P[2]); 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | #endif 48 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/nurbtess/quicksort.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | /* 31 | */ 32 | 33 | #ifndef _QUICKSORT_H 34 | #define _QUICKSORT_H 35 | 36 | #include 37 | #include 38 | 39 | void quicksort(void *v[], int left, int right, 40 | int (*comp) (void *, void *)); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libnurbs/nurbtess/zlassert.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | /* 31 | */ 32 | 33 | /*XXXblythe this file should be deleted*/ 34 | #include 35 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libtess/memalloc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | /* 31 | ** Author: Eric Veach, July 1994. 32 | ** 33 | */ 34 | 35 | #include "memalloc.h" 36 | #include "string.h" 37 | 38 | int __gl_memInit( size_t maxFast ) 39 | { 40 | #ifndef NO_MALLOPT 41 | /* mallopt( M_MXFAST, maxFast );*/ 42 | #ifdef MEMORY_DEBUG 43 | mallopt( M_DEBUG, 1 ); 44 | #endif 45 | #endif 46 | return 1; 47 | } 48 | 49 | #ifdef MEMORY_DEBUG 50 | void *__gl_memAlloc( size_t n ) 51 | { 52 | return memset( malloc( n ), 0xa5, n ); 53 | } 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libtess/memalloc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | /* 31 | ** Author: Eric Veach, July 1994. 32 | ** 33 | */ 34 | 35 | #ifndef __memalloc_simple_h_ 36 | #define __memalloc_simple_h_ 37 | 38 | #include 39 | 40 | #define memRealloc realloc 41 | #define memFree free 42 | 43 | #define memInit __gl_memInit 44 | /*extern void __gl_memInit( size_t );*/ 45 | extern int __gl_memInit( size_t ); 46 | 47 | #ifndef MEMORY_DEBUG 48 | #define memAlloc malloc 49 | #else 50 | #define memAlloc __gl_memAlloc 51 | extern void * __gl_memAlloc( size_t ); 52 | #endif 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libtess/normal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | /* 31 | ** Author: Eric Veach, July 1994. 32 | ** 33 | */ 34 | 35 | #ifndef __normal_h_ 36 | #define __normal_h_ 37 | 38 | #include "tess.h" 39 | 40 | /* __gl_projectPolygon( tess ) determines the polygon normal 41 | * and project vertices onto the plane of the polygon. 42 | */ 43 | void __gl_projectPolygon( GLUtesselator *tess ); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libtess/render.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | /* 31 | ** Author: Eric Veach, July 1994. 32 | ** 33 | */ 34 | 35 | #ifndef __render_h_ 36 | #define __render_h_ 37 | 38 | #include "mesh.h" 39 | 40 | /* __gl_renderMesh( tess, mesh ) takes a mesh and breaks it into triangle 41 | * fans, strips, and separate triangles. A substantial effort is made 42 | * to use as few rendering primitives as possible (ie. to make the fans 43 | * and strips as large as possible). 44 | * 45 | * The rendering output is provided as callbacks (see the api). 46 | */ 47 | void __gl_renderMesh( GLUtesselator *tess, GLUmesh *mesh ); 48 | void __gl_renderBoundary( GLUtesselator *tess, GLUmesh *mesh ); 49 | 50 | GLboolean __gl_renderCache( GLUtesselator *tess ); 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /thirdparty/glu/src/libutil/gluint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice including the dates of first publication and 13 | * either this permission notice or a reference to 14 | * http://oss.sgi.com/projects/FreeB/ 15 | * shall be included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. 26 | * shall not be used in advertising or otherwise to promote the sale, use or 27 | * other dealings in this Software without prior written authorization from 28 | * Silicon Graphics, Inc. 29 | */ 30 | 31 | #ifndef __gluint_h__ 32 | #define __gluint_h__ 33 | 34 | extern const unsigned char *__gluNURBSErrorString( int errnum ); 35 | 36 | extern const unsigned char *__gluTessErrorString( int errnum ); 37 | 38 | #ifdef _EXTENSIONS_ 39 | #define COS cosf 40 | #define SIN sinf 41 | #define SQRT sqrtf 42 | #else 43 | #define COS cos 44 | #define SIN sin 45 | #define SQRT sqrt 46 | #endif 47 | 48 | #endif /* __gluint_h__ */ 49 | -------------------------------------------------------------------------------- /tiger.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:aae9e45d7da42070f9ab846f02f39c8af4c34bf99a5f3a28558ce642fa385947 3 | size 43531 4 | --------------------------------------------------------------------------------