Advertisement Jump to content


This topic is now archived and is closed to further replies.


Video memory copy

This topic is 6580 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!