X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgraphics%2Fwgl%2Fglcontext.cpp;h=3df83f3119a294fa8472729d95e84451957881a6;hb=213ca43656411a06bbf1c0d18e4ebacaf545eb34;hp=844f7a712c990a1442a7f442c4d50e5034e5b602;hpb=171f2b47008522ad7e950dc67447a08406f4888d;p=libs%2Fgui.git diff --git a/source/graphics/wgl/glcontext.cpp b/source/graphics/wgl/glcontext.cpp index 844f7a7..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);