Linux fixes clang (#1216)

* Changes to work on Linux.

* Multiple small fixes for Linux.

* Changes to have trails working on Linux again.

* Bring back AA Trail Lines on Linux.

* Included new branch with correction in cfitsio library linking.

* Updated SGCT.

* Changes to work on Linux.

* Remove extra #endif

* Changes to compile in Clang on Linux.

* Other fixes.

* Bring back some of the changes lost and updated clang building commands.

* requiring 10.15 for sgct, upadating sgct

Co-authored-by: Jonathas <jon.costa@gmail.com>
Co-authored-by: Tom Schober <tom@tomschober.com>
Co-authored-by: Alexander Bock <mail@alexanderbock.eu>
This commit is contained in:
Micah Acinapura
2020-06-25 18:55:20 -04:00
committed by GitHub
parent 7e143cec31
commit 6db7d503a3
17 changed files with 148 additions and 32 deletions
+16 -8
View File
@@ -34,15 +34,24 @@
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/opengl/programobject.h>
#include <cmath>
namespace {
constexpr const char* ProgramName = "EphemerisProgram";
constexpr const char* KeyTranslation = "Translation";
#ifdef __APPLE__
constexpr const std::array<const char*, 12> UniformNames = {
"opacity", "modelViewTransform", "projectionTransform", "color", "useLineFade",
"lineFade", "vertexSortingMethod", "idOffset", "nVertices", "stride", "pointSize",
"renderPhase"
};
#else
constexpr const std::array<const char*, 14> UniformNames = {
"opacity", "modelViewTransform", "projectionTransform", "color", "useLineFade",
"lineFade", "vertexSortingMethod", "idOffset", "nVertices", "stride", "pointSize",
"renderPhase", "resolution", "lineWidth"
};
#endif
// The possible values for the _renderingModes property
enum RenderingMode {
@@ -334,7 +343,7 @@ void RenderableTrail::render(const RenderData& data, RendererTasks&) {
if (renderLines) {
#ifdef __APPLE__
glLineWidth(1.f);
glLineWidth(1);
#else
glLineWidth(ceil((2.f * 1.f + _appearance.lineWidth) * std::sqrt(2.f)));
#endif
@@ -366,12 +375,11 @@ void RenderableTrail::render(const RenderData& data, RendererTasks&) {
p->setUniform(c.nVertices, nVertices);
#ifndef __APPLE__
glm::ivec2 resolution = global::renderEngine.renderingResolution();
p->setUniform(c.resolution, resolution);
p->setUniform(c.lineWidth, ceil((2.f * 1.f + lw) * std::sqrt(2.f)));
#endif
#if !defined(__APPLE__)
glm::ivec2 resolution = global::renderEngine.renderingResolution();
p->setUniform(c.resolution, resolution);
p->setUniform(c.lineWidth, std::ceil((2.f * 1.f + lw) * std::sqrt(2.f)));
#endif
if (renderPoints) {
// The stride parameter determines the distance between larger points and
+6 -1
View File
@@ -182,10 +182,15 @@ private:
/// Program object used to render the data stored in RenderInformation
ghoul::opengl::ProgramObject* _programObject = nullptr;
#ifdef __APPLE__
UniformCache(opacity, modelView, projection, color, useLineFade,
lineFade, vertexSorting, idOffset, nVertices, stride,
pointSize, renderPhase) _uniformCache;
#else
UniformCache(opacity, modelView, projection, color, useLineFade, lineFade,
vertexSorting, idOffset, nVertices, stride, pointSize, renderPhase,
resolution, lineWidth) _uniformCache;
#endif
};
} // namespace openspace
@@ -1,4 +1,4 @@
/*****************************************************************************************
/*****************************************************************************************
* *
* OpenSpace *
* *
+8 -6
View File
@@ -26,6 +26,8 @@
#include <ghoul/lua/ghoul_lua.h>
#include <cmath>
using json = nlohmann::json;
namespace openspace::volume {
@@ -57,8 +59,8 @@ bool Envelope::operator!=(const Envelope& env) const {
iter != _points.end();
++iter, ++envIter)
{
if (abs(iter->position.first - envIter->position.first) > MinDist ||
abs(iter->position.second - envIter->position.second) > MinDist ||
if (std::fabs(iter->position.first - envIter->position.first) > MinDist ||
std::fabs(iter->position.second - envIter->position.second) > MinDist ||
iter->color != envIter->color)
{
return true;
@@ -118,12 +120,12 @@ glm::vec4 Envelope::valueAtPosition(float pos) const {
else {
return {
normalizeColor(
beforeIter->color * (abs(pos - afterIter->position.first) / dist) +
afterIter->color * (abs(pos - beforeIter->position.first) / dist)
beforeIter->color * (std::fabs(pos - afterIter->position.first) / dist) +
afterIter->color * (std::fabs(pos - beforeIter->position.first) / dist)
),
beforeIter->position.second * (abs(pos - afterIter->position.first) / dist) +
beforeIter->position.second * (std::fabs(pos - afterIter->position.first) / dist) +
afterIter->position.second *
(abs(pos - beforeIter->position.first) / dist)
(std::fabs(pos - beforeIter->position.first) / dist)
};
}
}
@@ -305,7 +305,7 @@ if(OS_MACOSX)
endforeach()
# Target SDK.
set(CEF_TARGET_SDK "10.14")
set(CEF_TARGET_SDK "10.15")
list(APPEND CEF_COMPILER_FLAGS
-mmacosx-version-min=${CEF_TARGET_SDK}
)