OpenMiner/source/main.cpp
2013-04-29 23:57:40 +02:00

62 lines
1.5 KiB
C++
Executable File

/*---------------------------------------------------------------------------------
KubKraft
Copyright (C) 2012 Quent42340 <quent42340@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
---------------------------------------------------------------------------------*/
#include <iostream>
#include <string>
#include <unordered_map>
#include <map>
#include <vector>
#include <cmath>
#include <SDL/SDL.h>
#include <GL/glew.h>
#include "types.h"
#include "init.h"
#include "cube.h"
#include "chunk.h"
#include "player.h"
#include "map.h"
#include "game.h"
using namespace std;
int main(int argc, char *argv[]) {
// Init SDL and OpenGL
initSDL();
initOpenGL();
GLenum err = glewInit();
if(err != GLEW_OK) {
cerr << "Error: " << glewGetErrorString(err) << endl;
return 1;
}
// Game execution
Game *game = new Game();
game->exec();
delete game;
// Stop SDL
SDL_Quit();
return 0;
}