Created
January 17, 2025 18:42
-
-
Save metaleap/e68e8eb9da68d94adeea7a5d585901d6 to your computer and use it in GitHub Desktop.
CWicked wrapup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <stdint.h> | |
#ifdef __cplusplus | |
extern "C" { | |
#endif | |
/// C-only API: | |
// wi::initializer | |
typedef enum WI_INITIALIZED_SYSTEM { | |
WI_INITIALIZED_SYSTEM_FONT, | |
WI_INITIALIZED_SYSTEM_IMAGE, | |
WI_INITIALIZED_SYSTEM_INPUT, | |
WI_INITIALIZED_SYSTEM_RENDERER, | |
WI_INITIALIZED_SYSTEM_TEXTUREHELPER, | |
WI_INITIALIZED_SYSTEM_HAIRPARTICLESYSTEM, | |
WI_INITIALIZED_SYSTEM_EMITTEDPARTICLESYSTEM, | |
WI_INITIALIZED_SYSTEM_OCEAN, | |
WI_INITIALIZED_SYSTEM_GPUSORTLIB, | |
WI_INITIALIZED_SYSTEM_GPUBVH, | |
WI_INITIALIZED_SYSTEM_PHYSICS, | |
WI_INITIALIZED_SYSTEM_LUA, | |
WI_INITIALIZED_SYSTEM_AUDIO, | |
WI_INITIALIZED_SYSTEM_TRAILRENDERER, | |
WI_INITIALIZED_SYSTEM_COUNT | |
} WI_INITIALIZED_SYSTEM; | |
// DirectXMath.h | |
typedef struct WiXMFLOAT4 { | |
float x; | |
float y; | |
float z; | |
float w; | |
} WI_XMFLOAT4; | |
typedef struct WiXMFLOAT3 { | |
float x; | |
float y; | |
float z; | |
} WI_XMFLOAT3; | |
typedef struct WiXMFLOAT2 { | |
float x; | |
float y; | |
} WI_XMFLOAT2; | |
// wi:: | |
typedef struct WiColor { | |
uint32_t rgba; | |
} WiColor; | |
typedef struct WiColor16 { | |
uint64_t rgba; | |
} WiColor16; | |
typedef struct WiCanvas { | |
uintptr_t _; | |
uint32_t width; | |
uint32_t height; | |
float dpi6; | |
float scaling; // custom DPI scaling factor (optional) | |
} WiCanvas; | |
// wi::input | |
typedef struct WiControllerFeedback { | |
float vibration_left; // left vibration motor (0: no vibration, 1: maximum vibration) | |
float vibration_right; // right vibration motor (0: no vibration, 1: maximum vibration) | |
WiColor led_color; // led color | |
} WiControllerFeedback; | |
typedef enum WI_GAMEPAD_ANALOG { | |
WI_GAMEPAD_ANALOG_THUMBSTICK_L, | |
WI_GAMEPAD_ANALOG_THUMBSTICK_R, | |
WI_GAMEPAD_ANALOG_TRIGGER_L, | |
WI_GAMEPAD_ANALOG_TRIGGER_R, | |
} WI_GAMEPAD_ANALOG; | |
typedef struct WiControllerState { | |
uint32_t buttons; | |
WI_XMFLOAT2 thumbstick_L; | |
WI_XMFLOAT2 thumbstick_R; | |
float trigger_L; | |
float trigger_R; | |
} WiControllerState; | |
typedef struct WiMouseState { | |
WI_XMFLOAT2 position; | |
WI_XMFLOAT2 delta_position; | |
float delta_wheel; | |
float pressure; | |
bool left_button_press; | |
bool middle_button_press; | |
bool right_button_press; | |
} WiMouseState; | |
typedef enum WI_BUTTON { | |
WI_BUTTON_NONE = 0, | |
WI_DIGIT_RANGE_START = 48, // digit 0 | |
WI_CHARACTER_RANGE_START = 65, // letter A | |
WI_GAMEPAD_RANGE_START = 256, // do not use! | |
WI_GAMEPAD_BUTTON_UP, | |
WI_GAMEPAD_BUTTON_LEFT, | |
WI_GAMEPAD_BUTTON_DOWN, | |
WI_GAMEPAD_BUTTON_RIGHT, | |
WI_GAMEPAD_BUTTON_1, | |
WI_GAMEPAD_BUTTON_2, | |
WI_GAMEPAD_BUTTON_3, | |
WI_GAMEPAD_BUTTON_4, | |
WI_GAMEPAD_BUTTON_5, | |
WI_GAMEPAD_BUTTON_6, | |
WI_GAMEPAD_BUTTON_7, | |
WI_GAMEPAD_BUTTON_8, | |
WI_GAMEPAD_BUTTON_9, | |
WI_GAMEPAD_BUTTON_10, | |
WI_GAMEPAD_BUTTON_11, | |
WI_GAMEPAD_BUTTON_12, | |
WI_GAMEPAD_BUTTON_13, | |
WI_GAMEPAD_BUTTON_14, | |
// Check analog presses like a button: | |
WI_GAMEPAD_ANALOG_THUMBSTICK_L_AS_BUTTON_UP, | |
WI_GAMEPAD_ANALOG_THUMBSTICK_L_AS_BUTTON_LEFT, | |
WI_GAMEPAD_ANALOG_THUMBSTICK_L_AS_BUTTON_DOWN, | |
WI_GAMEPAD_ANALOG_THUMBSTICK_L_AS_BUTTON_RIGHT, | |
WI_GAMEPAD_ANALOG_THUMBSTICK_R_AS_BUTTON_UP, | |
WI_GAMEPAD_ANALOG_THUMBSTICK_R_AS_BUTTON_LEFT, | |
WI_GAMEPAD_ANALOG_THUMBSTICK_R_AS_BUTTON_DOWN, | |
WI_GAMEPAD_ANALOG_THUMBSTICK_R_AS_BUTTON_RIGHT, | |
WI_GAMEPAD_ANALOG_TRIGGER_L_AS_BUTTON, | |
WI_GAMEPAD_ANALOG_TRIGGER_R_AS_BUTTON, | |
// Xbox mapping of generic codes: | |
WI_GAMEPAD_BUTTON_XBOX_X = WI_GAMEPAD_BUTTON_1, | |
WI_GAMEPAD_BUTTON_XBOX_A = WI_GAMEPAD_BUTTON_2, | |
WI_GAMEPAD_BUTTON_XBOX_B = WI_GAMEPAD_BUTTON_3, | |
WI_GAMEPAD_BUTTON_XBOX_Y = WI_GAMEPAD_BUTTON_4, | |
WI_GAMEPAD_BUTTON_XBOX_L1 = WI_GAMEPAD_BUTTON_5, | |
WI_GAMEPAD_BUTTON_XBOX_LT = WI_GAMEPAD_ANALOG_TRIGGER_L_AS_BUTTON, | |
WI_GAMEPAD_BUTTON_XBOX_R1 = WI_GAMEPAD_BUTTON_6, | |
WI_GAMEPAD_BUTTON_XBOX_RT = WI_GAMEPAD_ANALOG_TRIGGER_R_AS_BUTTON, | |
WI_GAMEPAD_BUTTON_XBOX_L3 = WI_GAMEPAD_BUTTON_7, | |
WI_GAMEPAD_BUTTON_XBOX_R3 = WI_GAMEPAD_BUTTON_8, | |
WI_GAMEPAD_BUTTON_XBOX_BACK = WI_GAMEPAD_BUTTON_9, | |
WI_GAMEPAD_BUTTON_XBOX_START = WI_GAMEPAD_BUTTON_10, | |
// Playstation mapping of generic codes: | |
WI_GAMEPAD_BUTTON_PLAYSTATION_SQUARE = WI_GAMEPAD_BUTTON_1, | |
WI_GAMEPAD_BUTTON_PLAYSTATION_CROSS = WI_GAMEPAD_BUTTON_2, | |
WI_GAMEPAD_BUTTON_PLAYSTATION_CIRCLE = WI_GAMEPAD_BUTTON_3, | |
WI_GAMEPAD_BUTTON_PLAYSTATION_TRIANGLE = WI_GAMEPAD_BUTTON_4, | |
WI_GAMEPAD_BUTTON_PLAYSTATION_L1 = WI_GAMEPAD_BUTTON_5, | |
WI_GAMEPAD_BUTTON_PLAYSTATION_L2 = WI_GAMEPAD_ANALOG_TRIGGER_L_AS_BUTTON, | |
WI_GAMEPAD_BUTTON_PLAYSTATION_R1 = WI_GAMEPAD_BUTTON_6, | |
WI_GAMEPAD_BUTTON_PLAYSTATION_R2 = WI_GAMEPAD_ANALOG_TRIGGER_R_AS_BUTTON, | |
WI_GAMEPAD_BUTTON_PLAYSTATION_L3 = WI_GAMEPAD_BUTTON_7, | |
WI_GAMEPAD_BUTTON_PLAYSTATION_R3 = WI_GAMEPAD_BUTTON_8, | |
WI_GAMEPAD_BUTTON_PLAYSTATION_SHARE = WI_GAMEPAD_BUTTON_9, | |
WI_GAMEPAD_BUTTON_PLAYSTATION_OPTION = WI_GAMEPAD_BUTTON_10, | |
WI_GAMEPAD_BUTTON_PLAYSTATION_SELECT = WI_GAMEPAD_BUTTON_PLAYSTATION_SHARE, | |
WI_GAMEPAD_BUTTON_PLAYSTATION_START = WI_GAMEPAD_BUTTON_PLAYSTATION_OPTION, | |
WI_GAMEPAD_RANGE_END = 512, // do not use! | |
WI_MOUSE_BUTTON_LEFT, | |
WI_MOUSE_BUTTON_RIGHT, | |
WI_MOUSE_BUTTON_MIDDLE, | |
// Detect mouse scroll like a button: | |
WI_MOUSE_SCROLL_AS_BUTTON_UP, | |
WI_MOUSE_SCROLL_AS_BUTTON_DOWN, | |
WI_KEYBOARD_BUTTON_UP, | |
WI_KEYBOARD_BUTTON_DOWN, | |
WI_KEYBOARD_BUTTON_LEFT, | |
WI_KEYBOARD_BUTTON_RIGHT, | |
WI_KEYBOARD_BUTTON_SPACE, | |
WI_KEYBOARD_BUTTON_RSHIFT, | |
WI_KEYBOARD_BUTTON_LSHIFT, | |
WI_KEYBOARD_BUTTON_F1, | |
WI_KEYBOARD_BUTTON_F2, | |
WI_KEYBOARD_BUTTON_F3, | |
WI_KEYBOARD_BUTTON_F4, | |
WI_KEYBOARD_BUTTON_F5, | |
WI_KEYBOARD_BUTTON_F6, | |
WI_KEYBOARD_BUTTON_F7, | |
WI_KEYBOARD_BUTTON_F8, | |
WI_KEYBOARD_BUTTON_F9, | |
WI_KEYBOARD_BUTTON_F10, | |
WI_KEYBOARD_BUTTON_F11, | |
WI_KEYBOARD_BUTTON_F12, | |
WI_KEYBOARD_BUTTON_ENTER, | |
WI_KEYBOARD_BUTTON_ESCAPE, | |
WI_KEYBOARD_BUTTON_HOME, | |
WI_KEYBOARD_BUTTON_RCONTROL, | |
WI_KEYBOARD_BUTTON_LCONTROL, | |
WI_KEYBOARD_BUTTON_DELETE, | |
WI_KEYBOARD_BUTTON_BACKSPACE, | |
WI_KEYBOARD_BUTTON_PAGEDOWN, | |
WI_KEYBOARD_BUTTON_PAGEUP, | |
WI_KEYBOARD_BUTTON_NUMPAD0, | |
WI_KEYBOARD_BUTTON_NUMPAD1, | |
WI_KEYBOARD_BUTTON_NUMPAD2, | |
WI_KEYBOARD_BUTTON_NUMPAD3, | |
WI_KEYBOARD_BUTTON_NUMPAD4, | |
WI_KEYBOARD_BUTTON_NUMPAD5, | |
WI_KEYBOARD_BUTTON_NUMPAD6, | |
WI_KEYBOARD_BUTTON_NUMPAD7, | |
WI_KEYBOARD_BUTTON_NUMPAD8, | |
WI_KEYBOARD_BUTTON_NUMPAD9, | |
WI_KEYBOARD_BUTTON_MULTIPLY, | |
WI_KEYBOARD_BUTTON_ADD, | |
WI_KEYBOARD_BUTTON_SEPARATOR, | |
WI_KEYBOARD_BUTTON_SUBTRACT, | |
WI_KEYBOARD_BUTTON_DECIMAL, | |
WI_KEYBOARD_BUTTON_DIVIDE, | |
WI_KEYBOARD_BUTTON_TAB, | |
WI_KEYBOARD_BUTTON_TILDE, | |
WI_KEYBOARD_BUTTON_INSERT, | |
WI_KEYBOARD_BUTTON_ALT, | |
WI_KEYBOARD_BUTTON_ALTGR, | |
// must be the last entry | |
WI_BUTTON_ENUM_SIZE | |
} WI_BUTTON; | |
typedef struct WiKeyboardState { | |
bool buttons[WI_BUTTON_ENUM_SIZE]; // it contains pressed buttons as "keyboard/typewriter" like, so no continuous presses | |
} WiKeyboardState; | |
// wi::graphics | |
typedef struct WiViewport { | |
float top_left_x; | |
float top_left_y; | |
float width; | |
float height; | |
float min_depth; | |
float max_depth; | |
} WiViewport; | |
typedef struct WiRect { | |
int32_t left; | |
int32_t top; | |
int32_t right; | |
int32_t bottom; | |
} WiRect; | |
// wi::jobsystem | |
typedef struct WiJobArgs { | |
uint32_t jobIndex; // job index relative to dispatch (like SV_DispatchThreadID in HLSL) | |
uint32_t groupID; // group index relative to dispatch (like SV_GroupID in HLSL) | |
uint32_t groupIndex; // job index relative to group (like SV_GroupIndex in HLSL) | |
bool isFirstJobInGroup; // is the current job the first one in the group? | |
bool isLastJobInGroup; // is the current job the last one in the group? | |
void* sharedmemory; // stack memory shared within the current group (jobs within a group execute serially) | |
} WiJobArgs; | |
typedef enum WiJobPriority { | |
WI_JOBPRIORITY_HIGH, | |
WI_JOBPRIORITY_LOW, | |
WI_JOBPRIORITY_STREAMING, | |
WI_JOBPRIORITY_COUNT, | |
} WiJobPriority; | |
// Defines a state of execution, can be waited on | |
typedef struct WiJobContext { | |
volatile long counter; | |
WiJobPriority priority; | |
} WiJobContext; | |
// wi::scene | |
/// | |
#ifdef __cplusplus | |
} // extern "C" | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "./copied.h" | |
#ifdef __cplusplus | |
extern "C" { | |
#endif | |
/// own stuff: | |
typedef enum WI_ON { | |
WI_ON_APP_INITIALIZE, | |
WI_ON_RENDERPATH_LOAD, | |
WI_ON_RENDERPATH_START, | |
WI_ON_RENDERPATH_STOP, | |
WI_ON_RENDERPATH_PREUPDATE, | |
WI_ON_FIXEDUPDATE, | |
WI_ON_UPDATE, | |
WI_ON_RENDERPATH_POSTUPDATE, | |
WI_ON_RENDER, | |
WI_ON_COMPOSE, | |
_WI_ON_COUNT, | |
} WI_ON; | |
#ifdef __cplusplus | |
} // extern "C" | |
#include "./wi.hpp" | |
extern "C" { | |
#endif | |
/// wrappers: | |
typedef unsigned int WiEntity; | |
typedef struct WiComponent { | |
int foo; | |
#ifdef __cplusplus | |
void Serialize(wi::Archive& archive, wi::ecs::EntitySerializer& seri); | |
#endif | |
} WiComponent; | |
typedef void* WiComponentManager; | |
typedef void (*WiComponentFunc)(WiComponent it); | |
typedef void (*WiEntityFunc)(WiEntity it); | |
WiEntity WiEntity_create(); | |
const char* wi_version_getVersionString(); | |
const char* wi_version_getCreditsString(); | |
int wi_version_getMajor(); | |
int wi_version_getMinor(); | |
int wi_version_getRevision(); | |
void wi_arguments_parse(int argc, char** argv); | |
void wi_initializer_waitForInitializationsToFinish(); | |
void wi_initializer_initializeComponentsAsync(); | |
void wi_initializer_initializeComponentsImmediate(); | |
bool wi_initializer_isInitializeFinished(WI_INITIALIZED_SYSTEM system); | |
bool wi_input_down(WI_BUTTON button, int playerIndex); | |
bool wi_input_hold(WI_BUTTON button, uint32_t frames, bool continuous, int playerIndex); | |
WI_BUTTON wi_input_whatIsPressed(int playerIndex); | |
WI_XMFLOAT4 wi_input_getAnalog(WI_GAMEPAD_ANALOG analog, int playerIndex); | |
bool wi_input_isGamepadButton(WI_BUTTON button); | |
WiMouseState* wi_input_getMouseState(); | |
bool wi_input_press(WI_BUTTON button, int playerIndex); | |
WI_XMFLOAT4 wi_input_getPointer(); | |
void wi_input_update(SDL_Window* window, WiCanvas* canvas); | |
void wi_input_sdlInput_processEvent(SDL_Event* evt); | |
void wi_input_sdlInput_getKeyboadState(WiKeyboardState* state); | |
void wi_input_sdlInput_getMouseState(WiMouseState* state); | |
void wi_input_sdlInput_getControllerState(WiControllerState* state, int index); | |
void wi_input_sdlInput_setControllerFeedback(WiControllerFeedback* data, int index); | |
int wi_input_sdlInput_getMaxControllerCount(); | |
void wi_input_sdlInput_update(); | |
void wi_renderer_setShaderPath(char* path); | |
void wi_renderer_setShaderSourcePath(char* path); | |
typedef void* WiRenderPath2D; | |
typedef void* WiRenderPath3D; | |
typedef void (*WiRenderPathHandler0)(WiRenderPath3D self); | |
typedef void (*WiRenderPathHandler1)(WiRenderPath3D self, float); | |
WiRenderPath3D WiRenderPath3D_new(); | |
void WiRenderPath3D_dispose(WiRenderPath3D self); | |
void WiRenderPath3D_load(WiRenderPath3D self); | |
void WiRenderPath3D_init(WiRenderPath3D self, SDL_Window* canvas); | |
void WiRect_fromViewport(WiRect* rect, WiViewport* viewport); | |
typedef void* WiApplication; | |
typedef void (*WiApplicationHandler0)(void); | |
typedef void (*WiApplicationHandler1)(float); | |
WiApplication WiApplication_new(); | |
void WiApplication_dispose(WiApplication self); | |
void WiApplication_on(WiApplication self, WI_ON on, void* handler); | |
void WiApplication_setInfoDisplay(WiApplication self, bool active, bool watermark, bool fpsInfo, bool deviceName, bool resolution, bool logicalSize, | |
bool colorSpace, bool heapAllocCounter, bool pipelineCount, bool pipelineCreation, bool vramUsage, int textSize, | |
bool colorGradingHelper, WiRect* rect); | |
void WiApplication_setWindow(WiApplication self, SDL_Window* window); | |
void WiApplication_initialize(WiApplication self); | |
void WiApplication_activatePath(WiApplication self, WiRenderPath3D renderPath, float fadeSeconds); | |
void WiApplication_setFullScreen(WiApplication self, bool fullscreen); | |
void WiApplication_run(WiApplication self); | |
bool WiApplication_get_isWindowActive(WiApplication self); | |
void WiApplication_set_isWindowActive(WiApplication self, bool set); | |
WiCanvas* WiApplication_get_canvas(WiApplication self); | |
SDL_Window* WiApplication_get_window(WiApplication self); | |
typedef void (*WiJobHandler)(WiJobArgs* args); | |
WiJobContext WiJobContext_create(); | |
void wi_jobsystem_dispatch(WiJobContext* ctx, uint32_t jobCount, uint32_t groupSize, WiJobHandler handler); | |
void wi_jobsystem_execute(WiJobContext* ctx, WiJobHandler handler); | |
void wi_jobsystem_wait(WiJobContext* ctx); | |
bool wi_jobsystem_isBusy(WiJobContext* ctx); | |
uint32_t wi_jobsystem_getThreadCount(WiJobPriority priority); | |
/// | |
#ifdef __cplusplus | |
} // extern "C" | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <SDL2/SDL.h> | |
#include "../cwicked.h" | |
void sdlDispose(SDL_Window* winToDestroyIfAny) { | |
if (winToDestroyIfAny != nullptr) | |
SDL_DestroyWindow(winToDestroyIfAny); | |
SDL_Quit(); | |
} | |
SDL_Window* sdlInitAndCreateWindow(const char* winTitle, int winX, int winY, int winWidth, int winHeight, Uint32 winFlags) { | |
if (0 != SDL_Init(SDL_INIT_EVERYTHING)) { | |
fprintf(stderr, "Failed to init SDL2: %s", SDL_GetError()); | |
sdlDispose(nullptr); | |
exit(1); | |
} | |
SDL_Window* sdl_win = SDL_CreateWindow(winTitle, winX, winY, winWidth, winHeight, winFlags); | |
if (sdl_win == nullptr) { | |
fprintf(stderr, "Failed to create SDL2 window: %s", SDL_GetError()); | |
sdlDispose(nullptr); | |
exit(1); | |
} | |
return sdl_win; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <unistd.h> | |
#include "./demos.h" | |
#include "../cwicked.h" | |
WiApplication app; | |
WiRenderPath3D game; | |
void onAppInitialize() { | |
WiRenderPath3D_init(game, WiApplication_get_window(app)); | |
WiRenderPath3D_load(game); | |
WiApplication_activatePath(app, game, 1); | |
} | |
int main(int argc, char** argv) { | |
wi_arguments_parse(argc, argv); | |
auto sdl_win = sdlInitAndCreateWindow("Ensuring up-to-date shaders for this PC, please wait a minute...", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, | |
960, 600, SDL_WINDOW_VULKAN | SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_RESIZABLE); | |
wi_renderer_setShaderPath("../../.wi/.shaders/"); | |
wi_renderer_setShaderSourcePath("../../.wi/WickedEngine/shaders/"); | |
app = WiApplication_new(); | |
WiApplication_setInfoDisplay(app, true, true, true, true, true, false, true, false, true, true, true, 22, false, nullptr); | |
WiApplication_setWindow(app, sdl_win); | |
WiApplication_on(app, WI_ON_APP_INITIALIZE, onAppInitialize); | |
game = WiRenderPath3D_new(); | |
// WiApplication_initialize(app); | |
// wi_initializer_waitForInitializationsToFinish(); | |
SDL_SetWindowTitle(sdl_win, wi_version_getVersionString()); | |
WiApplication_setFullScreen(app, true); | |
{ // the main loop: | |
bool quit = false; | |
SDL_Event sdl_evt; | |
// bool ran = false; | |
while (!quit) { | |
// if (!ran) { | |
// ran = true; | |
// wi::lua::RunFile(std::string(engineDirPath) + "/Content/scripts/character_controller/character_controller.lua"); | |
// } | |
while ((SDL_PollEvent(&sdl_evt) == 1) && !quit) { | |
switch (sdl_evt.type) { | |
case SDL_QUIT: | |
quit = true; | |
break; | |
case SDL_WINDOWEVENT: | |
switch (sdl_evt.window.event) { | |
case SDL_WINDOWEVENT_CLOSE: | |
quit = true; | |
break; | |
case SDL_WINDOWEVENT_FOCUS_LOST: | |
WiApplication_set_isWindowActive(app, false); | |
break; | |
case SDL_WINDOWEVENT_FOCUS_GAINED: | |
WiApplication_set_isWindowActive(app, true); | |
break; | |
case SDL_WINDOWEVENT_SIZE_CHANGED: | |
case SDL_WINDOWEVENT_RESIZED: | |
WiApplication_setWindow(app, WiApplication_get_window(app)); | |
break; | |
} | |
break; | |
default: | |
break; | |
} | |
wi_input_sdlInput_processEvent(&sdl_evt); | |
} | |
WiApplication_run(app); | |
} | |
} | |
sdlDispose(sdl_win); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "../pch/wi_pch.h" // aka WickedEngine.h | |
#include "./cwicked.h" | |
class WiWrapApplication : public wi::Application { | |
public: | |
void* handlers[_WI_ON_COUNT]; | |
void FixedUpdate() override; | |
void Update(float) override; | |
void Initialize() override; | |
void Render() override; | |
void Compose(wi::graphics::CommandList cmd) override; | |
}; | |
class WiWrapRenderPath3D : public wi::RenderPath3D { | |
public: | |
void* handlers[_WI_ON_COUNT]; | |
void FixedUpdate() override; | |
void Update(float) override; | |
void PreUpdate() override; | |
void PostUpdate() override; | |
void Start() override; | |
void Stop() override; | |
void Load() override; | |
void Render() const override; | |
void Compose(wi::graphics::CommandList cmd) const override; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment