From a98e49c892120696b1411e67a7c5a4fe4e2dfade Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Tue, 29 Nov 2016 14:02:11 -0800 Subject: [PATCH] Fix build errors --- libraries/gpu/src/gpu/Context.cpp | 2 +- .../shared/src/shared/GlobalAppProperties.cpp | 23 +++++++++++++++++++ .../shared/src/shared/GlobalAppProperties.h | 12 +++++----- 3 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 libraries/shared/src/shared/GlobalAppProperties.cpp diff --git a/libraries/gpu/src/gpu/Context.cpp b/libraries/gpu/src/gpu/Context.cpp index cc94fe7752..b1af4968e0 100644 --- a/libraries/gpu/src/gpu/Context.cpp +++ b/libraries/gpu/src/gpu/Context.cpp @@ -126,7 +126,7 @@ bool Context::makeProgram(Shader& shader, const Shader::BindingSet& bindings) { // FIXME find a way to do this without reliance on Qt app properties if (!_makeProgramCallback) { void* rawCallback = qApp->property(hifi::properties::gl::MAKE_PROGRAM_CALLBACK).value(); - _makeProgramCallback = static_cast(rawCallback); + _makeProgramCallback = reinterpret_cast(rawCallback); } if (shader.isProgram() && _makeProgramCallback) { return _makeProgramCallback(shader, bindings); diff --git a/libraries/shared/src/shared/GlobalAppProperties.cpp b/libraries/shared/src/shared/GlobalAppProperties.cpp new file mode 100644 index 0000000000..512096b86a --- /dev/null +++ b/libraries/shared/src/shared/GlobalAppProperties.cpp @@ -0,0 +1,23 @@ +// +// Created by Bradley Austin Davis on 2016/11/29 +// Copyright 2013-2016 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#include "GlobalAppProperties.h" + +namespace hifi { namespace properties { + + const char* CRASHED = "com.highfidelity.crashed"; + const char* STEAM = "com.highfidelity.launchedFromSteam"; + const char* LOGGER = "com.highfidelity.logger"; + + namespace gl { + const char* BACKEND = "com.highfidelity.gl.backend"; + const char* MAKE_PROGRAM_CALLBACK = "com.highfidelity.gl.makeProgram"; + const char* PRIMARY_CONTEXT = "com.highfidelity.gl.primaryContext"; + } + +} } diff --git a/libraries/shared/src/shared/GlobalAppProperties.h b/libraries/shared/src/shared/GlobalAppProperties.h index 51a196e30b..08deeddc03 100644 --- a/libraries/shared/src/shared/GlobalAppProperties.h +++ b/libraries/shared/src/shared/GlobalAppProperties.h @@ -12,14 +12,14 @@ namespace hifi { namespace properties { - static const char* CRASHED = "com.highfidelity.crashed"; - static const char* STEAM = "com.highfidelity.launchedFromSteam"; - static const char* LOGGER = "com.highfidelity.logger"; + extern const char* CRASHED; + extern const char* STEAM; + extern const char* LOGGER; namespace gl { - static const char* BACKEND = "com.highfidelity.gl.backend"; - static const char* MAKE_PROGRAM_CALLBACK = "com.highfidelity.gl.makeProgram"; - static const char* PRIMARY_CONTEXT = "com.highfidelity.gl.primaryContext"; + extern const char* BACKEND; + extern const char* MAKE_PROGRAM_CALLBACK; + extern const char* PRIMARY_CONTEXT; } } }