ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
base_surface_opengl3d.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef WINTERMUTE_BASE_SURFACE_OPENGL3D_H
23 #define WINTERMUTE_BASE_SURFACE_OPENGL3D_H
24 
25 #include "engines/wintermute/base/gfx/base_surface.h"
26 
27 #if defined(USE_OPENGL_GAME) || defined(USE_OPENGL_SHADERS)
28 
29 #include "graphics/opengl/system_headers.h"
30 
31 namespace Wintermute {
32 
33 class BaseGame;
34 class BaseRenderer3D;
35 
36 class BaseSurfaceOpenGL3D : public BaseSurface {
37 public:
38  BaseSurfaceOpenGL3D(BaseGame* game, BaseRenderer3D* renderer);
39  ~BaseSurfaceOpenGL3D();
40 
41  bool invalidate() override;
42 
43  bool displayHalfTrans(int x, int y, Rect32 rect) override;
44  bool isTransparentAt(int x, int y) override;
45  bool displayTransRotate(int x, int y, uint32 angle, int32 hotspotX, int32 hotspotY, Rect32 rect, float zoomX, float zoomY, uint32 alpha = 0xFFFFFFFF, Graphics::TSpriteBlendMode blendMode = Graphics::BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) override;
46  bool displayTransZoom(int x, int y, Rect32 rect, float zoomX, float zoomY, uint32 alpha = 0xFFFFFFFF, Graphics::TSpriteBlendMode blendMode = Graphics::BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) override;
47  bool displayTrans(int x, int y, Rect32 rect, uint32 alpha = 0xFFFFFFFF, Graphics::TSpriteBlendMode blendMode = Graphics::BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false, int offsetX = 0, int offsetY = 0) override;
48  bool display(int x, int y, Rect32 rect, Graphics::TSpriteBlendMode blendMode = Graphics::BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) override;
49  bool displayTiled(int x, int y, Rect32 rect, int numTimesX, int numTimesY) override;
50  bool restore() override;
51  bool create(const Common::String &filename, bool defaultCK, byte ckRed, byte ckGreen, byte ckBlue, int lifeTime = -1, bool keepLoaded = false) override;
52  bool create(int width, int height) override;
53  bool putSurface(const Graphics::Surface &surface, bool hasAlpha = false) override;
54  bool putPixel(int x, int y, byte r, byte g, byte b, int a = -1) override;
55  bool getPixel(int x, int y, byte *r, byte *g, byte *b, byte *a = nullptr) override;
56  bool comparePixel(int x, int y, byte r, byte g, byte b, int a = -1) override;
57  bool startPixelOp() override;
58  bool endPixelOp() override;
59  bool isTransparentAtLite(int x, int y) override;
60 
61  void setTexture();
62 
63  GLuint getTextureName() {
64  return _tex;
65  }
66 
67  uint getGLTextureWidth() const {
68  return _texWidth;
69  }
70 
71  uint getGLTextureHeight() const {
72  return _texHeight;
73  }
74 
75 private:
76  GLuint _tex;
77  BaseRenderer3D *_renderer;
78  Graphics::Surface *_imageData;
79  uint _texWidth;
80  uint _texHeight;
81 };
82 
83 } // End of namespace Wintermute
84 
85 #endif // defined(USE_OPENGL_GAME) || defined(USE_OPENGL_SHADERS)
86 
87 #endif
Definition: str.h:59
Definition: surface.h:67
Definition: achievements_tables.h:27