Log about SDL2 initialization
This commit is contained in:
parent
061489a1ce
commit
0e5759f1c6
2 changed files with 6 additions and 1 deletions
|
|
@ -5,4 +5,4 @@ file(GLOB_RECURSE PSEMEK_SDL2_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "so
|
||||||
|
|
||||||
add_library(psemek-sdl2 ${PSEMEK_SDL2_HEADERS} ${PSEMEK_SDL2_SOURCES})
|
add_library(psemek-sdl2 ${PSEMEK_SDL2_HEADERS} ${PSEMEK_SDL2_SOURCES})
|
||||||
target_include_directories(psemek-sdl2 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
target_include_directories(psemek-sdl2 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||||
target_link_libraries(psemek-sdl2 PUBLIC SDL2)
|
target_link_libraries(psemek-sdl2 PUBLIC psemek-log SDL2)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#include <psemek/sdl2/init.hpp>
|
#include <psemek/sdl2/init.hpp>
|
||||||
|
#include <psemek/log/log.hpp>
|
||||||
|
|
||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
|
|
||||||
|
|
@ -14,6 +15,10 @@ namespace psemek::sdl2
|
||||||
{
|
{
|
||||||
if (SDL_Init(0) != 0)
|
if (SDL_Init(0) != 0)
|
||||||
fail("Failed to initialize SDL2: ");
|
fail("Failed to initialize SDL2: ");
|
||||||
|
|
||||||
|
SDL_version version;
|
||||||
|
SDL_GetVersion(&version);
|
||||||
|
log::info() << "Initialized SDL " << (int)version.major << '.' << (int)version.minor << '.' << (int)version.patch;
|
||||||
}
|
}
|
||||||
|
|
||||||
~sdl_initializer()
|
~sdl_initializer()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue