Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51206 - in sandbox-branches/andreo/guigl: boost/guigl boost/guigl/platform/impl libs/guigl/build/vc8ide libs/guigl/example libs/guigl/src/widget
From: andreytorba_at_[hidden]
Date: 2009-02-11 14:08:59


Author: andreo
Date: 2009-02-11 14:08:58 EST (Wed, 11 Feb 2009)
New Revision: 51206
URL: http://svn.boost.org/trac/boost/changeset/51206

Log:
gl, glut wrappers
Added:
   sandbox-branches/andreo/guigl/boost/guigl/gl.hpp (contents, props changed)
   sandbox-branches/andreo/guigl/boost/guigl/platform/impl/
   sandbox-branches/andreo/guigl/boost/guigl/platform/impl/color.hpp (contents, props changed)
   sandbox-branches/andreo/guigl/boost/guigl/platform/impl/glut.hpp (contents, props changed)
   sandbox-branches/andreo/guigl/boost/guigl/platform/impl/rect.hpp (contents, props changed)
   sandbox-branches/andreo/guigl/boost/guigl/platform/impl/transform.hpp (contents, props changed)
   sandbox-branches/andreo/guigl/boost/guigl/platform/impl/vertex.hpp (contents, props changed)
Text files modified:
   sandbox-branches/andreo/guigl/libs/guigl/build/vc8ide/build.vcproj | 30 +++++++++++++++++++++++++++++-
   sandbox-branches/andreo/guigl/libs/guigl/example/custom_example.cpp | 8 ++++++--
   sandbox-branches/andreo/guigl/libs/guigl/example/two_spheres.cpp | 16 +++++++++++++---
   sandbox-branches/andreo/guigl/libs/guigl/src/widget/button.cpp | 3 ++-
   sandbox-branches/andreo/guigl/libs/guigl/src/widget/slider.cpp | 3 ++-
   5 files changed, 52 insertions(+), 8 deletions(-)

Added: sandbox-branches/andreo/guigl/boost/guigl/gl.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/andreo/guigl/boost/guigl/gl.hpp 2009-02-11 14:08:58 EST (Wed, 11 Feb 2009)
@@ -0,0 +1,142 @@
+#ifndef BOOST__GUIGL__GL_HPP
+#define BOOST__GUIGL__GL_HPP
+
+#include <boost/array.hpp>
+#include <boost/noncopyable.hpp>
+#include <boost/guigl/platform/opengl.hpp>
+#include <boost/guigl/platform/glut.hpp>
+
+namespace boost{ namespace guigl { namespace gl {
+
+ //////////////////////////////////////////////////////////////////////////
+ template<class T>
+ void vertex(T x, T y);
+
+ template<class T>
+ void vertex(T x, T y, T z);
+
+ template<class T>
+ void vertex(T x, T y, T z, T w);
+
+ template<class T>
+ void vertex2(T const* const);
+
+ template<class T>
+ void vertex3(T const* const);
+
+ template<class T>
+ void vertex4(T const* const);
+
+ template<class T>
+ void vertex(boost::array<T, 2> const& a);
+
+ template<class T>
+ void vertex(boost::array<T, 3> const& a);
+
+ template<class T>
+ void vertex(boost::array<T, 4> const& a);
+
+ //////////////////////////////////////////////////////////////////////////
+ template<class T>
+ void color(T r, T g, T b);
+
+ template<class T>
+ void color(T r, T g, T b, T a);
+
+ template<class T>
+ void color3(T const* const v);
+
+ template<class T>
+ void color4(T const* const v);
+
+ template<class T>
+ void color(boost::array<T, 3> const& a);
+
+ template<class T>
+ void color(boost::array<T, 4> const& a);
+
+ //////////////////////////////////////////////////////////////////////////
+ template<class T>
+ void rect(T x1, T y1, T x2, T y2);
+
+ template<class T>
+ void rect(T const* v1, T const* v2);
+
+ template<class T>
+ void rect(boost::array<T, 2> const& pt1, boost::array<T, 2> const& pt2);
+
+ ////////////////////////////////////////////////////////////////////////////////
+ struct scoped_matrix : boost::noncopyable
+ {
+ scoped_matrix();
+ ~scoped_matrix();
+ };
+
+ ////////////////////////////////////////////////////////////////////////////////
+ template<class T>
+ void rotate(T angle, T x, T y, T z);
+
+ template<class T>
+ void rotate_x(T angle);
+
+ template<class T>
+ void rotate_y(T angle);
+
+ template<class T>
+ void rotate_z(T angle);
+
+ ////////////////////////////////////////////////////////////////////////////////
+ template<class T>
+ void scale(T x, T y, T z);
+
+ template<class T>
+ void scale_x(T x);
+
+ template<class T>
+ void scale_y(T y);
+
+ template<class T>
+ void scale_z(T z);
+
+ ////////////////////////////////////////////////////////////////////////////////
+ template<class T>
+ void translate(T x, T y, T z);
+
+ template<class T>
+ void translate_x(T x);
+
+ template<class T>
+ void translate_y(T y);
+
+ template<class T>
+ void translate_z(T z);
+
+ //////////////////////////////////////////////////////////////////////////
+ void wired_cube(GLdouble size);
+ void solid_cube(GLdouble size);
+ void wire_sphere(GLdouble radius, GLint slices, GLint stacks);
+ void solid_sphere(GLdouble radius, GLint slices, GLint stacks);
+ void wire_cone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
+ void solid_cone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
+ void wire_torus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
+ void solid_torus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
+ void wire_dodecahedron();
+ void solid_dodecahedron();
+ void wire_octahedron();
+ void solid_octahedron();
+ void wire_tetrahedron();
+ void solid_tetrahedron();
+ void wire_icosahedron();
+ void solid_icosahedron();
+ void wire_teapot(GLdouble size);
+ void solid_teapot(GLdouble size);
+
+}}}
+
+#include "platform/impl/vertex.hpp"
+#include "platform/impl/color.hpp"
+#include "platform/impl/rect.hpp"
+#include "platform/impl/transform.hpp"
+#include "platform/impl/glut.hpp"
+
+#endif BOOST__GUIGL__GL_HPP

