Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions public/usage-examples/windows/open_window-1-example-oop.cs
Original file line number Diff line number Diff line change
@@ -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();
}
}
}
22 changes: 22 additions & 0 deletions public/usage-examples/windows/open_window-1-example-top-level.cs
Original file line number Diff line number Diff line change
@@ -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();
26 changes: 26 additions & 0 deletions public/usage-examples/windows/open_window-1-example.cpp
Original file line number Diff line number Diff line change
@@ -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;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions public/usage-examples/windows/open_window-1-example.py
Original file line number Diff line number Diff line change
@@ -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()
1 change: 1 addition & 0 deletions public/usage-examples/windows/open_window-1-example.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Simple Welcome Screen