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 {
00046         static const OSystem::GraphicsMode noGraphicsModes[] = {{"NONE", "Normal", 0}, {nullptr, nullptr, 0 }};
00047         return noGraphicsModes;
00048     };
00049     virtual int getDefaultGraphicsMode() const { return 0; }
00050     virtual bool setGraphicsMode(int mode) { return (mode == 0); }
00051     virtual void resetGraphicsScale() {}
00052     virtual int getGraphicsMode() const { return 0; }
00053     virtual const OSystem::GraphicsMode *getSupportedShaders() const {
00054         static const OSystem::GraphicsMode no_shader[2] = {{"NONE", "Normal (no shader)", 0}, {0, 0, 0}};
00055         return no_shader;
00056     };
00057     virtual int getDefaultShader() const { return 0; }
00058     virtual bool setShader(int id) { return false; }
00059     virtual int getShader() const { return 0; }
00060     virtual const OSystem::GraphicsMode *getSupportedStretchModes() const {
00061         static const OSystem::GraphicsMode noStretchModes[] = {{"NONE", "Normal", 0}, {nullptr, nullptr, 0 }};
00062         return noStretchModes;
00063     }
00064     virtual int getDefaultStretchMode() const { return 0; }
00065     virtual bool setStretchMode(int mode) { return false; }
00066     virtual int getStretchMode() const { return 0; }
00067 
00068 #ifdef USE_RGB_COLOR
00069     virtual Graphics::PixelFormat getScreenFormat() const = 0;
00070     virtual Common::List<Graphics::PixelFormat> getSupportedFormats() const = 0;
00071 #endif
00072     virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format = NULL) = 0;
00073     virtual void initSizeHint(const Graphics::ModeList &modes) {}
00074     virtual int getScreenChangeID() const = 0;
00075 
00076     virtual void beginGFXTransaction() = 0;
00077     virtual OSystem::TransactionError endGFXTransaction() = 0;
00078 
00079     virtual int16 getHeight() const = 0;
00080     virtual int16 getWidth() const = 0;
00081     virtual void setPalette(const byte *colors, uint start, uint num) = 0;
00082     virtual void grabPalette(byte *colors, uint start, uint num) const = 0;
00083     virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) = 0;
00084     virtual Graphics::Surface *lockScreen() = 0;
00085     virtual void unlockScreen() = 0;
00086     virtual void fillScreen(uint32 col) = 0;
00087     virtual void updateScreen() = 0;
00088     virtual void setShakePos(int shakeXOffset, int shakeYOffset) = 0;
00089     virtual void setFocusRectangle(const Common::Rect& rect) = 0;
00090     virtual void clearFocusRectangle() = 0;
00091 
00092     virtual void showOverlay() = 0;
00093     virtual void hideOverlay() = 0;
00094     virtual Graphics::PixelFormat getOverlayFormat() const = 0;
00095     virtual void clearOverlay() = 0;
00096     virtual void grabOverlay(void *buf, int pitch) const = 0;
00097     virtual void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) = 0;
00098     virtual int16 getOverlayHeight() const = 0;
00099     virtual int16 getOverlayWidth() const = 0;
00100 
00101     virtual bool showMouse(bool visible) = 0;
00102     virtual void warpMouse(int x, int y) = 0;
00103     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;
00104     virtual void setCursorPalette(const byte *colors, uint start, uint num) = 0;
00105 
00106     virtual void displayMessageOnOSD(const char *msg) {}
00107     virtual void displayActivityIconOnOSD(const Graphics::Surface *icon) {}
00108 
00109 
00110     // Graphics::PaletteManager interface
00111     //virtual void setPalette(const byte *colors, uint start, uint num) = 0;
00112     //virtual void grabPalette(byte *colors, uint start, uint num) const = 0;
00113 };
00114 
00115 #endif


Generated on Sat Aug 8 2020 05:01:04 for ResidualVM by doxygen 1.7.1
curved edge   curved edge