From 66a35d2b466e75604eeaa42b6ff0dfd0e19d2c3b Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Sat, 5 Jan 2013 15:55:31 +0000 Subject: - Ajout des dependances de compilation dans le README - Renommage MyGTKGlScene en MyGTKGlSceneWidget - Refactoring du maigre code OpenGL exitant (meilleure ventillation des events) - Modifications cosmétiques (commentaires / indentation / ordre des méthodes...) - Ajout gestion des évènement souris (reste des bugs avec les modifieurs clavier) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///var/svn/2013-gpudataviz/trunk@4 371a6b4a-a258-45f8-9dcc-bdd82ce0ac9d --- src/boring_parts.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/boring_parts.cc') 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 glCtx, Glib::RefPtr 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; + +} + -- cgit v1.2.3