From 2a9d714295b1587b9e669a43bf544ff08a2a0ac7 Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Tue, 10 Jun 2025 13:52:02 +0200 Subject: [PATCH] - Treballant en vore perque no me va en el comp del treball --- basic.glsl | 22 ++++++++++++++++++++++ main.cpp | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 basic.glsl 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());