-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from thoth-tech/main
Add Fill Triangle Usage Example
- Loading branch information
Showing
4 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+11.9 KB
public/usage-examples-images-gifs/graphics/fill_triangle-1-basic-red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions
15
src/assets/usage-examples-code/graphics/fill_triangle/fill_triangle-1-basic-red.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "splashkit.h" | ||
|
||
int main() | ||
{ | ||
open_window("Fill triangle Example", 800, 600); | ||
clear_screen(); | ||
|
||
fill_triangle(COLOR_RED, 100, 100, 200, 200, 300, 100); | ||
refresh_screen(); | ||
|
||
delay(5000); | ||
close_all_windows(); | ||
|
||
return 0; | ||
} |
11 changes: 11 additions & 0 deletions
11
src/assets/usage-examples-code/graphics/fill_triangle/fill_triangle-1-basic-red.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using SplashKitSDK; | ||
using static SplashKitSDK.SplashKit; | ||
|
||
OpenWindow("Fill Triangle Example", 800, 600); | ||
ClearScreen(); | ||
|
||
FillTriangle(ColorRed(), 100, 100, 200, 200, 300, 100); | ||
RefreshScreen(); | ||
|
||
Delay(5000); | ||
CloseAllWindows(); |
3 changes: 3 additions & 0 deletions
3
src/assets/usage-examples-code/graphics/fill_triangle/fill_triangle-1-basic-red.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
### Simple Red Triangle | ||
|
||
The following code demonstrates how to use the [Fill Triangle](/api/graphics#fill-triangle-3) function to draw a simple red-colored filled triangle. It creates a triangle with specified coordinates and fills it with red color. |