kanet77
03-24-2003, 09:38 AM
Hello, and welcome to my post. Make yourself at home.
If you have some experience using glDrawPixels() I'd like to hear from you.
I'm using glDrawPixels() to display a bitmap (actually two because I'm in stereo mode). I'm supporting pan and zoom operations on the image. I need to control the positioning of the drawn image down to the screen pixel. This means that I sometimes need to start drawing in the middle of an image pixel. However, glDrawPixels doesn't support this functionality, so instead I "shift" the whole image by starting to draw outside the window.
At first I couldn't start drawing outside the left or the bottom of the window. I used a trick with glBitmap() I found online to allow me to draw from outside the window. ( http://www.frii.com/~martz/oglfaq/clipping.htm -- Question 10.070) But it appears that I can't draw to the entire window if I do this. For example, if I start drawing from x = -10 (10 pixels outside the left window edge), the 10 rightmost pixels of the window will not be drawn to. This is exactly the same problem that occurs when the window is dragged off the left or bottom edge of the screen. So I guess this glBitmap() trick ensures that something is drawn rather than drawing nothing due to an invalid raster position. But if I can't draw to the entire window I really don't see the point.
I'm currently trying to get around this problem by using glDrawPixels() to draw the image in sections. I suppose this is a workable solution although it involves more calculations and I'm concerned about the inefficiency of calling glDrawPixels() four times. Especially when I draw the "column" on the right edge of the screen because these pixels are not in contiguous memory.
Has anyone had a similar problem? Thanks for any input.
-tom
If you have some experience using glDrawPixels() I'd like to hear from you.
I'm using glDrawPixels() to display a bitmap (actually two because I'm in stereo mode). I'm supporting pan and zoom operations on the image. I need to control the positioning of the drawn image down to the screen pixel. This means that I sometimes need to start drawing in the middle of an image pixel. However, glDrawPixels doesn't support this functionality, so instead I "shift" the whole image by starting to draw outside the window.
At first I couldn't start drawing outside the left or the bottom of the window. I used a trick with glBitmap() I found online to allow me to draw from outside the window. ( http://www.frii.com/~martz/oglfaq/clipping.htm -- Question 10.070) But it appears that I can't draw to the entire window if I do this. For example, if I start drawing from x = -10 (10 pixels outside the left window edge), the 10 rightmost pixels of the window will not be drawn to. This is exactly the same problem that occurs when the window is dragged off the left or bottom edge of the screen. So I guess this glBitmap() trick ensures that something is drawn rather than drawing nothing due to an invalid raster position. But if I can't draw to the entire window I really don't see the point.
I'm currently trying to get around this problem by using glDrawPixels() to draw the image in sections. I suppose this is a workable solution although it involves more calculations and I'm concerned about the inefficiency of calling glDrawPixels() four times. Especially when I draw the "column" on the right edge of the screen because these pixels are not in contiguous memory.
Has anyone had a similar problem? Thanks for any input.
-tom