broken vsync
This commit is contained in:
parent
c92d01b2c9
commit
7e57a02792
|
|
@ -1,6 +1,8 @@
|
|||
include_directories(${CMAKE_BINARY_DIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
|
||||
option(FORCE_ENABLE_VSYNC ON)
|
||||
|
||||
if(COMPILE_PLAYER OR COMPILE_STUDIO)
|
||||
if(LINUX)
|
||||
include(/usr/share/cmake/Modules/FindX11.cmake)
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ if(WIN32)
|
|||
list(APPEND HEADER Resource/Windows/Script.rc)
|
||||
endif()
|
||||
|
||||
if(FORCE_ENABLE_VSYNC)
|
||||
target_compile_definitions(Studio PRIVATE FORCE_ENABLE_VSYNC)
|
||||
endif()
|
||||
|
||||
qt_add_executable(Studio ${SOURCE} ${HEADER})
|
||||
|
||||
target_include_directories(Studio PRIVATE Header)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,12 @@ int main(int argc, char** argv)
|
|||
{
|
||||
QSurfaceFormat format;
|
||||
format.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
|
||||
|
||||
#ifdef FORCE_ENABLE_VSYNC
|
||||
format.setSwapInterval(1);
|
||||
#else
|
||||
format.setSwapInterval(0);
|
||||
#endif
|
||||
|
||||
QSurfaceFormat::setDefaultFormat(format);
|
||||
QApplication app(argc, argv);
|
||||
|
|
|
|||
Loading…
Reference in New Issue