wut  1.0.0-beta8
Wii U Toolchain
debug.h
Go to the documentation of this file.
1 #pragma once
2 #include <wut.h>
3 #include "surface.h"
4 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
16 
18 {
21 
23 {
25 
29 
31 {
33 
37 
39 {
41  uint32_t version;
42 
44  void (*onShutdown)();
45 
47  void (*setAllocator)();
48 
51  void (*onCaptureStart)(const char *filename);
52 
54  void (*onCaptureEnd)();
55 
58 
60  void (*onAlloc)(void *ptr, uint32_t size, uint32_t align);
61 
63  void (*onFree)(void *ptr);
64 
66  void (*onUnknownMemory)(void *ptr, uint32_t size);
67 
69  void (*setOutputSurface)(GX2Surface *surface);
70 
72  void (*onSwapScanBuffers)(GX2Surface *surface);
73 
77  void (*submitToRing)(void *unk1,
78  uint32_t unk2,
79  uint32_t *unk3,
80  uint64_t *outSubmitTimestamp);
81 };
82 WUT_CHECK_OFFSET(GX2DebugCaptureInterface, 0x00, version);
83 WUT_CHECK_OFFSET(GX2DebugCaptureInterface, 0x04, onShutdown);
84 WUT_CHECK_OFFSET(GX2DebugCaptureInterface, 0x08, setAllocator);
85 WUT_CHECK_OFFSET(GX2DebugCaptureInterface, 0x0C, onCaptureStart);
86 WUT_CHECK_OFFSET(GX2DebugCaptureInterface, 0x10, onCaptureEnd);
87 WUT_CHECK_OFFSET(GX2DebugCaptureInterface, 0x14, isCaptureEnabled);
88 WUT_CHECK_OFFSET(GX2DebugCaptureInterface, 0x18, onAlloc);
89 WUT_CHECK_OFFSET(GX2DebugCaptureInterface, 0x1C, onFree);
90 WUT_CHECK_OFFSET(GX2DebugCaptureInterface, 0x20, onUnknownMemory);
91 WUT_CHECK_OFFSET(GX2DebugCaptureInterface, 0x24, setOutputSurface);
92 WUT_CHECK_OFFSET(GX2DebugCaptureInterface, 0x28, onSwapScanBuffers);
93 WUT_CHECK_OFFSET(GX2DebugCaptureInterface, 0x2C, submitToRing);
94 WUT_CHECK_SIZE(GX2DebugCaptureInterface, 0x30);
95 
96 BOOL
98 
99 
112 void
113 GX2DebugCaptureStart(const char *filename,
115 
116 
120 void
122 
123 
132 void
133 GX2DebugCaptureFrame(const char* filename);
134 
135 
144 void
145 GX2DebugCaptureFrames(const char* filename,
146  uint32_t count);
147 
148 #ifdef __cplusplus
149 }
150 #endif
151 
GX2DebugCaptureInterfaceVersion
Definition: debug.h:17
void(* setAllocator)()
Called from GX2DebugSetCaptureInterface with the default gx2 allocators.
Definition: debug.h:47
BOOL _GX2DebugSetCaptureInterface(GX2DebugCaptureInterface *interface)
void(* onUnknownMemory)(void *ptr, uint32_t size)
UNKNOWN: Called when something happens with some memory.
Definition: debug.h:66
void(* onSwapScanBuffers)(GX2Surface *surface)
Called from GX2SwapScanBuffers with the TV scan buffer.
Definition: debug.h:72
void(* onAlloc)(void *ptr, uint32_t size, uint32_t align)
Called when GX2 memory is allocated.
Definition: debug.h:60
When set GX2DebugCaptureEnd will NOT call GX2Flush.
Definition: debug.h:35
void GX2DebugCaptureFrame(const char *filename)
Will capture the next frame.
void(* onShutdown)()
Called from GX2Shutdown.
Definition: debug.h:44
void(* onCaptureStart)(const char *filename)
Called from GX2DebugCaptureStart, the filename is first argument passed in to GX2DebugCaptureStart.
Definition: debug.h:51
GX2DebugCaptureStartFlags
Definition: debug.h:22
void(* submitToRing)(void *unk1, uint32_t unk2, uint32_t *unk3, uint64_t *outSubmitTimestamp)
Called when a command buffer is ready to be submitted to ring buffer.
Definition: debug.h:77
void(* setOutputSurface)(GX2Surface *surface)
Called from GX2DebugCaptureStart with the TV scan buffer.
Definition: debug.h:69
void(* onCaptureEnd)()
Called from GX2DebugCaptureEnd.
Definition: debug.h:54
BOOL(* isCaptureEnabled)()
Check if capture is enabled.
Definition: debug.h:57
void GX2DebugCaptureStart(const char *filename, GX2DebugCaptureStartFlags flags)
Starts a debug capture.
void GX2DebugCaptureFrames(const char *filename, uint32_t count)
Will capture count frames.
int32_t BOOL
Definition: wut_types.h:4
When set GX2DebugCaptureEnd will NOT call GX2DrawDone.
Definition: debug.h:27
GX2DebugCaptureEndFlags
Definition: debug.h:30
uint32_t version
Must be set to GX2_DEBUG_CAPTURE_INTERFACE_VERSION.
Definition: debug.h:41
void(* onFree)(void *ptr)
Called when GX2 memory is freed.
Definition: debug.h:63
void GX2DebugCaptureEnd(GX2DebugCaptureEndFlags flags)
Ends a debug capture.