diff options
Diffstat (limited to 'src/boring_parts.cc')
-rw-r--r-- | src/boring_parts.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/boring_parts.cc b/src/boring_parts.cc index 5e240c2..3973c23 100644 --- a/src/boring_parts.cc +++ b/src/boring_parts.cc @@ -103,3 +103,23 @@ int initOpenCL() { } #endif /*HAS_OPENCL*/ +bool updateGLProjectionMatrix(Glib::RefPtr<Gdk::GL::Context> glCtx, Glib::RefPtr<Gdk::GL::Window> glWin, int width, int height) { + + GLdouble aspect = (GLdouble) width/height; + + // *** OpenGL BEGIN *** + if (!glWin->gl_begin(glCtx)) return false; + + glViewport(0, 0, width, height); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(60.0, aspect, 0.1, 10.0); + glMatrixMode(GL_MODELVIEW); + + glWin->gl_end(); + // *** OpenGL END *** + + return true; + +} + |