Added: sandbox-branches/andreo/guigl/boost/guigl/platform/impl/color.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/andreo/guigl/boost/guigl/platform/impl/color.hpp 2009-02-11 14:08:58 EST (Wed, 11 Feb 2009)
@@ -0,0 +1,102 @@
+#ifndef BOOST__GUIGL__GL__COLOR_HPP
+#define BOOST__GUIGL__GL__COLOR_HPP
+
+namespace boost{ namespace guigl { namespace gl {
+
+ //////////////////////////////////////////////////////////////////////////
+# define BOOST_GUIGL_GL_DECLARE(type_, pref_)\
+ template<>\
+ inline void color<type_>(type_ r, type_ g, type_ b)\
+ {\
+ glColor3##pref_(r, g, b);\
+ }
+
+ BOOST_GUIGL_GL_DECLARE(GLbyte, b);
+ BOOST_GUIGL_GL_DECLARE(GLdouble, d);
+ BOOST_GUIGL_GL_DECLARE(GLfloat, f);
+ BOOST_GUIGL_GL_DECLARE(GLint, i);
+ BOOST_GUIGL_GL_DECLARE(GLshort, s);
+ BOOST_GUIGL_GL_DECLARE(GLubyte, ub);
+ BOOST_GUIGL_GL_DECLARE(GLuint, ui);
+ BOOST_GUIGL_GL_DECLARE(GLushort, us);
+
+# undef BOOST_GUIGL_GL_DECLARE
+
+ //////////////////////////////////////////////////////////////////////////
+# define BOOST_GUIGL_GL_DECLARE(type_, pref_)\
+ template<>\
+ inline void color<type_>(type_ r, type_ g, type_ b, type_ a)\
+ {\
+ glColor4##pref_(r, g, b, a);\
+ }
+
+ BOOST_GUIGL_GL_DECLARE(GLbyte, b);
+ BOOST_GUIGL_GL_DECLARE(GLdouble, d);
+ BOOST_GUIGL_GL_DECLARE(GLfloat, f);
+ BOOST_GUIGL_GL_DECLARE(GLint, i);
+ BOOST_GUIGL_GL_DECLARE(GLshort, s);
+ BOOST_GUIGL_GL_DECLARE(GLubyte, ub);
+ BOOST_GUIGL_GL_DECLARE(GLuint, ui);
+ BOOST_GUIGL_GL_DECLARE(GLushort, us);
+
+# undef BOOST_GUIGL_GL_DECLARE
+
+ //////////////////////////////////////////////////////////////////////////
+# define BOOST_GUIGL_GL_DECLARE(type_, pref_, dimension_)\
+ template<>\
+ inline void color##dimension_<type_>(type_ const* const v)\
+ {\
+ glColor##dimension_##pref_##v(v);\
+ }
+
+ BOOST_GUIGL_GL_DECLARE(GLbyte, b, 3);
+ BOOST_GUIGL_GL_DECLARE(GLdouble, d, 3);
+ BOOST_GUIGL_GL_DECLARE(GLfloat, f, 3);
+ BOOST_GUIGL_GL_DECLARE(GLint, i, 3);
+ BOOST_GUIGL_GL_DECLARE(GLshort, s, 3);
+ BOOST_GUIGL_GL_DECLARE(GLubyte, ub, 3);
+ BOOST_GUIGL_GL_DECLARE(GLuint, ui, 3);
+ BOOST_GUIGL_GL_DECLARE(GLushort, us, 3);
+
+ BOOST_GUIGL_GL_DECLARE(GLbyte, b, 4);
+ BOOST_GUIGL_GL_DECLARE(GLdouble, d, 4);
+ BOOST_GUIGL_GL_DECLARE(GLfloat, f, 4);
+ BOOST_GUIGL_GL_DECLARE(GLint, i, 4);
+ BOOST_GUIGL_GL_DECLARE(GLshort, s, 4);
+ BOOST_GUIGL_GL_DECLARE(GLubyte, ub, 4);
+ BOOST_GUIGL_GL_DECLARE(GLuint, ui, 4);
+ BOOST_GUIGL_GL_DECLARE(GLushort, us, 4);
+
+# undef BOOST_GUIGL_GL_DECLARE
+
+ //////////////////////////////////////////////////////////////////////////
+# define BOOST_GUIGL_GL_DECLARE(type_, pref_, dimension_)\
+ template<>\
+ inline void color<type_>(boost::array<type_, dimension_> const& a)\
+ {\
+ color##dimension_(&a[0]);\
+ }
+
+ BOOST_GUIGL_GL_DECLARE(GLbyte, b, 3);
+ BOOST_GUIGL_GL_DECLARE(GLdouble, d, 3);
+ BOOST_GUIGL_GL_DECLARE(GLfloat, f, 3);
+ BOOST_GUIGL_GL_DECLARE(GLint, i, 3);
+ BOOST_GUIGL_GL_DECLARE(GLshort, s, 3);
+ BOOST_GUIGL_GL_DECLARE(GLubyte, ub, 3);
+ BOOST_GUIGL_GL_DECLARE(GLuint, ui, 3);
+ BOOST_GUIGL_GL_DECLARE(GLushort, us, 3);
+
+ BOOST_GUIGL_GL_DECLARE(GLbyte, b, 4);
+ BOOST_GUIGL_GL_DECLARE(GLdouble, d, 4);
+ BOOST_GUIGL_GL_DECLARE(GLfloat, f, 4);
+ BOOST_GUIGL_GL_DECLARE(GLint, i, 4);
+ BOOST_GUIGL_GL_DECLARE(GLshort, s, 4);
+ BOOST_GUIGL_GL_DECLARE(GLubyte, ub, 4);
+ BOOST_GUIGL_GL_DECLARE(GLuint, ui, 4);
+ BOOST_GUIGL_GL_DECLARE(GLushort, us, 4);
+
+# undef BOOST_GUIGL_GL_DECLARE
+
+}}}
+
+#endif BOOST__GUIGL__GL__COLOR_HPP

