ScummVM API documentation
libretro-graphics-opengl.h
1 /* Copyright (C) 2024 Giovanni Cascione <ing.cascione@gmail.com>
2  *
3  * This program is free software: you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation, either version 3 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  */
17 
18 #ifndef BACKENDS_LIBRETRO_GRAPHICS_OPENGL_H
19 #define BACKENDS_LIBRETRO_GRAPHICS_OPENGL_H
20 
21 #include "backends/graphics/opengl/opengl-graphics.h"
22 #include "backends/graphics/opengl/texture.h"
23 
24 namespace OpenGL {
25 class Surface;
26 }
27 
29 public:
30  LibretroOpenGLGraphics(OpenGL::ContextType contextType);
31  bool loadVideoMode(uint requestedWidth, uint requestedHeight, const Graphics::PixelFormat &format) override {
32  return true;
33  };
34  void refreshScreen() override;
35  void setSystemMousePosition(const int x, const int y) override {};
36  void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format, const byte *mask) override;
37  void initSize(uint width, uint height, const Graphics::PixelFormat *format) override;
38  void setMousePosition(int x, int y);
39  void resetContext(OpenGL::ContextType contextType);
40  OSystem::TransactionError endGFXTransaction() override;
41  bool hasFeature(OSystem::Feature f) const override;
42 protected:
43  bool gameNeedsAspectRatioCorrection() const override {
44  return false;
45  }
46  void handleResizeImpl(const int width, const int height) override;
47 private:
48  void overrideCursorScaling(void);
49 };
50 
52 
53 protected:
54  void activateInternal() override;
55 };
56 
57 #endif //BACKENDS_LIBRETRO_GRAPHICS_OPENGL_H
void setSystemMousePosition(const int x, const int y) override
Definition: libretro-graphics-opengl.h:35
Definition: framebuffer.h:183
Definition: pixelformat.h:138
Feature
Definition: system.h:403
TransactionError
Definition: system.h:1155
Definition: libretro-graphics-opengl.h:51
Definition: opengl-graphics.h:57
Definition: renderbuffer.h:27
Definition: libretro-graphics-opengl.h:28
bool loadVideoMode(uint requestedWidth, uint requestedHeight, const Graphics::PixelFormat &format) override
Definition: libretro-graphics-opengl.h:31
bool gameNeedsAspectRatioCorrection() const override
Definition: libretro-graphics-opengl.h:43