#include <SDL/SDL.h>
#include <SDL/SDL_OpenGL.h>

#include "demo_screen.h"
#include "demo_init_gl.h"

SDL_Surface *screen;

int ScreenWidth;
int ScreenHeight;
int ScreenSize;

// ================
// ==== Screen ====
// ================

void InitScreen(bool fs)
{
	ScreenSize = ScreenWidth * ScreenHeight;

    SDL_Init(SDL_INIT_VIDEO);
    screen = SDL_SetVideoMode(ScreenWidth, ScreenHeight, 32, SDL_OPENGL | ((int)fs * SDL_FULLSCREEN));

    SDL_WM_SetCaption ("Quantum Retrofuture by Optimus", 0);
    //SDL_ShowCursor(SDL_DISABLE);
}

int GetSizeOfSquareWindow()
{
	int min = ScreenHeight;
	if (ScreenWidth < min) min = ScreenWidth;

	if (min<256)
		return 128;
	if (min<512)
		return 256;
	if (min<1024)
		return 512;
	else
		return 1024;
}
