added sdl module

git-svn-id: svn://anubis/anaglym/trunk@14 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
Josh Holtrop 2009-09-16 03:00:56 +00:00
parent 7424521468
commit 99d01b9f26
3 changed files with 22 additions and 0 deletions

View File

@ -1,5 +1,6 @@
#include "ag.h" #include "ag.h"
#include "sdl.h"
#include <lua.hpp> #include <lua.hpp>
#include <stdlib.h> /* exit() */ #include <stdlib.h> /* exit() */
#include <iostream> #include <iostream>
@ -38,6 +39,8 @@ int main(int argc, char * argv[])
usage(); usage();
} }
video_init();
lua_State * L = lua_open(); lua_State * L = lua_open();
register_libraries(L); register_libraries(L);

12
sdl.cc Normal file
View File

@ -0,0 +1,12 @@
#include "sdl.h"
#include <SDL/SDL.h>
void video_init()
{
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER))
{
cerr << "SDL_Init() returned error!" << endl;
exit(3);
}
}

7
sdl.h Normal file
View File

@ -0,0 +1,7 @@
#ifndef SDL_H
#define SDL_H
void video_init();
#endif