StelTextureMgr.hpp   StelTextureMgr.hpp 
skipping to change at line 31 skipping to change at line 31
#define _STELTEXTUREMGR_HPP_ #define _STELTEXTUREMGR_HPP_
#include <config.h> #include <config.h>
#include "GLee.h" #include "GLee.h"
#include "fixx11h.h" #include "fixx11h.h"
#include <QObject> #include <QObject>
#include <QMap> #include <QMap>
#include <QMutex> #include <QMutex>
#include "STexture.hpp" #include "StelTexture.hpp"
//! @class ImageLoader //! @class ImageLoader
//! Abstract class for any Image loaders. //! Abstract class for any Image loaders.
class ImageLoader class ImageLoader
{ {
public: public:
struct TexInfo struct TexInfo
{ {
GLsizei width; //! Texture image width GLsizei width; //! Texture image width
GLsizei height; //! Texture image height GLsizei height; //! Texture image height
skipping to change at line 96 skipping to change at line 96
StelTextureMgr(); StelTextureMgr();
virtual ~StelTextureMgr(); virtual ~StelTextureMgr();
//! Initialize some variable from the openGL contex. //! Initialize some variable from the openGL contex.
//! Must be called after the creation of the GLContext. //! Must be called after the creation of the GLContext.
void init(); void init();
//! Load an image from a file and create a new texture from it //! Load an image from a file and create a new texture from it
//! @param filename the texture file name, can be absolute path if s tarts with '/' otherwise //! @param filename the texture file name, can be absolute path if s tarts with '/' otherwise
//! the file will be looked in stellarium standard textures direc tories. //! the file will be looked in stellarium standard textures direc tories.
STextureSP createTexture(const QString& filename); StelTextureSP createTexture(const QString& filename);
//! Load an image from a file and create a new texture from it in a new thread. //! Load an image from a file and create a new texture from it in a new thread.
//! @param url the texture file name or URL, can be absolute path if starts with '/' otherwise //! @param url the texture file name or URL, can be absolute path if starts with '/' otherwise
//! the file will be looked in stellarium standard textures direc tories. //! the file will be looked in stellarium standard textures direc tories.
//! @param fileExtension the file extension to assume. If not set th e extension is determined from url //! @param fileExtension the file extension to assume. If not set th e extension is determined from url
//! @param lazyLoading define whether the texture should be actually loaded only when needed, i.e. when bind() is called the first time. //! @param lazyLoading define whether the texture should be actually loaded only when needed, i.e. when bind() is called the first time.
STextureSP createTextureThread(const QString& url, const QString& fi leExtension="", bool lazyLoading=true); StelTextureSP createTextureThread(const QString& url, const QString& fileExtension="", bool lazyLoading=true);
//! Define if mipmaps must be created while creating textures //! Define if mipmaps must be created while creating textures
void setMipmapsMode(bool b = false) {mipmapsMode = b;} void setMipmapsMode(bool b = false) {mipmapsMode = b;}
//! Define the texture wrapping mode to use while creating textures //! Define the texture wrapping mode to use while creating textures
//! @param m can be either GL_CLAMP, GL_CLAMP_TO_EDGE, or GL_REPEAT. //! @param m can be either GL_CLAMP, GL_CLAMP_TO_EDGE, or GL_REPEAT.
//! See doc for glTexParameter for more info. //! See doc for glTexParameter for more info.
void setWrapMode(GLint m = GL_CLAMP) {wrapMode = m;} void setWrapMode(GLint m = GL_CLAMP) {wrapMode = m;}
//! Define the texture min filter to use while creating textures //! Define the texture min filter to use while creating textures
skipping to change at line 129 skipping to change at line 129
//! Define the texture magnification filter to use while creating te xtures //! Define the texture magnification filter to use while creating te xtures
//! @param m can be either GL_NEAREST, GL_LINEAR //! @param m can be either GL_NEAREST, GL_LINEAR
//! See doc for glTexParameter for more info. //! See doc for glTexParameter for more info.
void setMagFilter(GLint m = GL_LINEAR) {magFilter = m;} void setMagFilter(GLint m = GL_LINEAR) {magFilter = m;}
//! Set default parameters for Mipmap mode, wrap mode, min and mag f ilters //! Set default parameters for Mipmap mode, wrap mode, min and mag f ilters
void setDefaultParams(); void setDefaultParams();
//! Define how the dynamic range of the image will be adapted to fit on 8 bits //! Define how the dynamic range of the image will be adapted to fit on 8 bits
//! Note that using linear mode on 8 bits images does nothing //! Note that using linear mode on 8 bits images does nothing
void setDynamicRangeMode(STextureTypes::DynamicRangeMode dMode = STe xtureTypes::Linear) {dynamicRangeMode = dMode;} void setDynamicRangeMode(StelTextureTypes::DynamicRangeMode dMode = StelTextureTypes::Linear) {dynamicRangeMode = dMode;}
//! Register a new image loader for a given image file extension //! Register a new image loader for a given image file extension
void registerImageLoader(const QString& fileExtension, ImageLoader* loader) void registerImageLoader(const QString& fileExtension, ImageLoader* loader)
{ {
imageLoaders[fileExtension] = loader; imageLoaders[fileExtension] = loader;
} }
private: private:
friend class STexture; friend class StelTexture;
//! Internal //! Internal
STextureSP initTex(); StelTextureSP initTex();
//! Load the image memory //! Load the image memory
bool loadImage(STexture* tex); bool loadImage(StelTexture* tex);
//! Adapt the scaling for the texture. Return true if there was no e rrors //! Adapt the scaling for the texture. Return true if there was no e rrors
bool reScale(STexture* tex); bool reScale(StelTexture* tex);
//! List of image loaders providing image loading for the given file s extensions //! List of image loaders providing image loading for the given file s extensions
QMap<QString, ImageLoader*> imageLoaders; QMap<QString, ImageLoader*> imageLoaders;
bool mipmapsMode; bool mipmapsMode;
GLint wrapMode; GLint wrapMode;
GLint minFilter; GLint minFilter;
GLint magFilter; GLint magFilter;
STextureTypes::DynamicRangeMode dynamicRangeMode; StelTextureTypes::DynamicRangeMode dynamicRangeMode;
//! The maximum texture size supported by the video card //! The maximum texture size supported by the video card
GLint maxTextureSize; GLint maxTextureSize;
//! Whether ARB_texture_non_power_of_two is supported on this card //! Whether ARB_texture_non_power_of_two is supported on this card
bool isNoPowerOfTwoAllowed; bool isNoPowerOfTwoAllowed;
//! Used to correct a bug on some nvidia cards
bool isNoPowerOfTwoLUMINANCEAllowed;
}; };
//! @class TexMalloc //! @class TexMalloc
//! A special multithreaded malloc which manages a memory pool to reuse the memory already allocated for loading previous textures //! A special multithreaded malloc which manages a memory pool to reuse the memory already allocated for loading previous textures.
class TexMalloc class TexMalloc
{ {
public: public:
//! Equivalent to standard C malloc function //! Equivalent to standard C malloc function
static void* malloc(size_t size); static void* malloc(size_t size);
//! Equivalent to standard C free function //! Equivalent to standard C free function
static void free(void *ptr); static void free(void *ptr);
//! Clear the cache and release all memory //! Clear the cache and release all memory
static void clear(); static void clear();
private: private:
 End of changes. 11 change blocks. 
13 lines changed or deleted 10 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/