25 #include <GLES3/gl31.h>
106 #define get_attrib_location(prog, name) \
107 app->a_##prog##_##name = glGetAttribLocation(app->program_##prog, #name); \
108 if (app->a_##prog##_##name < 0) { \
109 LOGE("Invalid or unused attribute %s\n", #name); \
112 #define get_uniform_location(prog, name) \
113 app->u_##prog##_##name = glGetUniformLocation(app->program_##prog, #name); \
114 if (app->u_##prog##_##name < 0) { \
115 LOGE("Invalid or unused uniform %s\n", #name); \
118 #define attribfv(prog, name, n, offset) \
119 glEnableVertexAttribArray(app->a_##prog##_##name); \
120 glVertexAttribPointer(app->a_##prog##_##name, n, GL_FLOAT, GL_FALSE, \
121 n * sizeof(float), (void*)offset);
123 #define attribiv(prog, name, n, offset) \
124 glEnableVertexAttribArray(app->a_##prog##_##name); \
125 glVertexAttribPointer(app->a_##prog##_##name, n, GL_INT, GL_FALSE, \
126 n * sizeof(GLint), (void*)offset);
128 #define uniform1f(prog, name, value) glUniform1f(app->u_##prog##_##name, value);
129 #define uniform2f(prog, name, x, y) glUniform2f(app->u_##prog##_##name, x, y);
130 #define uniform3fv(prog, name, value) glUniform3fv(app->u_##prog##_##name, 1, &value[0]);
131 #define uniform1i(prog, name, value) glUniform1i(app->u_##prog##_##name, value);
132 #define uniformm4(prog, name, value) glUniformMatrix4fv(app->u_##prog##_##name, 1, GL_FALSE, value.value_ptr());
GLuint u_geometry_inCentroid
void app_initialize(App *app)
GLuint u_geometry_projection
void app_update_and_render(App *app)
GLuint u_generate_sphere_radius
GLuint u_generate_sphere_pos
GLuint u_geometry_inMaterial
GLuint a_backdrop_position
void gl_check(const char *msg)
GLuint u_centroid_voxel_mode
typedef GLuint(GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC)(GLuint count
GLuint u_generate_dimension
GLuint u_geometry_inSurface