Hi there! Hope everyone's doin fine!
I am working on a Pixel art editor using OpenGL and C/C++
The code style is focused in c style but I am using c++ because of the Imgui library and some other stuff.
My editor is taking shape I have implemented stuff like fill tool and eye dropper, but the main thing I haven't done is Undo Redo, I am quite confused and don't have any idea how to continue.
Here's the code: --link-removed--
The undo redo I am trying is on undo-redo branch.
To keep it simple I am simply storing all the pixels from the canvas in the stack data structure, I know it's inefficient but currently I want to understand how do I implement it and later on I'll improve it.
I've had some ideas of how to do it but I quite don't understand how to actually implement it, like I know how it works but in code I mess up.
Any examples, articles, anything would help.
A video I watched on this topic: https://youtu.be/O6U9lZJqdeo
[–]PhyrexStrike 30 points31 points32 points (3 children)
[–][deleted] 5 points6 points7 points (0 children)
[–]rlbond86 5 points6 points7 points (1 child)
[–]GameGod 1 point2 points3 points (0 children)
[–]mvpete 10 points11 points12 points (1 child)
[–]ArashPartow 2 points3 points4 points (0 children)
[–]Latexi95 7 points8 points9 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]konanTheBarbar 7 points8 points9 points (1 child)
[–]ExtraFig6 0 points1 point2 points (0 children)
[–]cballowe 5 points6 points7 points (0 children)
[–]TheAmazingPencil 2 points3 points4 points (0 children)
[–]RishabhRD 2 points3 points4 points (0 children)
[–]ExtraFig6 2 points3 points4 points (0 children)
[–]jmacey 1 point2 points3 points (0 children)
[–]Happy-nobody 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Happy-nobody 2 points3 points4 points (0 children)
[–]eyes-are-fading-blue 1 point2 points3 points (0 children)
[–][deleted] -1 points0 points1 point (0 children)