Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: signal scrolling

  1. #1
    Newbie Newbie
    Join Date
    Jul 2013
    Posts
    2

    signal scrolling

    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.

  2. #2
    Member Regular Contributor Nowhere-01's Avatar
    Join Date
    Feb 2011
    Location
    Novosibirsk
    Posts
    251
    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.

  3. #3
    Newbie Newbie
    Join Date
    Jul 2013
    Posts
    2
    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?

  4. #4
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    490
    Quote Originally Posted by Vitaly View Post
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •