Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Draw objects in real time


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 vir2007   Members   -  Reputation: 105

Like
0Likes
Like

Posted 01 August 2012 - 03:03 PM

Hi all,

I have glutDisplayFunc() to draw the environement

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

So here my problem

I tried to store data into vector<data> 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 "thread" 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

Thanks

Sponsor:

#2 hplus0603   Moderators   -  Reputation: 5538

Like
2Likes
Like

Posted 02 August 2012 - 09:58 AM

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.
enum Bool { True, False, FileNotFound };

#3 vir2007   Members   -  Reputation: 105

Like
0Likes
Like

Posted 04 August 2012 - 03:23 PM

ok :)
thnx for help




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS