glDrawPixels Access Violation

I’m new here.
I’m seeing glDrawPixels generate an Access Violation when drawing certain images at zoom factors between 0 and 1 (e.g. 0.5).

Zoom factors of 1 or greater are no problem for any images, and smaller images (i.e., 256x256) have no problem with reducing scale factors, but larger images (i.e., 1024x1024) are very unreliable at reducing scale factors.

I’m using SGI OpenGL for Windows Version 1.1. Has anyone else seen this? Does anyone have suggestions?

I’ve set up an exception handler for this, so that my program can continue even if glDrawPixels crashes. Sometimes, when the exception is thrown, nothing is drawn into the buffer. Other times, a partial image has been placed into the buffer.

The address reported for the access violation is (apparently) always past the end of the bit buffer a small number of rows.

Thanks in advance,
Phil

That’s a really old library. Try using the OpenGL32.dll that comes from Microsoft. It’s software path is a newer version that was actually developed by SGI from the same codebase. It has the fastpath optimizations first unveiled in the “CosmoGL” implementation.

You could also try the Mesa library for software rendering http://www.mesa3d.org/

[This message has been edited by dorbie (edited 12-31-2003).]

Originally posted by Phil.Tessier:

[…]
Does anyone have suggestions?
[…]

yes, i have.
first, use the opengl32.dll from microsoft, as stated above. this way you get also HW support.
and second, don’t use drawpixels to zoom. create a texture with the pixeldata and draw an textured quad over the screen. this is the common method for zooming pixels (and you get filtering - when you need it - for free!).

Many thanks.

I’ll certainly try the Microsoft library.

AdrianD, I haven’t worked with textures before. Could you point me at some sample code for implementing your second suggestion?

Thanks again,
Phil

If you’re really interested in working with OpenGL, then the best way to get started is to buy the red book. It’s an absolute must have.
http://www.opengl.org/documentation/books.html#refman

Hope this helps,
Heath.

Heath,

Thanks. I’m not really new to OpenGL, though, just new to pixels. The book’ll probably be a good idea, though.

Thanks again,
Phil

You could always look at the resources that are listed on opengl.org . Particularly nehe .