22 #ifndef WINTERMUTE_BASE_RENDER_OPENGL3D_H 23 #define WINTERMUTE_BASE_RENDER_OPENGL3D_H 25 #include "engines/wintermute/base/gfx/base_renderer3d.h" 26 #include "engines/wintermute/math/rect32.h" 27 #include "engines/wintermute/math/vector2.h" 28 #include "engines/wintermute/dctypes.h" 30 #include "graphics/transform_struct.h" 32 #if defined(USE_OPENGL_GAME) 34 #include "graphics/opengl/system_headers.h" 38 class BaseSurfaceOpenGL3D;
40 class BaseRenderOpenGL3D :
public BaseRenderer3D {
41 friend class BaseSurfaceOpenGL3D;
42 friend class Mesh3DSOpenGL;
43 friend class XMeshOpenGL;
44 friend class ShadowVolumeOpenGL;
58 struct SimpleShadowVertex {
70 BaseRenderOpenGL3D(BaseGame *inGame =
nullptr);
71 ~BaseRenderOpenGL3D()
override;
73 bool invalidateTexture(BaseSurfaceOpenGL3D *texture)
override;
75 void setSpriteBlendMode(Graphics::TSpriteBlendMode blendMode,
bool forceChange =
false)
override;
77 void setAmbientLightRenderState()
override;
79 int getMaxActiveLights()
override;
80 void lightEnable(
int index,
bool enable)
override;
81 void setLightParameters(
int index,
const DXVector3 &position,
const DXVector3 &direction,
const DXVector4 &diffuse,
bool spotlight)
override;
83 void enableCulling()
override;
84 void disableCulling()
override;
86 bool enableShadows()
override;
87 bool disableShadows()
override;
88 void displayShadow(BaseObject *
object,
const DXVector3 *lightPos,
bool lightPosRelative)
override;
89 bool stencilSupported()
override;
91 void dumpData(
const char *filename)
override {}
92 BaseImage *takeScreenshot()
override;
93 void fadeToColor(byte r, byte g, byte b, byte a)
override;
98 bool setViewport(
int left,
int top,
int right,
int bottom)
override;
99 bool drawLine(
int x1,
int y1,
int x2,
int y2, uint32 color)
override;
101 DXMatrix *buildMatrix(DXMatrix* out,
const DXVector2 *centre,
const DXVector2 *scaling,
float angle);
102 void transformVertices(
struct SpriteVertex *vertices,
const DXVector2 *centre,
const DXVector2 *scaling,
float angle);
104 bool setProjection()
override;
105 bool setProjection2D();
106 bool setWorldTransform(
const DXMatrix &transform)
override;
107 bool setViewTransform(
const DXMatrix &transform)
override;
108 bool setProjectionTransform(
const DXMatrix &transform)
override;
110 bool initRenderer(
int width,
int height,
bool windowed)
override;
111 bool setup2D(
bool force =
false)
override;
112 bool setup3D(Camera3D *camera,
bool force =
false)
override;
113 bool setupLines()
override;
116 return "OpenGL 3D renderer";
118 bool displayDebugInfo()
override {
119 return STATUS_FAILED;
121 bool drawShaderQuad()
override {
122 return STATUS_FAILED;
125 float getScaleRatioX()
const override {
128 float getScaleRatioY()
const override {
132 BaseSurface *createSurface()
override;
134 bool startSpriteBatch()
override;
135 bool endSpriteBatch()
override;
136 bool commitSpriteBatch()
override;
138 bool drawSpriteEx(BaseSurface *texture,
const Rect32 &rect,
const Vector2 &pos,
const Vector2 &rot,
const Vector2 &
scale,
139 float angle, uint32 color,
bool alphaDisable, Graphics::TSpriteBlendMode blendMode,
bool mirrorX,
bool mirrorY)
override;
141 void renderSceneGeometry(
const BaseArray<AdWalkplane *> &planes,
const BaseArray<AdBlock *> &blocks,
142 const BaseArray<AdGeneric *> &generics,
const BaseArray<Light3D *> &lights, Camera3D *camera)
override;
143 void renderShadowGeometry(
const BaseArray<AdWalkplane *> &planes,
const BaseArray<AdBlock *> &blocks,
const BaseArray<AdGeneric *> &generics, Camera3D *camera)
override;
145 Mesh3DS *createMesh3DS()
override;
146 XMesh *createXMesh()
override;
147 ShadowVolume *createShadowVolume()
override;
149 bool setViewport3D(DXViewport *viewport)
override;
151 void postfilter()
override;
152 void setPostfilter(PostFilter postFilter)
override { _postFilterMode = postFilter; };
155 void renderSimpleShadow(BaseObject *
object);
157 SimpleShadowVertex _simpleShadow[4]{};
160 GLuint _filterTexture;
165 #endif // defined(USE_OPENGL_GAME)
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
signed char * fill(signed char *first, signed char *last, Value val)
Definition: algorithm.h:168
Definition: achievements_tables.h:27