View Full Version : Huge 2D array of changing Pixels
I am looking for a methode to display 800x800 pixels in 2D. Each of these 640000 Pixels do permanetly change its value (on or off). Is there another method that GL_POINS and Vertex2f(); to do this. I doubt that it would be fast enough, because I would have to recalculate the X and Y component of the vector of 640000 pixels all the time. So a lot of calculus, until one frame is drawn. I apprechiate your helpt a lot!
03-24-2005, 10:14 AM
upload the pixel data as a texture and draw a quad.
or use glDrawPixels to draw the contents of your pixel buffer.
Have you ever done this? How can I make a texture out of so many coordinates?
03-24-2005, 03:35 PM
Use glDrawArrays. If you are using the same memory for the 2D array - you simply recalculate the vertex positions and call glDrawArrays after a call to glVertexPointer pointing to the start of your data. Also there is a glColorPointer, glNormalPointer and several others to point to an array of colors for your points. You enable each array separately using glEnableClientState with the apporpriate parameter. Draw arrays are much faster than separate glVertex calls.
Hmm? I am not the big memory-crack, so I am not sure. Practically this will look like this: Data will come int via the serial interface or USB. I think I`ll have an X-coordinate and Y-coordinate and a value for each 640000 pixel. So what`s your way? First making a Array[200,200] and sorting the values in. Right??
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.