Start work on WebGL bindings
[wasm.git] / test.cpp
1 #include <GLES2/gl2.h>
2 #include <string>
3
4 const char* vertShaderSrc = R"(
5         attribute vec4 vertPos;
6         void main() {
7                 gl_Position = vertPos;
8         }
9 )";
10
11 extern "C" int foo() {
12         GLuint vertShader = glCreateShader(GL_VERTEX_SHADER);
13         const char* sources[1] = { vertShaderSrc };
14         const GLint lengths[1] = { (GLint)strlen(vertShaderSrc) };
15         glShaderSource(vertShader, 1, sources, lengths);
16         glCompileShader(vertShader);
17         return 0;
18 }