Skip to content

Commit

Permalink
Fix build and testviewer bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Duttenheim committed May 7, 2024
1 parent 32a238d commit 973229c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions tests/testviewer/scenes/clusteredlighting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include "particles/particlecontext.h"
#include "characters/charactercontext.h"

#include "materials/materialtemplates.h"

using namespace Timing;
using namespace Graphics;
using namespace Visibility;
Expand Down Expand Up @@ -226,7 +228,6 @@ void OpenScene()
static const int NumModels = 20;
int modelIndex = 0;
materialContexts.Resize((NumModels * 2) * (NumModels * 2));
CoreGraphics::BatchGroup::Code code = CoreGraphics::BatchGroup::FromName("FlatGeometryLit");

for (IndexT i = -NumModels; i < NumModels; i++)
{
Expand All @@ -243,12 +244,12 @@ void OpenScene()
const float timeOffset = Math::rand();// (((i + NumModels)* NumModels + (j + NumModels)) % 4) / 3.0f;

// create model and move it to the front
ModelContext::Setup(ent, modelRes[modelIndex], "NotA", [ent, entityIndex, modelIndex, i, j, skeletonRes, animationRes, code]()
ModelContext::Setup(ent, modelRes[modelIndex], "NotA", [ent, entityIndex, modelIndex, i, j, skeletonRes, animationRes]()
{
ModelContext::SetTransform(ent, Math::translation(i * 16, 0, j * 16));

uint materialIndex = i + (j + NumModels) * (NumModels * 2);
entities[entityIndex].materialInstanceContext = &ModelContext::SetupMaterialInstanceContext(ent, code);
entities[entityIndex].materialInstanceContext = &ModelContext::SetupMaterialInstanceContext(ent, MaterialTemplates::BatchGroup::FlatGeometryLit);

Graphics::RegisterEntity<Characters::CharacterContext, ObservableContext>(ent);
ObservableContext::Setup(ent, VisibilityEntityType::Model);
Expand Down
2 changes: 1 addition & 1 deletion tests/testviewer/viewerapp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ SimpleViewerApplication::Open()
this->wnd = CreateWindow(wndInfo);
this->cam = Graphics::CreateEntity();

this->view = gfxServer->CreateView("mainview", "frame:vkdefault.json"_uri);
this->view = gfxServer->CreateView("mainview", "frame:vkdefault.json"_uri, this->wnd);
gfxServer->SetCurrentView(this->view);
this->stage = gfxServer->CreateStage("stage1", true);

Expand Down

0 comments on commit 973229c

Please sign in to comment.