cpp-sdl2
C++ header-only SDL2 wrapper
|
Class that represet a renderer texture. More...
#include <texture.hpp>
Classes | |
class | Lock |
Lock object that permit to access pixels directly on texture. More... | |
Public Member Functions | |
Texture (SDL_Texture *t) | |
Construct texture from C SDL_Texture object. More... | |
SDL_Texture * | ptr () const |
Get SDL_Texture pointer from texture. More... | |
Texture (SDL_Renderer *render, Uint32 format, SDL_TextureAccess access, int w, int h) | |
Create texture. More... | |
Texture ()=default | |
Default constructor for empty texture object. More... | |
Texture (SDL_Renderer *render, Uint32 format, SDL_TextureAccess access, Vec2i size) | |
Create texture. More... | |
Texture (SDL_Renderer *render, Surface const &surface) | |
Create texture from surface. More... | |
Texture (SDL_Renderer *render, std::string const &filename) | |
Create texture from file. More... | |
Texture (Texture &&other) noexcept | |
Move texture into this one. More... | |
Texture & | operator= (Texture &&other) noexcept |
Move texture into this one. More... | |
Texture (Texture const &)=delete | |
Non copiable. More... | |
Texture & | operator= (Texture const &)=delete |
Non copiable. More... | |
~Texture () | |
Destroy texture when it's not in use anymore. More... | |
void | set_blendmode (SDL_BlendMode const &bm) const |
Set texture blend mode. More... | |
SDL_BlendMode | blendmode () const |
Get texture blend mode. More... | |
void | set_colormod (Color const &color) const |
Set colormod. More... | |
void | set_colormod (Uint8 r, Uint8 g, Uint8 b) const |
Set colormod. More... | |
Color | colormod () const |
Get colormod. More... | |
void | set_alphamod (Uint8 alpha) const |
Set alphamod. More... | |
Uint8 | alphamod () const |
Set alphamod. More... | |
void | set_coloralphamod (Uint8 r, Uint8 g, Uint8 b, Uint8 a) const |
Set coloralphamod. More... | |
void | set_coloralphamod (Color const &c) const |
Set coloralphamod. More... | |
Color | coloralphamod () const |
Get coloralphamod. More... | |
Uint32 | format () const |
Get texture format. More... | |
int | access () const |
Access texture. More... | |
Vec2i | size () const |
Get texture size. More... | |
Lock | lock () |
lock texture for direct access to content More... | |
Lock | lock (Rect const &rect) |
lock texture rect More... | |
Private Attributes | |
SDL_Texture * | texture_ = nullptr |
Class that represet a renderer texture.
Definition at line 17 of file texture.hpp.
|
inlineexplicit |
Construct texture from C SDL_Texture object.
Definition at line 73 of file texture.hpp.
|
inline |
Create texture.
Definition at line 79 of file texture.hpp.
References sdl::Texture::Lock::Texture, and sdl::Texture::Lock::texture_.
|
default |
Default constructor for empty texture object.
|
inline |
|
inline |
Create texture from surface.
Definition at line 95 of file texture.hpp.
References sdl::Surface::ptr(), and sdl::Texture::Lock::texture_.
|
inline |
Create texture from file.
Definition at line 102 of file texture.hpp.
|
inlinenoexcept |
Move texture into this one.
Definition at line 107 of file texture.hpp.
|
delete |
Non copiable.
|
inline |
Destroy texture when it's not in use anymore.
Definition at line 128 of file texture.hpp.
References sdl::Texture::Lock::texture_.
|
inline |
Access texture.
Definition at line 205 of file texture.hpp.
References sdl::simd::a, and sdl::Texture::Lock::texture_.
Referenced by Texture().
|
inline |
Set alphamod.
Definition at line 167 of file texture.hpp.
References sdl::Texture::Lock::texture_.
Referenced by coloralphamod().
|
inline |
Get texture blend mode.
Definition at line 136 of file texture.hpp.
References sdl::Texture::Lock::texture_.
|
inline |
Get coloralphamod.
Definition at line 188 of file texture.hpp.
References alphamod(), and colormod().
|
inline |
Get colormod.
Definition at line 153 of file texture.hpp.
References sdl::Texture::Lock::texture_.
Referenced by coloralphamod().
|
inline |
Get texture format.
Definition at line 196 of file texture.hpp.
References sdl::Texture::Lock::texture_.
Referenced by Texture().
|
inline |
lock texture for direct access to content
Definition at line 223 of file texture.hpp.
References sdl::Texture::Lock::texture_.
lock texture rect
Definition at line 226 of file texture.hpp.
References sdl::Texture::Lock::texture_.
Move texture into this one.
Definition at line 110 of file texture.hpp.
References sdl::Texture::Lock::Texture, and sdl::Texture::Lock::texture_.
|
inline |
Get SDL_Texture pointer from texture.
Definition at line 76 of file texture.hpp.
References sdl::Texture::Lock::texture_.
|
inline |
Set alphamod.
Definition at line 162 of file texture.hpp.
References sdl::Texture::Lock::texture_.
Referenced by set_coloralphamod().
|
inline |
Set texture blend mode.
Definition at line 131 of file texture.hpp.
References sdl::Texture::Lock::texture_.
|
inline |
Set coloralphamod.
Definition at line 176 of file texture.hpp.
References set_alphamod(), and set_colormod().
|
inline |
Set coloralphamod.
Definition at line 182 of file texture.hpp.
References set_alphamod(), and set_colormod().
|
inline |
Set colormod.
Definition at line 144 of file texture.hpp.
References set_colormod().
Referenced by set_coloralphamod(), and set_colormod().
|
inline |
|
inline |
Get texture size.
Definition at line 214 of file texture.hpp.
References sdl::Texture::Lock::texture_.
|
private |
Definition at line 229 of file texture.hpp.