OpenGL ES SDK for Android ARM Developer Center
 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. */
41  {
47 
49  {
50  mvpMatrixLocation = -1;
53  positionLocation = -1;
54  texCoordLocation = -1;
55  }
56  };
57 
58  /* Structure storing locations of attributes and uniforms for rule30 program. */
60  {
68 
70  {
73  mvpMatrixLocation = -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 */
static const float quadVertices[]
Definition: IntegerLogic.h:96
static const float lineVertices[]
Definition: IntegerLogic.h:86
static const float lineTextureCoordinates[]
Definition: IntegerLogic.h:105
static const float quadTextureCoordinates[]
Definition: IntegerLogic.h:112