Figured I can't edit my post to update progress, so I have to make a new one....
I found the SDL_CreateRGBSurfaceFrom function that takes existing pixel data, but I either get an all-black image or read access violation error with the blit. Basically, this is the idea:
Code:
// AlphaBlend stuff
HDC HDCBack; // pointer for back buffer, for drawing into - I can't access this with SDL
HBITMAP HBMPBack; // I can't access this with SDL
BITMAPINFOHEADER BackBufferInfo; // irrelevant
LPBITMAPINFOHEADER BackBufferInfoPointer; // irrelevant
LPVOID BackBufferPointer; // I can access this, but it's all black
unsigned char BackBuffer[3145728]; // back buffer pixel data 1024x768 at 32-bit color
// right after SDL initialization:
SDLBack = SDL_CreateRGBSurfaceFrom(BackBufferPointer, 1024, 768, 32, 4096, 0x0000FF00, 0x00FF0000, 0xFF000000, 0x000000FF); // set the back buffer's pixels to that of the back buffer's data, supposedly BGRA after the TGA format
if (SDLBack == NULL) // if an error otherwise occurred
{
// sprintf and MessageBox to indicate error
}
else
{
SDLScreen = SDL_SetVideoMode(1024, 768, 32, 0); // test so I don't have to use alt+tab every time to quit
// SDLScreen = SDL_SetVideoMode(1024, 768, 32, SDL_FULLSCREEN); // start PM in full screen (this, until release, should only be done in the debug menu)
}
// after all the AlphaBlend drawing is done
BitBlt(HDCScreen, 0, 0, ScreenWidth, ScreenHeight, HDCBack, 0, 0, SRCCOPY); // swaps the back and front buffers for displaying
SDL_UpdateRect(SDLBack, 0, 0, 1024, 768); // test case - seems to have no effect
SDL_BlitSurface(SDLBack, NULL, SDLScreen, NULL); // often causes read access violation
SDL_UpdateRect(SDLScreen, 0, 0, 1024, 768); // supposedly the real one I need
How do I get SDLBack to reference the pixel data in BackBuffer as is drawn with AlphaBlend? That's all I'm after.