很感谢许多学长的帮助。其实最近有些消极的。我想现在开始要重新做好自己。我要有饭吃。
以后每天的日志都贴代码,以代码为主,以此督促自己每天保持代码量。
main.cpp
1 #include <GL/glut.h>
2
3 #include "global.h"
4
5 int main( int argc, char* argv[] )
6 {
7 Init();
8
9 glutInit( &argc, argv );
10 glutInitDisplayMode( GLUT_RGBA| GLUT_DOUBLE );
11 glutInitWindowPosition( 50, 50 );
12 glutInitWindowSize( WindowWidth, WindowHeight );
13 glutCreateWindow( "送给亲爱的甜甜");
14 glutDisplayFunc( Display );
15 glutKeyboardFunc( Keyboard );
16 glutSpecialFunc( Key );
17 glutTimerFunc( 10, Timer, 0 );
18 gluOrtho2D( 0, WindowWidth, WindowHeight, 0 );
19 glutMainLoop();
20
21 return 0;
22 }
23
global.h
1 #ifndef _GLOBAL_H_
2 #define _GLOBAL_H_
3
4 #include "Init.h"
5 #include "Display.h"
6 #include "Key.h"
7 #include "Keyboard.h"
8 #include "Timer.h"
9 #include "definition.h"
10 #include "WelcomePage.h"
11 #include "SelectPage.h"
12 #include "GamePage.h"
13 #include "ReadBMP24.h"
14 #include <cstdlib>
15
16 static const int WindowWidth = 640;
17 static const int WindowHeight = 480;
18
19 extern CWelcomePage* welcome_page;
20 extern CSelectPage* select_page;
21 extern CGamePage* game_page;
22
23 extern Page page;
24 extern bool two_players;
25
26 #endif
27
global.cpp
1 #include "WelcomePage.h"
2 #include "SelectPage.h"
3 #include "GamePage.h"
4 #include "definition.h"
5
6 #include <cstdlib>
7
8 CWelcomePage* welcome_page = NULL;
9 CSelectPage* select_page = NULL;
10 CGamePage* game_page = NULL;
11
12 Page page = WelcomePage;
13 bool two_players = false;
今天先贴这么多,其实没什么内容,呵呵,还请各位牛们批评指正,小牛奶妹感激不尽