1#ifndef YAZE_APP_GFX_BACKEND_SDL3_RENDERER_H_
2#define YAZE_APP_GFX_BACKEND_SDL3_RENDERER_H_
31class SDL3Renderer :
public IRenderer {
34 ~SDL3Renderer()
override;
37 bool Initialize(SDL_Window* window)
override;
38 void Shutdown()
override;
42 TextureHandle CreateTextureWithFormat(
int width,
int height, uint32_t format,
44 void UpdateTexture(TextureHandle texture,
const Bitmap& bitmap)
override;
45 void DestroyTexture(TextureHandle texture)
override;
48 bool LockTexture(TextureHandle texture, SDL_Rect* rect,
void** pixels,
50 void UnlockTexture(TextureHandle texture)
override;
53 void Clear()
override;
54 void Present()
override;
55 void RenderCopy(TextureHandle texture,
const SDL_Rect* srcrect,
56 const SDL_Rect* dstrect)
override;
57 void SetRenderTarget(TextureHandle texture)
override;
58 void SetDrawColor(SDL_Color color)
override;
64 void* GetBackendRenderer()
override {
return renderer_; }
73 static SDL_FRect* ToFRect(
const SDL_Rect* rect, SDL_FRect* frect);
78 SDL_Renderer* renderer_ =
nullptr;
void * TextureHandle
An abstract handle representing a texture.