mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-07 12:58:33 -06:00
Feature/globals (#690)
* Move global objects out of OpenSpaceEngine * General cleanup of main.cpp * Add default_joystick asset to all scenes * No longer suppress mouse interaction on slave nodes * Window delegate uses function pointers rather than subclassing * Fix for false overwriting of ImGUI configuration file * Change default color and tilt angle of fisheye rendering * Restructured performance manager * Simplify screenshot handling
This commit is contained in:
@@ -26,8 +26,8 @@
|
||||
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/documentation/verifier.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/wrapper/windowwrapper.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/engine/windowdelegate.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/scripting/scriptengine.h>
|
||||
#include <openspace/scene/scene.h>
|
||||
@@ -338,7 +338,7 @@ ScreenSpaceRenderable::ScreenSpaceRenderable(const ghoul::Dictionary& dictionary
|
||||
_delete.onChange([this](){
|
||||
std::string script =
|
||||
"openspace.removeScreenSpaceRenderable('" + identifier() + "');";
|
||||
OsEng.scriptEngine().queueScript(
|
||||
global::scriptEngine.queueScript(
|
||||
script,
|
||||
scripting::ScriptEngine::RemoteScripting::No
|
||||
);
|
||||
@@ -353,7 +353,7 @@ bool ScreenSpaceRenderable::initialize() {
|
||||
}
|
||||
|
||||
bool ScreenSpaceRenderable::initializeGL() {
|
||||
_originalViewportSize = OsEng.windowWrapper().currentWindowResolution();
|
||||
_originalViewportSize = global::windowDelegate.currentWindowResolution();
|
||||
|
||||
createPlane();
|
||||
createShaders();
|
||||
@@ -372,9 +372,8 @@ bool ScreenSpaceRenderable::deinitializeGL() {
|
||||
glDeleteBuffers(1, &_vertexPositionBuffer);
|
||||
_vertexPositionBuffer = 0;
|
||||
|
||||
RenderEngine& renderEngine = OsEng.renderEngine();
|
||||
if (_shader) {
|
||||
renderEngine.removeRenderProgram(_shader.get());
|
||||
global::renderEngine.removeRenderProgram(_shader.get());
|
||||
_shader = nullptr;
|
||||
}
|
||||
|
||||
@@ -459,7 +458,7 @@ void ScreenSpaceRenderable::useEuclideanCoordinates(bool b) {
|
||||
void ScreenSpaceRenderable::createShaders() {
|
||||
ghoul::Dictionary dict = ghoul::Dictionary();
|
||||
|
||||
auto res = OsEng.windowWrapper().currentWindowResolution();
|
||||
auto res = global::windowDelegate.currentWindowResolution();
|
||||
ghoul::Dictionary rendererData = {
|
||||
{ "fragmentRendererPath", "${SHADERS}/framebuffer/renderframebuffer.frag" },
|
||||
{ "windowWidth" , res.x },
|
||||
@@ -479,7 +478,7 @@ void ScreenSpaceRenderable::createShaders() {
|
||||
}
|
||||
|
||||
glm::mat4 ScreenSpaceRenderable::scaleMatrix() {
|
||||
glm::vec2 resolution = OsEng.windowWrapper().currentWindowResolution();
|
||||
glm::vec2 resolution = global::windowDelegate.currentWindowResolution();
|
||||
|
||||
//to scale the plane
|
||||
float textureRatio =
|
||||
@@ -499,7 +498,7 @@ glm::mat4 ScreenSpaceRenderable::scaleMatrix() {
|
||||
|
||||
glm::mat4 ScreenSpaceRenderable::rotationMatrix() {
|
||||
// Get the scene transform
|
||||
glm::mat4 rotation = glm::inverse(OsEng.windowWrapper().modelMatrix());
|
||||
glm::mat4 rotation = glm::inverse(global::windowDelegate.modelMatrix());
|
||||
if (!_useEuclideanCoordinates) {
|
||||
glm::vec2 position = _sphericalPosition.value();
|
||||
|
||||
@@ -539,7 +538,7 @@ void ScreenSpaceRenderable::draw(glm::mat4 modelTransform) {
|
||||
|
||||
_shader->setUniform(
|
||||
_uniformCache.viewProj,
|
||||
OsEng.renderEngine().scene()->camera()->viewProjectionMatrix()
|
||||
global::renderEngine.scene()->camera()->viewProjectionMatrix()
|
||||
);
|
||||
|
||||
ghoul::opengl::TextureUnit unit;
|
||||
|
||||
Reference in New Issue
Block a user