openMSX
|
Most basic/generic texture: only contains a texture ID. More...
#include <GLUtil.hh>
Public Member Functions | |
Texture (const Texture &)=delete | |
Texture & | operator= (const Texture &)=delete |
Texture (bool interpolation=false, bool wrap=false) | |
Allocate a openGL texture name and enable/disable interpolation. More... | |
Texture (Null) | |
Create null-handle (not yet allocate an openGL handle). More... | |
~Texture () | |
Release openGL texture name. More... | |
Texture (Texture &&other) noexcept | |
Move constructor and assignment. More... | |
Texture & | operator= (Texture &&other) noexcept |
void | allocate () |
Allocate an openGL texture name. More... | |
void | reset () |
Release openGL texture name. More... | |
GLuint | get () const |
Returns the underlying openGL handler id. More... | |
void | bind () |
Makes this texture the active GL texture. More... | |
void | setInterpolation (bool interpolation) |
Enable/disable bilinear interpolation for this texture. More... | |
void | setWrapMode (bool wrap) |
Protected Attributes | |
GLuint | textureId |
Friends | |
class | FrameBufferObject |
Most basic/generic texture: only contains a texture ID.
Current implementation always assumes 2D textures.
|
delete |
|
explicit |
Allocate a openGL texture name and enable/disable interpolation.
Definition at line 29 of file GLUtil.cc.
References allocate(), setInterpolation(), and setWrapMode().
|
inlineexplicit |
|
inline |
|
inlinenoexcept |
void gl::Texture::allocate | ( | ) |
|
inline |
Makes this texture the active GL texture.
The other methods of this class and its subclasses will implicitly bind the texture, so you only need this method to explicitly bind this texture for use in GL function calls outside of this class.
Definition at line 81 of file GLUtil.hh.
References textureId.
Referenced by openmsx::GLImage::draw(), openmsx::GLScaler::execute(), openmsx::GLHQLiteScaler::GLHQLiteScaler(), openmsx::GLHQScaler::GLHQScaler(), openmsx::GLSnow::paint(), gl::ColorTexture::resize(), openmsx::GLHQLiteScaler::scaleImage(), openmsx::GLHQScaler::scaleImage(), openmsx::SDLGLOffScreenSurface::SDLGLOffScreenSurface(), setInterpolation(), setWrapMode(), openmsx::GLHQLiteScaler::uploadBlock(), and openmsx::GLHQScaler::uploadBlock().
|
inline |
Returns the underlying openGL handler id.
0 iff no openGL texture is allocated.
Definition at line 74 of file GLUtil.hh.
References textureId.
Referenced by openmsx::GLImage::draw().
Definition at line 60 of file GLUtil.hh.
References std::swap(), and textureId.
void gl::Texture::reset | ( | ) |
Release openGL texture name.
Definition at line 41 of file GLUtil.cc.
References textureId.
Referenced by ~Texture().
void gl::Texture::setInterpolation | ( | bool | interpolation | ) |
Enable/disable bilinear interpolation for this texture.
IOW selects between GL_NEAREST or GL_LINEAR filtering.
Definition at line 47 of file GLUtil.cc.
References bind().
Referenced by openmsx::GLHQLiteScaler::scaleImage(), openmsx::GLRGBScaler::scaleImage(), openmsx::GLSimpleScaler::scaleImage(), and Texture().
void gl::Texture::setWrapMode | ( | bool | wrap | ) |
|
friend |
|
protected |
Definition at line 93 of file GLUtil.hh.
Referenced by allocate(), bind(), gl::FrameBufferObject::FrameBufferObject(), get(), operator=(), and reset().