2017-10-04 09:43:31 +00:00
|
|
|
#ifndef gui_h
|
|
|
|
#define gui_h
|
|
|
|
|
|
|
|
#include <SDL2/SDL.h>
|
2017-10-14 11:10:26 +00:00
|
|
|
#include <Core/gb.h>
|
2017-10-04 09:43:31 +00:00
|
|
|
|
|
|
|
extern SDL_Window *window;
|
|
|
|
extern SDL_Renderer *renderer;
|
|
|
|
extern SDL_Texture *texture;
|
|
|
|
extern SDL_PixelFormat *pixel_format;
|
|
|
|
|
|
|
|
enum scaling_mode {
|
|
|
|
GB_SDL_SCALING_ENTIRE_WINDOW,
|
|
|
|
GB_SDL_SCALING_KEEP_RATIO,
|
|
|
|
GB_SDL_SCALING_INTEGER_FACTOR,
|
|
|
|
GB_SDL_SCALING_MAX,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-10-13 22:41:51 +00:00
|
|
|
enum pending_command {
|
|
|
|
GB_SDL_NO_COMMAND,
|
|
|
|
GB_SDL_SAVE_STATE_COMMAND,
|
|
|
|
GB_SDL_LOAD_STATE_COMMAND,
|
|
|
|
GB_SDL_RESET_COMMAND,
|
|
|
|
GB_SDL_NEW_FILE_COMMAND,
|
|
|
|
GB_SDL_TOGGLE_MODEL_COMMAND,
|
2017-10-14 11:10:26 +00:00
|
|
|
GB_SDL_QUIT_COMMAND,
|
2017-10-13 22:41:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern enum pending_command pending_command;
|
|
|
|
extern unsigned command_parameter;
|
2017-12-22 20:25:53 +00:00
|
|
|
typedef struct {
|
|
|
|
SDL_Scancode keys[9];
|
|
|
|
GB_color_correction_mode_t color_correction_mode;
|
|
|
|
enum scaling_mode scaling_mode;
|
|
|
|
} configuration_t;
|
|
|
|
|
|
|
|
extern configuration_t configuration;
|
2017-10-13 22:41:51 +00:00
|
|
|
|
2017-10-04 09:43:31 +00:00
|
|
|
void update_viewport(void);
|
|
|
|
|
2017-10-13 22:41:51 +00:00
|
|
|
void run_gui(bool is_running);
|
2017-10-04 09:43:31 +00:00
|
|
|
#endif
|