awlib.git
4 days agodoc: remove old parser example master
Hudd [Tue, 2 Mar 2021 20:02:06 +0000 (23:02 +0300)]
doc: remove old parser example

The utils.c++ is basically the same code. If someone wants to use
the parser class directly, they can look there.

But for most intents and purposes it is easier to use utils.h.

4 days agolog: Add forward-declarations header
Hudd [Thu, 14 Mar 2019 09:48:55 +0000 (12:48 +0300)]
log: Add forward-declarations header

Like standard <iosfwd>. It is kinda annoying to forward-declare log,
because of inline namespace (why, oh why did I decide to version
stuff?), but the full header is needed only in very few places (even
though it's small, I don't like having unneeded stuff)

7 months agoaw::memory: Tidy up the pool
Hudd [Wed, 29 Jul 2020 19:49:30 +0000 (22:49 +0300)]
aw::memory: Tidy up the pool

killi suggested that it can be made leaner

7 months agotest: Adjust output for xUnit
Hudd [Sun, 26 Jul 2020 03:33:16 +0000 (06:33 +0300)]
test: Adjust output for xUnit

7 months agotest: Add test configuration parameters
Hudd [Sun, 26 Jul 2020 02:59:56 +0000 (05:59 +0300)]
test: Add test configuration parameters

7 months agoAdd another test for common_prefix
Hudd [Sun, 26 Jul 2020 01:47:32 +0000 (04:47 +0300)]
Add another test for common_prefix

7 months agoAdd test for common_prefix
Hudd [Sun, 26 Jul 2020 01:41:33 +0000 (04:41 +0300)]
Add test for common_prefix

7 months agoplatform: Re-enable demangle test
Hudd [Sun, 26 Jul 2020 00:33:32 +0000 (03:33 +0300)]
platform: Re-enable demangle test

1 failing test is not that big of a deal

7 months agotest: Use stdout instead of stderr
Hudd [Sun, 26 Jul 2020 00:15:49 +0000 (03:15 +0300)]
test: Use stdout instead of stderr

7 months agotest: Add junit output
Hudd [Sun, 26 Jul 2020 00:09:52 +0000 (03:09 +0300)]
test: Add junit output

7 months agolog: Improve tests
Hedede [Sat, 25 Jul 2020 20:43:22 +0000 (23:43 +0300)]
log: Improve tests

7 months agoqueue: Switch-up const and non-const method impls
Hudd [Fri, 1 May 2020 23:54:38 +0000 (02:54 +0300)]
queue: Switch-up const and non-const method impls

It is more correct to cast a non-const pointer to const and then cast
back, than cast a const pointer to non-constqueue: Switch-up const and
non-const method impls

It is more correct to cast a non-const pointer to const and then cast
back, than cast a const pointer to non-const..

7 months agotest: Add isatty check
Hedede [Sat, 25 Jul 2020 19:49:56 +0000 (22:49 +0300)]
test: Add isatty check

7 months agostring: Disable coverage
Hedede [Sat, 25 Jul 2020 19:30:26 +0000 (22:30 +0300)]
string: Disable coverage

7 months agoDisable test-coverage
Hedede [Sat, 25 Jul 2020 19:08:43 +0000 (22:08 +0300)]
Disable test-coverage

7 months agoplatform: Fix test failure
Hedede [Sat, 25 Jul 2020 19:08:23 +0000 (22:08 +0300)]
platform: Fix test failure

7 months agodoc: Fix tests build
Hedede [Sat, 25 Jul 2020 18:47:08 +0000 (21:47 +0300)]
doc: Fix tests build

7 months agolog: Fix tests build
Hedede [Sat, 25 Jul 2020 18:46:56 +0000 (21:46 +0300)]
log: Fix tests build

7 months agobuild: Enable more tests
Hedede [Sat, 25 Jul 2020 18:46:34 +0000 (21:46 +0300)]
build: Enable more tests

7 months agopng: Fix build on clean system
Hedede [Sat, 25 Jul 2020 18:27:54 +0000 (21:27 +0300)]
png: Fix build on clean system

7 months agobuild: Add parameter to turn off colors
Hedede [Sat, 25 Jul 2020 13:12:59 +0000 (16:12 +0300)]
build: Add parameter to turn off colors

