29 lines
936 B
Java
29 lines
936 B
Java
package net.minecraft.client.renderer;
|
|
|
|
import com.mojang.blaze3d.platform.DisplayData;
|
|
import com.mojang.blaze3d.platform.Monitor;
|
|
import com.mojang.blaze3d.platform.ScreenManager;
|
|
import com.mojang.blaze3d.platform.Window;
|
|
import net.fabricmc.api.EnvType;
|
|
import net.fabricmc.api.Environment;
|
|
import net.minecraft.client.Minecraft;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
@Environment(EnvType.CLIENT)
|
|
public final class VirtualScreen implements AutoCloseable {
|
|
private final Minecraft minecraft;
|
|
private final ScreenManager screenManager;
|
|
|
|
public VirtualScreen(Minecraft minecraft) {
|
|
this.minecraft = minecraft;
|
|
this.screenManager = new ScreenManager(Monitor::new);
|
|
}
|
|
|
|
public Window newWindow(DisplayData screenSize, @Nullable String videoModeName, String title) {
|
|
return new Window(this.minecraft, this.screenManager, screenSize, videoModeName, title);
|
|
}
|
|
|
|
public void close() {
|
|
this.screenManager.shutdown();
|
|
}
|
|
}
|