|
||||||
| C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Hey folks,
I'm doing a relatively simple animation program, but I need to get some rediculously fast frame rates, somewhere on the order of 60 frames per second, but 1000 refreshes/second. Luckily, the frames themselves are simple: just a full screen (1280x800 resolution, could be less) black screen with some characters on it of different sizes and, maybe, color. I can pre-render the frames if necessary. I also don't need to completely update the screen every refresh. What I mean is that I would want a particular frame displayed for about 16 ms, then a blank screen for about 75 ms, then another frame for 16 ms, with 30-60 of these in a row. I would do this a with a nil time between the clearing of the first frame and the drawing of the second frame. I'm working in C++ so far, using the Fast Light Toolkit (FLTK). My experiments show that it takes about 16 ms between the time I call the MyWindow->show() function and the time it takes to get the window on the screen (done by calling gettickcount() before and after the function call). This consistently gives me times on the order of 16 ms, but as I said, I need to frame to display for 16 ms, and I think what this tells me is that it takes 16 ms to draw the frame, not necessarily have the frame on the screen for a full 16ms. I'm also not sure how the monitors refresh rate (60hz, or about refresh each 16.6667 ms) would play into this, but it seems that it would be okay if the frame is draw, to keep it there for 16ms. So maybe, the 16ms it takes to draw the frame isn't a big deal, I'm not sure. Again, any advice would be helpful, I'd perfer to stick with C++/FLTK but I'm open to 1) using a different GUI toolkit, if that'll help; 2) Using a different rendering engine (I tried my hand at OpenGL but found it quite tricky, even for this, I'd use it if necessary though), 3) Using a different language (I'm quite experienced at VB and Java, but if anything, it seems those would give me much worse drawing times). Thanks! |
| Sponsored Links |
|
|
|
|||
|
The speed you can redraw is limited by your monitors refresh rate, both hsync anc vsync. Trying to go to fast will cause clipping, where part of the screen is being rendered while another one is getting pushed to the stack. You can get absurd frame rates by bliting your rendered scene to the GPU and let it take care of everything, including frame sync.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
|
|||
|
Thanks for the reply!
I assume you are referring to the use of the BitBlt API in gdi32, correct? That does sound promising, mind pointing me in the direction of some example code I could look at (if you have some off hand)? Thanks! |
![]() |
| Tags |
| animation, c++, fltk, framerate, gui |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How would you rate your web design skills? | Nefrit | Website Design | 92 | 06-23-2008 02:14 PM |
| Animated Ripple effect (Simple) - Flash MX 2004 | ahsan16 | Photoshop Tutorials | 10 | 05-22-2008 05:54 AM |
| Collapse Outside the frame | Kolyn_Kryw | JavaScript and CSS | 1 | 04-16-2008 02:27 PM |
| Xav | ........ | 160.68 |
| neerlin | ........ | 100 |
| satrian | ........ | 100 |
| delia | ........ | 100 |
| chili5 | ........ | 70.08 |
| morefood2001 | ........ | 36.91 |
| MeTh0Dz|Reb0rn | ........ | 27.15 |
| RyanTuosto | ........ | 20 |
| gamiR | ........ | 19.64 |
| John | ........ | 14.46 |
Goal: 100,000 Posts
Complete: 68%