Re: how to check for an event
Brian Puthuff <[email protected]> Mon, 13 Feb 2017 08:24:37 -0800
| Newsgroups | gmane.comp.lib.sdl |
|---|---|
| Message-ID | <CAPh_eMGy7Rs0c=g=_ytZzCcgw-RciAULHozFdVUTSt--1oxvyw@mail.gmail.com> |
https://wiki.libsdl.org/SDL_CreateWindow SDL_CreateWindow will return NULL if failed. Not sure if that's what you are asking. On Feb 13, 2017 8:15 AM, "speartip" <[email protected]> wrote: > 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 > #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 > > _______________________________________________ SDL mailing list [email protected] http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org