Releases: albin-johansson/centurion
Centurion 7.3.0
Release notes
This is likely the last release before Centurion 8 (which will target SDL3).
- Fixed a compilation issue related to
basic_surface
whenCENTURION_NO_SDL_IMAGE
was defined - Rearranged headers. This is a potentially breaking change, but you should be fine if you've included the main
centurion.hpp
header. - Exception messages are now copied and stored in exception objects themselves (thanks @v1993)
- Added
file
overloads to various constructors and factory functions (thanks @v1993) - Added
close
andrelease
functions tofile
(thanks @v1993) - Updated to SDL 2.26
- Added
basic_window::size_in_pixels
- Added
basic_joystick::get_guid_info
- Added new mouse position functions to
mouse_wheel_event
- Added
- Tweak formatting
- Test dependencies are now installed using Vcpkg
- Minor CI improvements
- Minor build script improvements
- Minor documentation improvements
- Removed Doxygen documentation, use the wiki instead. Or you can build the documentation yourself using the root
Doxyfile
.
Centurion 7.2.0
Release notes
This release adds support for SDL 2.24, SDL_ttf 2.20, SDL_mixer 2.6, and SDL_image 2.6.
SDL
display_count()
now returns an optional value- Added class
joy_battery_event
- Added class
virtual_joystick_desc
- Added
event_type::joy_battery_updated
- Added
keyboard::reset()
- Added
display_with()
functions - Added
basic_controller::firmware_version()
- Added
basic_controller::path()
- Added
basic_joystick::firmware_version()
- Added
basic_joystick::path()
- Added
virtual_joystick_desc
overload ofbasic_joystick::attach_virtual()
- Added
gl_attribute::float_buffers
- Fixed compilation issue with some overloads of
message_box::show()
, thanks @gxm11!
SDL_ttf
- Added enum
wrap_alignment
- Added
font::set_wrap_align()
- Added
font::wrap_align()
SDL_mixer
- Added
basic_sound_effect::set_master_volume()
- Added
basic_sound_effect::master_volume()
- Added
music::current_title()
- Added
music::title()
- Added
music::title_tag()
- Added
music::artist_tag()
- Added
music::album_tag()
- Added
music::copyright_tag()
- Added
music::position()
- Added
music::duration()
- Added
music::loop_start_time()
- Added
music::loop_end_time()
- Added
music::loop_length()
SDL_image
- Added
animation
class - Added
file::is_avif()
- Added
file::is_jxl()
- Added
file::is_qoi()
Centurion 7.1.0
Release notes
This release adds support for SDL 2.0.22.
- Added
get_window(renderer_handle)
function for getting the window associated with a renderer - Added
text_editing_ext_event
- Other minor improvements
Centurion 7.0.0
Notes
This release brings the same changes outlined in the release notes for the v7.0.0 beta, with the following differences.
- Add
fwd.hpp
header with forward declarations of most Centurion types - Put
font_bundle
incen::experimental
namespace - Functions with
create_
prefix now usemake_
basic_window::create_renderer()
->basic_window::make_renderer()
basic_renderer::create_texture()
->basic_renderer::make_texture()
vk::create_surface()
->vk::make_surface()
Centurion 6.3.2
- Fixed a special case in
color
functionsas_rgb()
,as_rgba()
, andas_argb()
when usingstd::format()
- Removed some invalid documentation comments referencing the non-existent release 6.4.0
Preview of Centurion 7.0.0
This major release includes many naming changes and improvements, and many APIs have either been overhauled or removed.
Note, this list is incomplete.
General
- Added support for SDL 2.0.18 and 2.0.20
- Added support for SDL_ttf 2.0.18
- Removed support for amalgamated header mode
- Greatly reduced the amount of headers
- Removed comparison operators between Centurion and SDL2 enums
- Removed header
everything.hpp
- Removed header
macros.hpp
- Added more examples
🏗️ Common
- Added alias
bounded_array_ref
- Added alias
enable_for_enum_t
- Added
milliseconds
aliasesu16ms
,u32ms
, andu64ms
- Added Unicode aliases
unicode_t
andunicode32_t
- Renamed integer aliases
u8
->uint8
u16
->uint16
u32
->uint32
u64
->uint64
i8
->int8
i16
->int16
i32
->int32
i64
->int64
- Overhauled SFINAE helper aliases
enable_if_pointer_v
->enable_for_pointer_t
enable_if_convertible_t
->enable_for_convertible_t
- Replaced alias
enable_if_number_t
with variable templateis_number<T>
- Removed string aliases
str
,czstring
, andzstring
- Removed alias
not_null
- Overhauled literal operators
- Removed
_u8
,_u16
,_u32
,_u64
,_i8
,_i16
,_i32
, and_i64
- Removed
_ns
,_us
, and_s
- Put
_ms
literal operator in inline namespacetime_literals
(full qualification is nowcen::literals::time_literals
) _ms
literal operator now returnsu64ms
when using SDL 2.0.18 or later
- Removed
- Renamed
cen_error
toexception
Feature detection
- Removed macro
CENTURION_HAS_STD_MEMORY_RESOURCE
- Removed macro
CENTURION_HAS_FEATURE_MEMORY_RESOURCE
- Added macro
CENTURION_HAS_FEATURE_CHARCONV
Compiler
- Replaced
is_debug_build()
withis_debug_build
constant - Replaced
is_release_build()
withis_release_build
constant - Replaced
on_msvc()
withon_msvc
constant - Replaced
on_gcc()
withon_gcc
constant - Replaced
on_clang()
withon_clang
constant - Removed
on_emscripten()
- Removed
on_intel_cpp()
Initialization
- Removed hint API
- Removed
library
class, replaced bysdl
,img
,mix
, andttf
classes
Logging
- Added support for custom log categories
- Removed namespace
cen::log
log::reset_priorities()
->reset_priorities()
log::set_priority()
->set_priority()
log::get_priority()
->get_priority()
log::max_message_size()
->max_log_message_size()
log::msg()
->log()
log::error()
->log_error()
log::critical()
->log_critical()
log::warn()
->log_warn()
log::debug()
->log_debug()
log::info()
->log_info()
log::verbose()
->log_verbose()
- Removed
log::put()
- Removed
log::set_output_function()
- Removed
log::use_preset_output_function()
Math
- Replaced
basic_rect::isFloating
withbasic_rect::floating
- Replaced
basic_rect::isIntegral
withbasic_rect::integral
- Added new terse conversion functions
as_i()
/as_f()
to math types
Versioning
version
is no longer initalized to the current Centurion version by default- Added
current_version()
🔉 Audio
- Removed alias
channel_index
- Removed alias
group_index
- Removed alias
music_finished_callback
- Removed alias
channel_finished_callback
- Removed alias
sound_font_visit_callback
- Removed
set_sound_fonts()
- Removed
get_sound_fonts()
- Removed
each_sound_font()
- Removed namespace
cen::channels
and all of its functions
music
- Added alias
ms_type
- Added
is_fading_in()
- Added
is_fading_out()
- Removed explicit conversions to
Mix_Music*
andconst Mix_Music*
basic_sound_effect
- Added alias
ms_type
- Removed explicit conversions to
Mix_Chunk*
andconst Mix_Chunk*
🧶 Concurrency
- Removed alias
thread::id
👀 Events
- Renamed
common_event
toevent_base
- Renamed
event
toevent_handler
- Added support for user events (with custom type identifiers)
event_handler
- Added overload of
is()
accepting anevent_type
enumerator - Removed constructors accepting events
- Removed overload of
push()
accepting a non-const event handler - Added
raw_type()
- Renamed
is_empty()
toempty()
keyboard_event
- Renamed functions
set_scan_code()
->set_scan()
set_key_code()
->set_key()
set_button_state()
->set_state()
is_only_any_of_active()
->is_only_subset_active()
- Removed
get_scan_code()
- Removed
get_key_code()
📁 Filesystem
file_mode
- Renamed enumerators
read_existing
->r
read_existing_binary
->rb
write
->w
write_binary
->wb
append_or_create
->a
append_or_create_binary
->ab
read_write_existing
->rx
read_write_existing_binary
->rbx
read_write_replace
->wx
read_write_replace_binary
->wbx
read_append
->ax
read_append_binary
->abx
file_type
- Renamed enumerators
win32
->win
stdio
->std
🔡 Text
- Moved text rendering functions from
basic_renderer
tofont
- Removed rendering convenience functions from
font_cache
- Added experimental
font_bundle
class
🎮 Input
- Removed haptic API
- Removed
touch
namespace and all of its functions - Added class
finger
- Renamed
finger_state
tocontroller_finger_state
- Renamed
key_modifier
tokey_mod
(and removedkey_mod
alias) - Added
is_active(key_mod)
- Added
is_only_active(key_mod)
- Added
is_only_subset_active(key_mod)
key_mod
- Renamed enumerators
left_shift
->lshift
right_shift
->rshift
left_ctrl
->lctrl
right_ctrl
->rctrl
left_alt
->lalt
right_alt
->ralt
left_gui
->lgui
right_gui
->rgui
keyboard
- Renamed
update()
torefresh()
- Renamed
key_count()
tosize()
- Removed key modifier functions
is_active()
,is_only_active()
, andis_only_any_of_active()
mouse
- Added
warp()
- Added
warp_in_window()
- Added
set_relative_mode()
- Added
is_relative_mode_enabled()
- Added
update()
- Added
update(const basic_renderer&)
- Added
is_middle_pressed()
- Added
was_middle_released()
- Added
position_relative_window()
- Added
position_relative_desktop()
- Added
delta()
- Added
is_haptic()
- Renamed functions
is_left_button_pressed()
->is_left_pressed()
is_right_button_pressed()
->is_right_pressed()
was_left_button_released()
->was_left_released()
was_right_button_released()
->was_right_released()
- Removed
update(int, int)
- Removed
update(iarea)
- Removed
reset()
- Removed
set_logical_width()
- Removed
set_logical_height()
- Removed
set_logical_size()
- Removed
logical_width()
- Removed
logical_height()
- Removed
logical_size()
💻 System
- Removed namespace
cen::counter
counter::frequency()
->frequency()
counter::now()
->now()
counter::now_in_seconds()
->now_in_seconds()
counter::ticks()
->ticks32()
- Removed namespace
cen::clipboard
clipboard::has_text()
->has_clipboard()
clipboard::get_text()
->get_clipboard()
clipboard::set_text()
->set_clipboard()
- Removed namespace
cen::ram
ram::amount_mb()
->ram_mb()
ram::amount_gb()
->ram_gb()
- Added
ticks64()
Platform
- Renamed
platform_id
enumeratormac_osx
tomacos
Power
- Removed
battery::exists()
- Removed namespace
cen::battery
battery::seconds_left()
->battery_seconds()
battery::minutes_left()
->battery_minutes()
battery::percentage()
->battery_percentage()
battery::state()
->query_battery()
battery::is_available()
->is_battery_available()
battery::is_charging()
->is_battery_charging()
battery::is_charged()
->is_battery_charged()
🖥️ Video
- Renderers are now created using
basic_window::create_renderer()
- Textures are now created using
basic_renderer::create_texture()
- The
as_rgb()
,as_rgba()
, andas_argb()
functions incolor
now usestd::format
, if available - Removed
double
overload ofblend()
function
Rendering
- Removed font handling API from
basic_renderer
- Removed translated rendering API from
basic_renderer
- Removed text rendering functions from
basic_renderer
, and moved them tofont
Centurion 6.3.1
Release notes
- Fix incorrect point distance calculation (thanks @twantonie)
Centurion 6.3.0
Release notes
This release brings a few minor improvements, features and fixes. Such as adding support for more events and explicitly supporting not using the amalgamated centurion.hpp
header (i.e. it's now supported to include the headers in the src
folder directly).
Audio
- [+]
fade_status_count()
- [+]
music_type_count()
Core
- [~] Optimized
log::use_preset_output_function()
by formatting to a stack buffer (usingstd::format_to_n
)
Compiler
- [+]
CENTURION_HAS_FEATURE_TO_ARRAY
Events
- [+] Added enumerators to
event_type
app_will_enter_foreground
locale_changed
controller_touchpad_down
controller_touchpad_up
controller_touchpad_motion
controller_sensor_update
- [+]
display_event
- [+]
sensor_event
- [+]
user_event
- [+]
controller_touchpad_event
- [-] Removed deprecated
dollar_gesture_event::fingers()
function - [-] Removed deprecated
keyboard_event::modifier_active()
function - [-] Removed deprecated
keyboard_event::shift_active()
function - [-] Removed deprecated
keyboard_event::ctrl_active()
function - [-] Removed deprecated
keyboard_event::alt_active()
function - [-] Removed deprecated
keyboard_event::gui_active()
function - [-] Removed deprecated
keyboard_event::caps_active()
function - [-] Removed deprecated
keyboard_event::num_active()
function - [-] Removed deprecated
multi_gesture_event::set_fingers()
function - [-] Removed deprecated
multi_gesture_event::fingers()
function
Video
- [~] Fixed special case in the
color::as_{rgb/rgba/argb}
functions which could result in the resulting string being shorter than expected - [+]
blend_factor
enum - [+]
blend_op
enum - [+]
blend_task
struct - [+]
compose_blend_mode()
- [-] Removed deprecated overloads of
from_hsv()
andfrom_hsl()
fromcolor
Centurion 6.2.0
Release notes
The major features of this release includes adding support for SDL 2.0.16 and using C++20 facilities wherever possible, whilst still remaining compatible with C++17.
Audio
- [~] Fixed one of the
operator!=
overloads forfade_status
incorrectly taking twoMix_Fading
values as arguments - [+] Added overloads of
to_string()
andoperator<<
forfade_status
- [+] Added overloads of
to_string()
andoperator<<
formusic_type
Compiler
- [+]
CENTURION_NODISCARD_CTOR
- [+]
CENTURION_HAS_FEATURE_CPP20
- [+]
CENTURION_HAS_FEATURE_FORMAT
- [+]
CENTURION_HAS_FEATURE_CONCEPTS
- [+]
CENTURION_HAS_FEATURE_MEMORY_RESOURCE
- [+]
CENTURION_HAS_FEATURE_LERP
- [+]
CENTURION_HAS_FEATURE_SPACESHIP
- [+]
CENTURION_HAS_FEATURE_CHRONO_TIME_ZONES
Core
- [+] Added
str
alias forconst char*
- [+]
log_priority_count()
- [+]
log::set_output_function()
(C++20 only) - [+]
log::use_preset_output_function()
(C++20 only) - [~] Deprecated
czstring
alias - [~] Deprecated
zstring
alias - [~] Marked
library
constructors as nodiscard (C++20 only) - [~] Deprecated
CENTURION_HAS_STD_MEMORY_RESOURCE
macro - [+] Concept
is_stateless_callable
(C++20 only) - [+] Added overloads of
to_string()
andoperator<<
forlog_category
- [+] Added overloads of
to_string()
andoperator<<
forlog_priority
Events
- [+] Added overloads of
to_string()
andoperator<<
forevent_type
- [+] Added overloads of
to_string()
andoperator<<
formouse_wheel_direction
- [+] Added overloads of
to_string()
andoperator<<
forwindow_event_id
Filesystem
- [+] Added overloads of
to_string()
andoperator<<
forfile_mode
- [+] Added overloads of
to_string()
andoperator<<
forfile_type
- [+] Added overloads of
to_string()
andoperator<<
forseek_mode
Hints
- [+]
hint::audio_include_monitors
- [+]
hint::audio_device_stream_role
- [~]
get_hint()
is no longer incorrectly marked asnoexcept
- [~]
get_hint()
now has an explicit return type - [~] Replaced
hint::joystick::hidapi_correlate_xinput
withhint::joystick::rawinput_correlate_xinput
on SDL 2.0.16 or later - [+] Concept
is_hint_callback
(C++20 only) - [+]
add_hint_callback_ex()
(C++20 only)
Input
- [-] Removed deprecated
key_state
alias - [-] Removed deprecated
mouse_state
alias - [~]
haptic_feature
enum now usesuint
as underlying type - [~]
haptic_direction_type
enum now usesu8
as underlying type - [~]
mouse_wheel_direction
enum now usesu32
as underlying type - [+]
controller_type::amazon_luna
- [+]
controller_type::google_stadia
- [+]
basic_controller::get_sensor_data_rate()
- [+]
basic_controller::send_effect()
- [+]
basic_joystick::send_effect()
- [+]
set_modifiers()
- [+]
get_modifiers()
- [+]
keyboard::is_only_active(key_mod)
- [+]
keyboard::is_only_any_of_active(key_mod)
- [+] Added
touch_device_type
alias fortouch::device_type
- [+] Added
touch_finger_state
alias fortouch::finger_state
- [+] Added overloads of
to_string()
andoperator<<
forbutton_state
- [+] Added overloads of
to_string()
andoperator<<
forkeyboard
- [+] Added overloads of
to_string()
andoperator<<
formouse
- [+] Added overloads of
to_string()
andoperator<<
formouse_button
- [+] Added overloads of
to_string()
andoperator<<
forcontroller_type
- [+] Added overloads of
to_string()
andoperator<<
forcontroller_axis
- [+] Added overloads of
to_string()
andoperator<<
forcontroller_button
- [+] Added overloads of
to_string()
andoperator<<
forcontroller_bind_type
- [+] Added overloads of
to_string()
andoperator<<
forjoy_hat_position
- [+] Added overloads of
to_string()
andoperator<<
forjoystick_power
- [+] Added overloads of
to_string()
andoperator<<
forjoystick_type
- [+] Added overloads of
to_string()
andoperator<<
forhat_state
- [+] Added overloads of
to_string()
andoperator<<
forsensor_type
- [+] Added overloads of
to_string()
andoperator<<
fortouch_device_type
- [+] Added overloads of
to_string()
andoperator<<
forbutton_order
- [+] Added overloads of
to_string()
andoperator<<
forhaptic_direction_type
- [+] Added overloads of
to_string()
andoperator<<
forhaptic_feature
- [+] Added overloads of
to_string()
andoperator<<
forkey_modifier
- [+] Added overloads of
to_string()
andoperator<<
forbasic_controller::mapping_result
Math
- [~] Added
operator<=>
tovector3
(C++20 only) - [~] Added defaulted
operator==
forbasic_area
(C++20 only) - [~] Made
operator==
andoperator!=
overloads forbasic_point
templated
System
- [+] Added overloads of
to_string()
andoperator<<
forplatform_id
- [+] Added overloads of
to_string()
andoperator<<
forpower_state
Threads
- [+]
thread::init()
: Constrained factory functions, supporting non-void
user data or no user data at all (along with optional return values) (C++20 only) - [~] Deprecated
thread::id
, usethread_id
instead - [~] Marked
thread
constructor as nodiscard (C++20 only) - [~] Marked
scoped_lock
constructors as nodiscard (C++20 only) - [~] Marked
try_lock
constructor as nodiscard (C++20 only) - [+] Added overloads of
to_string()
andoperator<<
forlock_status
- [+] Added overloads of
to_string()
andoperator<<
forthread_priority
Video
- [+]
flash_op
enum - [+]
basic_window::flash()
- [+]
basic_window::set_always_on_top()
- [+] Additional overload of
blend()
function for colors that accepts afloat
bias - [~] Deprecated
double
bias overload ofblend()
for colors - [~] Marked
gl_library
constructor as nodiscard (C++20 only) - [~] Marked
vk_library
constructor as nodiscard (C++20 only) - [+]
system_cursor_count()
- [+] Added overloads of
to_string()
andoperator<<
forbasic_pixel_format_info
- [+] Added overloads of
to_string()
andoperator<<
forgl_attribute
- [+] Added overloads of
to_string()
andoperator<<
forgl_swap_interval
- [+] Added overloads of
to_string()
andoperator<<
forblend_mode
- [+] Added overloads of
to_string()
andoperator<<
forfont_hint
- [+] Added overloads of
to_string()
andoperator<<
formessage_box::color_id
- [+] Added overloads of
to_string()
andoperator<<
formessage_box::default_button
- [+] Added overloads of
to_string()
andoperator<<
formessage_box_type
- [+] Added overloads of
to_string()
andoperator<<
forpixel_format
- [+] Added overloads of
to_string()
andoperator<<
forscale_mode
- [+] Added overloads of
to_string()
andoperator<<
forscreen_orientation
- [+] Added overloads of
to_string()
andoperator<<
forsystem_cursor
- [+] Added overloads of
to_string()
andoperator<<
fortexture_access
Miscellaneous
- [~] Switched to using a doxygen-awesome theme
- [~] Replaced the wiki with new Doxygen pages
- [+] The CI test suites are now run using both C++17 and C++20
- [~] Use
std::format
into_string()
overloads (C++20 only)
Centurion 6.1.0
Release notes
This release features a collection of smaller quality-of-life improvements and fixes, along a few more considerable additions such as the possibility to opt-out from using any of the SDL extension libraries and the color
class supporting construction/conversion from/to hexadecimal color strings and normalized color values.
Configuration
- [+] Added opt-out macros to exclude all Centurion classes and functions related to the SDL extension libraries
- [+]
CENTURION_NO_SDL_TTF
- [+]
CENTURION_NO_SDL_MIXER
- [+]
CENTURION_NO_SDL_IMAGE
- [+]
Events
- [~] Deprecated
keyboard_event::modifier_active()
- [~] Deprecated
dollar_gesture_event::fingers()
- [~] Deprecated
multi_gesture_event::fingers()
- [~] Deprecated
multi_gesture_event::set_fingers()
- [+]
key_mod
alias forkey_modifier
- [+]
operator|
forkey_modifier
- [+]
operator&
forkey_modifier
- [+]
operator~
forkey_modifier
- [+]
keyboard_event::is_active(key_modifier)
- [+]
keyboard_event::is_only_active(key_modifier)
- [+]
keyboard_event::is_only_any_of_active(key_modifier)
- [~] Deprecated
keyboard_event::shift_active()
- [~] Deprecated
keyboard_event::ctrl_active()
- [~] Deprecated
keyboard_event::alt_active()
- [~] Deprecated
keyboard_event::gui_active()
- [~] Deprecated
keyboard_event::caps_active()
- [~] Deprecated
keyboard_event::num_active()
- [+]
dollar_gesture_event::finger_count()
- [+]
multi_gesture_event::set_finger_count()
- [+]
multi_gesture_event::finger_count()
(fixes incorrectfloat
return type with previousfingers()
function) - [+]
event::data()
Input
- [+] Added
shift
,ctrl
,alt
,gui
andreserved
enumerators tokey_modifier
enum.
Video
- [~] Relaxed pre-conditions of
color::from_hsv()
andcolor::from_hsl()
, these functions will now clamp the arguments to be within the respective ranges - [~] Deprecated
double
overloads ofcolor::from_hsv()
andcolor::from_hsl()
, use the newfloat
overloads instead - [+]
color::from_rgb()
- [+]
color::from_rgba()
- [+]
color::from_argb()
- [+]
color::from_norm()
- [+]
color::as_rgb()
- [+]
color::as_rgba()
- [+]
color::as_argb()
- [+]
color::red_norm()
- [+]
color::green_norm()
- [+]
color::blue_norm()
- [+]
color::alpha_norm()
- [+]
gl::bind()
- [+]
gl::unbind()
- [+]
gl_context
/gl_context_handle
aliases forgl::context
/gl::context_handle
, since classes are usually not located in subnamespaces in the rest of the library
Misc
- [+]
usize
alias forstd::size_t
- [~] Improved performance of
to_string()
overloads