On my screen i see kind of trails left behind when i move the ship forwards and it animates the rockets at the back.
Could anyone tell me why that happens/ how to avoid it?
(arrow keys move, Esc exits)
Oh and im using DDRAW btw.
On my screen i see kind of trails left behind when i move the ship forwards and it animates the rockets at the back.
Could anyone tell me why that happens/ how to avoid it?
(arrow keys move, Esc exits)
Oh and im using DDRAW btw.
Trails are generally caused by not repainting what was underneath the moving object. What you can do is copy the RECT that defines where the Ship was into a temp RECT. Blit the portion of the background that was covered by the temp RECT and blit the Ship in it's new position.
I see, what i'm doing at the moment is memory filling the back buffer with 0s, then blitting my ship surface to the back buffer, then flipping.
Thats why i dont quite understand why im getting trails; the back buffer is totally wiped before a new image is loaded onto it.
*confused*
I might add that the trails are not permanent they fade quickly, do you see them when you run it? Perhaps its my monitor.
Last edited by Clyde; 07-02-2002 at 05:04 PM.
what kind of frame rate are you getting?
ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.
I have no idea, how would i test for frame rate?
you need some way of outputting the values...
// declare these where you need them
// RealFPS stores last seconds fps
// framecountis out current fps counter
int RealFPS = 0,framecount;
// our timer for each second
long timetest = 0;
//later on...
drawframe();
framecount++;
if(timetest < GetTickTime())
{
timetest = GetTickTime() + 1000; // set timer for next second
RealFPS = framecount; // set the FPS
framecount= 0; // clear the counter
}
something like this for a quick fairly accurate check
ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.
i tried your program i get no trails at all.
¿Red Baron?
"Imagination is more important than knowledge"
-Albert Einstein (1879-1955)
Check out my games!
[code] /* dont forget code tags! */ [/code]
" tried your program i get no trails at all"
Cool, in that case its probably my lame monitor
Thanks for the advice on frame-rate counters No-One.
could we see the source code for that?
Frame rate is 75ish, my monitor must just suck.
"could we see the source code for that?"
Sure, almost all the directx stuff is wrapped up in the functions in t3dlib1.ccp/h.
This is the exe that the above code is for, it includes firing (spacebar).
It needs to be placed in the same directory as the two bmps in the zip above
You will also haev to rename the space7.bmp to space9.bmp
Last edited by Clyde; 07-03-2002 at 09:06 AM.
is the spaceship suppose to look different than before?
¿Red Baron?
"Imagination is more important than knowledge"
-Albert Einstein (1879-1955)
Check out my games!
[code] /* dont forget code tags! */ [/code]
The animation for the thrusters has changed a little otherwise it should be pretty much the same.
Does it look very different to you?
yes, it looks like its been stretched or something, the ship is wider and the colours more blurred, it has the same colours as the old ship.
¿Red Baron?
"Imagination is more important than knowledge"
-Albert Einstein (1879-1955)
Check out my games!
[code] /* dont forget code tags! */ [/code]
hmm how odd, i didn't notice a change.
I cant see why that would happen, i guess ill have to peruse my code