emscripten support

This commit is contained in:
Konstantin Käfer
2014-01-07 16:52:23 +01:00
parent 044a7b5dcd
commit 528eaf475e
24 changed files with 406 additions and 94 deletions

View File

@@ -1,10 +1,24 @@
#include <llmr/renderer/shader-line.hpp>
#include <llmr/shader/shaders.h>
#include <llmr/platform/gl.hpp>
#include <cstdio>
using namespace llmr;
LineShader::LineShader(const GLchar *vertSource, const GLchar *fragSource)
: Shader(vertSource, fragSource) {
if (!valid) return;
LineShader::LineShader()
: Shader(
llmr_shaders[LINE_SHADER].vertex,
llmr_shaders[LINE_SHADER].fragment
),
a_pos(42) {
if (!valid) {
fprintf(stderr, "invalid line shader\n");
return;
}
GLint pos = glGetAttribLocation(program, "a_pos");
fprintf(stderr, "a_pos: %d\n", pos);
a_pos = glGetAttribLocation(program, "a_pos");
attributes.push_back(a_pos);