7 months agoRemove potential UB in memory::pool
Hudd [Sat, 18 Jul 2020 12:35:40 +0000 (15:35 +0300)]
Remove potential UB in memory::pool

It might've been OK because it is a simple trivially-copyable type, but
just to be correct I changed it to be explicitly constructed

10 months agoqueue: Fix copy constructor
Hudd [Fri, 1 May 2020 23:36:19 +0000 (02:36 +0300)]
queue: Fix copy constructor

10 months agoqueue: Add comparison operators
Hudd [Fri, 1 May 2020 23:31:17 +0000 (02:31 +0300)]
queue: Add comparison operators

10 months agoqueue: Add missing return
Hudd [Fri, 1 May 2020 23:30:25 +0000 (02:30 +0300)]
queue: Add missing return

10 months agoqueue: Fix compile error when copying a const queue
Hudd [Fri, 1 May 2020 23:00:43 +0000 (02:00 +0300)]
queue: Fix compile error when copying a const queue

Sometimes const-correctness is so annoying...

10 months agodoc: Fix const-correctness
Hedede [Fri, 1 May 2020 23:48:59 +0000 (02:48 +0300)]
doc: Fix const-correctness

Weird, I've checked it. Did I forget to commit?

11 months agodoc: Additional methods for getting a list of nodes
Hudd [Sat, 21 Mar 2020 06:42:50 +0000 (09:42 +0300)]
doc: Additional methods for getting a list of nodes

11 months agoawdoc: libdoc -> libawdoc
Hudd [Mon, 16 Mar 2020 20:27:59 +0000 (23:27 +0300)]
awdoc: libdoc -> libawdoc

11 months agoconfig: Add aw_force_inline macro
Hudd [Mon, 16 Mar 2020 20:19:09 +0000 (23:19 +0300)]
config: Add aw_force_inline macro

11 months agoutility: Add _unreachable
Hudd [Mon, 16 Mar 2020 20:01:43 +0000 (23:01 +0300)]
utility: Add _unreachable

11 months agobuild: hdf -> doc
Hudd [Mon, 16 Mar 2020 19:43:36 +0000 (22:43 +0300)]
build: hdf -> doc

11 months agofileformat/obj: Ignore leading-whitespace in obj
Hudd [Sat, 14 Mar 2020 13:42:46 +0000 (16:42 +0300)]
fileformat/obj: Ignore leading-whitespace in obj

11 months agotypes/tests: Shorten tmpflag duration
Hudd [Sun, 15 Mar 2020 08:30:36 +0000 (11:30 +0300)]
types/tests: Shorten tmpflag duration

11 months agovariant: Fix binary search dispatch
Hudd [Sun, 15 Mar 2020 08:14:49 +0000 (11:14 +0300)]
variant: Fix binary search dispatch

I accidentally tuned left half of it into a linear search. Now it should
be optimal

11 months agovariant: Add type deduction and linear dispatch
Hudd [Sun, 15 Mar 2020 07:30:04 +0000 (10:30 +0300)]
variant: Add type deduction and linear dispatch

I think linear dispatch should perform better than binary search when
there are only 2 or 3 alternatives (maybe even more?)

Type deduction wasn't tested, but doesn't break tests so whatever (I'm
thinking of ditching my variant in favour of std::variant)

11 months agoawdoc: Add document
Hudd [Sun, 15 Mar 2020 00:46:27 +0000 (03:46 +0300)]
awdoc: Add document

Convenient container for an awdoc. Allows searching nodes by path

11 months agovariant: Remove specialization of vh_recursive
Hudd [Sun, 15 Mar 2020 00:15:04 +0000 (03:15 +0300)]
variant: Remove specialization of vh_recursive

11 months agoawdoc: Rename hdf->doc
Hudd [Sat, 14 Mar 2020 15:28:08 +0000 (18:28 +0300)]
awdoc: Rename hdf->doc

11 months agoawdoc: Rename hdf into awdoc
Hudd [Sat, 14 Mar 2020 14:33:32 +0000 (17:33 +0300)]
awdoc: Rename hdf into awdoc

There is an already established file format called 'hdf' so I decided to
rename my file format to avoid confusion down the road

