Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /examples/vr-demo/main.c
ViewVC logotype

Diff of /examples/vr-demo/main.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2067, Fri Nov 2 13:41:18 2012 UTC revision 2068, Fri Nov 2 13:44:53 2012 UTC
# Line 79  Line 79 
79  // Callback function called by GLFW when window size changes  // Callback function called by GLFW when window size changes
80  void GLFWCALL WindowSizeCB (int width, int height)  void GLFWCALL WindowSizeCB (int width, int height)
81  {  {
 printf("window size = %d x %d\n", width, height);  
82    // Set OpenGL viewport and camera    // Set OpenGL viewport and camera
83      glViewport(0, 0, width, height);      glViewport(0, 0, width, height);
84    
     glMatrixMode (GL_PROJECTION);  
     glLoadIdentity ();  
     double pad = 0.05*(WRLD_MAX_X - WRLD_MIN_X);  // add 10% to world dimensions  
     gluOrtho2D (  
         WRLD_MIN_X - pad, WRLD_MAX_X + pad,  
         WRLD_MAX_Y + pad, WRLD_MIN_Y - pad);  
   
     glMatrixMode (GL_MODELVIEW);  
     glLoadIdentity ();  
     gluLookAt (  
         0.0, 0.0, 1.0,  
         0.0, 0.0, 0.0,  
         0.0, 1.0, 0.0);  
   
85    // remember width and height    // remember width and height
86      Width = width;      Width = width;
87      Height = height;      Height = height;

Legend:
Removed from v.2067  
changed lines
  Added in v.2068

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0