Link to home
Start Free TrialLog in
Avatar of techpage
techpage

asked on

problem with RGB color mode

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!!!

ASKER CERTIFIED SOLUTION
Avatar of Crius
Crius

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of techpage
techpage

ASKER

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