11 months agobuild: Upgrade to C++17
Hedede [Sat, 14 Mar 2020 13:18:37 +0000 (16:18 +0300)]
build: Upgrade to C++17

11 months agoawdoc: Fix build #2
Hedede [Sat, 14 Mar 2020 11:47:36 +0000 (14:47 +0300)]
awdoc: Fix build #2

What is even log_fwd? It used to compile, so it was there... when did I
remove it?

11 months agoawdoc: fix build
Hedede [Sat, 14 Mar 2020 11:35:19 +0000 (14:35 +0300)]
awdoc: fix build

I'm unsure why was it declared friend in the first place.

23 months agohdf: Add utility functions
Hudd [Fri, 8 Mar 2019 22:15:49 +0000 (01:15 +0300)]
hdf: Add utility functions

I took them from Havogrek, these are high-level wrappers for parser
class. I did some minor cleanup, because this was C++98 code.

23 months agohdf: Rewrite node class
Hudd [Fri, 8 Mar 2019 22:13:12 +0000 (01:13 +0300)]
hdf: Rewrite node class

I took the new code from Havogrek, I am not sure why the newer version
of node wasn't committed into this repository, it is 3 years old by now.

23 months agohdf: Convert writer to snake_case
Hudd [Thu, 7 Mar 2019 10:45:01 +0000 (13:45 +0300)]
hdf: Convert writer to snake_case

2 years agoFix more of missing returns
Hedede [Tue, 5 Mar 2019 13:33:47 +0000 (16:33 +0300)]
Fix more of missing returns

2 years agoAdd missing return in gl::load_functions
Hedede [Tue, 5 Mar 2019 13:30:16 +0000 (16:30 +0300)]
Add missing return in gl::load_functions

It is a temporary fix, because it should return something different
(maybe a simple bool will suffice?)
It wan't a prooblem, because func is static, but since blah blah
swithced -Werror on

2 years agohdf: Update reader example
Hudd [Mon, 4 Mar 2019 12:48:20 +0000 (15:48 +0300)]
hdf: Update reader example

2 years agohdf: Fix return-type compile errors
Hudd [Mon, 4 Mar 2019 12:47:51 +0000 (15:47 +0300)]
hdf: Fix return-type compile errors

2 years agoAdd default case for ostream_logger
Hedede [Tue, 5 Mar 2019 13:26:06 +0000 (16:26 +0300)]
Add default case for ostream_logger

2 years agoutility: Add hash_combine
Hedede [Mon, 21 Jan 2019 03:47:24 +0000 (06:47 +0300)]
utility: Add hash_combine

It is based on popular version which is also found in boost.
I added a rotate (so that xor's don't cancel out) and a bigger prime for
64 bit values.

2 years agomath: Replace rotl/rotr with template function
Hedede [Mon, 21 Jan 2019 03:09:57 +0000 (06:09 +0300)]
math: Replace rotl/rotr with template function

+ Works for all unsigned integral types
+ Now constexpr
- I've removed MSVC built-ins because
C2131: expression did not evaluate to a constant
- It doesn't have an optimization built into it, but oh well

2 years agoBuild: Add -Werror=return-type
Hudd [Mon, 14 Jan 2019 18:54:58 +0000 (21:54 +0300)]
Build: Add -Werror=return-type

I forget the return inside operator= quite often.

2 years agogl3: Fix missing returns in assinment operators
Hudd [Mon, 14 Jan 2019 18:51:38 +0000 (21:51 +0300)]
gl3: Fix missing returns in assinment operators

This also caused a crash in resource manager.

2 years agoranges: Fix missing return in ipairs
Hudd [Mon, 14 Jan 2019 18:50:07 +0000 (21:50 +0300)]
ranges: Fix missing return in ipairs

2 years agocontainers: Fix allocator type in flat_map
Hudd [Mon, 14 Jan 2019 18:47:53 +0000 (21:47 +0300)]
containers: Fix allocator type in flat_map

Curiously, this is UB.

2 years agomath: C++17ify math.h
Hudd [Sat, 5 May 2018 11:44:00 +0000 (14:44 +0300)]
math: C++17ify math.h

2 years agomath: Improve the description of lerp()
Hudd [Sat, 5 May 2018 11:08:33 +0000 (14:08 +0300)]
math: Improve the description of lerp()

