View Full Version : About real-time chart

11-08-2007, 12:50 AM
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.


11-08-2007, 05:03 AM
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 :

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

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

11-08-2007, 05:07 AM
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.

11-10-2007, 02:45 PM
Thank you, guys.

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