mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-12 21:02:11 +02:00
Working on adding rendering from the workload
This commit is contained in:
parent
6d347cf44f
commit
9441bb477d
4 changed files with 82 additions and 4 deletions
|
@ -2209,7 +2209,8 @@ Application::~Application() {
|
||||||
// shutdown render engine
|
// shutdown render engine
|
||||||
_main3DScene = nullptr;
|
_main3DScene = nullptr;
|
||||||
_renderEngine = nullptr;
|
_renderEngine = nullptr;
|
||||||
_infinityEngine = nullptr;
|
|
||||||
|
_gameWorkload.shutdown();
|
||||||
|
|
||||||
DependencyManager::destroy<Preferences>();
|
DependencyManager::destroy<Preferences>();
|
||||||
|
|
||||||
|
@ -2332,6 +2333,8 @@ void Application::initializeGL() {
|
||||||
DependencyManager::get<GeometryCache>()->initializeShapePipelines();
|
DependencyManager::get<GeometryCache>()->initializeShapePipelines();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
_gameWorkload.startup();
|
||||||
|
|
||||||
_offscreenContext = new OffscreenGLCanvas();
|
_offscreenContext = new OffscreenGLCanvas();
|
||||||
_offscreenContext->setObjectName("MainThreadContext");
|
_offscreenContext->setObjectName("MainThreadContext");
|
||||||
_offscreenContext->create(_glWidget->qglContext());
|
_offscreenContext->create(_glWidget->qglContext());
|
||||||
|
@ -4099,7 +4102,7 @@ void Application::idle() {
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
_infinityEngine->run();
|
_gameWorkload._engine->run();
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
PerformanceTimer perfTimer("update");
|
PerformanceTimer perfTimer("update");
|
||||||
|
|
|
@ -69,7 +69,8 @@
|
||||||
#include "ui/OverlayConductor.h"
|
#include "ui/OverlayConductor.h"
|
||||||
#include "ui/overlays/Overlays.h"
|
#include "ui/overlays/Overlays.h"
|
||||||
#include "UndoStackScriptingInterface.h"
|
#include "UndoStackScriptingInterface.h"
|
||||||
#include "workload/Engine.h"
|
|
||||||
|
#include "workload/GameWorkload.h"
|
||||||
|
|
||||||
#include <procedural/ProceduralSkybox.h>
|
#include <procedural/ProceduralSkybox.h>
|
||||||
#include <graphics/Skybox.h>
|
#include <graphics/Skybox.h>
|
||||||
|
@ -616,7 +617,8 @@ private:
|
||||||
render::ScenePointer _main3DScene{ new render::Scene(glm::vec3(-0.5f * (float)TREE_SCALE), (float)TREE_SCALE) };
|
render::ScenePointer _main3DScene{ new render::Scene(glm::vec3(-0.5f * (float)TREE_SCALE), (float)TREE_SCALE) };
|
||||||
render::EnginePointer _renderEngine{ new render::Engine() };
|
render::EnginePointer _renderEngine{ new render::Engine() };
|
||||||
gpu::ContextPointer _gpuContext; // initialized during window creation
|
gpu::ContextPointer _gpuContext; // initialized during window creation
|
||||||
workload::EnginePointer _infinityEngine{ new workload::Engine() };
|
|
||||||
|
GameWorkload _gameWorkload;
|
||||||
|
|
||||||
mutable QMutex _renderArgsMutex{ QMutex::Recursive };
|
mutable QMutex _renderArgsMutex{ QMutex::Recursive };
|
||||||
struct AppRenderArgs {
|
struct AppRenderArgs {
|
||||||
|
|
32
interface/src/workload/GameWorkload.cpp
Normal file
32
interface/src/workload/GameWorkload.cpp
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
//
|
||||||
|
// GameWorkload.cpp
|
||||||
|
//
|
||||||
|
// Created by Sam Gateau on 2/16/2018.
|
||||||
|
// Copyright 2018 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 "GameWorkload.h"
|
||||||
|
|
||||||
|
|
||||||
|
GameWorkload::GameWorkload() {
|
||||||
|
}
|
||||||
|
|
||||||
|
GameWorkload::~GameWorkload() {
|
||||||
|
shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GameWorkload::startup() {
|
||||||
|
_engine.reset(new workload::Engine());
|
||||||
|
|
||||||
|
_engine.addJob<GameSpaceToRender>();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GameWorkload::shutdown() {
|
||||||
|
_engine.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GameSpaceToRender::run(const workload::WorkloadContextPointer& renderContext, Outputs& outputs) {
|
||||||
|
}
|
41
interface/src/workload/GameWorkload.h
Normal file
41
interface/src/workload/GameWorkload.h
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
//
|
||||||
|
// GameWorkload.h
|
||||||
|
//
|
||||||
|
// Created by Sam Gateau on 2/16/2018.
|
||||||
|
// Copyright 2018 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
|
||||||
|
//
|
||||||
|
#ifndef hifi_GameWorkload_h
|
||||||
|
#define hifi_GameWorkload_h
|
||||||
|
|
||||||
|
#include "workload/Space.h"
|
||||||
|
#include "workload/Engine.h"
|
||||||
|
|
||||||
|
#include "render/Scene.h"
|
||||||
|
|
||||||
|
class GameSpaceToRender {
|
||||||
|
public:
|
||||||
|
using Outputs = render::Transaction;
|
||||||
|
using JobModel = workload::Job::ModelO<GameSpaceToRender, Outputs>;
|
||||||
|
|
||||||
|
GameSpaceToRender() {}
|
||||||
|
void run(const workload::WorkloadContextPointer& renderContext, Outputs& outputs);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
};
|
||||||
|
|
||||||
|
class GameWorkload {
|
||||||
|
public:
|
||||||
|
GameWorkload();
|
||||||
|
~GameWorkload();
|
||||||
|
|
||||||
|
void startup();
|
||||||
|
void shutdown();
|
||||||
|
|
||||||
|
workload::EnginePointer _engine{};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in a new issue