00001 //////////////////////////////////////////////////////////////////////////////// 00002 // Scorched3D (c) 2000-2009 00003 // 00004 // This file is part of Scorched3D. 00005 // 00006 // Scorched3D 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 2 of the License, or 00009 // (at your option) any later version. 00010 // 00011 // Scorched3D is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 // GNU General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU General Public License 00017 // along with Scorched3D; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 //////////////////////////////////////////////////////////////////////////////// 00020 00021 #if !defined(__INCLUDE_RenderTargetsh_INCLUDE__) 00022 #define __INCLUDE_RenderTargetsh_INCLUDE__ 00023 00024 #include <engine/GameStateI.h> 00025 #include <tankgraph/TankMenus.h> 00026 00027 class RenderTargets 00028 { 00029 public: 00030 static RenderTargets *instance(); 00031 00032 struct Renderer3D : public GameStateI 00033 { 00034 Renderer3D() : GameStateI("RenderTargets3D"), stepTime(0.0f) {} 00035 00036 // Inherited from GameStateI 00037 virtual void draw(const unsigned state); 00038 virtual void simulate(const unsigned state, float simTime); 00039 virtual void enterState(const unsigned state); 00040 00041 float stepTime; 00042 } render3D; 00043 struct Renderer2D : public GameStateI 00044 { 00045 Renderer2D() : GameStateI("RenderTargets2D") {} 00046 00047 // Inherited from GameStateI 00048 virtual void draw(const unsigned state); 00049 virtual void simulate(const unsigned state, float simTime); 00050 } render2D; 00051 00052 void shadowDraw(); 00053 00054 unsigned int getTreesDrawn() { return treesDrawn_; } 00055 unsigned int getTargetsDrawn() { return targetsDrawn_; } 00056 00057 friend struct Renderer3D; 00058 friend struct Renderer2D; 00059 protected: 00060 static RenderTargets *instance_; 00061 00062 unsigned int treesDrawn_, targetsDrawn_; 00063 TankMenus menus_; 00064 00065 void draw2d(); 00066 void draw(); 00067 00068 private: 00069 RenderTargets(); 00070 virtual ~RenderTargets(); 00071 }; 00072 00073 00074 #endif
1.5.3