[turbine] Make window render during resizing
This commit is contained in:
@@ -34,8 +34,6 @@ void removeDrawer(Context &ctx, Drawer *cd) noexcept {
|
||||
|
||||
}
|
||||
|
||||
constexpr auto Scale = 5;
|
||||
|
||||
static void handleGlfwError(int err, const char *desc) noexcept {
|
||||
oxErrf("GLFW error ({}): {}\n", err, desc);
|
||||
}
|
||||
@@ -93,9 +91,6 @@ static void handleGlfwMouseButtonEvent(GLFWwindow *window, int, int, int) noexce
|
||||
ctx->uninterruptedRefreshes = 25;
|
||||
}
|
||||
|
||||
static void handleGlfwWindowResize(GLFWwindow*, int, int) noexcept {
|
||||
}
|
||||
|
||||
static void handleGlfwKeyEvent(GLFWwindow *window, int key, int, int action, int) noexcept {
|
||||
const auto ctx = static_cast<GlfwContext*>(glfwGetWindowUserPointer(window));
|
||||
ctx->uninterruptedRefreshes = 25;
|
||||
@@ -216,13 +211,13 @@ ox::Error initGfx(Context &ctx) noexcept {
|
||||
glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE);
|
||||
auto cstr = ox_malloca(ctx.keelCtx.appName.bytes() + 1, char);
|
||||
ox_strncpy(cstr.get(), ctx.keelCtx.appName.data(), ctx.keelCtx.appName.bytes());
|
||||
constexpr auto Scale = 5;
|
||||
gctx.window = glfwCreateWindow(240 * Scale, 160 * Scale, cstr, nullptr, nullptr);
|
||||
if (gctx.window == nullptr) {
|
||||
return OxError(1, "Could not open GLFW window");
|
||||
}
|
||||
glfwSetCursorPosCallback(gctx.window, handleGlfwCursorPosEvent);
|
||||
glfwSetMouseButtonCallback(gctx.window, handleGlfwMouseButtonEvent);
|
||||
glfwSetWindowSizeCallback(gctx.window, handleGlfwWindowResize);
|
||||
glfwSetKeyCallback(gctx.window, handleGlfwKeyEvent);
|
||||
glfwSetWindowUserPointer(gctx.window, &ctx);
|
||||
glfwMakeContextCurrent(gctx.window);
|
||||
|
||||
Reference in New Issue
Block a user