graphic_core.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2008 by Kutumov Alexey                                  *
00003  *   ru.pixel@gmail.com                                                    *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
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

Generated on Thu Mar 5 22:36:42 2009 for gpucalc by  doxygen 1.5.6