30 lines
558 B
C
30 lines
558 B
C
//
|
|
// 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 {
|
|
int width;
|
|
int height;
|
|
Pixel *pixels;
|
|
} Canvas;
|
|
|
|
Canvas canvas_init(int width, int height);
|
|
void canvas_uninit(Canvas *canvas);
|
|
|
|
void canvas_draw(Canvas *canvas, Pixel pixel, int index);
|
|
void canvas_draw_pos(Canvas *canvas, Pixel pixel, int x, int y);
|
|
void canvas_reset(Canvas *canvas);
|
|
|
|
#endif //NES_EMULATOR_CANVAS_H
|