Skip to main content
gamedev.net
🔒 Locked

Bits Per Pixel

Started by Faz 7 replies 400+ views
Original Post
Faz
Faz
I am writing a 2d game using 16bit colour in directx7. I''ve read that if you load in a bitmap using a different colour count, eg 8 bit(palette mode), onto a surface, directx automatically stores the surface into system memory as opposed to video memory. Is this true?, if so how do I convert an image to 16 bit colour, as my paint program (Paint Shop Pro 5) only sets colour counts to 8bit, 24bit etc, but not 16bit!. Do I just store the bmp in 24 bit? The game is running fine, I just want to make sure that I am using the video memory not system memory for storing off screen plain surfaces. Cheers
dusik
dusik
As far as I know, there is no 16-bit BMP.... Hmmm.....

What are you using to load the BMP files though? If you don''t use the framework library (I think it sux.... but maybe that''s just me) you can probably convert them.

Oh well, I guess it doesn''t concern me right now. I''m doing a 3D engine in DX8 Oh what fun, time to get 3DS files load... cya

DuSiK

------------------------
CRAZY_DUSIK* pCrazyDuSiK;
pCrazyDuSiK->EatMicroshaft(MS_MUNCH_BILL_GATES | MS_CHEW_BILL_GATES);
------------------------CRAZY_DUSIK* pCrazyDuSiK = new CRAZY_DUSIK;pCrazyDuSiK->EatMicroshaft(MS_MUNCH_BILL_GATES | MS_CHEW_BILL_GATES);pCrazyDuSiK->WebSiteURL = "http://www.geocities.com/dusik2000";
dusik
dusik
Also, can''t you specify video memory in the DDSURFACEDESC2 or whatever?

------------------------
CRAZY_DUSIK* pCrazyDuSiK;
pCrazyDuSiK->EatMicroshaft(MS_MUNCH_BILL_GATES | MS_CHEW_BILL_GATES);
------------------------CRAZY_DUSIK* pCrazyDuSiK = new CRAZY_DUSIK;pCrazyDuSiK->EatMicroshaft(MS_MUNCH_BILL_GATES | MS_CHEW_BILL_GATES);pCrazyDuSiK->WebSiteURL = "http://www.geocities.com/dusik2000";
Faz
Faz
I am using 24 bit bmps. I am using the DDLoadBitmap function in the ddutil.cpp file that you get with directx7. The game is running at 640x480x16 in full screen mode. I am specifying the surface to use video memory. Basically what I am asking is when running a game in 16bpp mode, can I use 24bit bmps?
bbxx
bbxx
yeah, you can use 24bit bitmaps but you need to convert them if you are using 16bit color display. there are two different types of 16bit color. 555 and 565. the 555 is only 15 bits but i think most new cards use 565.
Matt Teiken
Faz
Faz
How do I convert them from 24bit to 16bit?, do I use a paint program?, I''m using paint shop pro5 and it converts it to 8bit, 24bit, 32bit but NOT 16bit!

Cheers
TwoFlower
TwoFlower
You need to convert them at runtime when you load the images. The format of the pixels will be different depending on what graphics card the app is running on, so you have to detect this and then do the conversion.

The D3DX utility library has bitmap loading functions, or use the GDI to blit to the surface to do the conversion, or write the pixels directly yourself.
Faz
Faz
I''ll try that thanks!
dusik
dusik
Hey, if you want, I can send you a chunk of my code for loading BMPs... just e-mail me at dusik2000@yahoo.com. It''s my olde DX7 code I did a while ago.

------------------------
CRAZY_DUSIK* pCrazyDuSiK;
pCrazyDuSiK->EatMicroshaft(MS_MUNCH_BILL_GATES | MS_CHEW_BILL_GATES);
------------------------CRAZY_DUSIK* pCrazyDuSiK = new CRAZY_DUSIK;pCrazyDuSiK->EatMicroshaft(MS_MUNCH_BILL_GATES | MS_CHEW_BILL_GATES);pCrazyDuSiK->WebSiteURL = "http://www.geocities.com/dusik2000";

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.