OpenGL完整源码


OpenGL完整源码,这是第五版配套的,也包括exe可执行文件,亲测可用
资源截图
代码片段和文件信息
/* CallbackMaker.c */
/*
 * Program to invoke all the callbacks that “freeglut“ supports
 */


#include 
#include 
#include 
#include 

static int sequence_number = 0 ;

int reshape_called = 0 key_called = 0 special_called = 0 visibility_called = 0
    keyup_called = 0 specialup_called = 0 joystick_called = 0 mouse_called = 0
    mousewheel_called = 0 motion_called = 0 passivemotion_called = 0 entry_called = 0
    close_called = 0 overlaydisplay_called = 0 windowstatus_called = 0
    spacemotion_called = 0 spacerotation_called = 0 spacebutton_called = 0
    buttonbox_called = 0 dials_called = 0 tabletmotion_called = 0 tabletbutton_called = 0
    menudestroy_called = 0 menustatus_called = 0 ;
int reshape_width = -1 reshape_height = -1 reshape_seq = -1 ;
int key_key = -1 key_x = -1 key_y = -1 key_seq = -1 ;
int special_key = -1 special_x = -1 special_y = -1 special_seq = -1 ;
int visibility_vis = -1 visibility_seq = -1 ;
int keyup_key = -1 keyup_x = -1 keyup_y = -1 keyup_seq = -1 ;
int specialup_key = -1 specialup_x = -1 specialup_y = -1 specialup_seq = -1 ;
int joystick_a = -1 joystick_b = -1 joystick_c = -1 joystick_d = -1 joystick_seq = -1 ;  /* Need meaningful names */
int mouse_button = -1 mouse_updown = -1 mouse_x = -1 mouse_y = -1 mouse_seq = -1 ;
int mousewheel_number = -1 mousewheel_direction = -1 mousewheel_x = -1 mousewheel_y = -1 mousewheel_seq = -1 ;
int motion_x = -1 motion_y = -1 motion_seq = -1 ;
int passivemotion_x = -1 passivemotion_y = -1 passivemotion_seq = -1 ;

static void
bitmapPrintf (const char *fmt ...)
{
    static char buf[256];
    va_list args;

    va_start(args fmt);
#if defined(WIN32) && !defined(__CYGWIN__)
    (void) _vsnprintf (buf sizeof(buf) fmt args);
#else
    (void) vsnprintf (buf sizeof(buf) fmt args);
#endif
    va_end(args);
    glutBitmapString ( GLUT_BITMAP_HELVETICA_12 (unsigned char*)buf ) ;
}


static void 
Display(void)
{
  int window = glutGetWindow () ;
  glClear ( GL_COLOR_BUFFER_BIT );

  glDisable ( GL_DEPTH_TEST );
  glMatrixMode ( GL_PROJECTION );
  glPushMatrix();
  glLoadIdentity();
  glOrtho(0 glutGet ( GLUT_WINDOW_WIDTH ) 
          0 glutGet ( GLUT_WINDOW_HEIGHT ) -1 1 );
  glMatrixMode ( GL_MODELVIEW );
  glPushMatrix ();
  glLoadIdentity ();
  glColor3ub ( 0 0 0 );
  glRasterPos2i ( 10 glutGet ( GLUT_WINDOW_HEIGHT ) - 10 );

  if ( reshape_called )
  {
    bitmapPrintf ( “Reshape %d:  %d %d
“ reshape_seq reshape_width reshape_height );
  }

  if ( key_called )
  {
    bitmapPrintf ( “Key %d:  %d(%c) %d %d
“ key_seq key_key key_key key_x key_y );
  }

  if ( special_called )
  {
    bitmapPrintf ( “Special %d:  %d(%c) %d %d
“ special_seq special_key special_key special_x special_y );
  }

  if ( visibility_called )
  {
    bitmapPrintf ( “Visibility %d:  %d
“ visibility_seq visibility_vis );
  }

  if ( keyup_called )
  {
    bitmapPrintf ( “Key Up %d:  %

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

     文件     271537  2010-04-04 21:54  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0aclocal.m4

     文件        820  2010-04-04 21:54  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0AUTHORS

     文件         57  2010-04-04 21:54  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0autogen.sh

     文件     770027  2010-04-04 21:54  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0autom4te.cacheoutput.0

     文件     769457  2010-04-04 21:54  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0autom4te.cacheoutput.1

     文件      10333  2010-04-04 21:54  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0autom4te.cache
equests

     文件     440236  2010-04-04 21:54  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0autom4te.cache races.0

     文件      42479  2010-04-04 21:54  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0autom4te.cache races.1

     文件     162918  2010-04-04 21:54  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0ChangeLog

     文件       3707  2010-04-04 21:54  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0compile

     文件      44892  2010-04-04 21:54  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0config.guess

     文件       3122  2010-04-04 21:54  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0config.h.in

     文件      33387  2010-04-04 21:54  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0config.sub

     文件     768504  2010-04-04 21:54  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0configure

     文件       3045  2010-04-04 21:54  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0configure.ac

     文件       1439  2010-04-04 21:54  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0COPYING

     文件      17867  2010-04-04 21:54  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0depcomp

     文件       1481  2010-04-04 21:53  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0docdownload.html

     文件       8846  2010-04-04 21:53  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0docfreeglut.html

     文件      15887  2010-04-04 21:53  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0docfreeglut_logo.png

     文件     105711  2010-04-04 21:53  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0docfreeglut_user_interface.html

     文件       3349  2010-04-04 21:53  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0docindex.html

     文件        149  2010-04-04 21:53  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0docMakefile.am

     文件       9065  2010-04-04 21:53  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0docMakefile.in

     文件       1586  2010-04-04 21:53  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0docogl_sm.png

     文件       6115  2010-04-04 21:53  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0docprogress.html

     文件       3964  2010-04-04 21:53  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0docstructure.html

     文件       5420  2010-04-04 21:54  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0freeglut.dep

     文件       6122  2010-04-04 21:54  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0freeglut.dsp

     文件        703  2010-04-04 21:54  OpenGL超级宝典完整源码(第五版)freeglut-2.6.0freeglut.dsw

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

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

发表评论

评论列表(条)