uses
"TBGL"
begin
const
%max_x = 800
%max_y = 600
end
const
function
tbMain
()
window_init()
draw_loop()
tbgl_destroyWindow
end
function
function
draw_box()
tbgl_line (1, 1, 1, %max_y)
tbgl_line (1, %max_y, %max_x, %max_y)
tbgl_line (%max_x, %max_y, %max_x, 1)
tbgl_line (%max_x, 1, 1, 1)
end
function
function
window_init()
global
g_win
as
dword
=
tbgl_CreateWindowEx
(
"Pixel perfect 2D rendering - ESC to quit"
, 800, 600, 32, %TBGL_WS_WINDOWED
or
%TBGL_WS_DONTSIZE)
tbgl_showWindow
tbgl_renderMatrix2D
(1, 1, 800, 600, %TBGL_PIXEL_PERFECT_2D)
tbgl_color
255 , 0, 255
end
function
function
draw_loop()
tbgl_resetKeyState
()
while
tbgl_isWindow
(g_win)
if
tbgl_getWindowKeyState
(g_win, %
VK_ESCAPE
)
then
exit
while
tbgl_clearFrame
draw_box()
tbgl_drawFrame
wend
end
function