Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup basic window functionality #7

Merged
merged 46 commits into from
Apr 8, 2022
Merged

Setup basic window functionality #7

merged 46 commits into from
Apr 8, 2022

Conversation

ollisco
Copy link
Collaborator

@ollisco ollisco commented Mar 15, 2022

Closes #6

Window setup

@ollisco ollisco added Enhancement🚀 New feature or request Game Engine👨‍💻 This is related to the Game Engiene IDE🖥️ This is related to the IDE labels Mar 15, 2022
foodelevator and others added 9 commits March 17, 2022 21:13
* Initial Cleanup, extract instance creating

* fixup im.rs

* 🧹 Just sweeping up some unclean code 🧹

* 🧹 Just sweeping some stuff under the rug 🧹

* Oh damn i lost my broom

* 🧹 Found it! 🧹

* 📦 Moving stuff around 📦

* Give control flow back to `main` function

* Fix error handling

* Fix aspect ratio

* Remove (not) ppm image generator

Co-authored-by: mathiasmagnusson <mathiasmagnussons@gmail.com>
@foodelevator
Copy link
Collaborator

I'll write it here as well:

I was not quite happy with the current state of Editor, but don't really know how to improve it.

I moved some stuff (math redefinitions (so Vec3<f32> becomes Vec3 etc) and Transform) to a crate called common. My thought is that things that everything will depend on can be there while avoiding having to compile e.g. the renderer (and its dependencies) if you make changes to e.g. the ECS. But maybe this is totally unnecessary, I'm not quite sure. If anyone has any ideas or comments, please discuss!

}

#[derive(Error, Debug)]
pub enum WindowError {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure we wanna use thiserror here, instead of just anyhow?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, thiserror is probably overkill


use common::{Mat4, Vec3};

pub struct Camera {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly put this in common?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitly think that we should have some kind of CameraComponent that can be added to an entity (or possibly multiple?) and then the renderer would query for those to know where to render from.

Then the CameraComponent would probably be in common i guess

But of course the renderer would have to know about CameraComponents


#[rustfmt::skip]
pub fn opengl_to_wgpu_matrix() -> Mat4 {
Mat4::new(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe comment this? This is black magic, might not be applicable to vek

}

pub struct Renderer {
pub camera: Camera,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels really scuffed to tie the camera to the renderer, but I don't know how else to do it

Copy link
Collaborator

@TerraDOOM TerraDOOM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small change to .gitignore

@foodelevator foodelevator self-requested a review March 27, 2022 16:53
@ollisco ollisco requested a review from TerraDOOM April 5, 2022 12:54
Copy link
Collaborator

@lukasfri lukasfri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ser bra ut.

@lukasfri lukasfri merged commit efb2bdc into main Apr 8, 2022
@lukasfri lukasfri deleted the wpgu-start branch April 8, 2022 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement🚀 New feature or request Game Engine👨‍💻 This is related to the Game Engiene IDE🖥️ This is related to the IDE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setup Window
6 participants