diff options
author | don bright <hugh.m.bright@gmail.com> | 2013-01-26 06:09:37 (GMT) |
---|---|---|
committer | don bright <hugh.m.bright@gmail.com> | 2013-01-26 06:09:37 (GMT) |
commit | af4333a669eacc2cafc8274e23f58415e634477b (patch) | |
tree | 67d54465e838a224e16e262ebe8a5dfc0fde95f1 /src/OffscreenContextWGL.cc | |
parent | 544a8e5b799f5dd0a35d650c00db10074104650a (diff) |
refactor to reduce duplicate code. enable ostream save from OffscreenView
Diffstat (limited to 'src/OffscreenContextWGL.cc')
-rw-r--r-- | src/OffscreenContextWGL.cc | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/OffscreenContextWGL.cc b/src/OffscreenContextWGL.cc index b892c24..71d07e3 100644 --- a/src/OffscreenContextWGL.cc +++ b/src/OffscreenContextWGL.cc @@ -186,19 +186,7 @@ OffscreenContext *create_offscreen_context(int w, int h) return NULL; } - GLenum err = glewInit(); // must come after Context creation and before FBO calls. - if (GLEW_OK != err) { - cerr << "Unable to init GLEW: " << glewGetErrorString(err) << "\n"; - return NULL; - } - //cerr << glew_dump(0); - - ctx->fbo = fbo_new(); - if (!fbo_init(ctx->fbo, w, h)) { - return NULL; - } - - return ctx; + return create_offscreen_context_common( ctx ); } bool teardown_offscreen_context(OffscreenContext *ctx) @@ -206,11 +194,9 @@ bool teardown_offscreen_context(OffscreenContext *ctx) if (ctx) { fbo_unbind(ctx->fbo); fbo_delete(ctx->fbo); - wglMakeCurrent( NULL, NULL ); wglDeleteContext( ctx->openGLContext ); ReleaseDC( ctx->window, ctx->dev_context ); - return true; } return false; |