esc
Externally Scriptable Editor
git clone git://mccd.space/esc
| Log | Files | Refs | README |
renderer.h (654B)
1 #ifndef RENDERER_H
2 #define RENDERER_H
3
4 #include "editor.h"
5 #include <SDL3/SDL.h>
6 #include <SDL3_ttf/SDL_ttf.h>
7
8 typedef struct {
9 SDL_Renderer *renderer;
10 TTF_Font *font;
11 TTF_Font *bold_font;
12 int char_width;
13 float line_height;
14 float cursor_height;
15 float scroll_x;
16 float scroll_y;
17 int render_w;
18 int render_h;
19 float margin;
20 } RenderCtx;
21
22 void render_ctx_init(RenderCtx *ctx, SDL_Renderer *renderer,
23 TTF_Font *font, TTF_Font *bold_font,
24 int char_width, float line_height, float cursor_height);
25 void render_editor(RenderCtx *ctx, const Editor *ed);
26
27 #endif