Use std::span to pass vertex data

Starts utilizing
[std::span](https://en.cppreference.com/w/cpp/container/span) to
indicate a non-owning view of a contiguous array of elements rather than
`T* data, usize count`.
This commit is contained in:
Wunkolo 2023-06-16 07:28:35 -07:00
parent c6f5d19983
commit 553d23974a
5 changed files with 32 additions and 24 deletions

View file

@ -1,5 +1,7 @@
#pragma once
#include <array>
#include <span>
#include "helpers.hpp"
#include "logger.hpp"
#include "opengl.hpp"
@ -68,12 +70,14 @@ public:
Renderer(GPU& gpu, const std::array<u32, regNum>& internalRegs) : gpu(gpu), regs(internalRegs) {}
void reset();
void display(); // Display the 3DS screen contents to the window
void initGraphicsContext(); // Initialize graphics context
void getGraphicsContext(); // Set up graphics context for rendering
void clearBuffer(u32 startAddress, u32 endAddress, u32 value, u32 control); // Clear a GPU buffer in VRAM
void displayTransfer(u32 inputAddr, u32 outputAddr, u32 inputSize, u32 outputSize, u32 flags); // Perform display transfer
void drawVertices(OpenGL::Primitives primType, Vertex* vertices, u32 count); // Draw the given vertices
void display(); // Display the 3DS screen contents to the window
void initGraphicsContext(); // Initialize graphics context
void getGraphicsContext(); // Set up graphics context for rendering
void clearBuffer(u32 startAddress, u32 endAddress, u32 value, u32 control); // Clear a GPU buffer in VRAM
void displayTransfer(
u32 inputAddr, u32 outputAddr, u32 inputSize, u32 outputSize, u32 flags
); // Perform display transfer
void drawVertices(OpenGL::Primitives primType, std::span<const Vertex> vertices); // Draw the given vertices
void setFBSize(u32 width, u32 height) {
fbSize.x() = width;