Hi ,
I've got trouble understanding these two lines of code:
line 33 & line 34
'TBGL_RenderMatrix2D(0,1,800,601) 'this works better but is not logic for me
TBGL_RenderMatrix2D(1,1,800,600) 'this don't work properly
in this little piece of code
'---Script created on 12-19-2018 17:30:47 by
uses "TBGL"
uses "console"
dim htbgl as DWord 'handler for draw window
const max_x Value = 800 'window size
const max_y value = 600
Function tbmain()
call window_init
call 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()
htbgl = TBGL_CreateWindowEx ("800x600 - ESC to quit", 800,600,16,%TBGL_WS_WINDOWED + %TBGL_WS_DONTSIZE)
tbgl_ShowWindow
'TBGL_RenderMatrix2D(0,1,800,601) 'this works better but is not logic for me
TBGL_RenderMatrix2D(1,1,800,600) 'this don't work properly
TBGL_Color (255,255,255)
end Function
Function draw_loop()
' -- Main loop
While tbgl_IsWindow(htbgl)
If tbgl_GetWindowKeyState(htbgl, %VK_ESCAPE) Then Exit While
tbgl_ClearFrame
call draw_box
tbgl_DrawFrame
tbgl_ResetKeyState()
Wend
end Function
Bookmarks