mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-25 21:02:54 +00:00
woah
This commit is contained in:
parent
65a9c99215
commit
2f7962cbb2
|
|
@ -176,6 +176,18 @@ bool C4JRender::ShouldClose()
|
|||
return !s_window || glfwWindowShouldClose(s_window);
|
||||
}
|
||||
|
||||
void C4JRender::Shutdown()
|
||||
{
|
||||
// Destroy the main window and terminate GLFW cleanly so that
|
||||
// destructors running after the game loop don't touch a dead context.
|
||||
if (s_window)
|
||||
{
|
||||
glfwDestroyWindow(s_window);
|
||||
s_window = nullptr;
|
||||
}
|
||||
glfwTerminate();
|
||||
}
|
||||
|
||||
void C4JRender::DoScreenGrabOnNextPresent() {}
|
||||
|
||||
void C4JRender::Clear(int flags)
|
||||
|
|
|
|||
|
|
@ -210,6 +210,7 @@ public:
|
|||
|
||||
// Linux window management
|
||||
bool ShouldClose();
|
||||
void Shutdown();
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -955,7 +955,12 @@ else
|
|||
// A memory leak was caused because the icon renderer kept creating new Vec3's because the pool wasn't reset
|
||||
Vec3::resetPool();
|
||||
} // end game loop
|
||||
}
|
||||
|
||||
// Graceful shutdown: destroy GL context and GLFW before any C++ dtors run.
|
||||
// Without this, static/global destructors that touch GL objects cause SIGSEGV.
|
||||
RenderManager.Shutdown();
|
||||
_exit(0);
|
||||
} // end main
|
||||
|
||||
// Free resources, unregister custom classes, and exit.
|
||||
// app.Uninit();
|
||||
|
|
|
|||
|
|
@ -109,11 +109,13 @@ void Tesselator::end()
|
|||
if (!hasColor)
|
||||
{
|
||||
// 4J - TEMP put in fixed vertex colors if we don't have any, until we have a shader that can cope without them
|
||||
// Use 0x00000000 (not 0xffffffff) so DrawVertices skips glColor for these vertices,
|
||||
// letting any caller-set GL colour (e.g. sky colour) pass through unmodified.
|
||||
unsigned int *pColData = (unsigned int *)_array->data;
|
||||
pColData += 5;
|
||||
for( int i = 0; i < vertices; i++ )
|
||||
{
|
||||
*pColData = 0xffffffff;
|
||||
*pColData = 0x00000000;
|
||||
pColData += 8;
|
||||
}
|
||||
#ifdef __PSVITA__
|
||||
|
|
|
|||
Loading…
Reference in a new issue