OK I have a game that loads in graphics into templates and then makes objects with graphics that point to the templates. Also sometimes I use CreateImage with the all important 1 flag on the end! I time all the game routines in millisecs and output them for debugging/optimisation.
I have noticed that on some video cards the first time a graphic is drawn (with DrawImage or DrawBlock) there is a spike in the amount of millisecs taken to draw it e.g. normally takes 1 ms but suddenly takes 10ms. Then the second time the graphic is drawn, all is fine. This happens with tiles, enemies, pickups, fonts, all different types etc but not everything, to be honest it is a bit inconsistant and is not noticeable on some machines. I have tested it with sound off to make sure that was not the problem.
So I am asking how are loaded and created images stored in Blitz? I know they are "managed" based on the flags but what manages them, Blitz or the video card? Is there some kind of video caching going on? The game uses hardly any resources and I have run it on good machines so I doubt very much it is using virtual memory and my code loads everything before the level is displayed.
Any ideas? I know this is quite a techincal point but I was hoping someone knew. I realise it could be some kind of bug on my part, but before going on a wild goose chase I was hoping someone else knew for sure ...
Many thanks in advance.
I have noticed that on some video cards the first time a graphic is drawn (with DrawImage or DrawBlock) there is a spike in the amount of millisecs taken to draw it e.g. normally takes 1 ms but suddenly takes 10ms. Then the second time the graphic is drawn, all is fine. This happens with tiles, enemies, pickups, fonts, all different types etc but not everything, to be honest it is a bit inconsistant and is not noticeable on some machines. I have tested it with sound off to make sure that was not the problem.
So I am asking how are loaded and created images stored in Blitz? I know they are "managed" based on the flags but what manages them, Blitz or the video card? Is there some kind of video caching going on? The game uses hardly any resources and I have run it on good machines so I doubt very much it is using virtual memory and my code loads everything before the level is displayed.
Any ideas? I know this is quite a techincal point but I was hoping someone knew. I realise it could be some kind of bug on my part, but before going on a wild goose chase I was hoping someone else knew for sure ...
Many thanks in advance.