8d6f4af062956dc6963d69f6962eb14540e6bd0f
[iec.git] / src / type3_AndroidCloud / anbox-master / external / android-emugl / host / libs / GLESv2_dec / GLESv2Decoder.h
1 /*
2 * Copyright 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #ifndef _GL2_DECODER_H_
18 #define _GL2_DECODER_H_
19
20 #include "gles2_dec.h"
21 #include "GLDecoderContextData.h"
22 #include "emugl/common/shared_library.h"
23
24 class GLESv2Decoder : public gles2_decoder_context_t
25 {
26 public:
27     typedef void *(*get_proc_func_t)(const char *name, void *userData);
28     GLESv2Decoder();
29     ~GLESv2Decoder();
30     int initGL(get_proc_func_t getProcFunc, void *getProcFuncData);
31     void setContextData(GLDecoderContextData *contextData) { m_contextData = contextData; }
32 private:
33     GLDecoderContextData *m_contextData;
34     emugl::SharedLibrary* m_GL2library;
35
36     static void *s_getProc(const char *name, void *userData);
37     static void gles2_APIENTRY s_glGetCompressedTextureFormats(void *self, int count, GLint *formats);
38     static void gles2_APIENTRY s_glVertexAttribPointerData(void *self, GLuint indx, GLint size, GLenum type,
39                                       GLboolean normalized, GLsizei stride,  void * data, GLuint datalen);
40     static void gles2_APIENTRY s_glVertexAttribPointerOffset(void *self, GLuint indx, GLint size, GLenum type,
41                                         GLboolean normalized, GLsizei stride,  GLuint offset);
42
43     static void gles2_APIENTRY s_glDrawElementsOffset(void *self, GLenum mode, GLsizei count, GLenum type, GLuint offset);
44     static void gles2_APIENTRY s_glDrawElementsData(void *self, GLenum mode, GLsizei count, GLenum type, void * data, GLuint datalen);
45     static void gles2_APIENTRY s_glShaderString(void *self, GLuint shader, const GLchar* string, GLsizei len);
46     static int  gles2_APIENTRY s_glFinishRoundTrip(void *self);
47 };
48 #endif