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

graphics.h

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM 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_ABSTRACT_H
00024 #define BACKENDS_GRAPHICS_ABSTRACT_H
00025 
00026 #include "common/system.h"
00027 #include "common/noncopyable.h"
00028 #include "common/keyboard.h"
00029 
00030 #include "graphics/mode.h"
00031 #include "graphics/palette.h"
00032 
00037 class GraphicsManager : public PaletteManager {
00038 public:
00039     virtual ~GraphicsManager() {}
00040 
00041     virtual bool hasFeature(OSystem::Feature f) const = 0;
00042     virtual void setFeatureState(OSystem::Feature f, bool enable) = 0;
00043     virtual bool getFeatureState(OSystem::Feature f) const = 0;
00044 
00045     virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const = 0;
00046     virtual int getDefaultGraphicsMode() const = 0;
00047     virtual bool setGraphicsMode(int mode) = 0;
00048     virtual void resetGraphicsScale() = 0;
00049     virtual int getGraphicsMode() const = 0;
00050     virtual const OSystem::GraphicsMode *getSupportedShaders() const {
00051         static const OSystem::GraphicsMode no_shader[2] = {{"NONE", "Normal (no shader)", 0}, {0, 0, 0}};
00052         return no_shader;
00053     };
00054     virtual bool setShader(int id) { return false; }
00055     virtual int getShader() const { return 0; }
00056     virtual const OSystem::GraphicsMode *getSupportedStretchModes() const {
00057         static const OSystem::GraphicsMode noStretchModes[] = {{"NONE", "Normal", 0}, {nullptr, nullptr, 0 }};
00058         return noStretchModes;
00059     }
00060     virtual int getDefaultStretchMode() const { return 0; }
00061     virtual bool setStretchMode(int mode) { return false; }
00062     virtual int getStretchMode() const { return 0; }
00063 
00064 #ifdef USE_RGB_COLOR
00065     virtual Graphics::PixelFormat getScreenFormat() const = 0;
00066     virtual Common::List<Graphics::PixelFormat> getSupportedFormats() const = 0;
00067 #endif
00068     virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format = NULL) = 0;
00069     virtual void initSizeHint(const Graphics::ModeList &modes) {}
00070     virtual int getScreenChangeID() const = 0;
00071 
00072     virtual void beginGFXTransaction() = 0;
00073     virtual OSystem::TransactionError endGFXTransaction() = 0;
00074 
00075     // ResidualVM specific method
00076     virtual void setupScreen(uint screenW, uint screenH, bool fullscreen, bool accel3d) = 0;
00077     // ResidualVM specific method
00078     virtual Graphics::PixelBuffer getScreenPixelBuffer() = 0;
00079     // ResidualVM specific method
00080     virtual void suggestSideTextures(Graphics::Surface *left, Graphics::Surface *right) = 0;
00081     // ResidualVM specific method
00082     virtual void saveScreenshot() {}
00083 
00084     virtual int16 getHeight() const = 0;
00085     virtual int16 getWidth() const = 0;
00086     virtual void setPalette(const byte *colors, uint start, uint num) = 0;
00087     virtual void grabPalette(byte *colors, uint start, uint num) const = 0;
00088     virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) = 0;
00089     virtual Graphics::Surface *lockScreen() = 0;
00090     virtual void unlockScreen() = 0;
00091     virtual void fillScreen(uint32 col) = 0;
00092     virtual void updateScreen() = 0;
00093     virtual void setShakePos(int shakeOffset) = 0;
00094     virtual void setFocusRectangle(const Common::Rect& rect) = 0;
00095     virtual void clearFocusRectangle() = 0;
00096 
00097     virtual void showOverlay() = 0;
00098     virtual void hideOverlay() = 0;
00099     virtual Graphics::PixelFormat getOverlayFormat() const = 0;
00100     virtual void clearOverlay() = 0;
00101     virtual void grabOverlay(void *buf, int pitch) const = 0;
00102     virtual void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) = 0;
00103     virtual int16 getOverlayHeight() const = 0;
00104     virtual int16 getOverlayWidth() const = 0;
00105 
00106     virtual bool showMouse(bool visible) = 0;
00107     virtual void warpMouse(int x, int y) = 0;
00108     virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = NULL) = 0;
00109     virtual void setCursorPalette(const byte *colors, uint start, uint num) = 0;
00110 
00111     // ResidualVM specific method
00112     virtual bool lockMouse(bool lock) = 0;
00113 
00114     virtual void displayMessageOnOSD(const char *msg) {}
00115     virtual void displayActivityIconOnOSD(const Graphics::Surface *icon) {}
00116 
00117 
00118     // Graphics::PaletteManager interface
00119     //virtual void setPalette(const byte *colors, uint start, uint num) = 0;
00120     //virtual void grabPalette(byte *colors, uint start, uint num) const = 0;
00121 };
00122 
00123 #endif


Generated on Sat May 25 2019 05:00:46 for ResidualVM by doxygen 1.7.1
curved edge   curved edge