X-Git-Url: http://git.tdb.fi/?p=libs%2Fvr.git;a=blobdiff_plain;f=source%2Fsidebysidecombiner.cpp;h=b1b8f9db06ed2e25537164bf0d4459b943dd0a76;hp=213b5448249b894736d392e55c741235d10e438b;hb=735148a3ecf7e753f520f22668b771583185f72f;hpb=5244110fa8d347b8539f4fcff1bea729eecc2027 diff --git a/source/sidebysidecombiner.cpp b/source/sidebysidecombiner.cpp index 213b544..b1b8f9d 100644 --- a/source/sidebysidecombiner.cpp +++ b/source/sidebysidecombiner.cpp @@ -26,11 +26,14 @@ const char fs_source[] = namespace Msp { namespace VR { -SideBySideCombiner::SideBySideCombiner(bool c): +SideBySideCombiner::SideBySideCombiner(GL::View &v, bool c): + view(v), mesh(GL::VERTEX2), shprog(vs_source, fs_source) { - width_div = 2; + target_width = view.get_width()/2; + target_height = view.get_height()/2; + render_aspect = static_cast(target_width)/target_height; left_shdata.uniform("texture", 0); right_shdata.uniform("texture", 0); @@ -65,6 +68,8 @@ void SideBySideCombiner::render(const GL::Texture2D &left, const GL::Texture2D & right.bind(); right_shdata.apply(); mesh.draw(); + + view.get_context().swap_buffers(); } } // namespace VR