PDA

View Full Version : another importan question



Starnut coder
02-20-2001, 09:23 PM
Does anyone know how to display bitmaps in 2d on the screen using scree coordinates like in DirectDraw. I realy need this to make a Menu.
I wanted to use DirectDraw but it doesnt work with Opengl.

-Thanks help very appreciated

02-20-2001, 10:03 PM
Hi,

I think you could try something like this:
Use a new projection matrix
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrhto(0,1204,0,768,-1,1);

glMatrixMode(GL_MODELVIEW);
...
now you can
glVertex2i(1024/2,768/2);
to plot a vertex in the middle of the screen (the z value generaly dont care, cause i disable the depth buffer).

glRasterPos2i(320,200);

In addition you should notice that the coordonates (0,0) is the lower left conrner of the screen, but it is not really difficult to change this.

Bye