From: Alex Schmidt Date: Wed, 20 Feb 2013 13:45:16 +0000 (+0100) Subject: implemented linewidth. X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/commitdiff_plain/c92e802f596346087ee22a76868654f40a199f6e implemented linewidth. --- diff --git a/culooks.cpp b/culooks.cpp index 647f7be..0d0ebf2 100644 --- a/culooks.cpp +++ b/culooks.cpp @@ -42,6 +42,8 @@ culooks::culooks (const char* name, const int& xcubes, const int& ycubes, const Win->initialized = false; + Win->linewidth = 1; + Windows.push_back( pair(0, Win) ); if (windowid == 0) { @@ -104,3 +106,8 @@ void culooks::setWireColor(const float& r, const float& g, const float& b, const for (int icube=0; icubecubes.size(); icube++) Windows[mywid].second->cubes[icube].setWireColor(r, g, b, a); } + +void culooks::setLineWidth(float width) +{ + Windows[mywid].second->linewidth = width; +} diff --git a/culooks.h b/culooks.h index 3e47fde..34466c1 100644 --- a/culooks.h +++ b/culooks.h @@ -28,6 +28,7 @@ class culooks void hideLinks(); void setBgColor(const float& red, const float& green, const float& blue, const float& alpha); void setWireColor(const float& r, const float& g, const float& b, const float& a); + void setLineWidth(float width); private: @@ -82,6 +83,7 @@ class culooks string name; float bgcolor[4]; bool redisplay; + float linewidth; }; class drawing diff --git a/culooks_drawing.cpp b/culooks_drawing.cpp index 65c7644..cab01b5 100644 --- a/culooks_drawing.cpp +++ b/culooks_drawing.cpp @@ -94,6 +94,8 @@ void culooks::drawing::displayFunc() { culooks::window *Win = getWin(); + glLineWidth(Win->linewidth); + glClearColor(Win->bgcolor[0], Win->bgcolor[1], Win->bgcolor[2], Win->bgcolor[3]); glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);