OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MOJO_PUBLIC_C_GLES2_GLES2_H_ | 5 #ifndef MOJO_PUBLIC_C_GLES2_GLES2_H_ |
6 #define MOJO_PUBLIC_C_GLES2_GLES2_H_ | 6 #define MOJO_PUBLIC_C_GLES2_GLES2_H_ |
7 | 7 |
8 // Note: This header should be compilable as C. | 8 // Note: This header should be compilable as C. |
9 | 9 |
10 #include <stdint.h> | 10 #include <stdint.h> |
11 #include <GLES2/gl2.h> | 11 #include <GLES2/gl2.h> |
12 | 12 |
13 #include "mojo/public/c/environment/async_waiter.h" | 13 #include "mojo/public/c/environment/async_waiter.h" |
14 #include "mojo/public/c/gles2/gles2_export.h" | 14 #include "mojo/public/c/gles2/gles2_export.h" |
15 #include "mojo/public/c/gles2/gles2_types.h" | 15 #include "mojo/public/c/gles2/gles2_types.h" |
16 #include "mojo/public/c/system/types.h" | 16 #include "mojo/public/c/system/types.h" |
17 | 17 |
18 #ifdef __cplusplus | 18 #ifdef __cplusplus |
19 extern "C" { | 19 extern "C" { |
20 #endif | 20 #endif |
21 | 21 |
22 MOJO_GLES2_EXPORT void MojoGLES2Initialize(const MojoAsyncWaiter* async_waiter); | 22 MOJO_GLES2_EXPORT MojoGLES2Context |
23 MOJO_GLES2_EXPORT void MojoGLES2Terminate(void); | 23 MojoGLES2CreateContext(MojoHandle handle, |
24 MOJO_GLES2_EXPORT MojoGLES2Context MojoGLES2CreateContext( | 24 MojoGLES2ContextLost lost_callback, |
25 MojoHandle handle, | 25 void* closure, |
26 MojoGLES2ContextLost lost_callback, | 26 const MojoAsyncWaiter* async_waiter); |
27 void* closure); | |
28 MOJO_GLES2_EXPORT void MojoGLES2DestroyContext(MojoGLES2Context context); | 27 MOJO_GLES2_EXPORT void MojoGLES2DestroyContext(MojoGLES2Context context); |
29 MOJO_GLES2_EXPORT void MojoGLES2MakeCurrent(MojoGLES2Context context); | 28 MOJO_GLES2_EXPORT void MojoGLES2MakeCurrent(MojoGLES2Context context); |
30 MOJO_GLES2_EXPORT void MojoGLES2SwapBuffers(void); | 29 MOJO_GLES2_EXPORT void MojoGLES2SwapBuffers(void); |
31 | 30 |
32 // TODO(piman): We shouldn't have to leak those 2 interfaces, especially in a | 31 // TODO(piman): We shouldn't have to leak those 2 interfaces, especially in a |
33 // type-unsafe way. | 32 // type-unsafe way. |
34 MOJO_GLES2_EXPORT void* MojoGLES2GetGLES2Interface(MojoGLES2Context context); | 33 MOJO_GLES2_EXPORT void* MojoGLES2GetGLES2Interface(MojoGLES2Context context); |
35 MOJO_GLES2_EXPORT void* MojoGLES2GetContextSupport(MojoGLES2Context context); | 34 MOJO_GLES2_EXPORT void* MojoGLES2GetContextSupport(MojoGLES2Context context); |
36 | 35 |
37 #define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \ | 36 #define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \ |
38 MOJO_GLES2_EXPORT ReturnType GL_APIENTRY gl##Function PARAMETERS; | 37 MOJO_GLES2_EXPORT ReturnType GL_APIENTRY gl##Function PARAMETERS; |
39 #include "mojo/public/c/gles2/gles2_call_visitor_autogen.h" | 38 #include "mojo/public/c/gles2/gles2_call_visitor_autogen.h" |
40 #undef VISIT_GL_CALL | 39 #undef VISIT_GL_CALL |
41 | 40 |
42 #ifdef __cplusplus | 41 #ifdef __cplusplus |
43 } // extern "C" | 42 } // extern "C" |
44 #endif | 43 #endif |
45 | 44 |
46 #endif // MOJO_PUBLIC_C_GLES2_GLES2_H_ | 45 #endif // MOJO_PUBLIC_C_GLES2_GLES2_H_ |
OLD | NEW |