Centurion 5.0.0-beta
Pre-release
Pre-release
albin-johansson
released this
07 Sep 16:58
·
2875 commits
to dev
since this release
Release notes
Note: This is a pre-release of version 5.0.0.
This is a big update of the library. Many things have changed and a lot of stuff has been added. Some of the new features are a threading API, a new performant glyph-based text rendering API, owning and non-owning versions of classes, full C++17 utilization and much more. Far from all changes are documented in the following notes. However, the major changes are listed.
Note, this release breaks compatibility with C++11 and C++14.
Major
- The library now only supports C++17.
- Removed pseudo-header-only support.
- Replaced the
CENTURION_NODISCARD
macro with[[nodiscard]]
attribute. - Replaced
tl::optional
withstd::optional
. - Replaced
gsl-lite
withgsl
by Microsoft. - Added
EnTT
as dependency, since it provides so many useful C++17 utilities. - Class names, enumerators and aliases are now in
snake_case
, as per the standard library. - All headers now use the
.hpp
extension. - Added game loop implementations:
variable_timestep_loop
,semi_fixed_timestep_loop
andfixed_timestep_loop
. Located ingame_loop.hpp
. No virtual inheritance necessary! - Added owning and non-owning versions of common components. Owning types have the expected names, and non-owning types are suffixed with
_handle
, e.g.renderer
(owning) andrenderer_handle
(non-owning). Various APIs have been refactored to support both owning and non-owning versions of components where possible.- Added
renderer_handle
, a non-owning wrapper aroundSDL_Renderer*
. - Added
window_handle
, a non-owning wrapper aroundSDL_Window*
.
- Added
- Added threading API.
- Added
thread
class, provides a similar API tostd::thread
.- Renamed the
delay
function tosleep
, and moved it to thethread
class.
- Renamed the
- Added
mutex
class, located inmutex.hpp
. - Added
scoped_lock
class, located inscoped_lock.hpp
. - Added
try_lock
class, located intry_lock.hpp
. - Added
semaphore
class, located insemaphore.hpp
. - Added
condition
class, located incondition.hpp
.
- Added
- Added clipboard API in
clipboard.hpp
- Overhauled the hint API.
- Added fast glyph-based rendering and string caching with
font_cache
, infont_cache.hpp
. - Added simple Unicode string class,
unicode_string
, located inunicode_string.hpp
. - The
centurion.hpp
header no longer includes the rest of the library.- Renamed
Centurion
class tocenturion_lib
.
- Renamed
- Replaced the
Battery
class with thebattery
namespace. - Replaced the
CPU
class with thecpu
namespace. - Replaced the
Platform
class with theplatform
namespace. - Replaced the
Log
class with thelog
namespace. - Replaced the
Screen
class with thescreen
namespace. - Replaced the
Timer
class with thecounter
namespace. - Made most implicit conversions explicit. Look for
get
member function,static_cast
orctn::cast
function. - Replaced the
RAM
class with theram
namespace.- Renamed
size_gb
toamount_gb
. - Renamed
size_mb
toamount_mb
.
- Renamed
- The library now utilizes
std::chrono
time unit types for improved type-safety and correctness of conversions of milliseconds, nanoseconds, minutes, etc. - Fixed several methods that had incorrect
noexcept
specifiers. - Thanks to
if constexpr
, the rendering API has become less bloated and more elegant. For instance,render
will now delegate to eitherSDL_RenderCopy
orSDL_RenderCopyF
depending on the parameter types. - The
renderer
class now usesentt::id_type
as keys, which can be created from compile-time hashed strings, e.g."foo"_hs
. - Overhauled text-rendering API.
- Replaced member
to_string
functions with a non-member equivalent, i.e. you now stringify entities usingctn::to_string(obj);
instead ofobj.to_string();
, this enables usage of ADL to delegate to eitherstd::to_string
orctn::to_string
. - Added support for the stream operator (
<<
) for types that provide ato_string
overload. - Most of the
color
class is nowconstexpr
. - Merged all event headers into
event.hpp
. - Improved
event
class.- Removed
event::as_
methods fromevent
. - Added the
event::is<T>
method. - Added the
event::get<T>
method. - Added the
event::try_get<T>
method. - Added the
event::empty
method.
- Removed
- Removed
SysWMEvent
entirely. - Removed
Colour
alias. - Removed the
color::max
andcolor::min
constants. - Fixed the behavior of the outline related methods in
font
.
Minor
- The library now uses the trailing return type syntax for methods with non-void return types.
- Template definitions are now located in
.ipp
headers. (You don't have to include these explicitly). - Added
sound_effect::is_fading
method that returnstrue
if the sound effect is being faded. - Added the
basic_renderer::clear_with
method, for clearing the rendering target with a specified color. - Optimized and improved the renderer implementation.
- Added
CENTURION_USE_PRAGMA_ONCE
macro incenturion_cfg.hpp
, which is used to specify whether or not#pragma once
should be used by the Centurion headers. - All color constants are now
inline static constexpr
. - Drastically overhauled and improved documentation.
- Added RtD site, which can be found here!
- Started using AppVeyor for CI on Windows!