2 Copyright (C) 2003 Reed Mideke.
4 This file is part of GtkRadiant.
6 GtkRadiant is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 GtkRadiant 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 GtkRadiant; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 // Code by reyalP aka Reed Mideke
26 // Based on spritemodel source code by hydra
31 class CBackgroundImage {
36 // which components of a vec3_t correspond to x and y in the image
40 CBackgroundImage( VIEWTYPE vt );
41 // ~CBackgroundImage();
43 float m_alpha; // vertex alpha
46 // x and y axis are in relation to the screen, not world, making rendering
47 // the same for each view type. Whoever sets them is responsible for
49 // units are world units.
50 // TODO should be private
51 float m_xmin,m_ymin,m_xmax,m_ymax;
53 // load file, create new tex, cleanup old tex, set new tex
54 bool Load( const char *filename );
55 void Cleanup(); // free texture, free tex, set make tex NULL
56 bool SetExtentsMM(); // set extents by ET mapcoordsmaxs/mapcoordsmins
57 bool SetExtentsSel(); // set extents by selection
59 bool Valid() { return ( m_tex && ( m_xmin != m_xmax ) && ( m_ymin != m_ymax ) ); }
62 class CBackgroundRender : public IGL2DWindow {
66 virtual ~CBackgroundRender();
73 // IGL2DWindow IGL3DWindow interface
74 void IncRef() { refCount++; }
76 refCount--; if ( refCount <= 0 ) {
80 void Draw2D( VIEWTYPE vt );
84 extern CBackgroundImage backgroundXY,backgroundXZ,backgroundYZ;
85 extern CBackgroundRender render;