/* Copyright 2005 Nicholas Bishop * * This file is part of SharpConstruct. * * SharpConstruct is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SharpConstruct is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with SharpConstruct; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ namespace SharpConstruct { class Mesh; class Buffer { public: Buffer( const unsigned ); ~Buffer(); void Create(); void Initialize( const unsigned, const unsigned, const unsigned ); void Initialize( const unsigned, const unsigned, const unsigned, const void* ); void Bind() const; unsigned Count() const; private: unsigned index_; const unsigned type_; unsigned count_; unsigned dsize_; }; class Output3D { public: virtual ~Output3D() {} virtual void Set( const Mesh&, const bool, const bool, const bool ) = 0; virtual void Draw() const = 0; }; class VAR : public Output3D { public: VAR(); static bool IsSupported(); virtual void Set( const Mesh&, const bool, const bool, const bool ); virtual void Draw() const; private: unsigned triangle_count_, quad_count_; const void* triangle_data_, * quad_data_; }; class VBO : public Output3D { public: VBO(); static bool IsSupported(); virtual void Set( const Mesh&, const bool, const bool, const bool ); virtual void Draw() const; private: void set_vert_norm_color_( const Mesh&, bool, bool ); void set_polygons_( const Mesh& ); Buffer vert_norm_color_; Buffer triangle_, quad_; }; }