-
Notifications
You must be signed in to change notification settings - Fork 38
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
Draft SMFL-based native canvas implementation #406
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #406 +/- ##
==========================================
+ Coverage 82.78% 82.99% +0.20%
==========================================
Files 298 299 +1
Lines 36943 34044 -2899
==========================================
- Hits 30584 28255 -2329
+ Misses 6359 5789 -570
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Right now, this PR is structured to directly emulate We could put it in a new namespace like If we did that, we could potentially make a design based around a and the downside being the |
And archive on wayback machine
Should fix issues experienced by students on M1 macs reported by @anyaevostinar
TODO: switch from sfml to https://github.com/a-e-k/canvas_ity |
This pull request aims to add a native backend for
emp::web::Canvas
so that we can draw to a canvas and save results as an image file from our natively-compiled applications. The idea is to provide twoemp::web::Canvas
classes (one inweb/_NativeCanvas.hpp
and one inweb/_EmscriptenCanvas.hpp
) and then use the preprocessor__EMSCRIPTEN__
to switch out which class is used. For the native implementation, we ape only the drawing and safe-to-file methods... not the full dom model or any ofCanvas
's "Widget
"-related attributes.Under the hood, this PR uses the "Simple and Fast Multimedia Library" https://www.sfml-dev.org/
pro:
-lsfml-graphics
flagcon:
I've got some minimal working code put together (see image!), but lots left unimplemented. If we decide to move in this direction, this might make for a good undergraduate project!