GetColor
This functions gets the current rendering context.
Syntax
Returns
Returns the current rendering context, or NULL if there is no current context.
Example
--Create a window
local window = Window:Create()
--Create a rendering context
local context = Context:Create(window)
while true do
local context = Context:GetCurrent()
local window = context:GetWindow()
if (window:Closed() or window:KeyDown(Key.Escape)) then return false end
context:SetColor(0,0,1)
context:Clear()
--Draw a rectangle on the screen
context:SetColor(1,0,0)
context:DrawRect(100,100,window:GetWidth()-200,window:GetHeight()-200)
context:Sync()
end