 |
raylib-cpp
C++ object-oriented wrapper library for raylib.
|
1 #ifndef RAYLIB_CPP_TEXTURE2D_HPP_
2 #define RAYLIB_CPP_TEXTURE2D_HPP_
14 #include "./raylib-cpp-utils.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 UpdateTextureRec(*
this, rec, pixels);
88 return ::GetTextureData(*
this);
95 ::GenTextureMipmaps(
this);
100 ::SetTextureFilter(*
this, filterMode);
105 ::SetTextureWrap(*
this, wrapMode);
110 ::DrawTexture(*
this, posX, posY, tint);
115 ::DrawTextureV(*
this, position, tint);
119 ::DrawTextureEx(*
this, position, rotation, scale, tint);
124 ::DrawTextureRec(*
this, sourceRec, position, tint);
128 ::DrawTextureQuad(*
this, tiling, offset, quad, tint);
132 ::DrawTexturePro(*
this, sourceRec, destRec, origin, rotation, tint);
136 ::DrawTextureNPatch(*
this, nPatchInfo, destRec, origin, rotation, tint);
141 ::DrawCubeTexture(*
this, position, width, height, length, color);
146 ::DrawTextureTiled(*
this, sourceRec, destRec, origin, rotation, scale, tint);
156 return ::GetPixelDataSize(width, height, format);
void LoadTextureCubemap(::Image &image, int layoutType)
Provides all the classes associated with raylib-cpp.
void Load(const std::string &fileName)
Texture2D & Draw(::NPatchInfo nPatchInfo, ::Rectangle destRec, ::Vector2 origin, float rotation=0, ::Color tint=WHITE)
Texture2D(::Image &image)
Texture2D & Draw(::Vector3 position, float width, float height, float length, ::Color color=WHITE)
Texture2D & DrawTiled(Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, float scale, Color tint=WHITE)
Texture2D & Update(const void *pixels)
Texture2D & Draw(::Vector2 position, ::Color tint=WHITE)
Texture2D & Draw(int posX, int posY, ::Color tint=WHITE)
Texture2D & SetWrap(int wrapMode)
static int GetPixelDataSize(int width, int height, int format)
Texture2D(const std::string &fileName)
Texture2D & SetFilter(int filterMode)
Texture2D & operator=(const Texture2D &texture)
Texture2D & Draw(::Rectangle sourceRec, ::Vector2 position, ::Color tint=WHITE)
void LoadFromImage(::Image &image)
Texture2D & Draw(::Vector2 position, float rotation, float scale=1.0f, ::Color tint=WHITE)
Texture2D & UpdateRec(Rectangle rec, const void *pixels)
Texture2D & Draw(::Vector2 tiling, ::Vector2 offset, ::Rectangle quad, ::Color tint=WHITE)
Texture2D & Draw(::Rectangle sourceRec, ::Rectangle destRec, ::Vector2 origin, float rotation=0, ::Color tint=WHITE)
Texture2D & SetMaterialTexture(Material *material, int mapType)
void set(::Texture2D texture)