瀏覽代碼

Fix shader crap syntax, caused by space-like UTF-8 characters.

legacy
Sam Hocevar sam 14 年之前
父節點
當前提交
7d0990d858
共有 1 個檔案被更改,包括 8 行新增7 行删除
  1. +8
    -7
      src/scene.cpp

+ 8
- 7
src/scene.cpp 查看文件

@@ -73,20 +73,20 @@ Scene *SceneData::scene = NULL;

#if SHADER_CRAP
static char const *vertexshader =
"attribute vec4 position;\n"
"uniform mat4 mvp;\n"
"attribute vec4 position;\n"
"uniform mat4 mvp;\n"
"\n"
"void main()\n"
"void main()\n"
"{\n"
"    gl_Position = mvp * position;\n"
" gl_Position = mvp * position;\n"
"}\n";

static char const *fragmentshader =
"uniform lowp vec4 color;\n"
"uniform /*lowp*/ vec4 color;\n"
"\n"
"void main()\n"
"void main()\n"
"{\n"
" gl_FragColor = color;\n"
" gl_FragColor = color;\n"
"}\n";
#endif

@@ -127,6 +127,7 @@ Scene::Scene(float angle)

glBindAttribLocation(data->prog, ATTRIB_POSITION, "position");
glLinkProgram(data->prog);
glValidateProgram(data->prog);

data->uni_mvp = glGetUniformLocation(data->prog, "mvp");
data->uni_color = glGetUniformLocation(data->prog, "color");


Loading…
取消
儲存