OpenGL游戏程序设计+源码


OpenGL游戏程序设计 文档 源码 作者:(美国)K.霍金 (美国)D.阿斯特 编者:田昱川
资源截图
代码片段和文件信息
/****************************************************************************
 chapter1.cpp
 
 A simple OpenGL/GLUT demonstration showing a texture mapped lit spinning
 cube reflecting in a surface.
  
 This demo should give you a general idea of what GLUT is.  For more
 information visit the official GLUT page at:
 
       http://reality.sgi.com/opengl/glut3/glut3.html
 
 Author   :   Dave Astle
 Date     :   8/23/2000

 Written for OpenGL Game Programming
*****************************************************************************/

/********************************* Includes *********************************/
#include 
#include 
#include 
#include “HiResTimer.h“


/*************************** Macros and constants ***************************/
enum rendermode_t {
  RENDER_REFLECTED
  RENDER_SHADOW
  RENDER_NORMAL
};

const GLfloat DEGREES_PER_SECOND = 60.0f;


/******************************** Prototypes ********************************/
void Initialize();
void MouseHandler(int button int state int x int y);
void KeyboardHandler(unsigned char key int x int y);
void MainMenuHandler(int option);
void Animate();
void Reshape(int width int height);
void Display();

void LoadTexture(char *filename GLuint &texture);
void DrawScene(rendermode_t mode);
void DrawCube();
void DrawSurface();


/********************************* Globals **********************************/
// index for the texture we‘ll load for the cube
GLuint g_cubeTexture;

// how much to rotate the cube around an axis
GLfloat g_rotationAngle = 0.0;

CHiResTimer g_timer;


/****************************************************************************
 main()

 Setup GLUT and OpenGL drop into the event loop
*****************************************************************************/
int main(int argc char **argv)
{
  // Setup the basic GLUT stuff
  glutInit (&argc argv);
  glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_STENCIL);

  // Create the window
  glutInitWindowSize(512 512);
  glutInitWindowPosition(400 350);
  glutCreateWindow(“Chapter 1“);

  Initialize();

  // Register the event callback functions
  glutDisplayFunc(Display); 
  glutReshapeFunc(Reshape);
  glutMouseFunc(MouseHandler);
  glutKeyboardFunc(KeyboardHandler);
  glutIdleFunc(Animate);

  // At this point control is relinquished to the GLUT event handler.
  // Control is returned as events occur via the callback functions.
  glutMainLoop();   
   
  return 0;
} // end main()


/****************************************************************************
 Initialize()

 One time setup including creating menus creating a light setting the
 shading mode and clear color and loading textures.
*****************************************************************************/
void Initialize()
{
  // set up the only meny
  int mainMenu;

  mainMenu = gl

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      15006  2001-04-08 22:03  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter01chapter1chapter1.cpp

     文件       4430  2001-02-02 00:37  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter01chapter1Chapter1.dsp

     文件        539  2000-10-12 10:45  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter01chapter1Chapter1.dsw

     文件      69632  2001-04-08 22:03  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter01chapter1Chapter1.exe

     文件       4279  2001-02-02 00:19  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter01chapter1HiResTimer.h

     文件     196662  2000-08-22 00:17  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter01chapter1opengl.bmp

     文件       3960  2000-08-20 01:30  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter02compwinappcompwinapp.dsp

     文件        543  2000-08-20 01:10  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter02compwinappcompwinapp.dsw

     文件      33792  2001-04-09 17:11  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter02compwinappcompwinapp.ncb

     文件      48640  2001-04-09 17:11  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter02compwinappcompwinapp.opt

     文件       3069  2001-04-09 17:07  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter02compwinappmain.cpp

     文件        242  2000-08-19 12:34  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter02winhellomain.cpp

     文件       3938  2000-08-19 03:06  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter02winhellowinhello.dsp

     文件        539  2000-08-19 02:23  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter02winhellowinhello.dsw

     文件      27765  2001-04-08 21:32  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter04sourcechapter4.cpp

     文件       4044  2000-10-24 11:18  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter04sourcechapter4.dsp

     文件        539  2000-10-23 11:21  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter04sourcechapter4.dsw

     文件      49152  2001-04-08 22:02  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter04sourcechapter4.exe

     文件      18216  2001-04-09 14:30  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter05projectionsprojections.cpp

     文件       4080  2001-04-09 14:31  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter05projectionsprojections.dsp

     文件        545  2001-04-09 14:14  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter05projectionsprojections.dsw

     文件      45056  2001-04-09 14:30  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter05projectionsprojections.exe

     文件      13913  2001-03-08 02:37  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter05
obot
obot.cpp

     文件       4018  2001-04-10 01:49  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter05
obot
obot.dsp

     文件        533  2001-01-17 12:46  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter05
obot
obot.dsw

     文件      32768  2001-04-10 01:49  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter05
obot
obot.exe

     文件       4050  2001-04-10 01:51  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter06lendex1lendex1.dsp

     文件        539  2000-12-11 02:52  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter06lendex1lendex1.dsw

     文件      32768  2001-04-10 01:51  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter06lendex1lendex1.exe

     文件       9924  2001-03-08 01:13  OpenGL游戏程序设计+源码OpenGL游戏程序设计(源码)chapter06lendex1main.cpp

............此处省略386个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)