Tizen 2.1 base
[sdk/emulator/qemu.git] / gl / dgles2 / src / include / common-vertex.h
1 /* Copyright (C) 2010  Nokia Corporation All Rights Reserved.
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
21 #ifndef COMMON_VERTEX_H_
22 #define COMMON_VERTEX_H_
23
24 #if(defined BUILD_GLES2)
25 #       include "hgl2api.h"
26 #else
27 #       include "hglapi.h"
28 #endif
29
30 // set to 1 to enable extra vertex debug info
31 // configure with --enable-debug is also needed
32 #define DEBUG_VERTEX 0
33
34 // set to 0 to make no local copies of element array buffers
35 // -- potentially slower drawing, but does not need to allocate extra memory
36 // set to 1 to make local copies of element array buffers
37 // -- faster drawing, but all related buffer objects are cached in process heap
38
39 //
40 // Currently broken, use "1"
41 //
42 #define CACHE_ELEMENT_BUFFERS 1
43
44 // GLES Vertex array data holder.
45 typedef struct DGLVertexArray
46 {
47         GLenum array;         // Which array (e.g. GL_COLOR_ARRAY).
48         GLint size;           // Function call parameter.
49         GLboolean normalized; // --''--
50         GLenum type;          // --''--
51         GLsizei stride;       // --''--
52         const void* ptr;      // --''--
53         GLboolean enabled;    // State.
54         GLfloat* floatptr;    // Buffer for fixed->float conversion.
55         GLuint buffer;         //binded vbo
56 } DGLVertexArray;
57
58 extern void dglVertexInit(void);
59 extern void dglVertexFinish(void);
60
61 #endif // COMMON_VERTEX_H_