graphic_core.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00034 #ifndef __graphic_core__header__
00035 #define __graphic_core__header__
00036
00037 #include "gpucalc/object.h"
00038
00039 namespace gpucalc
00040 {
00041
00045 enum Vendor
00046 {
00047 DEFAULT = 0,
00048 NVIDIA = 1,
00049 MESA = 2,
00050 GDI = 3,
00051 ATI = 4
00052 };
00053
00057 enum TextureUsage
00058 {
00062 TU_Static = 0,
00063
00067 TU_Render = 1
00068 };
00069
00070
00071 const char _GraphicCoreClassName [] = "GraphicCore";
00072
00073
00083 class _GpuCalcExport GraphicCore: public Object
00084 {
00085
00086
00087 OBJ_DISABLE_COPY(GraphicCore)
00088
00089
00090
00091 public:
00092 GraphicCore(const std::string & GraphicCoreName):
00093 Object(_GraphicCoreClassName, GraphicCoreName)
00094 {
00095 }
00096
00097
00098 virtual ~GraphicCore()
00099 {
00100 }
00101
00102
00109 virtual void start(int argc, char * argv []) = 0;
00110
00111
00117 virtual void stop() = 0;
00118
00119
00127 virtual void setMatrixMode(float Width, float Height) = 0;
00128
00129
00140 virtual void draw(float TexCoordX, float TexCoordY) = 0;
00141
00142
00150 virtual Texture * create(const std::string & TextureName, TextureUsage Usage) = 0;
00151
00152
00156 virtual void initialize(const Data & data, Texture & texture) = 0;
00157
00158
00164 virtual Texture * getTextureByName(const std::string & TextureName) const = 0;
00165
00166
00167 virtual Texture * getActiveTexture() const = 0;
00168
00169
00173 virtual bool isTextureCreated(const std::string & TextureName) const = 0;
00174
00175
00179 virtual void destroy(Texture * texture) = 0;
00180
00181
00187 virtual FrameBuffer * create(const std::string & FrameBufferName) = 0;
00188
00189
00193 virtual FrameBuffer * getFrameBufferByName(const std::string & FrameBufferName) const = 0;
00194
00195
00199 virtual FrameBuffer * getActiveFrameBuffer() const = 0;
00200
00201
00205 virtual bool isFrameBufferCreated(const std::string & FrameBufferName) const = 0;
00206
00207
00208 virtual void bind(Texture * texture) = 0;
00209
00210
00211 virtual void bind(FrameBuffer * framebuffer) = 0;
00212
00213
00214 virtual void unbind(Texture * texture) = 0;
00215
00216
00217 virtual void unbind(FrameBuffer * framebuffer) = 0;
00218
00219
00223 virtual void destroy(FrameBuffer * fb) = 0;
00224
00225
00229 virtual int maxFramebufferAttachmentPoints() const = 0;
00230
00231
00235 virtual int maxTextureSize() const = 0;
00236
00237
00243 virtual void checkErrors(const std::string & where) = 0;
00244
00245
00249 virtual Vendor getVendor() const = 0;
00250
00251
00258 virtual bool isAcceptSystem(const ShaderSystem * System) const = 0;
00259
00260
00266 virtual void addAcceptableShaderSystemID(const std::string & ShaderSystemID) = 0;
00267 };
00268 }
00269
00270 #endif