1 /* ResidualVM - A 3D game interpreter 2 * 3 * ResidualVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the AUTHORS 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 */ 22 23 #ifndef STARK_GFX_SURFACE_RENDERER_H 24 #define STARK_GFX_SURFACE_RENDERER_H 25 26 #include "common/rect.h" 27 28 namespace Stark { 29 namespace Gfx { 30 31 class Texture; 32 33 /** 34 * A renderer to draw textures as two dimensional surfaces to the current viewport 35 */ 36 class SurfaceRenderer { 37 public: 38 SurfaceRenderer(); 39 virtual ~SurfaceRenderer(); 40 41 /** 42 * Draw a 2D surface from the specified texture 43 */ 44 virtual void render(const Texture *texture, const Common::Point &dest) = 0; 45 46 /** 47 * When this is set to true, the texture size is expected to be in current 48 * coordinates, and is to be drawn without scaling. 49 * 50 * This setting does not affect the destination point coordinates 51 */ 52 void setNoScalingOverride(bool noScalingOverride); 53 54 /** 55 * The fade level is added to the color value of each pixel 56 * 57 * It is a value between -1 and 1 58 */ 59 void setFadeLevel(float fadeLevel); 60 61 protected: 62 bool _noScalingOverride; 63 float _fadeLevel; 64 }; 65 66 } // End of namespace Gfx 67 } // End of namespace Stark 68 69 #endif // STARK_GFX_SURFACE_RENDERER_H 70