My science fair project is producing a file format (see http://plato.hightechhigh.org/students/2005/jjensen/sciencefair/index.html for a very rough file format specification) for storing 2d images. I’m writing a demo program and I’m wondering. Is OpenGL the right tool for the job? I need it to have a graphical interface but now I’m starting to think that I should use windows.h but how do I draw images that are loaded into memory as RGBARGBA with that?
I was thinking just draw a textured quad on the screen and when the mouse is clicked switch the texture to the next one to create a slide show. When the mouse is moved translate the textured quad, etc.
But I’m kindof stumped on this problem. My draw code looks like this:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glMatrixMode( GL_MODELVIEW );
glLoadIdentity(); // Reset The View
// Position View Up VectorgluLookAt(0, 1, 0, 0, 0, 0, 0, 1, 0); // This determines where the camera’s position and view is
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glEnable( GL_DEPTH_TEST );
glColor3f(1, 0, 0);
glBegin( GL_QUADS );
glVertex3f(0, 0, 0);
glVertex3f(1, 0, 0);
glVertex3f(1, 0, 1);
glVertex3f(0, 0, 1);
glEnd();
SwapBuffers(win.returnHDC());
return TRUE;
and when I change the clear color it changes the background color but I don’t see any quad on the screen. Does anybody see the problem? Thanks