Create
Creates a new graphics context for rendering.
Syntax
- Context Create(Window window, number multisamplemode=0)
Parameters
- window: the window to create the context on.
- multisamplemode: the multisample anti-alias (MSAA) mode to use. This can be 0, 1, 2, 4, 8, or 16.
Returns
Returns the created Context. If the Context could not be created with the specified parameters, NULL is returned.
Example
window = Window:Create()
context = Context:Create(window)
while true do
if window:Closed() or window:KeyHit(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,context:GetWidth()-200,context:GetHeight()-200)
context:Sync()
end