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.
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.
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!).