RL.config and InitWindow.

This commit is contained in:
jussi
2024-11-21 23:25:28 +02:00
parent d96e33bb17
commit c9ebe23d62
23 changed files with 189 additions and 221 deletions

View File

@@ -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 } )