X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fgraphics%2Fwgl%2Fglcontext.cpp;h=3df83f3119a294fa8472729d95e84451957881a6;hb=213ca43656411a06bbf1c0d18e4ebacaf545eb34;hp=05f9533de839322057b6b896eb8bc0cfabd3636d;hpb=7cd7824857aa9b95a9df40e782bfc121854e1d9c;p=libs%2Fgui.git diff --git a/source/graphics/wgl/glcontext.cpp b/source/graphics/wgl/glcontext.cpp index 05f9533..3df83f3 100644 --- a/source/graphics/wgl/glcontext.cpp +++ b/source/graphics/wgl/glcontext.cpp @@ -1,8 +1,11 @@ #include #include +#include #include "glcontext.h" #include "window_private.h" +using namespace std; + namespace Msp { namespace Graphics { @@ -53,6 +56,14 @@ GLContext::~GLContext() delete priv; } +void GLContext::set_swap_interval(unsigned i) +{ + PFNWGLSWAPINTERVALEXTPROC func = reinterpret_cast(wglGetProcAddress("wglSwapIntervalEXT")); + if(!func) + throw runtime_error("wglSwapIntervalEXT not found"); + func(i); +} + void GLContext::swap_buffers() { HDC dc = GetDC(window.get_private().window); @@ -60,10 +71,8 @@ void GLContext::swap_buffers() ReleaseDC(window.get_private().window, dc); } -void GLContext::window_resized(unsigned w, unsigned h) -{ - glViewport(0, 0, w, h); -} +void GLContext::window_resized(unsigned, unsigned) +{ } } // namespace Graphics } // namespace Msp