how to check for an event

"speartip" <[email protected]> Mon, 13 Feb 2017 16:15:07 +0000
Newsgroups gmane.comp.lib.sdl
Message-ID <[email protected]>
Hi, wanted to know how to code for an error state in the following code. I am new to SDL. I simply want a true to some value if a window was successfully created. I've made this window generation a subroutine:


Code:

#include <SDL.h>
#include "make_Window.h"

void make_Window(int horizontal, int vertical)   //SDL_Window *window)
{

	SDL_Init(SDL_INIT_EVERYTHING);

// Create a Window in the middle of the screen
		SDL_Window *window = 0;
        window = SDL_CreateWindow("Hello World!",
                                  SDL_WINDOWPOS_CENTERED,
                                  SDL_WINDOWPOS_CENTERED,
                                  horizontal, vertical,
                                  SDL_WINDOW_SHOWN);
        // Delay so that we can see the window appear
        SDL_Delay(2000);

}

_______________________________________________
SDL mailing list
[email protected]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org