28 #include <GLES2/gl2.h>
29 #include <GLES2/gl2ext.h>
32 #include <android/log.h>
45 using namespace MaliSDK;
62 LOGD(
"setupGraphics(%d, %d)", width, height);
78 GL_CHECK(glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA));
86 LOGD(
"vertexShaderID = %d", vertexShaderID);
88 LOGD(
"fragmentShaderID = %d", fragmentShaderID);
93 LOGE(
"Could not create program.");
110 GL_CHECK(glViewport(0, 0, width, height));
120 GL_CHECK(glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT));
136 GL_CHECK(glDrawArrays(GL_TRIANGLES, 0, 3));
155 (JNIEnv *env, jclass jcls)
string fragmentShaderFilename
Functions for drawing text in OpenGL ES.
GLint GLsizei GLsizei height
const float triangleVertices[]
const float triangleColors[]
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_triangle_Triangle_uninit(JNIEnv *, jclass)
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.
string vertexShaderFilename
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_triangle_Triangle_init(JNIEnv *env, jclass jcls, jint width, jint height)
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_triangle_Triangle_step(JNIEnv *env, jclass jcls)
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
bool setupGraphics(int width, int height)