Which memory does LoadImage/LoadAnimImage use?

BlitzPlus Forums/BlitzPlus Programming/Which memory does LoadImage/LoadAnimImage use?

AlexZ(Posted 2003) [#1]
Probably a silly question, but, which memory does LoadAnimImage/LoadImage use? Does it load in video memory or system memory? And, when DrawImage is used over and over, if image is loaded in system memory, does it grab it over the bus / agp every frame or does it cache in video memory?

Thanks.


jhocking(Posted 2003) [#2]
I think it goes into video memory first and then if that runs out it goes to system memory but I'm honestly not certain. I'm rather curious now that you've asked. Can someone who knows for sure (eg. mark) answer?


Beaker(Posted 2003) [#3]
Presuming you are talking about Blitz2D (or the 2d part of Blitz3D), I'm pretty sure it just uses gfx memory.


Gabriel(Posted 2003) [#4]
Just run a little test and if you're talking about B2d, it is going straight to video memory even before you actually display it for the first time.


Tricky(Posted 2003) [#5]
Maybe this clarifies things...

When I don't set a GFX I can use LoadImage and even DrawImage in the window I have, but as soon as I set a graphics mode, all my images are lost...

That makes me assume the video mem is used, but I could be too quick on that...


Billamu(Posted 2003) [#6]
When you set a graphics mode it automtically clears the graphics memory, which means all your Images you've loaded before calling the graphics command get cleared along with it.


AlexZ(Posted 2003) [#7]
I am setting a 3d mode but use 2d functions as well. i want to make a side scroller with some 3d elements in the back. Sprites look nice and sharp when drawn with 2d functions, if I texture a 3d sprite with the sprite, it looks blurry because I can not get the pixel perfect translation (i.e. 32x32 sprite occupies more or less 32x32 pixels as a 3d object, but not exactly).

I was just wondering in terms of speed. Thank you guys.


Billamu(Posted 2003) [#8]
Have you tried/Are you using Sprite Control.bb functions by Syntax Error? It's good for using 3d for placing 2d sprites in 2d space. I'm using it for a HUD.

I think that since it's all rendered in 3d it's faster.

http://homepage.ntlworld.com/config/spritecontrol/spritecontrol.htm

This has been updated recently (I'm using an older version - damn!)


AlexZ(Posted 2003) [#9]
Thanks Billamu, that is actually what I needed. Thanks to syntax error too! =)


turtle1776(Posted 2003) [#10]

I think it goes into video memory first and then if that runs out it goes to system memory



This is correct, at least with respect to 2D stuff.


Anthony Flack(Posted 2003) [#11]
Right. And with 3d, at least on my card, it seems to go into system memory first, and then copies into video memory the first time it appears on screen. In my game, I had to make a little kludge at the start of each level, which draws everything on screen once - otherwise stuff would be loading in (slowly) while you scrolled around the screen for the first time.


BlitzSupport(Posted 2003) [#12]

In my game, I had to make a little kludge at the start of each level, which draws everything on screen once


That's interesting, because I read an article by some professional developer where they had to do exactly the same thing (render a frame 'invisibly' before putting the game on-screen). I guess it's a DirectX 'feature'...