blob: 2563558d2cdae2d3ed2d72384e6befd80ee4d94c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#pragma once
#include <SDL3/SDL.h>
#include <renderer/Renderer.hpp>
class RSoftwareBackend {
public:
struct Canvas {
uint32_t rshift;
uint32_t gshift;
uint32_t bshift;
uint32_t ashift;
int32_t w;
int32_t h;
uint32_t* pixels;
};
public:
RSoftwareBackend(Renderer& renderer);
void Draw();
private:
void Resize(int32_t w, int32_t h);
void SortRenderEntities();
void DrawClear();
void DrawRectangle(REntity_Rectangle& entity);
void DrawAlphaBitmap(REntity_AlphaBitmap& entity);
void DrawFrameString32(REntity_String32& entity);
void DrawTextGlyph(Glyph& glyph, Color color, int32_t xscreen, int32_t yscreen);
private:
Renderer& m_renderer;
uint32_t m_gltexture_id{};
Canvas m_canvas;
};
|