aboutsummaryrefslogtreecommitdiff
path: root/src/sdl/draw.h
blob: b7e6caa02c9c41a93e404c8617624ce6a305f37e (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
44
#ifndef DRAW_H
#define DRAW_H

#include <stddef.h> // size_t
#include <SDL.h>
#include <SDL_ttf.h>
#include "../core/sok.h" 
#include "../levels/levels.h"
#include "theme.h"
#include "game-state.h"
#include "solve.h"

// arbitrary
#define MAX_SPRITES 32

typedef struct {
  SDL_Renderer * const renderer;

  // FIXME: move to theme eventually
  SDL_Texture *sprites[MAX_SPRITES];
  TTF_Font *font;

  const sok_ctx_t * const ctx;
  const size_t * const level_num;
  const level_t *level;
  const size_t * const zoom;

  // render offset
  int render_ofs_x, render_ofs_y;
  Uint32 ticks, bump_ticks;

  const theme_t * const theme;

  game_state_t state;
  solve_t *solve;
  size_t solve_num_steps;

  Uint32 fade_ticks;
  SDL_Texture *fade_tex;
} draw_ctx_t;

void draw(draw_ctx_t * const);

#endif /* DRAW_H */