1 #ifndef RAYLIB_CPP_TEXTURE2D_HPP_ 2 #define RAYLIB_CPP_TEXTURE2D_HPP_ 15 #include "Vector2.hpp" 16 #include "Material.hpp" 22 set(::GetTextureDefault());
39 width = texture.width;
40 height = texture.height;
41 mipmaps = texture.mipmaps;
42 format = texture.format;
45 GETTERSETTER(
unsigned int,Id,
id)
46 GETTERSETTER(
int,Width,width)
47 GETTERSETTER(
int,Height,height)
48 GETTERSETTER(
int,Mipmaps,mipmaps)
49 GETTERSETTER(
int,Format,format)
62 set(::LoadTextureFromImage(image));
69 void Load(
const std::string& fileName) {
70 set(::LoadTexture(fileName.c_str()));
74 ::UnloadTexture(*
this);
78 ::UpdateTexture(*
this, pixels);
83 return ::GetTextureData(*
this);
90 ::GenTextureMipmaps(
this);
95 ::SetTextureFilter(*
this, filterMode);
100 ::SetTextureWrap(*
this, wrapMode);
105 ::DrawTexture(*
this, posX, posY, tint);
110 ::DrawTextureV(*
this, position, tint);
114 ::DrawTextureEx(*
this, position, rotation, scale, tint);
119 ::DrawTextureRec(*
this, sourceRec, position, tint);
123 ::DrawTextureQuad(*
this, tiling, offset, quad, tint);
127 ::DrawTexturePro(*
this, sourceRec, destRec, origin, rotation, tint);
131 ::DrawTextureNPatch(*
this, nPatchInfo, destRec, origin, rotation, tint);
136 ::DrawCubeTexture(*
this, position, width, height, length, color);
146 return ::GetPixelDataSize(width, height, format);
static int GetPixelDataSize(int width, int height, int format)
Texture2D & Draw(::Vector2 tiling, ::Vector2 offset, ::Rectangle quad, ::Color tint=WHITE)
void LoadFromImage(::Image &image)
void LoadTextureCubemap(::Image &image, int layoutType)
Texture2D & Update(const void *pixels)
Texture2D & SetFilter(int filterMode)
Texture2D & Draw(::Vector3 position, float width, float height, float length, ::Color color=WHITE)
Texture2D(::Image &image)
Texture2D & SetMaterialTexture(Material *material, int mapType)
Texture2D & Draw(::NPatchInfo nPatchInfo, ::Rectangle destRec, ::Vector2 origin, float rotation=0, ::Color tint=WHITE)
Texture2D & Draw(int posX, int posY, ::Color tint=WHITE)
Texture2D & Draw(::Rectangle sourceRec, ::Rectangle destRec, ::Vector2 origin, float rotation=0, ::Color tint=WHITE)
Texture2D & Draw(::Vector2 position, float rotation, float scale=1.0f, ::Color tint=WHITE)
Texture2D(const std::string &fileName)
Texture2D & operator=(const Texture2D &texture)
void Load(const std::string &fileName)
Provides all the classes associated with raylib-cpp.
Texture2D & SetWrap(int wrapMode)
Texture2D & Draw(::Rectangle sourceRec, ::Vector2 position, ::Color tint=WHITE)
Texture2D & Draw(::Vector2 position, ::Color tint=WHITE)