Releases: albin-johansson/centurion
Centurion 6.0.1
Fixes
- #98
vk::required_extensions()
no longer always returns an emptystd::vector
Centurion 6.0.0
Release notes
General
- [-] Removed Read-the-Docs documentation, moving the contents to either the GitHub wiki or Doxygen documentation.
- [~] Direct usage of headers in
src/centurion
is no longer officially supported, use theinclude/centurion.hpp
header instead - [~] Renamed
exception
tocen_error
- [~]
basic_area
is nowfinal
- [~] Added conditional
noexcept
optimizations to several functions, since MSVC marks many functions asnoexcept
, even if they aren't required to be by the standard - [~] Several functions that take point and area parameters as references have been made to take them by value
- [~] All functions that previously returned
bool
s to indicate their success, now returnresult
values, which is a new class
Core
- [+]
result
class, used to indicate the success of functions (seesuccess
andfailure
) - [+] Version API
CENTURION_VERSION_MAJOR
CENTURION_VERSION_MINOR
CENTURION_VERSION_PATCH
CENTURION_VERSION_NUMBER
CENTURION_MAKE_VERSION_NUMBER
CENTURION_VERSION_AT_LEAST
version
structversion_at_least()
- [+]
sdl_image_linked_version()
- [+]
sdl_mixer_linked_version()
- [+]
sdl_ttf_linked_version()
- [+]
to_underlying()
- [+]
str_or_na()
- [+]
uint
alias - [+]
ulonglong
alias
Logging
- [~] Extracted
log::category
enum and renamed it tolog_category
- [~] Extracted
log::priority
enum and renamed it tolog_priority
Configuration
- [~] Renamed
hint::gamecontroller
namespace tohint::controller
Events
event
- [~] Renamed
event::refresh()
toevent::update()
Threads
N/A
Input
- [~] Renamed
key_state
tokeyboard
- [~] Renamed
mouse_state
tomouse
- [~] Renamed
touch::num_devices()
totouch::device_count()
- [~] Renamed
touch::num_fingers()
totouch::finger_count()
- [+]
has_screen_keyboard()
keyboard
- [~] Renamed
keyboard::was_just_released()
tojust_released()
- [~] Renamed
keyboard::was_just_pressed()
tojust_pressed()
- [~] Renamed
keyboard::modifier_active()
tois_active()
- [~]
keyboard::update()
is no longer marked asnoexcept
- [~]
keyboard::is_held()
is now onlynoexcept
on MSVC - [~]
keyboard::just_pressed()
is now onlynoexcept
on MSVC - [~]
keyboard::just_released()
is now onlynoexcept
on MSVC
mouse
- [~] Renamed
mouse::was_mouse_moved()
towas_moved()
- [~] Renamed
mouse::mouse_x()
tox()
- [~] Renamed
mouse::mouse_y()
toy()
- [~] Renamed
mouse::mouse_pos()
toposition()
basic_joystick
- [~] The
basic_joystick::type
enum has been extracted frombasic_joystick
and renamed tojoystick_type
- [~] The
basic_joystick::power
enum has been extracted frombasic_joystick
and renamed tojoystick_power
- [~] The
basic_joystick::hat_state
enum has been extracted frombasic_joystick
- [~] The
basic_joystick::ball_axis_change
struct has been extracted frombasic_joystick
- [~] Renamed
basic_joystick::get_type()
totype()
- [~]
basic_joystick::axis_pos()
no longer returns anoptional
value. - [-]
basic_joystick::num_hats()
- [-]
basic_joystick::num_axes()
- [-]
basic_joystick::num_trackballs()
- [-]
basic_joystick::num_buttons()
basic_controller
- [~] Renamed
basic_controller::num_mappings()
tomapping_count()
Video
- [~] Renamed
get_window_from_id()
toget_window()
- [~] Renamed
num_render_drivers()
torender_driver_count()
- [~] Renamed
num_video_drivers()
tovideo_driver_count()
- [+] OpenGL API
gl_library
classgl_attribute
enumgl_swap_interval
enumgl::basic_context
class, withgl::context
andgl::context_handle
aliasesgl::swap()
gl::drawable_size()
gl::set()
gl::get()
gl::reset_attributes()
gl::set_swap_interval()
gl::swap_interval()
gl::get_window()
gl::get_context()
gl::is_extension_supported()
- [+] Vulkan API
vk_library
classvk::get_instance_proc_addr()
vk::create_surface()
vk::required_extensions()
vk::drawable_size()
- [+]
palette
class - [+]
renderer_info
class - [+]
make_window_and_renderer()
- [+]
get_info()
screen
- [~] Renamed
screen_saver_enabled()
tois_screen_saver_enabled()
- [~] Moved
set_screen_saver_enabled()
andis_screen_saver_enabled()
out of thescreen
namespace - [~] Display mode functions now return
std::optional
values - [~] Most screen functions have been given display index parameters, that are defaulted to
0
- [~] Moved
screen::orientation
out of thescreen
namespace and renamed it toscreen_orientation
- [~] Moved
screen::dpi_info
out of thescreen
namespace
basic_cursor
- [~] Renamed
basic_cursor::num_system_cursors()
tobasic_cursor::count()
unicode_string
- [~]
unicode_string::operator[]()
overloads are now conditionallynoexcept
basic_renderer
- [~] Changed type of the flags parameter to the flags constructor from
SDL_RendererFlags
tou32
- [~] The flags constructor no longer sets any default settings, such as color and blend mode
- [~]
basic_renderer::default_flags()
is now public - [~]
basic_renderer::has_font()
is no longer marked asnoexcept
- [~] Renamed
basic_renderer::set_logical_integer_scale()
toset_logical_integer_scaling()
- [~]
basic_renderer::set_target()
now takes a non-const
reference to a centurion texture as parameter - [~]
basic_renderer::set_scale()
now have preconditions that the supplied scales are greater than zero - [~]
basic_renderer::set_logical_scale()
now have preconditions that the supplied dimensions aren't negative - [~]
basic_renderer::clear()
now returnsresult
- [~]
basic_renderer::draw_rect()
now returnsresult
- [~]
basic_renderer::fill_rect()
now returnsresult
- [~]
basic_renderer::draw_line()
now returnsresult
- [~]
basic_renderer::draw_lines()
now returnsresult
- [~]
basic_renderer::draw_rect_t()
now returnsresult
- [~]
basic_renderer::fill_rect_t()
now returnsresult
- [~]
basic_renderer::render()
overloads now returnsresult
- [~]
basic_renderer::set_color()
now returnsresult
- [~]
basic_renderer::set_clip()
now returnsresult
- [~]
basic_renderer::set_blend_mode()
now returnsresult
- [~]
basic_renderer::set_target()
now returnsresult
- [~]
basic_renderer::set_scale()
now returnsresult
- [~]
basic_renderer::set_logical_size()
now returnsresult
- [~]
basic_renderer::set_logical_integer_scaling()
now returnsresult
- [+]
basic_renderer::reset_target()
- [+]
basic_renderer::draw_point()
- [+]
basic_renderer::draw_point_t()
- [+]
basic_renderer::draw_circle()
- [+]
basic_renderer::draw_circle_t()
- [+]
basic_renderer::fill_circle()
- [+]
basic_renderer::fill_circle_t()
- [+]
renderer_flags
enum - [-]
basic_renderer::info()
- [-]
basic_renderer::flags()
- [-]
basic_renderer::is_vsync_enabled()
- [-]
basic_renderer::is_accelerated()
- [-]
basic_renderer::is_software_based()
- [-]
basic_renderer::supports_target_textures()
basic_window
- [+] Added defaulted flags parameter to
basic_window
s title/size constructor. - [~] Renamed
basic_window::always_on_top()
tois_always_on_top()
- [~]
basic_window::set_fullscreen()
now returns aresult
- [~]
basic_window::set_fullscreen_desktop()
now returns aresult
- [~]
basic_window::set_opacity()
now returns aresult
- [~]
basic_window::set_capturing_mouse()
now returns aresult
- [~]
basic_window::set_size()
has new preconditions - [~]
basic_window::set_min_size()
has new preconditions - [~]
basic_window::set_max_size()
has new preconditions - [+]
basic_window::is_screen_keyboard_shown()
- [+]
basic_window::has_grabbed_input()
- [+]
basic_window::is_high_dpi()
- [+]
basic_window::is_hidden()
- [+]
basic_window::is_metal()
- [+]
basic_window::is_utility()
- [+]
basic_window::is_tooltip()
- [+]
basic_window::is_popup_menu()
- [+]
basic_window::is_excluded_from_taskbar()
- [+]
window_flags
enum
basic_surface
- [+]
std::string
overload forbasic_surface::with_format()
- [+]
std::string
overload forbasic_surface::from_bmp()
- [+]
std::string
overload forbasic_surface::save_as_bmp()
- [+]
basic_surface::save_as_png()
- [+]
basic_surface::save_as_jpg()
color
- [+]
blend()
- [+]
color::data()
font
- [~] The
font::hint
enum has been extracted renamed tofont_hint
- [~] Removed a redundant style mask data member, slightly reducing the memory footprint of the class
- [~] Made the string size functions return
std::optional
values
message_box
- [~] The
message_box::type
enum has been extracted and renamed tomessage_box_type
- [~] The
message_box::button_order
enum has been extracted to the defaultcen
namespace - [~] Renamed
message_box::get_type()
totype()
System
- [~] Removed the
platform
namespace - [~] Renamed
platform_id::linuxx
toplatform_id::linux_os
- [~] Renamed old
platform::id()
function tocurrent_platform()
- [~] Renamed old
platform::name()
function toplatform_name()
- [~] Moved
battery::power_state
enum out ofbattery
namespace - [~] Moved
simd_block
out ofcpu
namespace - [~] Renamed
get_pref_path()
topreferred_path()
- [~] Renamed
get_base_path()
tobase_path()
- [~] Renamed
counter::now_sec()
tonow_in_seconds()
- [~] Renamed
counter::high_res_freq()
tofrequency()
- [+]
std::string
overload forpreferred_path()
- [+]
screen::display_mode()
- [-]
base_path
class - [-]
pref_path
class
##...
Centurion 6.0.0 (Beta)
This is a preview release of Centurion 6.0.0. Most APIs should be relatively stable, but they might still change before the release of v6.0.0.
Centurion 5.3.0
Release notes
With this release, the minimum supported SDL version is 2.0.10! This is the default version on the current LTS of Ubuntu, which motivated the change. This release also brings serialization support, based on the Cereal library API, along with several improvements to the basic_surface
class, and more. Furthermore, this release removes all library components that were deprecated in version 5.1.0.
The structure of the project has changed slightly, with all headers being located in src/centurion
, with a new composite header located in include
called centurion.hpp
, which contains the contents of all other centurion headers! However, you can still use the library in the old way by including said headers under src/centurion
.
The library is now continuously tested on macOS!
Changes
basic_surface::lock()
is now publicbasic_surface::unlock()
is now publicbasic_surface::must_lock()
is now publicbasic_controller::get_button()
now takes anot_null<czstring>
as a parameter, instead ofczstring
- Exception constructors can now handle null messages
- Tweak the
to_string()
output format from[component | foo: bar]
tocomponent{foo: bar}
Fixes
counter::ticks()
is no longer marked asnoexcept
.
Additions
file
class, along with several associated enumsshared_object
class- Byte order API
swap_byte_order()
swap_big_endian()
swap_little_endian()
- Serialization support for compatible types, based on the Cereal library API, which means that compatible types feature
serialize()
functions that accept an "archive", which serializes the associated data usingoperator()
.basic_area
basic_point
basic_rect
color
key_code
scan_code
unicode_string
vector3
- New literal suffix operators for integer overloads, defined in
integers.hpp
_u8
_u16
_u32
_u64
_i8
_i16
_i32
_i64
basic_surface::data()
function for API consistency, which returns the same pointer asbasic_surface::pixels()
basic_surface(iarea, pixel_format)
constructorbasic_surface::from_bmp()
basic_surface::save_as_bmp()
basic_area::value_type
aliasbasic_renderer::capture()
function for capturing a snapshot of the current rendering target as a surfacebasic_rect
constructor that accepts an SDL rectanglebasic_rect
constructor that takes x, y, width and height as separate valuesbasic_window::restore()
area_of()
- New
std::string
overloadsclipboard::set_text()
basic_controller::get_axis()
basic_controller::get_button()
basic_controller::add_mapping()
basic_controller::load_mappings()
font
constructorfont::string_width()
font::string_height()
font::string_size()
font_cache::store_blended_utf8()
font_cache::store_blended_wrapped_utf8()
font_cache::store_shaded_utf8()
font_cache::store_solid_utf8()
font_cache::store_blended_latin1()
font_cache::store_blended_wrapped_latin1()
font_cache::store_shaded_latin1()
font_cache::store_solid_latin1()
basic_joystick::guid_from_string()
key_code
key name constructorkey_code
key name assignment operatorscan_code
key name constructorscan_code
key name assignment operatorsound_effect
constructoropen_url()
basic_surface
path constructormusic
constructorbasic_texture
path constructorbasic_texture::streaming()
basic_window
title/size constructorbasic_window::set_title()
basic_renderer::render_blended_utf8()
basic_renderer::render_blended_wrapped_utf8()
basic_renderer::render_shaded_utf8()
basic_renderer::render_solid_utf8()
basic_renderer::render_blended_latin1()
basic_renderer::render_blended_wrapped_latin1()
basic_renderer::render_shaded_latin1()
basic_renderer::render_solid_latin1()
- Added
constexpr
functions intended to be used for conditional compilation, based on the current OSplatform::ifdef_win32()
platform::ifdef_win64()
platform::ifdef_linux()
platform::ifdef_android()
platform::ifdef_apple()
- Added
constexpr
functions for querying information about the compiler and build mode.is_debug_build()
is_release_build()
on_msvc()
on_gcc()
on_clang()
on_emscripten()
on_intel_cpp()
isize()
, for getting the size of a container as anint
mouse_state::update(iarea)
mouse_state::set_logical_size()
color::from_hsv()
color::from_hsl()
event::in_queue()
Deprecations
event::num_queued()
, useevent::queue_count()
insteadevent::num_queued(event_type)
, useevent::queue_count(event_type)
instead
Removals
types.hpp
headercenturion_api.hpp
headerbasic_texture::is_static()
basic_rect::resize()
basic_rect::move_to()
sound_effect::loopForever
music::loopForever
message_box::get_title()
message_box::get_message()
key_state::amount_of_keys()
basic_joystick::amount()
ttf_version()
nn_czstring
event::empty()
common_event
default constructorfont::kerning()
font::bold()
font::italic()
font::underlined()
font::strikethrough()
font::outlined()
Misc
- Documentation improvements, especially doxygen groups.
Centurion 5.2.0
Release notes
This release makes library now compatible with both SDL2 2.0.12 and 2.0.14! Overall, this release does not bring any source-breaking changes, but there are a couple of behavioral changes and signature tweaks such as the noexcept
-ness of certain functions. Furthermore, this release includes a few new APIs, such as the sensor and haptic APIs!
Changes
basic_texture::streaming()
now throwssdl_error
instead ofexception
if a temporary texture cannot be locked.basic_texture::set_pixel()
is no longer marked asnoexcept
, it will now throw if pixel format information cannot be obtained.basic_renderer::render_glyph()
now has no effect if the specified glyph doesn't exist in the font cache.basic_renderer::render_text()
no longer has a precondition that all glyphs in the string must have been previously cached.basic_controller::rumble()
is no longer marked asnoexcept
, and it now returns abool
to indicate the success of the rumble.sound_effect::fade_in
is no longer marked asnoexcept
.sound_effect::fade_out
is no longer marked asnoexcept
.music::fade_in
is no longer marked asnoexcept
.music::fade_out
is no longer marked asnoexcept
.milliseconds
overload ofcondition::wait()
is no longer marked asnoexcept
.basic_joystick::rumble()
is no longer marked asnoexcept
.semaphore::acquire()
is no longer marked asnoexcept
.thread::sleep()
is no longer marked asnoexcept
.basic_joystick::from_joystick()
now takes a templatedbasic_joystick
as a parameter, instead of ajoystick_handle
.- Index constructor of
basic_joystick
now uses0
as the default index.
Fixes
- Added missing SFINAE check to
basic_texture::release
, it's only available for owning textures. It would have caused a compilation error if used with a handle, which is the correct behavior, but would likely lead to a confusing error message. - Fixed missing
pixel_format::bgr444
enumerator.
Additions
- New haptic API, located in
haptic.hpp
. - New sensor API, located in
sensor.hpp
. - New locale API, located in
locale.hpp
. - POD
vector3<T>
struct, located in the newvector3.hpp
header. - Class
basic_pixel_format_info
, along withpixel_format_info
andpixel_format_info_handle
aliases, located inpixel_format.hpp
. platform::is_tablet()
function in theplatform.hpp
header.platform::open_url()
function in theplatform.hpp
header.basic_surface::with_format()
, extracted from a lambda in the implementation of thebasic_texture
class.basic_surface::format_info()
, made possible bypixel_format_info_handle
.basic_surface::size()
basic_surface::set_rle_hint()
basic_surface::is_rle_enabled()
font_cache::try_at()
basic_rect::data()
basic_point::data()
get_base_path()
inbase_path.hpp
, replacement for thebase_path
class.get_pref_path()
inpref_path.hpp
, replacement for thepref_path
class.sdl_linked_version()
, located incenturion.hpp
.- Numerous
cast()
specializations forbasic_area
. - Added new
pixel_format
enumeratorspixel_format::xrgb4444
pixel_format::xbgr4444
pixel_format::xrgb1555
pixel_format::xbgr1555
pixel_format::xrgb8888
pixel_format::xbgr8888
basic_controller::count()
basic_controller::serial()
basic_controller::has_axis()
basic_controller::rumble_triggers()
basic_controller::set_sensor_enabled()
basic_controller::has_sensor()
basic_controller::is_sensor_enabled()
basic_controller::get_sensor_data()
basic_controller::set_led_color()
basic_controller::has_led()
basic_joystick::rumble_triggers()
basic_joystick::set_led()
basic_joystick::serial()
basic_joystick::has_led()
basic_joystick::attach_virtual()
basic_joystick::detach_virtual()
basic_joystick::set_virtual_axis()
basic_joystick::set_virtual_button()
basic_joystick::set_virtual_hat()
basic_joystick::is_virtual()
hint::joystick::use_hidapi_ps5
hint::joystick::use_raw_input
hint::joystick::hidapi_correlate_xinput
hint::mouse::relative_scaling
hint::preferred_locales
hint::emscripten::asyncify
hint::android::pause_background_audio
hint::thread_priority_policy
hint::treat_time_critical_as_real_time
hint::linux_use_deadzones
hint::audio_device_app_name
hint::audio_device_stream_name
cpu::simd_block
Deprecations
- Class
base_path
, including the associatedto_string()
andoperator<<
overloads. Use theget_base_path()
function instead. - Class
pref_path
, including the associatedto_string()
andoperator<<
overloads. Use theget_pref_path()
function instead. basic_joystick::num_hats()
, usebasic_joystick::hat_count()
instead.basic_joystick::num_axes()
, usebasic_joystick::axis_count()
instead.basic_joystick::num_trackballs()
, usebasic_joystick::trackball_count()
instead.basic_joystick::num_buttons()
, usebasic_joystick::button_count()
instead.
Removals
None.
Misc
- Simplified owner/handle implementation details.
- Tweaked name of template parameters.
- Various documentation improvements.
Centurion 5.1.0
Release notes
This release turns the library into a header-only library! This change is not considered to break ABI since there is no ABI anymore. Furthermore, this release brings quite a few deprecations along with some new APIs. There shouldn't be any major source breaking changes in this release.
Changes
- Made the library a header-only library, no more need for runtime binaries (other than those of SDL2).
- Made
ttf_version()
incenturion.hpp
headerconstexpr
. battery::exists()
now returnstrue
if the power state is any of:on_battery
,charged
orcharging
.sound_effect::fade_in()
andsound_effect::fade_out
now have preconditions that the durations must be greater than zero.music::fade_in()
andmusic::fade_out
now have preconditions that the durations must be greater than zero.basic_window::set_fullscreen()
no longer resets brightness to1
when exiting fullscreen mode.basic_window::set_brightness()
now returns abool
-true
if successful,false
otherwise. It will also try to set the brightness even when the window isn't in fullscreen mode.event::type()
now returnsstd::optional<event_type>
since there might not be an internal event instance.basic_controller::load_mappings()
no longer throws upon failure, instead it returns astd::optional<int>
, this means that it is now marked asnoexcept
.basic_controller::add_mapping()
no longer throws upon failure, instead it returns an enum that indicates the result. As a result, it is nownoexcept
.- Index parameter to index constructor of
basic_controller
now defaults to0
. - Default-constructed event types will now be initialized with appropriate time and type values.
cast()
function definition is now located in the newcast.hpp
header.- Exceptions for SDL errors (i.e.
sdl_error
,ttf_error
,img_error
andmix_error
) now default to the latest error message from the
respective SDL library.
Fixes
- Fixed
basic_joystick(SDL_Joystick*)
constructor being private, it is now public. - Fixed
basic_renderer::set_logical_size()
not having any effect if any of the supplied components were0
. - Fixed return type of
basic_controller::get_axis(controller_axis)
toi16
(was previouslyi32
). - Fixed
message_box::button_order
enumerators not being equal to correspondingSDL_MessageBoxFlags
values. - Made
message_box::show(const basic_window&)
actually compile when instantiated. battery::seconds_left()
is no longer marked asnoexcept
(because ofstd::chrono::duration
contructor).battery::minutes_left()
is no longer marked asnoexcept
(because ofstd::chrono::duration
contructor).message_box::has_button()
is no longer markes asnoexcept
(because ofstd::any_of
).- Minor README and compilation fixes on newer versions of GCC thanks to @GiuseppeCesarano!
Additions
- New
event_dispatcher.hpp
header, which includes theevent_dispatcher
andevent_sink
classes. integers.hpp
header, provides theuX
andiX
integer aliases (e.g.u16
andi32
).time.hpp
header, provides the time related aliases such asseconds
andmilliseconds
along with the associated literals.not_null.hpp
header, provides thenot_null
alias.sdl_version()
incenturion.hpp
.sdl_image_version()
incenturion.hpp
.sdl_mixer_version()
incenturion.hpp
.sdl_ttf_version()
incenturion.hpp
.basic_renderer::fill()
basic_renderer::fill_with()
.battery::is_charging()
.battery::is_charged()
.battery::is_available()
.key_code::to_scan_code()
.scan_code::to_key_code()
.scan_code::count()
.sound_effect::is_any_playing()
sound_effect::channel()
event::push(const common_event<T>&)
as_sdl_event(const common_event<T>&)
function inevent.hpp
.basic_rect::set_max_x()
.basic_rect::set_max_y()
.
Removals
CENTURION_API
macro.CENTURION_QUERY
macro.- Removed
validate_event()
fromcen
namespace, it was never meant to be used for anything but testing.
Deprecations
centurion_api.hpp
header.types.hpp
header, use the new more explicit headers instead.nn_czstring
alias, usenot_null<czstring>
instead.buffer
alias.font_id
alias.
ttf_version()
, usesdl_ttf_version()
instead.font::kerning()
, usefont::has_kerning()
instead.font::bold()
, usefont::is_bold()
instead.font::italic()
, usefont::is_italic()
instead.font::underlined()
, usefont::is_underlined()
instead.font::strikethrough()
, usefont::is_strikethrough()
instead.font::outlined()
, usefont::is_outlined()
instead.texture::is_static()
, usetexture::is_no_lock()
instead.event::empty()
, useevent::is_empty()
instead.key_state::amount_of_keys()
, usekey_state::key_count()
instead.music::loopForever
, usemusic::forever
instead.sound_effect::loopForever
, usesound_effect::forever
instead.message_box::get_title()
, usemessage_box::title()
instead.message_box::get_message()
, usemessage_box::message()
instead.common_event
default constructor.basic_joystick::amount()
, usebasic_joystick::count()
instead.basic_rect::move_to()
, usebasic_rect::set_position()
instead.basic_rect::resize()
, usebasic_rect::set_size()
instead.
Misc
- Changed signature of variadic overload of
unicode_string::append()
, but it still behaves exactly the same as before. - Rewrote all tests using GoogleTest (instead of Catch2).
- Added mocked test suite in addition to the normal unit tests, so test coverage is greater and of higher quality!
- Added debug assertions where possible for parameters marked as
not_null
. However, you should not rely on this, supplying a null pointer when a parameter is marked asnot_null
is effectively undefined behaviour.
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
Centurion 5.0.0-beta
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!
Centurion 4.3.0
Release notes
This is a small release that adds a touch API and minor improvements to Joystick
.
- Add a touch API in
touch.h
. - Add equality operators for
Joystick
enums.
Centurion 4.2.0
Release notes
This version bring a joystick API, improvements to the Rect
class and minor documentation improvements.
- Added a joystick API, located in
joystick.h
. - Improved the
Rect
class.- Added
void move_to(Point<T>)
, for setting the position of the rectangle easily. - Added
T area()
, that simply returns the area of the rectangle.
- Added
- Various improvements to the Doxygen documentation, which is a work in progress.