Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \
- \ JANAITE 20200123
- \ A simple hello of Raylib v.2.5
- \ FROM: https://www.raylib.com/examples.html
- \ MUDANÇAS &&& POR PeterForth 25-1-2020
- REQUIRE CAPI: lib\win\api-call\capi.f
- REQUIRE ALIAS devel\~moleg\lib\util\alias.f
- \ &&& TEM QUE SE LLAMAR GRAPHICS O GRAPHICA O ALGUMA COISA
- \ PARECIDA
- VOCABULARY GRAPHICS ALSO GRAPHICS DEFINITIONS
- 3 CAPI: InitWindow libraylib.dll
- 0 CAPI: WindowShouldClose libraylib.dll
- 0 CAPI: CloseWindow libraylib.dll
- 0 CAPI: BeginDrawing libraylib.dll
- 1 CAPI: ClearBackground libraylib.dll
- 5 CAPI: DrawText libraylib.dll
- 0 CAPI: EndDrawing libraylib.dll
- 1 CAPI: SetTargetFPS libraylib.dll
- 5 CAPI: DrawLine libraylib.dll
- 4 CAPI: DrawCircle libraylib.dll
- 5 CAPI: DrawRectangle libraylib.dll
- 5 CAPI: DrawRectangleLines libraylib.dll
- 6 CAPI: DrawRectangleGradientH libraylib.dll
- \ WINAPI: DrawCircleGradient libraylib.dll
- \ WINAPI: DrawCircleLines libraylib.dll
- \ WINAPI: DrawTriangle libraylib.dll
- \ output ARGB with 8 bit each color component
- \ DECIMAL
- : >RGBA ( r g b a -- u )
- 24 LSHIFT SWAP
- 16 LSHIFT OR SWAP
- 8 LSHIFT OR SWAP
- OR CONSTANT ;
- \ &&&&&&=====AGREGUEI===precisa !==========================
- DECIMAL
- \ S" lib\include\float2.f" INCLUDED
- \ &&& LIBRARIA FLOATING POINT forthwin1.1 ya tem
- : F>FL ( -> f ) ( F: f -> )
- [
- 0x8D C, 0x6D C, 0xFC C,
- 0xD9 C, 0x5D C, 0x00 C,
- 0x87 C, 0x45 C, 0x00 C,
- 0xC3 C, ] ;
- \ Number of float from float stack to data stack
- : F>DL ( -> d ) ( F: f -> )
- FLOAT>DATA SWAP ;
- \ Convert number on stack to float
- : S>FL ( n -> f )
- DS>F F>FL ;
- \ Convert number on stack to double
- : S>DL ( n -> d )
- DS>F F>DL ;
- \ =======================================================
- \ constants from raylib.h
- 200 200 200 255 >RGBA #LIGHTGRAY \ Light Gray
- 130 130 130 255 >RGBA #GRAY \ Gray
- 80 80 80 255 >RGBA #DARKGRAY \ Dark Gray
- 253 249 0 255 >RGBA #YELLOW \ Yellow
- 255 203 0 255 >RGBA #GOLD \ Gold
- 255 161 0 255 >RGBA #ORANGE \ Orange
- 255 109 194 255 >RGBA #PINK \ Pink
- 230 41 55 255 >RGBA #RED \ Red
- 190 33 55 255 >RGBA #MAROON \ Maroon
- 0 228 48 255 >RGBA #GREEN \ Green
- 0 158 47 255 >RGBA #LIME \ Lime
- 0 117 44 255 >RGBA #DARKGREEN \ Dark Green
- 102 191 255 255 >RGBA #SKYBLUE \ Sky Blue
- 0 121 241 255 >RGBA #BLUE \ Blue
- 0 82 172 255 >RGBA #DARKBLUE \ Dark Blue
- 200 122 255 255 >RGBA #PURPLE \ Purple
- 135 60 190 255 >RGBA #VIOLET \ Violet
- 112 31 126 255 >RGBA #DARKPURPLE \ Dark Purple
- 211 176 131 255 >RGBA #BEIGE \ Beige
- 127 106 79 255 >RGBA #BROWN \ Brown
- 76 63 47 255 >RGBA #DARKBROWN \ Dark Brown
- 255 255 255 255 >RGBA #WHITE \ White
- 0 0 0 255 >RGBA #BLACK \ Black
- 0 0 0 0 >RGBA #BLANK \ Blank (Transparent)
- 255 0 255 255 >RGBA #MAGENTA \ Magenta
- 245 245 245 255 >RGBA #RAYWHITE
- : raylibBeginDrawing BeginDrawing DROP ;
- : raylibEndDrawing EndDrawing DROP ;
- : raylibClearBackground ClearBackground DROP ;
- : raylibDrawText DrawText DROP ;
- : raylibDrawRectangle DrawRectangle DROP ;
- : raylibDrawRectangleLines DrawRectangleLines DROP ;
- : raylibDrawRectangleGradientH DrawRectangleGradientH DROP ;
- ALIAS raylibBeginDrawing BeginDraw
- ALIAS raylibEndDrawing EndDraw
- ALIAS raylibClearBackground ClrBkg
- ALIAS raylibDrawText DrawText
- ALIAS raylibDrawRectangle DrawRect
- : init
- S" raylib example - basic window" DROP 480 640 InitWindow
- 60 SetTargetFPS
- DROP DROP
- ;
- : mainloop1
- BEGIN WindowShouldClose FALSE = WHILE
- raylibBeginDrawing
- #RAYWHITE raylibClearBackground
- #MAGENTA 20 200 190 S" Congrats! You created your first window!" DROP raylibDrawText
- raylibEndDrawing
- REPEAT ;
- 640 CONSTANT #WIDTH
- : mainloop2
- BEGIN WindowShouldClose FALSE = WHILE
- raylibBeginDrawing
- #RAYWHITE raylibClearBackground
- \ #DARKBLUE +35e0 120 160 #WIDTH 4 / DrawCircle DROP
- \ DrawCircle ( color fradius centery centerx )
- \ #DARKBLUE S" +35e0" >FLOAT 120 35 DrawCircle
- \ ****************************************
- #DARKBLUE 35 S>FL 120 35 DrawCircle \ &&& FUNCIONA !!
- \ **************______********************
- \ s>fl converte um Integer para Float
- \ #DARKBLUE 35.0e 120 35 DrawCircle
- #RED 60 120 100 #WIDTH 2 / 60 - raylibDrawRectangle
- #ORANGE 60 80 320 #WIDTH 2 / 40 - raylibDrawRectangleLines
- #GOLD #MAROON 130 180 170 #WIDTH 2 / 90 - raylibDrawRectangleGradientH
- \ #VIOLET DrawTriangle
- \ DrawTriangle((Vector2){screenWidth/4*3, 80},
- \ (Vector2){screenWidth/4*3 - 60, 150},
- \ (Vector2){screenWidth/4*3 + 60, 150}, VIOLET);
- \
- \ DrawPoly((Vector2){screenWidth/4*3, 320}, 6, 80, 0, BROWN);
- \ #BROWN 0 80 6 ??
- \ #SKYBLUE #GREEN 60 220 #WIDTH 4 / DrawCircleGradient
- \ NOTE: We draw all LINES based shapes together to optimize internal drawing,
- \ this way, all LINES are rendered in a single draw pass
- \ #BLACK 42 #WIDTH 18 - 42 18 DrawLine
- \ #DARKBLUE 80 340 #WIDTH 4 / DrawCircleLines
- \ DrawTriangleLines((Vector2){screenWidth/4*3, 160},
- \ (Vector2){screenWidth/4*3 - 20, 230},
- \ (Vector2){screenWidth/4*3 + 20, 230}, DARKBLUE);
- raylibEndDrawing
- REPEAT ;
- : finish
- CloseWindow DROP ;
- : main init mainloop2 finish ;
- 1 2 3 main . . .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement