您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

68 行
1.1 KiB

#ifndef __GLTEXTUR_H
#define __GLTEXTUR_H
#include <iostream>
#include <string>
#include <vector>
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_opengl.h>
#include "sdlfuncs.h"
namespace segl {
class GLTexture {
private:
GLuint texint;
SDL_Surface *tex;
int width, height;
std::string filename; // wenn von datei geladen
// Parameter
GLint minfilter;
GLint magfilter;
GLint wraps;
GLint wrapt;
bool loaded;
bool texconverted;
bool keepsurface;
bool donotreload;
void init();
bool loadLocalSurface();
void convertLocalSurface();
static std::vector<GLTexture*> alltextures;
protected:
GLTexture(SDL_Surface*);
bool loadSurface(SDL_Surface*, bool = false);
public:
static void reloadAll();
GLTexture();
GLTexture(std::string, GLint=GL_LINEAR, GLint=GL_LINEAR, GLint=GL_REPEAT, GLint=GL_REPEAT);
~GLTexture();
//load
bool loadImage(std::string);
bool selectTexture();
void unloadTexture();
bool setParameter(GLint=0, GLint=0, GLint=0, GLint=0);
inline bool select() { return selectTexture(); }
int getW();
int getH();
bool isLoaded();
};
} // namespace segl
#endif