   critique my sdl image load/display functions
  Well, I am starting to learn SDL, and have written some functions that I plan to use for displaying and loading my images. I want you guys to have a look at them to see if there's anything that you think I could have done better.BTW, these are written in D, but should be pretty similar to a C or C++ version of the same code./*sdlhelpers.dCreating easier functions to use for SDL programsLoad images, etc */module sdlhelpers;//Importsprivate{import derelict.sdl.sdl;import derelict.sdl.image;import std.string;}/***********Functions***********///Loads image, alpha arg ask if the image has transparency, e.g. pngSDL_Surface* loadImage( char[] filename, bool alpha = false ){SDL_Surface* image = IMG_Load( toStringz( filename ) );SDL_Surface* formattedImage;if ( image !is null ){//make the new image the same display format as the screenif ( !alpha ){formattedImage = SDL_DisplayFormat( image );}else{formattedImage = SDL_DisplayFormatAlpha( image );}SDL_FreeSurface( image );}return formattedImage;}//Displays an image; supports clippingvoid displayImage( int x, int y, SDL_Surface* imageToBlit, SDL_Surface* destination, int clipx = 0, int clipy = 0, int w = 0, int h = 0 ){SDL_Rect xy;xy.x = x;xy.y = y;SDL_Rect clip;bool doClip;if ( !( clipx == 0 && clipy == 0 && w == 0 && h == 0 ) ){doClip = true;clip.x = clipx;clip.y = clipy;clip.w = w;clip.h = h;}if ( doClip ){SDL_BlitSurface( imageToBlit, &clip, destination, &xy );}else{SDL_BlitSurface( imageToBlit, null, destination, &xy );}}I'm not sure if that whole alpha thing in the loading functions works, or if it is even necessary. When I read one of lazyfoo's tutorials, it says using SDL_DisplayFormat on an image with transparency can give some unexpected results. So I put that alpha thing in there.And for the display function, I just tried to make the clipping optional by making everything 0 if the user just wants to display the image normally.   