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