Tic-Tac-Toe on the GPU, as an example application for wgpu

Overview

Tic-Tac-GPU

A simple (cough cough) example on a tic-tac-toe game with wgpu.

Why?

Because I didn't find that many small applications which use wgpu as their rendering interface, which is understandable with wgpu being quite verbose. Nevertheless, I wanted to create one, also just to step into real water for the first time without a tutorial.

Installation

You can just use cargo install for that, assuming you installed Rust already (If you didn't, check out rustup):

cargo install --git https://github.com/MultisampledNight/tic-tac-gpu.git

This will by default install to $HOME/.cargo/bin, or whatever the equivalent on your OS is. Either put that path on $PATH, or just run the tic-tac-gpu binary directly.

Totally asked questions

Why are so many comments in src/render.rs, but almost none in src/main.rs?

These were more of a reminder to myself what components of wgpu actually do. I happen to learn things better if I try to formulate them out.

Why is the UI so ugly?

The final look didn't matter to me, more about the rendering itself. This is not a full-featured super accessible tic-tac-toe game with multiple AI modes and beautiful text rendering.

Gamepad support?

See https://github.com/rust-windowing/winit/issues/944. TLDR: No one seems to have time to implement it in winit, the windowing library I use, and I don't know anything about X11, evdev, Wayland and Quartz, so I can't implement it either.

Screenshots?

Screenshot showing a near-done game

Was it really worth it?

You might also like...
3d Cellular Automata using WGPU in Rust (for the web and using compute shaders)

3D-Cellular-Automata-WGPU 3d Cellular Automata using WGPU in Rust (for the web and using compute shaders) The branches are very messy... I recommend y

grr and rust-gpu pbr rendering
grr and rust-gpu pbr rendering

grr-gltf Barebone gltf viewer using grr and rust-gpu. Currently only supports a single gltf model! Assets These files need to be downloaded and placed

GFA visualizer, GPU-accelerated using Vulkan

gfaestus - Vulkan-accelerated GFA visualization Demo: https://youtu.be/TOJZeeCqatk gfaestus is a tool for visualizing and interacting with genome grap

Provides a mechanism to lay out data into GPU buffers according to WGSL's memory layout rules

Provides a mechanism to lay out data into GPU buffers ensuring WGSL's memory layout requirements are met. Features supports all WGSL host-shareable ty

Cross-platform GPU-accelerated viewer for the Mandelbrot set and similar (escape-time) fractals

fractal_viewer A cross-platform, GPU-accelerated viewer for the Mandelbrot Set and related fractals. Try it online! Usage Scroll wheel to zoom, click

A simple Rust and WebAssembly example implementing the Game of Life
A simple Rust and WebAssembly example implementing the Game of Life

rust-wasm-game-of-life rust-wasm-game-of-life is a simple Rust and WebAssembly example implementing the Game of Life based on Rust and WebAssembly boo

Rust-and-opengl-lessons - Collection of example code for learning OpenGL in Rust

rust-and-opengl-lessons Project requires Rust 1.31 Collection of example code for learning OpenGL in Rust 00 - Setup 01 - Window 02 - OpenGL Context 0

Quick example of displaying a BMP file with uefi-rs

uefi-bmp Quick example of drawing a bitmap using uefi-rs and tinybmp. Not necessarily the most efficient :) Build and run (may need some modification

🎮 A Realtime Multiplayer Server/Client Game example built entirely with Rust 🦀

Example of a 🎮 Realtime Multiplayer Web Game Server/Client built entirely using Rust 🦀

Owner
multisn8
space.
multisn8
A barebones example of how to integrate OpenXR with wgpu (Vulkan-only)

wgpu-openxr-example a barebones example of how to integrate OpenXR with wgpu (Vulkan-only) It has four modes: cargo run --no-default-features: desktop

Philpax 21 Dec 15, 2022
A modern 3D/2D game engine that uses wgpu.

Harmony A modern 3D/2D game engine that uses wgpu and is designed to work out of the box with minimal effort. It uses legion for handling game/renderi

John 152 Dec 24, 2022
A curated list of wgpu code and resources.

Awesome wgpu A curated list of wgpu code and resources. PRs welcome. About wgpu https://github.com/gfx-rs/wgpu-rs matrix chat https://matrix.to/#/#wgp

Roman Frołow 283 Jan 3, 2023
Simple profiler scopes for wgpu using timer queries

wgpu-profiler Simple profiler scopes for wgpu using timer queries Features Easy to use profiler scopes Allows nesting! Can be disabled by runtime flag

null 41 Dec 5, 2022
Scion is a tiny 2D game library built on top of wgpu, winit and legion.

Scion is a 2D game library made in rust. Please note that this project is in its first milestones and is subject to change according to convience need

Jérémy Thulliez 143 Dec 25, 2022
Rustcraft is a simple Minecraft engine written in rust using wgpu.

Rustcraft is a simple Minecraft engine written in rust using wgpu.

Raphael Van Hoffelen 110 Dec 22, 2022
Self Study on developing a game engine using wgpu as the rendering API. Learning as I go.

Fabled Engine Any issues, enhancement, features, or bugs report are always welcome in Issues. The obj branch is where frequent development and up to d

Khalid 20 Jan 5, 2023
Guide for using gfx-rs's wgpu library.

Introduction What is wgpu? Wgpu is a Rust implementation of the WebGPU API spec. WebGPU is a specification published by the GPU for the Web Community

sotrh 1k Dec 29, 2022
game engine built in rust, using wgpu and probably other stuff too

horizon game engine engine for devpty games, made in 99.9% rust and 0.1% shell. this is our main project currently. the engine will be used for most i

DEVPTY 2 Apr 12, 2022
🦅🦁 Fast, simple 2D text renderer for wgpu

?? glyphon ?? Fast, simple 2D text rendering for wgpu What is this? This crate provides a simple way to render 2D text with wgpu by: rasterizing glyph

Josh Groves 60 Nov 5, 2022