#include "video.h" #include #include using namespace std; static int default_width = 0; static int default_height = 0; void video_init() { if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER)) { cerr << "SDL_Init() returned error!" << endl; exit(3); } const SDL_VideoInfo * vidInfo = SDL_GetVideoInfo(); if (vidInfo != NULL) { default_width = vidInfo->current_w; default_height = vidInfo->current_h; } else { cerr << "Warning: SDL_GetVideoInfo() returned NULL!" << endl; default_width = 1024; default_height = 768; } } int getDefaultWidth() { return default_width; } int getDefaultHeight() { return default_height; }