Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
28
Task/Draw-a-pixel/FreeBASIC/draw-a-pixel.basic
Normal file
28
Task/Draw-a-pixel/FreeBASIC/draw-a-pixel.basic
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
' version 27-06-2018
|
||||
' compile with: fbc -s console
|
||||
' or: fbc -s gui
|
||||
|
||||
Screen 13 ' Screen 18: 320x200, 8bit colordepth
|
||||
'ScreenRes 320, 200, 24 ' Screenres: 320x200, 24bit colordepth
|
||||
|
||||
If ScreenPtr = 0 Then
|
||||
Print "Error setting video mode!"
|
||||
End
|
||||
End If
|
||||
|
||||
Dim As UInteger depth, x = 100, y = 100
|
||||
|
||||
' what is color depth
|
||||
ScreenInfo ,,depth
|
||||
|
||||
If depth = 8 Then
|
||||
PSet(x, y), 40 ' palette, index 40 = RGB(255, 0, 0)
|
||||
Else
|
||||
PSet(x, y), RGB(255, 0, 0) ' red
|
||||
End If
|
||||
|
||||
' empty keyboard buffer
|
||||
While Inkey <> "" : Wend
|
||||
WindowTitle IIf(depth = 8, "Palette","True Color") + ", hit any key to end program"
|
||||
Sleep
|
||||
End
|
||||
Loading…
Add table
Add a link
Reference in a new issue