Page 1 of 2

Misc GapiDraw Questions

PostPosted: Aug 23, 2003 @ 11:47pm
by mlepage

Misc GapiDraw Questions

PostPosted: Aug 24, 2003 @ 12:07am
by Kak

PostPosted: Aug 24, 2003 @ 3:50am
by DillRye

PostPosted: Sep 5, 2003 @ 11:55pm
by mlepage

PostPosted: Sep 6, 2003 @ 2:35am
by InexorableTash

PostPosted: Sep 6, 2003 @ 4:35am
by mlepage

PostPosted: Sep 11, 2003 @ 4:19am
by mlepage
How do I create a new surface that is a copy of an existing surface? (Say, to take a copy of the back buffer.) Can I just use the copy constructor?

PostPosted: Sep 11, 2003 @ 4:22am
by InexorableTash
Create a new surface the same width and height, and then BltFast.

(I would highly recommend against copy constructors being used for this sort of thing. C++ compilers like to use them in all sorts of places you wouldn't expect, and with a large memory copy you could find performance hits you weren't expecting.)

PostPosted: Sep 28, 2003 @ 6:05am
by mlepage

PostPosted: Sep 28, 2003 @ 11:27am
by Johan

PostPosted: Oct 18, 2003 @ 5:41am
by mlepage

PostPosted: Feb 9, 2004 @ 5:10am
by mlepage

PostPosted: Feb 9, 2004 @ 6:18am
by mlepage

PostPosted: Feb 12, 2004 @ 5:31am
by InexorableTash
You don't have to use the CGapiApplication frame timer mechanism; I'd recommend either rolling your own, or instead of using frame ticks switching to absolute times (e.g. your high performance tick counts) to position items in the game world.

Think about this scenario: average frames take 20ms, per-frame time is set at 30ms (so 33.3 frames per second - that makes the other number round). So on average, the timer is going to sleep for 10ms per frame. Now you run into a frame that takes 45ms to render. Now, the timer would have to sleep for -5 seconds to catch up.

Most commercial games that I've seen either just "stutter" when there's an intense frame (e.g. the game slows down when there's lots of activity) or use absolute times (e.g. it takes 5 seconds for a ship to fly across the screen, whether that's 1 frame or 150 frames). In the latter case you probably want to cap the frame rate at some reasonable number so you're not consuming 100% CPU. The CGapiApplication timer seems to be an adequate implementation for both scenarios, but may not be for yours.

PostPosted: Feb 12, 2004 @ 6:26am
by mlepage