boo/lib/graphicsdev/GLX.cpp
Lioncash baff71cdc3 General: Tidy up includes
Alphabetizes includes and resolves quite a few instances of indirect
inclusions, making the requirements of several interfaces explicit. This
also trims out includes that aren't actually necessary (likely due to
changes in the API over time).
2019-08-19 21:02:56 -04:00

24 lines
692 B
C++

#include "boo/graphicsdev/glxew.h"
#include <logvisor/logvisor.hpp>
namespace boo {
static logvisor::Module Log("boo::GLX");
void GLXExtensionCheck() {
if (!GLXEW_SGI_video_sync)
Log.report(logvisor::Fatal, fmt("GLX_SGI_video_sync not available"));
if (!GLXEW_EXT_swap_control && !GLXEW_MESA_swap_control && !GLXEW_SGI_swap_control)
Log.report(logvisor::Fatal, fmt("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);
}
} // namespace boo