-
Notifications
You must be signed in to change notification settings - Fork 1
/
screen.h
42 lines (31 loc) · 882 Bytes
/
screen.h
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
32
33
34
35
36
37
38
39
40
41
42
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include <pthread.h>
#ifndef SCREEN_ONLY_SDL
#undef NK_IMPLEMENTATION
#define NK_INCLUDE_FIXED_TYPES
#define NK_INCLUDE_STANDARD_IO
#define NK_INCLUDE_STANDARD_VARARGS
#define NK_INCLUDE_DEFAULT_ALLOCATOR
#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT
#define NK_INCLUDE_FONT_BAKING
#define NK_INCLUDE_DEFAULT_FONT
#include "nuklear/nuklear.h"
void screen(struct nk_context *ctx, uint8_t *mem, uint8_t size);
#endif
#include <SDL2/SDL.h>
typedef struct
{
SDL_Window *win;
SDL_Renderer *r;
SDL_Texture *tex;
uint8_t size;
} sdl_screen_t;
// draw the CPU screen
sdl_screen_t new_sdl_screen(uint8_t size);
void free_sdl_screen(sdl_screen_t *scr);
bool sdl_screen(sdl_screen_t *scr, uint8_t *mem, bool dirty);
extern bool g_screen_thread_halt;
void *screen_thread(uint8_t *mem);
pthread_t start_screen_thread(uint8_t *mem);