Here's an example:
--Load FreeImage plugin (optional)
local fiplugin = LoadPlugin("Plugins/FITextureLoader")
--Get the displays
local displays = GetDisplays()
--Create a window
local window = CreateWindow("Ultra Engine", 0, 0, 1280 * displays[1].scale, 720 * displays[1].scale, displays[1], WINDOW_CENTER | WINDOW_TITLEBAR)
--Create a framebuffer
local framebuffer = CreateFramebuffer(window)
--Create a world
local world = CreateWorld()
local cam = CreateCamera(world)
cam:AddComponent(CameraControls)
cam:SetPosition(0,1,-1)
--cam:SetFov(70)
local sz = Vec2(framebuffer.size.x * 0.25, framebuffer.size.y * 0.25)
local texbuffer = CreateTextureBuffer(sz.x, sz.y)
cam:SetRenderTarget(texbuffer)
local cam2 = CreateCamera(world, PROJECTION_ORTHOGRAPHIC)
cam2:SetRenderLayers(2)
local sprite = CreateSprite(world, framebuffer.size.x, framebuffer.size.y)
local mtl = CreateMaterial()
local fam = LoadShaderFamily("Shaders/Unlit.fam")
local tex = texbuffer:GetColorAttachment(1)
mtl:SetTexture(tex)
mtl:SetShaderFamily(fam)
sprite:SetMaterial(mtl)
sprite:SetRenderLayers(2)
cam2:SetPosition(framebuffer.size.x * 0.5, framebuffer.size.y * 0.5, 0)
--Load a map
local mapname = "Maps/start.ultra"
local cl = CommandLine()
if type(cl["map"]) == "string" then mapname = cl["map"] end
local scene = LoadMap(world, mapname)
while window:KeyDown(KEY_ESCAPE) == false and window:Closed() == false do
--Update the world
world:Update()
--Render the world to the framebuffer
world:Render(framebuffer)
end