ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

surfacesdl-graphics.h

Go to the documentation of this file.
00001 /* ResidualVM - A 3D game interpreter
00002  *
00003  * ResidualVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef BACKENDS_GRAPHICS_SURFACESDL_GRAPHICS_H
00024 #define BACKENDS_GRAPHICS_SURFACESDL_GRAPHICS_H
00025 
00026 #include "backends/graphics/sdl/resvm-sdl-graphics.h"
00027 
00033 class SurfaceSdlGraphicsManager : public ResVmSdlGraphicsManager {
00034 public:
00035     SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSource, SdlWindow *window, const Capabilities &capabilities);
00036     virtual ~SurfaceSdlGraphicsManager();
00037 
00038     // GraphicsManager API - Features
00039     virtual bool hasFeature(OSystem::Feature f) const override;
00040     virtual void setFeatureState(OSystem::Feature f, bool enable) override;
00041 
00042     // GraphicsManager API - Graphics mode
00043     virtual void setupScreen(uint gameWidth, uint gameHeight, bool fullscreen, bool accel3d) override;
00044     virtual Graphics::PixelBuffer getScreenPixelBuffer() override;
00045     virtual int16 getHeight() const override;
00046     virtual int16 getWidth() const override;
00047 
00048     // GraphicsManager API - Draw methods
00049     virtual void updateScreen() override;
00050 
00051     // GraphicsManager API - Overlay
00052     virtual void showOverlay() override;
00053     virtual void hideOverlay() override;
00054     virtual void clearOverlay() override;
00055     virtual void grabOverlay(void *buf, int pitch) const override;
00056     virtual void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) override;
00057     virtual int16 getOverlayWidth() const override { return _overlayscreen->w; }
00058     virtual int16 getOverlayHeight() const override { return _overlayscreen->h; }
00059 
00060     /* Render the passed Surfaces besides the game texture.
00061      * This is used for widescreen support in the Grim engine.
00062      * Note: we must copy the Surfaces, as they are free()d after this call.
00063      */
00064     virtual void suggestSideTextures(Graphics::Surface *left, Graphics::Surface *right) override;
00065 
00066     // GraphicsManager API - Mouse
00067     virtual void warpMouse(int x, int y) override;
00068 
00069     // SdlGraphicsManager API
00070     virtual void transformMouseCoordinates(Common::Point &point) override;
00071 
00072 protected:
00073 #if SDL_VERSION_ATLEAST(2, 0, 0)
00074     SDL_Renderer *_renderer;
00075     SDL_Texture *_screenTexture;
00076     void deinitializeRenderer();
00077     SDL_Surface *SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags);
00078 #endif
00079 
00080     SDL_Surface *_screen;
00081     SDL_Surface *_subScreen;
00082     void createOrUpdateScreen();
00083 
00084     SDL_Surface *_overlayscreen;
00085     bool _overlayDirty;
00086 
00087     Math::Rect2d _gameRect;
00088 
00089     SDL_Surface *_sideSurfaces[2];
00090 
00091     void drawOverlay();
00092     void drawSideTextures();
00093     void closeOverlay();
00094 
00095     // ResVmSdlGraphicsManager API
00096     virtual bool saveScreenshot(const Common::String &file) const override;
00097 };
00098 
00099 #endif


Generated on Sat Dec 7 2019 05:00:25 for ResidualVM by doxygen 1.7.1
curved edge   curved edge