dungeon_crawler

diff prototype/src/main.cc @ 17:d98240a13793

lalala
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 20 Aug 2012 06:11:58 +0300
parents 91180ee7b7d9
children 5c41e6fcb300
line diff
     1.1 --- a/prototype/src/main.cc	Mon Aug 20 03:40:51 2012 +0300
     1.2 +++ b/prototype/src/main.cc	Mon Aug 20 06:11:58 2012 +0300
     1.3 @@ -9,7 +9,7 @@
     1.4  #include "tileset.h"
     1.5  #include "renderer.h"
     1.6  
     1.7 -bool init();
     1.8 +bool init(int xsz, int ysz);
     1.9  void cleanup();
    1.10  void idle();
    1.11  void disp();
    1.12 @@ -31,6 +31,8 @@
    1.13  
    1.14  int main(int argc, char **argv)
    1.15  {
    1.16 +	int xsz, ysz;
    1.17 +
    1.18  	glutInit(&argc, argv);
    1.19  
    1.20  	if(argc > 1) {
    1.21 @@ -40,6 +42,8 @@
    1.22  	glutInitWindowSize(800, 600);
    1.23  	glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE | GLUT_MULTISAMPLE);
    1.24  	glutCreateWindow("prototype");
    1.25 +	xsz = glutGet(GLUT_WINDOW_WIDTH);
    1.26 +	ysz = glutGet(GLUT_WINDOW_HEIGHT);
    1.27  
    1.28  	glutIdleFunc(idle);
    1.29  	glutDisplayFunc(disp);
    1.30 @@ -51,14 +55,14 @@
    1.31  
    1.32  	glewInit();
    1.33  
    1.34 -	if(!init()) {
    1.35 +	if(!init(xsz, ysz)) {
    1.36  		return 1;
    1.37  	}
    1.38  
    1.39  	glutMainLoop();
    1.40  }
    1.41  
    1.42 -bool init()
    1.43 +bool init(int xsz, int ysz)
    1.44  {
    1.45  	glEnable(GL_LIGHTING);
    1.46  	glEnable(GL_LIGHT0);
    1.47 @@ -73,7 +77,7 @@
    1.48  	add_data_path("data");
    1.49  	add_data_path("sdr");
    1.50  
    1.51 -	if(!init_renderer()) {
    1.52 +	if(!init_renderer(xsz, ysz)) {
    1.53  		return false;
    1.54  	}
    1.55