Original Post
I am trying to directly manipulate a surface to plot a pixel.
Right now i am calling a function that says something like:
bool particles::Draw(LPDIRECTDRAWSURFACE s, int r, int g, int b)
{
BYTE* dest =NULL; //destination
DDSURFACEDESC ddsd; //create a descriptor
//init descriptor
memset(&ddsd, 0, sizeof(DDSURFACEDESC));
ddsd.dwSize = sizeof(ddsd);
//LOCK THE SURFACE
if(FAILED(s->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL)))
return FALSE; //Huston, there is a problem.
//find out where we are going
dest = static_cast(ddsd.lpSurface)
//write the data
/*gives me errors here*/ *(dest+m_xpos+m_ypos*SCREEN_WIDTH) = (r<<16)|(g<<8)|b;
s->Unlock(NULL);
return TRUE;
I checked out the gamedev resources on plotting pixels, but they were dealing with methoeds a little bit more advanced than I want to deal with. I am still learning.
Thanks.
Edited by - CTRL_ALT_DELETE on December 18, 2001 5:54:02 PM