Sign in to follow this  

Draw objects in real time

Recommended Posts

Hi all,

I have [b]glutDisplayFunc[/b]() to draw the environement

And I [b]receive [/b]data from [b]network [/b]that contain position of objects, I have a [b]thread [/b]that treats that kind of data

So here my problem

I tried to store data into [b]vector<data>[/b] to be drawn in glutDisplayFunc each time, this way slow down my computer and moving objects is not smoothly

Then I tried to not use vector<data> and want to draw objects direclty from "[b]thread[/b]" that receive data, and nothing happened

so is there way to make moving objects in real time, and if possible draw them from that thread instead of glutDisplayFunc

plz i need an answer asap


Share this post

Link to post
Share on other sites
You have to re-draw the entire scene each frame. Make sure you set up the glut timer/redraw system to issue re-draws as quickly as possible.

If you're saying that networking or using std::vector<> "slows down" your game, that makes little sense; you'd have to use a profiler to figure out where the time is going. It's probably not going where you think it is.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this