X-Git-Url: http://git.lukelau.me/?p=wasm.git;a=blobdiff_plain;f=test.cpp;fp=test.cpp;h=d59323af877cb9a5b084d770b824e96d3a05d51a;hp=da73b69c05fe49a1f81455ed5ba2360eb15bdf94;hb=aed1f5271c857c3afa085c593d2ca6159770395c;hpb=3ef5cb466b695cba27e45bbb273af1a9aa71bad9 diff --git a/test.cpp b/test.cpp index da73b69..d59323a 100644 --- a/test.cpp +++ b/test.cpp @@ -1,6 +1,18 @@ -#include +#include +#include + +const char* vertShaderSrc = R"( + attribute vec4 vertPos; + void main() { + gl_Position = vertPos; + } +)"; + extern "C" int foo() { - std::vector *xs = new std::vector(); - xs->push_back(42); - return (*xs)[0]; + GLuint vertShader = glCreateShader(GL_VERTEX_SHADER); + const char* sources[1] = { vertShaderSrc }; + const GLint lengths[1] = { (GLint)strlen(vertShaderSrc) }; + glShaderSource(vertShader, 1, sources, lengths); + glCompileShader(vertShader); + return 0; }