Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: runtime/embedders/openglui/common/opengl.h

Issue 11883013: Refactored OpenGL embedder that works on Android, Mac or Linux. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/embedders/openglui/common/log.h ('k') | runtime/embedders/openglui/common/resource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013, 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 // A semi-generic header file that can be used to isolate platform differences
6 // for OpenGL headers.
7 #ifndef EMBEDDERS_OPENGLUI_COMMON_OPENGL_H_
8 #define EMBEDDERS_OPENGLUI_COMMON_OPENGL_H_
9
10 #if defined(__APPLE__)
11 # ifdef GL_ES_VERSION_2_0
12 # include <OpenGLES/ES2/gl.h>
13 # else
14 # include <Glut/glut.h>
15 # include <OpenGL/gl.h>
16 # endif
17 # define GLSwapBuffers() glutSwapBuffers()
18 #elif defined(_WIN32) || defined(_WIN64)
19 # include <GL/glew.h>
20 # include <GL/wglew.h>
21 # include <GLUT/glut.h>
22 # include <Windows.h>
23 # define GLSwapBuffers() glutSwapBuffers()
24 #elif defined(__ANDROID__)
25 # include <EGL/egl.h>
26 # include <GLES2/gl2.h>
27 # include <GLES2/gl2ext.h>
28 # define GLSwapBuffers() \
29 do {\
30 EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); \
31 EGLSurface surface = eglGetCurrentSurface(EGL_DRAW); \
32 eglSwapBuffers(display, surface); \
33 } while (0);
34 #else // Linux.
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
OLDNEW
« no previous file with comments | « runtime/embedders/openglui/common/log.h ('k') | runtime/embedders/openglui/common/resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698