Actually, I do this for some other things and I wanted top-left to be 0,0. :)
GlPushAttrib(GL_ALL_ATTRIB_BITS);
GlViewport(0, 0, width, height);
GlMatrixMode(GL_PROJECTION);
GlPushMatrix();
GlLoadIdentity();
GlOrtho(0.0f, width, height, 0.0f, -1.0, 1.0);
But it doesn't impact how the bits are drawn. It works fine for my positioning
for where I can print text and draw images. The wierd thing is that some games
use a different coordinate system so 0,120 might be 1" normally but 2" down the
screen on other games. I'll delve into that later, need the basics first. I
probably should get an opengl programming boot. :D I splurged on a directx one
since this needs to work in both.
Cheers
> On 13 May 2007, at 10:58, bruce wrote:
>
> > I ended up using glPixelZoom(1.0,-1.0) to flip the image before I
> > read this. What you have below seems like it will reduce work (not
> > knowing much about the zoom operation). I'll check out setting the
> > stride. I know nothing about graphics but I'm having fun learning. :)
>
> You can also, IIRC, change the OpenGL viewport, so it has its co-
> ordinate system aligned more like a conventional GUI window (i.e. 0,0
> at top left).
>
> Of the top of my head, something like this at the top of your draw
> method might help...
>
> glPushMatrix();
> glLoadIdentity();
> glOrtho(0, w(), h(), 0, -1, 1);
>
> followed by a
> glPopMatrix();
>
> Near the end might do it. Or I could be talking nonsense. It's early
> here... And I always get the Ortho stuff wrong, so you'd best check
> the manuals and not believe me!
>
> > I'm an embedded programmer and I'm lucky to have an rs232 terminal
> > half the time.
>
> I know all about that one...
>
> Cheers,
> --
> Ian
>
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk