initial commit

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2023-01-21 08:33:19 +05:30
commit a307dc6c78
10 changed files with 2259 additions and 0 deletions

2
.cargo/config.toml Normal file
View File

@@ -0,0 +1,2 @@
[build]
rustflags = ["-C", "link-arg=-fuse-ld=lld"]

2
.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
Cargo.lock linguist-generated
flake.lock linguist-generated

4
.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
\#*\#
*~
result
target

2074
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

15
Cargo.toml Normal file
View File

@@ -0,0 +1,15 @@
[package]
name = "torana"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bytemuck = { version = "1.12", features = [ "derive" ] }
cfg-if = "1"
env_logger = "0.9"
image = "0.24"
log = "0.4"
wgpu = "0.14"
winit = "0.27"

19
README.org Normal file
View File

@@ -0,0 +1,19 @@
#+OPTIONS: toc:nil
NOTE: This does not at all work yet, and is not even actively WIP. This is just my attempt at learning wgpu and get some experience in Rust and programming graphics in general. Additionally, this is obviously inspired by 東方Project.
-----
This will start as a standalone game with it's own library written using wgpu.
This is supposed to be split into a standalone danmaku engine library at some point.
* Current Objectives
- Render "something"
- Move "it"
- Add multiple "entities"
- Sprite rendering
- Implement hitboxes
* Later Objectives
- Add own artwork
- Add own music
- Clean up everything

94
flake.lock generated Normal file
View File

@@ -0,0 +1,94 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1674266771,
"narHash": "sha256-Rttg4VUJpCtg5Qxdp+/xncxuEFQjMlKbvEFi5my0oNU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "7c3fc1838288763664291ef847816ddd03fde26b",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "release-22.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1665296151,
"narHash": "sha256-uOB0oxqxN9K7XGF1hcnY+PQnlQJ+3bP2vCn/+Ru/bbc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "14ccaaedd95a488dd7ae142757884d8e125b3363",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay",
"utils": "utils"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1674267882,
"narHash": "sha256-53sIczqxA5BbrhgO6l54DSisDqHvQ3UUwbSqBryA/k0=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "1fd6d280c132f4facad8cd023543fb10121e6487",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

43
flake.nix Normal file
View File

@@ -0,0 +1,43 @@
{
description = "Torana danmaku engine";
inputs = {
nixpkgs.url = github:nixos/nixpkgs/release-22.11;
rust-overlay.url = github:oxalica/rust-overlay;
utils.url = github:numtide/flake-utils;
};
outputs = {
self,
nixpkgs,
utils,
rust-overlay,
}:
utils.lib.eachDefaultSystem
(
system: let
overlays = [rust-overlay.overlays.default];
pkgs = import nixpkgs {
inherit system overlays;
};
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain;
in rec {
devShell = with pkgs;
mkShell {
nativeBuildInputs = [
cmake
openssl
fontconfig
pkg-config
llvmPackages.lld
rust-analyzer
toolchain
];
};
formatter = pkgs.alejandra;
}
);
}

3
rust-toolchain Normal file
View File

@@ -0,0 +1,3 @@
[toolchain]
channel = "nightly-2023-01-21"
components = [ "rustfmt", "clippy" ]

3
src/lib.rs Normal file
View File

@@ -0,0 +1,3 @@
pub fn run() {
println!("alo")
}