From 64bc82007b52f162d8b26fd80c796b90868bc96c Mon Sep 17 00:00:00 2001 From: maelstrom Date: Thu, 3 Jul 2025 14:02:21 +0200 Subject: [PATCH] feat(rendering): enabled multisampling --- client/src/main.cpp | 1 + core/src/rendering/renderer.cpp | 1 + editor/main.cpp | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/client/src/main.cpp b/client/src/main.cpp index bbbe31e..586757d 100644 --- a/client/src/main.cpp +++ b/client/src/main.cpp @@ -23,6 +23,7 @@ int main() { glfwSetErrorCallback(errorCatcher); glfwInit(); + glfwWindowHint(GLFW_SAMPLES, 4); GLFWwindow *window = glfwCreateWindow(1200, 900, "OpenBlocks Client ALPHA", NULL, NULL); glfwSetKeyCallback(window, keyCallback); glfwSetMouseButtonCallback(window, mouseButtonCallback); diff --git a/core/src/rendering/renderer.cpp b/core/src/rendering/renderer.cpp index 5d2f2ce..a7dd6cb 100644 --- a/core/src/rendering/renderer.cpp +++ b/core/src/rendering/renderer.cpp @@ -64,6 +64,7 @@ void renderInit(GLFWwindow* window, int width, int height) { glEnable(GL_DEPTH_TEST); glEnable(GL_BLEND); + glEnable(GL_MULTISAMPLE); glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); // glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); diff --git a/editor/main.cpp b/editor/main.cpp index 08d2743..ef548cd 100644 --- a/editor/main.cpp +++ b/editor/main.cpp @@ -6,9 +6,16 @@ #include #include #include +#include +#include +#include int main(int argc, char *argv[]) { + QSurfaceFormat format; + format.setSamples(4); + QSurfaceFormat::setDefaultFormat(format); + QApplication a(argc, argv); Logger::init();