OpenSiv3D
C++20 framework for creative coding ๐ฎ๐จ๐น / Cross-platform support (Windows, macOS, Linux, and the Web)
Install / Use
/learn @Siv3D/OpenSiv3DREADME
Siv3D (formerly known as OpenSiv3D) is a C++20 framework for creative coding (2D/3D games, media art, visualizers, and simulators). Siv3D applications run on Windows, macOS, Linux, and the Web.
Features
- Graphics
- Advanced 2D graphics
- Basic 3D graphics (Wavefront OBJ, primitive shapes)
- Custom vertex / pixel shaders (HLSL, GLSL)
- Text rendering (Bitmap, SDF, MSDF)
- PNG, JPEG, BMP, SVG, GIF, Animated GIF, TGA, PPM, WebP, TIFF
- Unicode 15.1 emojis and 7,000+ icons
- Image processing
- Video rendering
- Audio
- WAVE, MP3, AAC, OggVorbis, Opus, MIDI, WMA*, FLAC*, AIFF*
- Adjustable volume, pan, play speed and pitch
- File streaming (WAVE, MP3, OggVorbis)
- Fade in and fade out
- Looping
- Mixing busses
- Filters (LPF, HPF, echo, reverb)
- FFT
- SoundFont rendering
- Text to speech*
- Input
- Mouse
- Keyboard
- Gamepad
- Webcam
- Microphone
- Joy-Con / Pro Controller
- XInput*
- Digital drawing tablet*
- Leap Motion*
- Window
- Fullscreen mode
- High DPI support
- Window styles (sizable, borderless)
- File dialog
- Drag & drop
- Message box
- Toast notification*
- Network and communication
- HTTP client
- Multiplayer (with Photon SDK)
- TCP communication
- Serial communication
- Interprocess communication (pipe)
- OSC (Open Sound Control)
- Math
- Vector and matrix classes (
Point,Float2,Vec2,Float3,Vec3,Float4,Vec4,Mat3x2,Mat3x3,Mat4x4,SIMD_Float4,Quaternion) - 2D shape classes (
Line,Circle,Ellipse,Rect,RectF,Triangle,Quad,RoundRect,Polygon,MultiPolygon,LineString,Spline2D,Bezier2,Bezier3) - 3D shape classes (
Plane,InfinitePlane,Sphere,Box,OrientedBox,Ray,Line3D,Triangle3D,ViewFrustum,Disc,Cylinder,Cone) - Color classes (
Color,ColorF,HSV) - Polar / cylindrical / spherical coordinates system
- 2D / 3D shape intersection
- 2D / 3D geometry processing
- Rectangle packing
- Planar subdivisions
- Linear and gamma color space
- Pseudo random number generators
- Interpolation, easing, and smoothing
- Perlin noise
- Math parser
- Navigation mesh
- Extended arithmetic types (
HalfFloat,int128,uint128,BigInt,BigFloat)
- Vector and matrix classes (
- String and Text Processing
- Advanced String class (
String,StringView) - Unicode conversion
- Regular expression
{fmt}style text formatting- Text reader / writer classes
- CSV / INI / JSON / XML / TOML reader classes
- CSV / INI / JSON writer classes
- JSON Validation
- Advanced String class (
- Misc
- Basic GUI (button, slider, radio buttons, checkbox, text box, color picker, list box, menu bar, table)
- Integrated 2D physics engine (Box2D)
- Advanced array / 2D array classes (
Array,Grid) - Kd-tree
- Disjoint set
- Asynchronous asset file streaming
- Data compression (zlib, Zstandard)
- Transitions between scenes
- File system
- Directory watcher
- QR code reader / writer
- GeoJSON
- Date and time
- Stopwatch and timer
- Logging
- Serialization
- UUID
- Child process
- Clipboard
- Power status
- Scripting (AngelScript)
- OpenAI API (Chat, Vision, Image, Speech, Embedding)
<small>* Some features are limited to specific platforms</small>
How to Install Siv3D + Tutorial
- (English) Getting Started with Siv3D: https://siv3d.github.io/en-us/
- (ๆฅๆฌ่ช) Siv3D ใใฏใใใใ: https://siv3d.github.io/ja-jp/
v0.6.16 | released 7 April 2025 | Release Notes
| Platform | SDK | Requirements | |:------------------:|:----------:|:------------------------------| | Windows | Download SDK /<br>SDK ใใใฆใณใญใผใ | - Windows 10 / 11 (64-bit)<br>- Microsoft Visual C++ 2022 17.10<br>- Windows 10 SDK<br>- Intel / AMD CPU | | macOS | Download SDK /<br>SDK ใใใฆใณใญใผใ | - macOS Ventura / Sonoma / Sequoia<br>- Xcode 14.3 or newer<br>- Intel CPU / Apple Silicon (Rosetta mode)*<br>- OpenGL 4.1 compatible hardware | | Linux | Compiling for Linux /<br>Linux ็ใฎใใซใ | - Ubuntu 20.04 LTS / 22.04 LTS<br>- GCC 9.3.0 (with Boost 1.71.0) / GCC 11.2 (with Boost 1.74.0)<br>- Intel / AMD CPU<br>- OpenGL 4.1 compatible hardware |
<small>* Native support for Apple Silicon is planned for Siv3D v0.8. Currently, Siv3D can be built and run using Rosetta emulation.</small>
Next Major Update
The next major update, Siv3D v0.8, is under development in the following repository.
- https://github.com/Siv3D/siv8
Community
Miscellaneous
Supporting the Project
If you would like to support the project financially, visit my GitHub Sponsors page. Your support will accelerate the development of this exciting framework.
๐ https://github.com/sponsors/Reputeless
Examples
1. Hello, Siv3D!

# include <Siv3D.hpp>
void Main()
{
// ่ๆฏใฎ่ฒใ่จญๅฎใใ | Set the background color
Scene::SetBackground(ColorF{ 0.6, 0.8, 0.7 });
// ็ปๅใใกใคใซใใใใฏในใใฃใไฝๆใใ | Create a texture from an image file
const Texture texture{ U"example/windmill.png" };
// ็ตตๆๅญใใใใฏในใใฃใไฝๆใใ | Create a texture from an emoji
const Texture emoji{ U"๐ฆ"_emoji };
// ๅคชๆๅญใฎใใฉใณใใไฝๆใใ | Create a bold font with MSDF method
const Font font{ FontMethod::MSDF, 48, Typeface::Bold };
// ใใญในใใซๅซใพใใ็ตตๆๅญใฎใใใฎใใฉใณใใไฝๆใใfont ใซ่ฟฝๅ ใใ | Create a font for emojis in text and add it to font as a fallback
const Font emojiFont{ 48, Typeface::ColorEmoji };
font.addFallback(emojiFont);
// ใใฟใณใๆผใใๅๆฐ | Number of button presses
int32 count = 0;
// ใใงใใฏใใใฏในใฎ็ถๆ
| Checkbox state
bool checked = false;
// ใใฌใคใคใผใฎ็งปๅในใใผใ | Player's movement speed
double speed = 200.0;
// ใใฌใคใคใผใฎ X ๅบงๆจ | Player's X position
double playerPosX = 400;
// ใใฌใคใคใผใๅณใๅใใฆใใใ | Whether player is facing right
bool isPlayerFacingRight = true;
while (System::Update())
{
// ใใฏในใใฃใๆใ | Draw the texture
texture.draw(20, 20);
// ใใญในใใๆใ | Draw text
font(U"Hello, Siv3D!๐ฎ").draw(64, Vec2{ 20, 340 }, ColorF{ 0.2, 0.4, 0.8 });
// ๆๅฎใใ็ฏๅฒๅ
ใซใใญในใใๆใ | Draw text within a specified area
font(U"Siv3D (ใทใในใชใผใใฃใผ) ใฏใใฒใผใ ใใขใใชใๆฅฝใใ็ฐกๅใช C++ ใณใผใใง้็บใงใใใใฌใผใ ใฏใผใฏใงใใ")
.draw(18, Rect{ 20, 430, 480, 200 }, Palette::Black);
// ้ทๆนๅฝขใๆใ | Draw a rectangle
Rect{ 540, 20, 80, 80 }.draw();
// ่งไธธ้ทๆนๅฝขใๆใ | Draw a rounded rectangle
RoundRect{ 680, 20, 80, 200, 20 }.draw(ColorF{ 0.0, 0.4, 0.6 });
// ๅใๆใ | Draw a circle
Circle{ 580, 180, 40 }.draw(Palette::Seagreen);
// ็ขๅฐใๆใ | Draw an arrow
Line{ 540, 330, 760, 260 }.drawArrow(8, SizeF{ 20, 20 }, ColorF{ 0.4 });
// ๅ้ๆใฎๅใๆใ | Draw a semi-transparent circle
Circle{ Cursor::Pos(), 40 }.draw(ColorF{ 1.0, 0.0, 0.0, 0.5 });
// ใใฟใณ | Button
if (SimpleGUI::Button(U"count: {}"_fmt(count), Vec2{ 520, 370 }, 120, (checked == false)))
{
// ใซใฆใณใใๅขใใ | Increase the count
++count;
}
// ใใงใใฏใใใฏใน | Checkbox
SimpleGUI::CheckBox(checked, U"Lock \U000F033E", Vec2{ 660, 370 }, 120);
// ในใฉใคใใผ | Slider
SimpleGUI::Slider(U"speed: {:.1f}"_fmt(speed), speed, 100, 400, Vec2{ 520, 420 }, 140, 120);
// ๅทฆใญใผใๆผใใใฆใใใ | If left key is pressed
if (KeyLeft.pressed())
{
// ใใฌใคใคใผใๅทฆใซ็งปๅใใ | Player moves left
playerPosX = Max((playerPosX - speed * Scene::DeltaTime()), 60.0);
isPlayerFacingRight = false;
}
// ๅณใญใผใๆผใใใฆใใใ | If right key is pressed
if (KeyRight.pressed())
{
// ใใฌใคใคใผใๅณใซ็งปๅใใ | Player moves right
playerPosX = Min((playerPosX + speed * Scene::DeltaTime()), 740.0);
isPlayerFacingRight = true;
}
// ใใฌใคใคใผใๆใ | Draw the player
emoji.scaled(0.75).mirrored(isPlayerFacingRight).drawAt(playerPosX, 540);
}
}
2. Breakout

# include <Siv3D.hpp>
void Main()
{
// 1 ใคใฎใใญใใฏใฎใตใคใบ | Size of a single block
constexpr Size BrickSize{ 40, 20 };
// ใใผใซใฎ้ใ๏ผใใฏใปใซ / ็ง๏ผ | Ball speed (pixels / second)
constexpr double BallSpeedPerSec = 480.0;
// ใใผใซใฎ้ๅบฆ | Ball velocity
Vec2 ballVelocity{ 0, -BallSpeedPerSec };
// ใใผใซ | Ball
Circle ball{ 400, 400, 8 };
// ใใญใใฏใฎ้
ๅ | Array of bricks
Array<Rect> bricks;
for (int32 y = 0; y < 5; ++y)
{
for (int32 x = 0; x < (Scene::Width() / BrickSize.x); ++x)
{
bricks << Rect{ (x * BrickSize.x), (60 + y * BrickSize.y), BrickSize };
}
}
while (System::Update())
{
// ใใใซ | Paddle
const Rect paddle{ Arg::center(Cursor::Pos().x, 500), 60, 10 };
// ใใผใซใ็งปๅใใใ | Move the ball
ball.moveBy(ballVelocity * Scene::DeltaTime());
// ใใญใใฏใ้ ใซใใงใใฏใใ | Check bricks in sequence
for (auto it = bricks.begin(); it != bricks.end(); ++it)
{
// ใใญใใฏใจใใผใซใไบคๅทฎใใฆใใใ | If block and ball intersect
if (it->intersects(ball))
{
