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" 29 #include "graphics/transform_struct.h" 30 #include "graphics/surface.h" 32 #if defined(USE_OPENGL_SHADERS) 34 #include "graphics/opengl/system_headers.h" 36 #include "engines/wintermute/base/gfx/xmath.h" 45 class BaseSurfaceOpenGL3D;
51 #define DEFAULT_NEAR_PLANE 90.0f 52 #define DEFAULT_FAR_PLANE 10000.0f 56 kPostFilterBlackAndWhite,
65 bool getProjectionParams(
float *resWidth,
float *resHeight,
float *layerWidth,
float *layerHeight,
66 float *modWidth,
float *modHeight,
bool *customViewport);
67 virtual int getMaxActiveLights() = 0;
69 bool setAmbientLightColor(uint32 color);
70 bool setDefaultAmbientLightColor();
72 uint32 _ambientLightColor;
73 bool _ambientLightOverride;
75 void dumpData(
const char *filename) {};
77 virtual bool enableShadows() = 0;
78 virtual bool disableShadows() = 0;
79 virtual bool shadowVolumeSupported() = 0;
80 virtual bool invalidateTexture(
BaseSurface *texture) = 0;
82 virtual void setSpriteBlendMode(Graphics::TSpriteBlendMode blendMode,
bool forceChange =
false) = 0;
84 virtual bool invalidateDeviceObjects() = 0;
85 virtual bool restoreDeviceObjects() = 0;
87 bool fade(uint16 alpha)
override;
89 uint32 color,
bool alphaDisable, Graphics::TSpriteBlendMode blendMode,
bool mirrorX,
bool mirrorY);
91 float angle, uint32 color,
bool alphaDisable, Graphics::TSpriteBlendMode blendMode,
bool mirrorX,
bool mirrorY) = 0;
93 virtual bool resetDevice() = 0;
94 void initLoop()
override;
95 bool windowedBlt()
override;
97 virtual bool startSpriteBatch()
override = 0;
98 virtual bool endSpriteBatch()
override = 0;
99 virtual bool commitSpriteBatch() = 0;
104 virtual void lightEnable(
int index,
bool enable) = 0;
105 virtual void setLightParameters(
int index,
const DXVector3 &position,
const DXVector3 &direction,
106 const DXVector4 &diffuse,
bool spotlight) = 0;
108 virtual void enableCulling() = 0;
109 virtual void disableCulling() = 0;
113 void setWindowed(
bool windowed)
override;
114 void onWindowChange()
override;
118 virtual bool setWorldTransform(
const DXMatrix &transform) = 0;
119 virtual bool setViewTransform(
const DXMatrix &transform) = 0;
120 virtual bool setProjectionTransform(
const DXMatrix &transform) = 0;
122 void getWorldTransform(
DXMatrix *transform) {
123 *transform = _worldMatrix;
126 void getViewTransform(
DXMatrix *transform) {
127 *transform = _viewMatrix;
130 void getProjectionTransform(
DXMatrix *transform) {
131 *transform = _projectionMatrix;
134 virtual Mesh3DS *createMesh3DS() = 0;
135 virtual XMesh *createXMesh() = 0;
143 virtual void displaySimpleShadow(
BaseObject *
object) = 0;
145 virtual void postfilter() = 0;
146 virtual void setPostfilter(PostFilter postFilter) = 0;
147 bool flip()
override;
148 bool indicatorFlip(int32 x, int32 y, int32 width, int32 height)
override;
149 bool forcedFlip()
override;
150 virtual bool setViewport3D(
DXViewport *viewport) = 0;
152 void invalidateLastTexture() {
153 _lastTexture =
nullptr;
156 void endSaveLoad()
override;
166 float _nearClipPlane;
168 TRendererState _state;
169 PostFilter _postFilterMode;
170 bool _flipInProgress;
172 virtual void setAmbientLightRenderState() = 0;
Definition: base_game.h:79
bool fade(uint16 alpha) override
bool indicatorFlip(int32 x, int32 y, int32 width, int32 height) override
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: base_surface.h:37
Definition: 3dshadow_volume.h:49
Definition: base_renderer3d.h:60
Definition: coll_templ.h:347
Definition: base_renderer.h:53
Definition: 3dcamera.h:38
Definition: base_object.h:49
Definition: achievements_tables.h:27