-
-
Notifications
You must be signed in to change notification settings - Fork 681
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
Rework for current FinalScreenDrawer
design, allow the user to control the images monitored by the engine.
#3166
Comments
I don't quite understand the benefits. Cloud you elaborate what kind of problem are you addressing on? |
Sure, It will allow to pass screen-sized ebiten.Image to any ebitengine function and third-party library. |
You can return such size at Layout, right? |
I mean, yes, it can be a separate library. But a separate library will not have access to the internal ui api which can be used to listen resize events. I believe that the engine knows better, when to resize it (even if its just cheking it with == right now). There is also a point to get rid of that very strange implementation-closed interface which (in my opinion) can cause some problems with maintaining it in the future when new apis will be added to Image (which also is not compatible with most engine functions which is strange in design terms). |
Please explain what the problem is, not how to solve it.
The interface can add methods without breaking compatibility as the interface includes private methods so that no one other than ebiten package can implement the interface |
I can't use |
Ok I understood, but FinalDraw is not for such complicated rendering in the first place. |
I think such libraries could accept an interface interested of Ebitengine but I'll consider it for v3 if I would do. |
Thats the problem with its design, that I mentioned. It cannot be implemented so we need to make full copy all the functions that accept |
FinalDraw is a special function and my intention is not to provide a screen as a regular image to render texts or something. You should use regular Draw for that. So let me close this. If there is another problem, feel free to leave comments. |
Operating System
What feature would you like to be added?
The current solution to the problem of drawing shaders to the screen has some design flaws, in particular the
FinalScreen
interface, which lacks someImage
capabilities due to implementation quirks, and also cannot be used by most image-receiving functions.So, right now we have an offscreen for drawing FinalScreen:
Then, we have a loop that will constantly monitor screen size and recreating that offscreen:
Then, we have that draw call for it with some complicated logic for scaling probably because its different from a normal unmanaged image.
I suggest to deprecate all of that and make a function for creating unmanaged images that will be resized by ebitengine inside the lib, because its knows the best, when the resizing begin and end (could use slice with indicies instead of map).
Which will be monitored just as previous image:
Not sure about how to pass offscreens from
gameForUI
tocontext
, probably some getter will do the job.I'd also like to suggest to prepend and preshrink the image while zooming begin in order to minimize the number of allocations.
Why is this needed?
The new solution will work with every ebitengine util functions and other third-party libraries functions.
It will allow to get rid of that closed interface that will take some effort to maintan in the future.
The text was updated successfully, but these errors were encountered: