26 #include <GLES2/gl2.h>
27 #include <GLES2/gl2ext.h>
32 #include <android/log.h>
43 using namespace MaliSDK;
74 GL_CHECK(glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA));
78 text->
addString(0, 0,
"Simple Cube Example", 255, 255, 0, 255);
89 GL_CHECK(glAttachShader(programID, vertexShaderID));
90 GL_CHECK(glAttachShader(programID, fragmentShaderID));
142 modelView[14] -= 2.5;
154 if(angleX >= 360) angleX -= 360;
155 if(angleX < 0) angleX += 360;
161 GL_CHECK(glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT));
162 GL_CHECK(glDrawArrays(GL_TRIANGLES, 0, 36));
181 (JNIEnv *env, jclass jcls)
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_cube_Cube_init(JNIEnv *env, jclass jcls, jint width, jint height)
Functions for drawing text in OpenGL ES.
GLint GLsizei GLsizei height
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_cube_Cube_uninit(JNIEnv *, jclass)
Functions for manipulating matrices.
static Matrix matrixPerspective(float FOV, float ratio, float zNear, float zFar)
Create and return a perspective projection matrix.
string vertexShaderFilename
float * getAsArray(void)
Get the matrix elements as a column major order array.
void addString(int xPosition, int yPosition, const char *string, int red, int green, int blue, int alpha)
Add a std::string to be drawn to the screen.
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_cube_Cube_step(JNIEnv *env, jclass jcls)
static Matrix createRotationY(float angle)
Create and return a rotation matrix around the y-axis matrix.
static Matrix createRotationZ(float angle)
Create and return a rotation matrix around the z-axis matrix.
bool setupGraphics(int width, int height)
static void processShader(GLuint *shader, const char *filename, GLint shaderType)
Create shader, load in source, compile, and dump debug as necessary.
void draw(void)
Draw the text to the screen.
typedef GLuint(GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC)(GLuint count
static Matrix createRotationX(float angle)
Create and return a rotation matrix around the x-axis matrix.
string fragmentShaderFilename