mirror of
https://github.com/encounter/aurora.git
synced 2025-08-03 10:55:36 +00:00
Initial split of aurora into core, gx, and vi libraries, needs more re-org
This commit is contained in:
parent
20755720df
commit
d20c467fec
@ -6,90 +6,11 @@ set(CMAKE_CXX_STANDARD 20)
|
||||
option(AURORA_NATIVE_MATRIX "Assume OpenGL-layout matrices, disables transposing" OFF)
|
||||
|
||||
add_subdirectory(extern)
|
||||
add_library(aurora STATIC
|
||||
lib/aurora.cpp
|
||||
lib/webgpu/gpu.cpp
|
||||
lib/imgui.cpp
|
||||
lib/input.cpp
|
||||
lib/window.cpp
|
||||
lib/gfx/common.cpp
|
||||
lib/gfx/texture.cpp
|
||||
lib/gfx/gx.cpp
|
||||
lib/gfx/gx_shader.cpp
|
||||
lib/gfx/texture_convert.cpp
|
||||
lib/gfx/stream/shader.cpp
|
||||
lib/gfx/model/shader.cpp
|
||||
lib/dolphin/GXBump.cpp
|
||||
lib/dolphin/GXCull.cpp
|
||||
lib/dolphin/GXDispList.cpp
|
||||
lib/dolphin/GXDraw.cpp
|
||||
lib/dolphin/GXExtra.cpp
|
||||
lib/dolphin/GXFifo.cpp
|
||||
lib/dolphin/GXFrameBuffer.cpp
|
||||
lib/dolphin/GXGeometry.cpp
|
||||
lib/dolphin/GXGet.cpp
|
||||
lib/dolphin/GXLighting.cpp
|
||||
lib/dolphin/GXManage.cpp
|
||||
lib/dolphin/GXPerf.cpp
|
||||
lib/dolphin/GXPixel.cpp
|
||||
lib/dolphin/GXTev.cpp
|
||||
lib/dolphin/GXTexture.cpp
|
||||
lib/dolphin/GXTransform.cpp
|
||||
lib/dolphin/GXVert.cpp
|
||||
lib/dolphin/vi.cpp
|
||||
)
|
||||
add_library(aurora::aurora ALIAS aurora)
|
||||
target_compile_definitions(aurora PUBLIC AURORA TARGET_PC)
|
||||
if (AURORA_NATIVE_MATRIX)
|
||||
target_compile_definitions(aurora PRIVATE AURORA_NATIVE_MATRIX)
|
||||
endif ()
|
||||
target_include_directories(aurora PUBLIC include)
|
||||
target_include_directories(aurora PRIVATE ../imgui)
|
||||
if (NOT TARGET SDL3::SDL3-static)
|
||||
find_package(SDL3 REQUIRED)
|
||||
endif ()
|
||||
target_link_libraries(aurora PUBLIC SDL3::SDL3-static fmt::fmt imgui xxhash)
|
||||
if (EMSCRIPTEN)
|
||||
target_link_options(aurora PUBLIC -sUSE_WEBGPU=1 -sASYNCIFY -sEXIT_RUNTIME)
|
||||
target_compile_definitions(aurora PRIVATE ENABLE_BACKEND_WEBGPU)
|
||||
else ()
|
||||
target_link_libraries(aurora PRIVATE dawn::dawn_native dawn::dawn_proc)
|
||||
target_sources(aurora PRIVATE lib/dawn/BackendBinding.cpp)
|
||||
target_compile_definitions(aurora PRIVATE WEBGPU_DAWN)
|
||||
endif ()
|
||||
target_link_libraries(aurora PRIVATE absl::btree absl::flat_hash_map)
|
||||
if (DAWN_ENABLE_VULKAN)
|
||||
target_compile_definitions(aurora PRIVATE DAWN_ENABLE_BACKEND_VULKAN)
|
||||
target_link_libraries(aurora PRIVATE Vulkan::Headers)
|
||||
endif ()
|
||||
if (DAWN_ENABLE_METAL)
|
||||
target_compile_definitions(aurora PRIVATE DAWN_ENABLE_BACKEND_METAL)
|
||||
target_sources(aurora PRIVATE lib/dawn/MetalBinding.mm)
|
||||
set_source_files_properties(lib/dawn/MetalBinding.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
|
||||
endif ()
|
||||
if (DAWN_ENABLE_D3D11)
|
||||
target_compile_definitions(aurora PRIVATE DAWN_ENABLE_BACKEND_D3D11)
|
||||
endif ()
|
||||
if (DAWN_ENABLE_D3D12)
|
||||
target_compile_definitions(aurora PRIVATE DAWN_ENABLE_BACKEND_D3D12)
|
||||
endif ()
|
||||
if (DAWN_ENABLE_DESKTOP_GL OR DAWN_ENABLE_OPENGLES)
|
||||
target_compile_definitions(aurora PRIVATE DAWN_ENABLE_BACKEND_OPENGL)
|
||||
if (DAWN_ENABLE_DESKTOP_GL)
|
||||
target_compile_definitions(aurora PRIVATE DAWN_ENABLE_BACKEND_DESKTOP_GL)
|
||||
endif ()
|
||||
if (DAWN_ENABLE_OPENGLES)
|
||||
target_compile_definitions(aurora PRIVATE DAWN_ENABLE_BACKEND_OPENGLES)
|
||||
endif ()
|
||||
endif ()
|
||||
if (DAWN_ENABLE_NULL)
|
||||
target_compile_definitions(aurora PRIVATE DAWN_ENABLE_BACKEND_NULL)
|
||||
endif ()
|
||||
|
||||
add_library(aurora_main STATIC lib/main.cpp)
|
||||
target_include_directories(aurora_main PUBLIC include)
|
||||
target_link_libraries(aurora_main PUBLIC SDL3::SDL3-static)
|
||||
add_library(aurora::main ALIAS aurora_main)
|
||||
include(cmake/aurora_core.cmake)
|
||||
include(cmake/aurora_gx.cmake)
|
||||
include(cmake/aurora_vi.cmake)
|
||||
include(cmake/aurora_main.cmake)
|
||||
|
||||
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||
add_subdirectory(examples)
|
||||
|
54
cmake/aurora_core.cmake
Normal file
54
cmake/aurora_core.cmake
Normal file
@ -0,0 +1,54 @@
|
||||
add_library(aurora_core STATIC
|
||||
lib/aurora.cpp
|
||||
lib/webgpu/gpu.cpp
|
||||
lib/imgui.cpp
|
||||
lib/input.cpp
|
||||
lib/window.cpp
|
||||
)
|
||||
add_library(aurora::core ALIAS aurora_core)
|
||||
target_compile_definitions(aurora_core PUBLIC AURORA TARGET_PC)
|
||||
if (AURORA_NATIVE_MATRIX)
|
||||
target_compile_definitions(aurora_core PRIVATE AURORA_NATIVE_MATRIX)
|
||||
endif ()
|
||||
target_include_directories(aurora_core PUBLIC include)
|
||||
target_include_directories(aurora_core PRIVATE ../imgui)
|
||||
if (NOT TARGET SDL3::SDL3-static)
|
||||
find_package(SDL3 REQUIRED)
|
||||
endif ()
|
||||
target_link_libraries(aurora_core PUBLIC SDL3::SDL3-static fmt::fmt imgui xxhash)
|
||||
if (EMSCRIPTEN)
|
||||
target_link_options(aurora_core PUBLIC -sUSE_WEBGPU=1 -sASYNCIFY -sEXIT_RUNTIME)
|
||||
target_compile_definitions(aurora_core PRIVATE ENABLE_BACKEND_WEBGPU)
|
||||
else ()
|
||||
target_link_libraries(aurora_core PRIVATE dawn::dawn_native dawn::dawn_proc)
|
||||
target_sources(aurora_core PRIVATE lib/dawn/BackendBinding.cpp)
|
||||
target_compile_definitions(aurora_core PRIVATE WEBGPU_DAWN)
|
||||
endif ()
|
||||
target_link_libraries(aurora_core PRIVATE absl::btree absl::flat_hash_map)
|
||||
if (DAWN_ENABLE_VULKAN)
|
||||
target_compile_definitions(aurora_core PRIVATE DAWN_ENABLE_BACKEND_VULKAN)
|
||||
target_link_libraries(aurora_core PRIVATE Vulkan::Headers)
|
||||
endif ()
|
||||
if (DAWN_ENABLE_METAL)
|
||||
target_compile_definitions(aurora_core PRIVATE DAWN_ENABLE_BACKEND_METAL)
|
||||
target_sources(aurora_core PRIVATE lib/dawn/MetalBinding.mm)
|
||||
set_source_files_properties(lib/dawn/MetalBinding.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
|
||||
endif ()
|
||||
if (DAWN_ENABLE_D3D11)
|
||||
target_compile_definitions(aurora_core PRIVATE DAWN_ENABLE_BACKEND_D3D11)
|
||||
endif ()
|
||||
if (DAWN_ENABLE_D3D12)
|
||||
target_compile_definitions(aurora_core PRIVATE DAWN_ENABLE_BACKEND_D3D12)
|
||||
endif ()
|
||||
if (DAWN_ENABLE_DESKTOP_GL OR DAWN_ENABLE_OPENGLES)
|
||||
target_compile_definitions(aurora_core PRIVATE DAWN_ENABLE_BACKEND_OPENGL)
|
||||
if (DAWN_ENABLE_DESKTOP_GL)
|
||||
target_compile_definitions(aurora_core PRIVATE DAWN_ENABLE_BACKEND_DESKTOP_GL)
|
||||
endif ()
|
||||
if (DAWN_ENABLE_OPENGLES)
|
||||
target_compile_definitions(aurora_core PRIVATE DAWN_ENABLE_BACKEND_OPENGLES)
|
||||
endif ()
|
||||
endif ()
|
||||
if (DAWN_ENABLE_NULL)
|
||||
target_compile_definitions(aurora_core PRIVATE DAWN_ENABLE_BACKEND_NULL)
|
||||
endif ()
|
43
cmake/aurora_gx.cmake
Normal file
43
cmake/aurora_gx.cmake
Normal file
@ -0,0 +1,43 @@
|
||||
add_library(aurora_gx STATIC
|
||||
lib/gfx/common.cpp
|
||||
lib/gfx/texture.cpp
|
||||
lib/gfx/gx.cpp
|
||||
lib/gfx/gx_shader.cpp
|
||||
lib/gfx/texture_convert.cpp
|
||||
lib/gfx/stream/shader.cpp
|
||||
lib/gfx/model/shader.cpp
|
||||
lib/dolphin/gx/GXBump.cpp
|
||||
lib/dolphin/gx/GXCull.cpp
|
||||
lib/dolphin/gx/GXDispList.cpp
|
||||
lib/dolphin/gx/GXDraw.cpp
|
||||
lib/dolphin/gx/GXExtra.cpp
|
||||
lib/dolphin/gx/GXFifo.cpp
|
||||
lib/dolphin/gx/GXFrameBuffer.cpp
|
||||
lib/dolphin/gx/GXGeometry.cpp
|
||||
lib/dolphin/gx/GXGet.cpp
|
||||
lib/dolphin/gx/GXLighting.cpp
|
||||
lib/dolphin/gx/GXManage.cpp
|
||||
lib/dolphin/gx/GXPerf.cpp
|
||||
lib/dolphin/gx/GXPixel.cpp
|
||||
lib/dolphin/gx/GXTev.cpp
|
||||
lib/dolphin/gx/GXTexture.cpp
|
||||
lib/dolphin/gx/GXTransform.cpp
|
||||
lib/dolphin/gx/GXVert.cpp
|
||||
)
|
||||
|
||||
add_library(aurora::gx ALIAS aurora_gx)
|
||||
target_include_directories(aurora_gx PUBLIC include)
|
||||
target_compile_definitions(aurora_gx PUBLIC AURORA TARGET_PC)
|
||||
if (AURORA_NATIVE_MATRIX)
|
||||
target_compile_definitions(aurora_gx PRIVATE AURORA_NATIVE_MATRIX)
|
||||
endif ()
|
||||
target_include_directories(aurora_gx PUBLIC include)
|
||||
target_link_libraries(aurora_gx PUBLIC xxhash)
|
||||
if (EMSCRIPTEN)
|
||||
target_link_options(aurora_gx PUBLIC -sUSE_WEBGPU=1 -sASYNCIFY -sEXIT_RUNTIME)
|
||||
target_compile_definitions(aurora_gx PRIVATE ENABLE_BACKEND_WEBGPU)
|
||||
else ()
|
||||
target_link_libraries(aurora_gx PRIVATE dawn::dawn_native dawn::dawn_proc)
|
||||
target_compile_definitions(aurora_gx PRIVATE WEBGPU_DAWN)
|
||||
endif ()
|
||||
target_link_libraries(aurora_gx PRIVATE absl::btree absl::flat_hash_map)
|
4
cmake/aurora_main.cmake
Normal file
4
cmake/aurora_main.cmake
Normal file
@ -0,0 +1,4 @@
|
||||
add_library(aurora_main STATIC lib/main.cpp)
|
||||
target_include_directories(aurora_main PUBLIC include)
|
||||
target_link_libraries(aurora_main PUBLIC SDL3::SDL3-static)
|
||||
add_library(aurora::main ALIAS aurora_main)
|
7
cmake/aurora_vi.cmake
Normal file
7
cmake/aurora_vi.cmake
Normal file
@ -0,0 +1,7 @@
|
||||
add_library(aurora_vi STATIC
|
||||
lib/dolphin/vi/vi.cpp
|
||||
)
|
||||
target_include_directories(aurora_vi PUBLIC include)
|
||||
target_compile_definitions(aurora_vi PUBLIC AURORA TARGET_PC)
|
||||
|
||||
add_library(aurora::vi ALIAS aurora_vi)
|
@ -1,5 +1,6 @@
|
||||
#include "gx.hpp"
|
||||
|
||||
extern "C" {
|
||||
void GXSetNumIndStages(u8 num) { update_gx_state(g_gxState.numIndStages, num); }
|
||||
|
||||
void GXSetIndTexOrder(GXIndTexStageID indStage, GXTexCoordID texCoord, GXTexMapID texMap) {
|
||||
@ -59,3 +60,4 @@ void GXSetTevIndWarp(GXTevStageID tevStage, GXIndTexStageID indStage, GXBool sig
|
||||
// TODO GXSetTevIndBumpST
|
||||
// TODO GXSetTevIndBumpXYZ
|
||||
// TODO GXSetTevIndRepeat
|
||||
}
|
@ -1,7 +1,10 @@
|
||||
#include "gx.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
void GXSetScissor(u32 left, u32 top, u32 width, u32 height) { aurora::gfx::set_scissor(left, top, width, height); }
|
||||
|
||||
void GXSetCullMode(GXCullMode mode) { update_gx_state(g_gxState.cullMode, mode); }
|
||||
|
||||
// TODO GXSetCoPlanar
|
||||
}
|
@ -1,7 +1,8 @@
|
||||
#include "gx.hpp"
|
||||
|
||||
#include "../gfx/model/shader.hpp"
|
||||
#include "../../gfx/model/shader.hpp"
|
||||
|
||||
extern "C" {
|
||||
void GXBeginDisplayList(void* list, u32 size) {
|
||||
// TODO
|
||||
}
|
||||
@ -14,3 +15,4 @@ u32 GXEndDisplayList() {
|
||||
void GXCallDisplayList(const void* data, u32 nbytes) {
|
||||
aurora::gfx::model::queue_surface(static_cast<const u8*>(data), nbytes);
|
||||
}
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
#include "gx.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
// TODO GXDrawCylinder
|
||||
// TODO GXDrawTorus
|
||||
|
||||
@ -11,3 +13,4 @@ void GXDrawSphere(u8 numMajor, u8 numMinor) { puts("GXDrawSphere is a stub"); }
|
||||
// TODO GXDrawIcosahedron
|
||||
// TODO GXDrawSphere1
|
||||
// TODO GXGenNormalTable
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
#include "gx.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
void GXDestroyTexObj(GXTexObj* obj_) {
|
||||
auto* obj = reinterpret_cast<GXTexObj_*>(obj_);
|
||||
obj->ref.reset();
|
||||
@ -9,3 +11,4 @@ void GXDestroyTlutObj(GXTlutObj* obj_) {
|
||||
auto* obj = reinterpret_cast<GXTlutObj_*>(obj_);
|
||||
obj->ref.reset();
|
||||
}
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
#include "gx.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
static GXFifoObj* GPFifo;
|
||||
static GXFifoObj* CPUFifo;
|
||||
|
||||
@ -45,3 +47,4 @@ void GXSaveCPUFifo(GXFifoObj* fifo) {}
|
||||
// TODO GXGetCurrentGXThread
|
||||
// TODO GXGetOverflowCount
|
||||
// TODO GXResetOverflowCount
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
#include "gx.hpp"
|
||||
|
||||
#include "../window.hpp"
|
||||
#include "../webgpu/wgpu.hpp"
|
||||
#include "../../window.hpp"
|
||||
#include "../../webgpu/wgpu.hpp"
|
||||
|
||||
extern "C" {
|
||||
GXRenderModeObj GXNtsc480IntDf = {
|
||||
@ -13,7 +13,7 @@ GXRenderModeObj GXPal528IntDf = {
|
||||
GXRenderModeObj GXMpal480IntDf = {
|
||||
VI_TVMODE_PAL_INT, 640, 480, 480, 40, 0, 640, 480, VI_XFBMODE_DF, 0, 0,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
void GXAdjustForOverscan(GXRenderModeObj* rmin, GXRenderModeObj* rmout, u16 hor, u16 ver) {
|
||||
*rmout = *rmin;
|
||||
@ -69,3 +69,4 @@ void GXCopyTex(void* dest, GXBool clear) {
|
||||
// TODO GXGetNumXfbLines
|
||||
// TODO GXClearBoundingBox
|
||||
// TODO GXReadBoundingBox
|
||||
}
|
@ -2,6 +2,8 @@
|
||||
|
||||
#include <optional>
|
||||
|
||||
extern "C" {
|
||||
|
||||
void GXSetVtxDesc(GXAttr attr, GXAttrType type) { update_gx_state(g_gxState.vtxDesc[attr], type); }
|
||||
|
||||
void GXSetVtxDescv(GXVtxDescList* list) {
|
||||
@ -53,3 +55,4 @@ void GXSetLineWidth(u8 width, GXTexOffset offs) {
|
||||
|
||||
// TODO GXSetPointSize
|
||||
// TODO GXEnableTexOffsets
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
#include "gx.hpp"
|
||||
|
||||
#include "../gfx/texture.hpp"
|
||||
#include "../../gfx/texture.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
// TODO GXGetVtxDesc
|
||||
// TODO GXGetVtxDescv
|
||||
@ -104,3 +106,4 @@ GXBool GXGetTexObjMipMap(GXTexObj* tex_obj) { return reinterpret_cast<const GXTe
|
||||
// TODO GXGetTlutObjAll
|
||||
// TODO GXGetTexRegionAll
|
||||
// TODO GXGetTlutRegionAll
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
#include "gx.hpp"
|
||||
|
||||
extern "C" {
|
||||
void GXInitLightAttn(GXLightObj* light_, float a0, float a1, float a2, float k0, float k1, float k2) {
|
||||
auto* light = reinterpret_cast<GXLightObj_*>(light_);
|
||||
light->a0 = a0;
|
||||
@ -227,3 +228,4 @@ void GXSetChanCtrl(GXChannelID id, bool lightingEnabled, GXColorSrc ambSrc, GXCo
|
||||
update_gx_state(chan.attnFn, attnFn);
|
||||
update_gx_state(g_gxState.colorChannelState[id].lightMask, GX::LightMask{lightState});
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
#include "gx.hpp"
|
||||
|
||||
extern "C" {
|
||||
static GXDrawDoneCallback DrawDoneCB = nullptr;
|
||||
|
||||
GXFifoObj* GXInit(void* base, u32 size) { return NULL; }
|
||||
@ -33,3 +34,4 @@ void GXTexModeSync() {}
|
||||
|
||||
// TODO IsWriteGatherBufferEmpty
|
||||
// TODO GXSetMisc
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
#include "gx.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
// TODO GXSetGPMetric
|
||||
// TODO GXClearGPMetric
|
||||
// TODO GXReadGPMetric
|
||||
@ -15,3 +17,4 @@
|
||||
// TODO GXReadXfRasMetric
|
||||
// TODO GXInitXfRasMetric
|
||||
// TODO GXReadClksPerVtx
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
#include "gx.hpp"
|
||||
|
||||
extern "C" {
|
||||
void GXSetFog(GXFogType type, float startZ, float endZ, float nearZ, float farZ, GXColor color) {
|
||||
update_gx_state(g_gxState.fog, {type, startZ, endZ, nearZ, farZ, from_gx_color(color)});
|
||||
}
|
||||
@ -44,3 +45,4 @@ void GXSetDstAlpha(bool enabled, u8 value) {
|
||||
|
||||
// TODO GXSetFieldMask
|
||||
// TODO GXSetFieldMode
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
#include "gx.hpp"
|
||||
|
||||
extern "C" {
|
||||
void GXSetTevOp(GXTevStageID id, GXTevMode mode) {
|
||||
GXTevColorArg inputColor = GX_CC_RASC;
|
||||
GXTevAlphaArg inputAlpha = GX_CA_RASA;
|
||||
@ -100,3 +101,4 @@ void GXSetTevSwapModeTable(GXTevSwapSel id, GXTevColorChan red, GXTevColorChan g
|
||||
CHECK(id >= GX_TEV_SWAP0 && id < GX_MAX_TEVSWAP, "bad tev swap sel {}", static_cast<int>(id));
|
||||
update_gx_state(g_gxState.tevSwapTable[id], {red, green, blue, alpha});
|
||||
}
|
||||
}
|
@ -1,9 +1,10 @@
|
||||
#include "gx.hpp"
|
||||
|
||||
#include "../gfx/texture.hpp"
|
||||
#include "../../gfx/texture.hpp"
|
||||
|
||||
#include <absl/container/flat_hash_map.h>
|
||||
|
||||
extern "C" {
|
||||
void GXInitTexObj(GXTexObj* obj_, const void* data, u16 width, u16 height, u32 format, GXTexWrapMode wrapS,
|
||||
GXTexWrapMode wrapT, GXBool mipmap) {
|
||||
memset(obj_, 0, sizeof(GXTexObj));
|
||||
@ -235,3 +236,4 @@ void GXInvalidateTexAll() {
|
||||
// TODO GXSetTexCoordScaleManually
|
||||
// TODO GXSetTexCoordCylWrap
|
||||
// TODO GXSetTexCoordBias
|
||||
}
|
@ -2,6 +2,8 @@
|
||||
|
||||
#include <cfloat>
|
||||
|
||||
extern "C" {
|
||||
|
||||
constexpr aurora::Mat4x4<float> DepthCorrect{
|
||||
{1.f, 0.f, 0.f, 0.f},
|
||||
{0.f, 1.f, 0.f, 0.f},
|
||||
@ -109,3 +111,4 @@ void GXSetViewportJitter(float left, float top, float width, float height, float
|
||||
// TODO GXSetZScaleOffset
|
||||
// TODO GXSetScissorBoxOffset
|
||||
// TODO GXSetClipMode
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
#include "gx.hpp"
|
||||
|
||||
#include "../gfx/stream/shader.hpp"
|
||||
#include "../../gfx/stream/shader.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <optional>
|
||||
@ -40,13 +40,14 @@ struct SStreamState {
|
||||
}
|
||||
#ifndef NDEBUG
|
||||
nextAttr = next_attr(0);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
static std::optional<SStreamState> sStreamState;
|
||||
static u16 lastVertexStart = 0;
|
||||
|
||||
extern "C" {
|
||||
void GXBegin(GXPrimitive primitive, GXVtxFmt vtxFmt, u16 nVerts) {
|
||||
CHECK(!sStreamState, "Stream began twice!");
|
||||
uint16_t vertexSize = 0;
|
||||
@ -185,3 +186,4 @@ void GXEnd() {
|
||||
lastVertexStart = sStreamState->vertexStart + sStreamState->vertexCount;
|
||||
sStreamState.reset();
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "../internal.hpp"
|
||||
#include "../gfx/gx.hpp"
|
||||
#include "../../internal.hpp"
|
||||
#include "../../gfx/gx.hpp"
|
||||
|
||||
static aurora::Module Log("aurora::gx");
|
||||
|
@ -1,7 +1,8 @@
|
||||
#include <dolphin/vi.h>
|
||||
|
||||
#include "../window.hpp"
|
||||
#include "../../window.hpp"
|
||||
|
||||
extern "C" {
|
||||
void VIInit() {}
|
||||
u32 VIGetTvFormat() { return 0; }
|
||||
void VIFlush() {}
|
||||
@ -9,3 +10,4 @@ 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(); }
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user