Centurion 5.0.0
Release notes
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.
- Renamed the top-level namespace to
cen
instead ofcenturion
. - Removed pseudo-header-only support.
- Replaced the
CENTURION_NODISCARD
macro with[[nodiscard]]
attribute. - Replaced
tl::optional
withstd::optional
. - Removed
gsl-lite
dependency. - Class names, enumerators and aliases are now in
snake_case
, as per the standard library. - All headers now use the
.hpp
extension. - Added owning and non-owning versions of select components. Owning types have the expected names, and non-owning types are suffixed with
_handle
, e.g.renderer
(owning) andrenderer_handle
(non-owning). - 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 tolibrary
. - Renamed
CenturionConfig
class toconfig
.
- 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 functions 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 usesstd::size_t
as keys instead ofstd::string
. - Overhauled text-rendering API.
- Replaced member
to_string
functions with a non-member equivalent, i.e. you now stringify entities usingcen::to_string(obj);
instead ofobj.to_string();
, - Added support for the stream operator (
<<
) for types that provide ato_string
overload. - Most of the
color
class is nowconstexpr
.- Added
color::with_alpha
.
- Added
- Merged all event headers into
event.hpp
. - Improved
event
class.- Removed
event::as_
functions. - Added
event::is<T>
. - Added
event::get<T>
. - Added
event::try_get<T>
. - Added
event::empty
. - Added
event::num_queued
.
- Removed
- Removed
SysWMEvent
entirely. - Removed
Colour
alias. - Removed the
color::max
andcolor::min
constants. - Fixed the behavior of the outline related methods in
font
. - Put
base_path
andpref_path
in separate headers.
Minor
- The library now uses the trailing return type syntax for methods with non-void return types.
- 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. - Add
get_grabbed_window
andget_window_from_id
functions towindow_utils.hpp
. - 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!
Major differences with 5.0.0-beta
- Removed game loop implementations.
- Removed EnTT dependency.
- Added
texture_handle