hotloading!!
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
#include "Log.h"
|
||||
#include <cstdio>
|
||||
#include <bx/string.h>
|
||||
|
||||
namespace Game
|
||||
namespace
|
||||
{
|
||||
void Log(const char* text)
|
||||
{
|
||||
printf("%s\n", text);
|
||||
}
|
||||
char LineBuffer[1024]{0};
|
||||
}
|
||||
|
||||
void Log(const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
bx::snprintf(LineBuffer, sizeof(LineBuffer), "%s\n", format);
|
||||
bx::printf(LineBuffer, args);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
namespace Game
|
||||
{
|
||||
void Log(const char* text);
|
||||
}
|
||||
void Log(const char *format, ...);
|
||||
|
||||
@@ -4,22 +4,19 @@
|
||||
|
||||
namespace Game
|
||||
{
|
||||
int32_t FrameCounter = 0;
|
||||
|
||||
void Setup(void* window)
|
||||
{
|
||||
Log("Setup");
|
||||
bgfx::Init init;
|
||||
init.type = bgfx::RendererType::Direct3D12;
|
||||
init.platformData.nwh = (void*)window;
|
||||
init.platformData.ndt = nullptr;
|
||||
init.platformData.type = bgfx::NativeWindowHandleType::Default;
|
||||
init.resolution.width = 1920;
|
||||
init.resolution.height = 1080;
|
||||
init.resolution.reset = BGFX_RESET_VSYNC;
|
||||
bgfx::init(init);
|
||||
Log("Game Setup Start!");
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
Log("Update");
|
||||
}
|
||||
++FrameCounter;
|
||||
if (FrameCounter % 1000000 == 0)
|
||||
{
|
||||
Log("Frame!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user