10 |
13 | 1.3.6
14 |
15 |
16 |
--------------------------------------------------------------------------------
/iPhone/Chapter_8/Simple_VertexShader/Simple_VertexShader-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 | 11 |
17 | 1.3.6
18 |
19 |
20 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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
--------------------------------------------------------------------------------
/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 11 |
17 | 1.3.6
18 |
19 |
20 |
--------------------------------------------------------------------------------
/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 | ESContext | |
| ESMatrix | |
| TGA_HEADER |
16 | 1.3.6
17 |
18 |
19 |
--------------------------------------------------------------------------------
/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 9 |
| ESMatrix |
| TGA_HEADER | ||
| ESContext |
13 |
16 | 1.3.6
17 |
18 |
19 |
--------------------------------------------------------------------------------
/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 #include <esUtil.h>
9 | 10 |
Data Fields | |
| GLfloat | m [4][4] |
18 |
21 |
|
26 |
| 31 | 32 | | 33 |
34 |
35 | 36 | |
37 |
44 | 1.3.6
45 |
46 |
47 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/BlackBerry/Common/.project:
--------------------------------------------------------------------------------
1 |
2 |