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 #include "texture.h"
13 
14 #include "leak_dumper.h"
15 
16 namespace Shared{ namespace Graphics{
17 
18 // =====================================================
19 //	class Texture
20 // =====================================================
21 
22 const int Texture::defaultSize= 256;
23 
Texture()24 Texture::Texture(){
25 	mipmap= true;
26 	pixmapInit= true;
27 	wrapMode= wmRepeat;
28 	format= fAuto;
29 
30 	inited= false;
31 }
32 
33 // =====================================================
34 //	class Texture1D
35 // =====================================================
36 
load(const string & path)37 void Texture1D::load(const string &path){
38 	this->path= path;
39 	pixmap.load(path);
40 }
41 
42 // =====================================================
43 //	class Texture2D
44 // =====================================================
45 
load(const string & path)46 void Texture2D::load(const string &path){
47 	this->path= path;
48 	pixmap.load(path);
49 }
50 
51 // =====================================================
52 //	class Texture3D
53 // =====================================================
54 
loadSlice(const string & path,int slice)55 void Texture3D::loadSlice(const string &path, int slice){
56 	this->path= path;
57 	pixmap.loadSlice(path, slice);
58 }
59 
60 // =====================================================
61 //	class TextureCube
62 // =====================================================
63 
loadFace(const string & path,int face)64 void TextureCube::loadFace(const string &path, int face){
65 	this->path= path;
66 	pixmap.loadFace(path, face);
67 }
68 
69 }}//end namespace
70