diff --git a/include/openspace/scene/lightsource.h b/include/openspace/scene/lightsource.h index b53ef18396..f591c2eb9c 100644 --- a/include/openspace/scene/lightsource.h +++ b/include/openspace/scene/lightsource.h @@ -38,7 +38,7 @@ namespace openspace { namespace documentation { struct Documentation; } class SceneGraphNode; -class RenderData; +struct RenderData; class LightSource : public properties::PropertyOwner { public: diff --git a/modules/base/lightsource/cameralightsource.cpp b/modules/base/lightsource/cameralightsource.cpp index a012e25434..2a1b0e84af 100644 --- a/modules/base/lightsource/cameralightsource.cpp +++ b/modules/base/lightsource/cameralightsource.cpp @@ -89,9 +89,8 @@ float CameraLightSource::intensity() const { return _intensity; } -glm::vec3 CameraLightSource::directionViewSpace(const RenderData& renderData) const { +glm::vec3 CameraLightSource::directionViewSpace(const RenderData&) const { return glm::vec3(0.f, 0.f, 1.f); } - } // namespace openspace diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index 9a4416beb3..a5b670ff72 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -162,11 +162,11 @@ documentation::Documentation RenderableModel::Documentation() { RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary) : Renderable(dictionary) , _colorTexturePath(TextureInfo) - , _ambientIntensity(AmbientIntensityInfo, 0.2, 0.0, 1.0) - , _diffuseIntensity(DiffuseIntensityInfo, 1.0, 0.0, 1.0) - , _specularIntensity(SpecularIntensityInfo, 1.0, 0.0, 1.0) + , _ambientIntensity(AmbientIntensityInfo, 0.2f, 0.f, 1.f) + , _diffuseIntensity(DiffuseIntensityInfo, 1.f, 0.f, 1.f) + , _specularIntensity(SpecularIntensityInfo, 1.f, 0.f, 1.f) , _performShading(ShadingInfo, true) - , _modelTransform(ModelTransformInfo, glm::mat3(1.0)) + , _modelTransform(ModelTransformInfo, glm::mat3(1.f)) , _lightSourcePropertyOwner({ "LightSources", "Light Sources" }) { documentation::testSpecificationAndThrow( diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 83d8cf0a6b..13e1e50297 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -1100,28 +1100,38 @@ void OpenSpaceEngine::initializeGL() { } if (_configuration->isLoggingOpenGLCalls) { - using namespace glbinding; + LogLevel level = ghoul::logging::levelFromString(_configuration->logging.level); + if (level > LogLevel::Trace) { + LWARNING( + "Logging OpenGL calls is enabled, but the selected log level does " + "not include TRACE, so no OpenGL logs will be printed"); + } + else { + using namespace glbinding; - setCallbackMask(CallbackMask::After | CallbackMask::ParametersAndReturnValue); - glbinding::setAfterCallback([](const glbinding::FunctionCall& call) { - std::string arguments = std::accumulate( - call.parameters.begin(), - call.parameters.end(), - std::string("("), - [](std::string a, AbstractValue* v) { - return a + ", " + v->asString(); - } - ); + setCallbackMask(CallbackMask::After | CallbackMask::ParametersAndReturnValue); + glbinding::setAfterCallback([](const glbinding::FunctionCall& call) { + std::string arguments = std::accumulate( + call.parameters.begin(), + call.parameters.end(), + std::string("("), + [](std::string a, AbstractValue* v) { + return a + v->asString() + ", "; + } + ); + // Remove the final ", " + arguments = arguments.substr(0, arguments.size() - 2) + ")"; - std::string returnValue = call.returnValue ? - " -> " + call.returnValue->asString() : - ""; + std::string returnValue = call.returnValue ? + " -> " + call.returnValue->asString() : + ""; - LTRACEC( - "OpenGL", - call.function->name() + arguments + returnValue - ); - }); + LTRACEC( + "OpenGL", + call.function->name() + std::move(arguments) + std::move(returnValue) + ); + }); + } } LDEBUG("Initializing Rendering Engine");