Call Window.onFramebufferSizeChanged to resize (fixes #705)
Instead of setting the the values via accessor and calling the handler directly. This allows mods like ResolutionControl+ to properly resize its internal framebuffers as well.
This commit is contained in:
@@ -56,12 +56,14 @@ public class VirtualWindow implements Closeable {
|
||||
gameHeight = acc.getFramebufferHeight();
|
||||
acc.setFramebufferWidth(framebufferWidth);
|
||||
acc.setFramebufferHeight(framebufferHeight);
|
||||
applyScaleFactor();
|
||||
isBound = true;
|
||||
}
|
||||
|
||||
public void unbind() {
|
||||
acc.setFramebufferWidth(gameWidth);
|
||||
acc.setFramebufferHeight(gameHeight);
|
||||
applyScaleFactor();
|
||||
isBound = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,4 +15,6 @@ public interface MainWindowAccessor {
|
||||
int getFramebufferHeight();
|
||||
@Accessor
|
||||
void setFramebufferHeight(int value);
|
||||
@Invoker
|
||||
void invokeOnFramebufferSizeChanged(long window, int width, int height);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user