Skip to main content
gamedev.net
🔒 Locked

Video memory copy

Started by Ecco2000 Jan 15, 2001 at 4:12 AM 0 replies 450+ views
Original Post
Ecco2000
Ecco2000
lpDDS->Lock(NULL, &ddsd, DDLOCK_WAIT, NULL); unsigned char *memptr; unsigned char *datptr; memptr = (unsigned char *)ddsd.lpSurface; datptr = bitmap->data + bitmap->sizeX * bitmap->sizeY * 3; datptr -= bitmap->sizeX * 3; for (int i = 0; i < bitmap->sizeY; i++) { for (int j = 0; j < bitmap->sizeX; j++) { memcpy(memptr, datptr, 3); // Add one pixel memptr += 4; // Add one pixel datptr += 3; } memptr += ddsd.lPitch - bitmap->sizeX * 4; datptr -= bitmap->sizeX * 3 * 2; } lpDDS->Unlock(NULL); is there anyway i can convert the image to a 4 byte color format first if so how. p.s. i don''t want to save it in that format.
"Don't make me come down there..." -GOD

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.