[SDL] Still get SDL window with SetVideoMode(0, 0, 0, SDL_SWSURFACE)

manmach nabble at humanemachines.nl
Mon Oct 1 06:03:54 PDT 2007



Sylvain Beucler wrote:
> 
> 
> By the way:
> 
>> I could then create surfaces and overlays and have blit them to my
>> wxWidgets controls.
> 
> How did you blit the surface to wxWidgets? :)
> 

By creating a bitmap from the SDL_Surface and painting that using a buffered
paint DC. See code below.
mCanvas is a 24-bit RGB surface created with SDL_CreateRGBSurface. This
needs to be in OnPaint.

        // create a bitmap from our pixel data
        wxBitmap bmp(wxImage(mCanvas->w, mCanvas->h,
                             static_cast<unsigned char *>(mCanvas->pixels),
true));

        // paint it
        wxBufferedPaintDC dc(Panel, bmp);
-- 
View this message in context: http://www.nabble.com/Still-get-SDL-window-with-SetVideoMode%280%2C0%2C0%2CSDL_SWSURFACE%29-tf4522887.html#a12978744
Sent from the SDL mailing list archive at Nabble.com.



More information about the SDL mailing list