-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Should probably add the methods to the interface... #1398
Conversation
...and fix also android etc. but still, at least we do have that information for desktop.
This is showing the OpenCL info... and only for the last device listed. For display driver info that is useful for graphics settings screens and such, it would be the stuff in printContextInitInfo(). Also, without a change to the interface then this still requires a cast to use... so the caller might as well just import Display directly. |
printContextInitInfo() don't have the "profile" information. The OpenCL part is the ONLY place where "profile" is printed. I agree this is bad design and hackish, but at least is a step that makes it possible to see the opengl profile. |
It's already possible... by going directly to lwjgl. This code is currently no better than that. |
Please show me where it is done. I haven't found a method, and the only this I've found in JME is that initialization code that (I think) shouldn't be invoked from the application. |
Nothing stops an application from calling "CLPlatform.getPlatforms()" itself and looking at the information. The whole point of having this support in JME would be that you wouldn't have to go directly to platform specific code. If the support is only on the platform specific context anyway then there is no point... because the application could just go to lwjgl directly since they'd have already tied themselves directly to that. |
Yes, I can call getPlatform but:
gives me a nice:
and if I try
incompatible types: CLDevice cannot be converted to LwjglDevice and of course incompatible types: CLPlatform cannot be converted to LwjglPlatform |
And you are doing this on the render thread? I mean, apparently the JME code works. It shouldn't care what class it's in I guess. |
At first it was on the initialize() of an AppState, now I've tried with this
Still got the crash, and the profile is not printed. I take that unless you are a JME guru you just can't access this API. |
...and this is starting to look ridiculous. |
Seems like you are doing that before the context is initialized and not on the render thread. Even the code you added to JME cannot be used before the context has been initialized. |
Ok, I've waited until the context is initialized (graphics and mouse works). Then the debugger tells me that the thread is "jME3 Main". |
So I guess the same JME code that you added has magic fairy dust. I can't explain why the same code works in one place and not another. ...though it does make me wonder if the code added to JME will randomly break at different times now. |
|
Please try to run the above |
Oh, I recall something about this when trying to do the same thing.... I can't remember, but perhaps LWJGL Platform can only be created once per context.... I will setup a test to see what I can find. |
tbh you are on a completely wrong approach. Then the tricky question is: How can we expose this API programmatically without having to depend on the lwjgl2, 3 or jogl modules. Not sure if you can, but either way the API should be around the same and you could just save the info during context init (it won't be available earlier than that anyway) and then just query that "store" where you put them into. I guess funnier things are how to handle multi gpu setups, when lwjgl2 probably doesn't support that or other advanced info like GL Features, that jme only queries for one device in the long urn. TLDR: Design an Interface, Implement it directly where the log is printed. |
So, anybody tried to run and experience the crash with my code? |
I haven't, personally. In the end, this PR is probably not going to be accepted. Once we add public methods they are part of the public API essentially forever. If someone came along next week and did a real and proper implementation looking at the possible settings across all of the supported platforms and then decided the methods in this PR wouldn't fit that then we end up dragging around useless methods for several years. So my vote is that we wait for the proper implementation that adds methods to the interface and support for the other platforms. |
...and fix also android etc. but still, at least we do have that information for desktop.