On Fri, Apr 22, 2011 at 10:59 PM, Jacob Dawid
<address@hidden> wrote:
Hello everybody,
in the last two weeks I have tried to integrate a plotting subsection into Quint. Qt offers a QGLWidget, which handles an OpenGL rendering context itself. Jordi told me in IRC that there has been lots of erffort put into a new fltk rendering backend, which uses OpenGL to plot and is very mighty as of now. What I am interested in is how that plotting backend works (in the sense of an abstract idea or structure) on a code level and where one needs to make cut in order to make use of it. Is it documented somewhere or is there an expert that can give me a rough overview of what's happening there? It's really difficult to grasp the whole from barely staring at thousands of lines of code.
Jacob
Hi Jacob.
There is an opengl-renderer already built into octave. The fltk backend is just a windowing bit built around it.
The code for the fltk backend is in src/DLD_FUNCTIONS/__init_fltk__.cc
to actually plot:
{
#include "gl-render.h"
#include "graphics.h"
// Setup OpenGL context
opengl_renderer renderer;
renderer.draw (gh_manager::get_object (number)); // number is the figure number
}
That's it!
To setup the backend so that it's recognized by octave, look at __init_fltk__ function in that file
Shai