Original Post
Hi,
I have a simple asteroids like game that Im making and I''m trying to plot stars to the background. Its a full screen app running at 800*600*16. I locked the surface (lppdsback), got the line pitch (which I checked) and set a pointer equal to the surface desc.
UCHAR *video_buffer;
DDSURFACEDESC2 ddsd2;
then I initialized ddsd2 and used it when I locked lpddsback.
video_buffer = (UCHAR *)ddsd2.lpSurface;
Then I try to plot the pixel with
video_buffer[x + y*lpitch] = _RGB16BIT565(255,255,255);
before the macro was defined as:
#define _RGB16BIT565(r,g,b) ((b%32) + ((g%64) << 6) + ((r%32) << 11))
The I run the program and the pixel is in the correct location, but it is flickering and blue (sometimes changes to yellow). Does anyone have any idea what I did wrong? Thanks a lot.
James