author | Matt Plumtree <matt.plumtree@nokia.com> |
Fri, 12 Nov 2010 17:56:05 +0000 | |
branch | bug235_bringup_0 |
changeset 76 | 24381b61de5c |
parent 55 | 09263774e342 |
permissions | -rw-r--r-- |
24 | 1 |
/* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
2 |
* |
|
3 |
* Permission is hereby granted, free of charge, to any person obtaining a |
|
4 |
* copy of this software and associated documentation files (the "Software"), |
|
5 |
* to deal in the Software without restriction, including without limitation |
|
6 |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
|
7 |
* and/or sell copies of the Software, and to permit persons to whom the |
|
8 |
* Software is furnished to do so, subject to the following conditions: |
|
9 |
* |
|
10 |
* The above copyright notice and this permission notice shall be included |
|
11 |
* in all copies or substantial portions of the Software. |
|
12 |
* |
|
13 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
|
14 |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
15 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
|
16 |
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
|
17 |
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
|
18 |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
19 |
* |
|
20 |
* Initial Contributors: |
|
21 |
* Nokia Corporation - initial contribution. |
|
22 |
* |
|
23 |
* Contributors: |
|
24 |
* |
|
25 |
* Description: |
|
26 |
* |
|
27 |
*/ |
|
28 |
||
29 |
#ifndef _GLESCONTEXT_H_ |
|
30 |
#define _GLESCONTEXT_H_ |
|
31 |
||
32 |
#include "platform.h" |
|
33 |
#include "degl.h" |
|
34 |
#include "vertex.h" |
|
35 |
#include "buffer.h" |
|
36 |
#include "shader.h" |
|
37 |
#include "program.h" |
|
38 |
#include "texture.h" |
|
39 |
#include "fbo.h" |
|
40 |
||
76
24381b61de5c
Host OpenGL ES 2.0 code now building without warning or error using GCC.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
55
diff
changeset
|
41 |
#ifdef __cplusplus |
24381b61de5c
Host OpenGL ES 2.0 code now building without warning or error using GCC.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
55
diff
changeset
|
42 |
extern "C" { |
24381b61de5c
Host OpenGL ES 2.0 code now building without warning or error using GCC.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
55
diff
changeset
|
43 |
#endif |
24381b61de5c
Host OpenGL ES 2.0 code now building without warning or error using GCC.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
55
diff
changeset
|
44 |
|
24 | 45 |
typedef struct DGLContext |
46 |
{ |
|
47 |
GLboolean initialized; |
|
48 |
void* native_context; |
|
49 |
HGL hgl; // Extension procedure addresses are context-specific on WGL. |
|
50 |
||
51 |
unsigned int max_vertex_attribs; |
|
52 |
int max_texture_level; |
|
53 |
||
54 |
GLenum error; |
|
55 |
GLuint buffer_binding; |
|
56 |
GLuint texture_binding_2d; |
|
57 |
GLuint texture_binding_cube_map; |
|
58 |
GLuint framebuffer_binding; |
|
59 |
GLuint renderbuffer_binding; |
|
60 |
||
61 |
GLfloat attrib_zero[4]; // Attribute zero can't be set in desktop GL. |
|
62 |
||
63 |
DGLVertexArray* vertex_arrays; |
|
64 |
DGLBuffer* buffers; |
|
65 |
DGLShader* shaders; |
|
66 |
DGLProgram* programs; |
|
67 |
DGLTexture* textures; |
|
68 |
DGLRenderbuffer* renderbuffers; |
|
69 |
} DGLContext; |
|
70 |
||
71 |
DGLContext* DGLContext_create(void* native_context); |
|
72 |
GLboolean DGLContext_initialize(DGLContext* ctx); |
|
73 |
void DGLContext_destroy(DGLContext* ctx); |
|
74 |
||
75 |
void DGLContext_setError(DGLContext* ctx, GLenum error); |
|
76 |
GLenum DGLContext_getHostError(DGLContext* ctx); |
|
77 |
||
78 |
GLboolean DGLContext_createBuffer(DGLContext* ctx, GLuint buffer); |
|
79 |
void DGLContext_destroyBuffer(DGLContext* ctx, GLuint buffer); |
|
80 |
DGLBuffer* DGLContext_findBuffer(DGLContext* ctx, GLuint buffer); |
|
81 |
GLboolean DGLContext_bindBuffer(DGLContext* ctx, GLuint buffer); |
|
82 |
||
83 |
GLboolean DGLContext_createShader(DGLContext* ctx, GLuint shader); |
|
84 |
void DGLContext_destroyShader(DGLContext* ctx, GLuint shader); |
|
85 |
DGLShader* DGLContext_findShader(DGLContext* ctx, GLuint shader); |
|
86 |
GLboolean DGLContext_setShaderSource(DGLContext* ctx, GLuint shader, const char* source, int length); |
|
87 |
||
88 |
GLboolean DGLContext_createProgram(DGLContext* ctx, GLuint program); |
|
89 |
void DGLContext_destroyProgram(DGLContext* ctx, GLuint program); |
|
90 |
DGLProgram* DGLContext_findProgram(DGLContext* ctx, GLuint program); |
|
91 |
||
92 |
GLboolean DGLContext_createTexture(DGLContext* ctx, GLuint texture, DGLTextureType type); |
|
93 |
void DGLContext_destroyTexture(DGLContext* ctx, GLuint texture); |
|
94 |
DGLTexture* DGLContext_findTexture(DGLContext* ctx, GLuint texture); |
|
95 |
GLboolean DGLContext_bindTexture(DGLContext* ctx, GLenum target, GLuint name); |
|
96 |
DGLTexture* DGLContext_getTexture(DGLContext* ctx, GLenum target); |
|
97 |
DGLTextureLevel* DGLContext_getTextureLevel(DGLContext* ctx, GLenum target, GLint level); |
|
98 |
GLboolean DGLContext_specifyTextureFromEGLImage(DGLContext* ctx, GLeglImageOES image, GLenum target); |
|
99 |
||
100 |
GLboolean DGLContext_createRenderbuffer(DGLContext* ctx, GLuint buffer); |
|
101 |
void DGLContext_destroyRenderbuffer(DGLContext* ctx, GLuint buffer); |
|
102 |
DGLRenderbuffer* DGLContext_getColorRenderbuffer(DGLContext* ctx); |
|
103 |
DGLRenderbuffer* DGLContext_findRenderbuffer(DGLContext* ctx, GLuint buffer); |
|
104 |
GLboolean DGLContext_bindRenderbuffer(DGLContext* ctx, GLuint buffer); |
|
105 |
GLboolean DGLContext_specifyRenderbufferFromEGLImage(DGLContext* ctx, GLeglImageOES image); |
|
106 |
||
107 |
void DGLContext_updateFBOAttachmentSiblings(DGLContext* ctx); |
|
108 |
||
109 |
#ifdef __cplusplus |
|
110 |
} |
|
111 |
#endif |
|
112 |
||
113 |
#endif // _GLESCONTEXT_H_ |