diff --git a/public/usage-examples/windows/open_window-1-example-oop.cs b/public/usage-examples/windows/open_window-1-example-oop.cs new file mode 100644 index 000000000..e22c043ac --- /dev/null +++ b/public/usage-examples/windows/open_window-1-example-oop.cs @@ -0,0 +1,30 @@ +using SplashKitSDK; + +namespace OpenWindowExample +{ + public class Program + { + public static void Main() + { + // Open a new window + Window wind = SplashKit.OpenWindow("Simple Welcome Screen", 800, 600); + + // Keep the program running until the user closes the window + while (!SplashKit.QuitRequested()) + { + SplashKit.ProcessEvents(); + + // Draw content on the screen + wind.Clear(SplashKit.ColorSkyBlue()); + wind.FillRectangle(SplashKit.ColorWhite(), 220, 230, 360, 120); + wind.DrawText("Welcome to SplashKit!", SplashKit.ColorBlack(), 290, 270); + wind.DrawText("This window was opened using OpenWindow.", SplashKit.ColorBlack(), 245, 305); + + wind.Refresh(); + } + + // Close all open windows + SplashKit.CloseAllWindows(); + } + } +} diff --git a/public/usage-examples/windows/open_window-1-example-top-level.cs b/public/usage-examples/windows/open_window-1-example-top-level.cs new file mode 100644 index 000000000..62f43149c --- /dev/null +++ b/public/usage-examples/windows/open_window-1-example-top-level.cs @@ -0,0 +1,22 @@ +using static SplashKitSDK.SplashKit; +using SplashKitSDK; + +// Open a new window +Window wind = OpenWindow("Simple Welcome Screen", 800, 600); + +// Keep the program running until the user closes the window +while (!QuitRequested()) +{ + ProcessEvents(); + + // Draw content on the screen + ClearWindow(wind, ColorSkyBlue()); + FillRectangle(ColorWhite(), 220, 230, 360, 120); + DrawText("Welcome to SplashKit!", ColorBlack(), 290, 270); + DrawText("This window was opened using OpenWindow.", ColorBlack(), 245, 305); + + RefreshWindow(wind); +} + +// Close all open windows +CloseAllWindows(); diff --git a/public/usage-examples/windows/open_window-1-example.cpp b/public/usage-examples/windows/open_window-1-example.cpp new file mode 100644 index 000000000..3bcfaadc3 --- /dev/null +++ b/public/usage-examples/windows/open_window-1-example.cpp @@ -0,0 +1,26 @@ +#include "splashkit.h" + +int main() +{ + // Open a new window + open_window("Simple Welcome Screen", 800, 600); + + // Keep the program running until the user closes the window + while (!quit_requested()) + { + process_events(); + + // Draw content on the screen + clear_screen(color_sky_blue()); + fill_rectangle(color_white(), 220, 230, 360, 120); + draw_text("Welcome to SplashKit!", color_black(), 290, 270); + draw_text("This window was opened using open_window.", color_black(), 245, 305); + + refresh_screen(60); + } + + // Close all open windows + close_all_windows(); + + return 0; +} diff --git a/public/usage-examples/windows/open_window-1-example.png b/public/usage-examples/windows/open_window-1-example.png new file mode 100644 index 000000000..9991c12eb Binary files /dev/null and b/public/usage-examples/windows/open_window-1-example.png differ diff --git a/public/usage-examples/windows/open_window-1-example.py b/public/usage-examples/windows/open_window-1-example.py new file mode 100644 index 000000000..bf20667b1 --- /dev/null +++ b/public/usage-examples/windows/open_window-1-example.py @@ -0,0 +1,19 @@ +from splashkit import * + +# Open a new window +open_window("Simple Welcome Screen", 800, 600) + +# Keep the program running until the user closes the window +while not quit_requested(): + process_events() + + # Draw content on the screen + clear_screen(color_sky_blue()) + fill_rectangle(color_white(), 220, 230, 360, 120) + draw_text("Welcome to SplashKit!", color_black(), "Arial", 24, 290, 270) + draw_text("This window was opened using open_window.", color_black(), "Arial", 18, 245, 305) + + refresh_screen_with_target_fps(60) + +# Close all open windows +close_all_windows() diff --git a/public/usage-examples/windows/open_window-1-example.txt b/public/usage-examples/windows/open_window-1-example.txt new file mode 100644 index 000000000..defb2c683 --- /dev/null +++ b/public/usage-examples/windows/open_window-1-example.txt @@ -0,0 +1 @@ +Simple Welcome Screen