Changing engine to shared library

This commit is contained in:
Dynamitos
2023-08-26 15:19:12 +02:00
parent 4ab924f251
commit dcbce27fb2
20 changed files with 93 additions and 47 deletions
+2 -1
View File
@@ -9,5 +9,6 @@ struct DebugVertex
Vector position;
Vector color;
};
extern Array<DebugVertex> gDebugVertices;
void addDebugVertex(DebugVertex vert);
void addDebugVertices(Array<DebugVertex> vert);
} // namespace Seele
-2
View File
@@ -3,8 +3,6 @@
using namespace Seele;
using namespace Seele::Gfx;
uint32 Gfx::currentFrameIndex = 0;
double Gfx::currentFrameDelta = 0;
FormatCompatibilityInfo Gfx::getFormatInfo(SeFormat format)
{
+1 -2
View File
@@ -166,8 +166,7 @@ namespace Gfx
static constexpr bool useAsyncCompute = true;
static constexpr bool waitIdleOnSubmit = true;
static constexpr uint32 numFramesBuffered = 8;
extern uint32 currentFrameIndex;
extern double currentFrameDelta;
double getCurrentFrameDelta();
enum class MaterialShadingModel
{
+11 -1
View File
@@ -3,7 +3,17 @@
using namespace Seele;
Array<DebugVertex> Seele::gDebugVertices;
Array<DebugVertex> gDebugVertices;
void Seele::addDebugVertex(DebugVertex vert)
{
gDebugVertices.add(vert);
}
void Seele::addDebugVertices(Array<DebugVertex> verts)
{
gDebugVertices.addAll(verts);
}
DebugPass::DebugPass(Gfx::PGraphics graphics)
: RenderPass(graphics)
+10 -2
View File
@@ -8,6 +8,12 @@
using namespace Seele;
using namespace Seele::Vulkan;
double currentFrameDelta = 0;
double Gfx::getCurrentFrameDelta()
{
return currentFrameDelta;
}
void glfwKeyCallback(GLFWwindow* handle, int key, int, int action, int modifier)
{
Window* window = (Window*)glfwGetWindowUserPointer(handle);
@@ -209,6 +215,8 @@ void Window::recreateSwapchain(const WindowCreateInfo &windowInfo)
createSwapchain();
}
static uint32_t currentFrameIndex = 0;
void Window::present()
{
backBufferImages[currentImageIndex]->changeLayout(Gfx::SE_IMAGE_LAYOUT_PRESENT_SRC_KHR);
@@ -230,11 +238,11 @@ void Window::present()
{
presentResult = vkQueuePresentKHR(graphics->getGraphicsCommands()->getQueue()->getHandle(), &info);
}
Gfx::currentFrameIndex = (Gfx::currentFrameIndex + 1)%Gfx::numFramesBuffered;
currentFrameIndex = (currentFrameIndex + 1) % Gfx::numFramesBuffered;
static double lastFrameTime = 0.f;
double currentTime = glfwGetTime();
double currentDelta = currentTime - lastFrameTime;
Gfx::currentFrameDelta = currentDelta;
currentFrameDelta = currentDelta;
lastFrameTime = currentTime;
}