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,
131 Texture *texture) = 0;
133 virtual void drawCube(Texture **textures) = 0;
137 virtual Texture *copyScreenshotToTexture();
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 kBottomBorderHeightForSubsInWideScreen = 60;
173 static const int kBottomTriggerForInventoryInWideScreen = 35;
174 static const int kFrameHeight = 360;
176 void computeScreenViewport();
184 Math::Matrix4 _projectionMatrix;
185 Math::Matrix4 _modelViewMatrix;
186 Math::Matrix4 _mvpMatrix;
188 Math::Frustum _frustum;
190 static const float cubeVertices[5 * 6 * 4];
191 Math::AABB _cubeFacesAABB[6];
195 Math::Matrix4 makeProjectionMatrix(
float fov)
const;
198Renderer *CreateGfxOpenGL(
OSystem *system);
199Renderer *CreateGfxOpenGLShader(
OSystem *system);
200Renderer *CreateGfxTinyGL(
OSystem *system);
201Renderer *createRenderer(
OSystem *system);
bool isScaled() const
Definition: gfx.h:51
bool isConstrainedToWindow() const
Definition: gfx.h:45
bool is3D() const
Definition: gfx.h:48
void renderDrawableOverlay(Drawable *drawable, Window *window)
void renderWindow(Window *window)
virtual void selectTargetWindow(Window *window, bool is3D, bool scaled)=0
void renderWindowOverlay(Window *window)
void renderDrawable(Drawable *drawable, Window *window)
virtual void flipBuffer()
Definition: gfx.h:118
virtual Common::Rect getOriginalPosition() const =0
Common::Point scalePoint(const Common::Point &screen) const
Common::Point screenPosToWindowPos(const Common::Point &screen) const
virtual Common::Rect getPosition() const =0
Common::Point getCenter() const