Giter Club home page Giter Club logo

modernlife's Introduction

ModernLife Project Overview

Conway's Game of Life and other Cellular Automata Coded with C++/WinRT, WIL, WinUI3, Win2D, GSL

Why?

I learned C++ on C++/98 so

  • This is a great way to learn about improvements in C++ from C++ 11/14/17/20
  • This is a great way to learn our recommended Windows App Development path
  • Cellular Automata is something that interests me
  • The project includes many good opportunities for learning
  • XAML, XAML binding
  • Multithreading
  • Synchronization
  • Timers
  • Canvas and drawing
  • std:: and gsl:: and wil::
  • Class design and much more

Recommended reading

Requires

Included in the Solution

Learn More

Contributing

Pick an issue from the list, fork the repo, make your changes, and submit a pull request. If you find a problem, file it. Use the Performance Profiler to find bottlenecks and file issues. Run on different screen resolutions and DPIs. Build and debug on ARM devices. Write tests. Write documentation. Write code. Write more code. Run Code Analysis and file and fix issues. Clean up the class design. Go for it.

Updating submodules

From Windows Terminal In the butternut root execute git submodule update --remote --merge

modernlife's People

Contributors

asklar avatar mgradwohl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

asklar

modernlife's Issues

Custom shape loading list with preview, name, notes

This may require saving a .modernlife alongside each .cells with the preview and any other preferences like should the edges wrap or not, speed, location to place shape (center, left, right, etc) and a canvas preview thumbnail (would not be great for huge shapes).

Initial Window Size is not correct

On some machines, this code is correct, on others it is not.

       // TODO doesn't work at all monitor DPIs http://microsoft.github.io/Win2D/WinUI3/html/DPI.htm
        const int wndWidth = theCanvas().ConvertDipsToPixels(bestcanvassize + 240, CanvasDpiRounding::Ceiling);
		const int wndHeight = theCanvas().ConvertDipsToPixels(bestcanvassize + 40, CanvasDpiRounding::Ceiling);
        
        //const int wndWidth = bestcanvassize + 240;
        //const int wndHeight = bestcanvassize + 40;
		appWnd.ResizeClient(Windows::Graphics::SizeInt32{ wndWidth, wndHeight });

Draw, Save, Load boards

Let users
Load boards
Draw boards (including from a shapeset)
Save boards

Boards should include the ruleset used (Conway, Brian's brain, etc.)

Investigate copy/move assignment operators

Avoid partial construction by implementing copy/move assignment operators/constructors.

e.g. look at Board, Renderer, FPScounter, etc.

instead of constructing in mainwindow.h and then calling Attach(), Start() etc, which means the object isn't correctly initialized until those are called, see if you can implement this pattern.

MainWindow.h
fpscounter fps{nullptr_t}

MainWindow.cpp
fps = fps(foo, bar, blah);

For example Renderer.h has
Microsoft::Graphics::Canvas::CanvasRenderTarget _spritesheet{ nullptr };
Which isn't truly initialized until
Renderer.cpp
_spritesheet = Microsoft::Graphics::Canvas::CanvasRenderTarget(_canvasDevice, _spriteDipsPerRow, _spriteDipsPerRow, _dpi);

Mouse draw Pointer scaling is off

Because the front buffer and back buffer are created at different DPI. I bet the cell is a delta of 96/_dpi from the mouse pointer. Either creat front buffer at same DPI or scale the points before they get sent to renderer method to find Grid

Duplicate cells issue - really bad

  1. Build and launch
  2. Set the board size to 300 or greater (may depend on your DPI)
  3. Set the board initialization to 0
  4. Draw a line along the top of the board (hold down the left mouse button and drag)
  5. Notice you get more than one line
  6. Note: this happens when the board is randomized (find the repeating pattern)

Settings Panel

Need a settings panel that lets users choose
Colors

of cells

ruleset
etc.

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.