kryton9
04-05-2017, 21:20
I was experimenting today and tried out the templates in thinAir when creating a new project. Really nice job Eros and Petr on those templates!
After awhile, I used the tbgl skeleton template and started changing, well seeing what I could get away with. This runs fine and bundles fine too to an exe file.
Is it safe to code in this style these days even though it works fine in latest thinBasic?
Uses "TBGL"
' Create and show window
DWord hWnd = TBGL_CreateWindowEx "TBGL script - press ESC to quit", 640, 480, 32,
%TBGL_WS_WINDOWED Or %TBGL_WS_CLOSEBOX
TBGL_ShowWindow
' Initialize lighting
TBGL_UseLighting %TRUE
TBGL_UseLightSource %GL_LIGHT0, %TRUE
TBGL_SetLightParameter %GL_LIGHT0, %TBGL_LIGHT_POSITION, 15, 10, 15, 1
' Resets status of all keys
TBGL_ResetKeyState
' Main loop
While TBGL_IsWindow hWnd
TBGL_ClearFrame
TBGL_Camera 15, 15, 15, 0, 0, 0
TBGL_Color 255, 128, 0
TBGL_Box 1, 1, 1
TBGL_DrawFrame
' ESCAPE key to exit application
If TBGL_GetWindowKeyState hWnd, %VK_ESCAPE Then Exit While
Wend
TBGL_DestroyWindow
After awhile, I used the tbgl skeleton template and started changing, well seeing what I could get away with. This runs fine and bundles fine too to an exe file.
Is it safe to code in this style these days even though it works fine in latest thinBasic?
Uses "TBGL"
' Create and show window
DWord hWnd = TBGL_CreateWindowEx "TBGL script - press ESC to quit", 640, 480, 32,
%TBGL_WS_WINDOWED Or %TBGL_WS_CLOSEBOX
TBGL_ShowWindow
' Initialize lighting
TBGL_UseLighting %TRUE
TBGL_UseLightSource %GL_LIGHT0, %TRUE
TBGL_SetLightParameter %GL_LIGHT0, %TBGL_LIGHT_POSITION, 15, 10, 15, 1
' Resets status of all keys
TBGL_ResetKeyState
' Main loop
While TBGL_IsWindow hWnd
TBGL_ClearFrame
TBGL_Camera 15, 15, 15, 0, 0, 0
TBGL_Color 255, 128, 0
TBGL_Box 1, 1, 1
TBGL_DrawFrame
' ESCAPE key to exit application
If TBGL_GetWindowKeyState hWnd, %VK_ESCAPE Then Exit While
Wend
TBGL_DestroyWindow