blob: 75dc8cf522e16144f6ed4ae9c27d9b8d634db4ed [file] [log] [blame]
swissChilibb478f12020-08-07 20:45:07 -07001#pragma once
2
3#include <stdint.h>
swissChilicc27cfe2020-08-08 12:57:57 -07004#include <stdbool.h>
swissChilibb478f12020-08-07 20:45:07 -07005
swissChili94ba1f52020-08-08 11:39:10 -07006#ifndef SCREEN_ONLY_SDL
7
swissChilibb478f12020-08-07 20:45:07 -07008#undef NK_IMPLEMENTATION
9#define NK_INCLUDE_FIXED_TYPES
10#define NK_INCLUDE_STANDARD_IO
11#define NK_INCLUDE_STANDARD_VARARGS
12#define NK_INCLUDE_DEFAULT_ALLOCATOR
13#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT
14#define NK_INCLUDE_FONT_BAKING
15#define NK_INCLUDE_DEFAULT_FONT
16#include "nuklear/nuklear.h"
17
swissChilibb478f12020-08-07 20:45:07 -070018void screen(struct nk_context *ctx, uint8_t *mem, uint8_t size);
swissChili94ba1f52020-08-08 11:39:10 -070019
20#endif
21
22#include <SDL2/SDL.h>
23
24
25typedef struct
26{
27 SDL_Window *win;
28 SDL_Renderer *r;
swissChilicc27cfe2020-08-08 12:57:57 -070029 SDL_Texture *tex;
swissChili94ba1f52020-08-08 11:39:10 -070030 uint8_t size;
31} sdl_screen_t;
32
33// draw the CPU screen
34sdl_screen_t new_sdl_screen(uint8_t size);
swissChilicc27cfe2020-08-08 12:57:57 -070035void free_sdl_screen(sdl_screen_t *scr);
36bool sdl_screen(sdl_screen_t *scr, uint8_t *mem, bool dirty);
37
38#ifndef NO_PTHREAD
39void *screen_thread(uint8_t *mem);
40void start_screen_thread(uint8_t *mem);
41#endif