Show
Ignore:
Timestamp:
08/16/10 21:15:24 (21 months ago)
Author:
Carsten
Message:

Re-established most of the client functionality:

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • cafu/branches/cafu_to_wx/Libs/GuiSys/GuiManImpl.cpp

    r36 r119  
    174174    } 
    175175 
    176     // Render the GUIs in back-to-front order. 
     176    // We assume that the caller doesn't expect us to preserve (push/pop) the matrices... 
     177    const float zNear=0.0f; 
     178    const float zFar =1.0f; 
     179    MatSys::Renderer->SetMatrix(MatSys::RendererI::PROJECTION,     MatrixT::GetProjOrthoMatrix(0.0f, VIRTUAL_SCREEN_SIZE_X, VIRTUAL_SCREEN_SIZE_Y, 0.0f, zNear, zFar)); 
     180    MatSys::Renderer->SetMatrix(MatSys::RendererI::MODEL_TO_WORLD, MatrixT()); 
     181    MatSys::Renderer->SetMatrix(MatSys::RendererI::WORLD_TO_VIEW,  MatrixT()); 
     182 
     183    // Render the active GUIs in back-to-front order. 
    177184    for (unsigned long GuiNr=StartGuiNr; GuiNr<Guis.Size(); GuiNr++) 
    178185    { 
    179         // TODO: 
    180         // 1) Remove the next (no-comment-) line. 
    181         // 2) Move the matrix push, set and pop code out of this loop! 
    182         // 3) Fix the clients ClientWindowT::Render() method by fixing the matrix setup code inside it 
    183         //    (it probably belongs into the world rendering method anyway)!! 
    184         if (!Guis[GuiNr]->GetIsActive()) continue; 
    185  
    186         // Setup the matrices. 
    187         MatSys::Renderer->PushMatrix(MatSys::RendererI::PROJECTION    ); 
    188         MatSys::Renderer->PushMatrix(MatSys::RendererI::MODEL_TO_WORLD); 
    189         MatSys::Renderer->PushMatrix(MatSys::RendererI::WORLD_TO_VIEW ); 
    190  
    191         const float zNear=0.0f; 
    192         const float zFar =1.0f; 
    193         MatSys::Renderer->SetMatrix(MatSys::RendererI::PROJECTION,     MatrixT::GetProjOrthoMatrix(0.0f, VIRTUAL_SCREEN_SIZE_X, VIRTUAL_SCREEN_SIZE_Y, 0.0f, zNear, zFar)); 
    194         MatSys::Renderer->SetMatrix(MatSys::RendererI::MODEL_TO_WORLD, MatrixT()); 
    195         MatSys::Renderer->SetMatrix(MatSys::RendererI::WORLD_TO_VIEW,  MatrixT()); 
    196  
    197         if (Guis[GuiNr]->GetIsActive()) Guis[GuiNr]->Render(); 
    198  
    199         // Restore the previously active matrices. 
    200         MatSys::Renderer->PopMatrix(MatSys::RendererI::PROJECTION    ); 
    201         MatSys::Renderer->PopMatrix(MatSys::RendererI::MODEL_TO_WORLD); 
    202         MatSys::Renderer->PopMatrix(MatSys::RendererI::WORLD_TO_VIEW ); 
     186        if (Guis[GuiNr]->GetIsActive()) 
     187            Guis[GuiNr]->Render(); 
    203188    } 
    204189}