Jump to content
  • Advertisement


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


Video memory copy

This topic is 6485 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 GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!