chennes

11-17-2000, 12:15 PM

I have a chunk of code for displaying bimapped text that is supposed to set up the window by loading the identity matrices and then using glOrtho(0,1,0,1,0,1), immediately followed by a glRasterPos2f(x,y). It works correctly the first time through, but after I pop the matrices back, do some other stuff, then come back, push the matrices, load the identities, etc., the first image I drew disappears and the new one appears. All subsequent calls to the function continue to display everything but the first one. I tried printing out the matrices and got this:

First time through...

Projection: 2 0 0 0 0 2 0 0 0 0 -2 0 -1 -1 -1 1

Modelview: 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1

All other times...

Projection: 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1

Modelview: 2.6885e-10 0 0 0 0 2.6885e-10 0 0 0 0 -2.6885e-10 0 0 0 0 1

It seems to me that the first one is correct, and all the others are wrong, no? How can this be if I am loading the identity (in BOTH stacks), then only issuing a glOrtho(0,1,0,1,0,1) and a glRasterPos2f(x,y) before I print out the matrices?

Any suggestions would be greatly appreciated.

chennes

First time through...

Projection: 2 0 0 0 0 2 0 0 0 0 -2 0 -1 -1 -1 1

Modelview: 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1

All other times...

Projection: 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1

Modelview: 2.6885e-10 0 0 0 0 2.6885e-10 0 0 0 0 -2.6885e-10 0 0 0 0 1

It seems to me that the first one is correct, and all the others are wrong, no? How can this be if I am loading the identity (in BOTH stacks), then only issuing a glOrtho(0,1,0,1,0,1) and a glRasterPos2f(x,y) before I print out the matrices?

Any suggestions would be greatly appreciated.

chennes