Changeset 34

Show
Ignore:
Timestamp:
12/04/06 02:27:47 (2 years ago)
Author:
baxissimo
Message:

Updated to throw a GUIException instead of assert.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/luigi/adapters/sdl.d

    r33 r34  
    257257    } 
    258258 
     259    /** Return the size of the SDL window. 
     260     *  Params: an SDL_Surface* cast to a WindowHandle 
     261     */ 
    259262    Size get_window_size(WindowHandle win) { 
    260263        // only one window in SDL to query the size of 
    261264        SDL_Surface *surf = cast(SDL_Surface*)win; 
     265        if (surf is null) { 
     266            throw new GUIException( 
     267                "Null is not a valid WindowHandle for SDLAdapter.  \n" 
     268                "Overlay needs the window's SDL_Surface pointer: \n" 
     269                "  e.g. gui = new Overlay( cast(WindowHandle)main_surface );"); 
     270        } 
    262271        return Size(surf.w,surf.h); 
    263272    }