Results 1 to 6 of 6

Thread: createCompatableDC what if you don't want a compatible one?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2001
    Posts
    74

    Question createCompatableDC what if you don't want a compatible one?

    Is it possible to create memory dc's that arn't the same as the current screen setting?

    I ask because running my game in 16 bit color rather then 32 bit effectively reduces the memory requirements for the memory dc's by half. However although the sprites look good in 16 bit color the backgrounds do not. The game must run in 32 bit color but is there a way I can create the sprites in 16 bit color and have them still display correctly when windows is running in 32 bit?

    I've tryed changing the color settings through vb at the time the dc's get made then changing it back once they are made but that doesn't seem to work as in some cases caused malfunctions.
    All will fall before the might of the Black Sashi...

  2. #2
    Zaei
    Guest
    If your DCs are 16 bit, your images are going to be 16bit, so there is no reason to be running in 32 bit mode while the game is running. You will have 16 bit quality either way.

    As for the malfunctions, here is probably the reason:
    Code:
    a 32 Bit mode color is:
    XXXXXXXX RRRRRRRR GGGGGGGG BBBBBBBB
    while a 16 bit mode color is:
    RRRRRGGG GGGBBBBB
    If you notice the above diagrams, 32 bit is, of course, 2 bytes longer. So, when you blit from oen to the other, the 32 bit DC expects 32 bits of color data, while only 16 is provided. The problem is that, for every 2 pixels you get 1 32 bit value, looking something like:
    Code:
    XXXXXXXX GGGBBBBB RRRRRGGG GGGBBBBB
    Just a bit garbled up, id say =).

    This is all conjecture, as I dont know what goes on inside of BitBlt, but it is probable.

    Z.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2001
    Posts
    74

    re

    Well it seemed to work for the most part only with occasional problems (although on the whole it seemed to unstable to trust) memory wasn't getting saved like it would if I'd been running in 16 bit for the whole thing. Since I don't need all the quality of a 32-bit color sprite is there no other way to shrink the size of the dc?
    All will fall before the might of the Black Sashi...

  4. #4
    Zaei
    Guest
    Just change the bpp to 16 bits at the beginning of the program, and switching back to whatever bpp the user was running before at the end of the program.

    Z.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Sep 2001
    Posts
    74

    Question re

    I wan't to run the game in 32-bit color though because the backgrounds were designed for that and some of them look all blotchy in 16-bit.

    ideally I'd want something that would change only the memeory dcs not the rest of the game.
    All will fall before the might of the Black Sashi...

  6. #6
    Addicted Member Janus's Avatar
    Join Date
    Aug 2001
    Location
    California
    Posts
    221

    Use

    CreateDC, if i remember... you have to give it a bunch of parameters.
    "1 4m 4 1337 #4xz0r!'
    Janus

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width