├── Android ├── Ch10_MultiTexture │ ├── .classpath │ ├── .project │ ├── AndroidManifest.xml │ ├── default.properties │ ├── proguard.cfg │ ├── res │ │ ├── drawable-hdpi │ │ │ └── icon.png │ │ ├── drawable-ldpi │ │ │ └── icon.png │ │ ├── drawable-mdpi │ │ │ └── icon.png │ │ ├── layout │ │ │ └── main.xml │ │ ├── raw │ │ │ ├── basemap.png │ │ │ └── lightmap.png │ │ └── values │ │ │ └── strings.xml │ └── src │ │ └── com │ │ └── openglesbook │ │ └── multitexture │ │ ├── MultiTexture.java │ │ └── MultiTextureRenderer.java ├── Ch11_Stencil_Test │ ├── .classpath │ ├── .project │ ├── AndroidManifest.xml │ ├── default.properties │ ├── proguard.cfg │ ├── res │ │ ├── drawable-hdpi │ │ │ └── icon.png │ │ ├── drawable-ldpi │ │ │ └── icon.png │ │ ├── drawable-mdpi │ │ │ └── icon.png │ │ ├── layout │ │ │ └── main.xml │ │ └── values │ │ │ └── strings.xml │ └── src │ │ └── com │ │ └── openglesbook │ │ └── stenciltest │ │ ├── StencilTest.java │ │ └── StencilTestRenderer.java ├── Ch13_ParticleSystem │ ├── .classpath │ ├── .project │ ├── AndroidManifest.xml │ ├── default.properties │ ├── proguard.cfg │ ├── res │ │ ├── drawable-hdpi │ │ │ └── icon.png │ │ ├── drawable-ldpi │ │ │ └── icon.png │ │ ├── drawable-mdpi │ │ │ └── icon.png │ │ ├── layout │ │ │ └── main.xml │ │ ├── raw │ │ │ └── smoke.png │ │ └── values │ │ │ └── strings.xml │ └── src │ │ └── com │ │ └── openglesbook │ │ └── particlesystem │ │ ├── ParticleSystem.java │ │ └── ParticleSystemRenderer.java ├── Ch2_Hello_Triangle │ ├── .classpath │ ├── .project │ ├── .settings │ │ └── org.eclipse.jdt.core.prefs │ ├── AndroidManifest.xml │ ├── default.properties │ ├── proguard.cfg │ ├── res │ │ ├── drawable-hdpi │ │ │ └── icon.png │ │ ├── drawable-ldpi │ │ │ └── icon.png │ │ ├── drawable-mdpi │ │ │ └── icon.png │ │ ├── layout │ │ │ └── main.xml │ │ └── values │ │ │ └── strings.xml │ └── src │ │ └── com │ │ └── opengles │ │ └── hellotriangle │ │ ├── HelloTriangle.java │ │ └── HelloTriangleRenderer.java ├── Ch8_Simple_VertexShader │ ├── .classpath │ ├── .project │ ├── AndroidManifest.xml │ ├── default.properties │ ├── proguard.cfg │ ├── res │ │ ├── drawable-hdpi │ │ │ └── icon.png │ │ ├── drawable-ldpi │ │ │ └── icon.png │ │ ├── drawable-mdpi │ │ │ └── icon.png │ │ ├── layout │ │ │ └── main.xml │ │ └── values │ │ │ └── strings.xml │ └── src │ │ └── com │ │ └── opengles │ │ └── simplevertexshader │ │ ├── SimpleVertexShader.java │ │ └── SimpleVertexShaderRenderer.java ├── Ch9_MipMap2D │ ├── .classpath │ ├── .project │ ├── AndroidManifest.xml │ ├── default.properties │ ├── proguard.cfg │ ├── res │ │ ├── drawable-hdpi │ │ │ └── icon.png │ │ ├── drawable-ldpi │ │ │ └── icon.png │ │ ├── drawable-mdpi │ │ │ └── icon.png │ │ ├── layout │ │ │ └── main.xml │ │ └── values │ │ │ └── strings.xml │ └── src │ │ └── com │ │ └── openglesbook │ │ └── mipmap2d │ │ ├── MipMap2D.java │ │ └── MipMap2DRenderer.java ├── Ch9_Simple_Texture2D │ ├── .classpath │ ├── .project │ ├── AndroidManifest.xml │ ├── default.properties │ ├── proguard.cfg │ ├── res │ │ ├── drawable-hdpi │ │ │ └── icon.png │ │ ├── drawable-ldpi │ │ │ └── icon.png │ │ ├── drawable-mdpi │ │ │ └── icon.png │ │ ├── layout │ │ │ └── main.xml │ │ └── values │ │ │ └── strings.xml │ └── src │ │ └── com │ │ └── openglesbook │ │ └── simpletexture2d │ │ ├── SimpleTexture2D.java │ │ └── SimpleTexture2DRenderer.java ├── Ch9_Simple_TextureCubemap │ ├── .classpath │ ├── .project │ ├── AndroidManifest.xml │ ├── default.properties │ ├── proguard.cfg │ ├── res │ │ ├── drawable-hdpi │ │ │ └── icon.png │ │ ├── drawable-ldpi │ │ │ └── icon.png │ │ ├── drawable-mdpi │ │ │ └── icon.png │ │ ├── layout │ │ │ └── main.xml │ │ └── values │ │ │ └── strings.xml │ └── src │ │ └── com │ │ └── openglesbook │ │ └── simpletexturecubemap │ │ ├── SimpleTextureCubemap.java │ │ └── SimpleTextureCubemapRenderer.java ├── Ch9_TextureWrap │ ├── .classpath │ ├── .project │ ├── AndroidManifest.xml │ ├── default.properties │ ├── proguard.cfg │ ├── res │ │ ├── drawable-hdpi │ │ │ └── icon.png │ │ ├── drawable-ldpi │ │ │ └── icon.png │ │ ├── drawable-mdpi │ │ │ └── icon.png │ │ ├── layout │ │ │ └── main.xml │ │ └── values │ │ │ └── strings.xml │ └── src │ │ └── com │ │ └── openglesbook │ │ └── texturewrap │ │ ├── TextureWrap.java │ │ └── TextureWrapRenderer.java └── Common │ ├── .classpath │ ├── .project │ ├── .settings │ └── org.eclipse.jdt.core.prefs │ ├── AndroidManifest.xml │ ├── default.properties │ ├── proguard.cfg │ ├── res │ ├── drawable-hdpi │ │ └── icon.png │ ├── drawable-ldpi │ │ └── icon.png │ ├── drawable-mdpi │ │ └── icon.png │ ├── layout │ │ └── main.xml │ └── values │ │ └── strings.xml │ └── src │ └── com │ └── openglesbook │ └── common │ ├── ESShader.java │ ├── ESShapes.java │ └── ESTransform.java ├── BlackBerry ├── Ch10_MultiTexture │ ├── .cproject │ ├── .project │ ├── bar-descriptor.xml │ ├── icon.png │ ├── res │ │ └── textures │ │ │ ├── basemap.tga │ │ │ └── lightmap.tga │ └── src │ │ └── MultiTexture.c ├── Ch11_Stencil_Test │ ├── .cproject │ ├── .project │ ├── bar-descriptor.xml │ ├── icon.png │ └── src │ │ └── Stencil_Test.c ├── Ch13_ParticleSystem │ ├── .cproject │ ├── .project │ ├── bar-descriptor.xml │ ├── icon.png │ ├── res │ │ └── textures │ │ │ └── smoke.tga │ └── src │ │ └── ParticleSystem.c ├── Ch2_Hello_Triangle │ ├── .cproject │ ├── .project │ ├── bar-descriptor.xml │ ├── icon.png │ └── src │ │ └── Hello_Triangle.c ├── Ch8_Simple_VertexShader │ ├── .cproject │ ├── .project │ ├── bar-descriptor.xml │ ├── icon.png │ └── src │ │ └── Simple_VertexShader.c ├── Ch9_MipMap2D │ ├── .cproject │ ├── .project │ ├── bar-descriptor.xml │ ├── icon.png │ └── src │ │ └── MipMap2D.c ├── Ch9_Simple_Texture2D │ ├── .cproject │ ├── .project │ ├── bar-descriptor.xml │ ├── icon.png │ └── src │ │ └── Simple_Texture2D.c ├── Ch9_Simple_TextureCubemap │ ├── .cproject │ ├── .project │ ├── bar-descriptor.xml │ ├── icon.png │ └── src │ │ └── Simple_TextureCubemap.c ├── Ch9_TextureWrap │ ├── .cproject │ ├── .project │ ├── bar-descriptor.xml │ ├── icon.png │ └── src │ │ └── TextureWrap.c ├── Common │ ├── .cproject │ ├── .project │ └── src │ │ ├── esShader.c │ │ ├── esShapes.c │ │ ├── esTransform.c │ │ ├── esUtil.c │ │ ├── esUtil.h │ │ ├── esUtil_TGA.c │ │ ├── esUtil_qnx.c │ │ └── esUtil_qnx.h ├── LICENSE └── README.md ├── LICENSE.md ├── LinuxX11 ├── Chapter_10 │ └── MultiTexture │ │ ├── MultiTexture.c │ │ ├── basemap.tga │ │ └── lightmap.tga ├── Chapter_11 │ ├── Multisample │ │ └── Multisample.c │ └── Stencil_Test │ │ └── Stencil_Test.c ├── Chapter_13 │ └── ParticleSystem │ │ ├── ParticleSystem.c │ │ └── smoke.tga ├── Chapter_15 │ └── Hello_Triangle_KD │ │ └── Hello_Triangle_KD.c ├── Chapter_2 │ └── Hello_Triangle │ │ └── Hello_Triangle.c ├── Chapter_8 │ └── Simple_VertexShader │ │ └── Simple_VertexShader.c ├── Chapter_9 │ ├── MipMap2D │ │ └── MipMap2D.c │ ├── Simple_Texture2D │ │ └── Simple_Texture2D.c │ ├── Simple_TextureCubemap │ │ └── Simple_TextureCubemap.c │ └── TextureWrap │ │ └── TextureWrap.c ├── Common │ ├── esShader.c │ ├── esShapes.c │ ├── esTransform.c │ ├── esUtil.c │ └── esUtil.h ├── Makefile └── README.linux ├── README.md ├── WebGL ├── Chapter_10 │ └── MultiTexture │ │ ├── MultiTexture.html │ │ ├── basemap.gif │ │ └── lightmap.gif ├── Chapter_11 │ └── Stencil_Test │ │ └── Stencil_Test.html ├── Chapter_13 │ └── ParticleSystem │ │ ├── ParticleSystem.html │ │ └── smoke.gif ├── Chapter_2 │ └── Hello_Triangle │ │ └── Hello_Triangle.html ├── Chapter_8 │ └── Simple_VertexShader │ │ └── Simple_VertexShader.html ├── Chapter_9 │ ├── MipMap2D │ │ └── MipMap2D.html │ ├── Simple_Texture2D │ │ └── Simple_Texture2D.html │ ├── Simple_TextureCubemap │ │ └── Simple_TextureCubemap.html │ └── TextureWrap │ │ └── TextureWrap.html └── Common │ ├── esShader.js │ ├── esShapes.js │ ├── esTransform.js │ └── esUtil.js ├── Windows ├── Bin │ ├── README.TXT │ ├── basemap.tga │ ├── lightmap.tga │ └── smoke.tga ├── Chapter_10 │ ├── MultiTexture │ │ ├── MultiTexture.c │ │ ├── MultiTexture.sln │ │ ├── MultiTexture.vcproj │ │ ├── basemap.tga │ │ └── lightmap.tga │ ├── RM_AlphaTest │ │ ├── RM_AlphaTest.rfx │ │ ├── Torus.3ds │ │ └── cloud.tga │ ├── RM_ClipPlane │ │ ├── RM_ClipPlane.rfx │ │ └── Sphere.3ds │ └── RM_LinearFog │ │ ├── LinearFog.rfx │ │ ├── Terrain.3ds │ │ └── Terrain.tga ├── Chapter_11 │ ├── Multisample │ │ ├── Multisample.c │ │ ├── Multisample.sln │ │ └── Multisample.vcproj │ └── Stencil_Test │ │ ├── Stencil_Test.c │ │ ├── Stencil_Test.sln │ │ └── Stencil_Test.vcproj ├── Chapter_13 │ ├── EnvironmentMapping │ │ ├── EnvironmentMapping.rfx │ │ ├── Fieldstone.tga │ │ ├── FieldstoneBumpDOT3.tga │ │ ├── Snow.dds │ │ ├── Sphere.3ds │ │ └── Teapot.3ds │ ├── Noise3D │ │ ├── Noise3D.rfx │ │ ├── NoiseVolume.dds │ │ ├── SkyDome.3ds │ │ ├── Terrain.3ds │ │ ├── Terrain.tga │ │ └── generatenoise.c │ ├── ParticleSystem │ │ ├── ParticleSystem.c │ │ ├── ParticleSystem.sln │ │ ├── ParticleSystem.vcproj │ │ └── smoke.tga │ ├── PerFragmentLighting │ │ ├── Fieldstone.tga │ │ ├── FieldstoneBumpDOT3.tga │ │ ├── PerFragmentLighting.rfx │ │ └── Torus.3ds │ ├── PostProcess │ │ ├── Car.3ds │ │ ├── Cube.x │ │ ├── Fieldstone.tga │ │ ├── PostProcess.rfx │ │ └── ScreenAlignedQuad.3ds │ ├── ProceduralTextures │ │ ├── Checker.rfx │ │ ├── CheckerAA.rfx │ │ ├── ProceduralTextures.rfx │ │ ├── ScreenAlignedQuad.3ds │ │ ├── checker.fs │ │ ├── checker.tiff │ │ └── checker.vs │ └── ProjectiveSpotlight │ │ ├── Corona.tga │ │ ├── ProjectiveSpotlight.rfx │ │ ├── Terrain.3ds │ │ └── Terrain.tga ├── Chapter_15 │ └── Hello_Triangle_KD │ │ ├── Hello_Triangle_KD.c │ │ ├── Hello_Triangle_KD.sln │ │ └── Hello_Triangle_KD.vcproj ├── Chapter_2 │ └── Hello_Triangle │ │ ├── Hello_Triangle.c │ │ ├── Hello_Triangle.sln │ │ └── Hello_Triangle.vcproj ├── Chapter_8 │ └── Simple_VertexShader │ │ ├── Simple_VertexShader.c │ │ ├── Simple_VertexShader.sln │ │ └── Simple_VertexShader.vcproj ├── Chapter_9 │ ├── MipMap2D │ │ ├── MipMap2D.c │ │ ├── MipMap2D.sln │ │ └── MipMap2D.vcproj │ ├── Simple_Texture2D │ │ ├── Simple_Texture2D.c │ │ ├── Simple_Texture2D.sln │ │ └── Simple_Texture2D.vcproj │ ├── Simple_TextureCubemap │ │ ├── Simple_TextureCubemap.c │ │ ├── Simple_TextureCubemap.sln │ │ └── Simple_TextureCubemap.vcproj │ └── TextureWrap │ │ ├── TextureWrap.c │ │ ├── TextureWrap.sln │ │ └── TextureWrap.vcproj ├── Common │ ├── Doc │ │ ├── Doxyfile │ │ └── html │ │ │ ├── annotated.html │ │ │ ├── classes.html │ │ │ ├── doxygen.css │ │ │ ├── doxygen.png │ │ │ ├── egl_8h-source.html │ │ │ ├── egl_8h.html │ │ │ ├── eglplatform_8h-source.html │ │ │ ├── eglplatform_8h.html │ │ │ ├── egltypes_8h-source.html │ │ │ ├── egltypes_8h.html │ │ │ ├── esShader_8c.html │ │ │ ├── esShapes_8c.html │ │ │ ├── esTransform_8c.html │ │ │ ├── esUtil_8c.html │ │ │ ├── esUtil_8h-source.html │ │ │ ├── esUtil_8h.html │ │ │ ├── esUtil__win32_8c.html │ │ │ ├── esUtil__win_8h-source.html │ │ │ ├── esUtil__win_8h.html │ │ │ ├── files.html │ │ │ ├── functions.html │ │ │ ├── functions_func.html │ │ │ ├── functions_vars.html │ │ │ ├── gl2_8h-source.html │ │ │ ├── gl2_8h.html │ │ │ ├── gl2ext_8h-source.html │ │ │ ├── gl2ext_8h.html │ │ │ ├── globals.html │ │ │ ├── globals_defs.html │ │ │ ├── globals_func.html │ │ │ ├── globals_type.html │ │ │ ├── globals_vars.html │ │ │ ├── index.html │ │ │ ├── structESContext.html │ │ │ ├── structESMatrix.html │ │ │ └── structTGA__HEADER.html │ ├── Include │ │ ├── EGL │ │ │ ├── egl.h │ │ │ └── eglplatform.h │ │ ├── GLES2 │ │ │ ├── gl2.h │ │ │ ├── gl2ext.h │ │ │ └── gl2platform.h │ │ ├── KD │ │ │ ├── KHR_thread_storage.h │ │ │ ├── kd.h │ │ │ └── kdplatform.h │ │ ├── esUtil.h │ │ └── esUtil_win.h │ ├── Lib │ │ ├── esUtil.lib │ │ └── esUtil_d.lib │ ├── Source │ │ ├── Win32 │ │ │ ├── esUtil_TGA.c │ │ │ └── esUtil_win32.c │ │ ├── esShader.c │ │ ├── esShapes.c │ │ ├── esTransform.c │ │ └── esUtil.c │ ├── esUtil.sln │ ├── esUtil.suo │ └── esUtil.vcproj ├── Lib │ └── README.TXT └── README.TXT └── iPhone ├── Chapter_10 └── MultiTexture │ ├── Classes │ ├── EAGLView.h │ ├── EAGLView.m │ ├── MultiTextureAppDelegate.h │ └── MultiTextureAppDelegate.m │ ├── MainWindow.xib │ ├── MultiTexture-Info.plist │ ├── MultiTexture.c │ ├── MultiTexture.xcodeproj │ └── project.pbxproj │ ├── MultiTexture_Prefix.pch │ ├── basemap.png │ ├── lightmap.png │ └── main.m ├── Chapter_11 └── Stencil_Test │ ├── Classes │ ├── EAGLView.h │ ├── EAGLView.m │ ├── Stencil_TestAppDelegate.h │ └── Stencil_TestAppDelegate.m │ ├── MainWindow.xib │ ├── Stencil_Test-Info.plist │ ├── Stencil_Test.c │ ├── Stencil_Test.xcodeproj │ └── project.pbxproj │ ├── Stencil_Test_Prefix.pch │ └── main.m ├── Chapter_13 └── ParticleSystem │ ├── Classes │ ├── EAGLView.h │ ├── EAGLView.m │ ├── ParticleSystemAppDelegate.h │ └── ParticleSystemAppDelegate.m │ ├── MainWindow.xib │ ├── ParticleSystem-Info.plist │ ├── ParticleSystem.c │ ├── ParticleSystem.xcodeproj │ └── project.pbxproj │ ├── ParticleSystem_Prefix.pch │ ├── main.m │ └── smoke.png ├── Chapter_2 └── Hello_Triangle │ ├── Classes │ ├── EAGLView.h │ ├── EAGLView.m │ ├── Hello_TriangleAppDelegate.h │ └── Hello_TriangleAppDelegate.m │ ├── Hello_Triangle-Info.plist │ ├── Hello_Triangle.c │ ├── Hello_Triangle.xcodeproj │ └── project.pbxproj │ ├── Hello_Triangle_Prefix.pch │ ├── MainWindow.xib │ └── main.m ├── Chapter_8 └── Simple_VertexShader │ ├── Classes │ ├── EAGLView.h │ ├── EAGLView.m │ ├── Simple_VertexShaderAppDelegate.h │ └── Simple_VertexShaderAppDelegate.m │ ├── MainWindow.xib │ ├── Simple_VertexShader-Info.plist │ ├── Simple_VertexShader.c │ ├── Simple_VertexShader.xcodeproj │ └── project.pbxproj │ ├── Simple_VertexShader_Prefix.pch │ └── main.m ├── Chapter_9 ├── MipMap2D │ ├── Classes │ │ ├── EAGLView.h │ │ ├── EAGLView.m │ │ ├── MipMap2DAppDelegate.h │ │ └── MipMap2DAppDelegate.m │ ├── MainWindow.xib │ ├── MipMap2D-Info.plist │ ├── MipMap2D.c │ ├── MipMap2D.xcodeproj │ │ └── project.pbxproj │ ├── MipMap2D_Prefix.pch │ └── main.m ├── Simple_Texture2D │ ├── Classes │ │ ├── EAGLView.h │ │ ├── EAGLView.m │ │ ├── Simple_Texture2DAppDelegate.h │ │ └── Simple_Texture2DAppDelegate.m │ ├── MainWindow.xib │ ├── Simple_Texture2D-Info.plist │ ├── Simple_Texture2D.c │ ├── Simple_Texture2D.xcodeproj │ │ └── project.pbxproj │ ├── Simple_Texture2D_Prefix.pch │ └── main.m ├── Simple_TextureCubemap │ ├── Classes │ │ ├── EAGLView.h │ │ ├── EAGLView.m │ │ ├── Simple_TextureCubemapAppDelegate.h │ │ └── Simple_TextureCubemapAppDelegate.m │ ├── MainWindow.xib │ ├── Simple_TextureCubemap-Info.plist │ ├── Simple_TextureCubemap.c │ ├── Simple_TextureCubemap.xcodeproj │ │ └── project.pbxproj │ ├── Simple_TextureCubemap_Prefix.pch │ └── main.m └── TextureWrap │ ├── Classes │ ├── EAGLView.h │ ├── EAGLView.m │ ├── TextureWrapAppDelegate.h │ └── TextureWrapAppDelegate.m │ ├── MainWindow.xib │ ├── TextureWrap-Info.plist │ ├── TextureWrap.c │ ├── TextureWrap.xcodeproj │ └── project.pbxproj │ ├── TextureWrap_Prefix.pch │ └── main.m └── Common ├── Common.xcodeproj └── project.pbxproj ├── Common_Prefix.pch ├── ImageUtils.m ├── esShader.c ├── esShapes.c ├── esTransform.c ├── esUtil.c └── esUtil.h /Android/Ch10_MultiTexture/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Android/Ch10_MultiTexture/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ch10_MultiTexture 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | 35 | Common_src 36 | 2 37 | _android_Common_78a4160b/src 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Android/Ch10_MultiTexture/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Android/Ch10_MultiTexture/default.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "build.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-8 12 | android.library.reference.1=../Common/ 13 | -------------------------------------------------------------------------------- /Android/Ch10_MultiTexture/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class com.android.vending.licensing.ILicensingService 14 | 15 | -keepclasseswithmembernames class * { 16 | native ; 17 | } 18 | 19 | -keepclasseswithmembernames class * { 20 | public (android.content.Context, android.util.AttributeSet); 21 | } 22 | 23 | -keepclasseswithmembernames class * { 24 | public (android.content.Context, android.util.AttributeSet, int); 25 | } 26 | 27 | -keepclassmembers enum * { 28 | public static **[] values(); 29 | public static ** valueOf(java.lang.String); 30 | } 31 | 32 | -keep class * implements android.os.Parcelable { 33 | public static final android.os.Parcelable$Creator *; 34 | } 35 | -------------------------------------------------------------------------------- /Android/Ch10_MultiTexture/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch10_MultiTexture/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /Android/Ch10_MultiTexture/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch10_MultiTexture/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /Android/Ch10_MultiTexture/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch10_MultiTexture/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /Android/Ch10_MultiTexture/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /Android/Ch10_MultiTexture/res/raw/basemap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch10_MultiTexture/res/raw/basemap.png -------------------------------------------------------------------------------- /Android/Ch10_MultiTexture/res/raw/lightmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch10_MultiTexture/res/raw/lightmap.png -------------------------------------------------------------------------------- /Android/Ch10_MultiTexture/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello World, MultiTexture! 4 | Ch10_MultiTexture 5 | 6 | -------------------------------------------------------------------------------- /Android/Ch10_MultiTexture/src/com/openglesbook/multitexture/MultiTexture.java: -------------------------------------------------------------------------------- 1 | package com.openglesbook.multitexture; 2 | 3 | import android.app.Activity; 4 | import android.app.ActivityManager; 5 | import android.content.Context; 6 | import android.content.pm.ConfigurationInfo; 7 | import android.opengl.GLSurfaceView; 8 | import android.os.Bundle; 9 | import android.util.Log; 10 | 11 | /** 12 | * Activity class for example program that detects OpenGL ES 2.0. 13 | **/ 14 | public class MultiTexture extends Activity { 15 | @Override 16 | protected void onCreate(Bundle savedInstanceState) 17 | { 18 | super.onCreate(savedInstanceState); 19 | mGLSurfaceView = new GLSurfaceView(this); 20 | if (detectOpenGLES20()) 21 | { 22 | // Tell the surface view we want to create an OpenGL ES 2.0-compatible 23 | // context, and set an OpenGL ES 2.0-compatible renderer. 24 | mGLSurfaceView.setEGLContextClientVersion(2); 25 | mGLSurfaceView.setRenderer(new MultiTextureRenderer(this)); 26 | } 27 | else 28 | { 29 | Log.e("MultiTexture", "OpenGL ES 2.0 not supported on device. Exiting..."); 30 | finish(); 31 | 32 | } 33 | setContentView(mGLSurfaceView); 34 | } 35 | 36 | private boolean detectOpenGLES20() 37 | { 38 | ActivityManager am = 39 | (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); 40 | ConfigurationInfo info = am.getDeviceConfigurationInfo(); 41 | return (info.reqGlEsVersion >= 0x20000); 42 | } 43 | 44 | @Override 45 | protected void onResume() 46 | { 47 | // Ideally a game should implement onResume() and onPause() 48 | // to take appropriate action when the activity looses focus 49 | super.onResume(); 50 | mGLSurfaceView.onResume(); 51 | } 52 | 53 | @Override 54 | protected void onPause() 55 | { 56 | // Ideally a game should implement onResume() and onPause() 57 | // to take appropriate action when the activity looses focus 58 | super.onPause(); 59 | mGLSurfaceView.onPause(); 60 | } 61 | 62 | private GLSurfaceView mGLSurfaceView; 63 | } 64 | -------------------------------------------------------------------------------- /Android/Ch11_Stencil_Test/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Android/Ch11_Stencil_Test/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ch11_Stencil_Test 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | 35 | Common_src 36 | 2 37 | _android_Common_78a4160b/src 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Android/Ch11_Stencil_Test/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Android/Ch11_Stencil_Test/default.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "build.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-8 12 | android.library.reference.1=../Common/ 13 | -------------------------------------------------------------------------------- /Android/Ch11_Stencil_Test/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class com.android.vending.licensing.ILicensingService 14 | 15 | -keepclasseswithmembernames class * { 16 | native ; 17 | } 18 | 19 | -keepclasseswithmembernames class * { 20 | public (android.content.Context, android.util.AttributeSet); 21 | } 22 | 23 | -keepclasseswithmembernames class * { 24 | public (android.content.Context, android.util.AttributeSet, int); 25 | } 26 | 27 | -keepclassmembers enum * { 28 | public static **[] values(); 29 | public static ** valueOf(java.lang.String); 30 | } 31 | 32 | -keep class * implements android.os.Parcelable { 33 | public static final android.os.Parcelable$Creator *; 34 | } 35 | -------------------------------------------------------------------------------- /Android/Ch11_Stencil_Test/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch11_Stencil_Test/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /Android/Ch11_Stencil_Test/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch11_Stencil_Test/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /Android/Ch11_Stencil_Test/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch11_Stencil_Test/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /Android/Ch11_Stencil_Test/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /Android/Ch11_Stencil_Test/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello World, StencilTest! 4 | Ch11_Stencil_Test 5 | 6 | -------------------------------------------------------------------------------- /Android/Ch11_Stencil_Test/src/com/openglesbook/stenciltest/StencilTest.java: -------------------------------------------------------------------------------- 1 | package com.openglesbook.stenciltest; 2 | 3 | import android.app.Activity; 4 | import android.app.ActivityManager; 5 | import android.content.Context; 6 | import android.content.pm.ConfigurationInfo; 7 | import android.opengl.GLSurfaceView; 8 | import android.os.Bundle; 9 | import android.util.Log; 10 | 11 | /** 12 | * Activity class for example program that detects OpenGL ES 2.0. 13 | **/ 14 | public class StencilTest extends Activity { 15 | @Override 16 | protected void onCreate(Bundle savedInstanceState) 17 | { 18 | super.onCreate(savedInstanceState); 19 | mGLSurfaceView = new GLSurfaceView(this); 20 | if (detectOpenGLES20()) 21 | { 22 | // Tell the surface view we want to create an OpenGL ES 2.0-compatible 23 | // context, and set an OpenGL ES 2.0-compatible renderer. 24 | mGLSurfaceView.setEGLContextClientVersion(2); 25 | // Request an 565 Color buffer with 16-bit depth and 8-bit stencil 26 | mGLSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8); 27 | mGLSurfaceView.setRenderer(new StencilTestRenderer(this)); 28 | } 29 | else 30 | { 31 | Log.e("StencilTest", "OpenGL ES 2.0 not supported on device. Exiting..."); 32 | finish(); 33 | 34 | } 35 | setContentView(mGLSurfaceView); 36 | } 37 | 38 | private boolean detectOpenGLES20() 39 | { 40 | ActivityManager am = 41 | (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); 42 | ConfigurationInfo info = am.getDeviceConfigurationInfo(); 43 | return (info.reqGlEsVersion >= 0x20000); 44 | } 45 | 46 | @Override 47 | protected void onResume() 48 | { 49 | // Ideally a game should implement onResume() and onPause() 50 | // to take appropriate action when the activity looses focus 51 | super.onResume(); 52 | mGLSurfaceView.onResume(); 53 | } 54 | 55 | @Override 56 | protected void onPause() 57 | { 58 | // Ideally a game should implement onResume() and onPause() 59 | // to take appropriate action when the activity looses focus 60 | super.onPause(); 61 | mGLSurfaceView.onPause(); 62 | } 63 | 64 | private GLSurfaceView mGLSurfaceView; 65 | } 66 | -------------------------------------------------------------------------------- /Android/Ch13_ParticleSystem/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Android/Ch13_ParticleSystem/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ch13_ParticleSystem 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | 35 | Common_src 36 | 2 37 | _android_Common_78a4160b/src 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Android/Ch13_ParticleSystem/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Android/Ch13_ParticleSystem/default.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "build.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-8 12 | android.library.reference.1=../Common/ 13 | -------------------------------------------------------------------------------- /Android/Ch13_ParticleSystem/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class com.android.vending.licensing.ILicensingService 14 | 15 | -keepclasseswithmembernames class * { 16 | native ; 17 | } 18 | 19 | -keepclasseswithmembernames class * { 20 | public (android.content.Context, android.util.AttributeSet); 21 | } 22 | 23 | -keepclasseswithmembernames class * { 24 | public (android.content.Context, android.util.AttributeSet, int); 25 | } 26 | 27 | -keepclassmembers enum * { 28 | public static **[] values(); 29 | public static ** valueOf(java.lang.String); 30 | } 31 | 32 | -keep class * implements android.os.Parcelable { 33 | public static final android.os.Parcelable$Creator *; 34 | } 35 | -------------------------------------------------------------------------------- /Android/Ch13_ParticleSystem/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch13_ParticleSystem/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /Android/Ch13_ParticleSystem/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch13_ParticleSystem/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /Android/Ch13_ParticleSystem/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch13_ParticleSystem/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /Android/Ch13_ParticleSystem/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /Android/Ch13_ParticleSystem/res/raw/smoke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch13_ParticleSystem/res/raw/smoke.png -------------------------------------------------------------------------------- /Android/Ch13_ParticleSystem/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello World, ParticleSystem! 4 | Ch13_ParticleSystem 5 | 6 | -------------------------------------------------------------------------------- /Android/Ch13_ParticleSystem/src/com/openglesbook/particlesystem/ParticleSystem.java: -------------------------------------------------------------------------------- 1 | package com.openglesbook.particlesystem; 2 | 3 | import android.app.Activity; 4 | import android.app.ActivityManager; 5 | import android.content.Context; 6 | import android.content.pm.ConfigurationInfo; 7 | import android.opengl.GLSurfaceView; 8 | import android.os.Bundle; 9 | import android.util.Log; 10 | 11 | /** 12 | * Activity class for example program that detects OpenGL ES 2.0. 13 | **/ 14 | public class ParticleSystem extends Activity { 15 | @Override 16 | protected void onCreate(Bundle savedInstanceState) 17 | { 18 | super.onCreate(savedInstanceState); 19 | mGLSurfaceView = new GLSurfaceView(this); 20 | if (detectOpenGLES20()) 21 | { 22 | // Tell the surface view we want to create an OpenGL ES 2.0-compatible 23 | // context, and set an OpenGL ES 2.0-compatible renderer. 24 | mGLSurfaceView.setEGLContextClientVersion(2); 25 | mGLSurfaceView.setRenderer(new ParticleSystemRenderer(this)); 26 | } 27 | else 28 | { 29 | Log.e("ParticleSystem", "OpenGL ES 2.0 not supported on device. Exiting..."); 30 | finish(); 31 | 32 | } 33 | setContentView(mGLSurfaceView); 34 | } 35 | 36 | private boolean detectOpenGLES20() 37 | { 38 | ActivityManager am = 39 | (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); 40 | ConfigurationInfo info = am.getDeviceConfigurationInfo(); 41 | return (info.reqGlEsVersion >= 0x20000); 42 | } 43 | 44 | @Override 45 | protected void onResume() 46 | { 47 | // Ideally a game should implement onResume() and onPause() 48 | // to take appropriate action when the activity looses focus 49 | super.onResume(); 50 | mGLSurfaceView.onResume(); 51 | } 52 | 53 | @Override 54 | protected void onPause() 55 | { 56 | // Ideally a game should implement onResume() and onPause() 57 | // to take appropriate action when the activity looses focus 58 | super.onPause(); 59 | mGLSurfaceView.onPause(); 60 | } 61 | 62 | private GLSurfaceView mGLSurfaceView; 63 | } 64 | -------------------------------------------------------------------------------- /Android/Ch2_Hello_Triangle/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Android/Ch2_Hello_Triangle/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ch2_Hello_Triangle 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | 35 | Common_src 36 | 2 37 | _android_Common_78a4160b/src 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Android/Ch2_Hello_Triangle/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Sun Dec 26 16:30:58 EST 2010 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 4 | org.eclipse.jdt.core.compiler.compliance=1.5 5 | org.eclipse.jdt.core.compiler.source=1.5 6 | -------------------------------------------------------------------------------- /Android/Ch2_Hello_Triangle/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Android/Ch2_Hello_Triangle/default.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "build.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-8 12 | android.library.reference.1=../Common/ 13 | -------------------------------------------------------------------------------- /Android/Ch2_Hello_Triangle/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class com.android.vending.licensing.ILicensingService 14 | 15 | -keepclasseswithmembernames class * { 16 | native ; 17 | } 18 | 19 | -keepclasseswithmembernames class * { 20 | public (android.content.Context, android.util.AttributeSet); 21 | } 22 | 23 | -keepclasseswithmembernames class * { 24 | public (android.content.Context, android.util.AttributeSet, int); 25 | } 26 | 27 | -keepclassmembers enum * { 28 | public static **[] values(); 29 | public static ** valueOf(java.lang.String); 30 | } 31 | 32 | -keep class * implements android.os.Parcelable { 33 | public static final android.os.Parcelable$Creator *; 34 | } 35 | -------------------------------------------------------------------------------- /Android/Ch2_Hello_Triangle/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch2_Hello_Triangle/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /Android/Ch2_Hello_Triangle/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch2_Hello_Triangle/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /Android/Ch2_Hello_Triangle/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch2_Hello_Triangle/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /Android/Ch2_Hello_Triangle/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /Android/Ch2_Hello_Triangle/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello World, HelloTriangle! 4 | Ch2_Hello_Triangle 5 | 6 | -------------------------------------------------------------------------------- /Android/Ch2_Hello_Triangle/src/com/opengles/hellotriangle/HelloTriangle.java: -------------------------------------------------------------------------------- 1 | package com.opengles.hellotriangle; 2 | 3 | import android.app.Activity; 4 | import android.app.ActivityManager; 5 | import android.content.Context; 6 | import android.content.pm.ConfigurationInfo; 7 | import android.opengl.GLSurfaceView; 8 | import android.os.Bundle; 9 | import android.util.Log; 10 | 11 | /** 12 | * Activity class for example program that detects OpenGL ES 2.0. 13 | **/ 14 | public class HelloTriangle extends Activity { 15 | @Override 16 | protected void onCreate(Bundle savedInstanceState) 17 | { 18 | super.onCreate(savedInstanceState); 19 | mGLSurfaceView = new GLSurfaceView(this); 20 | if (detectOpenGLES20()) 21 | { 22 | // Tell the surface view we want to create an OpenGL ES 2.0-compatible 23 | // context, and set an OpenGL ES 2.0-compatible renderer. 24 | mGLSurfaceView.setEGLContextClientVersion(2); 25 | mGLSurfaceView.setRenderer(new HelloTriangleRenderer(this)); 26 | } 27 | else 28 | { 29 | Log.e("HelloTriangle", "OpenGL ES 2.0 not supported on device. Exiting..."); 30 | finish(); 31 | 32 | } 33 | setContentView(mGLSurfaceView); 34 | } 35 | 36 | private boolean detectOpenGLES20() 37 | { 38 | ActivityManager am = 39 | (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); 40 | ConfigurationInfo info = am.getDeviceConfigurationInfo(); 41 | return (info.reqGlEsVersion >= 0x20000); 42 | } 43 | 44 | @Override 45 | protected void onResume() 46 | { 47 | // Ideally a game should implement onResume() and onPause() 48 | // to take appropriate action when the activity looses focus 49 | super.onResume(); 50 | mGLSurfaceView.onResume(); 51 | } 52 | 53 | @Override 54 | protected void onPause() 55 | { 56 | // Ideally a game should implement onResume() and onPause() 57 | // to take appropriate action when the activity looses focus 58 | super.onPause(); 59 | mGLSurfaceView.onPause(); 60 | } 61 | 62 | private GLSurfaceView mGLSurfaceView; 63 | } 64 | -------------------------------------------------------------------------------- /Android/Ch8_Simple_VertexShader/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Android/Ch8_Simple_VertexShader/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ch8_Simple_VertexShader 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | 35 | Common_src 36 | 2 37 | _android_Common_78a4160b/src 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Android/Ch8_Simple_VertexShader/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Android/Ch8_Simple_VertexShader/default.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "build.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-8 12 | android.library.reference.1=../Common/ 13 | -------------------------------------------------------------------------------- /Android/Ch8_Simple_VertexShader/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class com.android.vending.licensing.ILicensingService 14 | 15 | -keepclasseswithmembernames class * { 16 | native ; 17 | } 18 | 19 | -keepclasseswithmembernames class * { 20 | public (android.content.Context, android.util.AttributeSet); 21 | } 22 | 23 | -keepclasseswithmembernames class * { 24 | public (android.content.Context, android.util.AttributeSet, int); 25 | } 26 | 27 | -keepclassmembers enum * { 28 | public static **[] values(); 29 | public static ** valueOf(java.lang.String); 30 | } 31 | 32 | -keep class * implements android.os.Parcelable { 33 | public static final android.os.Parcelable$Creator *; 34 | } 35 | -------------------------------------------------------------------------------- /Android/Ch8_Simple_VertexShader/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch8_Simple_VertexShader/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /Android/Ch8_Simple_VertexShader/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch8_Simple_VertexShader/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /Android/Ch8_Simple_VertexShader/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch8_Simple_VertexShader/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /Android/Ch8_Simple_VertexShader/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /Android/Ch8_Simple_VertexShader/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello World, SimpleVertexShader! 4 | SimpleVertexShader 5 | 6 | -------------------------------------------------------------------------------- /Android/Ch8_Simple_VertexShader/src/com/opengles/simplevertexshader/SimpleVertexShader.java: -------------------------------------------------------------------------------- 1 | package com.opengles.simplevertexshader; 2 | 3 | import android.app.Activity; 4 | import android.app.ActivityManager; 5 | import android.content.Context; 6 | import android.content.pm.ConfigurationInfo; 7 | import android.opengl.GLSurfaceView; 8 | import android.os.Bundle; 9 | import android.util.Log; 10 | 11 | /** 12 | * Activity class for example program that detects OpenGL ES 2.0. 13 | **/ 14 | public class SimpleVertexShader extends Activity { 15 | @Override 16 | protected void onCreate(Bundle savedInstanceState) 17 | { 18 | super.onCreate(savedInstanceState); 19 | mGLSurfaceView = new GLSurfaceView(this); 20 | if (detectOpenGLES20()) 21 | { 22 | // Tell the surface view we want to create an OpenGL ES 2.0-compatible 23 | // context, and set an OpenGL ES 2.0-compatible renderer. 24 | mGLSurfaceView.setEGLContextClientVersion(2); 25 | mGLSurfaceView.setRenderer(new SimpleVertexShaderRenderer(this)); 26 | } 27 | else 28 | { 29 | Log.e("HelloTriangle", "OpenGL ES 2.0 not supported on device. Exiting..."); 30 | finish(); 31 | 32 | } 33 | setContentView(mGLSurfaceView); 34 | } 35 | 36 | private boolean detectOpenGLES20() 37 | { 38 | ActivityManager am = 39 | (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); 40 | ConfigurationInfo info = am.getDeviceConfigurationInfo(); 41 | return (info.reqGlEsVersion >= 0x20000); 42 | } 43 | 44 | @Override 45 | protected void onResume() 46 | { 47 | // Ideally a game should implement onResume() and onPause() 48 | // to take appropriate action when the activity looses focus 49 | super.onResume(); 50 | mGLSurfaceView.onResume(); 51 | } 52 | 53 | @Override 54 | protected void onPause() 55 | { 56 | // Ideally a game should implement onResume() and onPause() 57 | // to take appropriate action when the activity looses focus 58 | super.onPause(); 59 | mGLSurfaceView.onPause(); 60 | } 61 | 62 | private GLSurfaceView mGLSurfaceView; 63 | } 64 | -------------------------------------------------------------------------------- /Android/Ch9_MipMap2D/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Android/Ch9_MipMap2D/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ch9_MipMap2D 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | 35 | Common_src 36 | 2 37 | _android_Common_78a4160b/src 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Android/Ch9_MipMap2D/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Android/Ch9_MipMap2D/default.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "build.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-8 12 | android.library.reference.1=../Common/ 13 | -------------------------------------------------------------------------------- /Android/Ch9_MipMap2D/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class com.android.vending.licensing.ILicensingService 14 | 15 | -keepclasseswithmembernames class * { 16 | native ; 17 | } 18 | 19 | -keepclasseswithmembernames class * { 20 | public (android.content.Context, android.util.AttributeSet); 21 | } 22 | 23 | -keepclasseswithmembernames class * { 24 | public (android.content.Context, android.util.AttributeSet, int); 25 | } 26 | 27 | -keepclassmembers enum * { 28 | public static **[] values(); 29 | public static ** valueOf(java.lang.String); 30 | } 31 | 32 | -keep class * implements android.os.Parcelable { 33 | public static final android.os.Parcelable$Creator *; 34 | } 35 | -------------------------------------------------------------------------------- /Android/Ch9_MipMap2D/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch9_MipMap2D/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /Android/Ch9_MipMap2D/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch9_MipMap2D/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /Android/Ch9_MipMap2D/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch9_MipMap2D/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /Android/Ch9_MipMap2D/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /Android/Ch9_MipMap2D/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello World, MipMap2D! 4 | Ch9_MipMap2D 5 | 6 | -------------------------------------------------------------------------------- /Android/Ch9_MipMap2D/src/com/openglesbook/mipmap2d/MipMap2D.java: -------------------------------------------------------------------------------- 1 | package com.openglesbook.mipmap2d; 2 | 3 | import android.app.Activity; 4 | import android.app.ActivityManager; 5 | import android.content.Context; 6 | import android.content.pm.ConfigurationInfo; 7 | import android.opengl.GLSurfaceView; 8 | import android.os.Bundle; 9 | import android.util.Log; 10 | 11 | /** 12 | * Activity class for example program that detects OpenGL ES 2.0. 13 | **/ 14 | public class MipMap2D extends Activity { 15 | @Override 16 | protected void onCreate(Bundle savedInstanceState) 17 | { 18 | super.onCreate(savedInstanceState); 19 | mGLSurfaceView = new GLSurfaceView(this); 20 | if (detectOpenGLES20()) 21 | { 22 | // Tell the surface view we want to create an OpenGL ES 2.0-compatible 23 | // context, and set an OpenGL ES 2.0-compatible renderer. 24 | mGLSurfaceView.setEGLContextClientVersion(2); 25 | mGLSurfaceView.setRenderer(new MipMap2DRenderer(this)); 26 | } 27 | else 28 | { 29 | Log.e("MipMap2D", "OpenGL ES 2.0 not supported on device. Exiting..."); 30 | finish(); 31 | } 32 | setContentView(mGLSurfaceView); 33 | } 34 | 35 | private boolean detectOpenGLES20() 36 | { 37 | ActivityManager am = 38 | (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); 39 | ConfigurationInfo info = am.getDeviceConfigurationInfo(); 40 | return (info.reqGlEsVersion >= 0x20000); 41 | } 42 | 43 | @Override 44 | protected void onResume() 45 | { 46 | // Ideally a game should implement onResume() and onPause() 47 | // to take appropriate action when the activity looses focus 48 | super.onResume(); 49 | mGLSurfaceView.onResume(); 50 | } 51 | 52 | @Override 53 | protected void onPause() 54 | { 55 | // Ideally a game should implement onResume() and onPause() 56 | // to take appropriate action when the activity looses focus 57 | super.onPause(); 58 | mGLSurfaceView.onPause(); 59 | } 60 | 61 | private GLSurfaceView mGLSurfaceView; 62 | } 63 | -------------------------------------------------------------------------------- /Android/Ch9_Simple_Texture2D/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Android/Ch9_Simple_Texture2D/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ch9_Simple_Texture2D 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | 35 | Common_src 36 | 2 37 | _android_Common_78a4160b/src 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Android/Ch9_Simple_Texture2D/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Android/Ch9_Simple_Texture2D/default.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "build.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-8 12 | android.library.reference.1=../Common/ 13 | -------------------------------------------------------------------------------- /Android/Ch9_Simple_Texture2D/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class com.android.vending.licensing.ILicensingService 14 | 15 | -keepclasseswithmembernames class * { 16 | native ; 17 | } 18 | 19 | -keepclasseswithmembernames class * { 20 | public (android.content.Context, android.util.AttributeSet); 21 | } 22 | 23 | -keepclasseswithmembernames class * { 24 | public (android.content.Context, android.util.AttributeSet, int); 25 | } 26 | 27 | -keepclassmembers enum * { 28 | public static **[] values(); 29 | public static ** valueOf(java.lang.String); 30 | } 31 | 32 | -keep class * implements android.os.Parcelable { 33 | public static final android.os.Parcelable$Creator *; 34 | } 35 | -------------------------------------------------------------------------------- /Android/Ch9_Simple_Texture2D/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch9_Simple_Texture2D/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /Android/Ch9_Simple_Texture2D/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch9_Simple_Texture2D/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /Android/Ch9_Simple_Texture2D/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch9_Simple_Texture2D/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /Android/Ch9_Simple_Texture2D/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /Android/Ch9_Simple_Texture2D/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello World, SimpleTexture2D! 4 | Ch9_Simple_Texture2D 5 | 6 | -------------------------------------------------------------------------------- /Android/Ch9_Simple_Texture2D/src/com/openglesbook/simpletexture2d/SimpleTexture2D.java: -------------------------------------------------------------------------------- 1 | package com.openglesbook.simpletexture2d; 2 | 3 | import android.app.Activity; 4 | import android.app.ActivityManager; 5 | import android.content.Context; 6 | import android.content.pm.ConfigurationInfo; 7 | import android.opengl.GLSurfaceView; 8 | import android.os.Bundle; 9 | import android.util.Log; 10 | 11 | /** 12 | * Activity class for example program that detects OpenGL ES 2.0. 13 | **/ 14 | public class SimpleTexture2D extends Activity { 15 | @Override 16 | protected void onCreate(Bundle savedInstanceState) 17 | { 18 | super.onCreate(savedInstanceState); 19 | mGLSurfaceView = new GLSurfaceView(this); 20 | if (detectOpenGLES20()) 21 | { 22 | // Tell the surface view we want to create an OpenGL ES 2.0-compatible 23 | // context, and set an OpenGL ES 2.0-compatible renderer. 24 | mGLSurfaceView.setEGLContextClientVersion(2); 25 | mGLSurfaceView.setRenderer(new SimpleTexture2DRenderer(this)); 26 | } 27 | else 28 | { 29 | Log.e("SimpleTexture2D", "OpenGL ES 2.0 not supported on device. Exiting..."); 30 | finish(); 31 | 32 | } 33 | setContentView(mGLSurfaceView); 34 | } 35 | 36 | private boolean detectOpenGLES20() 37 | { 38 | ActivityManager am = 39 | (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); 40 | ConfigurationInfo info = am.getDeviceConfigurationInfo(); 41 | return (info.reqGlEsVersion >= 0x20000); 42 | } 43 | 44 | @Override 45 | protected void onResume() 46 | { 47 | // Ideally a game should implement onResume() and onPause() 48 | // to take appropriate action when the activity looses focus 49 | super.onResume(); 50 | mGLSurfaceView.onResume(); 51 | } 52 | 53 | @Override 54 | protected void onPause() 55 | { 56 | // Ideally a game should implement onResume() and onPause() 57 | // to take appropriate action when the activity looses focus 58 | super.onPause(); 59 | mGLSurfaceView.onPause(); 60 | } 61 | 62 | private GLSurfaceView mGLSurfaceView; 63 | } 64 | -------------------------------------------------------------------------------- /Android/Ch9_Simple_TextureCubemap/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Android/Ch9_Simple_TextureCubemap/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ch9_SImple_TextureCubemap 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | 35 | Common_src 36 | 2 37 | _android_Common_78a4160b/src 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Android/Ch9_Simple_TextureCubemap/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Android/Ch9_Simple_TextureCubemap/default.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "build.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-8 12 | android.library.reference.1=../Common/ 13 | -------------------------------------------------------------------------------- /Android/Ch9_Simple_TextureCubemap/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class com.android.vending.licensing.ILicensingService 14 | 15 | -keepclasseswithmembernames class * { 16 | native ; 17 | } 18 | 19 | -keepclasseswithmembernames class * { 20 | public (android.content.Context, android.util.AttributeSet); 21 | } 22 | 23 | -keepclasseswithmembernames class * { 24 | public (android.content.Context, android.util.AttributeSet, int); 25 | } 26 | 27 | -keepclassmembers enum * { 28 | public static **[] values(); 29 | public static ** valueOf(java.lang.String); 30 | } 31 | 32 | -keep class * implements android.os.Parcelable { 33 | public static final android.os.Parcelable$Creator *; 34 | } 35 | -------------------------------------------------------------------------------- /Android/Ch9_Simple_TextureCubemap/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch9_Simple_TextureCubemap/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /Android/Ch9_Simple_TextureCubemap/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch9_Simple_TextureCubemap/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /Android/Ch9_Simple_TextureCubemap/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch9_Simple_TextureCubemap/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /Android/Ch9_Simple_TextureCubemap/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /Android/Ch9_Simple_TextureCubemap/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello World, SimpleTextureCubemap! 4 | Ch9_Simple_TextureCubemap 5 | 6 | -------------------------------------------------------------------------------- /Android/Ch9_Simple_TextureCubemap/src/com/openglesbook/simpletexturecubemap/SimpleTextureCubemap.java: -------------------------------------------------------------------------------- 1 | package com.openglesbook.simpletexturecubemap; 2 | 3 | import android.app.Activity; 4 | import android.app.ActivityManager; 5 | import android.content.Context; 6 | import android.content.pm.ConfigurationInfo; 7 | import android.opengl.GLSurfaceView; 8 | import android.os.Bundle; 9 | import android.util.Log; 10 | 11 | /** 12 | * Activity class for example program that detects OpenGL ES 2.0. 13 | **/ 14 | public class SimpleTextureCubemap extends Activity { 15 | @Override 16 | protected void onCreate(Bundle savedInstanceState) 17 | { 18 | super.onCreate(savedInstanceState); 19 | mGLSurfaceView = new GLSurfaceView(this); 20 | if (detectOpenGLES20()) 21 | { 22 | // Tell the surface view we want to create an OpenGL ES 2.0-compatible 23 | // context, and set an OpenGL ES 2.0-compatible renderer. 24 | mGLSurfaceView.setEGLContextClientVersion(2); 25 | mGLSurfaceView.setRenderer(new SimpleTextureCubemapRenderer(this)); 26 | } 27 | else 28 | { 29 | Log.e("SimpleTextureCubemap", "OpenGL ES 2.0 not supported on device. Exiting..."); 30 | finish(); 31 | } 32 | setContentView(mGLSurfaceView); 33 | } 34 | 35 | private boolean detectOpenGLES20() 36 | { 37 | ActivityManager am = 38 | (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); 39 | ConfigurationInfo info = am.getDeviceConfigurationInfo(); 40 | return (info.reqGlEsVersion >= 0x20000); 41 | } 42 | 43 | @Override 44 | protected void onResume() 45 | { 46 | // Ideally a game should implement onResume() and onPause() 47 | // to take appropriate action when the activity looses focus 48 | super.onResume(); 49 | mGLSurfaceView.onResume(); 50 | } 51 | 52 | @Override 53 | protected void onPause() 54 | { 55 | // Ideally a game should implement onResume() and onPause() 56 | // to take appropriate action when the activity looses focus 57 | super.onPause(); 58 | mGLSurfaceView.onPause(); 59 | } 60 | 61 | private GLSurfaceView mGLSurfaceView; 62 | } 63 | -------------------------------------------------------------------------------- /Android/Ch9_TextureWrap/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Android/Ch9_TextureWrap/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ch9_TextureWrap 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | 35 | Common_src 36 | 2 37 | _android_Common_78a4160b/src 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Android/Ch9_TextureWrap/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Android/Ch9_TextureWrap/default.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "build.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-8 12 | android.library.reference.1=../Common/ 13 | -------------------------------------------------------------------------------- /Android/Ch9_TextureWrap/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class com.android.vending.licensing.ILicensingService 14 | 15 | -keepclasseswithmembernames class * { 16 | native ; 17 | } 18 | 19 | -keepclasseswithmembernames class * { 20 | public (android.content.Context, android.util.AttributeSet); 21 | } 22 | 23 | -keepclasseswithmembernames class * { 24 | public (android.content.Context, android.util.AttributeSet, int); 25 | } 26 | 27 | -keepclassmembers enum * { 28 | public static **[] values(); 29 | public static ** valueOf(java.lang.String); 30 | } 31 | 32 | -keep class * implements android.os.Parcelable { 33 | public static final android.os.Parcelable$Creator *; 34 | } 35 | -------------------------------------------------------------------------------- /Android/Ch9_TextureWrap/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch9_TextureWrap/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /Android/Ch9_TextureWrap/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch9_TextureWrap/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /Android/Ch9_TextureWrap/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Ch9_TextureWrap/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /Android/Ch9_TextureWrap/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /Android/Ch9_TextureWrap/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello World, TextureWrap! 4 | Ch9_TextureWrap 5 | 6 | -------------------------------------------------------------------------------- /Android/Ch9_TextureWrap/src/com/openglesbook/texturewrap/TextureWrap.java: -------------------------------------------------------------------------------- 1 | package com.openglesbook.texturewrap; 2 | 3 | import android.app.Activity; 4 | import android.app.ActivityManager; 5 | import android.content.Context; 6 | import android.content.pm.ConfigurationInfo; 7 | import android.opengl.GLSurfaceView; 8 | import android.os.Bundle; 9 | import android.util.Log; 10 | 11 | /** 12 | * Activity class for example program that detects OpenGL ES 2.0. 13 | **/ 14 | public class TextureWrap extends Activity { 15 | @Override 16 | protected void onCreate(Bundle savedInstanceState) 17 | { 18 | super.onCreate(savedInstanceState); 19 | mGLSurfaceView = new GLSurfaceView(this); 20 | if (detectOpenGLES20()) 21 | { 22 | // Tell the surface view we want to create an OpenGL ES 2.0-compatible 23 | // context, and set an OpenGL ES 2.0-compatible renderer. 24 | mGLSurfaceView.setEGLContextClientVersion(2); 25 | mGLSurfaceView.setRenderer(new TextureWrapRenderer(this)); 26 | } 27 | else 28 | { 29 | Log.e("TextureWrap", "OpenGL ES 2.0 not supported on device. Exiting..."); 30 | finish(); 31 | } 32 | setContentView(mGLSurfaceView); 33 | } 34 | 35 | private boolean detectOpenGLES20() 36 | { 37 | ActivityManager am = 38 | (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); 39 | ConfigurationInfo info = am.getDeviceConfigurationInfo(); 40 | return (info.reqGlEsVersion >= 0x20000); 41 | } 42 | 43 | @Override 44 | protected void onResume() 45 | { 46 | // Ideally a game should implement onResume() and onPause() 47 | // to take appropriate action when the activity looses focus 48 | super.onResume(); 49 | mGLSurfaceView.onResume(); 50 | } 51 | 52 | @Override 53 | protected void onPause() 54 | { 55 | // Ideally a game should implement onResume() and onPause() 56 | // to take appropriate action when the activity looses focus 57 | super.onPause(); 58 | mGLSurfaceView.onPause(); 59 | } 60 | 61 | private GLSurfaceView mGLSurfaceView; 62 | } 63 | -------------------------------------------------------------------------------- /Android/Common/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Android/Common/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Common 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /Android/Common/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Sun Dec 26 15:58:59 EST 2010 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 4 | org.eclipse.jdt.core.compiler.compliance=1.5 5 | org.eclipse.jdt.core.compiler.source=1.5 6 | -------------------------------------------------------------------------------- /Android/Common/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Android/Common/default.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "build.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-8 12 | android.library=true 13 | -------------------------------------------------------------------------------- /Android/Common/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class com.android.vending.licensing.ILicensingService 14 | 15 | -keepclasseswithmembernames class * { 16 | native ; 17 | } 18 | 19 | -keepclasseswithmembernames class * { 20 | public (android.content.Context, android.util.AttributeSet); 21 | } 22 | 23 | -keepclasseswithmembernames class * { 24 | public (android.content.Context, android.util.AttributeSet, int); 25 | } 26 | 27 | -keepclassmembers enum * { 28 | public static **[] values(); 29 | public static ** valueOf(java.lang.String); 30 | } 31 | 32 | -keep class * implements android.os.Parcelable { 33 | public static final android.os.Parcelable$Creator *; 34 | } 35 | -------------------------------------------------------------------------------- /Android/Common/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Common/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /Android/Common/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Common/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /Android/Common/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Android/Common/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /Android/Common/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /Android/Common/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello World! 4 | Common 5 | 6 | -------------------------------------------------------------------------------- /BlackBerry/Ch10_MultiTexture/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ch10_MultiTexture 4 | 5 | 6 | Common 7 | 8 | 9 | 10 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 11 | clean,full,incremental, 12 | 13 | 14 | ?name? 15 | 16 | 17 | 18 | org.eclipse.cdt.make.core.append_environment 19 | true 20 | 21 | 22 | org.eclipse.cdt.make.core.buildArguments 23 | 24 | 25 | 26 | org.eclipse.cdt.make.core.buildCommand 27 | make 28 | 29 | 30 | org.eclipse.cdt.make.core.buildLocation 31 | ${workspace_loc:/Ch10_MultiTexture/Simulator-Debug} 32 | 33 | 34 | org.eclipse.cdt.make.core.contents 35 | org.eclipse.cdt.make.core.activeConfigSettings 36 | 37 | 38 | org.eclipse.cdt.make.core.enableAutoBuild 39 | false 40 | 41 | 42 | org.eclipse.cdt.make.core.enableCleanBuild 43 | true 44 | 45 | 46 | org.eclipse.cdt.make.core.enableFullBuild 47 | true 48 | 49 | 50 | org.eclipse.cdt.make.core.stopOnError 51 | true 52 | 53 | 54 | org.eclipse.cdt.make.core.useDefaultBuildCmd 55 | true 56 | 57 | 58 | 59 | 60 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 61 | full,incremental, 62 | 63 | 64 | 65 | 66 | com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder 67 | 68 | 69 | 70 | 71 | 72 | org.eclipse.cdt.core.cnature 73 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 74 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 75 | com.qnx.tools.ide.bbt.core.bbtnature 76 | 77 | 78 | -------------------------------------------------------------------------------- /BlackBerry/Ch10_MultiTexture/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/BlackBerry/Ch10_MultiTexture/icon.png -------------------------------------------------------------------------------- /BlackBerry/Ch10_MultiTexture/res/textures/basemap.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/BlackBerry/Ch10_MultiTexture/res/textures/basemap.tga -------------------------------------------------------------------------------- /BlackBerry/Ch10_MultiTexture/res/textures/lightmap.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/BlackBerry/Ch10_MultiTexture/res/textures/lightmap.tga -------------------------------------------------------------------------------- /BlackBerry/Ch11_Stencil_Test/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ch11_Stencil_Test 4 | 5 | 6 | Common 7 | 8 | 9 | 10 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 11 | clean,full,incremental, 12 | 13 | 14 | ?name? 15 | 16 | 17 | 18 | org.eclipse.cdt.make.core.append_environment 19 | true 20 | 21 | 22 | org.eclipse.cdt.make.core.buildArguments 23 | 24 | 25 | 26 | org.eclipse.cdt.make.core.buildCommand 27 | make 28 | 29 | 30 | org.eclipse.cdt.make.core.buildLocation 31 | ${workspace_loc:/Ch11_Stencil_Test/Simulator-Debug} 32 | 33 | 34 | org.eclipse.cdt.make.core.contents 35 | org.eclipse.cdt.make.core.activeConfigSettings 36 | 37 | 38 | org.eclipse.cdt.make.core.enableAutoBuild 39 | false 40 | 41 | 42 | org.eclipse.cdt.make.core.enableCleanBuild 43 | true 44 | 45 | 46 | org.eclipse.cdt.make.core.enableFullBuild 47 | true 48 | 49 | 50 | org.eclipse.cdt.make.core.stopOnError 51 | true 52 | 53 | 54 | org.eclipse.cdt.make.core.useDefaultBuildCmd 55 | true 56 | 57 | 58 | 59 | 60 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 61 | full,incremental, 62 | 63 | 64 | 65 | 66 | com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder 67 | 68 | 69 | 70 | 71 | 72 | org.eclipse.cdt.core.cnature 73 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 74 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 75 | com.qnx.tools.ide.bbt.core.bbtnature 76 | 77 | 78 | -------------------------------------------------------------------------------- /BlackBerry/Ch11_Stencil_Test/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/BlackBerry/Ch11_Stencil_Test/icon.png -------------------------------------------------------------------------------- /BlackBerry/Ch13_ParticleSystem/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ch13_ParticleSystem 4 | 5 | 6 | Common 7 | 8 | 9 | 10 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 11 | clean,full,incremental, 12 | 13 | 14 | ?name? 15 | 16 | 17 | 18 | org.eclipse.cdt.make.core.append_environment 19 | true 20 | 21 | 22 | org.eclipse.cdt.make.core.buildArguments 23 | 24 | 25 | 26 | org.eclipse.cdt.make.core.buildCommand 27 | make 28 | 29 | 30 | org.eclipse.cdt.make.core.buildLocation 31 | ${workspace_loc:/Ch13_ParticleSystem/Simulator-Debug} 32 | 33 | 34 | org.eclipse.cdt.make.core.contents 35 | org.eclipse.cdt.make.core.activeConfigSettings 36 | 37 | 38 | org.eclipse.cdt.make.core.enableAutoBuild 39 | false 40 | 41 | 42 | org.eclipse.cdt.make.core.enableCleanBuild 43 | true 44 | 45 | 46 | org.eclipse.cdt.make.core.enableFullBuild 47 | true 48 | 49 | 50 | org.eclipse.cdt.make.core.stopOnError 51 | true 52 | 53 | 54 | org.eclipse.cdt.make.core.useDefaultBuildCmd 55 | true 56 | 57 | 58 | 59 | 60 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 61 | full,incremental, 62 | 63 | 64 | 65 | 66 | com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder 67 | 68 | 69 | 70 | 71 | 72 | org.eclipse.cdt.core.cnature 73 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 74 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 75 | com.qnx.tools.ide.bbt.core.bbtnature 76 | 77 | 78 | -------------------------------------------------------------------------------- /BlackBerry/Ch13_ParticleSystem/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/BlackBerry/Ch13_ParticleSystem/icon.png -------------------------------------------------------------------------------- /BlackBerry/Ch13_ParticleSystem/res/textures/smoke.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/BlackBerry/Ch13_ParticleSystem/res/textures/smoke.tga -------------------------------------------------------------------------------- /BlackBerry/Ch2_Hello_Triangle/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ch2_Hello_Triangle 4 | 5 | 6 | Common 7 | 8 | 9 | 10 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 11 | clean,full,incremental, 12 | 13 | 14 | ?name? 15 | 16 | 17 | 18 | org.eclipse.cdt.make.core.append_environment 19 | true 20 | 21 | 22 | org.eclipse.cdt.make.core.buildArguments 23 | 24 | 25 | 26 | org.eclipse.cdt.make.core.buildCommand 27 | make 28 | 29 | 30 | org.eclipse.cdt.make.core.buildLocation 31 | ${workspace_loc:/Ch2_Hello_Triangle/Simulator-Debug} 32 | 33 | 34 | org.eclipse.cdt.make.core.contents 35 | org.eclipse.cdt.make.core.activeConfigSettings 36 | 37 | 38 | org.eclipse.cdt.make.core.enableAutoBuild 39 | false 40 | 41 | 42 | org.eclipse.cdt.make.core.enableCleanBuild 43 | true 44 | 45 | 46 | org.eclipse.cdt.make.core.enableFullBuild 47 | true 48 | 49 | 50 | org.eclipse.cdt.make.core.stopOnError 51 | true 52 | 53 | 54 | org.eclipse.cdt.make.core.useDefaultBuildCmd 55 | true 56 | 57 | 58 | 59 | 60 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 61 | full,incremental, 62 | 63 | 64 | 65 | 66 | com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder 67 | 68 | 69 | 70 | 71 | 72 | org.eclipse.cdt.core.cnature 73 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 74 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 75 | com.qnx.tools.ide.bbt.core.bbtnature 76 | 77 | 78 | -------------------------------------------------------------------------------- /BlackBerry/Ch2_Hello_Triangle/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/BlackBerry/Ch2_Hello_Triangle/icon.png -------------------------------------------------------------------------------- /BlackBerry/Ch8_Simple_VertexShader/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/BlackBerry/Ch8_Simple_VertexShader/icon.png -------------------------------------------------------------------------------- /BlackBerry/Ch9_MipMap2D/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ch9_MipMap2D 4 | 5 | 6 | Common 7 | 8 | 9 | 10 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 11 | clean,full,incremental, 12 | 13 | 14 | ?name? 15 | 16 | 17 | 18 | org.eclipse.cdt.make.core.append_environment 19 | true 20 | 21 | 22 | org.eclipse.cdt.make.core.buildArguments 23 | 24 | 25 | 26 | org.eclipse.cdt.make.core.buildCommand 27 | make 28 | 29 | 30 | org.eclipse.cdt.make.core.buildLocation 31 | ${workspace_loc:/Ch9_MipMap2D/Simulator-Debug} 32 | 33 | 34 | org.eclipse.cdt.make.core.contents 35 | org.eclipse.cdt.make.core.activeConfigSettings 36 | 37 | 38 | org.eclipse.cdt.make.core.enableAutoBuild 39 | false 40 | 41 | 42 | org.eclipse.cdt.make.core.enableCleanBuild 43 | true 44 | 45 | 46 | org.eclipse.cdt.make.core.enableFullBuild 47 | true 48 | 49 | 50 | org.eclipse.cdt.make.core.stopOnError 51 | true 52 | 53 | 54 | org.eclipse.cdt.make.core.useDefaultBuildCmd 55 | true 56 | 57 | 58 | 59 | 60 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 61 | full,incremental, 62 | 63 | 64 | 65 | 66 | com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder 67 | 68 | 69 | 70 | 71 | 72 | org.eclipse.cdt.core.cnature 73 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 74 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 75 | com.qnx.tools.ide.bbt.core.bbtnature 76 | 77 | 78 | -------------------------------------------------------------------------------- /BlackBerry/Ch9_MipMap2D/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/BlackBerry/Ch9_MipMap2D/icon.png -------------------------------------------------------------------------------- /BlackBerry/Ch9_Simple_Texture2D/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/BlackBerry/Ch9_Simple_Texture2D/icon.png -------------------------------------------------------------------------------- /BlackBerry/Ch9_Simple_TextureCubemap/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/BlackBerry/Ch9_Simple_TextureCubemap/icon.png -------------------------------------------------------------------------------- /BlackBerry/Ch9_TextureWrap/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ch9_TextureWrap 4 | 5 | 6 | Common 7 | 8 | 9 | 10 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 11 | clean,full,incremental, 12 | 13 | 14 | ?name? 15 | 16 | 17 | 18 | org.eclipse.cdt.make.core.append_environment 19 | true 20 | 21 | 22 | org.eclipse.cdt.make.core.buildArguments 23 | 24 | 25 | 26 | org.eclipse.cdt.make.core.buildCommand 27 | make 28 | 29 | 30 | org.eclipse.cdt.make.core.buildLocation 31 | ${workspace_loc:/Ch9_TextureWrap/Simulator-Debug} 32 | 33 | 34 | org.eclipse.cdt.make.core.contents 35 | org.eclipse.cdt.make.core.activeConfigSettings 36 | 37 | 38 | org.eclipse.cdt.make.core.enableAutoBuild 39 | false 40 | 41 | 42 | org.eclipse.cdt.make.core.enableCleanBuild 43 | true 44 | 45 | 46 | org.eclipse.cdt.make.core.enableFullBuild 47 | true 48 | 49 | 50 | org.eclipse.cdt.make.core.stopOnError 51 | true 52 | 53 | 54 | org.eclipse.cdt.make.core.useDefaultBuildCmd 55 | true 56 | 57 | 58 | 59 | 60 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 61 | full,incremental, 62 | 63 | 64 | 65 | 66 | com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder 67 | 68 | 69 | 70 | 71 | 72 | org.eclipse.cdt.core.cnature 73 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 74 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 75 | com.qnx.tools.ide.bbt.core.bbtnature 76 | 77 | 78 | -------------------------------------------------------------------------------- /BlackBerry/Ch9_TextureWrap/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/BlackBerry/Ch9_TextureWrap/icon.png -------------------------------------------------------------------------------- /BlackBerry/Common/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Common 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | clean,full,incremental, 11 | 12 | 13 | ?name? 14 | 15 | 16 | 17 | org.eclipse.cdt.make.core.append_environment 18 | true 19 | 20 | 21 | org.eclipse.cdt.make.core.buildArguments 22 | 23 | 24 | 25 | org.eclipse.cdt.make.core.buildCommand 26 | make 27 | 28 | 29 | org.eclipse.cdt.make.core.buildLocation 30 | ${workspace_loc:/Common/Simulator-Debug} 31 | 32 | 33 | org.eclipse.cdt.make.core.contents 34 | org.eclipse.cdt.make.core.activeConfigSettings 35 | 36 | 37 | org.eclipse.cdt.make.core.enableAutoBuild 38 | false 39 | 40 | 41 | org.eclipse.cdt.make.core.enableCleanBuild 42 | true 43 | 44 | 45 | org.eclipse.cdt.make.core.enableFullBuild 46 | true 47 | 48 | 49 | org.eclipse.cdt.make.core.stopOnError 50 | true 51 | 52 | 53 | org.eclipse.cdt.make.core.useDefaultBuildCmd 54 | true 55 | 56 | 57 | 58 | 59 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 60 | full,incremental, 61 | 62 | 63 | 64 | 65 | com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder 66 | 67 | 68 | 69 | 70 | 71 | org.eclipse.cdt.core.cnature 72 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 73 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 74 | com.qnx.tools.ide.bbt.core.bbtnature 75 | 76 | 77 | -------------------------------------------------------------------------------- /BlackBerry/Common/src/esUtil_qnx.h: -------------------------------------------------------------------------------- 1 | // 2 | // Book: OpenGL(R) ES 2.0 Programming Guide 3 | // Authors: Aaftab Munshi, Dan Ginsburg, Dave Shreiner 4 | // ISBN-10: 0321502795 5 | // ISBN-13: 9780321502797 6 | // Publisher: Addison-Wesley Professional 7 | // URLs: http://safari.informit.com/9780321563835 8 | // http://www.opengles-book.com 9 | // Additional contributions copyright (c) 2011 Research In Motion Limited 10 | 11 | // esUtil_qnx.h 12 | // 13 | // API-neutral interface for creating windows. Implementation needs to be provided per-platform. 14 | 15 | #ifndef ESUTIL_QNX_H_ 16 | #define ESUTIL_QNX_H_ 17 | 18 | /// 19 | // Includes 20 | // 21 | 22 | #ifdef __cplusplus 23 | 24 | extern "C" { 25 | #endif 26 | 27 | /// 28 | // Public Functions 29 | // 30 | 31 | /// 32 | // WinCreate() 33 | // 34 | // Create window 35 | // 36 | GLboolean CreateWindow ( ESContext *esContext, const char *title, GLuint flags); 37 | 38 | /// 39 | // WinLoop() 40 | // 41 | // Start main loop 42 | // 43 | void MainLoop ( ESContext *esContext ); 44 | 45 | /// 46 | // LoadTGA() 47 | // 48 | // TGA loader QNX implementation 49 | // 50 | int LoadTGA(const char *fileName, char **buffer, int *width, int *height); 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /BlackBerry/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011 Research In Motion Limited 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2010 Dan Ginsburg 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /LinuxX11/Chapter_10/MultiTexture/basemap.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/LinuxX11/Chapter_10/MultiTexture/basemap.tga -------------------------------------------------------------------------------- /LinuxX11/Chapter_10/MultiTexture/lightmap.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/LinuxX11/Chapter_10/MultiTexture/lightmap.tga -------------------------------------------------------------------------------- /LinuxX11/Chapter_13/ParticleSystem/smoke.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/LinuxX11/Chapter_13/ParticleSystem/smoke.tga -------------------------------------------------------------------------------- /LinuxX11/README.linux: -------------------------------------------------------------------------------- 1 | OpenGL ES 2.0 Programming Guide - Example code for Linux/X11 environment 2 | 3 | Adaptation code for Linux/X11 environment for the examples of the book 4 | OpenGL ES 2.0 Programming Guide written by Jarkko Vatjus-Anttila. All 5 | original example code has remained unmodified. Adaptation changes are 6 | in esUtil.c|h files, which encapsulates all X11 specific internals from 7 | the application layer. 8 | 9 | Prerequisites for building the source is a valid GCC toolchain (4.5.2 10 | 4.6.1 are tested) and properly setup X11 & GLESv2 & EGL environment. 11 | Mesa project offers such setup, and version 7.11 has been tested with 12 | software rendering. Also native GLESv2 renderer has been tested using 13 | NVidia Tegra2 setup. More details about the tested environments are 14 | below: 15 | 16 | The code has been tested with three configurations 17 | - ATI Radeon HD 3200 graphics with Mesa 7.11-0ubuntu3, Ubuntu 11.10 18 | - NVidia Quadro FX 2800M/PCI/SSE2 with Mesa 7.11-0ubuntu3, Ubuntu 11.10 19 | - NVidia Tegra 2, native EGL/GLESv2 drivers, Ubuntu 10.10 20 | 21 | Native GLESv2 on Tegra2 renders all the test cases correctly. However, 22 | Mesa 7.11 has problems with the Chapter 13 particle test, which at least 23 | with the mentioned test setups create only a black screen. 24 | 25 | Compiling the examples should be as easy as running "make" in the root 26 | linux directory. 27 | 28 | 31st Oct 2011 - Jarkko Vatjus-Anttila 29 | -------------------------------------------------------------------------------- /WebGL/Chapter_10/MultiTexture/basemap.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/WebGL/Chapter_10/MultiTexture/basemap.gif -------------------------------------------------------------------------------- /WebGL/Chapter_10/MultiTexture/lightmap.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/WebGL/Chapter_10/MultiTexture/lightmap.gif -------------------------------------------------------------------------------- /WebGL/Chapter_13/ParticleSystem/smoke.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/WebGL/Chapter_13/ParticleSystem/smoke.gif -------------------------------------------------------------------------------- /Windows/Bin/README.TXT: -------------------------------------------------------------------------------- 1 | Place the following files from AMD's OpenGL ES 2.0 Emulator in 2 | in this folder (http://developer.amd.com/gpu/opengl/Pages/default.aspx): 3 | 4 | * libEGL.dll 5 | * libGLESv2.dll 6 | 7 | Alternatively, use the libEGL.dll and libGLESv2.dll from Imagination Technologies 8 | OpenGL ES 2.0 SDK. 9 | -------------------------------------------------------------------------------- /Windows/Bin/basemap.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Bin/basemap.tga -------------------------------------------------------------------------------- /Windows/Bin/lightmap.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Bin/lightmap.tga -------------------------------------------------------------------------------- /Windows/Bin/smoke.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Bin/smoke.tga -------------------------------------------------------------------------------- /Windows/Chapter_10/MultiTexture/MultiTexture.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MultiTexture", "MultiTexture.vcproj", "{8278251F-6C1F-4D80-8499-FA7B590FAFE6}" 5 | ProjectSection(ProjectDependencies) = postProject 6 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F} = {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F} 7 | EndProjectSection 8 | EndProject 9 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "esUtil", "..\..\Common\esUtil.vcproj", "{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}" 10 | EndProject 11 | Global 12 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 13 | Debug|Win32 = Debug|Win32 14 | Release|Win32 = Release|Win32 15 | EndGlobalSection 16 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 17 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Debug|Win32.ActiveCfg = Debug|Win32 18 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Debug|Win32.Build.0 = Debug|Win32 19 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Release|Win32.ActiveCfg = Release|Win32 20 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Release|Win32.Build.0 = Release|Win32 21 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.ActiveCfg = Debug|Win32 22 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.Build.0 = Debug|Win32 23 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.ActiveCfg = Release|Win32 24 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.Build.0 = Release|Win32 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | EndGlobal 30 | -------------------------------------------------------------------------------- /Windows/Chapter_10/MultiTexture/basemap.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_10/MultiTexture/basemap.tga -------------------------------------------------------------------------------- /Windows/Chapter_10/MultiTexture/lightmap.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_10/MultiTexture/lightmap.tga -------------------------------------------------------------------------------- /Windows/Chapter_10/RM_AlphaTest/Torus.3ds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_10/RM_AlphaTest/Torus.3ds -------------------------------------------------------------------------------- /Windows/Chapter_10/RM_AlphaTest/cloud.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_10/RM_AlphaTest/cloud.tga -------------------------------------------------------------------------------- /Windows/Chapter_10/RM_ClipPlane/Sphere.3ds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_10/RM_ClipPlane/Sphere.3ds -------------------------------------------------------------------------------- /Windows/Chapter_10/RM_LinearFog/Terrain.3ds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_10/RM_LinearFog/Terrain.3ds -------------------------------------------------------------------------------- /Windows/Chapter_10/RM_LinearFog/Terrain.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_10/RM_LinearFog/Terrain.tga -------------------------------------------------------------------------------- /Windows/Chapter_11/Multisample/Multisample.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual C++ Express 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Multisample", "Multisample.vcproj", "{DBDDD08B-42D9-4972-AA85-24B7935DB33D}" 5 | ProjectSection(ProjectDependencies) = postProject 6 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F} = {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F} 7 | EndProjectSection 8 | EndProject 9 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "esUtil", "..\..\Common\esUtil.vcproj", "{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}" 10 | EndProject 11 | Global 12 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 13 | Debug|Win32 = Debug|Win32 14 | Release|Win32 = Release|Win32 15 | EndGlobalSection 16 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 17 | {DBDDD08B-42D9-4972-AA85-24B7935DB33D}.Debug|Win32.ActiveCfg = Debug|Win32 18 | {DBDDD08B-42D9-4972-AA85-24B7935DB33D}.Debug|Win32.Build.0 = Debug|Win32 19 | {DBDDD08B-42D9-4972-AA85-24B7935DB33D}.Release|Win32.ActiveCfg = Release|Win32 20 | {DBDDD08B-42D9-4972-AA85-24B7935DB33D}.Release|Win32.Build.0 = Release|Win32 21 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.ActiveCfg = Debug|Win32 22 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.Build.0 = Debug|Win32 23 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.ActiveCfg = Release|Win32 24 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.Build.0 = Release|Win32 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | EndGlobal 30 | -------------------------------------------------------------------------------- /Windows/Chapter_11/Stencil_Test/Stencil_Test.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 9.00 2 | # Visual C++ Express 2005 3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "esUtil", "..\..\Common\esUtil.vcproj", "{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}" 4 | EndProject 5 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Stencil_Test", "Stencil_Test.vcproj", "{EEACE995-26BC-4D56-A8B3-3E7A9AB3EB26}" 6 | EndProject 7 | Global 8 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 9 | Debug|Win32 = Debug|Win32 10 | Release|Win32 = Release|Win32 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.ActiveCfg = Debug|Win32 14 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.Build.0 = Debug|Win32 15 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.ActiveCfg = Release|Win32 16 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.Build.0 = Release|Win32 17 | {EEACE995-26BC-4D56-A8B3-3E7A9AB3EB26}.Debug|Win32.ActiveCfg = Debug|Win32 18 | {EEACE995-26BC-4D56-A8B3-3E7A9AB3EB26}.Debug|Win32.Build.0 = Debug|Win32 19 | {EEACE995-26BC-4D56-A8B3-3E7A9AB3EB26}.Release|Win32.ActiveCfg = Release|Win32 20 | {EEACE995-26BC-4D56-A8B3-3E7A9AB3EB26}.Release|Win32.Build.0 = Release|Win32 21 | EndGlobalSection 22 | GlobalSection(SolutionProperties) = preSolution 23 | HideSolutionNode = FALSE 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Windows/Chapter_13/EnvironmentMapping/Fieldstone.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_13/EnvironmentMapping/Fieldstone.tga -------------------------------------------------------------------------------- /Windows/Chapter_13/EnvironmentMapping/FieldstoneBumpDOT3.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_13/EnvironmentMapping/FieldstoneBumpDOT3.tga -------------------------------------------------------------------------------- /Windows/Chapter_13/EnvironmentMapping/Snow.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_13/EnvironmentMapping/Snow.dds -------------------------------------------------------------------------------- /Windows/Chapter_13/EnvironmentMapping/Sphere.3ds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_13/EnvironmentMapping/Sphere.3ds -------------------------------------------------------------------------------- /Windows/Chapter_13/EnvironmentMapping/Teapot.3ds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_13/EnvironmentMapping/Teapot.3ds -------------------------------------------------------------------------------- /Windows/Chapter_13/Noise3D/NoiseVolume.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_13/Noise3D/NoiseVolume.dds -------------------------------------------------------------------------------- /Windows/Chapter_13/Noise3D/SkyDome.3ds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_13/Noise3D/SkyDome.3ds -------------------------------------------------------------------------------- /Windows/Chapter_13/Noise3D/Terrain.3ds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_13/Noise3D/Terrain.3ds -------------------------------------------------------------------------------- /Windows/Chapter_13/Noise3D/Terrain.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_13/Noise3D/Terrain.tga -------------------------------------------------------------------------------- /Windows/Chapter_13/ParticleSystem/ParticleSystem.sln: -------------------------------------------------------------------------------- 1 | ` 2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ParticleSystem", "ParticleSystem.vcproj", "{8278251F-6C1F-4D80-8499-FA7B590FAFE6}" 5 | ProjectSection(ProjectDependencies) = postProject 6 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F} = {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F} 7 | EndProjectSection 8 | EndProject 9 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "esUtil", "..\..\Common\esUtil.vcproj", "{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}" 10 | EndProject 11 | Global 12 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 13 | Debug|Win32 = Debug|Win32 14 | Release|Win32 = Release|Win32 15 | EndGlobalSection 16 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 17 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Debug|Win32.ActiveCfg = Debug|Win32 18 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Debug|Win32.Build.0 = Debug|Win32 19 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Release|Win32.ActiveCfg = Release|Win32 20 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Release|Win32.Build.0 = Release|Win32 21 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.ActiveCfg = Debug|Win32 22 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.Build.0 = Debug|Win32 23 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.ActiveCfg = Release|Win32 24 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.Build.0 = Release|Win32 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | EndGlobal 30 | -------------------------------------------------------------------------------- /Windows/Chapter_13/ParticleSystem/smoke.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_13/ParticleSystem/smoke.tga -------------------------------------------------------------------------------- /Windows/Chapter_13/PerFragmentLighting/Fieldstone.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_13/PerFragmentLighting/Fieldstone.tga -------------------------------------------------------------------------------- /Windows/Chapter_13/PerFragmentLighting/FieldstoneBumpDOT3.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_13/PerFragmentLighting/FieldstoneBumpDOT3.tga -------------------------------------------------------------------------------- /Windows/Chapter_13/PerFragmentLighting/Torus.3ds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_13/PerFragmentLighting/Torus.3ds -------------------------------------------------------------------------------- /Windows/Chapter_13/PostProcess/Car.3ds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_13/PostProcess/Car.3ds -------------------------------------------------------------------------------- /Windows/Chapter_13/PostProcess/Fieldstone.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_13/PostProcess/Fieldstone.tga -------------------------------------------------------------------------------- /Windows/Chapter_13/PostProcess/ScreenAlignedQuad.3ds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_13/PostProcess/ScreenAlignedQuad.3ds -------------------------------------------------------------------------------- /Windows/Chapter_13/ProceduralTextures/ScreenAlignedQuad.3ds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_13/ProceduralTextures/ScreenAlignedQuad.3ds -------------------------------------------------------------------------------- /Windows/Chapter_13/ProceduralTextures/checker.fs: -------------------------------------------------------------------------------- 1 | #ifdef GL_ES 2 | precision highp float; 3 | #endif 4 | 5 | uniform int frequency; 6 | uniform vec4 color0; 7 | uniform vec4 color1; 8 | 9 | varying vec2 v_st; 10 | 11 | void 12 | main() 13 | { 14 | float s, t, delta; 15 | 16 | s = mod(floor(v_st.x * float(frequency * 2)), 2.0); 17 | t = mod(floor(v_st.y * float(frequency * 2)), 2.0); 18 | delta = abs(s - t); 19 | 20 | gl_FragColor = mix(color1, color0, delta); 21 | } 22 | -------------------------------------------------------------------------------- /Windows/Chapter_13/ProceduralTextures/checker.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_13/ProceduralTextures/checker.tiff -------------------------------------------------------------------------------- /Windows/Chapter_13/ProceduralTextures/checker.vs: -------------------------------------------------------------------------------- 1 | 2 | uniform mat4 mvp_matrix; 3 | 4 | attribute vec4 a_position; 5 | attribute vec2 a_st; 6 | 7 | varying vec2 v_st; 8 | 9 | void 10 | main() 11 | { 12 | v_st = a_st; 13 | gl_Position = mvp_matrix * a_position; 14 | } 15 | -------------------------------------------------------------------------------- /Windows/Chapter_13/ProjectiveSpotlight/Corona.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_13/ProjectiveSpotlight/Corona.tga -------------------------------------------------------------------------------- /Windows/Chapter_13/ProjectiveSpotlight/Terrain.3ds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_13/ProjectiveSpotlight/Terrain.3ds -------------------------------------------------------------------------------- /Windows/Chapter_13/ProjectiveSpotlight/Terrain.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Chapter_13/ProjectiveSpotlight/Terrain.tga -------------------------------------------------------------------------------- /Windows/Chapter_15/Hello_Triangle_KD/Hello_Triangle_KD.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Hello_Triangle_KD", "Hello_Triangle_KD.vcproj", "{6BE6BD94-F794-471D-9A9D-EFC01498D8B5}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {6BE6BD94-F794-471D-9A9D-EFC01498D8B5}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {6BE6BD94-F794-471D-9A9D-EFC01498D8B5}.Debug|Win32.Build.0 = Debug|Win32 14 | {6BE6BD94-F794-471D-9A9D-EFC01498D8B5}.Release|Win32.ActiveCfg = Release|Win32 15 | {6BE6BD94-F794-471D-9A9D-EFC01498D8B5}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /Windows/Chapter_2/Hello_Triangle/Hello_Triangle.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Hello_Triangle", "Hello_Triangle.vcproj", "{8278251F-6C1F-4D80-8499-FA7B590FAFE6}" 5 | ProjectSection(ProjectDependencies) = postProject 6 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F} = {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F} 7 | EndProjectSection 8 | EndProject 9 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "esUtil", "..\..\Common\esUtil.vcproj", "{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}" 10 | EndProject 11 | Global 12 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 13 | Debug|Win32 = Debug|Win32 14 | Release|Win32 = Release|Win32 15 | EndGlobalSection 16 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 17 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Debug|Win32.ActiveCfg = Debug|Win32 18 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Debug|Win32.Build.0 = Debug|Win32 19 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Release|Win32.ActiveCfg = Release|Win32 20 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Release|Win32.Build.0 = Release|Win32 21 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.ActiveCfg = Debug|Win32 22 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.Build.0 = Debug|Win32 23 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.ActiveCfg = Release|Win32 24 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.Build.0 = Release|Win32 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | EndGlobal 30 | -------------------------------------------------------------------------------- /Windows/Chapter_8/Simple_VertexShader/Simple_VertexShader.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Simple_VertexShader", "Simple_VertexShader.vcproj", "{8278251F-6C1F-4D80-8499-FA7B590FAFE6}" 5 | ProjectSection(ProjectDependencies) = postProject 6 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F} = {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F} 7 | EndProjectSection 8 | EndProject 9 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "esUtil", "..\..\Common\esUtil.vcproj", "{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}" 10 | EndProject 11 | Global 12 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 13 | Debug|Win32 = Debug|Win32 14 | Release|Win32 = Release|Win32 15 | EndGlobalSection 16 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 17 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Debug|Win32.ActiveCfg = Debug|Win32 18 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Debug|Win32.Build.0 = Debug|Win32 19 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Release|Win32.ActiveCfg = Release|Win32 20 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Release|Win32.Build.0 = Release|Win32 21 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.ActiveCfg = Debug|Win32 22 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.Build.0 = Debug|Win32 23 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.ActiveCfg = Release|Win32 24 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.Build.0 = Release|Win32 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | EndGlobal 30 | -------------------------------------------------------------------------------- /Windows/Chapter_9/MipMap2D/MipMap2D.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MipMap2D", "MipMap2D.vcproj", "{8278251F-6C1F-4D80-8499-FA7B590FAFE6}" 5 | ProjectSection(ProjectDependencies) = postProject 6 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F} = {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F} 7 | EndProjectSection 8 | EndProject 9 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "esUtil", "..\..\Common\esUtil.vcproj", "{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}" 10 | EndProject 11 | Global 12 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 13 | Debug|Win32 = Debug|Win32 14 | Release|Win32 = Release|Win32 15 | EndGlobalSection 16 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 17 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Debug|Win32.ActiveCfg = Debug|Win32 18 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Debug|Win32.Build.0 = Debug|Win32 19 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Release|Win32.ActiveCfg = Release|Win32 20 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Release|Win32.Build.0 = Release|Win32 21 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.ActiveCfg = Debug|Win32 22 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.Build.0 = Debug|Win32 23 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.ActiveCfg = Release|Win32 24 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.Build.0 = Release|Win32 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | EndGlobal 30 | -------------------------------------------------------------------------------- /Windows/Chapter_9/Simple_Texture2D/Simple_Texture2D.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Simple_Texture2D", "Simple_Texture2D.vcproj", "{8278251F-6C1F-4D80-8499-FA7B590FAFE6}" 5 | ProjectSection(ProjectDependencies) = postProject 6 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F} = {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F} 7 | EndProjectSection 8 | EndProject 9 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "esUtil", "..\..\Common\esUtil.vcproj", "{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}" 10 | EndProject 11 | Global 12 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 13 | Debug|Win32 = Debug|Win32 14 | Release|Win32 = Release|Win32 15 | EndGlobalSection 16 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 17 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Debug|Win32.ActiveCfg = Debug|Win32 18 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Debug|Win32.Build.0 = Debug|Win32 19 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Release|Win32.ActiveCfg = Release|Win32 20 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Release|Win32.Build.0 = Release|Win32 21 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.ActiveCfg = Debug|Win32 22 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.Build.0 = Debug|Win32 23 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.ActiveCfg = Release|Win32 24 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.Build.0 = Release|Win32 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | EndGlobal 30 | -------------------------------------------------------------------------------- /Windows/Chapter_9/Simple_TextureCubemap/Simple_TextureCubemap.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Simple_TextureCubemap", "Simple_TextureCubemap.vcproj", "{8278251F-6C1F-4D80-8499-FA7B590FAFE6}" 5 | ProjectSection(ProjectDependencies) = postProject 6 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F} = {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F} 7 | EndProjectSection 8 | EndProject 9 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "esUtil", "..\..\Common\esUtil.vcproj", "{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}" 10 | EndProject 11 | Global 12 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 13 | Debug|Win32 = Debug|Win32 14 | Release|Win32 = Release|Win32 15 | EndGlobalSection 16 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 17 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Debug|Win32.ActiveCfg = Debug|Win32 18 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Debug|Win32.Build.0 = Debug|Win32 19 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Release|Win32.ActiveCfg = Release|Win32 20 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Release|Win32.Build.0 = Release|Win32 21 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.ActiveCfg = Debug|Win32 22 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.Build.0 = Debug|Win32 23 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.ActiveCfg = Release|Win32 24 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.Build.0 = Release|Win32 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | EndGlobal 30 | -------------------------------------------------------------------------------- /Windows/Chapter_9/TextureWrap/TextureWrap.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TextureWrap", "TextureWrap.vcproj", "{8278251F-6C1F-4D80-8499-FA7B590FAFE6}" 5 | ProjectSection(ProjectDependencies) = postProject 6 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F} = {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F} 7 | EndProjectSection 8 | EndProject 9 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "esUtil", "..\..\Common\esUtil.vcproj", "{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}" 10 | EndProject 11 | Global 12 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 13 | Debug|Win32 = Debug|Win32 14 | Release|Win32 = Release|Win32 15 | EndGlobalSection 16 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 17 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Debug|Win32.ActiveCfg = Debug|Win32 18 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Debug|Win32.Build.0 = Debug|Win32 19 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Release|Win32.ActiveCfg = Release|Win32 20 | {8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Release|Win32.Build.0 = Release|Win32 21 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.ActiveCfg = Debug|Win32 22 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.Build.0 = Debug|Win32 23 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.ActiveCfg = Release|Win32 24 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.Build.0 = Release|Win32 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | EndGlobal 30 | -------------------------------------------------------------------------------- /Windows/Common/Doc/html/annotated.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | ES Framework: Annotated Index 4 | 5 | 6 | 7 | Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals 8 | ES Framework Data StructuresHere are the data structures with brief descriptions: 9 | ESContext 10 | ESMatrix 11 | TGA_HEADER 12 | 13 | Generated on Thu Jan 31 11:29:22 2008 for ES Framework by 14 | 15 | 16 | 1.3.6 17 | 18 | 19 | -------------------------------------------------------------------------------- /Windows/Common/Doc/html/classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | ES Framework: Alphabetical index 4 | 5 | 6 | 7 | Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals 8 | ES Framework Data Structure IndexE | T 9 | 10 | E 11 | ESMatrix T 12 | TGA_HEADER ESContext E | T 13 | Generated on Thu Jan 31 11:29:22 2008 for ES Framework by 14 | 15 | 16 | 1.3.6 17 | 18 | 19 | -------------------------------------------------------------------------------- /Windows/Common/Doc/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Common/Doc/html/doxygen.png -------------------------------------------------------------------------------- /Windows/Common/Doc/html/functions_func.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | ES Framework: Compound Member Index 4 | 5 | 6 | 7 | Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals 8 | All | Functions | Variables 9 | 10 | 11 | 12 | void() 13 | : ESContext 14 | Generated on Thu Jan 31 11:29:22 2008 for ES Framework by 15 | 16 | 17 | 1.3.6 18 | 19 | 20 | -------------------------------------------------------------------------------- /Windows/Common/Doc/html/globals_vars.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | ES Framework: File Member Index 4 | 5 | 6 | 7 | Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals 8 | All | Functions | Variables | Typedefs | Defines 9 | 10 | 11 | 12 | EGLAPIENTRY 13 | : egl.h, eglplatform.h 14 | Generated on Thu Jan 31 11:29:23 2008 for ES Framework by 15 | 16 | 17 | 1.3.6 18 | 19 | 20 | -------------------------------------------------------------------------------- /Windows/Common/Doc/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | ES Framework: Main Page 4 | 5 | 6 | 7 | Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals 8 | ES Framework Documentation 9 | 10 | 1.0 Generated on Thu Jan 31 11:29:22 2008 for ES Framework by 11 | 12 | 13 | 1.3.6 14 | 15 | 16 | -------------------------------------------------------------------------------- /Windows/Common/Doc/html/structESMatrix.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | ES Framework: ESMatrix struct Reference 4 | 5 | 6 | 7 | Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals 8 | ESMatrix Struct Reference#include <esUtil.h> 9 | 10 | 11 | 12 | Data Fields 13 | GLfloat m [4][4] 14 | 15 | 16 | Field Documentation 17 | 18 | 19 | 20 | 21 | 22 | 23 | GLfloat ESMatrix::m[4][4] 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | The documentation for this struct was generated from the following file: 40 | esUtil.h 41 | Generated on Thu Jan 31 11:29:23 2008 for ES Framework by 42 | 43 | 44 | 1.3.6 45 | 46 | 47 | -------------------------------------------------------------------------------- /Windows/Common/Include/EGL/eglplatform.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; tab-width: 8; -*- */ 2 | /* vi: set sw=4 ts=8: */ 3 | /* Platform-specific types and definitions for egl.h */ 4 | 5 | #ifndef __eglplatform_h_ 6 | #define __eglplatform_h_ 7 | 8 | /* Windows calling convention boilerplate */ 9 | #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) 10 | #define WIN32_LEAN_AND_MEAN 1 11 | #include 12 | #endif 13 | 14 | #include 15 | 16 | /* Macros used in EGL function prototype declarations. 17 | * 18 | * EGLAPI return-type EGLAPIENTRY eglFunction(arguments); 19 | * 20 | * On Windows, EGLAPIENTRY can be defined like APIENTRY. 21 | * On most other platforms, it should be empty. 22 | */ 23 | 24 | #ifndef EGLAPIENTRY 25 | #define EGLAPIENTRY __stdcall 26 | #endif 27 | 28 | #ifndef EGLAPI 29 | #ifdef __EGL_EXPORTS 30 | # define EGLAPI __declspec(dllexport) 31 | #else 32 | # define EGLAPI __declspec(dllimport) 33 | #endif 34 | #endif 35 | 36 | /* The types NativeDisplayType, NativeWindowType, and NativePixmapType 37 | * are aliases of window-system-dependent types, such as X Display * or 38 | * Windows Device Context. They must be defined in platform-specific 39 | * code below. The EGL-prefixed versions of Native*Type are the same 40 | * types, renamed in EGL 1.3 so all types in the API start with "EGL". 41 | */ 42 | 43 | #define NativeDisplayType HDC 44 | #define NativeWindowType HWND 45 | #define NativePixmapType HBITMAP 46 | 47 | /* Unix (tentative) 48 | #include 49 | typedef Display *NativeDisplayType; 50 | - or maybe, if encoding "hostname:display.head" 51 | typedef const char *NativeWindowType; 52 | etc. 53 | */ 54 | 55 | /* EGL 1.2 types, renamed for consistency in EGL 1.3 */ 56 | typedef NativeDisplayType EGLNativeDisplayType; 57 | typedef NativePixmapType EGLNativePixmapType; 58 | typedef NativeWindowType EGLNativeWindowType; 59 | 60 | #endif /* __eglplatform_h */ 61 | -------------------------------------------------------------------------------- /Windows/Common/Include/KD/KHR_thread_storage.h: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************* 3 | * OpenKODE Core extension: KD_KHR_thread_storage 4 | *******************************************************/ 5 | /* Sample KD/KHR_thread_storage.h for OpenKODE Core */ 6 | #ifndef __kd_KHR_thread_storage_h_ 7 | #define __kd_KHR_thread_storage_h_ 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | 15 | 16 | /* KDThreadStorageKeyKHR: The representation of a thread storage key. */ 17 | typedef KDuint32 KDThreadStorageKeyKHR; 18 | 19 | /* kdMapThreadStorageKHR: Maps an arbitrary pointer to a global thread storage key. */ 20 | KD_API KDThreadStorageKeyKHR KD_APIENTRY KD_APIENTRY kdMapThreadStorageKHR(const void * id); 21 | 22 | /* kdSetThreadStorageKHR: Stores thread-local data. */ 23 | KD_API KDint KD_APIENTRY KD_APIENTRY kdSetThreadStorageKHR(KDThreadStorageKeyKHR key, void * data); 24 | 25 | /* kdGetThreadStorageKHR: Retrieves previously stored thread-local data. */ 26 | KD_API void * KD_APIENTRY KD_APIENTRY kdGetThreadStorageKHR(KDThreadStorageKeyKHR key); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif /* __kd_KHR_thread_storage_h_ */ 33 | 34 | -------------------------------------------------------------------------------- /Windows/Common/Include/KD/kdplatform.h: -------------------------------------------------------------------------------- 1 | /* Sample KD/kdplatform.h for OpenKODE Core 1.0 Provisional revision 1 */ 2 | #ifndef __kdplatform_h_ 3 | #define __kdplatform_h_ 4 | 5 | #define KD_API 6 | #define KD_APIENTRY 7 | 8 | typedef int KDint32; 9 | typedef unsigned int KDuint32; 10 | typedef long long KDint64; 11 | typedef unsigned long long KDuint64; 12 | typedef short KDint16; 13 | typedef unsigned short KDuint16; 14 | typedef unsigned long KDsize; 15 | typedef long KDssize; 16 | #define KDINT_MIN (-0x7fffffff-1) 17 | #define KDINT_MAX 0x7fffffff 18 | #define KDUINT_MAX 0xffffffffU 19 | #define KDINT64_MIN (-0x7fffffffffffffffLL-1) 20 | #define KDINT64_MAX 0x7fffffffffffffffLL 21 | #define KDUINT64_MAX 0xffffffffffffffffULL 22 | 23 | /* kdAssert: Test assertion and call assertion handler if it is false */ 24 | #ifdef KD_NDEBUG 25 | #define kdAssert(c) 26 | #else 27 | #define kdAssert(c) ((c) || (kdHandleAssertion(#c, __FILE__, __LINE__), 0)) 28 | #endif 29 | 30 | KD_API float KD_APIENTRY __kdInfinity(void); 31 | 32 | #define KD_INFINITY __kdInfinity() 33 | 34 | #define KD_WINDOW_SUPPORTED 35 | 36 | #if defined(__GNUC__) 37 | 38 | #include 39 | /* GNU C Compiler specific settings */ 40 | #define KD_NORETURN __attribute((noreturn)) 41 | typedef uintptr_t KDuintptr; 42 | 43 | #elif defined(_MSC_VER) 44 | 45 | #include 46 | /* Microsot Visual C Compiler specific settings*/ 47 | #define KD_NORETURN __declspec(noreturn) 48 | typedef UINT_PTR KDuintptr; 49 | 50 | #elif defined(__ARMCC_VERSION) 51 | 52 | /* ARM Realview compiler specifics */ 53 | #define KD_NORETURN __declspec(noreturn) 54 | typedef unsigned long KDuintptr; 55 | 56 | #else 57 | #error Cannot detect the compiler used. 58 | #endif 59 | 60 | #endif /* __kdplatform_h_ */ 61 | 62 | -------------------------------------------------------------------------------- /Windows/Common/Include/esUtil_win.h: -------------------------------------------------------------------------------- 1 | // 2 | // Book: OpenGL(R) ES 2.0 Programming Guide 3 | // Authors: Aaftab Munshi, Dan Ginsburg, Dave Shreiner 4 | // ISBN-10: 0321502795 5 | // ISBN-13: 9780321502797 6 | // Publisher: Addison-Wesley Professional 7 | // URLs: http://safari.informit.com/9780321563835 8 | // http://www.opengles-book.com 9 | // 10 | 11 | // esUtil_win.h 12 | // 13 | // API-neutral interface for creating windows. Implementation needs to be provided per-platform. 14 | 15 | #ifndef ESUTIL_WIN_H 16 | #define ESUTIL_WIN_H 17 | 18 | /// 19 | // Includes 20 | // 21 | 22 | #ifdef __cplusplus 23 | 24 | extern "C" { 25 | #endif 26 | 27 | 28 | /// 29 | // Macros 30 | // 31 | 32 | /// 33 | // Types 34 | // 35 | 36 | /// 37 | // Public Functions 38 | // 39 | 40 | /// 41 | // WinCreate() 42 | // 43 | // Create Win32 instance and window 44 | // 45 | GLboolean WinCreate ( ESContext *esContext, const char *title ); 46 | 47 | /// 48 | // WinLoop() 49 | // 50 | // Start main windows loop 51 | // 52 | void WinLoop ( ESContext *esContext ); 53 | 54 | /// 55 | // WinTGALoad() 56 | // 57 | // TGA loader win32 implementation 58 | // 59 | int WinTGALoad ( const char *fileName, char **buffer, int *width, int *height ); 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif // ESUTIL_WIN_H -------------------------------------------------------------------------------- /Windows/Common/Lib/esUtil.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Common/Lib/esUtil.lib -------------------------------------------------------------------------------- /Windows/Common/Lib/esUtil_d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Common/Lib/esUtil_d.lib -------------------------------------------------------------------------------- /Windows/Common/esUtil.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "esUtil", "esUtil.vcproj", "{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.Build.0 = Debug|Win32 14 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.ActiveCfg = Release|Win32 15 | {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /Windows/Common/esUtil.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/Windows/Common/esUtil.suo -------------------------------------------------------------------------------- /Windows/Lib/README.TXT: -------------------------------------------------------------------------------- 1 | Place the following files from AMD's OpenGL ES 2.0 Emulator in 2 | in this folder (http://developer.amd.com/gpu/opengl/Pages/default.aspx): 3 | 4 | * libEGL.lib 5 | * libGLESv2.lib 6 | 7 | Alternatively, use the libEGL.lib and libGLESv2.lib from Imagination Technologies 8 | OpenGL ES 2.0 SDK. 9 | 10 | For the OpenKODE sample in Chapter 15, place the following file from Acrodea's 11 | OpenKODE Implementation here (http://www.acrodea.co.jp/en/openkode/): 12 | 13 | * libKD.lib 14 | 15 | -------------------------------------------------------------------------------- /Windows/README.TXT: -------------------------------------------------------------------------------- 1 | Build Instructions 2 | ------------------ 3 | 4 | In order to run the code samples, you will need to download 5 | AMD's OpenGL ES 2.0 Emulator from: 6 | 7 | http://developer.amd.com/gpu/opengl/Pages/default.aspx 8 | 9 | In order to build and run the samples, please copy the following 10 | files from C:\program files\AMD\OpenGL ES 2.0 Emulator v1.1\bin 11 | to the \Bin folder: 12 | 13 | * libEGL.dll 14 | * libGLESv2.dll 15 | 16 | Also, please copy the following files from 17 | C:\program files\AMD\OpenGL ES 2.0 Emulator v1.1\lib to 18 | the \Lib folder: 19 | 20 | * libEGL.lib 21 | * libGLESv2.lib 22 | 23 | For the OpenKODE sample in Chapter 15, place the following file from 24 | Acrodea's OpenKODE Implementation (http://www.acrodea.co.jp/en/openkode/) 25 | to the \Lib folder: 26 | 27 | * libKD.lib 28 | 29 | 30 | RenderMonkey Workspaces 31 | ----------------------- 32 | Finally, for the RenderMonkey workspaces (.rfx files), please download 33 | RenderMonkey v1.81 from AMD at: 34 | 35 | http://developer.amd.com/gpu/rendermonkey/Pages/default.aspx 36 | 37 | 38 | Using the Imagination Technologies OpenGL ES 2.0 SDK 39 | ---------------------------------------------------- 40 | As an alternative to using the AMD OpenGL ES 2.0 Emulator, you can 41 | instead use the Imagination Technologies emulator from their 42 | OpenGL ES 2.0 SDK (http://www.imgtec.com/powervr/insider/powervr-sdk.asp). 43 | In this case, get the .LIB and .DLL files from: 44 | 45 | C:\Imagination Technologies\PowerVR SDK\OGLES2_WINDOWS_PCEMULATION_2.02.22.0756\Builds\OGLES2\WindowsPC\Lib 46 | 47 | and copy them to /Lib and /DLL respectively. 48 | 49 | Also, copy the header files from: 50 | 51 | C:\Imagination Technologies\PowerVR SDK\OGLES2_WINDOWS_PCEMULATION_2.02.22.0756\Builds\OGLES2\Include 52 | 53 | to Common/Include (overwriting the existing files). 54 | 55 | -------------------------------------------------------------------------------- /iPhone/Chapter_10/MultiTexture/Classes/EAGLView.h: -------------------------------------------------------------------------------- 1 | // 2 | // EAGLView.h 3 | // TextureWrap 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import "esUtil.h" 15 | 16 | /* 17 | This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. 18 | The view content is basically an EAGL surface you render your OpenGL scene into. 19 | Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. 20 | */ 21 | @interface EAGLView : UIView { 22 | 23 | @private 24 | /* The pixel dimensions of the backbuffer */ 25 | GLint backingWidth; 26 | GLint backingHeight; 27 | 28 | EAGLContext *context; 29 | 30 | /* OpenGL names for the renderbuffer and framebuffers used to render to this view */ 31 | GLuint viewRenderbuffer, viewFramebuffer; 32 | 33 | /* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */ 34 | GLuint depthRenderbuffer; 35 | 36 | NSTimer *animationTimer; 37 | NSTimeInterval animationInterval; 38 | NSTimeInterval prevTick; 39 | 40 | // ES Programming Guide context 41 | ESContext esContext; 42 | } 43 | 44 | @property NSTimeInterval animationInterval; 45 | 46 | - (void)startAnimation; 47 | - (void)stopAnimation; 48 | - (void)drawView; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /iPhone/Chapter_10/MultiTexture/Classes/MultiTextureAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // MultiTextureAppDelegate.h 3 | // MultiTexture 4 | // 5 | // Created by Dan Ginsburg on 6/17/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class EAGLView; 12 | 13 | @interface MultiTextureAppDelegate : 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 | -------------------------------------------------------------------------------- /iPhone/Chapter_10/MultiTexture/Classes/MultiTextureAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // MultiTextureAppDelegate.m 3 | // MultiTexture 4 | // 5 | // Created by Dan Ginsburg on 6/17/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | #import "MultiTextureAppDelegate.h" 10 | #import "EAGLView.h" 11 | 12 | @implementation MultiTextureAppDelegate 13 | 14 | @synthesize window; 15 | @synthesize glView; 16 | 17 | - (void)applicationDidFinishLaunching:(UIApplication *)application { 18 | 19 | glView.animationInterval = 1.0 / 60.0; 20 | [glView startAnimation]; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | glView.animationInterval = 1.0 / 5.0; 26 | } 27 | 28 | 29 | - (void)applicationDidBecomeActive:(UIApplication *)application { 30 | glView.animationInterval = 1.0 / 60.0; 31 | } 32 | 33 | 34 | - (void)dealloc { 35 | [window release]; 36 | [glView release]; 37 | [super dealloc]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /iPhone/Chapter_10/MultiTexture/MultiTexture-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 | 30 | 31 | -------------------------------------------------------------------------------- /iPhone/Chapter_10/MultiTexture/MultiTexture_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'MultiTexture' target in the 'MultiTexture' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /iPhone/Chapter_10/MultiTexture/basemap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/iPhone/Chapter_10/MultiTexture/basemap.png -------------------------------------------------------------------------------- /iPhone/Chapter_10/MultiTexture/lightmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/iPhone/Chapter_10/MultiTexture/lightmap.png -------------------------------------------------------------------------------- /iPhone/Chapter_10/MultiTexture/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MultiTexture 4 | // 5 | // Created by Dan Ginsburg on 6/17/09. 6 | // Copyright __MyCompanyName__ 2009. 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 | -------------------------------------------------------------------------------- /iPhone/Chapter_11/Stencil_Test/Classes/EAGLView.h: -------------------------------------------------------------------------------- 1 | // 2 | // EAGLView.h 3 | // TextureWrap 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import "esUtil.h" 15 | 16 | /* 17 | This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. 18 | The view content is basically an EAGL surface you render your OpenGL scene into. 19 | Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. 20 | */ 21 | @interface EAGLView : UIView { 22 | 23 | @private 24 | /* The pixel dimensions of the backbuffer */ 25 | GLint backingWidth; 26 | GLint backingHeight; 27 | 28 | EAGLContext *context; 29 | 30 | /* OpenGL names for the renderbuffer and framebuffers used to render to this view */ 31 | GLuint viewRenderbuffer, viewFramebuffer; 32 | 33 | /* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */ 34 | GLuint depthRenderbuffer, stencilRenderbuffer; 35 | 36 | NSTimer *animationTimer; 37 | NSTimeInterval animationInterval; 38 | NSTimeInterval prevTick; 39 | 40 | // ES Programming Guide context 41 | ESContext esContext; 42 | } 43 | 44 | @property NSTimeInterval animationInterval; 45 | 46 | - (void)startAnimation; 47 | - (void)stopAnimation; 48 | - (void)drawView; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /iPhone/Chapter_11/Stencil_Test/Classes/Stencil_TestAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Stencil_TestAppDelegate.h 3 | // Stencil_Test 4 | // 5 | // Created by Dan Ginsburg on 6/17/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class EAGLView; 12 | 13 | @interface Stencil_TestAppDelegate : 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 | -------------------------------------------------------------------------------- /iPhone/Chapter_11/Stencil_Test/Classes/Stencil_TestAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // Stencil_TestAppDelegate.m 3 | // Stencil_Test 4 | // 5 | // Created by Dan Ginsburg on 6/17/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | #import "Stencil_TestAppDelegate.h" 10 | #import "EAGLView.h" 11 | 12 | @implementation Stencil_TestAppDelegate 13 | 14 | @synthesize window; 15 | @synthesize glView; 16 | 17 | - (void)applicationDidFinishLaunching:(UIApplication *)application { 18 | 19 | glView.animationInterval = 1.0 / 60.0; 20 | [glView startAnimation]; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | glView.animationInterval = 1.0 / 5.0; 26 | } 27 | 28 | 29 | - (void)applicationDidBecomeActive:(UIApplication *)application { 30 | glView.animationInterval = 1.0 / 60.0; 31 | } 32 | 33 | 34 | - (void)dealloc { 35 | [window release]; 36 | [glView release]; 37 | [super dealloc]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /iPhone/Chapter_11/Stencil_Test/Stencil_Test-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 | 30 | 31 | -------------------------------------------------------------------------------- /iPhone/Chapter_11/Stencil_Test/Stencil_Test_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Stencil_Test' target in the 'Stencil_Test' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /iPhone/Chapter_11/Stencil_Test/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Stencil_Test 4 | // 5 | // Created by Dan Ginsburg on 6/17/09. 6 | // Copyright __MyCompanyName__ 2009. 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 | -------------------------------------------------------------------------------- /iPhone/Chapter_13/ParticleSystem/Classes/EAGLView.h: -------------------------------------------------------------------------------- 1 | // 2 | // EAGLView.h 3 | // TextureWrap 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import "esUtil.h" 15 | 16 | /* 17 | This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. 18 | The view content is basically an EAGL surface you render your OpenGL scene into. 19 | Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. 20 | */ 21 | @interface EAGLView : UIView { 22 | 23 | @private 24 | /* The pixel dimensions of the backbuffer */ 25 | GLint backingWidth; 26 | GLint backingHeight; 27 | 28 | EAGLContext *context; 29 | 30 | /* OpenGL names for the renderbuffer and framebuffers used to render to this view */ 31 | GLuint viewRenderbuffer, viewFramebuffer; 32 | 33 | /* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */ 34 | GLuint depthRenderbuffer, stencilRenderbuffer; 35 | 36 | NSTimer *animationTimer; 37 | NSTimeInterval animationInterval; 38 | NSTimeInterval prevTick; 39 | 40 | // ES Programming Guide context 41 | ESContext esContext; 42 | } 43 | 44 | @property NSTimeInterval animationInterval; 45 | 46 | - (void)startAnimation; 47 | - (void)stopAnimation; 48 | - (void)drawView; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /iPhone/Chapter_13/ParticleSystem/Classes/ParticleSystemAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // ParticleSystemAppDelegate.h 3 | // ParticleSystem 4 | // 5 | // Created by Dan Ginsburg on 6/17/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class EAGLView; 12 | 13 | @interface ParticleSystemAppDelegate : 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 | -------------------------------------------------------------------------------- /iPhone/Chapter_13/ParticleSystem/Classes/ParticleSystemAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // ParticleSystemAppDelegate.m 3 | // ParticleSystem 4 | // 5 | // Created by Dan Ginsburg on 6/17/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | #import "ParticleSystemAppDelegate.h" 10 | #import "EAGLView.h" 11 | 12 | @implementation ParticleSystemAppDelegate 13 | 14 | @synthesize window; 15 | @synthesize glView; 16 | 17 | - (void)applicationDidFinishLaunching:(UIApplication *)application { 18 | 19 | glView.animationInterval = 1.0 / 60.0; 20 | [glView startAnimation]; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | glView.animationInterval = 1.0 / 5.0; 26 | } 27 | 28 | 29 | - (void)applicationDidBecomeActive:(UIApplication *)application { 30 | glView.animationInterval = 1.0 / 60.0; 31 | } 32 | 33 | 34 | - (void)dealloc { 35 | [window release]; 36 | [glView release]; 37 | [super dealloc]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /iPhone/Chapter_13/ParticleSystem/ParticleSystem-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 | 30 | 31 | -------------------------------------------------------------------------------- /iPhone/Chapter_13/ParticleSystem/ParticleSystem_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'ParticleSystem' target in the 'ParticleSystem' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /iPhone/Chapter_13/ParticleSystem/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ParticleSystem 4 | // 5 | // Created by Dan Ginsburg on 6/17/09. 6 | // Copyright __MyCompanyName__ 2009. 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 | -------------------------------------------------------------------------------- /iPhone/Chapter_13/ParticleSystem/smoke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nickdesaulniers/opengles2-book/5dfc5f90eded23273f1d62d1aaf660b53e2853cd/iPhone/Chapter_13/ParticleSystem/smoke.png -------------------------------------------------------------------------------- /iPhone/Chapter_2/Hello_Triangle/Classes/EAGLView.h: -------------------------------------------------------------------------------- 1 | // 2 | // EAGLView.h 3 | // Hello_Triangle 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import "esUtil.h" 15 | 16 | /* 17 | This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. 18 | The view content is basically an EAGL surface you render your OpenGL scene into. 19 | Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. 20 | */ 21 | @interface EAGLView : UIView { 22 | 23 | @private 24 | /* The pixel dimensions of the backbuffer */ 25 | GLint backingWidth; 26 | GLint backingHeight; 27 | 28 | EAGLContext *context; 29 | 30 | /* OpenGL names for the renderbuffer and framebuffers used to render to this view */ 31 | GLuint viewRenderbuffer, viewFramebuffer; 32 | 33 | /* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */ 34 | GLuint depthRenderbuffer; 35 | 36 | NSTimer *animationTimer; 37 | NSTimeInterval animationInterval; 38 | 39 | // ES Programming Guide context 40 | ESContext esContext; 41 | } 42 | 43 | @property NSTimeInterval animationInterval; 44 | 45 | - (void)startAnimation; 46 | - (void)stopAnimation; 47 | - (void)drawView; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /iPhone/Chapter_2/Hello_Triangle/Classes/Hello_TriangleAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Hello_TriangleAppDelegate.h 3 | // Hello_Triangle 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class EAGLView; 12 | 13 | @interface Hello_TriangleAppDelegate : 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 | -------------------------------------------------------------------------------- /iPhone/Chapter_2/Hello_Triangle/Classes/Hello_TriangleAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // Hello_TriangleAppDelegate.m 3 | // Hello_Triangle 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | #import "Hello_TriangleAppDelegate.h" 10 | #import "EAGLView.h" 11 | 12 | @implementation Hello_TriangleAppDelegate 13 | 14 | @synthesize window; 15 | @synthesize glView; 16 | 17 | - (void)applicationDidFinishLaunching:(UIApplication *)application { 18 | 19 | glView.animationInterval = 1.0 / 60.0; 20 | [glView startAnimation]; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | glView.animationInterval = 1.0 / 5.0; 26 | } 27 | 28 | 29 | - (void)applicationDidBecomeActive:(UIApplication *)application { 30 | glView.animationInterval = 1.0 / 60.0; 31 | } 32 | 33 | 34 | - (void)dealloc { 35 | [window release]; 36 | [glView release]; 37 | [super dealloc]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /iPhone/Chapter_2/Hello_Triangle/Hello_Triangle-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 | 30 | 31 | -------------------------------------------------------------------------------- /iPhone/Chapter_2/Hello_Triangle/Hello_Triangle_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Hello_Triangle' target in the 'Hello_Triangle' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /iPhone/Chapter_2/Hello_Triangle/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Hello_Triangle 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. 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 | -------------------------------------------------------------------------------- /iPhone/Chapter_8/Simple_VertexShader/Classes/EAGLView.h: -------------------------------------------------------------------------------- 1 | // 2 | // EAGLView.h 3 | // Hello_Triangle 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import "esUtil.h" 15 | 16 | /* 17 | This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. 18 | The view content is basically an EAGL surface you render your OpenGL scene into. 19 | Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. 20 | */ 21 | @interface EAGLView : UIView { 22 | 23 | @private 24 | /* The pixel dimensions of the backbuffer */ 25 | GLint backingWidth; 26 | GLint backingHeight; 27 | 28 | EAGLContext *context; 29 | 30 | /* OpenGL names for the renderbuffer and framebuffers used to render to this view */ 31 | GLuint viewRenderbuffer, viewFramebuffer; 32 | 33 | /* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */ 34 | GLuint depthRenderbuffer; 35 | 36 | NSTimer *animationTimer; 37 | NSTimeInterval animationInterval; 38 | NSTimeInterval prevTick; 39 | 40 | // ES Programming Guide context 41 | ESContext esContext; 42 | } 43 | 44 | @property NSTimeInterval animationInterval; 45 | 46 | - (void)startAnimation; 47 | - (void)stopAnimation; 48 | - (void)drawView; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /iPhone/Chapter_8/Simple_VertexShader/Classes/Simple_VertexShaderAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Simple_VertexShaderAppDelegate.h 3 | // Simple_VertexShader 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class EAGLView; 12 | 13 | @interface Simple_VertexShaderAppDelegate : 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 | -------------------------------------------------------------------------------- /iPhone/Chapter_8/Simple_VertexShader/Classes/Simple_VertexShaderAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // Simple_VertexShaderAppDelegate.m 3 | // Simple_VertexShader 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | #import "Simple_VertexShaderAppDelegate.h" 10 | #import "EAGLView.h" 11 | 12 | @implementation Simple_VertexShaderAppDelegate 13 | 14 | @synthesize window; 15 | @synthesize glView; 16 | 17 | - (void)applicationDidFinishLaunching:(UIApplication *)application { 18 | 19 | glView.animationInterval = 1.0 / 60.0; 20 | [glView startAnimation]; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | glView.animationInterval = 1.0 / 5.0; 26 | } 27 | 28 | 29 | - (void)applicationDidBecomeActive:(UIApplication *)application { 30 | glView.animationInterval = 1.0 / 60.0; 31 | } 32 | 33 | 34 | - (void)dealloc { 35 | [window release]; 36 | [glView release]; 37 | [super dealloc]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /iPhone/Chapter_8/Simple_VertexShader/Simple_VertexShader-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 | 30 | 31 | -------------------------------------------------------------------------------- /iPhone/Chapter_8/Simple_VertexShader/Simple_VertexShader_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Simple_VertexShader' target in the 'Simple_VertexShader' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /iPhone/Chapter_8/Simple_VertexShader/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Simple_VertexShader 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. 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 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/MipMap2D/Classes/EAGLView.h: -------------------------------------------------------------------------------- 1 | // 2 | // EAGLView.h 3 | // MipMap2D 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import "esUtil.h" 15 | 16 | /* 17 | This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. 18 | The view content is basically an EAGL surface you render your OpenGL scene into. 19 | Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. 20 | */ 21 | @interface EAGLView : UIView { 22 | 23 | @private 24 | /* The pixel dimensions of the backbuffer */ 25 | GLint backingWidth; 26 | GLint backingHeight; 27 | 28 | EAGLContext *context; 29 | 30 | /* OpenGL names for the renderbuffer and framebuffers used to render to this view */ 31 | GLuint viewRenderbuffer, viewFramebuffer; 32 | 33 | /* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */ 34 | GLuint depthRenderbuffer; 35 | 36 | NSTimer *animationTimer; 37 | NSTimeInterval animationInterval; 38 | NSTimeInterval prevTick; 39 | 40 | // ES Programming Guide context 41 | ESContext esContext; 42 | } 43 | 44 | @property NSTimeInterval animationInterval; 45 | 46 | - (void)startAnimation; 47 | - (void)stopAnimation; 48 | - (void)drawView; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/MipMap2D/Classes/MipMap2DAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // MipMap2DAppDelegate.h 3 | // MipMap2D 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class EAGLView; 12 | 13 | @interface MipMap2DAppDelegate : 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 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/MipMap2D/Classes/MipMap2DAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // MipMap2DAppDelegate.m 3 | // MipMap2D 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | #import "MipMap2DAppDelegate.h" 10 | #import "EAGLView.h" 11 | 12 | @implementation MipMap2DAppDelegate 13 | 14 | @synthesize window; 15 | @synthesize glView; 16 | 17 | - (void)applicationDidFinishLaunching:(UIApplication *)application { 18 | 19 | glView.animationInterval = 1.0 / 60.0; 20 | [glView startAnimation]; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | glView.animationInterval = 1.0 / 5.0; 26 | } 27 | 28 | 29 | - (void)applicationDidBecomeActive:(UIApplication *)application { 30 | glView.animationInterval = 1.0 / 60.0; 31 | } 32 | 33 | 34 | - (void)dealloc { 35 | [window release]; 36 | [glView release]; 37 | [super dealloc]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/MipMap2D/MipMap2D-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 | 30 | 31 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/MipMap2D/MipMap2D_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'MipMap2D' target in the 'MipMap2D' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/MipMap2D/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MipMap2D 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. 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 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/Simple_Texture2D/Classes/EAGLView.h: -------------------------------------------------------------------------------- 1 | // 2 | // EAGLView.h 3 | // Simple_Texture2D 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import "esUtil.h" 15 | 16 | /* 17 | This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. 18 | The view content is basically an EAGL surface you render your OpenGL scene into. 19 | Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. 20 | */ 21 | @interface EAGLView : UIView { 22 | 23 | @private 24 | /* The pixel dimensions of the backbuffer */ 25 | GLint backingWidth; 26 | GLint backingHeight; 27 | 28 | EAGLContext *context; 29 | 30 | /* OpenGL names for the renderbuffer and framebuffers used to render to this view */ 31 | GLuint viewRenderbuffer, viewFramebuffer; 32 | 33 | /* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */ 34 | GLuint depthRenderbuffer; 35 | 36 | NSTimer *animationTimer; 37 | NSTimeInterval animationInterval; 38 | NSTimeInterval prevTick; 39 | 40 | // ES Programming Guide context 41 | ESContext esContext; 42 | } 43 | 44 | @property NSTimeInterval animationInterval; 45 | 46 | - (void)startAnimation; 47 | - (void)stopAnimation; 48 | - (void)drawView; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/Simple_Texture2D/Classes/Simple_Texture2DAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Simple_Texture2DAppDelegate.h 3 | // Simple_Texture2D 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class EAGLView; 12 | 13 | @interface Simple_Texture2DAppDelegate : 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 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/Simple_Texture2D/Classes/Simple_Texture2DAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // Simple_Texture2DAppDelegate.m 3 | // Simple_Texture2D 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | #import "Simple_Texture2DAppDelegate.h" 10 | #import "EAGLView.h" 11 | 12 | @implementation Simple_Texture2DAppDelegate 13 | 14 | @synthesize window; 15 | @synthesize glView; 16 | 17 | - (void)applicationDidFinishLaunching:(UIApplication *)application { 18 | 19 | glView.animationInterval = 1.0 / 60.0; 20 | [glView startAnimation]; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | glView.animationInterval = 1.0 / 5.0; 26 | } 27 | 28 | 29 | - (void)applicationDidBecomeActive:(UIApplication *)application { 30 | glView.animationInterval = 1.0 / 60.0; 31 | } 32 | 33 | 34 | - (void)dealloc { 35 | [window release]; 36 | [glView release]; 37 | [super dealloc]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/Simple_Texture2D/Simple_Texture2D-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 | 30 | 31 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/Simple_Texture2D/Simple_Texture2D_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Simple_Texture2D' target in the 'Simple_Texture2D' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/Simple_Texture2D/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Simple_Texture2D 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. 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 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/Simple_TextureCubemap/Classes/EAGLView.h: -------------------------------------------------------------------------------- 1 | // 2 | // EAGLView.h 3 | // Simple_TextureCubemap 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import "esUtil.h" 15 | 16 | /* 17 | This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. 18 | The view content is basically an EAGL surface you render your OpenGL scene into. 19 | Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. 20 | */ 21 | @interface EAGLView : UIView { 22 | 23 | @private 24 | /* The pixel dimensions of the backbuffer */ 25 | GLint backingWidth; 26 | GLint backingHeight; 27 | 28 | EAGLContext *context; 29 | 30 | /* OpenGL names for the renderbuffer and framebuffers used to render to this view */ 31 | GLuint viewRenderbuffer, viewFramebuffer; 32 | 33 | /* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */ 34 | GLuint depthRenderbuffer; 35 | 36 | NSTimer *animationTimer; 37 | NSTimeInterval animationInterval; 38 | NSTimeInterval prevTick; 39 | 40 | // ES Programming Guide context 41 | ESContext esContext; 42 | } 43 | 44 | @property NSTimeInterval animationInterval; 45 | 46 | - (void)startAnimation; 47 | - (void)stopAnimation; 48 | - (void)drawView; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/Simple_TextureCubemap/Classes/Simple_TextureCubemapAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Simple_TextureCubemapAppDelegate.h 3 | // Simple_TextureCubemap 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class EAGLView; 12 | 13 | @interface Simple_TextureCubemapAppDelegate : 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 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/Simple_TextureCubemap/Classes/Simple_TextureCubemapAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // Simple_TextureCubemapAppDelegate.m 3 | // Simple_TextureCubemap 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | #import "Simple_TextureCubemapAppDelegate.h" 10 | #import "EAGLView.h" 11 | 12 | @implementation Simple_TextureCubemapAppDelegate 13 | 14 | @synthesize window; 15 | @synthesize glView; 16 | 17 | - (void)applicationDidFinishLaunching:(UIApplication *)application { 18 | 19 | glView.animationInterval = 1.0 / 60.0; 20 | [glView startAnimation]; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | glView.animationInterval = 1.0 / 5.0; 26 | } 27 | 28 | 29 | - (void)applicationDidBecomeActive:(UIApplication *)application { 30 | glView.animationInterval = 1.0 / 60.0; 31 | } 32 | 33 | 34 | - (void)dealloc { 35 | [window release]; 36 | [glView release]; 37 | [super dealloc]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/Simple_TextureCubemap/Simple_TextureCubemap-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 | 30 | 31 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/Simple_TextureCubemap/Simple_TextureCubemap_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Simple_TextureCubemap' target in the 'Simple_TextureCubemap' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/Simple_TextureCubemap/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Simple_TextureCubemap 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. 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 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/TextureWrap/Classes/EAGLView.h: -------------------------------------------------------------------------------- 1 | // 2 | // EAGLView.h 3 | // TextureWrap 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import "esUtil.h" 15 | 16 | /* 17 | This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. 18 | The view content is basically an EAGL surface you render your OpenGL scene into. 19 | Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. 20 | */ 21 | @interface EAGLView : UIView { 22 | 23 | @private 24 | /* The pixel dimensions of the backbuffer */ 25 | GLint backingWidth; 26 | GLint backingHeight; 27 | 28 | EAGLContext *context; 29 | 30 | /* OpenGL names for the renderbuffer and framebuffers used to render to this view */ 31 | GLuint viewRenderbuffer, viewFramebuffer; 32 | 33 | /* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */ 34 | GLuint depthRenderbuffer; 35 | 36 | NSTimer *animationTimer; 37 | NSTimeInterval animationInterval; 38 | NSTimeInterval prevTick; 39 | 40 | // ES Programming Guide context 41 | ESContext esContext; 42 | } 43 | 44 | @property NSTimeInterval animationInterval; 45 | 46 | - (void)startAnimation; 47 | - (void)stopAnimation; 48 | - (void)drawView; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/TextureWrap/Classes/TextureWrapAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // TextureWrapAppDelegate.h 3 | // TextureWrap 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class EAGLView; 12 | 13 | @interface TextureWrapAppDelegate : 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 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/TextureWrap/Classes/TextureWrapAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // TextureWrapAppDelegate.m 3 | // TextureWrap 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. All rights reserved. 7 | // 8 | 9 | #import "TextureWrapAppDelegate.h" 10 | #import "EAGLView.h" 11 | 12 | @implementation TextureWrapAppDelegate 13 | 14 | @synthesize window; 15 | @synthesize glView; 16 | 17 | - (void)applicationDidFinishLaunching:(UIApplication *)application { 18 | 19 | glView.animationInterval = 1.0 / 60.0; 20 | [glView startAnimation]; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | glView.animationInterval = 1.0 / 5.0; 26 | } 27 | 28 | 29 | - (void)applicationDidBecomeActive:(UIApplication *)application { 30 | glView.animationInterval = 1.0 / 60.0; 31 | } 32 | 33 | 34 | - (void)dealloc { 35 | [window release]; 36 | [glView release]; 37 | [super dealloc]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/TextureWrap/TextureWrap-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 | 30 | 31 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/TextureWrap/TextureWrap_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'TextureWrap' target in the 'TextureWrap' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /iPhone/Chapter_9/TextureWrap/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TextureWrap 4 | // 5 | // Created by Dan Ginsburg on 6/13/09. 6 | // Copyright __MyCompanyName__ 2009. 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 | -------------------------------------------------------------------------------- /iPhone/Common/Common_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'CocoaTouchStaticLibrary' target in the 'CocoaTouchStaticLibrary' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /iPhone/Common/ImageUtils.m: -------------------------------------------------------------------------------- 1 | // 2 | // ImageUtils.m 3 | // Common 4 | // 5 | // Created by Dan Ginsburg on 6/17/09. 6 | // Copyright 2009 __MyCompanyName__. All rights reserved. 7 | // 8 | #import 9 | #import 10 | 11 | /// 12 | // Load a 24-bit PNG file 13 | // 14 | char* esLoadPNG ( char *fileName, int *width, int *height ) 15 | { 16 | NSString *filePath = [NSString stringWithUTF8String: fileName]; 17 | NSString *path = [[NSBundle mainBundle] pathForResource: filePath ofType:@"png"]; 18 | NSData *texData = [[NSData alloc] initWithContentsOfFile:path]; 19 | UIImage *image = [[UIImage alloc] initWithData:texData]; 20 | 21 | *width = CGImageGetWidth(image.CGImage); 22 | *height = CGImageGetHeight(image.CGImage); 23 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 24 | void *imageData = malloc( *height * *width * 4 ); 25 | CGContextRef context = CGBitmapContextCreate( imageData, *width, *height, 8, 4 * *width, colorSpace, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big ); 26 | CGColorSpaceRelease( colorSpace ); 27 | CGContextClearRect( context, CGRectMake( 0, 0, *width, *height ) ); 28 | CGContextTranslateCTM( context, 0, *height - *height ); 29 | CGContextDrawImage( context, CGRectMake( 0, 0, *width, *height ), image.CGImage ); 30 | 31 | CGContextRelease(context); 32 | 33 | [image release]; 34 | [texData release]; 35 | 36 | return imageData; 37 | } -------------------------------------------------------------------------------- /iPhone/Common/esUtil.c: -------------------------------------------------------------------------------- 1 | // 2 | // Book: OpenGL(R) ES 2.0 Programming Guide 3 | // Authors: Aaftab Munshi, Dan Ginsburg, Dave Shreiner 4 | // ISBN-10: 0321502795 5 | // ISBN-13: 9780321502797 6 | // Publisher: Addison-Wesley Professional 7 | // URLs: http://safari.informit.com/9780321563835 8 | // http://www.opengles-book.com 9 | // 10 | 11 | // ESUtil.c 12 | // 13 | // A utility library for OpenGL ES. This library provides a 14 | // basic common framework for the example applications in the 15 | // OpenGL ES 2.0 Programming Guide. 16 | // 17 | 18 | /// 19 | // Includes 20 | // 21 | #include 22 | #include 23 | #include 24 | #include "esUtil.h" 25 | 26 | 27 | ////////////////////////////////////////////////////////////////// 28 | // 29 | // Public Functions 30 | // 31 | // 32 | 33 | /// 34 | // esInitContext() 35 | // 36 | // Initialize ES utility context. This must be called before calling any other 37 | // functions. 38 | // 39 | void ESUTIL_API esInitContext ( ESContext *esContext ) 40 | { 41 | if ( esContext != NULL ) 42 | { 43 | memset( esContext, 0, sizeof( ESContext) ); 44 | } 45 | } 46 | 47 | 48 | /// 49 | // esLogMessage() 50 | // 51 | // Log an error message to the debug output for the platform 52 | // 53 | void ESUTIL_API esLogMessage ( const char *formatStr, ... ) 54 | { 55 | 56 | va_list params; 57 | char buf[BUFSIZ]; 58 | 59 | va_start ( params, formatStr ); 60 | vsprintf ( buf, formatStr, params ); 61 | 62 | printf ( "%s", buf ); 63 | 64 | va_end ( params ); 65 | } 66 | 67 | --------------------------------------------------------------------------------
9 |
13 |
11 |
10 |
#include <esUtil.h>
18 |
36 |