Commiting whatever state I got that gui data grid widget for archival and fond memori...
[fail.git] / src / scenegraph / Text.cpp
blobb02f1d9005e014b989be0f22499506c6dda0b768
1 /*
2 Fail game engine
3 Copyright 2007 Antoine Chavasse <a.chavasse@gmail.com>
5 This file is part of Fail.
7 Fail is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 3
9 as published by the Free Software Foundation.
11 Fail is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #include "scenegraph/Text.h"
20 #include "scenegraph/RenderPass.h"
22 using namespace fail;
23 using namespace fail::scenegraph;
25 Text::Text( Pointer< Font > pFont, Pointer< Frame > pFrame, Pointer< Material > pMaterial ) :
26 m_pFont( pFont ),
27 m_pMaterial( pMaterial ),
28 m_pFrame( pFrame ),
29 m_Clip( 0.f )
33 Text::Text( Pointer< Font > pFont, Pointer< Frame > pFrame, Pointer< Material > pMaterial,
34 const std::string& Text ) :
35 m_pFont( pFont ),
36 m_pMaterial( pMaterial ),
37 m_pFrame( pFrame ),
38 m_TextString( Text ),
39 m_Clip( 0.f )
43 void Text::evaluate( const Pointer< RenderPass >& pPass )
45 float z = m_pFrame->getLocalToWorld().position().z();
46 pPass->addText( this, z );