2 #include <msp/strings/format.h>
11 GLOptions::GLOptions():
16 forward_compatible(false),
18 gl_version_major(DEFAULT_VERSION),
19 gl_version_minor(DEFAULT_VERSION)
23 unsupported_gl_mode::unsupported_gl_mode(const GLOptions &opts):
24 runtime_error(format("{ .alpha=%s, .stencil=%s, .doublebuffer=%s, .multisample=%d, .forward_compatible=%s, .core_profile=%s, .gl_version=%s }",
25 opts.alpha, opts.stencil, opts.doublebuffer, opts.multisample, opts.forward_compatible, opts.core_profile, format_version(opts)))
28 string unsupported_gl_mode::format_version(const GLOptions &opts)
30 if(opts.gl_version_major==GLOptions::LATEST_VERSION)
32 else if(opts.gl_version_major==GLOptions::DEFAULT_VERSION)
35 return format("%d.%d", opts.gl_version_major, opts.gl_version_minor);
40 GLContext::GLContext(Window &wnd, const GLOptions &opts):
41 display(wnd.get_display()),
46 window.signal_resize.connect(sigc::mem_fun(this, &GLContext::window_resized));
50 void GLContext::platform_init(const GLOptions &)
52 throw runtime_error("no OpenGL support");
55 GLContext::~GLContext()
58 void GLContext::set_swap_interval(unsigned)
61 void GLContext::swap_buffers()
64 void GLContext::window_resized(unsigned, unsigned)
68 } // namespace Graphics