Added: sandbox-branches/andreo/guigl/boost/guigl/platform/impl/glut.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/andreo/guigl/boost/guigl/platform/impl/glut.hpp 2009-02-11 14:08:58 EST (Wed, 11 Feb 2009)
@@ -0,0 +1,100 @@
+#ifndef BOOST__GUIGL__GL__GLUT_HPP
+#define BOOST__GUIGL__GL__GLUT_HPP
+
+#include <boost/noncopyable.hpp>
+
+namespace boost{ namespace guigl { namespace gl {
+
+ inline void wire_cube(GLdouble size)
+ {
+ glutWireCube(size);
+ }
+
+ inline void solid_cube(GLdouble size)
+ {
+ glutSolidCube(size);
+ }
+
+ inline void wire_sphere(GLdouble radius, GLint slices, GLint stacks)
+ {
+ glutWireSphere(radius, slices, stacks);
+ }
+
+ inline void solid_sphere(GLdouble radius, GLint slices, GLint stacks)
+ {
+ glutSolidSphere(radius, slices, stacks);
+ }
+
+ inline void wire_cone(GLdouble base, GLdouble height, GLint slices, GLint stacks)
+ {
+ glutWireCone(base, height, slices, stacks);
+ }
+
+ inline void solid_cone(GLdouble base, GLdouble height, GLint slices, GLint stacks)
+ {
+ glutSolidCone(base, height, slices, stacks);
+ }
+
+ inline void wire_torus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings)
+ {
+ glutWireTorus(innerRadius, outerRadius, sides, rings);
+ }
+
+ inline void solid_torus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings)
+ {
+ glutSolidTorus(innerRadius, outerRadius, sides, rings);
+ }
+
+ inline void wire_dodecahedron()
+ {
+ glutWireDodecahedron();
+ }
+
+ inline void solid_dodecahedron()
+ {
+ glutSolidDodecahedron();
+ }
+
+ inline void wire_octahedron()
+ {
+ glutWireOctahedron();
+ }
+
+ inline void solid_octahedron()
+ {
+ glutSolidOctahedron();
+ }
+
+ inline void wire_tetrahedron()
+ {
+ glutWireTetrahedron();
+ }
+
+ inline void solid_tetrahedron()
+ {
+ glutSolidTetrahedron();
+ }
+
+ inline void wire_icosahedron()
+ {
+ glutWireIcosahedron();
+ }
+
+ inline void solid_icosahedron()
+ {
+ glutSolidIcosahedron();
+ }
+
+ inline void wire_teapot(GLdouble size)
+ {
+ glutWireTeapot(size);
+ }
+
+ inline void solid_teapot(GLdouble size)
+ {
+ glutSolidTeapot(size);
+ }
+
+}}}
+
+#endif

