Hiya, quick one here, I'm sure I've seen or asked it before but can't remember the answer...
Basically sometimes if you load some graphics into your game and then draw them, the first frame takes a long time to draw due to the graphics being uploaded from RAM to VRAM and if you are running delta time or something you get a visible jerk as the next frame compensates and draws further on in the timescale.
So I wanted to cache my graphics before drawing the first frame but wondered the best way to do this. I thought about:
a) Drawing all the graphics, then drawing a black rect over them (or calling CLS) then flip. So there'd be a black screen. Problem is what if BMax and the Graphics card optimise somehow and go "Hmm, he didn't draw anything so I won't upload any graphics". There may even be a difference between using CLS and drawing a black rect.
b) OR can I just call all the DrawImages I want and then not actually call Flip? Will that upload to the graphics card or is flip required?
Naturally I ought to check the total size of all my textures and aim for a minimum VRAM size of say 32MB or 64MB and make sure I cache only the relevent ones instead of absolutely everything.
But even that makes me think, hmm, do graphics cards try to optimise what is cached based on how often it's used or something else (like size) or will new graphics simply push out old graphics (FIFO).
Another thing I don't know is how graphics cards arrange their memory i.e. can textures all be stored linearly so they exactly fill up 32MB or whatever, OR is any space wasted due to bad tessellation i.e. a small graphic is dropped from VRAM leaving a gap but if the other graphics don't "shuffle up", this will leave a gap that may be too small for new bigger textures so the bigger texture is either split or placed entirely elsewhere (a bit like a fragmented hard drive).
I'm a bit of a gfx card noob so any advice is welcome, thanks!
Basically sometimes if you load some graphics into your game and then draw them, the first frame takes a long time to draw due to the graphics being uploaded from RAM to VRAM and if you are running delta time or something you get a visible jerk as the next frame compensates and draws further on in the timescale.
So I wanted to cache my graphics before drawing the first frame but wondered the best way to do this. I thought about:
a) Drawing all the graphics, then drawing a black rect over them (or calling CLS) then flip. So there'd be a black screen. Problem is what if BMax and the Graphics card optimise somehow and go "Hmm, he didn't draw anything so I won't upload any graphics". There may even be a difference between using CLS and drawing a black rect.
b) OR can I just call all the DrawImages I want and then not actually call Flip? Will that upload to the graphics card or is flip required?
Naturally I ought to check the total size of all my textures and aim for a minimum VRAM size of say 32MB or 64MB and make sure I cache only the relevent ones instead of absolutely everything.
But even that makes me think, hmm, do graphics cards try to optimise what is cached based on how often it's used or something else (like size) or will new graphics simply push out old graphics (FIFO).
Another thing I don't know is how graphics cards arrange their memory i.e. can textures all be stored linearly so they exactly fill up 32MB or whatever, OR is any space wasted due to bad tessellation i.e. a small graphic is dropped from VRAM leaving a gap but if the other graphics don't "shuffle up", this will leave a gap that may be too small for new bigger textures so the bigger texture is either split or placed entirely elsewhere (a bit like a fragmented hard drive).
I'm a bit of a gfx card noob so any advice is welcome, thanks!