Skip to content

Commit

Permalink
model layer for gui in world
Browse files Browse the repository at this point in the history
  • Loading branch information
malytomas committed Dec 28, 2024
1 parent cb67534 commit e9c6a73
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions sources/include/cage-engine/winMain.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
const auto cmd = ::cage::privat::winMainParams();
return ::main(cmd.first, cmd.second);
}

#endif
#endif
1 change: 1 addition & 0 deletions sources/include/cage-simple/guiInWorld.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ namespace cage
Entity *cameraEntity = nullptr; // optional
Vec2i resolution = Vec2i(1920, 1080);
Real retinaScale = 4;
sint32 modelLayer = 0;
bool tooltipsEnabled = true;
};

Expand Down
4 changes: 1 addition & 3 deletions sources/libengine/winMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ namespace cage
{
CAGE_API_EXPORT std::pair<int, const char **> winMainParams()
{
using namespace cage;

CAGE_LOG(SeverityEnum::Info, "cage-engine", "winMain parsing parameters");

static int consoleDummy = []()
Expand All @@ -40,7 +38,7 @@ namespace cage
}

// convert wide char to multibyte
char **argv = new char *[argc];
char **argv = new char *[argc]; // intentional leak
for (int i = 0; i < argc; i++)
{
size_t len = wcslen(argvW[i]) + 1;
Expand Down
3 changes: 2 additions & 1 deletion sources/libsimple/guiInWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ namespace cage
tex = newTexture();
tex->initialize(config.resolution, 1, GL_RGBA8);
tex->wraps(GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE);
tex->filters(GL_LINEAR, GL_LINEAR, 8);
tex->filters(GL_LINEAR, GL_LINEAR, 16);
tex->setDebugName(Stringizer() + "gui-in-world-texture-" + (uintPtr)this);
textureName = engineAssets()->generateUniqueId();
engineAssets()->loadValue<AssetSchemeIndexTexture>(textureName, tex.share(), Stringizer() + "gui-in-world-texture-" + (uintPtr)this);
Expand All @@ -140,6 +140,7 @@ namespace cage
mod->importMesh(+msh, bufferView(material));
mod->textureNames[0] = textureName;
mod->flags = MeshRenderFlags::DepthTest | MeshRenderFlags::DepthWrite | MeshRenderFlags::CutOut;
mod->layer = config.modelLayer;
mod->setDebugName(Stringizer() + "gui-in-world-model-" + (uintPtr)this);
modelName = engineAssets()->generateUniqueId();
engineAssets()->loadValue<AssetSchemeIndexModel>(modelName, mod.share(), Stringizer() + "gui-in-world-model-" + (uintPtr)this);
Expand Down

0 comments on commit e9c6a73

Please sign in to comment.