Mailing List Archive

PyOpenGL -- Scrollbars?
Hi All..

New to OpenGL so please bear with me. I'm trying to create an OpenGL port
in my application to display images--only way to show more than 256 colors
here on our SGIs. I've been having some difficulties:

1.) Any way to scroll via. scrollbars the OpenGL port? (like attaching
to a canvas but that didn't seem to do the trick)

2.) My Images are always offset about 25% up and left using this code:
glLoadIdentity()
gluOrtho2d(0,portWidth,0,portHeight)
glRasterPos2i(0,0)
glDrawPixels(imWid,imHeight, GL_RGBA, GL_UNSIGNED_BYTE, im)

At least I can see the image, but I don't understand where the offset is
coming in. I've looked for a simple "DisplayImage" demo but haven't found
one.

Thanks in advance!

Mark A. McGuire
mcguire@rhythm.com
Rhythm & Hues Studios, Inc.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
PyOpenGL -- Scrollbars? [ In reply to ]
On Fri, 23 Apr 1999 mamcguire@my-dejanews.com wrote:

> Hi All..
>
> New to OpenGL so please bear with me. I'm trying to create an OpenGL port
> in my application to display images--only way to show more than 256 colors
> here on our SGIs. I've been having some difficulties:
>
> 1.) Any way to scroll via. scrollbars the OpenGL port? (like attaching
> to a canvas but that didn't seem to do the trick)

No -- but you can find out from the scrollbars what the shift in
coordinates would be and adjust your drawing code in OpenGL to do the
appropriate thing.

I will be posting code in the next PyOpenGL release which might do a lot
of what you need. Keep an eye out for it.

--david