天地之灵学习小组
我们学习小组的OpenGL学习笔记 大家一定要互相折磨呀~~
posts - 150,  comments - 156,  trackbacks - 0
很感谢许多学长的帮助。其实最近有些消极的。我想现在开始要重新做好自己。我要有饭吃。
以后每天的日志都贴代码,以代码为主,以此督促自己每天保持代码量。
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( 5050 );
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;
今天先贴这么多,其实没什么内容,呵呵,还请各位牛们批评指正,小牛奶妹感激不尽

FeedBack:
# re: 11月21日_重新站起来_By PureMilk[未登录]
2008-11-21 21:10 | missdeer
别为了赶代码量而失去了思考的时间。  回复  更多评论
  
# re: 11月21日_重新站起来_By PureMilk[未登录]
2008-11-21 21:12 | missdeer
那些啥 welcome_page 、game_page应该都是singleton吧  回复  更多评论
  
# re: 11月21日_重新站起来_By PureMilk
2008-11-22 10:13 | 正牌的天地之灵和他的徒儿们肖赫_王婷婷_王冠_郑燚_孙婷
@missdeer
不知道什么是singleton,现在这水平也就能写出这模样的东西了……  回复  更多评论
  
# re: 11月21日_重新站起来_By PureMilk[未登录]
2008-11-22 17:38 | missdeer
所以说别为了代码量而赶代码,看看《设计模式:可复用面向对象软件的基础》,与市面上绝大多数讲设计模式的书的一大区别是,它用C++来描述。  回复  更多评论
  
# re: 11月21日_重新站起来_By PureMilk
2008-11-22 17:56 | 正牌的天地之灵和他的徒儿们肖赫_王婷婷_王冠_郑燚_孙婷
@missdeer
好的,不过要先把这个写完再看,谢谢你啦~  回复  更多评论
  

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理



<2008年11月>
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

常用链接

留言簿(6)

随笔分类(149)

随笔档案(150)

同道中人

搜索

  •  

积分与排名

  • 积分 - 43689
  • 排名 - 487

最新随笔

最新评论

阅读排行榜

评论排行榜