Original Post
Hi...
Damn ddraw keeps screwin'' with my head!! >:|
void PlotSinglePixel( LPDIRECTDRAWSURFACE7 pDDS, int x, int y, int r, int g, int b )
{
// Safety net
if (pDDS == NULL) return;
if (x < 0 || x >= 640) return;
if (y < 0 || y >= 480) return;
DDSURFACEDESC2 ddsd;
ZeroMemory( &ddsd, sizeof( ddsd ));
ddsd.dwSize = sizeof( ddsd );
pDDS->Lock( 0, &ddsd, DDLOCK_WAIT, 0 );
DWORD *pDDSPixel16 = ( DWORD* )ddsd.lpSurface;
pDDSPixel16 [((ddsd.lPitch / 2) * y) + x] = RGBToColour(r,g,b);
pDDS->Unlock(NULL);
}
Whats wrong with this?!
If I draw a pixel at 0, 0 it''s fine, but at 1, 0 it''s actually at 2,0, and the pixel than should be at 2,0 is at 4,0..
so it''s spacing them improperly...
oh and the pixel at 639,0 is at 639,1...
it''s like the screen it only 320 wide
- Derek