Added: sandbox-branches/andreo/guigl/boost/guigl/platform/impl/rect.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/andreo/guigl/boost/guigl/platform/impl/rect.hpp 2009-02-11 14:08:58 EST (Wed, 11 Feb 2009)
@@ -0,0 +1,51 @@
+#ifndef BOOST__GUIGL__GL__RECT_HPP
+#define BOOST__GUIGL__GL__RECT_HPP
+
+namespace boost{ namespace guigl { namespace gl {
+
+# define BOOST_GUIGL_GL_DECLARE(type_, pref_)\
+ template<>\
+ inline void rect<type_>(type_ x1, type_ y1, type_ x2, type_ y2)\
+ {\
+ glRect##pref_(x1, y1, x2, y2);\
+ }
+
+ BOOST_GUIGL_GL_DECLARE(GLdouble, d);
+ BOOST_GUIGL_GL_DECLARE(GLfloat, f);
+ BOOST_GUIGL_GL_DECLARE(GLint, i);
+ BOOST_GUIGL_GL_DECLARE(GLshort, s);
+# undef BOOST_GUIGL_GL_DECLARE
+
+# define BOOST_GUIGL_GL_DECLARE(type_, pref_)\
+ template<>\
+ inline void rect<type_>(type_ const* v1, type_ const* v2)\
+ {\
+ glRect##pref_##v(v1, v2);\
+ }
+
+ BOOST_GUIGL_GL_DECLARE(GLdouble, d);
+ BOOST_GUIGL_GL_DECLARE(GLfloat, f);
+ BOOST_GUIGL_GL_DECLARE(GLint, i);
+ BOOST_GUIGL_GL_DECLARE(GLshort, s);
+
+# undef BOOST_GUIGL_GL_DECLARE
+
+# define BOOST_GUIGL_GL_DECLARE(type_, pref_)\
+ template<>\
+ inline void rect<type_>(\
+ boost::array<type_, 2> const& pt1,\
+ boost::array<type_, 2> const& pt2)\
+ {\
+ rect(&pt1[0], &pt2[0]);\
+ }
+
+ BOOST_GUIGL_GL_DECLARE(GLdouble, d);
+ BOOST_GUIGL_GL_DECLARE(GLfloat, f);
+ BOOST_GUIGL_GL_DECLARE(GLint, i);
+ BOOST_GUIGL_GL_DECLARE(GLshort, s);
+
+# undef BOOST_GUIGL_GL_DECLARE
+
+}}}
+
+#endif BOOST__GUIGL__GL__RECT_HPP

