X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fgraphics%2Fglcontext.cpp;h=ec073cb79c2c9928fc6dece00604807f2aa540dc;hb=be455be47a214f8fba1224ef1fb4158a073bc4e3;hp=ab0ea7ad59267eb55625c42c2a26a72852450601;hpb=1aca77b93853ee127ac3bbf6886f7f04920542ef;p=libs%2Fgui.git diff --git a/source/graphics/glcontext.cpp b/source/graphics/glcontext.cpp index ab0ea7a..ec073cb 100644 --- a/source/graphics/glcontext.cpp +++ b/source/graphics/glcontext.cpp @@ -12,15 +12,29 @@ GLOptions::GLOptions(): alpha(false), stencil(false), doublebuffer(true), - multisample(0) + multisample(0), + forward_compatible(false), + core_profile(false), + gl_version_major(DEFAULT_VERSION), + gl_version_minor(DEFAULT_VERSION) { } unsupported_gl_mode::unsupported_gl_mode(const GLOptions &opts): - runtime_error(format("{ .alpha=%s, .stencil=%s, .doublebuffer=%s, .multisample=%d }", - opts.alpha, opts.stencil, opts.doublebuffer, opts.multisample)) + runtime_error(format("{ .alpha=%s, .stencil=%s, .doublebuffer=%s, .multisample=%d, .forward_compatible=%s, .core_profile=%s, .gl_version=%s }", + opts.alpha, opts.stencil, opts.doublebuffer, opts.multisample, opts.forward_compatible, opts.core_profile, format_version(opts))) { } +string unsupported_gl_mode::format_version(const GLOptions &opts) +{ + if(opts.gl_version_major==GLOptions::LATEST_VERSION) + return "LATEST"; + else if(opts.gl_version_major==GLOptions::DEFAULT_VERSION) + return "DEFAULT"; + else + return format("%d.%d", opts.gl_version_major, opts.gl_version_minor); +} + GLContext::GLContext(Window &wnd, const GLOptions &opts): @@ -41,6 +55,9 @@ void GLContext::platform_init(const GLOptions &) GLContext::~GLContext() { } +void GLContext::set_swap_interval(unsigned) +{ } + void GLContext::swap_buffers() { }