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

Started by
0 comments, last by GameDev.net 24 years, 5 months ago
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,

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

This topic is closed to new replies.

Advertisement