X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fdemo.c;h=1614426c30df98c9ef85443afcb770acc549a7c5;hb=fca3f24e31b3bbbe81ce0ef00da901480a2a92cc;hp=4ab00f3f4f30401c7e628bef92df1957779d9ffa;hpb=aa9f7c423c8c4111b3e1d0a7bbe73e376533ed80;p=andemo diff --git a/src/demo.c b/src/demo.c index 4ab00f3..1614426 100644 --- a/src/demo.c +++ b/src/demo.c @@ -1,9 +1,24 @@ +#include #include "demo.h" #include "opengl.h" +#include "sanegl.h" +#include "assman.h" + +static unsigned int sdr_foo; +static unsigned int tex_logo; int demo_init(void) { - glClearColor(1, 0, 0, 1); + if(init_opengl() == -1) { + return -1; + } + + if(!(sdr_foo = get_sdrprog("sdr/foo.v.glsl", "sdr/foo.p.glsl"))) { + return -1; + } + if(!(tex_logo = get_tex2d("data/ml_logo_old.png"))) { + return -1; + } return 0; } @@ -14,6 +29,18 @@ void demo_cleanup(void) void demo_display(void) { glClear(GL_COLOR_BUFFER_BIT); + + glUseProgram(sdr_foo); + gl_begin(GL_QUADS); + gl_texcoord2f(0, 1); + gl_vertex2f(-1, -1); + gl_texcoord2f(1, 1); + gl_vertex2f(1, -1); + gl_texcoord2f(1, 0); + gl_vertex2f(1, 1); + gl_texcoord2f(0, 0); + gl_vertex2f(-1, 1); + gl_end(); } void demo_reshape(int x, int y)