A cross-platform Turtle graphics system written using modern C++ and SDL, and best practices.
Has both native Visual Studio project for ease of use and access, and fast build speeds. Also has a CMake-based system for cross-platform support (Linux, macOS, etc).
Features:
- Modern C++, and SDL
- Implementation of turtle graphics, with an interpreter
- Trying to show best practices
- Passes Google C++ lint with some filters
See YouTube Playlist for real-time video commentary on development.
You will need to install SDL into the External
folder from the root folder of the project. Up to you how you do this.
Either use the Visual Studio solution directly, or CMake otherwise.
The usual:
$ mkdir -p build && cd build && cmake .. && make
- Setup and quick short follow up.
- Setup Solution, tools and libs for Visual Studio 2019
- Get an SDL window up, after building SDL from source
- Draw a turtle
- Add Interpreter Structure
- Add Lexer
- Add Parser
- Add Executor
- Add Translator
These are the filters I use for Google's cpplint
to suite my tastes more. The bash
function I use is:
lint() {
cpplint --filter=\
-build/include_order,\
-readability/utf8,\
-whitespace/indent,\
-whitespace/line_length,\
-runtime/references\
$*
}
- -build/include_order - need to ignore because of pre-compiled headers
- -readability/utf8 - I just really want to use Unicode © symbol
- -whitespace/indent - I refuse to put a single space before access modifiers
- -whitespace/line_length - Tried to enforce this, but these days it's not needed
- -runtime/references - Google doesn't like you to pass objects by reference. I like to sometimes pass objects by reference. Apparently I should use a pointer instead, which is insane to me.
Maybe have multiple Turtles?