OpenGL ES SDK for Android ARM Developer Center
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Skybox Namespace Reference

Classes

class  Matrix
 Functions for manipulating matrices. More...
 
struct  Vec2
 Type representing texture coordinates. More...
 
class  Text
 Functions for drawing text in OpenGL ES. More...
 

Typedefs

typedef struct Skybox::Vec2 Vec2
 Type representing texture coordinates. More...
 

Functions

void loadData (const char *filename, unsigned char **textureData)
 Load texture data from a file into memory. More...
 
GLint get_and_check_attrib_location (GLuint program, const GLchar *attrib_name)
 Invoke glGetAttribLocation(), if it has returned a positive value. Otherwise, print a message and exit. Function used for clarity reasons. More...
 
GLint get_and_check_uniform_location (GLuint program, const GLchar *uniform_name)
 Invoke glGetUniformLocation, if it has returned a positive value. Otherwise, print a message and exit. Function used for clarity reasons. More...
 

Variables

const char fontVertexShaderSource []
 Vertex shader source code for text rendering. More...
 
const char fontFragmentShaderSource []
 Fragment shader source code for text rendering. More...
 

Typedef Documentation

typedef struct Skybox::Vec2 Skybox::Vec2

Type representing texture coordinates.

Function Documentation

GLint Skybox::get_and_check_attrib_location ( GLuint  program,
const GLchar *  attrib_name 
)

Invoke glGetAttribLocation(), if it has returned a positive value. Otherwise, print a message and exit. Function used for clarity reasons.

Parameters
[in]programOpenGL ES specific.
[in]attrib_nameOpenGL ES specific.

Definition at line 73 of file Text.cpp.

GLint Skybox::get_and_check_uniform_location ( GLuint  program,
const GLchar *  uniform_name 
)

Invoke glGetUniformLocation, if it has returned a positive value. Otherwise, print a message and exit. Function used for clarity reasons.

Parameters
[in]programOpenGL ES specific.
[in]uniform_nameOpenGL ES specific.

Definition at line 87 of file Text.cpp.

void Skybox::loadData ( const char *  filename,
unsigned char **  textureData 
)

Load texture data from a file into memory.

Parameters
[in]filenameThe filename of the texture to load.
[out]textureDataPointer to the texture that has been loaded.

Definition at line 38 of file Text.cpp.

Variable Documentation

const char Skybox::fontFragmentShaderSource[]
Initial value:
=
{
"#version 300 es\n"
"precision mediump float;\n"
"uniform sampler2D u_s2dTexture;\n"
"in vec2 v_v2TexCoord;\n"
"in vec4 v_v4FontColor;\n"
"out vec4 color;\n"
"void main() {\n"
" vec4 v4Texel = texture(u_s2dTexture, v_v2TexCoord);\n"
" color = v_v4FontColor * v4Texel;\n"
"}\n"
}

Fragment shader source code for text rendering.

Definition at line 52 of file Text.h.

const char Skybox::fontVertexShaderSource[]
Initial value:
=
{
"#version 300 es\n"
"uniform mat4 u_m4Projection;\n"
"in vec4 a_v4Position;\n"
"in vec4 a_v4FontColor;\n"
"in vec2 a_v2TexCoord;\n"
"out vec4 v_v4FontColor;\n"
"out vec2 v_v2TexCoord;\n"
"void main() {\n"
" v_v4FontColor = a_v4FontColor;\n"
" v_v2TexCoord = a_v2TexCoord;\n"
" gl_Position = u_m4Projection * a_v4Position;\n"
"}\n"
}

Vertex shader source code for text rendering.

Definition at line 33 of file Text.h.