OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
2 // for details. All rights reserved. Use of this source code is governed by a | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 #ifndef EMBEDDERS_OPENGLUI_COMMON_OPENGL_H_ | |
6 #define EMBEDDERS_OPENGLUI_COMMON_OPENGL_H_ | |
7 | |
8 #if defined(__APPLE__) | |
9 # ifdef GL_ES_VERSION_2_0 | |
10 # include <OpenGLES/ES2/gl.h> | |
11 # else | |
12 # include <Glut/glut.h> | |
13 # include <OpenGL/gl.h> | |
14 # endif | |
vsm
2013/01/14 21:31:40
Why the funny spacing with '#'? It is inconsisten
gram
2013/01/16 01:49:16
Done.
| |
15 #define GLSwapBuffers() glutSwapBuffers() | |
16 #elif defined(_WIN32) || defined(_WIN64) | |
17 #include <GL/glew.h> | |
18 #include <GL/wglew.h> | |
19 #include <GLUT/glut.h> // changed according to your path of glut.h | |
20 #include <Windows.h> | |
21 #define GLSwapBuffers() glutSwapBuffers() | |
22 #elif defined(__ANDROID__) | |
23 #include <EGL/egl.h> | |
24 #include <GLES2/gl2.h> | |
25 #include <GLES2/gl2ext.h> | |
26 | |
27 #define GLSwapBuffers() \ | |
28 do {\ | |
29 EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); \ | |
30 EGLSurface surface = eglGetCurrentSurface(EGL_DRAW); \ | |
31 eglSwapBuffers(display, surface); \ | |
32 } while (0); | |
33 | |
34 #else | |
35 #define GL_GLEXT_PROTOTYPES 1 | |
36 #include <GL/gl.h> | |
37 #include <GL/glext.h> | |
38 #include <GL/glut.h> | |
39 #define GLSwapBuffers() glutSwapBuffers() | |
40 #endif | |
41 | |
42 #endif // EMBEDDERS_OPENGLUI_COMMON_OPENGL_H_ | |
43 | |
OLD | NEW |