Just a simple object renderer, written in under 500 lines using Rust.

Overview

All cargoes that the project runs are:

  • bitflags: a crate for defining bitflag types
  • cfg-if: a small macro crate for defining cfg-based - conditional compilation
  • lazy_static: a crate for defining lazy-initialized static variables
  • libc: a crate for defining the C library interface in Rust
  • sdl2: a Rust wrapper around the SDL2 library for graphics and input handling
  • sdl2-sys: a low-level Rust binding to the SDL2 library
  • software-renderer: a package that depends on sdl2 and implements a software renderer
  • version-compare: a crate for comparing version strings

Screenshots

Cube

Cube with a frame

Run Locally

Clone the project

  git clone https://github.com/Valery-a/Rust-renderer.git

Go to the project directory

  cd Rust-renderer

Build the project

  cargo build

Start the app

  cargo run --release

Error handling

If you are experiencing any errors such has this one:

  • error: linking with link.exe failed: exit code: 1181

Follow these steps to resolve it:

Download MSVC development libraries from http://www.libsdl.org/ (SDL2-devel-2.0.x-VC.zip).

Unpack SDL2-devel-2.0.x-VC.zip to a folder of your choosing (You can delete it afterwards).

Copy all lib files from

SDL2-devel-2.0.x-VC\SDL2-2.0.x\lib\x64\

to (for Rust 1.6 and above)

C:\Program Files\Rust\lib\rustlib\x86_64-pc-windows-msvc\lib

or to (for Rust versions 1.5 and below)

C:\Program Files\Rust\bin\rustlib\x86_64-pc-windows-msvc\lib

or to your library folder of choice, and ensure you have a system environment variable of

LIB = C:\your\rust\library\folder

For Rustup users, this folder will be in

C:\Users\{Your Username}\.rustup\toolchains\{current toolchain}\lib\rustlib\{current toolchain}\lib

Where current toolchain is likely stable-x86_64-pc-windows-msvc.

Copy SDL2.dll from

SDL2-devel-2.0.x-VC\SDL2-2.0.x\lib\x64\

into your cargo project, right next to your Cargo.toml.

When you're shipping your game make sure to copy SDL2.dll to the same directory that your compiled exe is in, otherwise the game won't launch.
You might also like...
Cross-platform CLI Rimworld Mod manager. Still under development

rwm Inspired by Spoons rmm. This is a cross-platform Mod Manager for RimWorld intended to work with macOS, linux and Windows Up to now, you must have

Coffee is a loader for ELF (Executable and Linkable Format) object files written in Rust
Coffee is a loader for ELF (Executable and Linkable Format) object files written in Rust

Coffee is a loader for ELF (Executable and Linkable Format) object files written in Rust. It provides a mechanism to load and parse ELF files similar to COFFLoader, but specifically designed for ELF files used in Unix-like systems.

A fast, resilient, isomorphic hacker news clone in ~1k lines of rust.
A fast, resilient, isomorphic hacker news clone in ~1k lines of rust.

Hackernews sauron A hacker news clone in ~1k lines of rust. This is using sauron web-framework. Feature Isomorphic Completely identical server-side re

a cargo subcommand for counting lines of code in Rust projects
a cargo subcommand for counting lines of code in Rust projects

cargo-count Linux: A cargo subcommand for displaying line counts of source code in projects, including a niave unsafe counter for Rust source files. T

A tool for adding new lines to files, skipping duplicates and write in Rust!

anew A tool for adding new lines to files written in Rust. The tool aids in appending lines from stdin to a file, but only if they don't already appea

Turns lines of text into SVG files.

Sentences 2 svg Does what it says on the tin. This takes in a file with some sentences and outputs numbered svgs. There are 3 arguments to keep in min

Command-line tool that provides a workflow for extending, editing, diffing, and writing to vim-style grep lines.

Grug Grug is a command-line tool that provides a workflow for expanding, editing, diffing, and writing edits to files using vim-styled grep lines (suc

A text renderer for Rust's embedded-graphics crate, based on U8g2
A text renderer for Rust's embedded-graphics crate, based on U8g2

u8g2-fonts This crate is a pure Rust reimplementation of the font subsystem of U8g2. It is intended for the embedded-graphics ecosystem. Licensing Whi

A Rust-based renderer for Remotion videos.

Rustymotion A Rust-based renderer for Remotion projects. 🚧 WARNING: This is exploratory work only, use at your own risk. Design Remotion allows you t

Owner
null
Game of life rendered in your terminal with over 500+ unique patterns to choose from.

Controls a: play animation n: next generation s: stop j or down arrow: go down next pattern (note: you have to stop the animation to browse the patter

Omar Magdy 20 Dec 22, 2022
My solutions for the 2021 edition of the Advent of Code, using Rust and SOM (Simple Object Machine)

Advent of Code 2021 These are my solutions for the 2021 edition of the Advent of Code. The solutions are all implemented using both Rust and SOM (Simp

Nicolas Polomack 1 Dec 23, 2021
A simple program that provides DBus interface to control display temperature and brightness under wayland without flickering

wl-gammarelay-rs Like wl-gammarelay, but written in rust, runs on a single thread, has three times less SLOC and uses DBus (for simplicity). Dbus inte

Max Verevkin 33 Nov 23, 2022
A lightweight and super fast cli todo program written in rust under 200 sloc

todo A lightweight and super fast cli todo program written in rust under 200 sloc installation AUR package: todo-bin use cargo build --release to comp

sioodmy 243 Dec 24, 2022
Open source email client written in Rust and Dioxus. Under 🏗️

Blazemail A full-featued, beautiful, mail client that doesn't suck. Works on mac, windows, linux, mobile, web, etc. Features, status Blazemail is curr

Jon Kelley 13 Dec 19, 2022
🦀 Stupid simple presentation of the number of words, characters and lines on your clipboard.

clipcount: Counting words from the clipboard content Why does this exist? Do you find yourself often needing to count the number of words in a piece o

Magnus Rødseth 3 Feb 23, 2024
Neovim plugin for moving lines up and down, written in Rust

Moveline.nvim Moveline is a simple plugin for moving lines up and down. It's written in Rust using my library nvim-utils. Installation Moveline can be

Will Hopkins 34 Mar 18, 2023
A tiny software renderer written in Rust.

tiny-renderer 简单的软光栅化渲染器 基础数学库 Bresenham画线算法 Cohen-Sutherland线段裁剪算法 glTF模型加载 模型/视图/投影变换 背面剔除 视椎剔除 齐次空间裁剪 深度测试 Blinn–Phong着色模型 重心坐标插值 运行 bresenham画线算法

Night's Watch Games 9 May 29, 2023
Gauzilla: a 3D Gaussian Splatting renderer written in Rust for WebAssembly with lock-free multithreading

Gauzilla A 3D Gaussian Splatting (3DGS) renderer written in Rust for platform-agnostic WebAssembly (WASM) with lock-free multithreading. Uses WebGL an

Yoshi Sato 90 Jan 2, 2024
global state management for dioxus built on the concept of atoms. currently under 🏗

Fermi: A global state management solution for Dioxus, inspired by Recoil.Js Fermi provides primitives for managing global state in Dioxus applications

Dioxus 15 Feb 12, 2022