2 Copyright (C) 1999-2007 id Software, Inc. and contributors.
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
5 This file is part of GtkRadiant.
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 // Code by reyalP aka Reed Mideke
27 // Based on spritemodel source code by hydra
32 class CBackgroundImage {
37 // which components of a vec3_t correspond to x and y in the image
41 CBackgroundImage( VIEWTYPE vt );
42 // ~CBackgroundImage();
44 float m_alpha; // vertex alpha
47 // x and y axis are in relation to the screen, not world, making rendering
48 // the same for each view type. Whoever sets them is responsible for
50 // units are world units.
51 // TODO should be private
52 float m_xmin,m_ymin,m_xmax,m_ymax;
54 // load file, create new tex, cleanup old tex, set new tex
55 bool Load( const char *filename );
56 void Cleanup(); // free texture, free tex, set make tex NULL
57 bool SetExtentsMM(); // set extents by ET mapcoordsmaxs/mapcoordsmins
58 bool SetExtentsSel(); // set extents by selection
60 bool Valid() { return ( m_tex && ( m_xmin != m_xmax ) && ( m_ymin != m_ymax ) ); }
63 class CBackgroundRender : public IGL2DWindow {
67 virtual ~CBackgroundRender();
74 // IGL2DWindow IGL3DWindow interface
75 void IncRef() { refCount++; }
77 refCount--; if ( refCount <= 0 ) {
81 void Draw2D( VIEWTYPE vt );
85 extern CBackgroundImage backgroundXY,backgroundXZ,backgroundYZ;
86 extern CBackgroundRender render;