Skip to content

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

License

Notifications You must be signed in to change notification settings

MultisampledNight/tic-tac-gpu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 rust-windowing/winit#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?

About

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

Topics

Resources

License

Stars

Watchers

Forks