2015-10-31 04:28:21 +00:00
|
|
|
#include "boo/graphicsdev/glxew.h"
|
2019-08-19 23:08:54 +00:00
|
|
|
#include <logvisor/logvisor.hpp>
|
2015-10-31 04:28:21 +00:00
|
|
|
|
2018-12-08 05:17:51 +00:00
|
|
|
namespace boo {
|
2016-03-04 23:02:18 +00:00
|
|
|
static logvisor::Module Log("boo::GLX");
|
2015-10-31 04:28:21 +00:00
|
|
|
|
2018-12-08 05:17:51 +00:00
|
|
|
void GLXExtensionCheck() {
|
|
|
|
if (!GLXEW_SGI_video_sync)
|
2019-07-20 04:22:36 +00:00
|
|
|
Log.report(logvisor::Fatal, fmt("GLX_SGI_video_sync not available"));
|
2018-12-08 05:17:51 +00:00
|
|
|
if (!GLXEW_EXT_swap_control && !GLXEW_MESA_swap_control && !GLXEW_SGI_swap_control)
|
2019-07-20 04:22:36 +00:00
|
|
|
Log.report(logvisor::Fatal, fmt("swap_control not available"));
|
2015-10-31 04:28:21 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:17:51 +00:00
|
|
|
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);
|
2015-10-31 04:28:21 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:17:51 +00:00
|
|
|
} // namespace boo
|