-
Notifications
You must be signed in to change notification settings - Fork 130
Automatically find config data or load default #265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…pty config if one is not found
|
Following up from discussion on #271 (moving discussion here where it fits better): The displays directory is used in osvr_server config files: for example, this one https://github.com/OSVR/OSVR-Core/blob/master/apps/sample-configs/osvr_server_config.dSight.json (The default is to prepopulate the data structure with a compiled-in version of the HDK display descriptor, so if you don't specify one explicitly that's what it uses.) The "displays" entry can either contain the full display descriptor json object right there, or it can be a filename or a (limited subset of valid forms of) JSON reference. The code that handles that is in the following files, designed/coded with the knowledge it would probably expand, move into common or util, and gain awareness of some sense of "json search path" because right now it's pretty fragile and primarily current-working-directory-dependent (which happens to work OK in the case of Windows where working dir defaults to executable dir if you double-click it).
used for displays here: https://github.com/OSVR/OSVR-Core/blob/master/src/osvr/Server/ConfigureServer.cpp#L345 Eventually, of course, many times these display descriptors will be compiled in to plugins and auto-detected, but there are plenty of cases/reasons when display parameters couldn't be autodetected or don't need a full plugin, so this configuration option is likely to stick around even once display autodetect functionality is in there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this file needs to be generated - it doesn't look like it's using any CMake substitutions. Just consuming #ifdefs from a configured header is fine in a regular header or implementation file.
|
Feel free to make any changes as needed. Also note that I didn't have a chance to test on Windows. |
|
We may want to go ahead and put a default RenderManager config in place (see the installer for directmode one for the HDK). This won't hurt clients that don't use RenderManager but would make it work by default without a special config file when they are. |
|
@russell-taylor we can do that in a separate issue, this one is primarily about cross-platforming stuff.
Not sure what you mean here - we do already have a plugin directory search path thing. It doesn't handle a system-wide or user-wide thing, but it does correctly handle (I think! I really need to set up a bare-metal Linux machine here) finding + loading plugins from the install tree. |
|
@rpavlik you're right, I should have noticed this, since I played with it before. |
|
Any thoughts on where we want to go with this? It may need some restructuring, but I'm not sure what exactly I should be doing. |
|
@JeroMiya I don't mind, unfortunately I haven't had much of a chance to look at this stuff lately. |
|
Cool, thanks. I'm going to go ahead and close this PR out then. It's being replaced by this one: |
This enables automatic searching for config files based on a list of hardcoded paths (this can be changed if needed), or loads a default empty config if no config filename is passed.
This, together with #264, should solve #238, #185, and #171, #172, at least, but may need some changes/tweaks.
Before we can claim full autoconfig support we also need to implement plugin directory path detection.