OpenGL ES SDK for Android
ARM Developer Center
Home
Pages
Namespaces
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
FrameBufferObject.h
Go to the documentation of this file.
1
/* Copyright (c) 2012-2017, ARM Limited and Contributors
2
*
3
* SPDX-License-Identifier: MIT
4
*
5
* Permission is hereby granted, free of charge,
6
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
7
* to deal in the Software without restriction, including without limitation the rights to
8
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
9
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
*
11
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12
*
13
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
14
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19
*/
20
21
#ifndef FRAMEBUFFEROBJECT_H
22
#define FRAMEBUFFEROBJECT_H
23
24
#define GLES_VERSION 2
25
26
#include <GLES2/gl2.h>
27
28
/* These indices describe the cube triangle strips, separated by degenerate triangles where necessary. */
29
static
const
GLubyte
cubeIndices
[] =
30
{
31
0, 1, 2, 3, 3, 4, 4, 5, 6, 7, 7, 8, 8, 9, 10, 11, 11, 12, 12, 13, 14, 15, 15, 16, 16, 17, 18, 19, 19, 20, 20, 21, 22, 23,
32
};
33
34
/* Tri strips, so quads are in this order:
35
*
36
* 2 ----- 3
37
* | \ |
38
* | \ |6 - 7
39
* | \ || \ |
40
* 0 ----- 14 - 5
41
*/
42
static
const
float
cubeVertices
[] =
43
{
44
/* Front. */
45
-0.5f, -0.5f, 0.5f,
/* 0 */
46
0.5f, -0.5f, 0.5f,
/* 1 */
47
-0.5f, 0.5f, 0.5f,
/* 2 */
48
0.5f, 0.5f, 0.5f,
/* 3 */
49
50
/* Right. */
51
0.5f, -0.5f, 0.5f,
/* 4 */
52
0.5f, -0.5f, -0.5f,
/* 5 */
53
0.5f, 0.5f, 0.5f,
/* 6 */
54
0.5f, 0.5f, -0.5f,
/* 7 */
55
56
/* Back. */
57
0.5f, -0.5f, -0.5f,
/* 8 */
58
-0.5f, -0.5f, -0.5f,
/* 9 */
59
0.5f, 0.5f, -0.5f,
/* 10 */
60
-0.5f, 0.5f, -0.5f,
/* 11 */
61
62
/* Left. */
63
-0.5f, -0.5f, -0.5f,
/* 12 */
64
-0.5f, -0.5f, 0.5f,
/* 13 */
65
-0.5f, 0.5f, -0.5f,
/* 14 */
66
-0.5f, 0.5f, 0.5f,
/* 15 */
67
68
/* Top. */
69
-0.5f, 0.5f, 0.5f,
/* 16 */
70
0.5f, 0.5f, 0.5f,
/* 17 */
71
-0.5f, 0.5f, -0.5f,
/* 18 */
72
0.5f, 0.5f, -0.5f,
/* 19 */
73
74
/* Bottom. */
75
-0.5f, -0.5f, -0.5f,
/* 20 */
76
0.5f, -0.5f, -0.5f,
/* 21 */
77
-0.5f, -0.5f, 0.5f,
/* 22 */
78
0.5f, -0.5f, 0.5f,
/* 23 */
79
};
80
81
static
const
float
cubeTextureCoordinates
[] =
82
{
83
/* Front. */
84
0.0f, 0.0f,
/* 0 */
85
1.0f, 0.0f,
/* 1 */
86
0.0f, 1.0f,
/* 2 */
87
1.0f, 1.0f,
/* 3 */
88
89
/* Right. */
90
0.0f, 0.0f,
/* 4 */
91
1.0f, 0.0f,
/* 5 */
92
0.0f, 1.0f,
/* 6 */
93
1.0f, 1.0f,
/* 7 */
94
95
/* Back. */
96
0.0f, 0.0f,
/* 8 */
97
1.0f, 0.0f,
/* 9 */
98
0.0f, 1.0f,
/* 10 */
99
1.0f, 1.0f,
/* 11 */
100
101
/* Left. */
102
0.0f, 0.0f,
/* 12 */
103
1.0f, 0.0f,
/* 13 */
104
0.0f, 1.0f,
/* 14 */
105
1.0f, 1.0f,
/* 15 */
106
107
/* Top. */
108
0.0f, 0.0f,
/* 16 */
109
1.0f, 0.0f,
/* 17 */
110
0.0f, 1.0f,
/* 18 */
111
1.0f, 1.0f,
/* 19 */
112
113
/* Bottom. */
114
0.0f, 0.0f,
/* 20 */
115
1.0f, 0.0f,
/* 21 */
116
0.0f, 1.0f,
/* 22 */
117
1.0f, 1.0f,
/* 23 */
118
119
};
120
121
static
const
float
cubeColors
[] =
122
{
123
/* Front. */
124
0.0f, 0.0f, 0.0f, 1.0f,
/* 0 */
125
1.0f, 0.0f, 0.0f, 1.0f,
/* 1 */
126
0.0f, 1.0f, 0.0f, 1.0f,
/* 2 */
127
1.0f, 1.0f, 0.0f, 1.0f,
/* 3 */
128
129
/* Right. */
130
1.0f, 0.0f, 0.0f, 1.0f,
/* 4 */
131
0.0f, 0.0f, 1.0f, 1.0f,
/* 5 */
132
1.0f, 1.0f, 0.0f, 1.0f,
/* 6 */
133
0.0f, 1.0f, 1.0f, 1.0f,
/* 7 */
134
135
/* Back. */
136
0.0f, 0.0f, 1.0f, 1.0f,
/* 8 */
137
1.0f, 0.0f, 1.0f, 1.0f,
/* 9 */
138
0.0f, 1.0f, 1.0f, 1.0f,
/* 10 */
139
1.0f, 1.0f, 1.0f, 1.0f,
/* 11 */
140
141
/* Left. */
142
1.0f, 0.0f, 1.0f, 1.0f,
/* 12 */
143
0.0f, 0.0f, 0.0f, 1.0f,
/* 13 */
144
1.0f, 1.0f, 1.0f, 1.0f,
/* 14 */
145
0.0f, 1.0f, 0.0f, 1.0f,
/* 15 */
146
147
/* Top. */
148
0.0f, 1.0f, 0.0f, 1.0f,
/* 16 */
149
1.0f, 1.0f, 0.0f, 1.0f,
/* 17 */
150
1.0f, 1.0f, 1.0f, 1.0f,
/* 18 */
151
0.0f, 1.0f, 1.0f, 1.0f,
/* 19 */
152
153
/* Bottom. */
154
1.0f, 0.0f, 1.0f, 1.0f,
/* 20 */
155
0.0f, 0.0f, 1.0f, 1.0f,
/* 21 */
156
0.0f, 0.0f, 0.0f, 1.0f,
/* 22 */
157
1.0f, 0.0f, 0.0f, 1.0f,
/* 23 */
158
};
159
160
#endif
/* FRAMEBUFFEROBJECT_H */
cubeColors
static const float cubeColors[]
Definition:
FrameBufferObject.h:121
cubeVertices
static const float cubeVertices[]
Definition:
FrameBufferObject.h:42
cubeTextureCoordinates
static const float cubeTextureCoordinates[]
Definition:
FrameBufferObject.h:81
cubeIndices
static const GLubyte cubeIndices[]
Definition:
FrameBufferObject.h:29
samples
advanced_samples
FrameBufferObject
jni
FrameBufferObject.h
(C) ARM Ltd. 2017