Update gitignore to include Mars texture

Update SGCT reference
Update Ghoul reference
Prevent spherical grid to recreate grid each frame
Add version and commit information (closes #395)
This commit is contained in:
Alexander Bock
2017-08-30 14:56:02 -04:00
parent f57feb01d3
commit 0ceab49df7
9 changed files with 91 additions and 2 deletions
+2
View File
@@ -119,3 +119,5 @@ data/spice/plu055.bsp
data/spice/Rosetta
data/spice/sat375.bsp
data/spice/new_horizons/
data/scene/mars/map_datasets/mars_COL_v006_mars2000_rgb.tif
data/scene/mars/map_datasets/mars_COL_v006_mars2000_rgb.vrt
+20
View File
@@ -59,6 +59,26 @@ endif ()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${OPENSPACE_CMAKE_EXT_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OPENSPACE_BASE_DIR}/bin)
##########################################################################################
# Main #
##########################################################################################
# Get the current working branch
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE OPENSPACE_GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE OPENSPACE_GIT_COMMIT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
option(OPENSPACE_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF)
include(src/CMakeLists.txt)
@@ -95,6 +95,7 @@ public:
const glm::mat4& projectionMatrix);
void renderScreenLog();
void renderVersionInformation();
void renderShutdownInformation(float timer, float fullTime);
void postDraw();
@@ -200,6 +201,7 @@ private:
properties::BoolProperty _showDate;
properties::BoolProperty _showInfo;
properties::BoolProperty _showLog;
properties::BoolProperty _showVersionInfo;
properties::TriggerProperty _takeScreenshot;
bool _shouldTakeScreenshot;
@@ -303,6 +303,8 @@ void RenderableSphericalGrid::update(const UpdateData&) {
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _iBufferID);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, _isize * sizeof(int), _iarray.data(), GL_STATIC_DRAW);
_gridIsDirty = false;
}
}
+1
View File
@@ -1220,6 +1220,7 @@ void OpenSpaceEngine::postDraw() {
if (isGuiWindow) {
_renderEngine->renderScreenLog();
_renderEngine->renderVersionInformation();
_console->render();
}
+57
View File
@@ -29,6 +29,7 @@
#endif
#include <openspace/util/syncdata.h>
#include <openspace/openspace.h>
#include <openspace/engine/configurationmanager.h>
#include <openspace/engine/openspaceengine.h>
#include <openspace/engine/wrapper/windowwrapper.h>
@@ -127,6 +128,13 @@ namespace {
"log."
};
static const openspace::properties::Property::PropertyInfo ShowVersionInfo = {
"ShowVersion",
"Shows the version on-screen information",
"This value determines whether the GIT version information (branch and commit ) "
"hash are shown on the screen."
};
static const openspace::properties::Property::PropertyInfo TakeScreenshotInfo = {
"TakeScreenshot",
"Take Screenshot",
@@ -197,6 +205,7 @@ RenderEngine::RenderEngine()
, _showDate(ShowDateInfo, true)
, _showInfo(ShowInfoInfo, true)
, _showLog(ShowLogInfo, true)
, _showVersionInfo(ShowVersionInfo, true)
, _takeScreenshot(TakeScreenshotInfo)
, _shouldTakeScreenshot(false)
, _applyWarping(ApplyWarpingInfo, false)
@@ -248,6 +257,7 @@ RenderEngine::RenderEngine()
addProperty(_showDate);
addProperty(_showInfo);
addProperty(_showLog);
addProperty(_showVersionInfo);
_nAaSamples.onChange([this](){
if (_renderer) {
@@ -1287,6 +1297,53 @@ void RenderEngine::renderInformation() {
}
}
void RenderEngine::renderVersionInformation() {
if (!_showVersionInfo) {
return;
}
using FR = ghoul::fontrendering::FontRenderer;
FR::BoundingBoxInformation versionBox = FR::defaultRenderer().boundingBox(
*_fontInfo,
"%s",
OPENSPACE_VERSION_STRING_FULL
);
FR::BoundingBoxInformation commitBox = FR::defaultRenderer().boundingBox(
*_fontInfo,
"%s@%s",
OPENSPACE_GIT_BRANCH,
OPENSPACE_GIT_COMMIT
);
FR::defaultRenderer().render(
*_fontInfo,
glm::vec2(
fontResolution().x - versionBox.boundingBox.x - 10.f,
5.f
),
glm::vec4(0.5, 0.5, 0.5, 1.f),
"%s",
OPENSPACE_VERSION_STRING_FULL
);
FR::defaultRenderer().render(
*_fontInfo,
glm::vec2(
fontResolution().x - commitBox.boundingBox.x - 10.f,
versionBox.boundingBox.y + 5.f
),
glm::vec4(0.5, 0.5, 0.5, 1.f),
"%s@%s",
OPENSPACE_GIT_BRANCH,
OPENSPACE_GIT_COMMIT
);
}
void RenderEngine::renderScreenLog() {
if (!_showLog) {
return;
+5
View File
@@ -37,6 +37,11 @@ constexpr int OPENSPACE_VERSION_PATCH = @OPENSPACE_VERSION_PATCH@;
constexpr const char* OPENSPACE_VERSION_STRING = "@OPENSPACE_VERSION_STRING@";
constexpr const char* OPENSPACE_VERSION_STRING_FULL = "@OPENSPACE_VERSION_MAJOR@.@OPENSPACE_VERSION_MINOR@.@OPENSPACE_VERSION_PATCH@ (@OPENSPACE_VERSION_STRING@)";
constexpr const char* OPENSPACE_GIT_BRANCH = "@OPENSPACE_GIT_BRANCH@";
constexpr const char* OPENSPACE_GIT_COMMIT = "@OPENSPACE_GIT_COMMIT@";
} // namespace openspace
#endif // __OPENSPACE_CORE___OPENSPACE___H__