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 CreateRenderTargetTexture(
int width,
int height)
override;
43 TextureHandle CreateTextureWithFormat(
int width,
int height, uint32_t format,
45 void UpdateTexture(TextureHandle texture,
const Bitmap& bitmap)
override;
46 void DestroyTexture(TextureHandle texture)
override;
49 bool LockTexture(TextureHandle texture, SDL_Rect* rect,
void** pixels,
51 void UnlockTexture(TextureHandle texture)
override;
54 void Clear()
override;
55 void Present()
override;
56 void RenderCopy(TextureHandle texture,
const SDL_Rect* srcrect,
57 const SDL_Rect* dstrect)
override;
58 void SetRenderTarget(TextureHandle texture)
override;
59 void SetDrawColor(SDL_Color color)
override;
65 void* GetBackendRenderer()
override {
return renderer_; }
74 static SDL_FRect* ToFRect(
const SDL_Rect* rect, SDL_FRect* frect);
79 SDL_Renderer* renderer_ =
nullptr;
void Clear()
Clear all context state.
void * TextureHandle
An abstract handle representing a texture.