boo/lib/graphicsdev/GLX.cpp

27 lines
695 B
C++
Raw Normal View History

#include "boo/graphicsdev/glxew.h"
2016-03-04 23:02:18 +00:00
#include "logvisor/logvisor.hpp"
namespace boo
{
2016-03-04 23:02:18 +00:00
static logvisor::Module Log("boo::GLX");
void GLXExtensionCheck()
{
if (!GLXEW_SGI_video_sync)
2016-03-04 23:02:18 +00:00
Log.report(logvisor::Fatal, "GLX_SGI_video_sync not available");
if (!GLXEW_EXT_swap_control && !GLXEW_MESA_swap_control && !GLXEW_SGI_swap_control)
2016-03-04 23:02:18 +00:00
Log.report(logvisor::Fatal, "swap_control not available");
}
void GLXEnableVSync(Display* disp, GLXWindow drawable)
{
if (GLXEW_EXT_swap_control)
glXSwapIntervalEXT(disp, drawable, 1);
else if (GLXEW_MESA_swap_control)
glXSwapIntervalMESA(1);
else if (GLXEW_SGI_swap_control)
glXSwapIntervalSGI(1);
}
}