2 years agoplatform: Add missing `using`s
Hudd [Sun, 29 Apr 2018 18:16:01 +0000 (21:16 +0300)]
platform: Add missing `using`s

2 years agotypes: Extend array_view test
Hudd [Sun, 29 Apr 2018 18:11:41 +0000 (21:11 +0300)]
types: Extend array_view test

2 years agoplatform: Add spawn & friends io-process
Hudd [Sun, 29 Apr 2018 17:31:14 +0000 (20:31 +0300)]
platform: Add spawn & friends

(Migrated from drpd)

2 years agotypes: Fix critical mistake in array_view::back()
Hudd [Sun, 29 Apr 2018 17:50:42 +0000 (20:50 +0300)]
types: Fix critical mistake in array_view::back()

2 years agoplatform: Update os_version test
Hudd [Sun, 29 Apr 2018 13:19:58 +0000 (16:19 +0300)]
platform: Update os_version test

2 years agoplatform: Move demangle strings into separate file
Hudd [Sun, 29 Apr 2018 13:18:34 +0000 (16:18 +0300)]
platform: Move demangle strings into separate file

2 years agoplatform: Remove old outdated code
Hudd [Sun, 29 Apr 2018 13:13:58 +0000 (16:13 +0300)]
platform: Remove old outdated code

2 years agomath: Add make_inverse_transform
Hudd [Fri, 27 Apr 2018 11:13:37 +0000 (14:13 +0300)]
math: Add make_inverse_transform

2 years agoFix build error
Hudd [Sun, 22 Apr 2018 12:33:13 +0000 (15:33 +0300)]
Fix build error

It is annoying when other headers mask the error.

2 years agographics: Improve shader loader utilities
Hudd [Sun, 22 Apr 2018 12:27:01 +0000 (15:27 +0300)]
graphics: Improve shader loader utilities

2 years agotypes: Add initializer list support to array_view
Hudd [Sun, 22 Apr 2018 12:26:24 +0000 (15:26 +0300)]
types: Add initializer list support to array_view

2 years agomath: Add make_transform()
Hudd [Sat, 21 Apr 2018 21:27:46 +0000 (00:27 +0300)]
math: Add make_transform()

2 years agographics: Fix incorrect usage of transpose()
Hudd [Sat, 21 Apr 2018 21:19:30 +0000 (00:19 +0300)]
graphics: Fix incorrect usage of transpose()

2 years agographics: Add few uasages of extend()
Hudd [Sat, 21 Apr 2018 21:18:05 +0000 (00:18 +0300)]
graphics: Add few uasages of extend()

2 years agomath: Rename expand_matrix() -> extend()
Hudd [Sat, 21 Apr 2018 21:14:23 +0000 (00:14 +0300)]
math: Rename expand_matrix() -> extend()

I believe this name is more correct. Dropped _matrix, because it is
shorter to read this way and it is already unambigous.

2 years agomath: Add translation_matrix()
Hudd [Sat, 21 Apr 2018 21:10:41 +0000 (00:10 +0300)]
math: Add translation_matrix()

Quite useful utility, should've made it earlier.

2 years agomath: Fix look_at_inverse
Hudd [Sat, 21 Apr 2018 20:56:21 +0000 (23:56 +0300)]
math: Fix look_at_inverse

I forgot that inversing a product of two matrices also inverses order of
operations.

(A·B)⁻¹ = B⁻¹·A⁻¹                   (1)

2 years agomath: Replace pow(1./3.) with cbrt()
Hudd [Sat, 21 Apr 2018 19:47:28 +0000 (22:47 +0300)]
math: Replace pow(1./3.) with cbrt()

It is more accurate (and probably performant).

(Good thing I noticed this)

2 years agomath: Add second overload of look_at_inverse
Hudd [Wed, 18 Apr 2018 09:20:40 +0000 (12:20 +0300)]
math: Add second overload of look_at_inverse

2 years agomath: Fix typo in look_at()
Hudd [Wed, 18 Apr 2018 08:56:54 +0000 (11:56 +0300)]
math: Fix typo in look_at()

2 years agoFix missing return
Hudd [Wed, 18 Apr 2018 08:38:34 +0000 (11:38 +0300)]
Fix missing return

2 years agomath: Add look_at_inverse
Hudd [Wed, 18 Apr 2018 06:34:42 +0000 (09:34 +0300)]
math: Add look_at_inverse

2 years agogl3: Allow passing mat3 to uniforms
Hudd [Thu, 12 Apr 2018 12:11:28 +0000 (15:11 +0300)]
gl3: Allow passing mat3 to uniforms

2 years agocontainers: Convert queue to use circular_iterator
Hudd [Sat, 14 Apr 2018 08:25:17 +0000 (11:25 +0300)]
containers: Convert queue to use circular_iterator

Part of the series introducing circular_buffer.

(Forgot to commit 177 commits ago)

2 years agomath: Remove <iostream> from angle.h
Hudd [Sat, 7 Apr 2018 12:46:54 +0000 (15:46 +0300)]
math: Remove <iostream> from angle.h

2 years agomath: Update angle to C++17
Hudd [Sat, 7 Apr 2018 11:35:54 +0000 (14:35 +0300)]
math: Update angle to C++17

2 years agomath: Disambiguate different versions of look_at
Hudd [Fri, 6 Apr 2018 22:45:43 +0000 (01:45 +0300)]
math: Disambiguate different versions of look_at

2 years agomath: Add look_at function
Hudd [Fri, 6 Apr 2018 22:19:51 +0000 (01:19 +0300)]
math: Add look_at function

2 years agomath: Rename polar.h -> orientaion.h
Hudd [Fri, 6 Apr 2018 21:53:32 +0000 (00:53 +0300)]
math: Rename polar.h -> orientaion.h

2 years agomath: Add vector cross-product tests
Hudd [Fri, 6 Apr 2018 19:29:22 +0000 (22:29 +0300)]
math: Add vector cross-product tests

2 years agographics: Fix include path
Hudd [Fri, 6 Apr 2018 19:28:34 +0000 (22:28 +0300)]
graphics: Fix include path

2 years agomath: Fix vector.normalize()
Hudd [Fri, 6 Apr 2018 19:28:19 +0000 (22:28 +0300)]
math: Fix vector.normalize()

2 years agomath: Remove static qualifier from matrix functions
Hudd [Fri, 6 Apr 2018 19:27:21 +0000 (22:27 +0300)]
math: Remove static qualifier from matrix functions

These were static members of matrix_ops class, and looks like I forgot
to remove the qualifier when I moved them into namespacec.

2 years agomath: Add expand_matrix
Hudd [Fri, 6 Apr 2018 19:26:39 +0000 (22:26 +0300)]
math: Add expand_matrix

2 years agomath: Add [[nodiscard]] to transpose/inverse
Hudd [Fri, 6 Apr 2018 19:24:15 +0000 (22:24 +0300)]
math: Add [[nodiscard]] to transpose/inverse

Forgetting that transpose() has value seantics has bitten me several
times. It is harder to forget how inverse() works, but I it is possible.

2 years agomath: Add spherical_to_cartesian
Hudd [Thu, 5 Apr 2018 16:20:48 +0000 (19:20 +0300)]
math: Add spherical_to_cartesian

Convert spherical coordiantes into cartesian coordinates.
This is intended to be used in orbit camera implementation (i.e. one
that is used in most of model editors).

2 years agoMerge remote-tracking branch 'origin/gl3-wip'
Hedede [Thu, 22 Mar 2018 09:01:09 +0000 (12:01 +0300)]
Merge remote-tracking branch 'origin/gl3-wip'

2 years agogl/utility: Add load_program() func
Hudd [Thu, 22 Mar 2018 08:58:22 +0000 (11:58 +0300)]
gl/utility: Add load_program() func

2 years agogl: Move header shader_file -> program_loader
Hudd [Thu, 22 Mar 2018 08:56:07 +0000 (11:56 +0300)]
gl: Move header shader_file -> program_loader

2 years agoUpdate logger library
Hedede [Wed, 21 Mar 2018 05:02:16 +0000 (08:02 +0300)]
Update logger library

2 years agoMerge branch 'gl3-wip' of ~git/awlib
Hedede [Wed, 21 Mar 2018 03:45:56 +0000 (06:45 +0300)]
Merge branch 'gl3-wip' of ~git/awlib