Hi all! I’m developing software for medical devices. I want to make perfect signal scrolling (like on oscillograph) using Open GL. Now our program has two threads: one for preparing bitmaps and other for rendering (program is very very old:-)). So question is how to render prepared bitmap more faster. Firstly I have used glDrawPixels/glCopyPixels functions (shift previous bitmap and draw new pixels columns). This method gave excellent result on most computers. But on some computers (especially with weak graphics) glCopyPixels doesn’t work if my window is obscured by another. Can anyone tell me the best way to solve my problem using Open GL? Thanks.
performance-wise, best thing to do is to avoid using bitmap at all and draw graph line using opengl. but it will require to make a lot of changes to your program.
also, to avoid glCopyPixels, you can just pre-process bitmap on CPU, removing one column and adding a new one. it’s going to be more predictable in terms of behavior and performance. but your program does things in such an ugly and old-fashioned way, it begs rewriting.
Program is really old. It was developed using Borland C++ Builder and bitmap is actually TBitmap class I use GetDIBits function to get pixels data from TBitmap and then pass array to glDrawPixels. I tried to remove calling glCopyPixels (everytime redraw all screen using glDrawPixels), but scrolling becomes too slow. Maybe there are another ways to shift picture in graphics memory and add new columns in Open GL? Or maybe using textures will give better results?
Probably. Hardware performance is measured primarily in terms of the performance of textured polygons.
In terms of uploading data, you should upload columns as texture rows and rotate the texture coordinates by 90 degrees. Replacing one row of a texture is likely to be faster than replacing a column.