You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Prevent windows from having a size greater than device limit
This commit is contained in:
@@ -342,3 +342,11 @@ RenderingDevice::DeviceType Utilities::get_video_adapter_type() const {
|
||||
String Utilities::get_video_adapter_api_version() const {
|
||||
return RenderingDevice::get_singleton()->get_device_api_version();
|
||||
}
|
||||
|
||||
Size2i Utilities::get_maximum_viewport_size() const {
|
||||
RenderingDevice *device = RenderingDevice::get_singleton();
|
||||
|
||||
int max_x = device->limit_get(RenderingDevice::LIMIT_MAX_VIEWPORT_DIMENSIONS_X);
|
||||
int max_y = device->limit_get(RenderingDevice::LIMIT_MAX_VIEWPORT_DIMENSIONS_Y);
|
||||
return Size2i(max_x, max_y);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user