Ignore:
Timestamp:
Aug 17, 2010, 2:05:05 PM (10 years ago)
Author:
sam
Message:

Better near/far values.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/video.cpp

    r105 r135  
    2929    /* Initialise OpenGL */
    3030    glViewport(0, 0, width, height);
    31     glMatrixMode(GL_PROJECTION);
    32     glLoadIdentity();
    33     glOrtho(0, width, height, 0, -1, 10);
    34     glMatrixMode(GL_MODELVIEW);
    35     glLoadIdentity();
    3631
    3732    glEnable(GL_TEXTURE_2D);
     
    4540    glEnable(GL_BLEND);
    4641    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     42
     43    /* Projection matrix: once and for all */
     44    glMatrixMode(GL_PROJECTION);
     45    glLoadIdentity();
     46    glOrtho(0, width, height, 0, -(width + height), width + height);
    4747}
    4848
     
    5050{
    5151    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
     52
     53    /* Model view matrix: for each frame, just in case */
     54    glMatrixMode(GL_MODELVIEW);
    5255    glLoadIdentity();
    5356}
    54 
Note: See TracChangeset for help on using the changeset viewer.