Mercurial > octave
diff m4/acinclude.m4 @ 25862:e5a73a8c116c
use wrapper class to call OpenGL functions
The motivation for this change is to allow calling OpenGL functions
through the Qt wrapper classes (QOpenGLFunctions and related classes)
so that we can fall back to a software implementation of OpenGL (at
least on Windows systems when using Qt) as described here
http://doc.qt.io/qt-5/windows-requirements.html in the section
"Dynamically Loading Graphics Drivers".
However, we can't use the Qt wrappers directly since we also need to
use OpenGL functions from the FLTK graphics widget. The new
opengl_functions base class and the qopengl_functions class derived
from it allows both the Qt and FLTK graphics widgets do continue using
a common set of classes (opengl_render, etc.) for most OpenGL
rendering.
* oct-opengl.h (opengl_functions): New class. Forward calls to OpenGL
functions. Don't define anything unless HAVE_OPENGL is defined.
* gl-render.cc, gl-render.h, gl2ps-print.cc, gl2ps-print.h,
gl-select.cc, gl-select.h: Fix constructors to accept opengl_functions
object. Change all uses. Store reference to opengl_functions in all
classes that call OpenGL functions. Use opengl_functions wrapper
object to call all OpenGL functions.
* gl-render.h, gl-render.cc (opengl_renderer::get_opengl_functions):
New function.
(opengl_renderer::m__max_lights): New data member.
(opengl_renderer::init_maxlights): New member function to replace
static function get_maxlights.
(opengl_renderer::get_string): New member function to replace static
function gl_get_string.
* __init_fltk__.cc (OpenGL_fltk::m_glfcns): New opengl_functions data
member. Use wrapper object to call all OpenGL functions.
* libgui/graphics/qopengl-functions.h: New file.
* libgui/graphics/module.mk: Update.
* acinclude.m4 (OCTAVE_CHECK_QT_OPENGL_OK): Check for QGLFunctions_1_1
header file.
* GLCanvas.cc, GLCanvas.h (GLCanvas::m_glfcns): New qopengl_functions
data member. Use wrapper object to call all OpenGL functions.
(GLCanvas::initializeGL): Initialize qopengl_functions object.
(GLCanvas::drawZoomRect): New member function to replace static
function glDrawZoomBox. Change all uses.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 06 Sep 2018 16:29:56 -0400 |
parents | dd10eea0be97 |
children | 4e108574385c |
line wrap: on
line diff
--- a/m4/acinclude.m4 Fri Sep 07 09:48:33 2018 -0700 +++ b/m4/acinclude.m4 Thu Sep 06 16:29:56 2018 -0400 @@ -1846,7 +1846,7 @@ ac_octave_save_CXXFLAGS="$CXXFLAGS" CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS" CXXFLAGS="$CXXPICFLAG $CXXFLAGS" - AC_CHECK_HEADERS([QOpenGLWidget QGLWidget]) + AC_CHECK_HEADERS([QOpenGLWidget QGLWidget QGLFunctions_1_1]) AC_CACHE_CHECK([whether Qt works with OpenGL and GLU], [octave_cv_qt_opengl_ok], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[