enable widget debug outline when BWIDGETS_DEBUG is defined
This commit is contained in:
parent
b11d574d9c
commit
6ba5d7fc1c
|
@ -4,7 +4,6 @@ project('sdl2_basic_widgets', 'cpp',
|
||||||
# 'b_lundef=false',
|
# 'b_lundef=false',
|
||||||
# 'b_sanitize=address,undefined',
|
# 'b_sanitize=address,undefined',
|
||||||
'cpp_std=c++20',
|
'cpp_std=c++20',
|
||||||
'd_ndebug=if-release',
|
|
||||||
'optimization=g',
|
'optimization=g',
|
||||||
'warning_level=3',
|
'warning_level=3',
|
||||||
],
|
],
|
||||||
|
@ -12,6 +11,10 @@ project('sdl2_basic_widgets', 'cpp',
|
||||||
|
|
||||||
add_project_arguments('-pedantic', '-Winline', language: 'cpp')
|
add_project_arguments('-pedantic', '-Winline', language: 'cpp')
|
||||||
|
|
||||||
|
if (get_option('buildtype').startswith('debug'))
|
||||||
|
add_project_arguments('-DBWIDGETS_DEBUG', language: 'cpp')
|
||||||
|
endif
|
||||||
|
|
||||||
sdl = [
|
sdl = [
|
||||||
dependency('sdl2', version: '>=2.0.5'),
|
dependency('sdl2', version: '>=2.0.5'),
|
||||||
dependency('SDL2_ttf')
|
dependency('SDL2_ttf')
|
||||||
|
|
|
@ -40,11 +40,11 @@ auto Widget::render() -> Widget*
|
||||||
{
|
{
|
||||||
if (_renderer == nullptr) return this;
|
if (_renderer == nullptr) return this;
|
||||||
|
|
||||||
#ifndef _NDEBUG
|
#ifdef BWIDGETS_DEBUG
|
||||||
_renderer
|
_renderer
|
||||||
->draw_color({
|
->draw_color({
|
||||||
// NOLINTNEXTLINE(readability-magic-numbers)
|
// NOLINTNEXTLINE(readability-magic-numbers)
|
||||||
{0, 255, 0, SDL_ALPHA_TRANSPARENT}
|
{0, 255, 0, SDL_ALPHA_OPAQUE}
|
||||||
})
|
})
|
||||||
->draw_rect(nullptr);
|
->draw_rect(nullptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue