Ignore:
Timestamp:
Jun 22, 2013, 11:23:40 PM (8 years ago)
Author:
sam
Message:

gpu: framebuffers now use the g_render object to restore viewport data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gpu/rendercontext.cpp

    r2764 r2768  
    5555    Scene *m_scene;
    5656
     57    TrackedState<ibox2> m_viewport;
    5758    TrackedState<vec4> m_clear_color;
    58 
    5959    TrackedState<float> m_clear_depth;
    60 
    6160    TrackedState<AlphaFunc> m_alpha_func;
    6261    TrackedState<float> m_alpha_value;
    63 
    6462    TrackedState<BlendFunc> m_blend_src, m_blend_dst;
    65 
    6663    TrackedState<DepthFunc> m_depth_func;
    67 
    6864    TrackedState<CullMode> m_face_culling;
    6965};
     
    8177RenderContext::~RenderContext()
    8278{
     79    if (m_data->m_viewport.HasChanged())
     80        g_renderer->SetViewport(m_data->m_viewport.GetValue());
     81
    8382    if (m_data->m_clear_color.HasChanged())
    8483        g_renderer->SetClearColor(m_data->m_clear_color.GetValue());
     
    102101
    103102    delete m_data;
     103}
     104
     105void RenderContext::SetViewport(ibox2 viewport)
     106{
     107    if (!m_data->m_viewport.HasChanged())
     108        m_data->m_viewport.TrackValue(g_renderer->GetViewport());
     109
     110    g_renderer->SetViewport(viewport);
    104111}
    105112
Note: See TracChangeset for help on using the changeset viewer.