1 // ============================================================== 2 // This file is part of Glest Shared Library (www.glest.org) 3 // 4 // Copyright (C) 2001-2008 Martiño Figueroa 5 // 6 // You can redistribute this code and/or modify it under 7 // the terms of the GNU General Public License as published 8 // by the Free Software Foundation; either version 2 of the 9 // License, or (at your option) any later version 10 // ============================================================== 11 12 #ifndef _SHARED_GRAPHICS_CONTEXT_H_ 13 #define _SHARED_GRAPHICS_CONTEXT_H_ 14 15 #include "data_types.h" 16 #include "leak_dumper.h" 17 18 namespace Shared{ namespace Graphics{ 19 20 using Platform::uint32; 21 using Platform::int8; 22 23 // ===================================================== 24 // class Context 25 // ===================================================== 26 27 class Context{ 28 protected: 29 uint32 colorBits; 30 uint32 depthBits; 31 uint32 stencilBits; 32 int8 hardware_acceleration; 33 int8 fullscreen_anti_aliasing; 34 float gammaValue; 35 36 public: 37 Context(); ~Context()38 virtual ~Context(){} 39 getColorBits()40 uint32 getColorBits() const {return colorBits;} getDepthBits()41 uint32 getDepthBits() const {return depthBits;} getStencilBits()42 uint32 getStencilBits() const {return stencilBits;} getHardware_acceleration()43 int8 getHardware_acceleration() const { return hardware_acceleration; } getFullscreen_anti_aliasing()44 int8 getFullscreen_anti_aliasing() const { return fullscreen_anti_aliasing; } getGammaValue()45 float getGammaValue() const { return gammaValue; } 46 setColorBits(uint32 colorBits)47 void setColorBits(uint32 colorBits) {this->colorBits= colorBits;} setDepthBits(uint32 depthBits)48 void setDepthBits(uint32 depthBits) {this->depthBits= depthBits;} setStencilBits(uint32 stencilBits)49 void setStencilBits(uint32 stencilBits) {this->stencilBits= stencilBits;} setHardware_acceleration(int8 value)50 void setHardware_acceleration(int8 value) { hardware_acceleration = value; } setFullscreen_anti_aliasing(int8 value)51 void setFullscreen_anti_aliasing(int8 value) { fullscreen_anti_aliasing = value; } setGammaValue(float value)52 void setGammaValue(float value) { gammaValue = value; } 53 54 virtual void init()= 0; 55 virtual void end()= 0; 56 virtual void reset()= 0; 57 58 virtual void makeCurrent()= 0; 59 virtual void swapBuffers()= 0; 60 }; 61 62 }}//end namespace 63 64 #endif 65