diff -r 0fd926ebb03b -r 42b4953dff85 src/gl/partrenderer.cpp
--- a/src/gl/partrenderer.cpp Tue Jun 28 17:35:56 2022 +0300
+++ b/src/gl/partrenderer.cpp Tue Jun 28 17:59:34 2022 +0300
@@ -16,6 +16,7 @@
* along with this program. If not, see .
*/
+#include
#include
#include
#include
@@ -29,17 +30,10 @@
#include "src/settings.h"
#include "src/gl/partrenderer.h"
#include "src/gl/compiler.h"
-#include "src/gl/debug.h"
static constexpr double MIN_ZOOM = -3.0;
static constexpr double MAX_ZOOM = 3.0;
-QOpenGLFunctions& glfunc()
-{
- static QOpenGLFunctions funcs;
- return funcs;
-}
-
PartRenderer::PartRenderer(
Model* model,
DocumentManager* documents,
@@ -56,9 +50,6 @@
QSurfaceFormat surfaceFormat;
surfaceFormat.setSamples(8);
this->setFormat(surfaceFormat);
- connect(&this->logger, &QOpenGLDebugLogger::messageLogged, [&](const QOpenGLDebugMessage& glmessage){
- Q_EMIT this->message(debugMessageToString(glmessage));
- });
connect(model, &Model::rowsInserted, [&]{
this->needBuild = true;
});
@@ -81,18 +72,9 @@
{
}
-static QVector3D calcQVector3DFromQColor(const QColor& color)
-{
- return {
- float_cast(color.redF()),
- float_cast(color.greenF()),
- float_cast(color.blueF()),
- };
-}
-
void PartRenderer::initializeGL()
{
- glfunc().initializeOpenGLFunctions();
+ glewInit();
gl::initializeModelShaders(&this->shaders);
for (RenderLayer* layer : this->activeRenderLayers) {
layer->initializeGL();
@@ -100,10 +82,6 @@
for (RenderLayer* layer : this->inactiveRenderLayers) {
layer->initializeGL();
}
- this->logger.initialize();
- if (setting()) {
- this->logger.startLogging();
- }
connect(this->model, &Model::dataChanged, this, &PartRenderer::build);
this->initialized = true;
this->modelQuaternion = glm::angleAxis(glm::radians(30.0f), glm::vec3{-1, 0, 0});
@@ -499,15 +477,6 @@
{
this->build();
}
- if (this->initialized) {
- this->makeCurrent();
- if (setting()) {
- this->logger.startLogging();
- }
- else {
- this->logger.stopLogging();
- }
- }
Q_EMIT this->renderPreferencesChanged();
this->update();
}