Capycore Engine  0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
Loading...
Searching...
No Matches
texture.h
Go to the documentation of this file.
1#pragma once
2#include <memory>
3
4class SDL_Texture; // NOLINT
5
10class Texture final {
11 private:
12 float width_;
13 float height_;
14
15 friend class Renderer;
16 friend class RenderingManager;
17 friend class AssetService;
18 friend class SdlSpriteStrategy;
19 friend class SdlImageStrategy;
20
21 std::unique_ptr<SDL_Texture, void (*)(SDL_Texture*)>
22 texture_; // custom deleter
23 explicit Texture(SDL_Texture* texture);
24
25 public:
26 [[nodiscard]] float width() const;
27 [[nodiscard]] float height() const;
28};
Service responsible for managing game assets such as textures and spritesheets.
Definition assetService.h:20
Service responsible for rendering game objects to the screen.
Definition renderer.h:25
SDL implementation of the image rendering strategy.
Definition sdl_image_strategy.h:16
SDL implementation of the sprite rendering strategy.
Definition sdl_sprite_strategy.h:16
Represents a texture used in rendering game objects. Encapsulates an SDL_Texture and provides access ...
Definition texture.h:10
float height() const
friend class RenderingManager
Definition texture.h:16
float width() const