Commit 15ae9e0b authored by Olivier Lagrasse's avatar Olivier Lagrasse

- Fix a problem with color which made slow the render.

- Add an alternate render with VBO. Uncomment #define WITH_VBO on Core.hpp to use it. You need glew installed. If you cannot compile and you do not want to install glew, please remove Render_alternate.hpp et Render_alternate.cpp entries from src/src.pro and/or src/CMakeLists.txt.
- Fix some bugs.
parent a6f33bcf
...@@ -87,6 +87,7 @@ SET(VITE_HDRS ...@@ -87,6 +87,7 @@ SET(VITE_HDRS
render/Geometry.hpp render/Geometry.hpp
render/Hook_event.hpp render/Hook_event.hpp
render/Render_opengl.hpp render/Render_opengl.hpp
render/Render_alternate.hpp
render/Render_svg.hpp render/Render_svg.hpp
render/render_stats.hpp render/render_stats.hpp
render/render_stats_opengl.hpp render/render_stats_opengl.hpp
...@@ -166,6 +167,7 @@ SET(VITE_SRCS ...@@ -166,6 +167,7 @@ SET(VITE_SRCS
render/Hook_event.cpp render/Hook_event.cpp
render/Render.hpp render/Render.hpp
render/Render_opengl.cpp render/Render_opengl.cpp
render/Render_alternate.cpp
render/Render_svg.cpp render/Render_svg.cpp
render/render_stats_opengl.cpp render/render_stats_opengl.cpp
render/render_stats_svg.cpp render/render_stats_svg.cpp
......
...@@ -47,32 +47,6 @@ ...@@ -47,32 +47,6 @@
#include "common/common.hpp" #include "common/common.hpp"
#include "common/info.hpp" #include "common/info.hpp"
// void (Interface_console:: *Info::Core::launch_action)(int, void*) = NULL;
// const int Info::Core::_STATE_UNKNOWN = -1;
// const int Info::Core::_STATE_DISPLAY_HELP = 0;
// const int Info::Core::_STATE_IN_AN_INTERVAL = 1; // 2^0
// const int Info::Core::_STATE_OPEN_FILE = 2; // 2^1
// const int Info::Core::_STATE_OPEN_FILE_IN_AN_INTERVAL = 3;
// const int Info::Core::_STATE_EXPORT_FILE = 4; // 2^2
// const int Info::Core::_STATE_EXPORT_FILE_IN_INTERVAL = 5;
// const int Info::Core::_STATE_RELEASE_RENDER_AREA = 6;
// const int Info::Core::_STATE_RENDER_AREA_CHANGE_TRANSLATE = 7;
// const int Info::Core::_STATE_RENDER_AREA_CHANGE_SCALE = 8;
// const int Info::Core::_STATE_RENDER_AREA_CHANGE_CONTAINER_SCALE = 9;
// const int Info::Core::_DRAW_OPENGL = 10;
// const int Info::Core::_DRAW_SVG = 11;
// const int Info::Core::_STATE_LAUNCH_GRAPHICAL_INTERFACE = 12;
// const int Info::Core::_STATE_RENDER_AREA_REPLACE_SCALE = 13;
// const int Info::Core::_STATE_RENDER_AREA_REPLACE_TRANSLATE = 14;
// const int Info::Core::_STATE_RENDER_AREA_REPLACE_TRANSLATE_Y = 15;
// const int Info::Core::_STATE_RENDER_AREA_REGISTERED_TRANSLATE = 16;
// const int Info::Core::_STATE_RENDER_AREA_CHANGE_SCALE_Y = 17;
// const int Info::Core::_STATE_AJUST_SCROLL_BARS = 18;
// const int Info::Core::_STATE_REFRESH_SCROLL_BARS = 19;
// const int Info::Core::_STATE_ZOOM_BOX_VALUE = 20;
// const int Info::Core::_STATE_RENDER_DISPLAY_INFORMATION = 21;
// const int Info::Core::_STATE_RENDER_UPDATE = 22;
unsigned int Info::Screen::width = 800; unsigned int Info::Screen::width = 800;
unsigned int Info::Screen::height = 600; unsigned int Info::Screen::height = 600;
...@@ -101,5 +75,5 @@ Element_pos Info::Render::_info_accurate = 0.0; ...@@ -101,5 +75,5 @@ Element_pos Info::Render::_info_accurate = 0.0;
bool Info::Render::_no_arrows = false; bool Info::Render::_no_arrows = false;
bool Info::Render::_no_events = false; bool Info::Render::_no_events = false;
QLabel* Info::Render::_ui_render_min_value = NULL; //QLabel* Info::Render::_ui_render_min_value = NULL;
QLabel* Info::Render::_ui_render_max_value = NULL; //QLabel* Info::Render::_ui_render_max_value = NULL;
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
#define INFO_HPP #define INFO_HPP
class Interface_console; class Interface_console;
class QLabel; //class QLabel;
/*! /*!
* \brief Class used to store informations. * \brief Class used to store informations.
...@@ -253,13 +253,13 @@ public: ...@@ -253,13 +253,13 @@ public:
* \brief This attribute is used to update the label which indicates * \brief This attribute is used to update the label which indicates
* the minimum visible trace value. * the minimum visible trace value.
*/ */
static QLabel* _ui_render_min_value; //static QLabel* _ui_render_min_value;
/*! /*!
* \brief This attribute is used to update the label which indicates * \brief This attribute is used to update the label which indicates
* the maximum visible trace value. * the maximum visible trace value.
*/ */
static QLabel* _ui_render_max_value; //static QLabel* _ui_render_max_value;
}; };
......
...@@ -45,8 +45,6 @@ ...@@ -45,8 +45,6 @@
*\brief This is the console interface C source code. *\brief This is the console interface C source code.
*/ */
//#define WITH_OTF
#include <queue> #include <queue>
#include <string> #include <string>
...@@ -66,12 +64,9 @@ ...@@ -66,12 +64,9 @@
/* -- */ /* -- */
#include "render/Render_opengl.hpp"
//#include "render/render.hpp" //#include "render/render.hpp"
#include "render/Render_svg.hpp" #include "render/Render_svg.hpp"
#include "render/Render.hpp" #include "render/Render.hpp"
//#include "render/Render_opengl_dl.hpp"
/* -- */ /* -- */
#include "trace/values/Values.hpp" #include "trace/values/Values.hpp"
#include "trace/tree/Interval.hpp" #include "trace/tree/Interval.hpp"
...@@ -101,6 +96,13 @@ ...@@ -101,6 +96,13 @@
#include "core/Core.hpp" #include "core/Core.hpp"
#include "interface/parsing_thread.hpp" #include "interface/parsing_thread.hpp"
/* -- */ /* -- */
#ifdef WITH_VBO
#include "render/Render_alternate.hpp"
#else
#include "render/Render_opengl.hpp"
#endif
using namespace std; using namespace std;
#define message *Message::get_instance() << "(" << __FILE__ << " l." << __LINE__ << "): " #define message *Message::get_instance() << "(" << __FILE__ << " l." << __LINE__ << "): "
...@@ -211,13 +213,19 @@ bool Core::draw_trace(const string & filename, const int format){ ...@@ -211,13 +213,19 @@ bool Core::draw_trace(const string & filename, const int format){
Parser *parser; Parser *parser;
DrawTrace drawing_ogl; DrawTrace drawing_ogl;
#ifdef WITH_VBO
Render<Render_alternate> render(_render_opengl);
#else
Render<Render_opengl> render(_render_opengl); Render<Render_opengl> render(_render_opengl);
#endif
QTime time_elapsed; QTime time_elapsed;
ostringstream buf_txt; ostringstream buf_txt;
int time_buf; int time_buf;
time_buf = 0; time_buf = 0;
// Get the parser in function of the extension of the file // Get the parser in function of the extension of the file
const unsigned int position_of_dot = filename.find_last_of('.'); const unsigned int position_of_dot = filename.find_last_of('.');
...@@ -254,6 +262,13 @@ bool Core::draw_trace(const string & filename, const int format){ ...@@ -254,6 +262,13 @@ bool Core::draw_trace(const string & filename, const int format){
if (NULL == _trace) { /* no trace is loaded, parse the file */ if (NULL == _trace) { /* no trace is loaded, parse the file */
/* Init data */
Info::Entity::x_min = 0;
Info::Entity::x_max = 0;
Info::Render::_x_min_visible = 0;
Info::Render::_x_max_visible = 0;
_trace = new Trace(); _trace = new Trace();
// Init of the thread // Init of the thread
...@@ -633,12 +648,16 @@ void Core::launch_action(int state, void* arg) { ...@@ -633,12 +648,16 @@ void Core::launch_action(int state, void* arg) {
if ( _STATE_OPEN_FILE == state) if ( _STATE_OPEN_FILE == state)
message << QObject::tr("Opening the file: ").toStdString ()+_file_opened << Message::endi; message << QObject::tr("Opening the file: ").toStdString ()+_file_opened << Message::endi;
_main_window = new Interface_graphic (this);/* launch the window interface */ _main_window = new Interface_graphic (this);/* launch the window interface */
Message::set_interface (_main_window);/* define which interface will receive messages */ Message::set_interface (_main_window);/* define which interface will receive messages */
// format.setOverlay(true); // format.setOverlay(true);
#ifdef WITH_VBO
_render_opengl = new Render_alternate (this, _main_window, format);
#else
_render_opengl = new Render_opengl (this, _main_window, format); _render_opengl = new Render_opengl (this, _main_window, format);
#endif
if ( NULL == _render_opengl){ if ( NULL == _render_opengl){
message << QObject::tr("Cannot allocate memory for an OpengGL instance").toStdString () << Message::ende; message << QObject::tr("Cannot allocate memory for an OpengGL instance").toStdString () << Message::ende;
......
...@@ -47,9 +47,18 @@ ...@@ -47,9 +47,18 @@
#ifndef CORE_HPP #ifndef CORE_HPP
#define CORE_HPP #define CORE_HPP
//#define WITH_VBO
class Core; class Core;
class Interface_graphic; class Interface_graphic;
#ifdef WITH_VBO
class Render_alternate;
#else
class Render_opengl; class Render_opengl;
#endif
class Render_svg; class Render_svg;
class Trace; class Trace;
#include "render/Render.hpp" #include "render/Render.hpp"
...@@ -256,7 +265,11 @@ protected: ...@@ -256,7 +265,11 @@ protected:
* \brief Contains the OpenGL render instance. * \brief Contains the OpenGL render instance.
*/ */
/* MOD */ /* MOD */
Render_opengl* _render_opengl; #ifdef WITH_VBO
Render_alternate* _render_opengl;
#else
Render_opengl* _render_opengl;
#endif
//Render<Render_opengl>* _render_opengl; //Render<Render_opengl>* _render_opengl;
/*! /*!
......
...@@ -195,8 +195,8 @@ void Interface_graphic::load_windows(){ ...@@ -195,8 +195,8 @@ void Interface_graphic::load_windows(){
CKFP(_ui_zoom_box = qFindChild<QComboBox*>(this, "zoom_box"), "Cannot find the zoom box in the .ui file"); CKFP(_ui_zoom_box = qFindChild<QComboBox*>(this, "zoom_box"), "Cannot find the zoom box in the .ui file");
CKFP(Info::Render::_ui_render_min_value = qFindChild<QLabel*>(this, "render_min_value"), "Cannot find the render_min_value label in the .ui file"); // CKFP(Info::Render::_ui_render_min_value = qFindChild<QLabel*>(this, "render_min_value"), "Cannot find the render_min_value label in the .ui file");
CKFP(Info::Render::_ui_render_max_value = qFindChild<QLabel*>(this, "render_max_value"), "Cannot find the render_max_value label in the .ui file"); // CKFP(Info::Render::_ui_render_max_value = qFindChild<QLabel*>(this, "render_max_value"), "Cannot find the render_max_value label in the .ui file");
/* Export window */ /* Export window */
CKFP(_ui_export_ok_button = qFindChild<QPushButton*>(_ui_time_selection_export, "option_export_ok"), "Cannot find the ok push button in the export dialog .ui file"); CKFP(_ui_export_ok_button = qFindChild<QPushButton*>(_ui_time_selection_export, "option_export_ok"), "Cannot find the ok push button in the export dialog .ui file");
......
...@@ -28,55 +28,6 @@ ...@@ -28,55 +28,6 @@
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="render_min_value">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="render_max_value">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
</widget>
</item>
</layout>
</item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
...@@ -235,7 +186,7 @@ ...@@ -235,7 +186,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1060</width> <width>1060</width>
<height>27</height> <height>25</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuHelp"> <widget class="QMenu" name="menuHelp">
......
...@@ -253,7 +253,7 @@ void Hook_event::mouseDoubleClickEvent ( QMouseEvent * event ){ ...@@ -253,7 +253,7 @@ void Hook_event::mouseDoubleClickEvent ( QMouseEvent * event ){
void Hook_event::mouseMoveEvent(QMouseEvent * event){ void Hook_event::mouseMoveEvent(QMouseEvent * event){
// if (!_mouse_pressed) return; if (!_mouse_pressed) return;
_new_mouse_x = event->x(); _new_mouse_x = event->x();
_new_mouse_y = event->y(); _new_mouse_y = event->y();
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
#include "render/Ruler.hpp" #include "render/Ruler.hpp"
#include "common/info.hpp" #include "common/info.hpp"
#include <GL/glut.h>
/*! /*!
* \brief Structure used to store container information. * \brief Structure used to store container information.
...@@ -242,16 +243,20 @@ public: ...@@ -242,16 +243,20 @@ public:
} }
drawing_instance->end_draw_containers(); drawing_instance->end_draw_containers();
} }
static int bb;
/*! /*!
* \brief Creates and opens the display list for state draws. * \brief Creates and opens the display list for state draws.
*/ */
inline void start_draw_states(){ inline void start_draw_states(){
drawing_instance->start_draw_states(); drawing_instance->start_draw_states();
} }
/*! /*!
* \brief Draw a state of the trace. * \brief Draw a state of the trace.
* \param start the beginning time of the state. * \param start the beginning time of the state.
...@@ -262,18 +267,17 @@ public: ...@@ -262,18 +267,17 @@ public:
* \param g the green color rate of the state. * \param g the green color rate of the state.
* \param b the blue color rate of the state. * \param b the blue color rate of the state.
*/ */
inline void draw_state(const Element_pos start, const Element_pos end, const Element_pos base, const Element_pos height, const Element_col r, const Element_col g, const Element_col b) {
// std::cout << __FILE__ << " " << __LINE__ << " -* " << trace_to_render_x(start) << " " << coeff_trace_render_x() << std::endl; inline void draw_state(const Element_pos start, const Element_pos end, const Element_pos base, const Element_pos height, const Element_col r, const Element_col g, const Element_col b) {
drawing_instance->set_color(r, g, b); drawing_instance->set_color(r, g, b);
// drawing_instance->draw_quad(start, base, _z_state, end-start, height);
drawing_instance->draw_quad(trace_to_render_x(start - Info::Render::_x_min_visible), drawing_instance->draw_quad(trace_to_render_x(start - Info::Render::_x_min_visible),
trace_to_render_y(base), trace_to_render_y(base),
_z_state, _z_state,
(end-start)*coeff_trace_render_x(), (end-start)*coeff_trace_render_x(),
height*coeff_trace_render_y()); height*coeff_trace_render_y());
} }
/*! /*!
...@@ -449,7 +453,6 @@ public: ...@@ -449,7 +453,6 @@ public:
*/ */
inline void end_draw(){ inline void end_draw(){
// std::cerr << __FILE__ << __LINE__ << " " << Info::Render::_x_min_visible << " " << Info::Render::_x_max_visible << std::endl; // std::cerr << __FILE__ << __LINE__ << " " << Info::Render::_x_min_visible << " " << Info::Render::_x_max_visible << std::endl;
/* Now, draw ruler */ /* Now, draw ruler */
Element_pos graduation_diff; Element_pos graduation_diff;
Element_pos coeff_prefix; Element_pos coeff_prefix;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -94,6 +94,15 @@ class Render_opengl : /*public QGLWidget,*/ public Hook_event, public Render_te ...@@ -94,6 +94,15 @@ class Render_opengl : /*public QGLWidget,*/ public Hook_event, public Render_te
{ {
Q_OBJECT Q_OBJECT
private:
bool _draw_container;
bool _draw_state;
bool _draw_ruler;
bool _draw_arrow;
bool _draw_event;
protected: protected:
/*! /*!
...@@ -166,6 +175,8 @@ protected: ...@@ -166,6 +175,8 @@ protected:
*/ */
int _wait_spf; int _wait_spf;
/*! /*!
* \brief Timer to animate the wait. * \brief Timer to animate the wait.
*/ */
......
...@@ -43,14 +43,15 @@ ...@@ -43,14 +43,15 @@
/*! /*!
*\file vbo.cpp *\file vbo.cpp
*/ */
#include <GL/glew.h>
#include "common/common.hpp" #include <stdlib.h>
/* -- */ #include <iostream>
#include "render/vbo.hpp" #include "vbo.hpp"
/* -- */
using namespace std;
#define message *Message::get_instance() << "(" << __FILE__ << " l." << __LINE__ << "): "
#define ERROR(m) printf("%s", m);
using namespace std;
const int Vbo::VBO_OK = 0; const int Vbo::VBO_OK = 0;
const int Vbo::VBO_OUT_OF_MEMORY = 1; const int Vbo::VBO_OUT_OF_MEMORY = 1;
...@@ -70,7 +71,7 @@ Vbo::Vbo(){ ...@@ -70,7 +71,7 @@ Vbo::Vbo(){
} }
Vbo::Vbo(int nb_verteces_per_object, int nb_object, GLenum object_type, GLenum client_state){ Vbo::Vbo(int nb_object, Type object_type){
/* init class attributes */ /* init class attributes */
...@@ -79,13 +80,25 @@ Vbo::Vbo(int nb_verteces_per_object, int nb_object, GLenum object_type, GLenum c ...@@ -79,13 +80,25 @@ Vbo::Vbo(int nb_verteces_per_object, int nb_object, GLenum object_type, GLenum c
_id = 0; _id = 0;
_nb_object = nb_object; _nb_object = nb_object;
_nb_verteces_per_object = nb_verteces_per_object;
switch (object_type){
case TRIANGLES:
_nb_verteces_per_object = 3;
_object_type = GL_TRIANGLES;
break;
case QUADS:
_nb_verteces_per_object = 4;
_object_type = GL_QUADS;
break;
case LINES:
_nb_verteces_per_object = 2;
_object_type = GL_LINES;
}
/* There is _nb_object*(number_of_vertices_per_object) elements. */ /* There is _nb_object*(number_of_vertices_per_object) elements. */
_size = _nb_coordinates_per_vertex*nb_verteces_per_object*_nb_object; _size = _nb_coordinates_per_vertex*_nb_verteces_per_object*_nb_object;
_object_type = object_type; _client_state = GL_VERTEX_ARRAY;
_client_state = client_state;
/* init OpenGL */ /* init OpenGL */
...@@ -94,7 +107,7 @@ Vbo::Vbo(int nb_verteces_per_object, int nb_object, GLenum object_type, GLenum c ...@@ -94,7 +107,7 @@ Vbo::Vbo(int nb_verteces_per_object, int nb_object, GLenum object_type, GLenum c
glBindBuffer(GL_ARRAY_BUFFER, _id);/* select our vbo */ glBindBuffer(GL_ARRAY_BUFFER, _id);/* select our vbo */
glBufferData(GL_ARRAY_BUFFER, _size*sizeof(Element_pos), NULL, GL_STREAM_DRAW);/* allocate memory space inside graphic card */ glBufferData(GL_ARRAY_BUFFER, _size*sizeof(Data_type), NULL, GL_STREAM_DRAW);/* allocate memory space inside graphic card */
glBindBuffer(GL_ARRAY_BUFFER, 0);/* deselect our vbo */ glBindBuffer(GL_ARRAY_BUFFER, 0);/* deselect our vbo */
...@@ -102,7 +115,7 @@ Vbo::Vbo(int nb_verteces_per_object, int nb_object, GLenum object_type, GLenum c ...@@ -102,7 +115,7 @@ Vbo::Vbo(int nb_verteces_per_object, int nb_object, GLenum object_type, GLenum c
Vbo::~Vbo(){ Vbo::~Vbo(){
glDeleteBuffers(1, &_id);/* release the buffer and free its memory inside graphic card */ glDeleteBuffers(1, &_id);/* release the buffer and free its memory inside the graphic card */
_id = 0; _id = 0;
} }
...@@ -119,7 +132,7 @@ Vbo::~Vbo(){ ...@@ -119,7 +132,7 @@ Vbo::~Vbo(){
* *
**********************************/ **********************************/
int Vbo::fill_buffer(const unsigned int data_size, const Element_pos* const data){ int Vbo::add(const unsigned int data_size, const Data_type* const data){
glBindBuffer(GL_ARRAY_BUFFER, _id);/* select our vbo */ glBindBuffer(GL_ARRAY_BUFFER, _id);/* select our vbo */
...@@ -132,7 +145,7 @@ int Vbo::fill_buffer(const unsigned int data_size, const Element_pos* const dat ...@@ -132,7 +145,7 @@ int Vbo::fill_buffer(const unsigned int data_size, const Element_pos* const dat
if ( (_cur+data_size) <= _size){ if ( (_cur+data_size) <= _size){
glBufferSubData(GL_ARRAY_BUFFER, _cur*sizeof(Element_pos), data_size*sizeof(Element_pos), data); glBufferSubData(GL_ARRAY_BUFFER, _cur*sizeof(Data_type), data_size*sizeof(Data_type), data);
_cur += data_size; _cur += data_size;
}else{ }else{
...@@ -148,7 +161,7 @@ int Vbo::fill_buffer(const unsigned int data_size, const Element_pos* const dat ...@@ -148,7 +161,7 @@ int Vbo::fill_buffer(const unsigned int data_size, const Element_pos* const dat
int Vbo::get_remaining_size() const{ int Vbo::get_remaining_size() const{
return (_size-_cur); return (_size-_cur)/(_nb_verteces_per_object*_nb_coordinates_per_vertex);
} }
...@@ -164,7 +177,7 @@ int Vbo::get_remaining_size() const{ ...@@ -164,7 +177,7 @@ int Vbo::get_remaining_size() const{
* *
**********************************/ **********************************/
void Vbo::display_buffer() const{ void Vbo::display() const{
glBindBuffer(GL_ARRAY_BUFFER, _id);/* select our vbo */ glBindBuffer(GL_ARRAY_BUFFER, _id);/* select our vbo */
...@@ -212,48 +225,5 @@ void Vbo::display_buffer() const{ ...@@ -212,48 +225,5 @@ void Vbo::display_buffer() const{
void Vbo::display_info(){ void Vbo::display_info(){
GLvoid* _read_buf = NULL; GLvoid* _read_buf = NULL;
message << "*** Display VBO info ***" << Message::endi;
message << "Id: " << _id << Message::endi;
message << "Current position inside vbo: " << _cur << Message::endi;
message << "Coordinates per vertex: " << _nb_coordinates_per_vertex << Message::endi;
message << "Verteces per object: " << _nb_verteces_per_object << Message::endi;
message << "Max objects per vertex buffer: " << _nb_object << Message::endi;
message << "Max size of the vbo (verteces_per_object * nb_object * sizeof(Element_pos)) in Bytes: " << _size*sizeof(Element_pos) << Message::endi;
message << "Object type: " << _object_type << Message::endi;
message << "Client state: " << _client_state << Message::endi;
/* Now, read the video memory */
message << Message::endi << Message::endi << "Display memory data: " << Message::endi;
glBindBuffer(GL_ARRAY_BUFFER, _id);
_read_buf = glMapBuffer(GL_ARRAY_BUFFER, GL_READ_ONLY);
if (NULL == _read_buf){
message << "Cannot access data" << Message::endi;
}