 |
raylib-cpp
C++ object-oriented wrapper library for raylib.
|
1 #ifndef RAYLIB_CPP_Texture_HPP_
2 #define RAYLIB_CPP_Texture_HPP_
14 #include "./raylib-cpp-utils.hpp"
15 #include "./Vector2.hpp"
16 #include "./Material.hpp"
22 set(::GetTextureDefault());
37 GETTERSETTER(
unsigned int,Id,
id)
38 GETTERSETTER(
int,Width,width)
39 GETTERSETTER(
int,Height,height)
40 GETTERSETTER(
int,Mipmaps,mipmaps)
41 GETTERSETTER(
int,Format,format)
54 set(::LoadTextureFromImage(image));
61 void Load(
const std::string& fileName) {
62 set(::LoadTexture(fileName.c_str()));
66 ::UnloadTexture(*
this);
70 ::UpdateTexture(*
this, pixels);
75 UpdateTextureRec(*
this, rec, pixels);
80 return ::GetTextureData(*
this);
87 ::GenTextureMipmaps(
this);
92 ::SetTextureFilter(*
this, filterMode);
97 ::SetTextureWrap(*
this, wrapMode);
102 ::DrawTexture(*
this, posX, posY, tint);
107 ::DrawTextureV(*
this, position, tint);
111 ::DrawTextureEx(*
this, position, rotation, scale, tint);
116 ::DrawTextureRec(*
this, sourceRec, position, tint);
120 ::DrawTextureQuad(*
this, tiling, offset, quad, tint);
124 ::DrawTexturePro(*
this, sourceRec, destRec, origin, rotation, tint);
128 ::DrawTextureNPatch(*
this, nPatchInfo, destRec, origin, rotation, tint);
133 ::DrawCubeTexture(*
this, position, width, height, length, color);
138 ::DrawTextureTiled(*
this, sourceRec, destRec, origin, rotation, scale, tint);
148 return ::GetPixelDataSize(width, height, format);
154 width = texture.width;
155 height = texture.height;
156 mipmaps = texture.mipmaps;
157 format = texture.format;
static int GetPixelDataSize(int width, int height, int format)
Provides all the classes associated with raylib-cpp.
Texture & SetWrap(int wrapMode)
Texture & operator=(const Texture &texture)
void LoadTextureCubemap(::Image &image, int layoutType)
Texture & Draw(::Vector2 tiling, ::Vector2 offset, ::Rectangle quad, ::Color tint=WHITE)
Texture & Draw(::NPatchInfo nPatchInfo, ::Rectangle destRec, ::Vector2 origin, float rotation=0, ::Color tint=WHITE)
Texture & UpdateRec(Rectangle rec, const void *pixels)
void set(::Texture texture)
Texture & DrawTiled(Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, float scale, Color tint=WHITE)
Texture & SetMaterialTexture(Material *material, int mapType)
Texture & Draw(::Vector3 position, float width, float height, float length, ::Color color=WHITE)
void Load(const std::string &fileName)
Texture(const std::string &fileName)
Texture & SetFilter(int filterMode)
Texture & Draw(::Rectangle sourceRec, ::Rectangle destRec, ::Vector2 origin, float rotation=0, ::Color tint=WHITE)
Texture & Draw(::Vector2 position, ::Color tint=WHITE)
void LoadFromImage(::Image &image)
Texture & Draw(::Vector2 position, float rotation, float scale=1.0f, ::Color tint=WHITE)
Texture & Update(const void *pixels)
Texture & Draw(::Rectangle sourceRec, ::Vector2 position, ::Color tint=WHITE)
Image GetTextureData() const
Texture & Draw(int posX, int posY, ::Color tint=WHITE)