67 Surface(
int width,
int height,
fge::Color const& color = {0, 0, 0, 255});
68 Surface(Surface
const& r);
69 Surface(Surface&& r)
noexcept;
70 explicit Surface(SDL_Surface* newSurface);
73 Surface& operator=(Surface
const& r);
74 Surface& operator=(Surface&& r)
noexcept;
81 bool create(
int width,
int height,
fge::Color const& color = {0, 0, 0, 255});
82 bool loadFromFile(std::filesystem::path
const& filePath);
83 bool loadFromMemory(
void const* data, std::size_t size);
91 bool saveToFile(std::filesystem::path
const& filePath)
const;
93 [[nodiscard]] fge::Vector2i getSize()
const;
103 bool setPixel(
int x,
int y,
fge::Color const& color);
104 [[nodiscard]] std::optional<fge::Color> getPixel(
int x,
int y)
const;
106 void setCircle(
int x,
int y,
unsigned int radius,
fge::Color const& color);
108 void flipHorizontally();
109 void flipVertically();
111 void stretch(
int width,
int height);
112 enum class ShearBaseSides
117 void shear(
float angle, ShearBaseSides side);
129 bool blitSurface(Surface
const& src, std::optional<SDL_Rect>
const& srcRect, std::optional<SDL_Rect>& dstRect);
154 enum class AngleDirections
160 void addCircle(
int x,
int y,
unsigned int radius,
fge::Color const& color);
161 void addUnfilledCircle(
int x,
166 AngleDirections direction,
168 void addHollowCircle(
int x,
int y,
unsigned int startRadius,
unsigned int endRadius,
fge::Color const& color);
169 void addUnfilledHollowCircle(
int x,
173 unsigned int startRadius,
174 unsigned int endRadius,
175 AngleDirections direction,
185 void set(SDL_Surface* surface);
191 [[nodiscard]] SDL_Surface*
get()
const;
209 SDL_Surface* g_surface;
bool blitSurface(Surface const &src, std::optional< SDL_Rect > const &srcRect, std::optional< SDL_Rect > &dstRect)
Blit a surface on this surface.
Vulkan context.
Definition C_context.hpp:70