« first day (220 days earlier)      last day (4711 days later) » 

9:02 PM
can anyone tell me what the * elapsedtime is called in graphics tech terms, so I can find the explanation of how that works?
float elapsedtime = app.GetFrameTime();

if (app.GetInput().IsKeyDown(sf::Key::Left)) expl.Move(-200 * elapsedtime, 0);
 
Time delta?
 
it's a variable tick rate engine
it basically means that the movement is adjusted for the rate of update, giving it a flat movement speed regardless of the update rate
 
rate of update = framerate?
so app.GetFrameTime(); is the time since the last frame was printed on the screen, so doing the amount to move times the last time it was updated it gives how much it should be moved since the frame was last refreshed?
 
no, the rate of game-state updates
and yes
 
@DeadMG but you do mean visual updates?
 
9:07 PM
no
 
confused :(
 
the updates to the screen and the internal game state are orthogonal
of course, in a single-threaded system, then they have to happen serially
 
IMHO it's easier to work with constant ticks. AFAIK it's also less prone to glitches.
 
but in multithreaded games, they are concurrent
and, of course, the frame rate is not the same as frame time
after all, if your game gets 30fps, that doesn't say anything about how much time you spent rendering and how much you spent updating
or if you spent the first half a second doing the first frame, and 29 frames in the other half a second
 
@DeadMG oh, so as the game changes, so do the screen visuals?
 
9:09 PM
yes
in a concurrent engine, then you view snapshots of the game state
in a serial engine, you view it after each update
 
can you refer me to some place that explains that principle in some more detail?
 
there's not really more detail to it
if you want to move 30 units per second, then you need to know the time in order to know the units
unless you want more detail on concurrent engines
 
so each time the state of the game changes, mostly the visual will also change, so they depend one upon another, no?
 
yes
 
leave it to single threaded for now
 
9:13 PM
you typically update the game state once a frame, but it's not compulsory and some engines do it differently
 
oh ok
 
you compute data, then you display the data
 
so that timeelapsed business just tells me how much to move since the last frame was printed...
 
yes
exactly
 
hmmm... ok, seems simple enough
 
9:14 PM
when you call GetElapsedTime(), then it has a marker in the object which tells it when the last time was
it computes the time since you last called GetElapsedTime(), updates the marker, and returns the computed time
on Windows, you can use the High Performance Counter to get the elapsed time to a very high precision
 
cause I tried my example without doing the time elapsed and then on moving the pic it no longer shows, I guess cause it has no idea where to do draw it
 
the Standard's clock() and clock_t are nowhere near precise or accurate enough for this job
@Tony: I could post for you the source of my current engine
 
HPC on Windows, gettimeofday on Linux.
 
@DeadMG where do you want to post that?
 
it's in the middle of revising right now and is a bit of a mess, but for simpler things like this it should be fine
eh, I'll just stick a .zip up somewhere
 
9:16 PM
or you want to email it (if you don't want to publicly post it)
 
yeah
I've got a .RAR with a VS2010 project in it
how's that?
 
@DeadMG sure
that email works... just tested it
did you get it?
don't wanna leave SO with an email of mine
haha
 
yeah got it
 
oh, by the way, VS2010, so it's completely a C++0x project, with nullptr and std::unique_ptr and stuff in it
but no Boost dependencies
just DX and WinAPI
 
9:23 PM
@DeadMG hmm DX, do I have to download that somewhere?
 
there's a DirectX SDK
but you'll only need it if you want to actually compile and run, instead of just look at the source
 
I've got Boost installed, so wouldn't have mattered much
 
I can live with C++0x :)
@DeadMG I'd want to see what it does, besides seeing the code... it helps to understand it
what DX is it? (Version)
 
well, the DirectX stuff s a DX SDK download from MSDN
9, and some 11
 
9:25 PM
so I guess if I downloaded 11SDK I'd be fine?
 
the same SDK contains all of them
 
it would I guess be backward compatible?
oh ok
 
and you'd need the 9 SDK
11 code path is disabled
due to text rendering issues
even if there was a 9 SDK, I mean
basically, Microsoft removed the Direct3D native font rendering, ID3DXFont
and then didn't replace it with anything
 
@DeadMG muppets
 
yep
meaning I couldn't implement even the simplest API element
I do quite like my current-gen API design, though it needs hefty expanding
 
9:29 PM
hmmm
did you find this stuff easy?
 
also, I removed the 3D stuff
no
this is my third attempt
the 3D rendering stuff does work, but it's in the middle of a massive upgrade
i.e., a complete systems re-write
so's the 2D, but the previous implementation still survives
so all in all, it's a big mes
 
it's ok, I'm sure I can still learn from it :)
 
well
the 2D implementation is just poorly optimized
the 3D implementation needs completely re-working
the 2D API needs a lot of layout work done
but it could be much worse
 
D3D uses COM?
 
yup
 
9:40 PM
ugh
 
it's hardly a big deal, no real COM knowledge is needed
 
oh ok
 
all I had to do was one custom deleter
and then there's a tiny bit of QueryInterface
 
@DeadMG that's what I was looking at just now
 
what, QI or the custom deleter?
 
9:43 PM
custom deleter
what is this D3DXMatrixPerspectiveFovLH
 
generates the perspective matrix from some simple camera parameters
 
it builds a perspective projection matrix, which I think I get, but left handed?
 
I've no idea what the difference is between LH and RH
but LH is faster, a little, and it doesn't seem to matter which you pick as long as you always pick the same
 
hmmmm
 
C++ courses should teach Boost alongside standard library.
 
9:49 PM
@DeadMG LH refers to the ' left-handed coordinate system.' that is being used
even better: Coordinate Systems
 
I wonder why they support both, instead of sticking to either one.
 
oooh
maybe that explains why my camera rotations never worked
lol
I think I kept using some sort of rotated LH system, not LH
 
it helps sometimes to know why things are the way they are, lol :P
 
lol
 

« first day (220 days earlier)      last day (4711 days later) »