3 #include <msp/strings/format.h>
11 unsupported_gl_mode::unsupported_gl_mode(const GLOptions &opts):
12 runtime_error(format("{ .alpha=%s, .stencil=%s, .doublebuffer=%s, .multisample=%d, .forward_compatible=%s, .core_profile=%s, .gl_version=%s }",
13 opts.alpha, opts.stencil, opts.doublebuffer, opts.multisample, opts.forward_compatible, opts.core_profile, format_version(opts)))
16 string unsupported_gl_mode::format_version(const GLOptions &opts)
18 if(opts.gl_version_major==GLOptions::LATEST_VERSION)
20 else if(opts.gl_version_major==GLOptions::DEFAULT_VERSION)
23 return format("%d.%d", opts.gl_version_major, opts.gl_version_minor);
28 GLContext::GLContext(Window &wnd, const GLOptions &opts):
29 display(wnd.get_display()),
34 window.signal_resize.connect(sigc::mem_fun(this, &GLContext::window_resized));
38 void GLContext::platform_init(const GLOptions &)
40 throw runtime_error("no OpenGL support");
43 GLContext::~GLContext()
46 void GLContext::set_swap_interval(unsigned)
49 void GLContext::swap_buffers()
52 void GLContext::window_resized(unsigned, unsigned)
56 } // namespace Graphics