25 #include "common/rect.h" 26 #include "common/system.h" 28 #include "math/frustum.h" 29 #include "math/matrix4.h" 30 #include "math/vector3d.h" 41 virtual void draw() {}
42 virtual void drawOverlay() {}
48 bool is3D()
const {
return _is3D; }
54 bool _isConstrainedToWindow;
112 virtual void init() = 0;
113 virtual void clear() = 0;
121 virtual void freeFont();
126 virtual void drawRect2D(
const Common::Rect &rect, uint8 a, uint8 r, uint8 g, uint8 b) = 0;
128 float transparency = -1.0,
bool additiveBlending =
false) = 0;
129 virtual void drawTexturedRect3D(
const Math::Vector3d &topLeft,
const Math::Vector3d &bottomLeft,
130 const Math::Vector3d &topRight,
const Math::Vector3d &bottomRight,
133 virtual void drawCube(
Texture **textures) = 0;
137 virtual Texture *copyScreenshotToTexture();
146 void renderWindow(
Window *window);
149 void renderWindowOverlay(
Window *window);
158 virtual void selectTargetWindow(
Window *window,
bool is3D,
bool scaled) = 0;
160 void setupCameraPerspective(
float pitch,
float heading,
float fov);
162 bool isCubeFaceVisible(uint face);
164 Math::Matrix4 getMvpMatrix()
const {
return _mvpMatrix; }
168 static const int kOriginalWidth = 640;
169 static const int kOriginalHeight = 480;
170 static const int kTopBorderHeight = 30;
171 static const int kBottomBorderHeight = 90;
172 static const int kFrameHeight = 360;
174 void computeScreenViewport();
182 Math::Matrix4 _projectionMatrix;
183 Math::Matrix4 _modelViewMatrix;
184 Math::Matrix4 _mvpMatrix;
186 Math::Frustum _frustum;
188 static const float cubeVertices[5 * 6 * 4];
189 Math::AABB _cubeFacesAABB[6];
193 Math::Matrix4 makeProjectionMatrix(
float fov)
const;
virtual void flipBuffer()
Definition: gfx.h:118
bool is3D() const
Definition: gfx.h:48
bool isConstrainedToWindow() const
Definition: gfx.h:45
bool isScaled() const
Definition: gfx.h:51