From c9ebe23d6282e96b410dc7687e0be1c4f3ba1b4d Mon Sep 17 00:00:00 2001 From: jussi Date: Thu, 21 Nov 2024 23:25:28 +0200 Subject: RL.config and InitWindow. --- examples/draw_textured_polygon/main.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'examples/draw_textured_polygon/main.lua') diff --git a/examples/draw_textured_polygon/main.lua b/examples/draw_textured_polygon/main.lua index ddf5efc..c96e900 100644 --- a/examples/draw_textured_polygon/main.lua +++ b/examples/draw_textured_polygon/main.lua @@ -4,11 +4,7 @@ package.path = package.path..";"..RL.GetBasePath().."../resources/lib/?.lua" Vec2 = require( "vector2" ) -local monitor = 0 -local mPos = Vec2:newT( RL.GetMonitorPosition( monitor ) ) -local mSize = Vec2:newT( RL.GetMonitorSize( monitor ) ) -local winSize = Vec2:newT( RL.GetScreenSize() ) - +local winSize = Vec2:new() local polygon = { texture = -1, texcoords = { @@ -30,6 +26,11 @@ local polygon = { } function RL.init() + local monitor = 0 + local mPos = Vec2:newT( RL.GetMonitorPosition( monitor ) ) + local mSize = Vec2:newT( RL.GetMonitorSize( monitor ) ) + winSize = Vec2:newT( RL.GetScreenSize() ) + RL.SetWindowState( RL.FLAG_WINDOW_RESIZABLE ) RL.SetWindowState( RL.FLAG_VSYNC_HINT ) RL.SetWindowPosition( { mPos.x + mSize.x / 2 - winSize.x / 2, mPos.y + mSize.y / 2 - winSize.y / 2 } ) -- cgit v1.2.3