PDA

View Full Version : glDrawPixels Access Violation



Phil.Tessier
12-31-2003, 11:14 AM
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

dorbie
12-31-2003, 02:28 PM
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).]

AdrianD
01-01-2004, 08:09 PM
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!).

Phil.Tessier
01-02-2004, 06:37 AM
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

heath
01-02-2004, 09:19 AM
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.

Phil.Tessier
01-05-2004, 07:02 AM
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

rgpc
01-05-2004, 03:04 PM
You could always look at the resources that are listed on opengl.org (http://www.opengl.org/resources/tutorials/) . Particularly nehe (http://nehe.gamedev.net) .