58 lines
1.2 KiB
C
58 lines
1.2 KiB
C
//
|
|
// Created by william on 16/05/24.
|
|
//
|
|
|
|
#ifndef NES_EMULATOR_GUI_H
|
|
#define NES_EMULATOR_GUI_H
|
|
|
|
#include <stdbool.h>
|
|
#include <SDL_ttf.h>
|
|
|
|
typedef enum {
|
|
WINDOW_TYPE_MAIN = 0,
|
|
WINDOW_TYPE_NAMETABLE = 1,
|
|
WINDOW_TYPE_PATTERN_TABLE = 2,
|
|
} WindowType;
|
|
#define WINDOW_TYPE_MAX WINDOW_TYPE_PATTERN_TABLE
|
|
|
|
/**
|
|
* Initializes the graphical user interface of the emulator.
|
|
* @return A boolean indicating if the GUI was successfully initialized.
|
|
*/
|
|
bool gui_init();
|
|
|
|
/**
|
|
* Free the resources used by the graphical user interface.
|
|
*/
|
|
void gui_free();
|
|
|
|
/**
|
|
* Creates and open a window. If a window of the given type already exists, focus it.
|
|
* @param type The type of window to open.
|
|
*/
|
|
void gui_window_create(WindowType type);
|
|
|
|
/**
|
|
* Process user input events received since the last call to gui_input.
|
|
* @return An integer indicating if the user closed the main window (-1).
|
|
*/
|
|
int gui_input();
|
|
|
|
/**
|
|
* Renders the graphical user interface to the screen.
|
|
*/
|
|
void gui_render();
|
|
|
|
/**
|
|
* Blocks until the next frame should be drawn, making the frame rate 60 hertz.
|
|
*/
|
|
void gui_delay();
|
|
|
|
/**
|
|
* Gets the font used for the graphical user interface.
|
|
* @return A reference to the TTF font.
|
|
*/
|
|
TTF_Font* gui_get_font();
|
|
|
|
#endif //NES_EMULATOR_GUI_H
|