Home | History | Annotate | Download | only in gles2
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef MOJO_PUBLIC_C_GLES2_GLES2_H_
      6 #define MOJO_PUBLIC_C_GLES2_GLES2_H_
      7 
      8 // Note: This header should be compilable as C.
      9 
     10 #include <stdint.h>
     11 #include <GLES2/gl2.h>
     12 
     13 #include "mojo/public/c/environment/async_waiter.h"
     14 #include "mojo/public/c/gles2/gles2_export.h"
     15 #include "mojo/public/c/gles2/gles2_types.h"
     16 #include "mojo/public/c/system/types.h"
     17 
     18 #ifdef __cplusplus
     19 extern "C" {
     20 #endif
     21 
     22 MOJO_GLES2_EXPORT void MojoGLES2Initialize(const MojoAsyncWaiter* async_waiter);
     23 MOJO_GLES2_EXPORT void MojoGLES2Terminate(void);
     24 MOJO_GLES2_EXPORT MojoGLES2Context MojoGLES2CreateContext(
     25     MojoHandle handle,
     26     MojoGLES2ContextLost lost_callback,
     27     MojoGLES2DrawAnimationFrame animation_callback,
     28     void* closure);
     29 MOJO_GLES2_EXPORT void MojoGLES2DestroyContext(MojoGLES2Context context);
     30 MOJO_GLES2_EXPORT void MojoGLES2MakeCurrent(MojoGLES2Context context);
     31 MOJO_GLES2_EXPORT void MojoGLES2SwapBuffers(void);
     32 // TODO(piman): this doesn't belong here.
     33 MOJO_GLES2_EXPORT void MojoGLES2RequestAnimationFrames(
     34     MojoGLES2Context context);
     35 MOJO_GLES2_EXPORT void MojoGLES2CancelAnimationFrames(MojoGLES2Context context);
     36 
     37 // TODO(piman): We shouldn't have to leak those 2 interfaces, especially in a
     38 // type-unsafe way.
     39 MOJO_GLES2_EXPORT void* MojoGLES2GetGLES2Interface(MojoGLES2Context context);
     40 MOJO_GLES2_EXPORT void* MojoGLES2GetContextSupport(MojoGLES2Context context);
     41 
     42 #define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \
     43   MOJO_GLES2_EXPORT ReturnType GL_APIENTRY gl##Function PARAMETERS;
     44 #include "mojo/public/c/gles2/gles2_call_visitor_autogen.h"
     45 #undef VISIT_GL_CALL
     46 
     47 #ifdef __cplusplus
     48 }  // extern "C"
     49 #endif
     50 
     51 #endif  // MOJO_PUBLIC_C_GLES2_GLES2_H_
     52