22 #ifndef WINTERMUTE_BASE_RENDERER_3D_H 23 #define WINTERMUTE_BASE_RENDERER_3D_H 25 #include "engines/wintermute/base/gfx/base_renderer.h" 26 #include "engines/wintermute/coll_templ.h" 27 #include "engines/wintermute/dctypes.h" 28 #include "engines/wintermute/math/rect32.h" 29 #include "engines/wintermute/math/vector2.h" 31 #include "graphics/transform_struct.h" 32 #include "graphics/surface.h" 34 #if defined(USE_OPENGL_SHADERS) 36 #include "graphics/opengl/system_headers.h" 38 #include "engines/wintermute/base/gfx/xmath.h" 47 class BaseSurfaceOpenGL3D;
53 #define DEFAULT_NEAR_PLANE 90.0f 54 #define DEFAULT_FAR_PLANE 10000.0f 58 kPostFilterBlackAndWhite,
67 bool getProjectionParams(
float *resWidth,
float *resHeight,
float *layerWidth,
float *layerHeight,
68 float *modWidth,
float *modHeight,
bool *customViewport);
69 virtual int getMaxActiveLights() = 0;
71 bool setAmbientLightColor(uint32 color);
72 bool setDefaultAmbientLightColor();
74 uint32 _ambientLightColor;
75 bool _ambientLightOverride;
78 virtual bool enableShadows() = 0;
79 virtual bool disableShadows() = 0;
80 virtual bool stencilSupported() = 0;
81 virtual void displayShadow(
BaseObject *
object,
const DXVector3 *light,
bool lightPosRelative) = 0;
82 virtual bool invalidateTexture(BaseSurfaceOpenGL3D *texture) = 0;
84 Graphics::TSpriteBlendMode _blendMode;
85 virtual void setSpriteBlendMode(Graphics::TSpriteBlendMode blendMode,
bool forceChange =
false) = 0;
91 bool invalidateDeviceObjects();
93 BaseSurfaceOpenGL3D *_lastTexture;
94 void fade(uint16 alpha)
override;
99 uint32 color,
bool alphaDisable, Graphics::TSpriteBlendMode blendMode,
bool mirrorX,
bool mirrorY);
101 float angle, uint32 color,
bool alphaDisable, Graphics::TSpriteBlendMode blendMode,
bool mirrorX,
bool mirrorY) = 0;
108 void initLoop()
override;
117 virtual bool startSpriteBatch()
override = 0;
118 virtual bool endSpriteBatch()
override = 0;
119 virtual bool commitSpriteBatch() = 0;
126 virtual void lightEnable(
int index,
bool enable) = 0;
127 virtual void setLightParameters(
int index,
const DXVector3 &position,
const DXVector3 &direction,
128 const DXVector4 &diffuse,
bool spotlight) = 0;
130 virtual void enableCulling() = 0;
131 virtual void disableCulling() = 0;
135 void setWindowed(
bool windowed)
override;
136 void onWindowChange()
override;
137 bool windowedBlt()
override;
141 virtual bool setWorldTransform(
const DXMatrix &transform) = 0;
142 virtual bool setViewTransform(
const DXMatrix &transform) = 0;
143 virtual bool setProjectionTransform(
const DXMatrix &transform) = 0;
145 void getWorldTransform(
DXMatrix *transform) {
146 *transform = _worldMatrix;
149 void getViewTransform(
DXMatrix *transform) {
150 *transform = _viewMatrix;
153 void getProjectionTransform(
DXMatrix *transform) {
154 *transform = _projectionMatrix;
157 virtual Mesh3DS *createMesh3DS() = 0;
158 virtual XMesh *createXMesh() = 0;
166 virtual void postfilter() = 0;
167 virtual void setPostfilter(PostFilter postFilter) = 0;
168 bool flip()
override;
170 bool forcedFlip()
override;
171 virtual bool setViewport3D(
DXViewport *viewport) = 0;
181 float _nearClipPlane;
183 TRendererState _state;
184 bool _spriteBatchMode;
185 Graphics::TSpriteBlendMode _batchBlendMode;
186 bool _batchAlphaDisable;
187 BaseSurfaceOpenGL3D *_batchTexture;
188 PostFilter _postFilterMode;
191 virtual void setAmbientLightRenderState() = 0;
Definition: base_game.h:76
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: base_surface.h:38
void fade(uint16 alpha) override
Definition: 3dshadow_volume.h:49
Definition: base_renderer3d.h:62
Definition: coll_templ.h:63
Definition: base_renderer.h:53
Definition: 3dcamera.h:38
Definition: base_object.h:49
Definition: achievements_tables.h:27
bool indicatorFlip() override