First of all, I thought that if your videocard didn't support gamma control, DirectX would emulate it. Is this true? I've tried unsucessfully to implement a gamma control fade as described in the tutorial at http://www.gamedev.net/reference/programming/features/gamma/ The other thing is when I try to use this code to blit a white square to the lpddsprimary surface, it comes out as a turquoise square:
#define _RGB16BIT565(r,g,b) ((b%32) + ((g%64) << 6) + ((r%32) << 11))
DDBLTFX ddbltfx; // the blitter fx structure
RECT dest_rect; // used to hold the destination RECT
DDRAW_INIT_STRUCT(ddbltfx);
int x1 = 0;
int y1 = 0;
int x2 = 50;
int y2 = 50;
// now set up the RECT structure to fill the region from
// (x1,y1) to (x2,y2) on the destination surface
dest_rect.left = x1;
dest_rect.top = y1;
dest_rect.right = x2;
dest_rect.bottom = y2;
ddbltfx.dwFillColor = _RGB16BIT565(255, 255, 255);
// make the blitter call
if(FAILED(lpddsprimary->Blt(&dest_rect, NULL, NULL, DDBLT_COLORFILL / DDBLT_WAIT, &ddbltfx)))
Yet when I use _RGB16BIT565(254, 254, 254), it seems to work fine. BTW I am in 640x480x16 mode, so that's not the problem. Also, the same thing happens when I use a macro for the 5.5.5 pixel format. Any help is greatly appreciated.
Edited by - ziplux on 1/28/00 10:02:16 AM