BYTE mycolor;
BYTE *sptr;
sptr = g_pDDSOne->Lock(NULL,&ddsd,DDLOCK_WAIT,NULL);
sptr[x + (y*ddsd.lpitch)] = mycolor;
g_pDDOne->Unlock();
BYTE mycolor;
BYTE *sptr;
sptr = g_pDDSOne->Lock(NULL,&ddsd,DDLOCK_WAIT,NULL);
sptr[x + (y*ddsd.lpitch)] = mycolor;
g_pDDOne->Unlock();
ddsd.dwSize = sizeof(ddsd); (i think)
Otherwise direct draw doesnt know what to make of it.
memset(&ddsd, 0, sizeof(DDSURFACEDESC));
Good luck!
Starfall
hRet = g_pDDSOne->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL);
sptr = (BYTE*) ddsd.lpSurface;
sptr++;
mycolor = *sptr; g_pDDSOne->Unlock(NULL);
I was having some problems with this code as well, when I tried printing the value of mycolor to a file, it crashed again. I tried
setting the pixel value by saying
*sptr = 255; but this did not work (I did this before Unlocking). Could someone help me out please?