//
// Created by william on 12/07/24.
//

#ifndef NES_EMULATOR_NAMETABLE_WINDOW_H
#define NES_EMULATOR_NAMETABLE_WINDOW_H

#include "components/window.h"
#include "../include/types.h"

#define NW_SCALE 1
#define NW_ROW_COUNT 60
#define NW_ROW_TILE_COUNT 64

typedef struct nes_nametable_window {
    Window window;
    SDL_Texture *texture;
} NametableWindow;

/**
 * Creates a nametable window instance.
 * @return A reference to the created window
 */
NametableWindow *nametable_window_create(int *window_id);

/**
 * Destroys a nametable window instance.
 * @param window A reference to the window to destroy
 */
void nametable_window_destroy(NametableWindow *window);

/**
 * Updates the content of a nametable window with the current data of the PPU.
 * @param window A reference to the window to update
 */
void nametable_window_update(NametableWindow *window);

/**
 * Renders a nemtable window to the screen.
 * @param window A reference to the window to render
 */
void nametable_window_render(NametableWindow *window);

#endif //NES_EMULATOR_NAMETABLE_WINDOW_H