00001 /************************************************************************ 00002 filename: CEGUIRenderer.cpp 00003 created: 20/2/2004 00004 author: Paul D Turner 00005 00006 purpose: Some base class implementation for Renderer objects 00007 *************************************************************************/ 00008 /************************************************************************* 00009 Crazy Eddie's GUI System (http://www.cegui.org.uk) 00010 Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk) 00011 00012 This library is free software; you can redistribute it and/or 00013 modify it under the terms of the GNU Lesser General Public 00014 License as published by the Free Software Foundation; either 00015 version 2.1 of the License, or (at your option) any later version. 00016 00017 This library is distributed in the hope that it will be useful, 00018 but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00020 Lesser General Public License for more details. 00021 00022 You should have received a copy of the GNU Lesser General Public 00023 License along with this library; if not, write to the Free Software 00024 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00025 *************************************************************************/ 00026 #include "CEGUIRenderer.h" 00027 #include "CEGUIEventSet.h" 00028 #include "CEGUIEvent.h" 00029 #include "CEGUIDefaultResourceProvider.h" 00030 00031 00032 // Start of CEGUI namespace section 00033 namespace CEGUI 00034 { 00035 const String Renderer::EventNamespace("Renderer"); 00036 00037 /************************************************************************* 00038 Event name constants (static data definitions) 00039 *************************************************************************/ 00040 const String Renderer::EventDisplaySizeChanged( (utf8*)"DisplayModeChanged" ); 00041 00042 00043 /************************************************************************* 00044 Implementation constants 00045 *************************************************************************/ 00046 const float Renderer::GuiZInitialValue = 1.0f; 00047 const float Renderer::GuiZElementStep = 0.001f; // this is enough for 1000 Windows. 00048 const float Renderer::GuiZLayerStep = 0.0001f; // provides space for 10 layers per Window. 00049 00050 00051 /************************************************************************* 00052 Constructor 00053 *************************************************************************/ 00054 Renderer::Renderer(void) 00055 : d_resourceProvider(0) 00056 { 00057 // setup standard events available 00058 addEvent(EventDisplaySizeChanged); 00059 00060 // default initialisation 00061 resetZValue(); 00062 } 00063 00064 /************************************************************************* 00065 Destructor 00066 *************************************************************************/ 00067 Renderer::~Renderer(void) 00068 { 00069 if(d_resourceProvider) 00070 { 00071 delete d_resourceProvider; 00072 d_resourceProvider = 0; 00073 } 00074 } 00075 00076 ResourceProvider* Renderer::createResourceProvider(void) 00077 { 00078 d_resourceProvider = new DefaultResourceProvider(); 00079 return d_resourceProvider; 00080 } 00081 00082 } // End of CEGUI namespace section