IMGUI: save ini and logs in our app dir
parent
cc7fdb5f6c
commit
0a9f8ff443
|
@ -34,6 +34,7 @@ void Filesystem::init(const std::string& organisation, const std::string& appnam
|
|||
} else {
|
||||
_homePath = prefPath;
|
||||
SDL_free(prefPath);
|
||||
createDir(_homePath);
|
||||
}
|
||||
|
||||
registerPath(_basePath);
|
||||
|
|
|
@ -10,11 +10,12 @@
|
|||
#include "video/ScopedViewPort.h"
|
||||
#include "io/Filesystem.h"
|
||||
|
||||
TestMeshApp::TestMeshApp(const metric::MetricPtr& metric, const io::FilesystemPtr& filesystem, const core::EventBusPtr& eventBus, const core::TimeProviderPtr& timeProvider) :
|
||||
TestMeshApp::TestMeshApp(const char *appName, const metric::MetricPtr& metric, const io::FilesystemPtr& filesystem, const core::EventBusPtr& eventBus, const core::TimeProviderPtr& timeProvider) :
|
||||
Super(metric, filesystem, eventBus, timeProvider), _colorShader(shader::ColorShader::getInstance()) {
|
||||
setCameraMotion(false);
|
||||
setRenderPlane(false);
|
||||
_fogColor = core::Color::LightBlue;
|
||||
init(ORGANISATION, appName);
|
||||
}
|
||||
|
||||
core::AppState TestMeshApp::onConstruct() {
|
||||
|
|
|
@ -46,7 +46,7 @@ protected:
|
|||
virtual void doRender() override;
|
||||
virtual void onRenderUI() override;
|
||||
public:
|
||||
TestMeshApp(const metric::MetricPtr& metric, const io::FilesystemPtr& filesystem, const core::EventBusPtr& eventBus, const core::TimeProviderPtr& timeProvider);
|
||||
TestMeshApp(const char *appName, const metric::MetricPtr& metric, const io::FilesystemPtr& filesystem, const core::EventBusPtr& eventBus, const core::TimeProviderPtr& timeProvider);
|
||||
|
||||
virtual core::AppState onConstruct() override;
|
||||
virtual core::AppState onInit() override;
|
||||
|
|
|
@ -181,6 +181,12 @@ core::AppState IMGUIApp::onInit() {
|
|||
|
||||
ImGui::CreateContext();
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
const std::string iniFile = _appname + "-imgui.ini";
|
||||
_writePathIni = _filesystem->writePath(iniFile.c_str());
|
||||
io.IniFilename = _writePathIni.c_str();
|
||||
const std::string logFile = _appname + "-imgui.log";
|
||||
_writePathLog = _filesystem->writePath(logFile.c_str());
|
||||
io.LogFilename = _writePathLog.c_str();
|
||||
io.DisplaySize = ImVec2((float)_dimension.x, (float)_dimension.y);
|
||||
ImFontConfig fontCfg;
|
||||
fontCfg.SizePixels = 13.0f * _dpiFactor;
|
||||
|
|
|
@ -73,6 +73,8 @@ protected:
|
|||
Measures _traceMeasuresLastFrame;
|
||||
using FramesMillis = std::array<uint64_t, _maxMeasureSize>;
|
||||
FramesMillis _frameMillis {0ul};
|
||||
std::string _writePathIni;
|
||||
std::string _writePathLog;
|
||||
|
||||
virtual void traceBeginFrame(const char *threadName) override;
|
||||
virtual void traceBegin(const char *threadName, const char* name) override;
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
#include "io/Filesystem.h"
|
||||
|
||||
TestDepthBuffer::TestDepthBuffer(const metric::MetricPtr& metric, const io::FilesystemPtr& filesystem, const core::EventBusPtr& eventBus, const core::TimeProviderPtr& timeProvider) :
|
||||
Super(metric, filesystem, eventBus, timeProvider) {
|
||||
init(ORGANISATION, "testdepthbuffer");
|
||||
Super("testdepthbuffer", metric, filesystem, eventBus, timeProvider) {
|
||||
}
|
||||
|
||||
void TestDepthBuffer::doRender() {
|
||||
|
|
|
@ -9,6 +9,6 @@ int main(int argc, char *argv[]) {
|
|||
const io::FilesystemPtr filesystem = std::make_shared<io::Filesystem>();
|
||||
const core::TimeProviderPtr timeProvider = std::make_shared<core::TimeProvider>();
|
||||
const metric::MetricPtr& metric = std::make_shared<metric::Metric>();
|
||||
TestMeshApp app(metric, filesystem, eventBus, timeProvider);
|
||||
TestMeshApp app("testmesh", metric, filesystem, eventBus, timeProvider);
|
||||
return app.startMainLoop(argc, argv);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue