summaryrefslogtreecommitdiff
path: root/Week1-Pacman/src/demo.h
blob: 427a577610b52426b92a484dc956d952a9621ccf (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
#ifndef DEMO_H_
#define DEMO_H_

#include <SDL2/SDL.h>

/*
 * An abstraction layer over the typical SDL_Renderer
 * is meant to handle display scaling mostly
*/
struct demo {
  SDL_Window* win;
  SDL_Renderer* ren;

  float display_scale_x;
  float display_scale_y;
};

void update_demo(struct demo* demo);
void demo_rendercopy(struct demo* demo,
                     SDL_Texture* texture,
                     const SDL_Rect* s_rect,
                     const SDL_Rect* d_rect);
void demo_rendercopy_ex(struct demo* demo,
                     SDL_Texture* texture,
                     const SDL_Rect* s_rect,
                     const SDL_Rect* d_rect,
                     const double angle,
                     const SDL_Point* center,
                     const SDL_RendererFlip flip);

#endif // DEMO_H_