Advertisement

DirectX *mumbles*

Started by January 31, 2000 05:53 AM
10 comments, last by Miraj 25 years, 1 month ago
Honestly, I don''t know why I put myself through this. Never the less I do so no use in complaining. Ok I feel like I''m in the dark here big time. All of these games I see, commercial and non commercial have these wonderful graphics that SEEM to be 24 bit. How come when I attempt to load a Bitmap that is 24 bit in Directdraw it comes out looking like .... well .. not what I intended. I''ll leave it at that. Am I losing my mind? Are all these wonderful games we play using 256 colors? If so WHAT DAMN art program are they using? LOL. I''ll be the first to admit I know nothing about most art packages but I can tell you 256 colors in programs like Paint Shop Pro or Adobe Photoshop don''t look like commercial quality. Diddo when I load them in my program. Someone please explain this to me! -Miraj
-Miraj
Well there is 8 bit (265 color), 16 bit (65,536 colors), 24 bit (16.7 million colors) and the 32 bit (4.2 billion colors)

Kavos.
Advertisement
How are you loading the bitmaps? Can you post the relevant code?

Breakaway Games

Former Microsoft XNA and Xbox MVP | Check out my blog for random ramblings on game development

try using the ddutil(.cpp) routines...they should work, unless you are concerned about speed or flexibility that is
Is the screens bit depth less than the bitmap?
I am using ddutil.cpp. I''m not to concerned about speed as I''m just studying and learning right now

The problem is I can''t manpulate it the way I want, heh.

I think ne8bit hit it though. I think the problem is my screen depth. Its not that I have a problem finding example code to help me with that its just that when I have I have trouble figuring out where it begins and where it ends. Hmm....

As for the code, its pretty straight forward. Most is getting Directdraw up and running and then your standard routines based on ddutil like hRet = (HBITMAP) LoadImage...etc.

Bit depth, bit depth, I need to figure out how to change that, heh.

-Miraj
-Miraj
Advertisement
Something you might want to look into is a technique known as dithering. A lot of profesional games use it to minimize the effect of color loss (what you get when you go from 24bit surfaces to 16bit or lower).

--TheGoop
Kavos: 32bit is still 16.7 million colors.
What most people do or at least what I do is the folowing.
Draw your image in your favorite paint app and save it as a 24bit bmp. I sujest you write your engine in 16bit mode it''s fairly is to work with! So through some code you will be able to load up teh 24bit image and convert it to 16bit, also once you have learned that you will be able to support more graphics formats and even create your own! 24bit and 32 bit 2d engine arent there yet cause teh hardware is to slow especially when you want to start writting transparency effects etc....


Since you are in learning mode. I sujest getting 2 books:

Windows Game Programminf For Dummies and Windows Tips and Trick Of The Game Programming Guru''s both by Lamoth.

First book is in 256 color, but he does show you how to load a 24 bit bmp and convert it to 16bit. Through that I was able to convert the 256 into 16bit wich is more than enough! 24bit is just to slow for the present momment and also not to many vidoe cards support 24bit mode because of memorry alignment. The other book is bassicly the sameof the first, except that he talks more of teh higher bit depths more and less of 256! And show you some extra stuff!
Hardcore Until The End.
Almost every 2D game lately has been in 256 colors, I think. (for instance, Sanitarium and even Tiberian Sun were in 256 colors, I think.) As for how you''d make the graphics, I know that Paint Shop Pro can reduce images to optimized palettes, so if you put all the true-color graphics you use in a level in a single image, you can just convert it to 256 colors and then apply the palette to the individual images.

This topic is closed to new replies.

Advertisement