diff --git a/basic.glsl b/basic.glsl new file mode 100644 index 0000000..6679aa5 --- /dev/null +++ b/basic.glsl @@ -0,0 +1,22 @@ +#define COMPAT_PRECISION + +varying vec2 TEX0; + +#if defined(VERTEX) + +void main() +{ + TEX0 = gl_MultiTexCoord0.st; //vec2(gl_MultiTexCoord0.x, 1.0-gl_MultiTexCoord0.y)*1.0001; + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + +#elif defined(FRAGMENT) + +uniform sampler2D Texture; + +void main() +{ + gl_FragColor = vec4(TEX0.s, TEX0.t, 0, 1); texture2D(Texture, TEX0); +} + +#endif diff --git a/main.cpp b/main.cpp index 8b774bc..6da655d 100644 --- a/main.cpp +++ b/main.cpp @@ -18,13 +18,14 @@ int main(int argc, char **argv) printf("VIDEO DRIVERS AVAILABLE:\n"); for (int i=0; i(f)), std::istreambuf_iterator()); shader::init(win, texTarget, source.c_str());