From 1ec06a26cc35a37d7191b4ad7eeab86894c7e674 Mon Sep 17 00:00:00 2001 From: tobid7 Date: Wed, 28 Jan 2026 07:40:34 +0100 Subject: [PATCH] Fix GL Scissor in Desktop Backend --- CMakeLists.txt | 15 ++++++++++++ backends/desktop/source/bknd-gfx.cpp | 1 + test/CMakeLists.txt | 35 ++++++++++++++++++++-------- 3 files changed, 41 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c57bc9d..9c785b8 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,6 +74,21 @@ endif() target_include_directories(palladium PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) +if(${CMAKE_SYSTEM_NAME} STREQUAL "Nintendo3DS") + target_compile_options(palladium PRIVATE + $<$:-Wall> + $<$:-Wno-psabi> + $<$:-fno-exceptions> + ) +endif() + +if(${CMAKE_BUILD_TYPE} STREQUAL "Release") + target_compile_options(palladium PRIVATE + $<$:-O0 -g> + $<$:-O3> + ) +endif() + install(DIRECTORY include DESTINATION ".") install(TARGETS palladium) diff --git a/backends/desktop/source/bknd-gfx.cpp b/backends/desktop/source/bknd-gfx.cpp index 364410e..e4875f9 100755 --- a/backends/desktop/source/bknd-gfx.cpp +++ b/backends/desktop/source/bknd-gfx.cpp @@ -309,6 +309,7 @@ void GfxGL2::RenderDrawData(const Li::CmdPool& Commands) { #if PD_OPENGL >= 33 glBindVertexArray(0); #endif + glDisable(GL_SCISSOR_TEST); } } diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 98aedf3..3bb9bfa 100755 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -11,11 +11,10 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Nintendo3DS") if(${PD_BUILD_SHARED}) message(ERROR "3DS Only supports Static libraries") endif() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-psabi -O2") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS} -fno-rtti -fno-exceptions") endif() add_subdirectory(../ palladium) + if(${CMAKE_SYSTEM_NAME} STREQUAL "Nintendo3DS") add_subdirectory(../backends/3ds pd-3ds) else() @@ -24,17 +23,33 @@ endif() add_executable(test source/main.cpp ${BKND_SRC}) + if(${CMAKE_SYSTEM_NAME} STREQUAL "Nintendo3DS") target_link_libraries(test PUBLIC pd-3ds palladium) else() target_link_libraries(test PUBLIC pd-desktop palladium) endif() -#set(RC_FILES -#testassets/ComicNeue.ttf -#testassets/logo.png -#testassets/test.png) -#install(FILES ${RC_FILES} DESTINATION ".") -#else() -#target_link_libraries(test PUBLIC pd-backend-3ds ctru citro3d) -#endif() \ No newline at end of file +if(${CMAKE_SYSTEM_NAME} STREQUAL "Nintendo3DS") + target_compile_options(palladium PRIVATE + $<$:-Wall> + $<$:-Wno-psabi> + $<$:-fno-exceptions> + ) +endif() + +if(${CMAKE_BUILD_TYPE} STREQUAL "Release") + target_compile_options(palladium PRIVATE + $<$:-O0 -g> + $<$:-O3> + ) +endif() + +# set(RC_FILES +# testassets/ComicNeue.ttf +# testassets/logo.png +# testassets/test.png) +# install(FILES ${RC_FILES} DESTINATION ".") +# else() +# target_link_libraries(test PUBLIC pd-backend-3ds ctru citro3d) +# endif() \ No newline at end of file