Jump to content
  • Advertisement

Archived

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

Guest Anonymous Poster

How do yo write a function to copy the Double Buffer in this situation

This topic is 6829 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

Guest Anonymous Poster
if yo use this code:
lpddsprimary->Lock(NULL,&ddsd,DDLOCK_SURFACEMEMORYPTR,NULL);
video_buffer = (UCHAR *)ddsd.lpSurface;
lpitch = ddsd.lPitch;

Then to plot a pixel yo use:
double_buffer[x+y*lpitch] = color;
I believe

How would yo copy the double_buffer to the video_buffer without doing that computation every pixel, just when yo copy the double_buffer,
Thanks for the Help,

Share this post


Link to post
Share on other sites
Advertisement
Hello Esap1

You want to copy the whole double buffer to the primary surface ? Then do it like this (using your variable names):

video_buffer->Blt(NULL, double_buffer, NULL, DDBLT_WAIT, NULL);

VirtualNext

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!