Update main.py

This commit is contained in:
Yonokid
2025-04-26 03:21:55 -04:00
parent db89298573
commit e7449e08bb

11
main.py
View File

@@ -17,10 +17,15 @@ class Screens:
RESULT = "RESULT" RESULT = "RESULT"
def main(): def main():
render_width, render_height = ray.get_render_width(), ray.get_render_height()
dpi_scale = ray.get_window_scale_dpi()
screen_width: int = get_config()["video"]["screen_width"] screen_width: int = get_config()["video"]["screen_width"]
screen_height: int = get_config()["video"]["screen_height"] screen_height: int = get_config()["video"]["screen_height"]
render_width, render_height = ray.get_render_width(), ray.get_render_height()
dpi_scale = ray.get_window_scale_dpi()
if dpi_scale.x == 0:
dpi_scale = (ray.get_render_width(), ray.get_render_height())
dpi_scale = screen_width, screen_height
else:
dpi_scale = int(render_width/dpi_scale.x), int(render_height/dpi_scale.y)
if get_config()["video"]["vsync"]: if get_config()["video"]["vsync"]:
ray.set_config_flags(ray.ConfigFlags.FLAG_VSYNC_HINT) ray.set_config_flags(ray.ConfigFlags.FLAG_VSYNC_HINT)
@@ -92,7 +97,7 @@ def main():
ray.draw_texture_pro( ray.draw_texture_pro(
target.texture, target.texture,
ray.Rectangle(0, 0, target.texture.width, -target.texture.height), ray.Rectangle(0, 0, target.texture.width, -target.texture.height),
ray.Rectangle(0, 0, int(render_width/dpi_scale.x), int(render_height)/dpi_scale.y), ray.Rectangle(0, 0, dpi_scale[0], dpi_scale[1]),
ray.Vector2(0,0), ray.Vector2(0,0),
0, 0,
ray.WHITE ray.WHITE