22 #ifndef GRIM_GFX_OPENGL_SHADERS_H 23 #define GRIM_GFX_OPENGL_SHADERS_H 25 #include "engines/grim/actor.h" 26 #include "engines/grim/gfx_base.h" 28 #include "graphics/opengl/shader.h" 30 #include "common/stack.h" 31 #include "common/rect.h" 46 void setupScreen(
int screenW,
int screenH)
override;
55 void setupCameraFrustum(
float fov,
float nclip,
float fclip)
override;
56 void positionCamera(
const Math::Vector3d &pos,
const Math::Vector3d &interest,
float roll)
override;
57 void positionCamera(
const Math::Vector3d &pos,
const Math::Matrix4 &rot)
override;
59 Math::Matrix4 getModelView()
override;
60 Math::Matrix4 getProjection()
override;
62 void clearScreen()
override;
63 void clearDepthBuffer()
override;
68 void flipBuffer(
bool opportunistic =
false)
override;
73 void startActorDraw(
const Actor *actor)
override;
75 void finishActorDraw()
override;
76 void setShadow(
Shadow *shadow)
override;
77 void drawShadowPlanes()
override;
78 void setShadowMode()
override;
79 void clearShadowMode()
override;
80 bool isShadowModeActive()
override;
81 void setShadowColor(byte r, byte g, byte b)
override;
82 void getShadowColor(byte *r, byte *g, byte *b)
override;
83 void destroyShadow(
Shadow *shadow)
override;
85 void set3DMode()
override;
87 void translateViewpointStart()
override;
88 void translateViewpoint(
const Math::Vector3d &vec)
override;
89 void rotateViewpoint(
const Math::Angle &angle,
const Math::Vector3d &axis)
override;
90 void rotateViewpoint(
const Math::Matrix4 &rot)
override;
91 void translateViewpointFinish()
override;
94 void drawModelFace(
const Mesh *mesh,
const MeshFace *face)
override;
95 void drawSprite(
const Sprite *sprite)
override;
96 void drawMesh(
const Mesh *mesh)
override;
97 void drawDimPlane()
override;
99 void enableLights()
override;
100 void disableLights()
override;
101 void setupLight(
Light *light,
int lightId)
override;
102 void turnOffLight(
int lightId)
override;
104 void createTexture(
Texture *texture,
const uint8 *data,
const CMap *cmap,
bool clamp)
override;
105 void selectTexture(
const Texture *texture)
override;
106 void destroyTexture(
Texture *texture)
override;
131 void drawBitmap(
const Bitmap *bitmap,
int x,
int y, uint32 layer = 0)
override;
144 void createFont(
Font *font)
override;
145 void destroyFont(
Font *font)
override;
147 void createTextObject(
TextObject *text)
override;
148 void drawTextObject(
const TextObject *text)
override;
149 void destroyTextObject(
TextObject *text)
override;
151 Bitmap *getScreenshot(
int w,
int h,
bool useStored)
override;
152 void storeDisplay()
override;
153 void copyStoredToDisplay()
override;
161 void dimRegion(
int x,
int y,
int w,
int h,
float level)
override;
173 void drawEmergString(
int x,
int y,
const char *text,
const Color &fgColor)
override;
174 void loadEmergFont()
override;
193 void drawMovieFrame(
int offsetX,
int offsetY)
override;
203 const char *getVideoDeviceName()
override;
205 void renderBitmaps(
bool render)
override;
206 void renderZBitmaps(
bool render)
override;
208 void createMesh(
Mesh *mesh)
override;
209 void destroyMesh(
const Mesh *mesh)
override;
210 void createEMIModel(
EMIModel *model)
override;
211 void updateEMIModel(
const EMIModel* model)
override;
212 void destroyEMIModel(
EMIModel *model)
override;
214 void setBlendMode(
bool additive)
override;
218 GLuint compileShader(
const char *vertex,
const char *fragment);
219 GLuint compileShader(
const char *shader) {
return compileShader(shader, shader); }
220 void createSpecialtyTextureFromScreen(uint
id, uint8 *data,
int x,
int y,
int width,
int height)
override;
223 const Actor *_currentActor;
226 GLuint _emergTexture;
237 GLuint _smushVBO, _quadEBO;
246 void setupTexturedQuad();
250 void drawDepthBitmap(
int bitmapId,
int x,
int y,
int w,
int h,
char *data);
255 Math::Matrix4 _projMatrix;
256 Math::Matrix4 _viewMatrix;
257 Math::Matrix4 _mvpMatrix;
258 Math::Matrix4 _overworldProjMatrix;
260 void setupTexturedCenteredQuad();
268 Math::Vector2d _zBufTexCrop;
271 Math::Vector4d _position;
272 Math::Vector4d _direction;
273 Math::Vector4d _color;
274 Math::Vector4d _params;
278 bool _hasAmbientLight;
281 void setupPrimitives();
282 GLuint nextPrimitive();
283 GLuint _primitiveVBOs[32];
284 uint32 _currentPrimitive;
285 void drawGenericPrimitive(
const float *vertices, uint32 numVertices,
const PrimitiveObject *primitive);
288 GLuint _dimRegionVBO;
290 GLuint _storedDisplay;
void getScreenBoundingBox(const Mesh *mesh, int *x1, int *y1, int *x2, int *y2) override
void drawBitmap(const Bitmap *bitmap, int x, int y, uint32 layer=0) override
Definition: modelemi.h:82
void setupScreen(int screenW, int screenH) override
void createBitmap(BitmapData *bitmap) override
void releaseMovieFrame() override
Definition: gfx_opengl_shaders.h:35
bool isHardwareAccelerated() override
Definition: gfx_opengl_shaders.h:53
Definition: textobject.h:84
Definition: gfx_base.h:62
Definition: modelemi.h:55
Definition: colormap.h:35
void destroyBitmap(BitmapData *bitmap) override
void dimScreen() override
Definition: primitives.h:34
Actor represents a 3D character on screen.
Definition: actor.h:72
void irisAroundRegion(int x1, int y1, int x2, int y2) override
void flipBuffer(bool opportunistic=false) override
Definition: material.h:31
void prepareMovieFrame(Graphics::Surface *frame) override
bool supportsShaders() override
Definition: gfx_opengl_shaders.h:54