1
General / Re: Spike lag
« on: August 10, 2016, 07:19:41 am »
Every time I move the paddle theres this spike lag happening. Same as the ball. Might be my computer but it doesnt seem to be like that on monogame.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
However, this could have been used much clearer by using the actual value sf::Keyboard::Unknown instead of the 'magic' -1.
Speaking of which, I also just caught a mistake that was fixed in the final drafts, but somehow made it into production:if (bind->m_details.m_keyCode == -1) { // <-- Supposed to be ==, not !=.
bind->m_details.m_keyCode = e_itr.second.m_code;
}
Keep last – the total number of event types.
There are two ways to compute the FPS:
1. counting how many frames you have in one second (that's your code)
2. counting how many seconds you have in one frame, and inverting the result (that's my code)
CMakeFiles\SFMLDemo3.dir/objects.a(main.cpp.obj): In function `main':
ClionProjects/SFMLDemo3/main.cpp:8: undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'
ClionProjects/SFMLDemo3/main.cpp:8: undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'
ClionProjects/SFMLDemo3/main.cpp:8: undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'
ClionProjects/SFMLDemo3/main.cpp:17: undefined reference to `_imp___ZN2sf6Window5closeEv'
ClionProjects/SFMLDemo3/main.cpp:13: undefined reference to `_imp___ZN2sf6Window9pollEventERNS_5EventE'
ClionProjects/SFMLDemo3/main.cpp:21: undefined reference to `_imp___ZN2sf5ColorC1Ehhhh'
ClionProjects/SFMLDemo3/main.cpp:21: undefined reference to `_imp___ZN2sf12RenderTarget5clearERKNS_5ColorE'
ClionProjects/SFMLDemo3/main.cpp:22: undefined reference to `_imp___ZN2sf6Window7displayEv'
ClionProjects/SFMLDemo3/main.cpp:10: undefined reference to `_imp___ZNK2sf6Window6isOpenEv'
ClionProjects/SFMLDemo3/main.cpp:25: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
ClionProjects/SFMLDemo3/main.cpp:25: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
set(SOURCE_FILES main.cpp)
add_executable(SFMLDemo3 ${SOURCE_FILES})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/SFML-2.3.2/cmake/Modules/")
set(SFML_LIBRARIES "${CMAKE_SOURCE_DIR}/SFML-2.3.2/lib")
set(SFML_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/SFML-2.3.2/include")
MESSAGE(${SFML_INCLUDE_DIR} " hahahaha")
find_package(SFML COMPONENTS system window graphics network audio)
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(SFMLDemo3 ${SFML_LIBRARIES})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/SFML-2.3.2/cmake/Modules/")
set(SFML_LIBRARIES "${CMAKE_SOURCE_DIR}/SFML-2.3.2/lib")
set(SFML_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/SFML-2.3.2/include")
MESSAGE(${SOURCE_FILES})
find_package(SFML COMPONENTS system window graphics network audio REQUIRED)
if (SFML_FOUND)
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(SFMLDemo3 ${SFML_LIBRARIES})
endif(SFML_FOUND)
(missing: SFML_SYSTEM_LIBRARY SFML_WINDOW_LIBRARY
SFML_GRAPHICS_LIBRARY SFML_NETWORK_LIBRARY SFML_AUDIO_LIBRARY)
Yes, it will help. Also, using the REQUIRED keyword will trigger a fatal error if the library is not found, so it is totally useless to test SFML_FOUND after that.
Error:Could NOT find SFML (missing: SFML_SYSTEM_LIBRARY SFML_WINDOW_LIBRARY SFML_GRAPHICS_LIBRARY SFML_NETWORK_LIBRARY SFML_AUDIO_LIBRARY)
cmake_minimum_required(VERSION 3.2)
project(SFMLDemo3)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)
add_executable(SFMLDemo3 ${SOURCE_FILES})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/SFML-2.3.2/cmake/Modules/")
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH} ${CMAKE_SOURCE_DIR}/SFML-2.3.2/lib")
set(SFML_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/SFML-2.3.2/include/SFML")
find_package(SFML COMPONENTS system window graphics network audio REQUIRED)
if (SFML_FOUND)
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(SFMLDemo3 ${SFML_LIBRARIES})
endif(SFML_FOUND)
Error:Could NOT find SFML (missing: SFML_GRAPHICS_LIBRARY SFML_WINDOW_LIBRARY SFML_SYSTEM_LIBRARY)
cmake_minimum_required(VERSION 3.2)
project(SFMLTest)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)
add_executable(SFMLTest ${SOURCE_FILES})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/SFML-2.3.2/cmake/Modules/")
find_package(SFML REQUIRED graphics window system)
if (SFML_FOUND)
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(SFMLTest ${SFML_LIBRARIES})
endif(SFML_FOUND)