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_surfacewhenCENTURION_NO_SDL_IMAGEwas defined - Rearranged headers. This is a potentially breaking change, but you should be fine if you've included the main
centurion.hppheader. - Exception messages are now copied and stored in exception objects themselves (thanks @v1993)
- Added
fileoverloads to various constructors and factory functions (thanks @v1993) - Added
closeandreleasefunctions 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_descoverload 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
animationclass - 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.hppheader with forward declarations of most Centurion types - Put
font_bundleincen::experimentalnamespace - 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
colorfunctionsas_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
millisecondsaliasesu16ms,u32ms, andu64ms - Added Unicode aliases
unicode_tandunicode32_t - Renamed integer aliases
u8->uint8u16->uint16u32->uint32u64->uint64i8->int8i16->int16i32->int32i64->int64
- Overhauled SFINAE helper aliases
enable_if_pointer_v->enable_for_pointer_tenable_if_convertible_t->enable_for_convertible_t- Replaced alias
enable_if_number_twith 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
_msliteral operator in inline namespacetime_literals(full qualification is nowcen::literals::time_literals) _msliteral operator now returnsu64mswhen using SDL 2.0.18 or later
- Removed
- Renamed
cen_errortoexception
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_buildconstant - Replaced
is_release_build()withis_release_buildconstant - Replaced
on_msvc()withon_msvcconstant - Replaced
on_gcc()withon_gccconstant - Replaced
on_clang()withon_clangconstant - Removed
on_emscripten() - Removed
on_intel_cpp()
Initialization
- Removed hint API
- Removed
libraryclass, replaced bysdl,img,mix, andttfclasses
Logging
- Added support for custom log categories
- Removed namespace
cen::loglog::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::isFloatingwithbasic_rect::floating - Replaced
basic_rect::isIntegralwithbasic_rect::integral - Added new terse conversion functions
as_i()/as_f()to math types
Versioning
versionis 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::channelsand 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_eventtoevent_base - Renamed
eventtoevent_handler - Added support for user events (with custom type identifiers)
event_handler
- Added overload of
is()accepting anevent_typeenumerator - 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->rread_existing_binary->rbwrite->wwrite_binary->wbappend_or_create->aappend_or_create_binary->abread_write_existing->rxread_write_existing_binary->rbxread_write_replace->wxread_write_replace_binary->wbxread_append->axread_append_binary->abx
file_type
- Renamed enumerators
win32->winstdio->std
🔡 Text
- Moved text rendering functions from
basic_renderertofont - Removed rendering convenience functions from
font_cache - Added experimental
font_bundleclass
🎮 Input
- Removed haptic API
- Removed
touchnamespace and all of its functions - Added class
finger - Renamed
finger_statetocontroller_finger_state - Renamed
key_modifiertokey_mod(and removedkey_modalias) - Added
is_active(key_mod) - Added
is_only_active(key_mod) - Added
is_only_subset_active(key_mod)
key_mod
- Renamed enumerators
left_shift->lshiftright_shift->rshiftleft_ctrl->lctrlright_ctrl->rctrlleft_alt->laltright_alt->raltleft_gui->lguiright_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::countercounter::frequency()->frequency()counter::now()->now()counter::now_in_seconds()->now_in_seconds()counter::ticks()->ticks32()
- Removed namespace
cen::clipboardclipboard::has_text()->has_clipboard()clipboard::get_text()->get_clipboard()clipboard::set_text()->set_clipboard()
- Removed namespace
cen::ramram::amount_mb()->ram_mb()ram::amount_gb()->ram_gb()
- Added
ticks64()
Platform
- Renamed
platform_idenumeratormac_osxtomacos
Power
- Removed
battery::exists() - Removed namespace
cen::batterybattery::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 incolornow usestd::format, if available - Removed
doubleoverload 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_typeapp_will_enter_foregroundlocale_changedcontroller_touchpad_downcontroller_touchpad_upcontroller_touchpad_motioncontroller_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_factorenum - [+]
blend_openum - [+]
blend_taskstruct - [+]
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_statusincorrectly taking twoMix_Fadingvalues 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
stralias forconst char* - [+]
log_priority_count() - [+]
log::set_output_function()(C++20 only) - [+]
log::use_preset_output_function()(C++20 only) - [~] Deprecated
czstringalias - [~] Deprecated
zstringalias - [~] Marked
libraryconstructors as nodiscard (C++20 only) - [~] Deprecated
CENTURION_HAS_STD_MEMORY_RESOURCEmacro - [+] 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_xinputwithhint::joystick::rawinput_correlate_xinputon SDL 2.0.16 or later - [+] Concept
is_hint_callback(C++20 only) - [+]
add_hint_callback_ex()(C++20 only)
Input
- [-] Removed deprecated
key_statealias - [-] Removed deprecated
mouse_statealias - [~]
haptic_featureenum now usesuintas underlying type - [~]
haptic_direction_typeenum now usesu8as underlying type - [~]
mouse_wheel_directionenum now usesu32as 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_typealias fortouch::device_type - [+] Added
touch_finger_statealias 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_pointtemplated
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-voiduser data or no user data at all (along with optional return values) (C++20 only) - [~] Deprecated
thread::id, usethread_idinstead - [~] Marked
threadconstructor as nodiscard (C++20 only) - [~] Marked
scoped_lockconstructors as nodiscard (C++20 only) - [~] Marked
try_lockconstructor as nodiscard (C++20 only) - [+] Added overloads of
to_string()andoperator<<forlock_status - [+] Added overloads of
to_string()andoperator<<forthread_priority
Video
- [+]
flash_openum - [+]
basic_window::flash() - [+]
basic_window::set_always_on_top() - [+] Additional overload of
blend()function for colors that accepts afloatbias - [~] Deprecated
doublebias overload ofblend()for colors - [~] Marked
gl_libraryconstructor as nodiscard (C++20 only) - [~] Marked
vk_libraryconstructor 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::formatinto_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_modalias 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 incorrectfloatreturn type with previousfingers()function) - [+]
event::data()
Input
- [+] Added
shift,ctrl,alt,guiandreservedenumerators tokey_modifierenum.
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
doubleoverloads ofcolor::from_hsv()andcolor::from_hsl(), use the newfloatoverloads 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_handlealiases forgl::context/gl::context_handle, since classes are usually not located in subnamespaces in the rest of the library
Misc
- [+]
usizealias forstd::size_t - [~] Improved performance of
to_string()overloads