45 m_Target(GL_TEXTURE_2D),
48 m_FilterMin(GL_LINEAR),
49 m_FilterMag(GL_LINEAR),
59 m_Target(GL_TEXTURE_2D),
62 m_FilterMin(GL_LINEAR),
63 m_FilterMag(GL_LINEAR),
78 m_FilterMin(GL_LINEAR),
79 m_FilterMag(GL_LINEAR),
83 if (!glIsTexture(tex_id))
92 m_Target(GL_TEXTURE_2D),
95 m_FilterMin(GL_LINEAR),
96 m_FilterMag(GL_LINEAR),
108 m_Target(GL_TEXTURE_2D),
111 m_FilterMin(GL_LINEAR),
112 m_FilterMag(GL_LINEAR),
113 m_TexEnv(GL_MODULATE)
117 string msg(
"CGlTexture(): cannot read image");
178 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE,
m_TexEnv);
194 glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
212 glGetIntegerv(GL_PACK_ALIGNMENT, &alignment);
213 glPixelStorei(GL_PACK_ALIGNMENT, 1);
215 glPixelStorei(GL_PACK_ALIGNMENT, alignment);
233 _TRACE(
" no image to load!");
246 gluBuild2DMipmaps(
m_Target, GL_ALPHA,
248 GL_ALPHA, GL_UNSIGNED_BYTE,
255 GL_RGB, GL_UNSIGNED_BYTE,
260 gluBuild2DMipmaps(
m_Target, GL_RGBA,
262 GL_RGBA, GL_UNSIGNED_BYTE,
267 LOG_POST(
Error <<
"CGlTexture::Load(): unhandled image depth");
282 glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA,
static_cast<GLsizei
>(width), 0, GL_RGBA, GL_FLOAT, (GLvoid*)
data);
293 glDeleteTextures (1, &
m_TexId);
static CImage * ReadImage(const string &file, EType type=CImageIO::eUnknown)
size_t GetDepth(void) const
const unsigned char * GetData(void) const
size_t GetWidth(void) const
size_t GetHeight(void) const
unsigned char * SetData(void)
static unsigned char depth[2 *(256+1+29)+1]
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
virtual void MakeCurrent()
virtual CImage * GenerateImage()
virtual void SetParams()
set the gl texture parameters (filtering, etc) for texture
virtual bool IsValid(void) const
void Load1DRGBA(size_t width, float *data)
void Swallow(CImage *image)
void Init(size_t w, size_t h, size_t depth)
void Reset(void)
Reset reference object.
TObjectType * Release(void)
Release a reference to the object and return a pointer to the object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
Standard mechanism to include OpenGL headers for all platforms.
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)