nesemu/gui/canvas.h

32 lines
552 B
C
Raw Normal View History

2024-05-17 00:33:37 -04:00
//
// Created by william on 16/05/24.
//
#ifndef NES_EMULATOR_CANVAS_H
#define NES_EMULATOR_CANVAS_H
#include "../include/types.h"
//#define CANVAS_WIDTH 256
//#define CANVAS_HEIGHT 240
2024-05-17 00:33:37 -04:00
typedef struct pixel {
byte r;
byte g;
byte b;
} Pixel;
typedef struct canvas {
int width;
int height;
Pixel *pixels;
2024-05-17 00:33:37 -04:00
} Canvas;
Canvas canvas_init(int width, int height);
void canvas_uninit(Canvas *canvas);
2024-05-17 00:33:37 -04:00
void canvas_draw(Canvas *canvas, Pixel pixel, int x, int y);
void canvas_reset(Canvas *canvas);
#endif //NES_EMULATOR_CANVAS_H