#include <SDL/SDL.h>

#undef main

#include "project_screen.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_SWSURFACE | ((int)fs * SDL_FULLSCREEN));

    SDL_WM_SetCaption ("Test", 0);
//    SDL_ShowCursor(SDL_DISABLE);
}

void RenderScreen(unsigned int *src)
{
	unsigned int *dest = (unsigned int*)screen->pixels;

	for (int i=0; i<ScreenSize; i++)
	{
		*dest++ = *src++;
	}
}
