Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

problem with RGB color mode

Posted on 2002-03-14
2
Medium Priority
?
319 Views
Last Modified: 2013-12-26
Hi guys!! i'm having a problem with RGB color mode. in my computer (5x6x5) the game works pretty well, but on other computers (my friends') the color mode is said to be "not supported", i'm wondering why is that? here's the code i've been using in my program:

// get pixel format
     ddsd.dwSize  = sizeof(ddsd);
     ddsd.dwFlags = DDSD_PIXELFORMAT;
     if (FAILED(lpddsprimary->GetSurfaceDesc(&ddsd)))
          {WriteError("DirectDraw: Pixel Format not available"); return(0);}

     // get color type (5x5x5 or 5x6x5), we need only green value
     int g = ddsd.ddpfPixelFormat.dwGBitMask>>5; // throw 5 bits used for red
     if (g == 0x1F) color_type = _5x5x5_;          // 0x1F = 31 (5 bit)
     else if (g == 0x3F) color_type = _5x6x5_;     // 0x3F = 63 (6 bit)
     else
     {
          char buff[60];
          sprintf(buff,"DirectDraw: Color Mode not supported\n"
               "(Green = %d)", g);
          WriteError(buff);     // don't know what is the color mode
          return(0);
     }

i suppose there would be no problems detecting both 5x6x5 and 5x5x5, so it shouldn't give me the message "DirectDraw: Color Mode not supported" right? so what is wrong with it? is there any other color mode i've overlooked anyhow?

thanks in advance!!!

0
Comment
Question by:techpage
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
Crius earned 150 total points
ID: 6869647
Have you taken a look at dwRGBBitCount?

It's possible your friend's computer is not running in a 16 bit display (which is why you need to do a 5x6x5, or a 5x5x5 test).

If he is running a 24 bit or a 32 bit display, then the dwRGBBitCount will be 24 or 32. The code I'm reading should only be run if dwRGBBitCount is 16.
0
 
LVL 3

Author Comment

by:techpage
ID: 6871827
thanks, you're right... it is indeed the color depth, *sigh* i've been thinking it was the color mode all this time...
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question