Original Post
i am doing a simple terrain engine and i would like to have textures generated from values of heightmap, but i can''t figure out why this code ain''t working:
void TEXTURES:
utPixel(LPDIRECTDRAWSURFACE7 pSurface, int x, int y, int r, int g, int b)
{
DDSURFACEDESC2 ddsd;
ddsd.dwSize=sizeof(DDSURFACEDESC2);
pSurface->GetSurfaceDesc(&ddsd);
pSurface->Lock(NULL, &ddsd, 0, 0);
DWORD lPitch=ddsd.lPitch;
WORD* wDest=(WORD*)ddsd.lpSurface;
wDest[x+y*lPitch]=RGB(r, g, b);
pSurface->Unlock(0);
}
it doesn''t give me any errors, but doesn''t either write anything to my texture surface... i am using framework library.