uxn/src/devices/screen.h

39 lines
1.0 KiB
C
Raw Normal View History

2021-12-28 16:37:26 -05:00
#include <stdlib.h>
/*
Copyright (c) 2021 Devine Lu Linvega
Copyright (c) 2021 Andrew Alderwick
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE.
*/
#define FIXED_SIZE 0
typedef struct Layer {
Uint8 *pixels;
Uint8 changed;
} Layer;
2021-12-29 12:11:03 -05:00
typedef struct UxnScreen {
2021-12-28 16:37:26 -05:00
Uint32 palette[4], *pixels;
Uint16 width, height;
Layer fg, bg;
2021-12-29 12:11:03 -05:00
} UxnScreen;
2021-12-28 16:37:26 -05:00
2021-12-29 12:11:03 -05:00
extern UxnScreen uxn_screen;
2021-12-28 16:37:26 -05:00
2021-12-28 20:22:40 -05:00
/* this should probably be done differently */
int set_size(Uint16 width, Uint16 height, int is_resize);
2021-12-29 12:11:03 -05:00
void screen_palette(UxnScreen *p, Uint8 *addr);
void screen_resize(UxnScreen *p, Uint16 width, Uint16 height);
void screen_clear(UxnScreen *p, Layer *layer);
void screen_redraw(UxnScreen *p, Uint32 *pixels);
2021-12-28 16:37:26 -05:00
Uint8 screen_dei(Device *d, Uint8 port);
void screen_deo(Device *d, Uint8 port);