Below you will find pages that utilize the taxonomy term “Rust”
Rendering SVG in SDL2 using Rust
This posts explains how to display SVG picture using Rust sdl2 crate.
Disclaimer: while what is written does work, I am new to both Rust and SDL2, so the suggested approach might be not the best or even plain wrong. I am also developing on Windows (I do not have Linux, and I have failed to get sdl2 crate working on FreeBSD). I also did not try on Mac.
Pre-requisites
- You have to have a working Rust installation and cargo. If you do not have it, I suggest that you look here.
- Install
cargo-vcpkg
usingcargo install cargo-vcpkg
.
Basic Rust SDL2 project
There will be no SVG in this section. It just explains how to create a basic SDL2 project in Rust.
Mixed Python/Rust project with maturin
This post describes how to create Python project using Rust for time-critical parts. While the steps described below work for me, they are definitely not the only way to do things.
Disclaimer: the instructions are obsolete and probably will not work now.
Prerequisites and setup
Prerequisites
Python
Obviously, you will need Python. I am not going to
cover its installation here. The Python version I am going to use is 3.11.2
.
The command python -c "import sys; print(sys.version)"
will print the version
of the Python interpreter you have installed.