Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Bitmap vs. Image

Author
Message
roswell
21
Years of Service
User Offline
Joined: 17th Dec 2002
Location: United States
Posted: 21st Apr 2003 05:34 Edited at: 21st Apr 2003 06:28
First off, forgive me if I'm overlooking a very obvious answer here, but I have yet to see it. Can anyone explain for me when to use a bitmap (as in LOAD BITMAP) and when to use an image (as in LOAD IMAGE)? They both support the same filetypes. What is the main reason for using one over another? It seems to me that they both can be loaded, and sent to the screen. Bitmaps are obviously more valuable because there are only 31 available index numbers. When programming a small 2D game, however, with only a few images moving around, what would be the benefit of bitmaps over images?

Oh, and one more question: Do sprites "share" their contents with an image? That is to say, if DBPro supports 65,000+ sprites on the screen at one time, does that mean that each sprite must have a corresponding image in memory to pull from? It looks like each SPRITE command requires an image number to display. If someone can de-fuzzify this concept, I'd be truly grateful.

/* You are not expected to understand this. */

Dual Athlon 2.0/1GB RAM/GeForce Ti4200-128/Win2000 Pro
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st Apr 2003 13:52
DBPro has considerably more bitmaps available than that, however -

You use an image for sprite images, and for textures, and for small graphics (such as individual letters in a font). I load into bitmaps for large graphics that I wish to break into images (such as a grid of fonts).

Basically, If there is not an overiding reason to load into a bitmap, load into an image instead.


If the following code, both sprites share the image - there is only one copy of the image and no need for extra copies.

load image "ship.bmp",1,1
sprite 1,0,0,1
sprite 2,100,100,1
jimbo1913
21
Years of Service
User Offline
Joined: 19th Apr 2003
Location: - Please Select -
Posted: 21st Apr 2003 21:14
Rosewell - where did u get the 'Bob' (is that right?) I vaguely remembering reading an article in some magazine about 'The Cult of Bob' and pissed meself laughing at it.

Mere humans cant smoke his pipe right?

from future review of next game....
'..while the programmer of this game may not be God-like he certainly represents the next step in human evolution. (10/10).'
CloseToPerfect
21
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 22nd Apr 2003 02:25
bitmaps are stored in you video memory and images are store in you ram. If your programing for a low-end card like 8 meg the min for DBP then you can't load very many bitmaps or the program will crash.
I would assume the advantage of bitmaps over images would be speed if you have a good card with fast vram.

CTP

roswell
21
Years of Service
User Offline
Joined: 17th Dec 2002
Location: United States
Posted: 22nd Apr 2003 08:34
jimbo1913 -- My avatar is J.R. "Bob" Dobbs. Cultural icon, snappy dresser, and keeper of the Slack. He's a prophet for the Church of the SubGenius.

http://www.subgenius.com

/* You are not expected to understand this. */

Dual Athlon 2.0/1GB RAM/GeForce Ti4200-128/Win2000 Pro

Login to post a reply

Server time is: 2024-09-20 06:33:04
Your offset time is: 2024-09-20 06:33:04