peter
06-10-2012, 20:30
Hi Petr,
A small TBGL demo.
I have little bit trouble with (TBGL_LoadBMPFont APP_SourcePath +"TBGL_font.bmp") and with ( %TBGL_WS_WINDOWED)
And this doesn't go.
hfont= TBGL_FontHandle("fontname",fontsize)
TBGL_BuildFont(hfont)
TBGL_SetActiveFont(1)
Uses "tbgl"
Dim hwnd As DWord
Function Key(xkey As Word) As Word
Return TBGL_GetAsyncKeyState(xkey)
End Function
hwnd= TBGL_CreateWindowEx("FERN DEMO",800,600,32, %TBGL_WS_FULLSCREEN) '%TBGL_WS_WINDOWED)
TBGL_ShowWindow
TBGL_RenderMatrix2D (0,800,600,0)
TBGL_LoadBMPFont APP_SourcePath+"TBGL_font.bmp"
TBGL_BackColor 0,0,155
Dim a,b,c,d,e,f,newx,newy As Single
Dim r,wa As Long
Dim xy(2) As Single
Sub Fern()
r = Rnd(0,100)
If r <= 10 Then
a = 0
b = 0
c = 0
d = 0.16
e = 0
f = 0
ElseIf r > 1 And r <=86 Then
a = 0.85
b = 0.04
c = -.04
d = 0.85
e = 0
f = 1.60
ElseIf r > 86 And r <=93 Then
a = 0.2
b = -.26
c = 0.23
d = 0.22
e = 0
f = 0.16
Else
a = -.15
b = 0.28
c = 0.26
d = 0.24
e = 0
f = 0.44
End If
newx = ((a * xy(1)) + (b * xy(2)) + e)
newy = ((c * xy(1)) + (d * xy(2)) + f)
xy(1) = newx
xy(2) = newy
TBGL_Color 0,210,55
TBGL_Point xy(1)*40+200,xy(2)*40+80
End Sub
'While TBGL_IsWindow(hwnd)
TBGL_ClearFrame
TBGL_Color 255,255,255
TBGL_PrintBMP "FERN",30,30
TBGL_DrawFrame
For wa=0 To 200000
fern
Next
TBGL_DrawFrame
While Key(27)=0
Sleep (10)
Wend
A small TBGL demo.
I have little bit trouble with (TBGL_LoadBMPFont APP_SourcePath +"TBGL_font.bmp") and with ( %TBGL_WS_WINDOWED)
And this doesn't go.
hfont= TBGL_FontHandle("fontname",fontsize)
TBGL_BuildFont(hfont)
TBGL_SetActiveFont(1)
Uses "tbgl"
Dim hwnd As DWord
Function Key(xkey As Word) As Word
Return TBGL_GetAsyncKeyState(xkey)
End Function
hwnd= TBGL_CreateWindowEx("FERN DEMO",800,600,32, %TBGL_WS_FULLSCREEN) '%TBGL_WS_WINDOWED)
TBGL_ShowWindow
TBGL_RenderMatrix2D (0,800,600,0)
TBGL_LoadBMPFont APP_SourcePath+"TBGL_font.bmp"
TBGL_BackColor 0,0,155
Dim a,b,c,d,e,f,newx,newy As Single
Dim r,wa As Long
Dim xy(2) As Single
Sub Fern()
r = Rnd(0,100)
If r <= 10 Then
a = 0
b = 0
c = 0
d = 0.16
e = 0
f = 0
ElseIf r > 1 And r <=86 Then
a = 0.85
b = 0.04
c = -.04
d = 0.85
e = 0
f = 1.60
ElseIf r > 86 And r <=93 Then
a = 0.2
b = -.26
c = 0.23
d = 0.22
e = 0
f = 0.16
Else
a = -.15
b = 0.28
c = 0.26
d = 0.24
e = 0
f = 0.44
End If
newx = ((a * xy(1)) + (b * xy(2)) + e)
newy = ((c * xy(1)) + (d * xy(2)) + f)
xy(1) = newx
xy(2) = newy
TBGL_Color 0,210,55
TBGL_Point xy(1)*40+200,xy(2)*40+80
End Sub
'While TBGL_IsWindow(hwnd)
TBGL_ClearFrame
TBGL_Color 255,255,255
TBGL_PrintBMP "FERN",30,30
TBGL_DrawFrame
For wa=0 To 200000
fern
Next
TBGL_DrawFrame
While Key(27)=0
Sleep (10)
Wend