[SDL] SDL_SURFACE from window handle (win32)

Edward Cullen eac203 at ecs.soton.ac.uk
Fri Jun 27 03:14:00 PDT 2008


Actually, I think this would be better (Win32 example):

   typedef SDL_NativeWindow HWND;
   void SDL_SetParentWindow(SDL_Surface*, SDL_NativeWindow);

   HWND main_window = CreateWindow(...);

   disp_surf = SDL_DisplaySurface(...);
   SDL_SetParentWindow(disp_surf, main_window);

Eddy

Edward Cullen wrote:
> I've been looking at this problem too.
> 
> I can't help you directly with your question, but I would like to say 
> that I think it would be better to have an API that returns a window 
> handle for the surface so one could do this (Win32):
> 
>   HWND main_window = CreateWindow(...);
>   SDL_Surface* disp_surf = SDL_DisplaySurface(...);
>   SetParent(SDL_GetNativeHandle(disp_surf), main_window);
> 
> Eddy
> 
> Paulo Vicentini wrote:
>> Instead of using SDL_SetVideoMode in order to create a screen 
>> (SDL_Surface), is it possible to generate a SDL_Surface from a Window 
>> handle (Win32) ?
>> =>CreateWindow Top-Level  Window => hWnd => create a SDL_SURFACE from 
>> hWnd, and use it...
>>
>> thank you
>> Paulo
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> SDL mailing list
>> SDL at lists.libsdl.org
>> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
> 
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org




More information about the SDL mailing list