About real-time chart

Hello, guys.

I need your help.

I’m working on a real-time chart using opengl and c++.

This is kind of seismogram or stock chart. It works on real-time and updates every single second.

Here is the problem. I can draw chart once but I cannot update changed data later on. I think buffers of opengl take data for display before complete to calculate and draw it at once.

I’m trying to do with very simple program, but I can’t.

Please let me know if you have any idea.

Thanks.

From this question, I guess that you are pretty new to OpenGL and computer graphics in general, right ? You should have posted in the beginner forum.

Anyway, your program should be designed in the following way :

  1. create window
  2. t1 = get current time
  3. read input data (from file, network, usb device…)
  4. clear window
  5. display chart from data
  6. wait until current time = t1 + 1
  7. goto 1)

If you need more help, please be more specific about you do and what you don’t know how to do.

You weren’t very specific, so you can’t expect and answer stragiht away. I can only suggest to check a few fings:

Do you enforce reapint in your window properly?
Are you using depth test? If yes - do you clear z buffer?
Do you use double buffering? If yes - do you swap buffers properly?

You can also compare your code with NeHe tutorials.

Thank you, guys.

I think I should explain what I’m doing right now in detail.