Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51919 - in sandbox-branches/andreo/guigl: boost/guigl boost/guigl/view/impl libs/guigl/example
From: andreytorba_at_[hidden]
Date: 2009-03-22 20:12:49


Author: andreo
Date: 2009-03-22 20:12:47 EDT (Sun, 22 Mar 2009)
New Revision: 51919
URL: http://svn.boost.org/trac/boost/changeset/51919

Log:
color
Text files modified:
   sandbox-branches/andreo/guigl/boost/guigl/types.hpp | 2 +-
   sandbox-branches/andreo/guigl/boost/guigl/view/impl/active_colored.hpp | 4 ++--
   sandbox-branches/andreo/guigl/boost/guigl/view/impl/colored.hpp | 4 ++--
   sandbox-branches/andreo/guigl/boost/guigl/view/impl/solid_background.hpp | 8 ++++++--
   sandbox-branches/andreo/guigl/libs/guigl/example/two_buttons.hpp | 4 ++--
   sandbox-branches/andreo/guigl/libs/guigl/example/window_example.cpp | 21 +++++++++++----------
   6 files changed, 24 insertions(+), 19 deletions(-)

Modified: sandbox-branches/andreo/guigl/boost/guigl/types.hpp
==============================================================================
--- sandbox-branches/andreo/guigl/boost/guigl/types.hpp (original)
+++ sandbox-branches/andreo/guigl/boost/guigl/types.hpp 2009-03-22 20:12:47 EDT (Sun, 22 Mar 2009)
@@ -1,5 +1,5 @@
 /*=================================---------------------------------------------
- Copyright 2008 Stjepan Rajko
+ Copyright 2008,2009 Stjepan Rajko, Andrey Torba
   
     Distributed under the Boost Software License, Version 1.0.
     (See accompanying file LICENSE_1_0.txt or copy at

Modified: sandbox-branches/andreo/guigl/boost/guigl/view/impl/active_colored.hpp
==============================================================================
--- sandbox-branches/andreo/guigl/boost/guigl/view/impl/active_colored.hpp (original)
+++ sandbox-branches/andreo/guigl/boost/guigl/view/impl/active_colored.hpp 2009-03-22 20:12:47 EDT (Sun, 22 Mar 2009)
@@ -1,5 +1,5 @@
 /*=================================---------------------------------------------
- Copyright 2008 Stjepan Rajko
+ Copyright 2008,2009 Stjepan Rajko, Andrey Torba
   
     Distributed under the Boost Software License, Version 1.0.
     (See accompanying file LICENSE_1_0.txt or copy at
@@ -17,7 +17,7 @@
 template<typename BaseView>
 void active_colored<BaseView>::use_active_color()
 {
- glColor3d(m_active_color[0],m_active_color[1],m_active_color[2]);
+ glColor4f(m_active_color[0], m_active_color[1], m_active_color[2], m_active_color[3]);
 }
 
 }}}

Modified: sandbox-branches/andreo/guigl/boost/guigl/view/impl/colored.hpp
==============================================================================
--- sandbox-branches/andreo/guigl/boost/guigl/view/impl/colored.hpp (original)
+++ sandbox-branches/andreo/guigl/boost/guigl/view/impl/colored.hpp 2009-03-22 20:12:47 EDT (Sun, 22 Mar 2009)
@@ -1,5 +1,5 @@
 /*=================================---------------------------------------------
- Copyright 2008 Stjepan Rajko
+ Copyright 2008,2009 Stjepan Rajko, Andrey Torba
   
     Distributed under the Boost Software License, Version 1.0.
     (See accompanying file LICENSE_1_0.txt or copy at
@@ -19,7 +19,7 @@
 inline void colored<BaseView>::draw_prologue()
 {
     BaseView::draw_prologue();
- glColor3d(m_color[0], m_color[1], m_color[2]);
+ glColor4f(m_color[0], m_color[1], m_color[2], m_color[3]);
 }
 
 }}}

Modified: sandbox-branches/andreo/guigl/boost/guigl/view/impl/solid_background.hpp
==============================================================================
--- sandbox-branches/andreo/guigl/boost/guigl/view/impl/solid_background.hpp (original)
+++ sandbox-branches/andreo/guigl/boost/guigl/view/impl/solid_background.hpp 2009-03-22 20:12:47 EDT (Sun, 22 Mar 2009)
@@ -1,5 +1,5 @@
 /*=================================---------------------------------------------
- Copyright 2008 Stjepan Rajko
+ Copyright 2008,2009 Stjepan Rajko, Andrey Torba
   
     Distributed under the Boost Software License, Version 1.0.
     (See accompanying file LICENSE_1_0.txt or copy at
@@ -21,7 +21,11 @@
 inline void solid_background<BaseView>::draw_prologue()
 {
     BaseView::draw_prologue();
- glColor3d(m_background_color[0], m_background_color[1], m_background_color[2]);
+ glColor4f(
+ m_background_color[0],
+ m_background_color[1],
+ m_background_color[2],
+ m_background_color[3]);
     glRectd(0.0, 0.0, solid_background::size().x, solid_background::size().y);
 }
 

Modified: sandbox-branches/andreo/guigl/libs/guigl/example/two_buttons.hpp
==============================================================================
--- sandbox-branches/andreo/guigl/libs/guigl/example/two_buttons.hpp (original)
+++ sandbox-branches/andreo/guigl/libs/guigl/example/two_buttons.hpp 2009-03-22 20:12:47 EDT (Sun, 22 Mar 2009)
@@ -1,5 +1,5 @@
 /*=================================---------------------------------------------
- Copyright 2008 Stjepan Rajko
+ Copyright 2008,2009 Stjepan Rajko, Andrey Torba
   
     Distributed under the Boost Software License, Version 1.0.
     (See accompanying file LICENSE_1_0.txt or copy at
@@ -30,7 +30,7 @@
     template<typename Args>
     two_buttons(const Args &args)
         : base_type((args, boost::guigl::_children=boost::fusion::make_vector(
- boost::guigl::widget::labeled_button((boost::guigl::_label = "top button", boost::guigl::_background = boost::guigl::make_color(0.5,0.5,0.5))),
+ boost::guigl::widget::labeled_button((boost::guigl::_label = "top button", boost::guigl::_background = boost::guigl::grey())),
             boost::guigl::widget::labeled_button(boost::guigl::_label = "bottom button")
         ) ))
     {

Modified: sandbox-branches/andreo/guigl/libs/guigl/example/window_example.cpp
==============================================================================
--- sandbox-branches/andreo/guigl/libs/guigl/example/window_example.cpp (original)
+++ sandbox-branches/andreo/guigl/libs/guigl/example/window_example.cpp 2009-03-22 20:12:47 EDT (Sun, 22 Mar 2009)
@@ -1,5 +1,5 @@
 /*=================================---------------------------------------------
- Copyright 2007,2008 Stjepan Rajko
+ Copyright 2007,2008,2009 Stjepan Rajko, Andrey Torba
   
     Distributed under the Boost Software License, Version 1.0.
     (See accompanying file LICENSE_1_0.txt or copy at
@@ -13,6 +13,7 @@
 #include <boost/guigl/widget/label.hpp>
 #include <boost/guigl/widget/labeled_button.hpp>
 #include <boost/guigl/widget/labeled_slider.hpp>
+#include <boost/guigl/color.hpp>
 
 #include <boost/bind.hpp>
 #include <boost/bind/placeholders.hpp>
@@ -26,7 +27,7 @@
 
 color_type make_grey(double value)
 {
- return make_color((float)value, (float)value, (float)value);
+ return grey(static_cast<float>(value));
 }
 
 void idle()
@@ -56,15 +57,15 @@
     test_window1 << new widget::label((
         _label = "Label",
         _size=size_type(100,30),
- _background=make_color(1,1,1),
- _color=make_color(0,0,0) ));
+ _background = white(),
+ _color = black() ));
 
     widget::labeled_button *b1 = new widget::labeled_button((
         _size=size_type(100,30),
         _position=position_type(50, 50),
- _background=make_color(1,1,1),
- _active_color=make_color(1,0,0),
- _color=make_color(0,0,0),
+ _background = white(),
+ _active_color = red(),
+ _color = black(),
         _label="Button"));
     test_window1 << b1;
     
@@ -72,8 +73,8 @@
         _label="Slider",
         _size=size_type(100,30),
         _position=position_type(50,80),
- _background=make_color(0.5,0.5,0.5),
- _active_color=make_color(0,1,0),
+ _background = grey(),
+ _active_color = green(),
         _min=0.1,_max=0.9,_value=0.5,
         _step=0.1 ));
     test_window1 << s;
@@ -93,7 +94,7 @@
 
     layout::grid grid_layout(( _grid_size=test_window3.size(), _horizontal=3, _vertical=3 ));
     for(int i=1; i<=9; i++)
- test_window3 << grid_layout.create<widget::button>(( _background=make_color(1.0f/i,1.0f/i,1.0f/i) ));
+ test_window3 << grid_layout.create<widget::button>(( _background = make_color(1.0f/i, 1.0f/i, 1.0f/i, 1.0f) ));
     
     window test_window_3d(( _depth = true, _label="3D", _color=make_grey(1) ));
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk