| 1 | #pragma once |
| 2 | #include <SDL2/SDL.h> |
| 3 | #include <string> |
| 4 | #include <Nes_Apu.h> |
| 5 | #include "common.hpp" |
| 6 | |
| 7 | namespace GUI { |
| 8 | |
| 9 | // Screen size: |
| 10 | const unsigned WIDTH = 256; |
| 11 | const unsigned HEIGHT = 240; |
| 12 | const int TEXT_CENTER = -1; |
| 13 | const int TEXT_RIGHT = -2; |
| 14 | const unsigned FONT_SZ = 15; |
| 15 | |
| 16 | void init(); |
| 17 | void toggle_pause(); |
| 18 | SDL_Scancode query_key(); |
| 19 | int query_button(); |
| 20 | void run(); |
| 21 | |
| 22 | SDL_Texture* gen_text(std::string text, SDL_Color color); |
| 23 | void render_texture(SDL_Texture* texture, int x, int y); |
| 24 | |
| 25 | u8 get_joypad_state(int n); |
| 26 | void new_frame(u32* pixels); |
| 27 | void new_samples(const blip_sample_t* samples, size_t count); |
| 28 | void set_size(int mul); |
| 29 | |
| 30 | } |
| 31 | |