1 /***************************************************************************
2                           lodtexture.h  -  Texture with multiple Levels Of Detail
3                              -------------------
4     begin                : do okt 28 2004
5     copyright            : (C) 2004 by CJP
6     email                : cornware-cjp@users.sourceforge.net
7  ***************************************************************************/
8 
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17 
18 #ifndef LODTEXTURE_H
19 #define LODTEXTURE_H
20 
21 #include <GL/gl.h>
22 
23 #include "texture.h"
24 
25 /**
26   *@author CJP
27   */
28 
29 class CLODTexture : public CTexture  {
30 public:
31 	CLODTexture(CDataManager *manager);
32 	virtual ~CLODTexture();
33 
34 	virtual void unload();
35 
36 	int getSizeX(int i) const;
37 	int getSizeY(int i) const;
38 	void draw(int lod) const;
39 
40 	unsigned int getTextureID(int lod) const; //only for low-level hacking to make things faster
41 protected:
42 	GLuint m_Texture2;
43 	GLuint m_Texture3;
44 	GLuint m_Texture4;
45 
46 	int sizex2,sizey2,
47 			sizex3,sizey3,
48 			sizex4,sizey4;
49 
50 	virtual RGBImageRec *loadFromImage(RGBImageRec *in_image, int xs, int ys);
51 };
52 
53 #endif
54