
#include <SDL.h>

#include "i_main.h"
#include "m_main.h"


extern int borderflag;
extern int with_borders;


void    i_init(void)
{

}


void    i_shutdown(void)
{

}

char    i_getkey(void)
{
	SDL_Event event;

	if (SDL_PollEvent(&event)) {

		switch (event.type) {

		 case SDL_QUIT:
			return i_esc;
			break;

		 case SDL_KEYUP:
			switch (event.key.keysym.sym) {
			 case SDLK_ESCAPE:
				return i_esc;
			 case SDLK_SPACE:
				return i_space;
			 case SDLK_UP:
				with_borders = 1;
				borderflag = 0;
				break;
			 case SDLK_DOWN:
				with_borders = 0;
				break;
			}
			break;
		}
	}

	return 0;
}

