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

A multi-window game of life application example #1812

Merged
merged 10 commits into from Feb 2, 2022
Merged

A multi-window game of life application example #1812

merged 10 commits into from Feb 2, 2022

Conversation

hakolao
Copy link
Contributor

@hakolao hakolao commented Jan 30, 2022

We need a classic game of life example. Why not multi-window? :). One you can draw on!

image

A multi windowed game of life application. You could use this to learn:

  • how to handle multiple window inputs and draw on multiple windows
  • how to draw on a canvas
  • how to organize compute shaders with graphics
  • how to do a cellular automata simulation using compute shaders

Lots more.

I wrote this very quickly (Sunday afternoon), so there might be mistakes. Only tested on Ubuntu today.

@hakolao
Copy link
Contributor Author

hakolao commented Jan 30, 2022

3D next? :)

if (life_out[get_index(down_right)] == 1) { alive_count += 1; }
if (life_out[get_index(down)] == 1) { alive_count += 1; }
if (life_out[get_index(down_left)] == 1) { alive_count += 1; }
if (life_out[get_index(left)] == 1) { alive_count += 1; }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't check if the index can go out of range at borders. Intuition says a crash would occur, but it does not.

@hakolao
Copy link
Contributor Author

hakolao commented Jan 30, 2022

Uh. Will fix the build error…

@Rua
Copy link
Contributor

Rua commented Jan 31, 2022

Do you think this makes the old multi-window example obsolete? If so, you could remove it.

Also, slight nitpick, but it's 2022. :)

@hakolao
Copy link
Contributor Author

hakolao commented Jan 31, 2022

I don't know if it does. The old multi-window is plain and simple. In a way nothing wrong with it. I'll consider it

I'll change the year...

@hakolao
Copy link
Contributor Author

hakolao commented Jan 31, 2022

I truly can't believe it's 2022

@Rua Rua merged commit 96c52ad into vulkano-rs:master Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants