Support GDAL on non-Windows platforms

Fix compile fix with TileProviderManager
Fix projection error on PlanetProjection
This commit is contained in:
Alexander Bock
2016-06-22 08:51:58 +02:00
parent e671a59ede
commit 37e18441dc
3 changed files with 30 additions and 12 deletions

View File

@@ -128,13 +128,28 @@ create_new_module(
${HEADER_FILES} ${SOURCE_FILES} ${SHADER_FILES}
)
target_include_directories(
openspace-module-globebrowsing
SYSTEM PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/include
)
if (WIN32)
target_include_directories(
openspace-module-globebrowsing
SYSTEM PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/include
)
target_link_libraries(
openspace-module-globebrowsing
${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/lib/gdal_i.lib
)
target_link_libraries(
openspace-module-globebrowsing
${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/lib/gdal_i.lib
)
else (WIN32)
find_package(GDAL REQUIRED)
target_include_directories(
openspace-module-globebrowsing
SYSTEM PUBLIC
${GDAL_INCLUDE}
)
target_link_libraries(
openspace-module-globebrowsing
${GDAL_LIBRARY}
)
endif ()

View File

@@ -148,8 +148,8 @@ namespace openspace {
}
void TileProviderManager::prerender() {
for each (auto layerCategory in _layerCategories) {
for each (auto tileProviderWithName in layerCategory) {
for (auto layerCategory : _layerCategories) {
for (auto tileProviderWithName : layerCategory) {
if (tileProviderWithName.isActive) {
tileProviderWithName.tileProvider->prerender();
}
@@ -162,7 +162,7 @@ namespace openspace {
LayeredTextures::TextureCategory textureCategory)
{
std::vector<std::shared_ptr<TileProvider> > tileProviders;
for each (auto tileProviderWithName in _layerCategories[textureCategory]) {
for (auto tileProviderWithName : _layerCategories[textureCategory]) {
if (tileProviderWithName.isActive) {
tileProviders.push_back(tileProviderWithName.tileProvider);
}

View File

@@ -83,4 +83,7 @@ void main() {
// to be fixed soon ---abock
color = texture(projectionTexture, vec2(projected.x, 1-projected.y));
}
else {
color = vec4(0.0);
}
}