Blender V2.61 - r43446

Texture.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of VideoTexture library
00004 
00005 Copyright (c) 2006 The Zdeno Ash Miklas
00006 
00007 This program is free software; you can redistribute it and/or modify it under
00008 the terms of the GNU Lesser General Public License as published by the Free Software
00009 Foundation; either version 2 of the License, or (at your option) any later
00010 version.
00011 
00012 This program is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00014 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00015 
00016 You should have received a copy of the GNU Lesser General Public License along with
00017 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00018 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00019 http://www.gnu.org/copyleft/lesser.txt.
00020 -----------------------------------------------------------------------------
00021 */
00022 
00027 #if !defined TEXTURE_H
00028 #define TEXTURE_H
00029 
00030 #include <PyObjectPlus.h>
00031 #include <structmember.h>
00032 
00033 #include <DNA_image_types.h>
00034 #include <BL_Texture.h>
00035 #include <KX_BlenderMaterial.h>
00036 
00037 #include "ImageBase.h"
00038 #include "BlendType.h"
00039 #include "Exception.h"
00040 
00041 
00042 // type Texture declaration
00043 struct Texture
00044 {
00045     PyObject_HEAD
00046 
00047     // texture is using blender material
00048     bool m_useMatTexture;
00049 
00050     // video texture bind code
00051     unsigned int m_actTex;
00052     // original texture bind code
00053     unsigned int m_orgTex;
00054     // original texture saved
00055     bool m_orgSaved;
00056 
00057     // texture image for game materials
00058     Image * m_imgTexture;
00059     // texture for blender materials
00060     BL_Texture * m_matTexture;
00061 
00062     // use mipmapping
00063     bool m_mipmap;
00064 
00065     // scaled image buffer
00066     unsigned int * m_scaledImg;
00067     // scaled image buffer size
00068     unsigned int m_scaledImgSize;
00069     // last refresh
00070     double m_lastClock;
00071 
00072     // image source
00073     PyImage * m_source;
00074 };
00075 
00076 
00077 // Texture type description
00078 extern PyTypeObject TextureType;
00079 
00080 // load texture
00081 void loadTexture (unsigned int texId, unsigned int * texture, short * size,
00082                   bool mipmap = false);
00083 
00084 // get material
00085 RAS_IPolyMaterial * getMaterial (PyObject *obj, short matID);
00086 
00087 // get material ID
00088 short getMaterialID (PyObject * obj, const char *name);
00089 
00090 // Exceptions
00091 extern ExceptionID MaterialNotAvail;
00092 
00093 // object type
00094 extern BlendType<KX_GameObject> gameObjectType;
00095 
00096 #endif