Jump to content
  • Advertisement
Sign in to follow this  
lupin982

OpenGL frame rate and scheduling problems NEED HELP

This topic is 3259 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Dear friends, i have a problem explained in the follow: I use the linux OS. I have 2 function "processData(parameters)" and "display(parameters)" this 2 function share the data with a shared memory. processData function process the data displayed from the display function, for this the display function must be recall after the processData function. I recall the display function with opengl; in the main function i use glutDisplayFunc(display); The processData function is recalled with a simple posix timer every 20 milliseconds, the frame rate is 20 msec. the project schema is this: processData(parameters) | | shm | | display(parameters) ----------------------------------------- void processData(parameters) { ... process data put data in shared memory ... } void diaplay(parameters) { ... diplay shm data provided from the processData function ... } int main(int argc, char **argv) { int sigNumber = signal number; //assign to sigNumber 55 posixtimer scheduler(dataProcess, sigNumber); //define posix timer scheduler.start(20); // 20 msec is the frame rate ... init gl function ... glutDisplayFunc(display); glutIdleFunc(idle); } The problem is that the display function mast be recall always after the processData function and not with the opengl frame rate (glutDisplayFunc(display)). Another problem is that in some frame the processData function can require more then frame time, in this case i want to display the previous frame data. I try to resolve that problems with semaphore in the 2 function procesData and diplay, i accomplish in this mode to call the diplay function after the processData function, bat in some frames i diplay black data because in that frames the processData use more than 20 msec to process the data e put that in the shared memory. I don't know what happened in that cases because in the shared memory should be the previous frame data. Can anyone suggest me how i can resolve that problems? Thanks

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!