Skip to content
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

Missing customization option at configs #36

Open
ManuelKugelmann opened this issue Mar 27, 2020 · 6 comments
Open

Missing customization option at configs #36

ManuelKugelmann opened this issue Mar 27, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@ManuelKugelmann
Copy link

I'm working on stuff like an embeddable ramses renderer, ramses Spout sender, etc. . I do not want to make any changes to this project to make maintenance easier. I am missing an option to add custom data to the configs. Right now I'am misusing cfg.setAndroidNativeWindow((void*)cfgx); ...

@jcsneaker
Copy link
Contributor

hi, this sounds interesting. From where to where exactly do you want to transfer custom data?

@ManuelKugelmann
Copy link
Author

ManuelKugelmann commented Apr 28, 2020

CreateDisplay() to e.g. Window_..., Context__..., Platform_..., PlatformFactory_...

There is also some private and final methods that hinder code reuse - I e.g. had to copy Window_Windows instead of deriving from it.

And some methods do not have access to the configs, so I had to expose the Window_Windows_... member. To getContextAttributes() I had to add a parameter to get access to the config - different windows may use different attributes.

At some places I was also wondering why the Platform stuff made no use of C++ templates - I think the whole per-platform code of PlatformFactory_... could be templated and neccessary custom code put into Platform_...

@ManuelKugelmann
Copy link
Author

Bump - my extension needs an update to the current ramses version - any progress here? I saw some potentially related stuff, but did not dive into the source, yet.

@violinyanev
Copy link
Member

Hi @ManuelKugelmann this looks like a "summary" of the other issues you posted, right? The other ones are a lot more concrete - should we close this one then, and follow up in the others? Or is there something here you still consider worthy of its own issue?

@ManuelKugelmann
Copy link
Author

ManuelKugelmann commented Nov 28, 2021

Hi @violinyanev, this is actually its own issue - I'll try to rephrase:
DisplayConfig is not very extensible. I currently use a Hack where I put a pointer to my own config extension into a suitable unused (by me) member of DisplayConfig: I just do cfg.setAndroidNativeWindow((void*)cfgx) where cfgx is a pointer to an instance of my own ConfigExtension class.
This way I can get to my custom config data (e.g. Spout settings) everywhere the DisplayConfig is available ;)

@ManuelKugelmann
Copy link
Author

In general: DisplayConfig could be much cleaner if it followed a composition pattern, where platform specific settings are wrapped in their own platform specific configuration blocks.

@violinyanev violinyanev added the enhancement New feature or request label May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants