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,7 +213,13 @@ bool Core::draw_trace(const string & filename, const int format){ ...@@ -211,7 +213,13 @@ 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;
...@@ -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
...@@ -638,7 +653,11 @@ void Core::launch_action(int state, void* arg) { ...@@ -638,7 +653,11 @@ void Core::launch_action(int state, void* arg) {
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 */
#ifdef WITH_VBO
Render_alternate* _render_opengl;
#else
Render_opengl* _render_opengl; 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) { 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;
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.
...@@ -63,10 +63,6 @@ using namespace std; ...@@ -63,10 +63,6 @@ using namespace std;
#define message *Message::get_instance() << "(" << __FILE__ << " l." << __LINE__ << "): " #define message *Message::get_instance() << "(" << __FILE__ << " l." << __LINE__ << "): "
static bool _draw_container;
static bool _draw_ruler;
static bool _draw_arrow;
static bool _draw_event;
const int Render_opengl::DRAWING_TIMER_DEFAULT = 10; const int Render_opengl::DRAWING_TIMER_DEFAULT = 10;
/*********************************** /***********************************
...@@ -204,72 +200,43 @@ void Render_opengl::paintGL(){ ...@@ -204,72 +200,43 @@ void Render_opengl::paintGL(){
glTranslated(0.0, Info::Render::height, 100.0); glTranslated(0.0, Info::Render::height, 100.0);
glRotated(180.0, 1.0, 0.0, 0.0); glRotated(180.0, 1.0, 0.0, 0.0);
// display_container(0, 0);
glPushMatrix(); glPushMatrix();
{ {
/* Translate containers and entities of the ruler height */
// glTranslated(0.0, _ruler_height, 0.0);
// glTranslated(- _x_state_translate, -_y_state_translate, 0.0);
glTranslatef(0.0f, _ruler_y + _ruler_height -_y_state_translate, 0.0); glTranslatef(0.0f, _ruler_y + _ruler_height -_y_state_translate, 0.0);
// glScalef( (Info::Render::width/Info::Container::x_max)*_x_scale_container_state, _y_state_scale*(Info::Render::height-_ruler_height)/Info::Container::y_max, 0.0f);
glScalef(_x_scale_container_state/0.20, _y_state_scale, 1.0); glScalef(_x_scale_container_state/0.20, _y_state_scale, 1.0);
if (glIsList(_list_containers) == GL_FALSE) if (glIsList(_list_containers) == GL_FALSE)
*Message::get_instance() << tr("ERROR LIST not exist for containers.").toStdString() << Message::ende; *Message::get_instance() << tr("ERROR LIST not exist for containers.").toStdString() << Message::ende;
else else
glCallList(_list_containers); glCallList(_list_containers);
} }
glPopMatrix(); glPopMatrix();
glPushMatrix(); glPushMatrix();
{ {
glTranslated(_default_entity_x_translate - _x_state_translate, _ruler_y + _ruler_height - _y_state_translate, _z_state);
glTranslated(_default_entity_x_translate - _x_state_translate, _ruler_y + _ruler_height - _y_state_translate, 0.0); glScalef(_x_state_scale, _y_state_scale, 1);
glScalef(_x_state_scale, _y_state_scale, 1.0);
if (glIsList(_list_states) == GL_FALSE) if (glIsList(_list_states) == GL_FALSE)
*Message::get_instance() << tr("ERROR LIST not exist for states.").toStdString() << Message::ende; *Message::get_instance() << tr("ERROR LIST not exist for states.").toStdString() << Message::ende;
else else{
glCallList(_list_states); glCallList(_list_states);
glCallList(_list_counters);
}
} }
glPopMatrix(); glPopMatrix();
// draw_stored_texts();
call_ruler();
// display_state(0, 0, 0, 0, 0, 0);
if (false == Info::Render::_no_arrows)/* display arrows */ if (false == Info::Render::_no_arrows)/* display arrows */
draw_stored_arrows(); draw_stored_arrows();
// display_arrow(0, 0, 0, 0, 0, 0);
if (false == Info::Render::_no_events)/* display events */ if (false == Info::Render::_no_events)/* display events */
draw_stored_circles(); draw_stored_circles();
// display_event(0, 0, 0, 0);
// display_counter(0, 0, 0, 0);
/* Untranslate ruler */ /* Untranslate ruler */
/* glTranslated(0.0, -_ruler_height, 0.0);
glEnable(GL_BLEND); glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
call_ruler(); call_ruler();
glDisable(GL_BLEND);*/ glDisable(GL_BLEND);
} }
glPopMatrix(); glPopMatrix();
...@@ -334,6 +301,11 @@ void Render_opengl::paintGL(){ ...@@ -334,6 +301,11 @@ void Render_opengl::paintGL(){
if(DRAWING_STATE_WAITING == _state)/* A wait is drawn, do not take car about the ruler drawing */
return;
QFont arial_font = QFont("Arial", 10); QFont arial_font = QFont("Arial", 10);
qglColor(Qt::white);//QColor(0, 0, 0)); qglColor(Qt::white);//QColor(0, 0, 0));
...@@ -486,8 +458,8 @@ bool Render_opengl::unbuild(){ ...@@ -486,8 +458,8 @@ bool Render_opengl::unbuild(){
Info::Container::x_min = 0; Info::Container::x_min = 0;
Info::Container::y_min = 0; Info::Container::y_min = 0;
Info::Render::_ui_render_min_value->setText(""); // Info::Render::_ui_render_min_value->setText("");
Info::Render::_ui_render_max_value->setText(""); // Info::Render::_ui_render_max_value->setText("");
Info::Entity::x_max = 0; Info::Entity::x_max = 0;
Info::Entity::x_min = 0; Info::Entity::x_min = 0;
...@@ -619,6 +591,7 @@ void Render_opengl::call_ruler(){ ...@@ -619,6 +591,7 @@ void Render_opengl::call_ruler(){
graduation_diff = Ruler::get_graduation_diff(Info::Render::_x_min_visible, Info::Render::_x_max_visible); graduation_diff = Ruler::get_graduation_diff(Info::Render::_x_min_visible, Info::Render::_x_max_visible);
coeff_prefix = Ruler::get_coeff_for_common_prefix(Info::Render::_x_min_visible, Info::Render::_x_max_visible); coeff_prefix = Ruler::get_coeff_for_common_prefix(Info::Render::_x_min_visible, Info::Render::_x_max_visible);
set_color(1.0, 1.0, 1.0);
for (Element_pos i = Info::Render::_x_min_visible ; i < Info::Render::_x_max_visible ; i+=graduation_diff){ for (Element_pos i = Info::Render::_x_min_visible ; i < Info::Render::_x_max_visible ; i+=graduation_diff){
const Element_pos grad_div_by_5 = graduation_diff/5; const Element_pos grad_div_by_5 = graduation_diff/5;
...@@ -660,12 +633,11 @@ void Render_opengl::set_color(float r, float g, float b){ ...@@ -660,12 +633,11 @@ void Render_opengl::set_color(float r, float g, float b){
_red = r; _red = r;
_green = g; _green = g;
_blue = b; _blue = b;
glColor3d(_red, _green, _blue);
} }
void Render_opengl::draw_text(const Element_pos x, const Element_pos y, const Element_pos, const std::string s){ void Render_opengl::draw_text(const Element_pos x, const Element_pos y, const Element_pos, const std::string s){
if (_draw_ruler) return;/* do not draw text for ruler */ if (_draw_ruler) return;/* do not draw text for ruler */
if (_draw_state) message << "Fatal error! Cannot put text in state lists!" << Message::ende;
Container_text_ buf; Container_text_ buf;
...@@ -677,9 +649,9 @@ void Render_opengl::draw_text(const Element_pos x, const Element_pos y, const El ...@@ -677,9 +649,9 @@ void Render_opengl::draw_text(const Element_pos x, const Element_pos y, const El
} }
void Render_opengl::draw_quad(Element_pos x, Element_pos y, Element_pos z, Element_pos w, Element_pos h){ void Render_opengl::draw_quad(Element_pos x, Element_pos y, Element_pos /*z*/, Element_pos w, Element_pos h){
Element_pos offset_x; Element_pos offset_x;
const Element_pos offset_y = -_ruler_y - _ruler_height; Element_pos offset_y = -_ruler_y - _ruler_height;
offset_x = 0; offset_x = 0;
...@@ -689,11 +661,11 @@ void Render_opengl::draw_quad(Element_pos x, Element_pos y, Element_pos z, Eleme ...@@ -689,11 +661,11 @@ void Render_opengl::draw_quad(Element_pos x, Element_pos y, Element_pos z, Eleme
glBegin(GL_QUADS); glBegin(GL_QUADS);
{ {
glColor3d(_red, _green, _blue); glColor3d(_red, _green, _blue);
glVertex3d(x + offset_x , y + offset_y , z ); glVertex2d(x + offset_x , y + offset_y);
glVertex3d(x + offset_x , y + h + offset_y, z ); glVertex2d(x + offset_x , y + h + offset_y);
glColor3d(_red/1.5 , _green/1.5 , _blue/1.5); glColor3d(_red/1.5 , _green/1.5 , _blue/1.5);
glVertex3d(x + w + offset_x, y + h + offset_y, z ); glVertex2d(x + w + offset_x, y + h + offset_y);
glVertex3d(x + w + offset_x, y + offset_y , z ); glVertex2d(x + w + offset_x, y + offset_y);
} }
glEnd(); glEnd();
} }
...@@ -704,7 +676,7 @@ void Render_opengl::draw_triangle(Element_pos , Element_pos , ...@@ -704,7 +676,7 @@ void Render_opengl::draw_triangle(Element_pos , Element_pos ,
void Render_opengl::draw_line(Element_pos x1, Element_pos y1, Element_pos x2, Element_pos y2, Element_pos z){ void Render_opengl::draw_line(Element_pos x1, Element_pos y1, Element_pos x2, Element_pos y2, Element_pos z){
if (_draw_ruler || _draw_arrow || _draw_event) return;/* do not draw line for ruler or for arrow or for event */ if (_draw_ruler || _draw_arrow || _draw_event) return;/* do not draw line for ruler or for arrow or for event */
if (_draw_state) message << "Fatal error! Cannot put line in state lists!" << Message::ende;