void GLContext::platform_init(const GLOptions &opts)
{
- priv = new Private;
-
vector<unsigned> attribs;
-
+
attribs.push_back(CPF_DEPTH_SIZE);
attribs.push_back(1);
-
+
if(opts.alpha)
{
attribs.push_back(CPF_ALPHA_SIZE);
attribs.push_back(1);
}
-
+
if(opts.stencil)
{
attribs.push_back(CPF_STENCIL_SIZE);
attribs.push_back(1);
}
-
+
if(opts.doublebuffer)
attribs.push_back(CPF_DOUBLEBUFFER);
-
+
if(opts.multisample>0)
{
attribs.push_back(CPF_SAMPLE_BUFFERS);
if(!pixfmt)
throw unsupported_gl_mode(opts);
+ priv = new Private;
priv->context = create_gl_context(pixfmt);
destroy_pixel_format(pixfmt);
delete priv;
}
+void GLContext::set_swap_interval(unsigned)
+{
+ // TODO
+}
+
void GLContext::swap_buffers()
{
flush_gl_buffer(priv->context);
}
-void GLContext::window_resized(unsigned w, unsigned h)
+void GLContext::window_resized(unsigned, unsigned)
{
// XXX Call [context update] here?
- glViewport(0, 0, w, h);
}
} // namespace Graphics