Files
aurora/lib/dolphin/vi/vi.cpp
T
Luke Street c05e7aace1 Viewport scaling rework & IR configuration (#127)
This is a breaking change: `GXSetViewport`, `GXSetScissor`, `GXSetTexCopySrc`, `GXSetTexCopyDst` now accept logical coords relative to the `VIConfigure` EFB size.

`GXSetViewportRender` and `GXSetScissorRender` are used to override the scaled viewport/scissor from the logical coords.
2026-04-18 14:10:32 -06:00

48 lines
1.4 KiB
C++

#include <dolphin/vi.h>
#include "../../window.hpp"
#include "aurora/math.hpp"
#include "vi_internal.hpp"
#include <optional>
namespace aurora::vi {
std::optional<GXRenderModeObj> g_renderMode;
void configure(const GXRenderModeObj* rm) noexcept {
if (rm == nullptr) {
g_renderMode.reset();
return;
}
g_renderMode = *rm;
}
Vec2<uint32_t> configured_fb_size() noexcept {
if (!g_renderMode) {
return {640, 480};
}
return {g_renderMode->fbWidth, g_renderMode->efbHeight};
}
} // namespace aurora::vi
extern "C" {
void VIInit() {}
void VIConfigure(const GXRenderModeObj* rm) { aurora::vi::configure(rm); }
void VIConfigurePan(u16 xOrg, u16 yOrg, u16 width, u16 height) {
(void)xOrg;
(void)yOrg;
(void)width;
(void)height;
}
u32 VIGetTvFormat() { return 0; }
void VIFlush() {}
void VISetWindowTitle(const char* title) { aurora::window::set_title(title); }
void VISetWindowFullscreen(bool fullscreen) { aurora::window::set_fullscreen(fullscreen); }
bool VIGetWindowFullscreen() { return aurora::window::get_fullscreen(); }
void VISetWindowSize(uint32_t width, uint32_t height) { aurora::window::set_window_size(width, height); }
void VISetWindowPosition(uint32_t x, uint32_t y) { aurora::window::set_window_position(x, y); }
void VICenterWindow() { aurora::window::center_window(); }
void VISetFrameBufferScale(float scale) { aurora::window::set_frame_buffer_scale(scale); }
}