Closed funrep closed 11 years ago
I don't think we should handle loading config from JSON in the engine, games should handle that themselves. But this looks good. I'll add some sort of engineconfig struct containing title, dimensions, etc. and just make the regular run function take it. That's what I've been meaning to do for a while. I don't think we really need 2 run functions.
I just added a second function so demos would still work. ^^
Also, option for fullscreen and option for fixed-size window may be something to be considered.
Okey, so engine should not handle configs, I agree with that. BUT, don't you think it would be good to provide some kind of functionality to deal with different locations where game assets and saved games might be located since all platforms have different kind of filesystem structure?
(Just brainstorming a bit to much maybe sry about that :P)
Yeah, I'll update all the demos when I change it. I just don't want to enforce a specific way of handling config by default. But I think you're right about some utility for handling platform-specific game directories, that definitely would be useful.
OK, so in 3885eccda71c0cfc2ee5735060399c738900c2b4 the run
function takes an EngineConfig
struct now.
Read runA as runAdvanced. Okey, now it's a bit more useful since you get choose initial window size and title.
I suggest something like this for a better run engine function: It parses a config file(we could use Data.Configurator or probably preferably using json?) that has window size etc. This file could be change in runtime. If the config file stuff is in seperated module it could also be used for stuff like saved games etc. and also have easy support for handling filesystems across platforms(*nix uses .gamename/ for files, windows using C:\Users\user\Saved Games\gamename etc. etc.). This is just suggestion.
Also, maybe have option to only not allow the window to be resizeable and also have an option for fullscreen is needed i guess. I could probably implement that as good as I can but now I have to head to the gym.