mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-04 21:50:35 -04:00
Fixed the build system for Linux
This commit is contained in:
parent
aa50ab78ec
commit
6393955683
11 changed files with 103 additions and 43 deletions
|
@ -1,7 +1,7 @@
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
project(NiotsoClient)
|
||||
|
||||
include_directories(${FILEHANDLER_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIR})
|
||||
include_directories(${FILEHANDLER_INCLUDE} ${FREETYPE_INCLUDE})
|
||||
|
||||
if(WIN32)
|
||||
set(NIOTSOCLIENT_SOURCES
|
||||
|
@ -17,5 +17,6 @@ if(WIN32)
|
|||
Window/Window.cpp
|
||||
)
|
||||
add_executable(TSO WIN32 ${NIOTSOCLIENT_SOURCES})
|
||||
target_link_libraries(TSO FileHandler_shared freetype_shared ole32 opengl32)
|
||||
target_link_libraries(TSO ole32 opengl32)
|
||||
target_link_libraries(TSO FileHandler_shared ${FREETYPE_LINK})
|
||||
endif()
|
|
@ -92,10 +92,9 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
|
|||
LARGE_INTEGER CurrentTime;
|
||||
QueryPerformanceCounter(&CurrentTime);
|
||||
float TimeDelta = (float)(CurrentTime.QuadPart-PreviousTime.QuadPart)/System::ClockFreq.QuadPart;
|
||||
if(TimeDelta < 0 || TimeDelta >= 5){ //Invalid TimeDelta
|
||||
PreviousTime.QuadPart = CurrentTime.QuadPart;
|
||||
PreviousTime = CurrentTime;
|
||||
if(TimeDelta < 0 || TimeDelta >= 5) //Safe-guard in case of system delay
|
||||
continue;
|
||||
}
|
||||
|
||||
memcpy(&System::UserInput, (const void*) &System::UserInput_v, sizeof(System::UserInput_t));
|
||||
|
||||
|
@ -108,6 +107,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
|
|||
SwapBuffers(Graphics::hDC);
|
||||
}
|
||||
|
||||
//Sleep for the remainder of the frame
|
||||
PreviousTime.QuadPart = CurrentTime.QuadPart;
|
||||
QueryPerformanceCounter(&CurrentTime);
|
||||
float SleepDuration =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue