Commit graph

21 commits

Author SHA1 Message Date
Andrea Blankenstijn a54dc9c2b2 some comment edits, readme draft 2021-08-27 16:08:14 +02:00
Andrea Blankenstijn f6ae2c51e8 Comment a bit the code. 2021-08-23 23:50:14 +02:00
Andrea Blankenstijn a19d2ea6bd - mark as const every single read only variable.
- mark as const every pointer that can be const.
- in implementation mark const args passed by value that are meant to be read-only.
- wrap in a lambda complex initializations of (const) values.
- argument passing:
  - pass by value arguments of cheap-to-copy types or meant to be copied
    anyway.
  - pass by (const) reference args not meant to outlive called
    function scope and not cheap-to-copy.
  - pass (const) pointers to (const) args when null is a valid option
    and pointed data aren't expected to outlive function scope.
  - use string_view for non-owned strings (not meant to outlive function
    scope).
  - use span for collection types like vector and arrays.
  - fancy pointers passing:
    - pass by value if a reference will be held:
    - pass by const reference if a reference _may_ be hell.
    - when no references are meant to be held:
        - dereference the pointer to pass the pointed data by reference
          if null is not an option.
        - pass the underlying raw pointer if null is an option.
… and random subtle changes and fixes here and there that I forgot to mention.
2021-08-22 00:57:55 +02:00
Andrea Blankenstijn 76d319fb69 trash commit, style, small api changes (ref vs ptr) and who knows 2021-08-19 15:00:44 +02:00
Andrea Blankenstijn 0eb300ceeb caption interface-api separation 2021-08-17 11:39:07 +02:00
Andrea Blankenstijn bb934d4f86 separate widget interface-implementation 2021-08-17 00:27:51 +02:00
Andrea Blankenstijn 3458ca123b pass by value vs by ref thing 2021-08-14 16:37:42 +02:00
Andrea Blankenstijn 3570cf301a format code 2021-08-14 09:25:28 +02:00
Andrea Blankenstijn e52b55f460 delete default copy/move ctor/operator=, default default ctor and
destructor
2021-08-13 16:11:19 +02:00
Andrea Blankenstijn 79f83abe3b smart ptr and a bit of doc 2021-08-10 23:48:19 +02:00
Andrea Blankenstijn e71a16208b noexcept correctness intent 2021-08-08 16:04:33 +02:00
Andrea Blankenstijn 4f82826bbc constness 2021-08-08 14:30:56 +02:00
Andrea Blankenstijn cab6fa0cf4 wip general code improvement 2021-08-07 20:11:28 +02:00
Andrea Blankenstijn 2d4c6e3694 Extract linear and smoothstep functions. Minor tweaks. 2021-08-01 11:19:06 +02:00
Andrea Blankenstijn 13bdb970c0 config clang-tidy linter and fix code based on linting err/warn 2021-07-30 21:37:14 +02:00
Andrea Blankenstijn 3b6e900a22 format code with custom clang-format style 2021-07-29 16:06:03 +02:00
Andrea Blankenstijn 55fbd59c36 half workaround to fix corner glitch in draw_rect and minor changes 2021-07-26 23:48:04 +02:00
Andrea Blankenstijn 4b87af7bc4 various changes and fixes 2021-07-23 20:08:52 +02:00
Andrea Blankenstijn ec0d85b97a remove unused caption vertical alignment as we use all viewport height 2021-07-20 12:29:17 +02:00
Andrea Blankenstijn 30c4205dab some fixes and working sdl wrapper 2021-07-19 23:50:50 +02:00
Andrea Blankenstijn dd3ff9358a big hierarchy refactor, some little changes, add Font class 2021-07-18 18:26:12 +02:00