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
IntegerLogic.h
Go to the documentation of this file.
1
/* Copyright (c) 2014-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 INTEGER_LOGIC_H
22
#define INTEGER_LOGIC_H
23
24
#include "
VectorTypes.h
"
25
#include <EGL/egl.h>
26
#include <GLES3/gl3.h>
27
28
namespace
MaliSDK
29
{
30
/* Name of the file in which "rule 30" vertex shader's body is located. */
31
#define VERTEX_RULE_30_SHADER_FILENAME ("/data/data/com.arm.malideveloper.openglessdk.integerLogic/files/IntegerLogic_Rule30_shader.vert")
32
/* Name of the file in which "merge" vertex shader's body is located. */
33
#define VERTEX_MERGE_SHADER_FILENAME ("/data/data/com.arm.malideveloper.openglessdk.integerLogic/files/IntegerLogic_Merge_shader.vert")
34
/* Name of the file in which "rule 30" fragment shader's body is located. */
35
#define FRAGMENT_RULE_30_SHADER_FILENAME ("/data/data/com.arm.malideveloper.openglessdk.integerLogic/files/IntegerLogic_Rule30_shader.frag")
36
/* Name of the file in which "merge" fragment shader's body is located. */
37
#define FRAGMENT_MERGE_SHADER_FILENAME ("/data/data/com.arm.malideveloper.openglessdk.integerLogic/files/IntegerLogic_Merge_shader.frag")
38
39
/* Structure storing locations of attributes and uniforms for merge program. */
40
struct
MergeProgramLocations
41
{
42
GLint
mvpMatrixLocation
;
43
GLint
pingTextureLocation
;
44
GLint
pongTextureLocation
;
45
GLint
positionLocation
;
46
GLint
texCoordLocation
;
47
48
MergeProgramLocations
()
49
{
50
mvpMatrixLocation
= -1;
51
pingTextureLocation
= -1;
52
pongTextureLocation
= -1;
53
positionLocation
= -1;
54
texCoordLocation
= -1;
55
}
56
};
57
58
/* Structure storing locations of attributes and uniforms for rule30 program. */
59
struct
Rule30ProgramLocations
60
{
61
GLint
inputTextureLocation
;
62
GLint
verticalOffsetLocation
;
63
GLint
mvpMatrixLocation
;
64
GLint
inputVerticalOffsetLocation
;
65
GLint
inputNeighbourLocation
;
66
GLint
positionLocation
;
67
GLint
texCoordLocation
;
68
69
Rule30ProgramLocations
()
70
{
71
inputTextureLocation
= -1;
72
verticalOffsetLocation
= -1;
73
mvpMatrixLocation
= -1;
74
inputVerticalOffsetLocation
= -1;
75
inputNeighbourLocation
= -1;
76
positionLocation
= -1;
77
texCoordLocation
= -1;
78
}
79
};
80
81
/*
82
* Vertex array, storing coordinates for a single line filling whole row.
83
* The 4th coordinate is set to 0.5 to reduce clip coordinates to [-0.5, 0.5].
84
* It is necessary so the offsets are the same as for UV coordinatesin Rule30 shader.
85
*/
86
static
const
float
lineVertices
[] =
87
{
88
-0.5f, 1.0f, 0.0f, 0.5f,
89
0.5f, 1.0f, 0.0f, 0.5f,
90
};
91
92
/*
93
* Vertex array, storing coordinates for the quad in the fullscreen.
94
* The 4th coordinate is set to 0.5 to keep compatibility with line vertices.
95
*/
96
static
const
float
quadVertices
[] =
97
{
98
-0.5f, 1.0f, 0.0f, 0.5f,
99
0.5f, 1.0f, 0.0f, 0.5f,
100
-0.5f, -1.0f, 0.0f, 0.5f,
101
0.5f, -1.0f, 0.0f, 0.5f,
102
};
103
104
/* UV array. Used to map texture on both line ends. */
105
static
const
float
lineTextureCoordinates
[] =
106
{
107
0.0f, 1.0f,
108
1.0f, 1.0f
109
};
110
111
/* UV array. Used to map texture on the whole quad. */
112
static
const
float
quadTextureCoordinates
[] =
113
{
114
0.0f, 1.0f,
115
1.0f, 1.0f,
116
0.0f, 0.0f,
117
1.0f, 0.0f,
118
};
119
}
120
#endif
/* INTEGER_LOGIC_H */
MaliSDK::quadVertices
static const float quadVertices[]
Definition:
IntegerLogic.h:96
VectorTypes.h
MaliSDK::Rule30ProgramLocations::mvpMatrixLocation
GLint mvpMatrixLocation
Definition:
IntegerLogic.h:63
MaliSDK::Rule30ProgramLocations::inputTextureLocation
GLint inputTextureLocation
Definition:
IntegerLogic.h:61
MaliSDK::Rule30ProgramLocations::inputVerticalOffsetLocation
GLint inputVerticalOffsetLocation
Definition:
IntegerLogic.h:64
MaliSDK::Rule30ProgramLocations::verticalOffsetLocation
GLint verticalOffsetLocation
Definition:
IntegerLogic.h:62
MaliSDK::lineVertices
static const float lineVertices[]
Definition:
IntegerLogic.h:86
MaliSDK::MergeProgramLocations::pongTextureLocation
GLint pongTextureLocation
Definition:
IntegerLogic.h:44
MaliSDK::MergeProgramLocations::texCoordLocation
GLint texCoordLocation
Definition:
IntegerLogic.h:46
MaliSDK::Rule30ProgramLocations::texCoordLocation
GLint texCoordLocation
Definition:
IntegerLogic.h:67
MaliSDK::lineTextureCoordinates
static const float lineTextureCoordinates[]
Definition:
IntegerLogic.h:105
MaliSDK::MergeProgramLocations::pingTextureLocation
GLint pingTextureLocation
Definition:
IntegerLogic.h:43
MaliSDK::Rule30ProgramLocations
Definition:
IntegerLogic.h:59
MaliSDK::Rule30ProgramLocations::Rule30ProgramLocations
Rule30ProgramLocations()
Definition:
IntegerLogic.h:69
MaliSDK::quadTextureCoordinates
static const float quadTextureCoordinates[]
Definition:
IntegerLogic.h:112
MaliSDK::Rule30ProgramLocations::positionLocation
GLint positionLocation
Definition:
IntegerLogic.h:66
MaliSDK::MergeProgramLocations
Definition:
IntegerLogic.h:40
MaliSDK::MergeProgramLocations::positionLocation
GLint positionLocation
Definition:
IntegerLogic.h:45
MaliSDK::Rule30ProgramLocations::inputNeighbourLocation
GLint inputNeighbourLocation
Definition:
IntegerLogic.h:65
MaliSDK::MergeProgramLocations::MergeProgramLocations
MergeProgramLocations()
Definition:
IntegerLogic.h:48
MaliSDK::MergeProgramLocations::mvpMatrixLocation
GLint mvpMatrixLocation
Definition:
IntegerLogic.h:42
samples
tutorials
IntegerLogic
jni
IntegerLogic.h
(C) ARM Ltd. 2017