Coder Social home page Coder Social logo

caper's Introduction

shockham

The personal site of shockham

Build Setup

# install dependencies
$ yarn install

# serve with hot reload at localhost:3000
$ yarn run dev

# build for production and launch server
$ yarn run build
$ yarn start

# generate static project
$ yarn run generate

For detailed explanation on how things work, checkout Nuxt.js docs.

caper's People

Contributors

bddap avatar eibx avatar mrmonotone avatar shockham avatar teddriggs avatar woelper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

caper's Issues

Add alsa dependency on the docs

I tried to run an example and the alsa library was missing on my dependencies. I google for it and i found that thread ggez/ggez#100. Would be nice to add it on the docs as a dependency to install. Thanks

Compile Problems

Hello I am trying to compile the transforms example with the latest code. When I run the example, it exits with this error:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` v
alue: NoVersion', src/libcore/result.rs:837

I am a feeling it has something to do with shaders and opengl. I have successfully run the samples for imgui and glium though so, I am at a loss.
I am new to rust so if you could point me in the right direction to solve my problem I would be really appreciative.
MM
Here is the backtrace:

1.14.0/src/libcore/result.rs:737
  11:     0x56267194d830 - caper::shader::Shaders::new::h3e9b58a1d
66d849a
                        at /home/nicholas/Documents/Code/rust_proj
ects/caper/src/shader/mod.rs:22
  12:     0x56267194a629 - caper::renderer::Renderer::new::h716119
fc4271156e
                        at /home/nicholas/Documents/Code/rust_proj
ects/caper/src/renderer.rs:73
  13:     0x5626718c8310 - transforms::main::h3fda41e71022afff
                        at /home/nicholas/Documents/Code/rust_proj
ects/caper/examples/transforms.rs:117
  14:     0x562671c2ea3a - __rust_maybe_catch_panic
                        at /home/build/YPKG/root/rust/build/rustc-
1.14.0/src/libpanic_unwind/lib.rs:97
  15:     0x562671c264b5 - std::rt::lang_start::hd661476ce2fc2931
                        at /home/build/YPKG/root/rust/build/rustc-
1.14.0/src/libstd/panicking.rs:332
                        at /home/build/YPKG/root/rust/build/rustc-
1.14.0/src/libstd/panic.rs:351
                        at /home/build/YPKG/root/rust/build/rustc-
1.14.0/src/libstd/rt.rs:57
  16:     0x5626718d65e2 - main
  17:     0x7f815742a480 - __libc_start_main
  18:     0x56267177e3d9 - _start
                        at ../sysdeps/x86_64/start.S:120
  19:                0x0 - <unknown>
error: Process didn't exit successfully: `target/debug/examples/tr
ansforms` (exit code: 101)

impl Default for types rather than using builder's field-level defaults

With derive_builder supporting serde-style usage of struct level defaults, Transform et al. could be more idiomatically written as:

/// struct for handling transform data
#[derive(Builder, Copy, Clone, Serialize, Deserialize, PartialEq)]
#[builder(default)]
pub struct Transform {
    /// The position of the transform
    pub pos: Vector3,
    /// The rotation of the transform
    pub rot: Quaternion,
    /// The scale of the transform
    pub scale: Vector3,
    /// Whether the transform is currently active/should be rendered
    pub active: bool,
    /// Whether the transform is frustum culled
    pub cull: bool,
}

impl Default for Transform {
    fn default() -> Self {
        Transform {
            pos: (0f32, 0f32, 0f32),
            rot: (0f32, 0f32, 0f32, 0f32),
            scale: (1f32, 1f32, 1f32),
            active: true,
            cull: true,
         }
    }
}

This change would also enable using these types in more contexts.

Screen flashing/objects move very fast.

In the examples that use the handle_fp_inputs function the objects on the screen appear the flash or are moving very fast around me. FYI this only happens on one of my computers. It is running Manjaro Linux

Idea: Use lightweight types for scale and position vectors, colors, and quaternions

Full disclosure: I've never tried to develop a game, and probably never will get the chance. This idea is based purely on my reading of the examples and my experience writing Rust APIs.

Right now, the crate is using type aliases over tuples to represent vectors. This works, but it precludes creating Default impls for these types (or other trait impls), and it means there's no type safety preventing me from accidentally using a Quaternion as a Color.

This change would mean more code in types.rs, but I think the combination of setter(into) for builder methods and From<(f32...)> should avoid much verbosity in the consuming code. This would also allow the creation of new inherent methods, such as Scale::uniform(val: f32) -> Scale.

Textures appear black

Occasionally on textured RenderItems they appear black rather than the texture applied.
This could be for a few reasons:

  • Texture doesn't load properly.
  • Problem when loading and packing the texture into the bin.
  • Handling of the texture within shader itself.
  • Possibly during uniform creation.

Add 3D audio capabilities

The Audi system is really minimalist and simple to understand, but 3D audio could be pretty useful. I have used a library called ambisonic, based on rodio which implements 3D audio really well, but I don't think fits the minimalist approach. Maybe the audio system could be extended to incorporate it, or just base a 3D audio system on it

OSX: Mouse input

It compiles and runs!

But at the slightest finger of mouse input ...
caper-mouse-60fps

Could not compile `caper` because some trait bounds are not satisfied

OS: Windows 10
Version: rust 1.21.0, cargo 0.22.0

In my Cargo.toml:

[dependencies]
caper = "0.10.0"

On first build, I get a compile error:

[Running: cargo run --message-format=json]
Updating registry https://github.com/rust-lang/crates.io-index
Downloading impose v0.1.0
Downloading lazy_static v1.0.1
...
Downloading shell32-sys v0.1.2
Downloading gdi32-sys v0.1.2
Compiling lzw v0.10.0
Compiling lazy_static v0.1.16
...
Compiling imgui v0.0.18
Compiling imgui-glium-renderer v0.0.18
Compiling caper v0.10.0
error: C:\Users\hsandt.cargo\registry\src\github.com-1ecc6299db9ec823\caper-0.10.0\src\renderer.rs:95: the trait bound glium::Display: glium::backend::Facade is not satisfied
error: C:\Users\hsandt.cargo\registry\src\github.com-1ecc6299db9ec823\caper-0.10.0\src\renderer.rs:95: the trait glium::backend::Facade is not implemented for glium::Display
note: C:\Users\hsandt.cargo\registry\src\github.com-1ecc6299db9ec823\caper-0.10.0\src\renderer.rs:95: required by glium_text::TextSystem::new
error: C:\Users\hsandt.cargo\registry\src\github.com-1ecc6299db9ec823\caper-0.10.0\src\renderer.rs:96: the trait bound glium::Display: glium::backend::Facade is not satisfied
error: C:\Users\hsandt.cargo\registry\src\github.com-1ecc6299db9ec823\caper-0.10.0\src\renderer.rs:96: the trait glium::backend::Facade is not implemented for glium::Display
note: C:\Users\hsandt.cargo\registry\src\github.com-1ecc6299db9ec823\caper-0.10.0\src\renderer.rs:96: required by glium_text::FontTexture::new
error: C:\Users\hsandt.cargo\registry\src\github.com-1ecc6299db9ec823\caper-0.10.0\src\renderer.rs:540: the trait bound glium::Frame: glium::Surface is not satisfied
error: C:\Users\hsandt.cargo\registry\src\github.com-1ecc6299db9ec823\caper-0.10.0\src\renderer.rs:540: the trait glium::Surface is not implemented for glium::Frame
note: C:\Users\hsandt.cargo\registry\src\github.com-1ecc6299db9ec823\caper-0.10.0\src\renderer.rs:540: required by glium_text::draw
error: Could not compile caper.

Add Physics and sound as features

Adding those as features could lead to those being disabled if not needed, so that the library being compiled is so much smaller. The would obviously be on by default, but I think that would add value to the crate.
Maybe those systems are too integrated into the rest of the library that this isn't possible, but it would be nice.

The engine is amazing btw, it has a really understandable structure, it feels a lot more welcoming than other engines.

Cocoa compile error Mac

Hey,

first of all, I really like what you are building up here, all alone. You have my full respect and I hope, you can stay as motivated as you are right now for this project.

Unfortunately I can't use your crate because Cocoa is not compiling. Do you know an answer?

Compiling cocoa v0.3.3
error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/appkit.rs:251:45
|
251 | unsafe fn sharedApplication(_: Self) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/appkit.rs:326:46
|
326 | unsafe fn currentApplication(_: Self) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/appkit.rs:339:31
|
339 | unsafe fn new(_: Self) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/appkit.rs:364:33
|
364 | unsafe fn alloc(_: Self) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/appkit.rs:368:31
|
368 | unsafe fn new(_: Self) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/appkit.rs:372:41
|
372 | unsafe fn separatorItem(_: Self) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/appkit.rs:422:33
|
422 | unsafe fn alloc(_: Self) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/appkit.rs:1269:33
|
1269 | unsafe fn alloc(_: Self) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/appkit.rs:1364:33
|
1364 | unsafe fn alloc(_: Self) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/appkit.rs:1393:33
|
1393 | unsafe fn alloc(_: Self) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/appkit.rs:1427:33
|
1427 | unsafe fn alloc(_: Self) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/appkit.rs:2410:33
|
2410 | unsafe fn alloc(_: Self) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/appkit.rs:2482:43
|
2482 | unsafe fn systemStatusBar(_: Self) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/foundation.rs:133:31
|
133 | unsafe fn new(_: Self) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/foundation.rs:152:39
|
152 | unsafe fn processInfo(_: Self) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/foundation.rs:168:58
|
168 | unsafe fn valueWithPoint(_: Self, point: NSPoint) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/foundation.rs:172:55
|
172 | unsafe fn valueWithSize(_: Self, size: NSSize) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/foundation.rs:181:33
|
181 | unsafe fn array(_: Self) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/foundation.rs:185:60
|
185 | unsafe fn arrayWithObjects(_: Self, objects: &[id]) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/foundation.rs:190:55
|
190 | unsafe fn arrayWithObject(_: Self, object: id) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/foundation.rs:209:33
|
209 | unsafe fn alloc(_: Self) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/foundation.rs:248:39
|
248 | unsafe fn distantPast(_: Self) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error[E0277]: the trait bound Self: std::marker::Sized is not satisfied
--> /Users/roba/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.3.3/src/foundation.rs:252:41
|
252 | unsafe fn distantFuture(_: Self) -> id {
| ^^ Self does not have a constant size known at compile-time
|
= help: the trait std::marker::Sized is not implemented for Self
= help: consider adding a where Self: std::marker::Sized bound

error: aborting due to 23 previous errors

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.