OLD | NEW |
1 // | 1 // |
2 // Book: OpenGL(R) ES 2.0 Programming Guide | 2 // Book: OpenGL(R) ES 2.0 Programming Guide |
3 // Authors: Aaftab Munshi, Dan Ginsburg, Dave Shreiner | 3 // Authors: Aaftab Munshi, Dan Ginsburg, Dave Shreiner |
4 // ISBN-10: 0321502795 | 4 // ISBN-10: 0321502795 |
5 // ISBN-13: 9780321502797 | 5 // ISBN-13: 9780321502797 |
6 // Publisher: Addison-Wesley Professional | 6 // Publisher: Addison-Wesley Professional |
7 // URLs: http://safari.informit.com/9780321563835 | 7 // URLs: http://safari.informit.com/9780321563835 |
8 // http://www.opengles-book.com | 8 // http://www.opengles-book.com |
9 // | 9 // |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 { | 61 { |
62 /// Put your user data here... | 62 /// Put your user data here... |
63 void* userData; | 63 void* userData; |
64 | 64 |
65 /// Window width | 65 /// Window width |
66 GLint width; | 66 GLint width; |
67 | 67 |
68 /// Window height | 68 /// Window height |
69 GLint height; | 69 GLint height; |
70 | 70 |
| 71 /// EGL flags |
| 72 GLuint flags; |
| 73 ··· |
71 /// Window handle | 74 /// Window handle |
72 EGLNativeWindowType hWnd; | 75 EGLNativeWindowType hWnd; |
73 | 76 |
74 /// EGL display | 77 /// EGL display |
75 EGLDisplay eglDisplay; | 78 EGLDisplay eglDisplay; |
76 ······ | 79 ······ |
77 /// EGL context | 80 /// EGL context |
78 EGLContext eglContext; | 81 EGLContext eglContext; |
79 | 82 |
80 /// EGL surface | 83 /// EGL surface |
81 EGLSurface eglSurface; | 84 EGLSurface eglSurface; |
82 | 85 |
| 86 /// EGL config |
| 87 EGLConfig eglConfig; |
| 88 ··· |
83 /// Callbacks | 89 /// Callbacks |
84 void (ESCALLBACK *drawFunc) ( void* ); | 90 int (ESCALLBACK *initFunc) ( void* ); |
| 91 int (ESCALLBACK *drawFunc) ( void* ); |
85 void (ESCALLBACK *keyFunc) ( void*, unsigned char, int, int ); | 92 void (ESCALLBACK *keyFunc) ( void*, unsigned char, int, int ); |
86 void (ESCALLBACK *updateFunc) ( void*, float deltaTime ); | 93 void (ESCALLBACK *updateFunc) ( void*, float deltaTime ); |
| 94 void (ESCALLBACK *shutdownFunc) ( void* ); |
87 } ESContext; | 95 } ESContext; |
88 | 96 |
89 | 97 |
90 /// | 98 /// |
91 // Public Functions | 99 // Public Functions |
92 // | 100 // |
93 | 101 |
94 // | 102 // |
95 /// | 103 /// |
96 /// \brief Initialize ES framework context. This must be called before calling
any other functions. | 104 /// \brief Initialize ES framework context. This must be called before calling
any other functions. |
(...skipping 16 matching lines...) Expand all Loading... |
113 /// \return GL_TRUE if window creation is succesful, GL_FALSE otherwise | 121 /// \return GL_TRUE if window creation is succesful, GL_FALSE otherwise |
114 GLboolean ESUTIL_API esCreateWindow ( ESContext *esContext, LPCTSTR title, GLint
width, GLint height, GLuint flags ); | 122 GLboolean ESUTIL_API esCreateWindow ( ESContext *esContext, LPCTSTR title, GLint
width, GLint height, GLuint flags ); |
115 | 123 |
116 // | 124 // |
117 /// \brief Start the main loop for the OpenGL ES application | 125 /// \brief Start the main loop for the OpenGL ES application |
118 /// \param esContext Application context | 126 /// \param esContext Application context |
119 // | 127 // |
120 void ESUTIL_API esMainLoop ( ESContext *esContext ); | 128 void ESUTIL_API esMainLoop ( ESContext *esContext ); |
121 | 129 |
122 // | 130 // |
| 131 /// \brief Register an initialization callback function to be used to initialize
the program and recover from context lost. |
| 132 /// \param esContext Application context |
| 133 /// \param drawFunc Draw callback function that will be used to initialize the p
rogram |
| 134 // |
| 135 void ESUTIL_API esRegisterInitFunc ( ESContext *esContext, int (ESCALLBACK *init
Func) ( ESContext* ) ); |
| 136 |
| 137 // |
123 /// \brief Register a draw callback function to be used to render each frame | 138 /// \brief Register a draw callback function to be used to render each frame |
124 /// \param esContext Application context | 139 /// \param esContext Application context |
125 /// \param drawFunc Draw callback function that will be used to render the scene | 140 /// \param drawFunc Draw callback function that will be used to render the scene |
126 // | 141 // |
127 void ESUTIL_API esRegisterDrawFunc ( ESContext *esContext, void (ESCALLBACK *dra
wFunc) ( ESContext* ) ); | 142 void ESUTIL_API esRegisterDrawFunc ( ESContext *esContext, int (ESCALLBACK *draw
Func) ( ESContext* ) ); |
128 | 143 |
129 // | 144 // |
130 /// \brief Register an update callback function to be used to update on each tim
e step | 145 /// \brief Register an update callback function to be used to update on each tim
e step |
131 /// \param esContext Application context | 146 /// \param esContext Application context |
132 /// \param updateFunc Update callback function that will be used to render the s
cene | 147 /// \param updateFunc Update callback function that will be used to render the s
cene |
133 // | 148 // |
134 void ESUTIL_API esRegisterUpdateFunc ( ESContext *esContext, void (ESCALLBACK *u
pdateFunc) ( ESContext*, float ) ); | 149 void ESUTIL_API esRegisterUpdateFunc ( ESContext *esContext, void (ESCALLBACK *u
pdateFunc) ( ESContext*, float ) ); |
135 | 150 |
136 // | 151 // |
137 /// \brief Register an keyboard input processing callback function | 152 /// \brief Register an keyboard input processing callback function |
138 /// \param esContext Application context | 153 /// \param esContext Application context |
139 /// \param keyFunc Key callback function for application processing of keyboard
input | 154 /// \param keyFunc Key callback function for application processing of keyboard
input |
140 // | 155 // |
141 void ESUTIL_API esRegisterKeyFunc ( ESContext *esContext,· | 156 void ESUTIL_API esRegisterKeyFunc ( ESContext *esContext,· |
142 void (ESCALLBACK *drawFunc) ( ESContext*, un
signed char, int, int ) ); | 157 void (ESCALLBACK *drawFunc) ( ESContext*, un
signed char, int, int ) ); |
| 158 |
| 159 // |
| 160 /// \brief Register an shutdon callback function to be used to shutdown the prog
ram and recover from context lost. |
| 161 /// \param esContext Application context |
| 162 /// \param drawFunc Draw callback function that will be used to shutdown the pro
gram |
| 163 // |
| 164 void ESUTIL_API esRegisterShutdownFunc ( ESContext *esContext, void (ESCALLBACK
*initFunc) ( ESContext* ) ); |
| 165 |
143 // | 166 // |
144 /// \brief Log a message to the debug output for the platform | 167 /// \brief Log a message to the debug output for the platform |
145 /// \param formatStr Format string for error log.·· | 168 /// \param formatStr Format string for error log.·· |
146 // | 169 // |
147 void ESUTIL_API esLogMessage ( const char *formatStr, ... ); | 170 void ESUTIL_API esLogMessage ( const char *formatStr, ... ); |
148 | 171 |
149 // | 172 // |
150 /// | 173 /// |
151 /// \brief Load a shader, check for compile errors, print error messages to outp
ut log | 174 /// \brief Load a shader, check for compile errors, print error messages to outp
ut log |
152 /// \param type Type of shader (GL_VERTEX_SHADER or GL_FRAGMENT_SHADER) | 175 /// \param type Type of shader (GL_VERTEX_SHADER or GL_FRAGMENT_SHADER) |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 //// \brief return an indentity matrix· | 288 //// \brief return an indentity matrix· |
266 //// \param result returns identity matrix | 289 //// \param result returns identity matrix |
267 // | 290 // |
268 void ESUTIL_API esMatrixLoadIdentity(ESMatrix *result); | 291 void ESUTIL_API esMatrixLoadIdentity(ESMatrix *result); |
269 | 292 |
270 #ifdef __cplusplus | 293 #ifdef __cplusplus |
271 } | 294 } |
272 #endif | 295 #endif |
273 | 296 |
274 #endif // ESUTIL_H | 297 #endif // ESUTIL_H |
OLD | NEW |