Added: sandbox-branches/andreo/guigl/boost/guigl/platform/impl/transform.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/andreo/guigl/boost/guigl/platform/impl/transform.hpp 2009-02-11 14:08:58 EST (Wed, 11 Feb 2009)
@@ -0,0 +1,171 @@
+#ifndef BOOST__GUIGL__GL__TRANSFORM_HPP
+#define BOOST__GUIGL__GL__TRANSFORM_HPP
+
+#include <boost/noncopyable.hpp>
+
+namespace boost{ namespace guigl { namespace gl {
+
+ inline void push_matrix()
+ {
+ glPushMatrix();
+ }
+
+ inline void pop_matrix()
+ {
+ glPopMatrix();
+ }
+
+ inline scoped_matrix::scoped_matrix() {push_matrix();}
+ inline scoped_matrix::~scoped_matrix() {pop_matrix();}
+
+ ////////////////////////////////////////////////////////////////////////////////
+ template<>
+ inline void rotate<GLdouble>(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
+ {
+ glRotated(angle, x, y, z);
+ }
+
+ template<>
+ inline void rotate<GLfloat>(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
+ {
+ glRotatef(angle, x, y, z);
+ }
+
+ template<>
+ inline void rotate_x<GLdouble>(GLdouble angle)
+ {
+ rotate(angle, 1.0, 0.0, 0.0);
+ }
+
+ template<>
+ inline void rotate_y<GLdouble>(GLdouble angle)
+ {
+ rotate(angle, 0.0, 0.1, 0.0);
+ }
+
+ template<>
+ inline void rotate_z<GLdouble>(GLdouble angle)
+ {
+ rotate(angle, 0.0, 0.0, 0.1);
+ }
+
+ template<>
+ inline void rotate_x<GLfloat>(GLfloat angle)
+ {
+ rotate(angle, 1.0f, 0.0f, 0.0f);
+ }
+
+ template<>
+ inline void rotate_y<GLfloat>(GLfloat angle)
+ {
+ rotate(angle, 0.0f, 0.1f, 0.0f);
+ }
+
+ template<>
+ inline void rotate_z<GLfloat>(GLfloat angle)
+ {
+ rotate(angle, 0.0f, 0.0f, 0.1f);
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////////
+ template<>
+ inline void scale<GLdouble>(GLdouble x, GLdouble y, GLdouble z)
+ {
+ glScaled(x, y, z);
+ }
+
+ template<>
+ inline void scale<GLfloat>(GLfloat x, GLfloat y, GLfloat z)
+ {
+ glScalef(x, y, z);
+ }
+
+ template<>
+ inline void scale_x<GLdouble>(GLdouble x)
+ {
+ scale(x, 1.0, 1.0);
+ }
+
+ template<>
+ inline void scale_y<GLdouble>(GLdouble y)
+ {
+ scale(1.0, y, 1.0);
+ }
+
+ template<>
+ inline void scale_z<GLdouble>(GLdouble z)
+ {
+ scale(1.0, 1.0, z);
+ }
+
+ template<>
+ inline void scale_x<GLfloat>(GLfloat x)
+ {
+ scale(x, 1.0f, 1.0f);
+ }
+
+ template<>
+ inline void scale_y<GLfloat>(GLfloat y)
+ {
+ scale(1.0f, y, 1.0f);
+ }
+
+ template<>
+ inline void scale_z<GLfloat>(GLfloat z)
+ {
+ scale(1.0f, 1.0f, z);
+ }
+
+ ////////////////////////////////////////////////////////////////////////////////
+ template<>
+ inline void translate<GLdouble>(GLdouble x, GLdouble y, GLdouble z)
+ {
+ glTranslated(x, y, z);
+ }
+
+ template<>
+ inline void translate<GLfloat>(GLfloat x, GLfloat y, GLfloat z)
+ {
+ glTranslatef(x, y, z);
+ }
+
+ template<>
+ inline void translate_x<GLdouble>(GLdouble x)
+ {
+ translate(x, 0.0, 0.0);
+ }
+
+ template<>
+ inline void translate_y<GLdouble>(GLdouble y)
+ {
+ translate(0.0, y, 0.0);
+ }
+
+ template<>
+ inline void translate_z<GLdouble>(GLdouble z)
+ {
+ translate(0.0, 0.0, z);
+ }
+
+ template<>
+ inline void translate_x<GLfloat>(GLfloat x)
+ {
+ translate(x, 0.0f, 0.0f);
+ }
+
+ template<>
+ inline void translate_y<GLfloat>(GLfloat y)
+ {
+ translate(0.0f, y, 0.0f);
+ }
+
+ template<>
+ inline void translate_z<GLfloat>(GLfloat z)
+ {
+ translate(0.0f, 0.0f, z);
+ }
+
+}}}
+
+#endif // BOOST__GUIGL__GL__TRANSFORM_HPP

Added: sandbox-branches/andreo/guigl/boost/guigl/platform/impl/vertex.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/andreo/guigl/boost/guigl/platform/impl/vertex.hpp 2009-02-11 14:08:58 EST (Wed, 11 Feb 2009)
@@ -0,0 +1,98 @@
+#ifndef BOOST__GUIGL__GL__VERTEX_HPP
+#define BOOST__GUIGL__GL__VERTEX_HPP
+
+namespace boost { namespace guigl { namespace gl {
+
+ //////////////////////////////////////////////////////////////////////////
+# define BOOST_GUIGL_GL_DECLARE(type_, pref_)\
+ template<>\
+ inline void vertex<type_>(type_ x, type_ y)\
+ {\
+ glVertex2##pref_(x, y);\
+ }
+
+ BOOST_GUIGL_GL_DECLARE(GLdouble, d);
+ BOOST_GUIGL_GL_DECLARE(GLfloat, f);
+ BOOST_GUIGL_GL_DECLARE(GLint, i);
+ BOOST_GUIGL_GL_DECLARE(GLshort, s);
+# undef BOOST_GUIGL_GL_DECLARE
+
+ //////////////////////////////////////////////////////////////////////////
+# define BOOST_GUIGL_GL_DECLARE(type_, pref_)\
+ template<>\
+ inline void vertex<type_>(type_ x, type_ y, type_ z)\
+ {\
+ glVertex3##pref_(x, y, z);\
+ }
+
+ BOOST_GUIGL_GL_DECLARE(GLdouble, d);
+ BOOST_GUIGL_GL_DECLARE(GLfloat, f);
+ BOOST_GUIGL_GL_DECLARE(GLint, i);
+ BOOST_GUIGL_GL_DECLARE(GLshort, s);
+# undef BOOST_GUIGL_GL_DECLARE
+
+ //////////////////////////////////////////////////////////////////////////
+# define BOOST_GUIGL_GL_DECLARE(type_, pref_)\
+ template<>\
+ inline void vertex<type_>(type_ x, type_ y, type_ z, type_ w)\
+ {\
+ glVertex4##pref_(x, y, z, w);\
+ }
+
+ BOOST_GUIGL_GL_DECLARE(GLdouble, d);
+ BOOST_GUIGL_GL_DECLARE(GLfloat, f);
+ BOOST_GUIGL_GL_DECLARE(GLint, i);
+ BOOST_GUIGL_GL_DECLARE(GLshort, s);
+# undef BOOST_GUIGL_GL_DECLARE
+
+ //////////////////////////////////////////////////////////////////////////
+# define BOOST_GUIGL_GL_DECLARE(type_, pref_, dimension_)\
+ template<>\
+ inline void vertex##dimension_<type_>(type_ const* const v)\
+ {\
+ glVertex##dimension_##pref_##v(v);\
+ }
+
+ BOOST_GUIGL_GL_DECLARE(GLdouble, d, 2);
+ BOOST_GUIGL_GL_DECLARE(GLfloat, f, 2);
+ BOOST_GUIGL_GL_DECLARE(GLint, i, 2);
+ BOOST_GUIGL_GL_DECLARE(GLshort, s, 2);
+
+ BOOST_GUIGL_GL_DECLARE(GLdouble, d, 3);
+ BOOST_GUIGL_GL_DECLARE(GLfloat, f, 3);
+ BOOST_GUIGL_GL_DECLARE(GLint, i, 3);
+ BOOST_GUIGL_GL_DECLARE(GLshort, s, 3);
+
+ BOOST_GUIGL_GL_DECLARE(GLdouble, d, 4);
+ BOOST_GUIGL_GL_DECLARE(GLfloat, f, 4);
+ BOOST_GUIGL_GL_DECLARE(GLint, i, 4);
+ BOOST_GUIGL_GL_DECLARE(GLshort, s, 4);
+# undef BOOST_GUIGL_GL_DECLARE
+
+ //////////////////////////////////////////////////////////////////////////
+# define BOOST_GUIGL_GL_DECLARE(type_, pref_, dimension_)\
+ template<>\
+ inline void vertex<type_>(boost::array<type_, dimension_> const& a)\
+ {\
+ vertex##dimension_(&a[0]);\
+ }
+
+ BOOST_GUIGL_GL_DECLARE(GLdouble, d, 2);
+ BOOST_GUIGL_GL_DECLARE(GLfloat, f, 2);
+ BOOST_GUIGL_GL_DECLARE(GLint, i, 2);
+ BOOST_GUIGL_GL_DECLARE(GLshort, s, 2);
+
+ BOOST_GUIGL_GL_DECLARE(GLdouble, d, 3);
+ BOOST_GUIGL_GL_DECLARE(GLfloat, f, 3);
+ BOOST_GUIGL_GL_DECLARE(GLint, i, 3);
+ BOOST_GUIGL_GL_DECLARE(GLshort, s, 3);
+
+ BOOST_GUIGL_GL_DECLARE(GLdouble, d, 4);
+ BOOST_GUIGL_GL_DECLARE(GLfloat, f, 4);
+ BOOST_GUIGL_GL_DECLARE(GLint, i, 4);
+ BOOST_GUIGL_GL_DECLARE(GLshort, s, 4);
+# undef BOOST_GUIGL_GL_DECLARE
+
+}}} // gl
+
+#endif BOOST__GUIGL__GL__VERTEX_HPP

Modified: sandbox-branches/andreo/guigl/libs/guigl/build/vc8ide/build.vcproj
==============================================================================
--- sandbox-branches/andreo/guigl/libs/guigl/build/vc8ide/build.vcproj (original)
+++ sandbox-branches/andreo/guigl/libs/guigl/build/vc8ide/build.vcproj 2009-02-11 14:08:58 EST (Wed, 11 Feb 2009)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="Windows-1252"?>
 <VisualStudioProject
         ProjectType="Visual C++"
- Version="8.00"
+ Version="8,00"
         Name="build"
         ProjectGUID="{96DD7085-0763-49FF-9986-0244D7B43704}"
>
@@ -88,6 +88,10 @@
                                 RelativePath="..\..\..\..\boost\guigl\export_symbols.hpp"
>
                         </File>
+ <File
+ RelativePath="..\..\..\..\boost\guigl\gl.hpp"
+ >
+ </File>
                         <Filter
                                 Name="component"
>
@@ -115,6 +119,30 @@
                                         RelativePath="..\..\..\../boost/guigl/platform/opengl.hpp"
>
                                 </File>
+ <Filter
+ Name="impl"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\guigl\platform\impl\color.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\guigl\platform\impl\glut.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\guigl\platform\impl\rect.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\guigl\platform\impl\transform.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\guigl\platform\impl\vertex.hpp"
+ >
+ </File>
+ </Filter>
                         </Filter>
                         <Filter
                                 Name="view"

Modified: sandbox-branches/andreo/guigl/libs/guigl/example/custom_example.cpp
==============================================================================
--- sandbox-branches/andreo/guigl/libs/guigl/example/custom_example.cpp (original)
+++ sandbox-branches/andreo/guigl/libs/guigl/example/custom_example.cpp 2009-02-11 14:08:58 EST (Wed, 11 Feb 2009)
@@ -13,12 +13,16 @@
 
 #include <boost/guigl/platform/opengl.hpp>
 
+#include <boost/guigl/gl.hpp>
+
 using namespace boost::guigl;
 
 void draw_stuff()
 {
- glColor3d(1.0, 0.0, 0.0);
- glRectd(0.0, 0.0, 50.0, 50.0);
+ using namespace boost::guigl::gl;
+
+ color(1.0, 0.0, 0.0);
+ rect(0.0, 0.0, 50.0, 50.0);
 }
 
 int main()

Modified: sandbox-branches/andreo/guigl/libs/guigl/example/two_spheres.cpp
==============================================================================
--- sandbox-branches/andreo/guigl/libs/guigl/example/two_spheres.cpp (original)
+++ sandbox-branches/andreo/guigl/libs/guigl/example/two_spheres.cpp 2009-02-11 14:08:58 EST (Wed, 11 Feb 2009)
@@ -15,18 +15,28 @@
 #include <boost/guigl/view/impl/solid_background.hpp>
 #include <boost/guigl/view/impl/three_dimensional.hpp>
 #include <boost/guigl/platform/glu.hpp>
+#include <boost/guigl/gl.hpp>
 
 #include <iostream>
 
 void two_spheres::draw_prologue()
 {
+ using namespace boost::guigl::gl;
+
     base_type::draw_prologue();
     glMatrixMode(GL_MODELVIEW);
     glLoadIdentity();
- gluSphere(static_cast<GLUquadric *>(sphere()), 10, 4, 4);
+
+ wire_sphere(20, 20, 20);
     glLoadIdentity();
- glTranslatef(50,50,50);
- gluSphere(static_cast<GLUquadric *>(sphere()), 10, 4, 4);
+ translate(50.f, 50.f, 50.f);
+ wire_sphere(20, 20, 20);
+
+ {
+ scoped_matrix m;
+ translate_x(-70.0f);
+ wire_teapot(20);
+ }
 }
 
 void two_spheres::draw()

Modified: sandbox-branches/andreo/guigl/libs/guigl/src/widget/button.cpp
==============================================================================
--- sandbox-branches/andreo/guigl/libs/guigl/src/widget/button.cpp (original)
+++ sandbox-branches/andreo/guigl/libs/guigl/src/widget/button.cpp 2009-02-11 14:08:58 EST (Wed, 11 Feb 2009)
@@ -13,6 +13,7 @@
 #include <boost/guigl/view/impl/clickable.hpp>
 #include <boost/guigl/view/impl/positioned.hpp>
 #include <boost/guigl/view/impl/solid_background.hpp>
+#include <boost/guigl/gl.hpp>
 
 namespace boost { namespace guigl { namespace widget {
 
@@ -24,7 +25,7 @@
     if(button_down())
     {
         use_active_color();
- glRectd(0,0,size().x, size().y);
+ gl::rect(0., 0., size().x, size().y);
     }
 }
 

Modified: sandbox-branches/andreo/guigl/libs/guigl/src/widget/slider.cpp
==============================================================================
--- sandbox-branches/andreo/guigl/libs/guigl/src/widget/slider.cpp (original)
+++ sandbox-branches/andreo/guigl/libs/guigl/src/widget/slider.cpp 2009-02-11 14:08:58 EST (Wed, 11 Feb 2009)
@@ -13,6 +13,7 @@
 #include <boost/guigl/view/impl/positioned.hpp>
 #include <boost/guigl/view/impl/solid_background.hpp>
 #include <boost/guigl/view/impl/draggable.hpp>
+#include <boost/guigl/gl.hpp>
 #include <iostream>
 #include <cmath>
 
@@ -25,7 +26,7 @@
     base_type::draw_prologue();
 
     use_active_color();
- glRectd(0,0,(m_value-m_min) * size().x / (m_max-m_min), size().y);
+ gl::rect(0.0, 0.0, (m_value-m_min) * size().x / (m_max-m_min), size().y);
 }
 
 void slider::draw_epilogue()


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