Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/core/orxonox.cc @ 1853

Last change on this file since 1853 was 1853, checked in by patrick, 20 years ago

orxonox/trunk: added working configure, Makefile and extended core-system

File size: 2.2 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   This program is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   GNU General Public License for more details.
15
16   You should have received a copy of the GNU General Public License
17   along with this program; if not, write to the Free Software Foundation,
18   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
19
20*/
21
22
23
24
25
26
27/* class definition header */
28#include "orxonox.h"
29#include "data_tank.h"
30
31/* standard headers */
32#include <iostream>
33#include <cstdio>
34
35/* openGL Headers */
36#include <GL/glut.h>
37
38using namespace std;
39
40
41
42Orxonox::Orxonox () {}
43
44
45
46Orxonox::~Orxonox () {}
47
48
49/* this is a singleton class to prevent dublicates */
50Orxonox* Orxonox::singleton_ref = 0;
51Orxonox* Orxonox::getInstance (void)
52{
53  if (singleton_ref == NULL)
54    singleton_ref = new Orxonox();
55  return singleton_ref;
56}
57
58
59
60int Orxonox::globalInit (int argc, char** argv) 
61{
62  glutInit(&argc, argv);
63  glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
64  glutInitWindowSize(500, 500);
65  glutInitWindowPosition(100, 100);
66  glutCreateWindow("orxOnox");
67  /* window event dispatchers */
68  glutDisplayFunc(display);
69  glutReshapeFunc(reshape);
70}
71
72
73
74int Orxonox::menuInit (void)
75{
76  glClearColor(0.0, 0.0, 0.0, 0.0);
77}
78
79
80
81int Orxonox::gameInit (void) 
82{
83
84}
85
86
87
88void Orxonox::display (void) 
89{
90  glClear(GL_COLOR_BUFFER_BIT);
91  glutSwapBuffers();
92} 
93
94
95
96void Orxonox::reshape (int w, int h)
97{
98  glViewport(0, 0, (GLsizei) w, (GLsizei) h);
99  glMatrixMode(GL_PROJECTION);
100  glLoadIdentity();
101  glOrtho(-50.0, 50.0, -50.0, 50.0, -1.0, 1.0);
102  glMatrixMode(GL_MODELVIEW);
103  glLoadIdentity(); //pb why a second time?
104}
105
106
107
108int main (int argc, char** argv) 
109{ 
110  Orxonox *orx = Orxonox::getInstance();
111  (*orx).globalInit(argc, argv);
112  (*orx).menuInit();
113  glutMainLoop();
114  return 0;
115}
Note: See TracBrowser for help on using the repository browser.