xoreos  0.0.5
kotordialogframe.cpp
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos 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.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
26 #include "src/graphics/windowman.h"
27 
29 
30 namespace Graphics {
31 
32 namespace Aurora {
33 
36  _distance(0.0f),
37  _rectHeight(0) {
38 }
39 
40 void KotORDialogFrame::setDistance(float distance) {
41  _distance = distance;
42 }
43 
45  _rectHeight = h;
46 }
47 
49 }
50 
52  if (pass != kRenderPassAll)
53  return;
54 
55  float hw = WindowMan.getWindowWidth() / 2.0f;
56  float hh = WindowMan.getWindowHeight() / 2.0f;
57 
58  glColor3f(0.0f, 0.0f, 0.0f);
59  glBegin(GL_QUADS);
60  // top rectangle
61  glVertex3f( hw, hh - _rectHeight, _distance);
62  glVertex3f( hw, hh, _distance);
63  glVertex3f(-hw, hh, _distance);
64  glVertex3f(-hw, hh - _rectHeight, _distance);
65  // bottom rectangle
66  glVertex3f( hw, - hh, _distance);
67  glVertex3f( hw, _rectHeight - hh, _distance);
68  glVertex3f(-hw, _rectHeight - hh, _distance);
69  glVertex3f(-hw, - hh, _distance);
70  glEnd();
71  glColor3f(1.0f, 1.0f, 1.0f);
72 }
73 
74 } // End of namespace Aurora
75 
76 } // End of namespace Graphics
void render(RenderPass pass)
Render the object.
The global window manager.
RenderPass
Definition: types.h:97
Render all parts.
Definition: types.h:100
An object that can be displayed by the graphics manager.
Definition: renderable.h:42
#define WindowMan
Shortcut for accessing the window manager.
Definition: windowman.h:137
#define pass
Definition: fft.cpp:257
Frame for conversations/cutscenes in Star Wars: Knights of the Old Republic.
void calculateDistance()
Calculate the object&#39;s distance.