summaryrefslogtreecommitdiffstats
path: root/mojo/public/c/gles2/gles2.h
blob: 6b20b9c596df40d437c9166be6edfe69ed361f52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MOJO_PUBLIC_C_GLES2_GLES2_H_
#define MOJO_PUBLIC_C_GLES2_GLES2_H_

// Note: This header should be compilable as C.

#include <stdint.h>
#include <GLES2/gl2.h>

#include "mojo/public/c/gles2/gles2_export.h"
#include "mojo/public/c/gles2/gles2_types.h"
#include "mojo/public/c/system/async_waiter.h"
#include "mojo/public/c/system/core.h"

#ifdef __cplusplus
extern "C" {
#endif

MOJO_GLES2_EXPORT void MojoGLES2Initialize(MojoAsyncWaiter* async_waiter);
MOJO_GLES2_EXPORT void MojoGLES2Terminate();
MOJO_GLES2_EXPORT MojoGLES2Context MojoGLES2CreateContext(
    MojoHandle handle,
    MojoGLES2ContextLost lost_callback,
    MojoGLES2DrawAnimationFrame animation_callback,
    void* closure);
MOJO_GLES2_EXPORT void MojoGLES2DestroyContext(MojoGLES2Context context);
MOJO_GLES2_EXPORT void MojoGLES2MakeCurrent(MojoGLES2Context context);
MOJO_GLES2_EXPORT void MojoGLES2SwapBuffers();
// TODO(piman): this doesn't belong here.
MOJO_GLES2_EXPORT void MojoGLES2RequestAnimationFrames(
    MojoGLES2Context context);
MOJO_GLES2_EXPORT void MojoGLES2CancelAnimationFrames(MojoGLES2Context context);

// TODO(piman): We shouldn't have to leak those 2 interfaces, especially in a
// type-unsafe way.
MOJO_GLES2_EXPORT void* MojoGLES2GetGLES2Interface(MojoGLES2Context context);
MOJO_GLES2_EXPORT void* MojoGLES2GetContextSupport(MojoGLES2Context context);

#define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \
  MOJO_GLES2_EXPORT ReturnType GL_APIENTRY gl##Function PARAMETERS;
#include "mojo/public/c/gles2/gles2_call_visitor_autogen.h"
#undef VISIT_GL_CALL

#ifdef __cplusplus
}  // extern "C"
#endif

#endif  // MOJO_PUBLIC_C_GLES2_GLES2_H_