Work at 3ds support and backend upgrades
- Track textures (not sure if this is done tbh) - Add lithium formatters and move TextureID, TextureFormat and TextureFilter to lithium - Only include gl-helper if any glDriver is included - Add Li::Rect for UV stuff - Add Li::Texture as Info holder (still thinking of making them to ptrs - Add Check if textures are still loaded on exit
This commit is contained in:
@@ -9,37 +9,43 @@ option(PD_ENABLE_CITRO3D "Enable Citro3D Support (3DS)" OFF)
|
||||
option(PD_ENABLE_VULKAN "Not implemented yet" OFF)
|
||||
|
||||
if(NOT WIN32) # cause we are not on windows...
|
||||
set(PD_ENABLE_DIRECTX9 OFF)
|
||||
set(PD_ENABLE_DIRECTX9 OFF)
|
||||
endif()
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Nintendo3DS")
|
||||
set(PD_ENABLE_OPENGL2 OFF)
|
||||
set(PD_ENABLE_OPENGL3 OFF)
|
||||
set(PD_ENABLE_VULKAN OFF)
|
||||
set(PD_ENABLE_CITRO3D ON)
|
||||
endif()
|
||||
|
||||
add_library(pd-system STATIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source/gl-helper.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source/gfx_opengl2.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source/gfx_opengl3.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source/gfx_directx9.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source/gfx_citro3d.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source/gl-helper.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source/gfx_opengl2.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source/gfx_opengl3.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source/gfx_directx9.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source/gfx_citro3d.cpp
|
||||
)
|
||||
|
||||
target_include_directories(pd-system
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
)
|
||||
|
||||
target_compile_options(palladium
|
||||
PUBLIC
|
||||
$<$<CXX_COMPILER_ID:GNU,Clang>:
|
||||
PUBLIC $<$<CXX_COMPILER_ID:GNU,Clang>:
|
||||
-fmacro-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}/source=source
|
||||
-fmacro-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}/include=include
|
||||
>
|
||||
)
|
||||
|
||||
target_compile_definitions(pd-system
|
||||
PUBLIC
|
||||
$<$<BOOL:${PD_ENABLE_OPENGL2}>:PD_ENABLE_OPENGL2>
|
||||
$<$<BOOL:${PD_ENABLE_OPENGL3}>:PD_ENABLE_OPENGL3>
|
||||
$<$<BOOL:${PD_ENABLE_VULKAN}>:PD_ENABLE_VULKAN>
|
||||
$<$<BOOL:${PD_ENABLE_DIRECTX9}>:PD_ENABLE_DIRECTX9>
|
||||
PUBLIC
|
||||
$<$<BOOL:${PD_ENABLE_OPENGL2}>:PD_ENABLE_OPENGL2>
|
||||
$<$<BOOL:${PD_ENABLE_OPENGL3}>:PD_ENABLE_OPENGL3>
|
||||
$<$<BOOL:${PD_ENABLE_VULKAN}>:PD_ENABLE_VULKAN>
|
||||
$<$<BOOL:${PD_ENABLE_DIRECTX9}>:PD_ENABLE_DIRECTX9>
|
||||
$<$<BOOL:${PD_ENABLE_CITRO3D}>:PD_ENABLE_CITRO3D>
|
||||
)
|
||||
|
||||
# Palladium
|
||||
@@ -47,17 +53,20 @@ target_link_libraries(pd-system PUBLIC palladium::palladium)
|
||||
|
||||
# glad (if we have any OpenGL version included)
|
||||
if(PD_ENABLE_OPENGL2 OR PD_ENABLE_OPENGL3)
|
||||
target_link_libraries(pd-system
|
||||
PUBLIC
|
||||
glad
|
||||
)
|
||||
target_link_libraries(pd-system
|
||||
PUBLIC glad
|
||||
)
|
||||
endif()
|
||||
|
||||
# DirectX9
|
||||
if(PD_ENABLE_DIRECTX9)
|
||||
target_link_libraries(pd-system
|
||||
PUBLIC
|
||||
d3d9
|
||||
d3dcompiler
|
||||
)
|
||||
target_link_libraries(pd-system
|
||||
PUBLIC
|
||||
d3d9
|
||||
d3dcompiler
|
||||
)
|
||||
endif()
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Nintendo3DS")
|
||||
target_link_libraries(pd-system PUBLIC pica::pica citro3d ctru)
|
||||
endif()
|
||||
Reference in New Issue
Block a user