1
0
Fork 0
mirror of https://github.com/ctruLua/ctruLua.git synced 2025-10-27 16:39:29 +00:00

gfx.startFrame -> gfx.start and gfx.endFrame -> gfx.stop

This commit is contained in:
Reuh 2015-12-30 18:19:13 +01:00
parent 07d5316d72
commit 73b5c55133
7 changed files with 30 additions and 30 deletions

View file

@ -86,20 +86,20 @@ while ctr.run() do
if not file then
local t = os.time()
repeat
gfx.startFrame(gfx.GFX_TOP)
gfx.start(gfx.GFX_TOP)
gfx.text(3, 3, "Can't open file in write mode")
gfx.endFrame()
gfx.stop()
gfx.render()
until t + 5 < os.time()
else
for i = 1, #lines, 1 do
file:write(lines[i]..lineEnding)
gfx.startFrame(gfx.GFX_TOP)
gfx.start(gfx.GFX_TOP)
gfx.rectangle(0, 0, math.ceil(i/#lines*gfx.TOP_WIDTH), gfx.TOP_HEIGHT, 0, 0xFFFFFFFF)
gfx.color.setDefault(color.background)
gfx.text(gfx.TOP_WIDTH/2, gfx.TOP_HEIGHT/2, math.ceil(i/#lines*100).."%")
gfx.color.setDefault(color.default)
gfx.endFrame()
gfx.stop()
gfx.render()
end
file:flush()
@ -138,7 +138,7 @@ while ctr.run() do
end
-- Draw
gfx.startFrame(gfx.GFX_TOP)
gfx.start(gfx.GFX_TOP)
-- Lines
local sI = math.floor(scrollY / lineHeight)
@ -167,15 +167,15 @@ while ctr.run() do
gfx.rectangle(-scrollX+ font:width(displayedText(curline:sub(1, (utf8.offset(curline, cursorX) or 0)-1))),
-scrollY+ (cursorY-1)*lineHeight, 1, lineHeight, 0, color.cursor)
gfx.endFrame()
gfx.stop()
gfx.startFrame(gfx.GFX_BOTTOM)
gfx.start(gfx.GFX_BOTTOM)
gfx.text(3, 3, "FPS: "..math.ceil(gfx.getFPS()))
keyboard.draw(5, 115)
gfx.endFrame()
gfx.stop()
gfx.render()
end

View file

@ -47,19 +47,19 @@ while ctr.run() do
dMul = hid.pos3d()
gfx.startFrame(gfx.GFX_TOP, gfx.GFX_LEFT)
gfx.start(gfx.GFX_TOP, gfx.GFX_LEFT)
drawStuffIn3D(-1)
gfx.endFrame()
gfx.stop()
gfx.startFrame(gfx.GFX_TOP, gfx.GFX_RIGHT)
gfx.start(gfx.GFX_TOP, gfx.GFX_RIGHT)
drawStuffIn3D(1)
gfx.endFrame()
gfx.stop()
gfx.startFrame(gfx.GFX_BOTTOM)
gfx.start(gfx.GFX_BOTTOM)
gfx.color.setDefault(gfx.color.RGBA8(0, 0, 0))
gfx.text(5, 5, "FPS: "..math.ceil(gfx.getFPS()))
@ -72,7 +72,7 @@ while ctr.run() do
gfx.rectangle(40, 90, 60, 60, 0, 0xDDDDDDFF)
gfx.circle(70 + math.ceil(cx/156 * 30), 120 - math.ceil(cy/156 * 30), 10, 0xFF000000)
gfx.endFrame()
gfx.stop()
angle = angle + 0.05
if angle > 2*math.pi then angle = angle - 2*math.pi end

View file

@ -98,7 +98,7 @@ return function(title, curdir, exts, type)
end
-- Draw
gfx.startFrame(gfx.GFX_TOP)
gfx.start(gfx.GFX_TOP)
gfx.rectangle(0, 10+(sel-scroll)*15, gfx.TOP_WIDTH, 15, 0, gfx.color.RGBA8(0, 0, 200))
@ -112,9 +112,9 @@ return function(title, curdir, exts, type)
gfx.rectangle(0, 0, gfx.TOP_WIDTH, 25, 0, gfx.color.RGBA8(200, 200, 200))
gfx.text(3, 3, curdir, 13, gfx.color.RGBA8(0, 0, 0))
gfx.endFrame()
gfx.stop()
gfx.startFrame(gfx.GFX_BOTTOM)
gfx.start(gfx.GFX_BOTTOM)
gfx.text(5, 5, title)
gfx.text(5, 20, "Accepted file extensions: "..(exts or "all"))
@ -124,7 +124,7 @@ return function(title, curdir, exts, type)
keyboard.draw(5, 115)
end
gfx.endFrame()
gfx.stop()
gfx.render()
end

View file

@ -23,9 +23,9 @@ repeat
while true do
hid.read()
if hid.keys().down.start then break end
gfx.startFrame(gfx.GFX_TOP)
gfx.start(gfx.TOP)
gfx.wrappedText(0, 0, err, gfx.TOP_WIDTH)
gfx.endFrame()
gfx.stop()
gfx.render()
end
end

View file

@ -40,11 +40,11 @@ while true do
audio.mix(nil, leftBalance, 1-leftBalance)
end
gfx.startFrame(gfx.GFX_TOP)
gfx.start(gfx.GFX_TOP)
gfx.text(5, 5, "Audio test! "..tostring(test:time()).."/"..tostring(test:duration()).."s")
gfx.text(5, 25, "Last audio played on channel "..tostring(channel))
gfx.text(5, 65, "Speed: "..(speed*100).."% - Left balance: "..(leftBalance*100).."%")
gfx.endFrame()
gfx.stop()
gfx.render()
end

View file

@ -25,9 +25,9 @@ while ctr.run() do
data = (data.."!")
end
gfx.startFrame(gfx.GFX_TOP)
gfx.start(gfx.GFX_TOP)
gfx.text(0, 0, data)
gfx.endFrame()
gfx.stop()
gfx.render()
end