33 #include <GLES2/gl2.h>
34 #include <GLES2/gl2ext.h>
42 #include <android/log.h>
52 using namespace MaliSDK;
80 GL_CHECK(glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA));
84 text->
addString(0, 0,
"Anti-aliased triangle", 255, 255, 0, 255);
89 LOGI(
"setupGraphics(%d, %d)", width, height);
91 LOGI(
"vertexShaderID = %d", vertexShaderID);
93 LOGI(
"fragmentShaderID = %d", fragmentShaderID);
99 LOGE(
"Could not create program.");
106 LOGI(
"Shaders in use...");
112 LOGE(
"Attribute not found at %s:%i\n", __FILE__, __LINE__);
121 LOGD(
"Warning: Uniform not found at %s:%i\n", __FILE__, __LINE__);
132 LOGD(
"Warning: Uniform not found at %s:%i\n", __FILE__, __LINE__);
148 GL_CHECK(glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT));
170 GL_CHECK(glDrawArrays(GL_TRIANGLES, 0, 3));
190 (JNIEnv *env, jclass jcls)
Functions for drawing text in OpenGL ES.
static Matrix identityMatrix
The identity matrix.
GLint GLsizei GLsizei height
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_antialias_AntiAlias_uninit(JNIEnv *, jclass)
const float triangleVertices[]
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_antialias_AntiAlias_init(JNIEnv *env, jclass jcls, jint width, jint height)
const float triangleColors[]
bool setupGraphics(int width, int height)
string fragmentShaderFilename
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.
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
string vertexShaderFilename
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_antialias_AntiAlias_step(JNIEnv *env, jclass jcls)