2014-05-06 21:20:16 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2011-2014 hasufell
|
|
|
|
*
|
|
|
|
* This file is part of a hasufell project.
|
|
|
|
*
|
|
|
|
* 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 version 2 of the License only.
|
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2014-05-10 17:39:20 +00:00
|
|
|
/**
|
|
|
|
* @file main.c
|
|
|
|
* Takes argv[1] as parameter and passes
|
|
|
|
* it to the glut functions for drawing the file
|
|
|
|
* in a predefined scene.
|
|
|
|
* @brief program entry point
|
|
|
|
*/
|
|
|
|
|
2014-06-06 20:16:33 +00:00
|
|
|
#include "gl_setup.h"
|
2014-05-10 17:16:13 +00:00
|
|
|
#include "half_edge.h"
|
2014-05-08 15:39:23 +00:00
|
|
|
#include "print.h"
|
2014-05-10 17:16:13 +00:00
|
|
|
#include "vector.h"
|
2014-05-06 21:09:59 +00:00
|
|
|
|
2014-05-08 20:45:16 +00:00
|
|
|
#include <GL/glut.h>
|
|
|
|
#include <GL/gl.h>
|
|
|
|
#include <GL/glu.h>
|
2014-05-07 19:08:47 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2014-06-06 20:16:33 +00:00
|
|
|
#include <SDL.h>
|
2014-05-08 20:45:16 +00:00
|
|
|
|
|
|
|
|
2014-05-07 19:08:47 +00:00
|
|
|
/**
|
|
|
|
* Program help text.
|
|
|
|
*/
|
|
|
|
char const * const helptext = "Usage: drow-engine <file.obj>\n";
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
2014-05-06 21:09:59 +00:00
|
|
|
{
|
2014-05-09 12:27:58 +00:00
|
|
|
if (argc == 1) {
|
2014-05-07 19:08:47 +00:00
|
|
|
printf("%s", helptext);
|
2014-05-09 12:27:58 +00:00
|
|
|
return 1;
|
2014-05-08 15:39:23 +00:00
|
|
|
}
|
2014-05-07 19:08:47 +00:00
|
|
|
|
2014-05-08 20:45:16 +00:00
|
|
|
glutInit(&argc, argv);
|
|
|
|
|
2014-06-06 20:16:33 +00:00
|
|
|
init_object(argv[1]);
|
|
|
|
init_sdl_loop();
|
2014-05-08 20:45:16 +00:00
|
|
|
|
2014-05-07 19:08:47 +00:00
|
|
|
return 0;
|
2014-05-06 21:09:59 +00:00
|
|
|
}
|