I am having problem with glDrawPixels and I am wondering if I am hitting some limitations with my viewport or something else of that nature. I know there are limitations to the viewport's width and height, but what about its starting point?
The data I am trying to draw is inside a scrolled area (using Qt) with an area about 24,000 pixels high by 2,000 pixels wide. I set my scroll bar to range from values 0-max(~24,000) and retrieve the value from the scroll bar to know which row is the first row I am seeing. 0 is at the bottom and "max" is at the top. I always start the viewing at the top of the data and display about 1000 pixels in height and width (inside the limitations I printed out using glGet( ) ). But with this much data, my glDrawPixels does not appear to draw anything to the screen until I get down to about the 6,000th-8,000th pixel starting the viewport. So what I do looks something like this: Unfortunately I do not have the code with me as this is done on a stand-alone Solaris box.
Code :glViewport( widthOffset, heightOffset, width, height ); glOrtho( 0.0, width, 0.0, height, -1.0, 1.0 ); glRasterPos2f( 0.0, 0.0 ); glDrawPixels( width, height, GL_COLOR_INDEX, GL_UNSIGNED_SHORT, data );
I left out the code stating when I switch matrices but I use the standard matrices for their respective calls as shown in most textbooks on OpenGL. I just left it out here since I didn't feel like typing those all in. So width is ~1000 and height is ~1000 with widthOffset normally being 0 or ~1000, depends if I am showing the first 1000 pixels of width or the last 1000 pixels of width. The heightOffset ranges anywhere from 0 to ~23000 based on which portion of the data I choose to see.
Does anyone have any idea why I cannot see data once my viewport's beginning point gets too high? Thanks!



