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"
|
|
|
|
|
|
|
|
typedef struct pixel {
|
|
|
|
byte r;
|
|
|
|
byte g;
|
|
|
|
byte b;
|
|
|
|
} Pixel;
|
|
|
|
|
|
|
|
typedef struct canvas {
|
2024-05-17 11:40:02 -04:00
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
Pixel *pixels;
|
2024-05-17 00:33:37 -04:00
|
|
|
} Canvas;
|
|
|
|
|
2024-05-17 11:40:02 -04:00
|
|
|
Canvas canvas_init(int width, int height);
|
|
|
|
void canvas_uninit(Canvas *canvas);
|
|
|
|
|
2024-05-17 13:16:21 -04:00
|
|
|
void canvas_draw(Canvas *canvas, Pixel pixel, int index);
|
|
|
|
void canvas_draw_pos(Canvas *canvas, Pixel pixel, int x, int y);
|
2024-05-17 00:33:37 -04:00
|
|
|
void canvas_reset(Canvas *canvas);
|
|
|
|
|
|
|
|
#endif //NES_EMULATOR_CANVAS_H
|