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

driver.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 AUTHORS
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 STARK_GFX_DRIVER_H
00024 #define STARK_GFX_DRIVER_H
00025 
00026 #include "common/rect.h"
00027 #include "graphics/pixelformat.h"
00028 
00029 namespace Graphics {
00030 struct Surface;
00031 }
00032 
00033 namespace Stark {
00034 
00035 class VisualActor;
00036 class VisualProp;
00037 
00038 namespace Gfx {
00039 
00040 class SurfaceRenderer;
00041 class FadeRenderer;
00042 class Texture;
00043 
00044 class Driver {
00045 public:
00046     static Driver *create();
00047 
00048     virtual ~Driver() {}
00049 
00050     virtual void init() = 0;
00051 
00055     void toggleFullscreen() const;
00056 
00057     bool computeScreenViewport();
00058     virtual void setScreenViewport(bool noScaling) = 0; // deprecated
00059 
00060     virtual void setViewport(const Common::Rect &rect) = 0;
00061 
00063     Common::Rect getScreenViewport() { return _screenViewport; }
00064 
00065     Common::Rect gameViewport() const;
00066 
00067     virtual void clearScreen() = 0;
00068     virtual void flipBuffer() = 0;
00069 
00076     virtual Texture *createTexture(const Graphics::Surface *surface = nullptr, const byte *palette = nullptr) = 0;
00077 
00083     virtual VisualActor *createActorRenderer() = 0;
00084 
00090     virtual VisualProp *createPropRenderer() = 0;
00091 
00097     virtual SurfaceRenderer *createSurfaceRenderer() = 0;
00098 
00104     virtual FadeRenderer *createFadeRenderer() = 0;
00105 
00107     bool isPosInScreenBounds(const Common::Point &point) const;
00108 
00110     Common::Point convertCoordinateCurrentToOriginal(const Common::Point &point) const;
00111 
00113     uint scaleWidthOriginalToCurrent(uint width) const;
00114 
00116     uint scaleHeightOriginalToCurrent(uint height) const;
00117 
00119     uint scaleWidthCurrentToOriginal(uint width) const;
00120 
00122     uint scaleHeightCurrentToOriginal(uint width) const;
00123 
00133     static const Graphics::PixelFormat getRGBAPixelFormat();
00134 
00136     virtual Graphics::Surface *getViewportScreenshot() const = 0;
00137 
00138     virtual void set3DMode() = 0;
00139 
00140     static const int32 kOriginalWidth = 640;
00141     static const int32 kOriginalHeight = 480;
00142 
00143     static const int32 kTopBorderHeight = 36;
00144     static const int32 kGameViewportHeight = 365;
00145     static const int32 kBottomBorderHeight = 79;
00146 
00147     static const int32 kGameViewportWidth = 640;
00148 
00149 protected:
00150     static void flipVertical(Graphics::Surface *s);
00151 
00152     Common::Rect _screenViewport;
00153 };
00154 
00155 } // End of namespace Gfx
00156 } // End of namespace Stark
00157 
00158 #endif // STARK_GFX_DRIVER_H


Generated on Sat Sep 14 2019 05:01:20 for ResidualVM by doxygen 1.7.1
curved edge   curved edge