hey @bakercp , thanks for this addon, it’s working fine for what I tested until now.
I am using the addon to store/recall the window settings (pos, size, mode) but I am not sure if there’s a better way… Maybe it’s possible to access to the main window pointer or something.
Here’s my code. I don’t know how to handle the window mode…
ofSavePrettyJson ("AppWindow.json", j);
ofJson j = ofLoadJson("AppWindow.json");
Hey there, currently
ofAppBaseWindow doesn’t have an accessor for
ofWindowSettings. You can pass it in
ofAppBaseWindow::setup(..), but can’t recover it all together. You have to recover it one member variable at a time. Your method works, but you might also do something like this:
settings.windowMode = ofGetCurrentWindow()->getWindowMode();
It is a little tricky to serialize ofWindowSettings, because usually you will actually be using one of its subclasses, so I didn’t build in a bunch of special window settings that are available in
ofGLFWWindowSettings for instance.
To set the window settings, you can use this helper function:
// Load the json.
ofJson json = ofLoadJson("AppWindow.json");
// This will apply all of the settings to the current window.
There are also some helpful app settings you can save / apply, just take a look at the code.