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/vector2.h" 30 #include "graphics/transform_struct.h" 31 #include "graphics/surface.h" 33 #if defined(USE_OPENGL_SHADERS) 35 #include "graphics/opengl/system_headers.h" 37 #include "engines/wintermute/base/gfx/xmath.h" 46 class BaseSurfaceOpenGL3D;
52 #define DEFAULT_NEAR_PLANE 90.0f 53 #define DEFAULT_FAR_PLANE 10000.0f 57 kPostFilterBlackAndWhite,
66 bool getProjectionParams(
float *resWidth,
float *resHeight,
float *layerWidth,
float *layerHeight,
67 float *modWidth,
float *modHeight,
bool *customViewport);
68 virtual int getMaxActiveLights() = 0;
70 bool setAmbientLightColor(uint32 color);
71 bool setDefaultAmbientLightColor();
73 uint32 _ambientLightColor;
74 bool _ambientLightOverride;
76 void dumpData(
const char *filename) {};
78 virtual bool enableShadows() = 0;
79 virtual bool disableShadows() = 0;
80 virtual bool stencilSupported() = 0;
81 virtual bool invalidateTexture(BaseSurfaceOpenGL3D *texture) = 0;
83 virtual void setSpriteBlendMode(Graphics::TSpriteBlendMode blendMode,
bool forceChange =
false) = 0;
85 virtual bool invalidateDeviceObjects() = 0;
86 virtual bool restoreDeviceObjects() = 0;
87 BaseSurfaceOpenGL3D *_lastTexture;
88 void fade(uint16 alpha)
override;
90 uint32 color,
bool alphaDisable, Graphics::TSpriteBlendMode blendMode,
bool mirrorX,
bool mirrorY);
92 float angle, uint32 color,
bool alphaDisable, Graphics::TSpriteBlendMode blendMode,
bool mirrorX,
bool mirrorY) = 0;
94 virtual bool resetDevice() = 0;
95 void initLoop()
override;
96 bool windowedBlt()
override;
98 virtual bool startSpriteBatch()
override = 0;
99 virtual bool endSpriteBatch()
override = 0;
100 virtual bool commitSpriteBatch() = 0;
105 virtual void lightEnable(
int index,
bool enable) = 0;
106 virtual void setLightParameters(
int index,
const DXVector3 &position,
const DXVector3 &direction,
107 const DXVector4 &diffuse,
bool spotlight) = 0;
109 virtual void enableCulling() = 0;
110 virtual void disableCulling() = 0;
114 void setWindowed(
bool windowed)
override;
115 void onWindowChange()
override;
119 virtual bool setWorldTransform(
const DXMatrix &transform) = 0;
120 virtual bool setViewTransform(
const DXMatrix &transform) = 0;
121 virtual bool setProjectionTransform(
const DXMatrix &transform) = 0;
123 void getWorldTransform(
DXMatrix *transform) {
124 *transform = _worldMatrix;
127 void getViewTransform(
DXMatrix *transform) {
128 *transform = _viewMatrix;
131 void getProjectionTransform(
DXMatrix *transform) {
132 *transform = _projectionMatrix;
135 virtual Mesh3DS *createMesh3DS() = 0;
136 virtual XMesh *createXMesh() = 0;
144 virtual void displaySimpleShadow(
BaseObject *
object) = 0;
146 virtual void postfilter() = 0;
147 virtual void setPostfilter(PostFilter postFilter) = 0;
148 bool flip()
override;
150 bool forcedFlip()
override;
151 virtual bool setViewport3D(
DXViewport *viewport) = 0;
161 float _nearClipPlane;
163 TRendererState _state;
164 PostFilter _postFilterMode;
166 virtual void setAmbientLightRenderState() = 0;
Definition: base_game.h:75
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: base_surface.h:37
void fade(uint16 alpha) override
Definition: 3dshadow_volume.h:49
Definition: base_renderer3d.h:61
Definition: coll_templ.h:347
Definition: base_renderer.h:53
Definition: 3dcamera.h:38
Definition: base_object.h:49
Definition: achievements_tables.h:27
bool indicatorFlip() override