void Window::init() { if( !SDL_init(w,h) ) { err = 1; return; } if( !GL_init() ) { err = 2; return; } }
int main() { SDL_Window *window = NULL; SDL_init(SDL_INIT_EVERYTHING); window = SDL_CreateWindow("SDL Test", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, NULL); SDL_Delay(5000); SDL_DestroyWindow(window); SDL_Quit(); return 0; }
int main(int argc, char* args[]) { if (!SDL_init()) return 1; // Get the output lubed up #pragma warning(suppress: 6031) freopen("CON", "wt", stdout); #pragma warning(suppress: 6031) freopen("CON", "wt", stderr); //Game Running g_game = new Game(); g_game->run(); SDL_deinit(); return 0; }