00001 00005 /* Copyright © 2009, 2010 James Legg. 00006 This program is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 */ 00011 #ifndef DRAWABLEMESH_H_ 00012 #define DRAWABLEMESH_H_ 00013 00014 #include <boost/shared_ptr.hpp> 00015 00016 #include "../AABBDrawable.h" 00017 #include "MeshFaces.h" 00018 00019 namespace Track 00020 { 00021 00026 class DrawableMesh : public AABBDrawable, public MeshFaces 00027 { 00028 public: 00030 enum RenderMode {RM_WIREFRAME , 00031 RM_SOLID }; 00040 DrawableMesh(std::istream & source, RenderMode render_mode = RM_SOLID); 00041 00048 DrawableMesh(std::string filename, RenderMode render_mode = RM_SOLID); 00049 00055 DrawableMesh(const MeshFaces & mesh, RenderMode render_mode = RM_SOLID); 00056 00061 DrawableMesh(RenderMode render_mode = RM_SOLID); 00062 00063 virtual ~DrawableMesh(); 00064 00070 virtual void draw() const; 00071 00078 virtual void make_cache() const; 00079 00087 void set_render_mode(RenderMode new_render_mode); 00088 protected: 00090 mutable unsigned int display_list; 00091 00095 mutable boost::shared_ptr<unsigned int> list_handle; 00096 00103 static void delete_list(unsigned int * display_list); 00108 unsigned int * make_list() const; 00109 00111 RenderMode render_mode; 00112 }; 00113 00114 } 00115 00116 #endif /*DRAWABLEMESH_H_*/
Generated at Mon Sep 6 00:41:11 2010 by Doxygen version 1.4.7 for Racer version svn335.