mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-25 13:05:16 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
141fbf55f6 | ||
|
|
aad6f7b2d1 | ||
|
|
944b267262 | ||
|
|
caf9aba55e | ||
|
|
109a02c829 | ||
|
|
d849c0eae5 | ||
|
|
7c6e4e64b5 | ||
|
|
93dd72dc26 | ||
|
|
91a09b3ce5 | ||
|
|
7c5a55746a | ||
|
|
a499927784 | ||
|
|
4cc30a1f21 | ||
|
|
fb1824b3b0 | ||
|
|
1193ded996 | ||
|
|
c1873e4499 | ||
|
|
6ca48631aa | ||
|
|
b7b2ed5d34 | ||
|
|
f532c0dc98 | ||
|
|
15009493e0 | ||
|
|
2636bec9a1 | ||
|
|
a7ff14c407 | ||
|
|
0e6c07a149 | ||
|
|
e10f7caecb | ||
|
|
9f4120faf4 | ||
|
|
4789261e1e | ||
|
|
58781d458e | ||
|
|
6fa1212560 | ||
|
|
62188c38ec | ||
|
|
6667deca6f | ||
|
|
302048d29e | ||
|
|
c8b2e62da0 | ||
|
|
2a2951e608 | ||
|
|
29382a4492 | ||
|
|
848b4d3aaa | ||
|
|
31ac05d8f4 | ||
|
|
8de6cde2d1 | ||
|
|
766398d86e | ||
|
|
d105eded16 | ||
|
|
59a7060088 | ||
|
|
1f8b022d17 | ||
|
|
1529d3fa34 | ||
|
|
c0b80724b4 | ||
|
|
fdf58188ca | ||
|
|
9a2c8d0ecb | ||
|
|
87d69530a0 | ||
|
|
b790fbd28f | ||
|
|
6abeaed4aa | ||
|
|
42c2fb1f5c | ||
|
|
ed44d9e0db | ||
|
|
2a1a11ca4b | ||
|
|
d6849a3d57 | ||
|
|
8478569b4b | ||
|
|
4e509ff160 | ||
|
|
a6fdf83073 | ||
|
|
4b4d84da0b | ||
|
|
ccf18cf8f9 | ||
|
|
b465c53afe | ||
|
|
bc9ae12596 | ||
|
|
6669a6590a | ||
|
|
85a648ccc6 | ||
|
|
bd0faf69c5 | ||
|
|
91e11cc095 | ||
|
|
12b7c5a6a5 | ||
|
|
acfb53c8d5 | ||
|
|
a707c5e0c7 | ||
|
|
c7cabf8fb2 | ||
|
|
f06b95526c | ||
|
|
7aab9a20d1 | ||
|
|
7535e03679 | ||
|
|
85db0634e5 | ||
|
|
2ec849d7b9 | ||
|
|
44288a186c | ||
|
|
de75c6a122 | ||
|
|
8c9f98f17e | ||
|
|
b2409bee14 | ||
|
|
3277479584 | ||
|
|
00bd5c9a22 | ||
|
|
cc8637f65c | ||
|
|
53f5e263a2 | ||
|
|
4310a05d67 | ||
|
|
65c8bfc655 | ||
|
|
a74e57bcd4 | ||
|
|
1dd4f6484d | ||
|
|
5a60afa475 | ||
|
|
9ee38bd681 | ||
|
|
8f89740308 | ||
|
|
c23b08245e | ||
|
|
d7240abb18 | ||
|
|
0757c89d7c | ||
|
|
fe6c23f26f | ||
|
|
56d1db8b45 | ||
|
|
8e856b00b4 | ||
|
|
046d415f98 | ||
|
|
7e9321e57c | ||
|
|
5aab13ca8d | ||
|
|
8f722ad0fc | ||
|
|
bfebe0aab4 | ||
|
|
bf614690ad | ||
|
|
d1b0c2221b | ||
|
|
c581a975ed |
No files matched your search
+20
-10
@@ -1,11 +1,17 @@
|
|||||||
|
|
||||||
cmake_minimum_required(VERSION 2.8)
|
cmake_minimum_required(VERSION 2.8)
|
||||||
|
|
||||||
|
# define a macro that helps defining an option
|
||||||
|
macro(csfml_set_option var default type docstring)
|
||||||
|
if(NOT DEFINED ${var})
|
||||||
|
set(${var} ${default})
|
||||||
|
endif()
|
||||||
|
set(${var} ${${var}} CACHE ${type} ${docstring} FORCE)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
# set a default build type if none was provided
|
# set a default build type if none was provided
|
||||||
# this has to be done before the project() instruction!
|
# this has to be done before the project() instruction!
|
||||||
if(NOT CMAKE_BUILD_TYPE)
|
csfml_set_option(CMAKE_BUILD_TYPE Release STRING "Choose the type of build (Debug or Release)")
|
||||||
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# project name
|
# project name
|
||||||
project(CSFML)
|
project(CSFML)
|
||||||
@@ -15,27 +21,30 @@ include(${CMAKE_SOURCE_DIR}/cmake/Config.cmake)
|
|||||||
|
|
||||||
# setup version numbers
|
# setup version numbers
|
||||||
set(VERSION_MAJOR 2)
|
set(VERSION_MAJOR 2)
|
||||||
set(VERSION_MINOR 0)
|
set(VERSION_MINOR 2)
|
||||||
set(VERSION_PATCH 0)
|
set(VERSION_PATCH 0)
|
||||||
|
|
||||||
# add the CSFML header path
|
# add the CSFML header path
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/include)
|
include_directories(${CMAKE_SOURCE_DIR}/include)
|
||||||
|
|
||||||
# force dynamic build (static build is not supported)
|
# add an option for choosing the build type (shared or static)
|
||||||
set(BUILD_SHARED_LIBS TRUE)
|
csfml_set_option(BUILD_SHARED_LIBS TRUE BOOL "TRUE to build CSFML as shared libraries, FALSE to build it as static libraries")
|
||||||
|
|
||||||
# add an option for building the API documentation
|
# add an option for building the API documentation
|
||||||
set(BUILD_DOC FALSE CACHE BOOL "TRUE to generate the API documentation, FALSE to ignore it")
|
csfml_set_option(CSFML_BUILD_DOC FALSE BOOL "TRUE to generate the API documentation, FALSE to ignore it")
|
||||||
|
|
||||||
|
# add an option for linking to sfml either statically or dynamically
|
||||||
|
csfml_set_option(CSFML_LINK_SFML_STATICALLY TRUE BOOL "TRUE to link to a static version of SFML, FALSE to link dynamically")
|
||||||
|
|
||||||
# disable the rpath stuff
|
# disable the rpath stuff
|
||||||
set(CMAKE_SKIP_BUILD_RPATH TRUE)
|
set(CMAKE_SKIP_BUILD_RPATH TRUE)
|
||||||
|
|
||||||
# define an option for choosing between static and dynamic C runtime (Windows only)
|
# define an option for choosing between static and dynamic C runtime (Windows only)
|
||||||
if(WINDOWS)
|
if(SFML_OS_WINDOWS)
|
||||||
set(STATIC_STD_LIBS FALSE CACHE BOOL "TRUE to statically link to the standard libraries, FALSE to use them as DLLs")
|
set(STATIC_STD_LIBS FALSE CACHE BOOL "TRUE to statically link to the standard libraries, FALSE to use them as DLLs")
|
||||||
|
|
||||||
# for VC++, we can apply it globally by modifying the compiler flags
|
# for VC++, we can apply it globally by modifying the compiler flags
|
||||||
if(COMPILER_MSVC AND STATIC_STD_LIBS)
|
if(SFML_COMPILER_MSVC AND STATIC_STD_LIBS)
|
||||||
foreach(flag
|
foreach(flag
|
||||||
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
|
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
|
||||||
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
|
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
|
||||||
@@ -48,7 +57,7 @@ endif()
|
|||||||
|
|
||||||
# add the subdirectories
|
# add the subdirectories
|
||||||
add_subdirectory(src/SFML)
|
add_subdirectory(src/SFML)
|
||||||
if(BUILD_DOC)
|
if(CSFML_BUILD_DOC)
|
||||||
add_subdirectory(doc)
|
add_subdirectory(doc)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -58,3 +67,4 @@ install(DIRECTORY include
|
|||||||
COMPONENT devel
|
COMPONENT devel
|
||||||
PATTERN ".svn" EXCLUDE)
|
PATTERN ".svn" EXCLUDE)
|
||||||
install(FILES license.txt DESTINATION ${INSTALL_MISC_DIR})
|
install(FILES license.txt DESTINATION ${INSTALL_MISC_DIR})
|
||||||
|
install(FILES readme.txt DESTINATION ${INSTALL_MISC_DIR})
|
||||||
+27
-20
@@ -1,30 +1,28 @@
|
|||||||
|
|
||||||
# detect the OS
|
# detect the OS
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||||
set(WINDOWS 1)
|
set(SFML_OS_WINDOWS 1)
|
||||||
|
|
||||||
# detect the architecture (note: this test won't work for cross-compilation)
|
# detect the architecture (note: this test won't work for cross-compilation)
|
||||||
include(CheckTypeSize)
|
include(CheckTypeSize)
|
||||||
check_type_size(void* SIZEOF_VOID_PTR)
|
check_type_size(void* SIZEOF_VOID_PTR)
|
||||||
if(${SIZEOF_VOID_PTR} EQUAL "4")
|
if("${SIZEOF_VOID_PTR}" STREQUAL "4")
|
||||||
set(ARCH_32BITS 1)
|
set(ARCH_32BITS 1)
|
||||||
elseif(${SIZEOF_VOID_PTR} EQUAL "8")
|
elseif("${SIZEOF_VOID_PTR}" STREQUAL "8")
|
||||||
set(ARCH_64BITS 1)
|
set(ARCH_64BITS 1)
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Unsupported architecture")
|
message(FATAL_ERROR "Unsupported architecture")
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||||
set(LINUX 1)
|
set(SFML_OS_LINUX 1)
|
||||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||||
# FreeBSD compile path is the same as Linux
|
set(SFML_OS_FREEBSD 1)
|
||||||
set(LINUX 1)
|
|
||||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
set(MACOSX 1)
|
set(SFML_OS_MACOSX 1)
|
||||||
|
|
||||||
# detect OS X version. (use '/usr/bin/sw_vers -productVersion' to extract V from '10.V.x'.)
|
# detect OS X version. (use '/usr/bin/sw_vers -productVersion' to extract V from '10.V.x'.)
|
||||||
EXEC_PROGRAM(/usr/bin/sw_vers ARGS -productVersion OUTPUT_VARIABLE MACOSX_VERSION_RAW)
|
EXEC_PROGRAM(/usr/bin/sw_vers ARGS -productVersion OUTPUT_VARIABLE MACOSX_VERSION_RAW)
|
||||||
STRING(REGEX REPLACE "10\\.([0-9]).*" "\\1" MACOSX_VERSION "${MACOSX_VERSION_RAW}")
|
STRING(REGEX REPLACE "10\\.([0-9]+).*" "\\1" MACOSX_VERSION "${MACOSX_VERSION_RAW}")
|
||||||
if(${MACOSX_VERSION} LESS 5)
|
if(${MACOSX_VERSION} LESS 5)
|
||||||
message(FATAL_ERROR "Unsupported version of OS X : ${MACOSX_VERSION_RAW}")
|
message(FATAL_ERROR "Unsupported version of OS X : ${MACOSX_VERSION_RAW}")
|
||||||
return()
|
return()
|
||||||
@@ -40,23 +38,32 @@ endif()
|
|||||||
if(CMAKE_CXX_COMPILER MATCHES ".*clang[+][+]" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
if(CMAKE_CXX_COMPILER MATCHES ".*clang[+][+]" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
# CMAKE_CXX_COMPILER_ID is an internal CMake variable subject to change,
|
# CMAKE_CXX_COMPILER_ID is an internal CMake variable subject to change,
|
||||||
# but there is no other way to detect CLang at the moment
|
# but there is no other way to detect CLang at the moment
|
||||||
set(COMPILER_CLANG 1)
|
set(SFML_COMPILER_CLANG 1)
|
||||||
execute_process(COMMAND "${CMAKE_CXX_COMPILER}" "--version" OUTPUT_VARIABLE CLANG_VERSION_OUTPUT)
|
execute_process(COMMAND "${CMAKE_CXX_COMPILER}" "--version" OUTPUT_VARIABLE CLANG_VERSION_OUTPUT)
|
||||||
string(REGEX REPLACE ".*clang version ([0-9]+\\.[0-9]+).*" "\\1" CLANG_VERSION "${CLANG_VERSION_OUTPUT}")
|
string(REGEX REPLACE ".*clang version ([0-9]+\\.[0-9]+).*" "\\1" SFML_CLANG_VERSION "${CLANG_VERSION_OUTPUT}")
|
||||||
elseif(CMAKE_COMPILER_IS_GNUCXX)
|
elseif(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
set(COMPILER_GCC 1)
|
set(SFML_COMPILER_GCC 1)
|
||||||
execute_process(COMMAND "${CMAKE_CXX_COMPILER}" "-dumpversion" OUTPUT_VARIABLE GCC_VERSION_OUTPUT)
|
execute_process(COMMAND "${CMAKE_CXX_COMPILER}" "-dumpversion" OUTPUT_VARIABLE GCC_VERSION_OUTPUT)
|
||||||
string(REGEX REPLACE "([0-9]+\\.[0-9]+).*" "\\1" GCC_VERSION "${GCC_VERSION_OUTPUT}")
|
string(REGEX REPLACE "([0-9]+\\.[0-9]+).*" "\\1" SFML_GCC_VERSION "${GCC_VERSION_OUTPUT}")
|
||||||
|
execute_process(COMMAND "${CMAKE_CXX_COMPILER}" "--version" OUTPUT_VARIABLE GCC_COMPILER_VERSION)
|
||||||
|
string(REGEX MATCHALL ".*(tdm[64]*-[1-9]).*" SFML_COMPILER_GCC_TDM "${GCC_COMPILER_VERSION}")
|
||||||
|
execute_process(COMMAND "${CMAKE_CXX_COMPILER}" "-dumpmachine" OUTPUT_VARIABLE GCC_MACHINE)
|
||||||
|
string(STRIP "${GCC_MACHINE}" GCC_MACHINE)
|
||||||
|
if(${GCC_MACHINE} MATCHES ".*w64.*")
|
||||||
|
set(SFML_COMPILER_GCC_W64 1)
|
||||||
|
endif()
|
||||||
elseif(MSVC)
|
elseif(MSVC)
|
||||||
set(COMPILER_MSVC 1)
|
set(SFML_COMPILER_MSVC 1)
|
||||||
if(MSVC_VERSION EQUAL 1400)
|
if(MSVC_VERSION EQUAL 1400)
|
||||||
set(MSVC_VERSION 2005)
|
set(SFML_MSVC_VERSION 8)
|
||||||
elseif(MSVC_VERSION EQUAL 1500)
|
elseif(MSVC_VERSION EQUAL 1500)
|
||||||
set(MSVC_VERSION 2008)
|
set(SFML_MSVC_VERSION 9)
|
||||||
elseif(MSVC_VERSION EQUAL 1600)
|
elseif(MSVC_VERSION EQUAL 1600)
|
||||||
set(MSVC_VERSION 2010)
|
set(SFML_MSVC_VERSION 10)
|
||||||
elseif(MSVC_VERSION EQUAL 1700)
|
elseif(MSVC_VERSION EQUAL 1700)
|
||||||
set(MSVC_VERSION 2011)
|
set(SFML_MSVC_VERSION 11)
|
||||||
|
elseif(MSVC_VERSION EQUAL 1800)
|
||||||
|
set(SFML_MSVC_VERSION 12)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Unsupported compiler")
|
message(FATAL_ERROR "Unsupported compiler")
|
||||||
@@ -64,8 +71,8 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# define the install directory for miscellaneous files
|
# define the install directory for miscellaneous files
|
||||||
if(WINDOWS)
|
if(SFML_OS_WINDOWS)
|
||||||
set(INSTALL_MISC_DIR .)
|
set(INSTALL_MISC_DIR .)
|
||||||
elseif(UNIX)
|
elseif(SFML_OS_LINUX OR SFML_OS_FREEBSD OR SFML_OS_MACOSX)
|
||||||
set(INSTALL_MISC_DIR share/CSFML)
|
set(INSTALL_MISC_DIR share/CSFML)
|
||||||
endif()
|
endif()
|
||||||
+16
-57
@@ -1,49 +1,4 @@
|
|||||||
|
include(CMakeParseArguments)
|
||||||
# some of these macros are inspired from the boost/cmake macros
|
|
||||||
|
|
||||||
# check if a value is contained in a list
|
|
||||||
# sets ${var} to TRUE if the value is found
|
|
||||||
macro(csfml_list_contains var value)
|
|
||||||
set(${var})
|
|
||||||
foreach(value2 ${ARGN})
|
|
||||||
if(${value} STREQUAL ${value2})
|
|
||||||
set(${var} TRUE)
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
# parse a list of arguments and options
|
|
||||||
# ex: sfml_parse_arguments(THIS "SOURCES;DEPENDS" "FLAG" FLAG SOURCES s1 s2 s3 DEPENDS d1 d2)
|
|
||||||
# will define the following variables:
|
|
||||||
# - THIS_SOURCES (s1 s2 s3)
|
|
||||||
# - THIS_DEPENDS (d1 d2)
|
|
||||||
# - THIS_FLAG TRUE
|
|
||||||
macro(csfml_parse_arguments prefix arg_names option_names)
|
|
||||||
foreach(arg_name ${arg_names})
|
|
||||||
set(${prefix}_${arg_name})
|
|
||||||
endforeach()
|
|
||||||
foreach(option_name ${option_names})
|
|
||||||
set(${prefix}_${option_name} FALSE)
|
|
||||||
endforeach()
|
|
||||||
set(current_arg_name)
|
|
||||||
set(current_arg_list)
|
|
||||||
foreach(arg ${ARGN})
|
|
||||||
csfml_list_contains(is_arg_name ${arg} ${arg_names})
|
|
||||||
if(is_arg_name)
|
|
||||||
set(${prefix}_${current_arg_name} ${current_arg_list})
|
|
||||||
set(current_arg_name ${arg})
|
|
||||||
set(current_arg_list)
|
|
||||||
else()
|
|
||||||
csfml_list_contains(is_option ${arg} ${option_names})
|
|
||||||
if(is_option)
|
|
||||||
set(${prefix}_${arg} TRUE)
|
|
||||||
else()
|
|
||||||
set(current_arg_list ${current_arg_list} ${arg})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
set(${prefix}_${current_arg_name} ${current_arg_list})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
# add a new target which is a CSFML library
|
# add a new target which is a CSFML library
|
||||||
# ex: csfml_add_library(csfml-graphics
|
# ex: csfml_add_library(csfml-graphics
|
||||||
@@ -52,7 +7,7 @@ endmacro()
|
|||||||
macro(csfml_add_library target)
|
macro(csfml_add_library target)
|
||||||
|
|
||||||
# parse the arguments
|
# parse the arguments
|
||||||
csfml_parse_arguments(THIS "SOURCES;DEPENDS" "" ${ARGN})
|
cmake_parse_arguments(THIS "" "" "SOURCES;DEPENDS;EXTERNAL_LIBS" ${ARGN})
|
||||||
|
|
||||||
# create the target
|
# create the target
|
||||||
add_library(${target} ${THIS_SOURCES})
|
add_library(${target} ${THIS_SOURCES})
|
||||||
@@ -62,15 +17,14 @@ macro(csfml_add_library target)
|
|||||||
string(TOUPPER "${NAME_UPPER}" NAME_UPPER)
|
string(TOUPPER "${NAME_UPPER}" NAME_UPPER)
|
||||||
set_target_properties(${target} PROPERTIES DEFINE_SYMBOL ${NAME_UPPER}_EXPORTS)
|
set_target_properties(${target} PROPERTIES DEFINE_SYMBOL ${NAME_UPPER}_EXPORTS)
|
||||||
|
|
||||||
# adjust the output file prefix/suffix to match our conventions
|
if(SFML_OS_WINDOWS)
|
||||||
if(WINDOWS)
|
|
||||||
# include the major version number in Windows shared library names (but not import library names)
|
# include the major version number in Windows shared library names (but not import library names)
|
||||||
set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -d)
|
set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -d)
|
||||||
set_target_properties(${target} PROPERTIES SUFFIX "-${VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
set_target_properties(${target} PROPERTIES SUFFIX "-${VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||||
else()
|
else()
|
||||||
set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -d)
|
set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -d)
|
||||||
endif()
|
endif()
|
||||||
if (WINDOWS AND COMPILER_GCC)
|
if (SFML_OS_WINDOWS AND SFML_COMPILER_GCC)
|
||||||
# on Windows/gcc get rid of "lib" prefix for shared libraries,
|
# on Windows/gcc get rid of "lib" prefix for shared libraries,
|
||||||
# and transform the ".dll.a" suffix into ".a" for import libraries
|
# and transform the ".dll.a" suffix into ".a" for import libraries
|
||||||
set_target_properties(${target} PROPERTIES PREFIX "")
|
set_target_properties(${target} PROPERTIES PREFIX "")
|
||||||
@@ -78,19 +32,24 @@ macro(csfml_add_library target)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# set the version and soversion of the target (for compatible systems -- mostly Linuxes)
|
# set the version and soversion of the target (for compatible systems -- mostly Linuxes)
|
||||||
set_target_properties(${target} PROPERTIES SOVERSION ${VERSION_MAJOR})
|
set_target_properties(${target} PROPERTIES SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR})
|
||||||
set_target_properties(${target} PROPERTIES VERSION ${VERSION_MAJOR}.${VERSION_MINOR})
|
set_target_properties(${target} PROPERTIES VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
|
||||||
|
|
||||||
# for gcc >= 4.0 on Windows, apply the STATIC_STD_LIBS option if it is enabled
|
# set the target's folder (for IDEs that support it, e.g. Visual Studio)
|
||||||
if(WINDOWS AND COMPILER_GCC AND STATIC_STD_LIBS)
|
set_target_properties(${target} PROPERTIES FOLDER "CSFML")
|
||||||
if(NOT GCC_VERSION VERSION_LESS "4")
|
|
||||||
|
# for gcc >= 4.0 on Windows, apply the SFML_USE_STATIC_STD_LIBS option if it is enabled
|
||||||
|
if(SFML_OS_WINDOWS AND SFML_COMPILER_GCC AND NOT SFML_GCC_VERSION VERSION_LESS "4")
|
||||||
|
if(SFML_USE_STATIC_STD_LIBS AND NOT SFML_COMPILER_GCC_TDM)
|
||||||
set_target_properties(${target} PROPERTIES LINK_FLAGS "-static-libgcc -static-libstdc++")
|
set_target_properties(${target} PROPERTIES LINK_FLAGS "-static-libgcc -static-libstdc++")
|
||||||
|
elseif(NOT SFML_USE_STATIC_STD_LIBS AND SFML_COMPILER_GCC_TDM)
|
||||||
|
set_target_properties(${target} PROPERTIES LINK_FLAGS "-shared-libgcc -shared-libstdc++")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# If using gcc >= 4.0 or clang >= 3.0 on a non-Windows platform, we must hide public symbols by default
|
# if using gcc >= 4.0 or clang >= 3.0 on a non-Windows platform, we must hide public symbols by default
|
||||||
# (exported ones are explicitely marked)
|
# (exported ones are explicitely marked)
|
||||||
if(NOT WINDOWS AND ((COMPILER_GCC AND NOT GCC_VERSION VERSION_LESS "4") OR (COMPILER_CLANG AND NOT CLANG_VERSION VERSION_LESS "3")))
|
if(NOT SFML_OS_WINDOWS AND ((SFML_COMPILER_GCC AND NOT SFML_GCC_VERSION VERSION_LESS "4") OR (SFML_COMPILER_CLANG AND NOT SFML_CLANG_VERSION VERSION_LESS "3")))
|
||||||
set_target_properties(${target} PROPERTIES COMPILE_FLAGS -fvisibility=hidden)
|
set_target_properties(${target} PROPERTIES COMPILE_FLAGS -fvisibility=hidden)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
+1
-3
@@ -7,7 +7,7 @@ set(DOXYGEN_INPUT_DIR ${CMAKE_SOURCE_DIR})
|
|||||||
set(DOXYGEN_OUTPUT_DIR ${CMAKE_BINARY_DIR}/doc)
|
set(DOXYGEN_OUTPUT_DIR ${CMAKE_BINARY_DIR}/doc)
|
||||||
|
|
||||||
# see if we can generate the CHM documentation
|
# see if we can generate the CHM documentation
|
||||||
if(WINDOWS)
|
if(SFML_OS_WINDOWS)
|
||||||
# if HHC is found, we can generate the CHM (compressed HTML) output
|
# if HHC is found, we can generate the CHM (compressed HTML) output
|
||||||
find_program(DOXYGEN_HHC_PROGRAM
|
find_program(DOXYGEN_HHC_PROGRAM
|
||||||
NAMES hhc.exe
|
NAMES hhc.exe
|
||||||
@@ -29,8 +29,6 @@ configure_file(${DOXYGEN_INPUT_DIR}/doc/doxyfile.in ${DOXYGEN_CONFIGURED_INPUT}
|
|||||||
|
|
||||||
# copy the files needed by the documentation
|
# copy the files needed by the documentation
|
||||||
configure_file(${DOXYGEN_INPUT_DIR}/doc/doxygen.css ${DOXYGEN_OUTPUT_DIR}/html/doxygen.css COPYONLY)
|
configure_file(${DOXYGEN_INPUT_DIR}/doc/doxygen.css ${DOXYGEN_OUTPUT_DIR}/html/doxygen.css COPYONLY)
|
||||||
configure_file(${DOXYGEN_INPUT_DIR}/doc/logo.jpg ${DOXYGEN_OUTPUT_DIR}/html/logo.jpg COPYONLY)
|
|
||||||
configure_file(${DOXYGEN_INPUT_DIR}/doc/logo-bg.jpg ${DOXYGEN_OUTPUT_DIR}/html/logo-bg.jpg COPYONLY)
|
|
||||||
|
|
||||||
# target setup
|
# target setup
|
||||||
add_custom_target(doc ALL
|
add_custom_target(doc ALL
|
||||||
|
|||||||
+1
-1
@@ -31,7 +31,7 @@ PROJECT_NAME = SFML
|
|||||||
# This could be handy for archiving the generated documentation or
|
# This could be handy for archiving the generated documentation or
|
||||||
# if some version control system is used.
|
# if some version control system is used.
|
||||||
|
|
||||||
PROJECT_NUMBER = @VERSION_MAJOR@.@VERSION_MINOR@
|
PROJECT_NUMBER = @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@
|
||||||
|
|
||||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||||
# base path where the generated documentation will be put.
|
# base path where the generated documentation will be put.
|
||||||
|
|||||||
+846
-249
File diff suppressed because it is too large.
Load diff
+7
-6
@@ -1,8 +1,9 @@
|
|||||||
|
</div>
|
||||||
<p id="footer">
|
<div id="footer-container">
|
||||||
:: Copyright © 2007 Laurent Gomila, all rights reserved ::
|
<div id="footer">
|
||||||
Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.5.2</a> ::
|
Copyright © Laurent Gomila ::
|
||||||
</p>
|
Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> ::
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
+11
-8
@@ -1,12 +1,15 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
<html>
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<title>SFML - Simple and Fast Multimedia Library</title>
|
<title>CSFML - C binding of the Simple and Fast Multimedia Library</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
|
||||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
<!--<link rel='stylesheet' type='text/css' href="http://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
|
||||||
<link href="tabs.css" rel="stylesheet" type="text/css" />
|
<link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="logo">
|
<div id="banner-container">
|
||||||
<img src="./logo.jpg" width="770" height="200" title="SFML home" alt="SFML logo" />
|
<div id="banner">
|
||||||
|
<span id="sfml">CSFML</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="content">
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 22 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 114 KiB |
+3
-4
@@ -3,10 +3,9 @@
|
|||||||
///
|
///
|
||||||
/// \section welcome Welcome
|
/// \section welcome Welcome
|
||||||
/// Welcome to the official SFML documentation for C. Here you will find a detailed
|
/// Welcome to the official SFML documentation for C. Here you will find a detailed
|
||||||
/// view of all the SFML <a href="./globals_func.htm">functions</a>, as well as source
|
/// view of all the SFML <a href="./globals_func.htm">functions</a>.<br/>
|
||||||
/// <a href="./files.htm">files</a>. <br/>
|
|
||||||
/// If you are looking for tutorials, you can visit the official website
|
/// If you are looking for tutorials, you can visit the official website
|
||||||
/// at <a href="http://www.sfml-dev.org/tutorials/">www.sfml-dev.org</a>.
|
/// at <a href="http://www.sfml-dev.org/">www.sfml-dev.org</a>.
|
||||||
///
|
///
|
||||||
/// \section example Short example
|
/// \section example Short example
|
||||||
/// Here is a short example, to show you how simple it is to use SFML in C :
|
/// Here is a short example, to show you how simple it is to use SFML in C :
|
||||||
@@ -33,7 +32,7 @@
|
|||||||
/// return EXIT_FAILURE;
|
/// return EXIT_FAILURE;
|
||||||
///
|
///
|
||||||
/// /* Load a sprite to display */
|
/// /* Load a sprite to display */
|
||||||
/// texture = sfTexture_createFromFile("cute_image.jpg");
|
/// texture = sfTexture_createFromFile("cute_image.jpg", NULL);
|
||||||
/// if (!texture)
|
/// if (!texture)
|
||||||
/// return EXIT_FAILURE;
|
/// return EXIT_FAILURE;
|
||||||
/// sprite = sfSprite_create();
|
/// sprite = sfSprite_create();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -71,25 +71,50 @@ CSFML_AUDIO_API void sfListener_setPosition(sfVector3f position);
|
|||||||
CSFML_AUDIO_API sfVector3f sfListener_getPosition();
|
CSFML_AUDIO_API sfVector3f sfListener_getPosition();
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set the orientation of the listener in the scene
|
/// \brief Set the orientation of the forward vector in the scene
|
||||||
///
|
///
|
||||||
/// The orientation defines the 3D axes of the listener
|
/// The direction (also called "at vector") is the vector
|
||||||
/// (left, up, front) in the scene. The orientation vector
|
/// pointing forward from the listener's perspective. Together
|
||||||
/// doesn't have to be normalized.
|
/// with the up vector, it defines the 3D orientation of the
|
||||||
/// The default listener's orientation is (0, 0, -1).
|
/// listener in the scene. The direction vector doesn't
|
||||||
|
/// have to be normalized.
|
||||||
|
/// The default listener's direction is (0, 0, -1).
|
||||||
///
|
///
|
||||||
/// \param position New direction of the listener
|
/// \param direction New listener's direction
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API void sfListener_setDirection(sfVector3f orientation);
|
CSFML_AUDIO_API void sfListener_setDirection(sfVector3f direction);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the current orientation of the listener in the scene
|
/// \brief Get the current forward vector of the listener in the scene
|
||||||
///
|
///
|
||||||
/// \return The listener's direction
|
/// \return Listener's forward vector (not normalized)
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API sfVector3f sfListener_getDirection();
|
CSFML_AUDIO_API sfVector3f sfListener_getDirection();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Set the upward vector of the listener in the scene
|
||||||
|
///
|
||||||
|
/// The up vector is the vector that points upward from the
|
||||||
|
/// listener's perspective. Together with the direction, it
|
||||||
|
/// defines the 3D orientation of the listener in the scene.
|
||||||
|
/// The up vector doesn't have to be normalized.
|
||||||
|
/// The default listener's up vector is (0, 1, 0). It is usually
|
||||||
|
/// not necessary to change it, especially in 2D scenarios.
|
||||||
|
///
|
||||||
|
/// \param upVector New listener's up vector
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_AUDIO_API void sfListener_setUpVector(sfVector3f upVector);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get the current upward vector of the listener in the scene
|
||||||
|
///
|
||||||
|
/// \return Listener's upward vector (not normalized)
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_AUDIO_API sfVector3f sfListener_getUpVector();
|
||||||
|
|
||||||
|
|
||||||
#endif // SFML_LISTENER_H
|
#endif // SFML_LISTENER_H
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -158,7 +158,7 @@ CSFML_AUDIO_API void sfMusic_pause(sfMusic* music);
|
|||||||
///
|
///
|
||||||
/// This function stops the music if it was playing or paused,
|
/// This function stops the music if it was playing or paused,
|
||||||
/// and does nothing if it was already stopped.
|
/// and does nothing if it was already stopped.
|
||||||
/// It also resets the playing position (unlike sfMusic_Pause).
|
/// It also resets the playing position (unlike sfMusic_pause).
|
||||||
///
|
///
|
||||||
/// \param music Music object
|
/// \param music Music object
|
||||||
///
|
///
|
||||||
@@ -306,10 +306,10 @@ CSFML_AUDIO_API void sfMusic_setAttenuation(sfMusic* music, float attenuation);
|
|||||||
/// either paused or playing.
|
/// either paused or playing.
|
||||||
///
|
///
|
||||||
/// \param music Music object
|
/// \param music Music object
|
||||||
/// \param timeOffset New playing position, in milliseconds
|
/// \param timeOffset New playing position
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API void sfMusic_setPlayingOffset(sfMusic* music, sfUint32 timeOffset);
|
CSFML_AUDIO_API void sfMusic_setPlayingOffset(sfMusic* music, sfTime timeOffset);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the pitch of a music
|
/// \brief Get the pitch of a music
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -51,7 +51,7 @@ CSFML_AUDIO_API sfSound* sfSound_create(void);
|
|||||||
/// \return A new sfSound object which is a copy of \a sound
|
/// \return A new sfSound object which is a copy of \a sound
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API sfSound* sfSound_copy(sfSound* sound);
|
CSFML_AUDIO_API sfSound* sfSound_copy(const sfSound* sound);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Destroy a sound
|
/// \brief Destroy a sound
|
||||||
@@ -136,7 +136,7 @@ CSFML_AUDIO_API const sfSoundBuffer* sfSound_getBuffer(const sfSound* sound);
|
|||||||
CSFML_AUDIO_API void sfSound_setLoop(sfSound* sound, sfBool loop);
|
CSFML_AUDIO_API void sfSound_setLoop(sfSound* sound, sfBool loop);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Tell whether or not a soud is in loop mode
|
/// \brief Tell whether or not a sound is in loop mode
|
||||||
///
|
///
|
||||||
/// \param sound Sound object
|
/// \param sound Sound object
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -102,7 +102,7 @@ CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromSamples(const sfInt16* sa
|
|||||||
/// \return A new sfSoundBuffer object which is a copy of \a soundBuffer
|
/// \return A new sfSoundBuffer object which is a copy of \a soundBuffer
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_copy(sfSoundBuffer* soundBuffer);
|
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_copy(const sfSoundBuffer* soundBuffer);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Destroy a sound buffer
|
/// \brief Destroy a sound buffer
|
||||||
@@ -132,7 +132,7 @@ CSFML_AUDIO_API sfBool sfSoundBuffer_saveToFile(const sfSoundBuffer* soundBuffer
|
|||||||
///
|
///
|
||||||
/// The format of the returned samples is 16 bits signed integer
|
/// The format of the returned samples is 16 bits signed integer
|
||||||
/// (sfInt16). The total number of samples in this array
|
/// (sfInt16). The total number of samples in this array
|
||||||
/// is given by the sfSoundBuffer_GetSampleCount function.
|
/// is given by the sfSoundBuffer_getSampleCount function.
|
||||||
///
|
///
|
||||||
/// \param soundBuffer Sound buffer object
|
/// \param soundBuffer Sound buffer object
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -30,6 +30,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
#include <SFML/Audio/Export.h>
|
#include <SFML/Audio/Export.h>
|
||||||
#include <SFML/Audio/Types.h>
|
#include <SFML/Audio/Types.h>
|
||||||
|
#include <SFML/System/Time.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
|
||||||
@@ -75,8 +76,10 @@ CSFML_AUDIO_API void sfSoundRecorder_destroy(sfSoundRecorder* soundRecorder);
|
|||||||
/// \param soundRecorder Sound recorder object
|
/// \param soundRecorder Sound recorder object
|
||||||
/// \param sampleRate Desired capture rate, in number of samples per second
|
/// \param sampleRate Desired capture rate, in number of samples per second
|
||||||
///
|
///
|
||||||
|
/// \return True, if start of capture was successful
|
||||||
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API void sfSoundRecorder_start(sfSoundRecorder* soundRecorder, unsigned int sampleRate);
|
CSFML_AUDIO_API sfBool sfSoundRecorder_start(sfSoundRecorder* soundRecorder, unsigned int sampleRate);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Stop the capture of a sound recorder
|
/// \brief Stop the capture of a sound recorder
|
||||||
@@ -112,5 +115,75 @@ CSFML_AUDIO_API unsigned int sfSoundRecorder_getSampleRate(const sfSoundRecorder
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API sfBool sfSoundRecorder_isAvailable(void);
|
CSFML_AUDIO_API sfBool sfSoundRecorder_isAvailable(void);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Set the processing interval
|
||||||
|
///
|
||||||
|
/// The processing interval controls the period
|
||||||
|
/// between calls to the onProcessSamples function. You may
|
||||||
|
/// want to use a small interval if you want to process the
|
||||||
|
/// recorded data in real time, for example.
|
||||||
|
///
|
||||||
|
/// Note: this is only a hint, the actual period may vary.
|
||||||
|
/// So don't rely on this parameter to implement precise timing.
|
||||||
|
///
|
||||||
|
/// The default processing interval is 100 ms.
|
||||||
|
///
|
||||||
|
/// \param soundRecorder Sound recorder object
|
||||||
|
/// \param interval Processing interval
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_AUDIO_API void sfSoundRecorder_setProcessingInterval(sfSoundRecorder* soundRecorder, sfTime interval);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get a list of the names of all availabe audio capture devices
|
||||||
|
///
|
||||||
|
/// This function returns an array of strings (null terminated),
|
||||||
|
/// containing the names of all availabe audio capture devices.
|
||||||
|
/// If no devices are available then NULL is returned.
|
||||||
|
///
|
||||||
|
/// \param count Pointer to a variable that will be filled with the number of modes in the array
|
||||||
|
///
|
||||||
|
/// \return An array of strings containing the names
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_AUDIO_API const char** sfSoundRecorder_getAvailableDevices(size_t* count);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get the name of the default audio capture device
|
||||||
|
///
|
||||||
|
/// This function returns the name of the default audio
|
||||||
|
/// capture device. If none is available, NULL is returned.
|
||||||
|
///
|
||||||
|
/// \return The name of the default audio capture device (null terminated)
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_AUDIO_API const char* sfSoundRecorder_getDefaultDevice();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Set the audio capture device
|
||||||
|
///
|
||||||
|
/// This function sets the audio capture device to the device
|
||||||
|
/// with the given name. It can be called on the fly (i.e:
|
||||||
|
/// while recording). If you do so while recording and
|
||||||
|
/// opening the device fails, it stops the recording.
|
||||||
|
///
|
||||||
|
/// \param soundRecorder Sound recorder object
|
||||||
|
/// \param The name of the audio capture device
|
||||||
|
///
|
||||||
|
/// \return sfTrue, if it was able to set the requested device
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_AUDIO_API sfBool sfSoundRecorder_setDevice(sfSoundRecorder* soundRecorder, const char* name);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get the name of the current audio capture device
|
||||||
|
///
|
||||||
|
/// \param soundRecorder Sound recorder object
|
||||||
|
///
|
||||||
|
/// \return The name of the current audio capture device
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_AUDIO_API const char* sfSoundRecorder_getDevice(sfSoundRecorder* soundRecorder);
|
||||||
|
|
||||||
|
|
||||||
#endif // SFML_SOUNDRECORDER_H
|
#endif // SFML_SOUNDRECORDER_H
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -61,7 +61,7 @@ typedef void (*sfSoundStreamSeekCallback)(sfTime, void*); ///<
|
|||||||
/// \return A new sfSoundStream object
|
/// \return A new sfSoundStream object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API sfSoundStream* sfSoundStream_Create(sfSoundStreamGetDataCallback onGetData,
|
CSFML_AUDIO_API sfSoundStream* sfSoundStream_create(sfSoundStreamGetDataCallback onGetData,
|
||||||
sfSoundStreamSeekCallback onSeek,
|
sfSoundStreamSeekCallback onSeek,
|
||||||
unsigned int channelCount,
|
unsigned int channelCount,
|
||||||
unsigned int sampleRate,
|
unsigned int sampleRate,
|
||||||
@@ -73,7 +73,7 @@ CSFML_AUDIO_API sfSoundStream* sfSoundStream_Create(sfSoundStreamGetDataCallback
|
|||||||
/// \param soundStream Sound stream to destroy
|
/// \param soundStream Sound stream to destroy
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API void sfSoundStream_Destroy(sfSoundStream* soundStream);
|
CSFML_AUDIO_API void sfSoundStream_destroy(sfSoundStream* soundStream);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Start or resume playing a sound stream
|
/// \brief Start or resume playing a sound stream
|
||||||
@@ -87,7 +87,7 @@ CSFML_AUDIO_API void sfSoundStream_Destroy(sfSoundStream* soundStream);
|
|||||||
/// \param soundStream Sound stream object
|
/// \param soundStream Sound stream object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API void sfSoundStream_Play(sfSoundStream* soundStream);
|
CSFML_AUDIO_API void sfSoundStream_play(sfSoundStream* soundStream);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Pause a sound stream
|
/// \brief Pause a sound stream
|
||||||
@@ -98,19 +98,19 @@ CSFML_AUDIO_API void sfSoundStream_Play(sfSoundStream* soundStream);
|
|||||||
/// \param soundStream Sound stream object
|
/// \param soundStream Sound stream object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API void sfSoundStream_Pause(sfSoundStream* soundStream);
|
CSFML_AUDIO_API void sfSoundStream_pause(sfSoundStream* soundStream);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Stop playing a sound stream
|
/// \brief Stop playing a sound stream
|
||||||
///
|
///
|
||||||
/// This function stops the stream if it was playing or paused,
|
/// This function stops the stream if it was playing or paused,
|
||||||
/// and does nothing if it was already stopped.
|
/// and does nothing if it was already stopped.
|
||||||
/// It also resets the playing position (unlike sfSoundStream_Pause).
|
/// It also resets the playing position (unlike sfSoundStream_pause).
|
||||||
///
|
///
|
||||||
/// \param soundStream Sound stream object
|
/// \param soundStream Sound stream object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API void sfSoundStream_Stop(sfSoundStream* soundStream);
|
CSFML_AUDIO_API void sfSoundStream_stop(sfSoundStream* soundStream);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the current status of a sound stream (stopped, paused, playing)
|
/// \brief Get the current status of a sound stream (stopped, paused, playing)
|
||||||
@@ -120,7 +120,7 @@ CSFML_AUDIO_API void sfSoundStream_Stop(sfSoundStream* soundStream);
|
|||||||
/// \return Current status
|
/// \return Current status
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API sfSoundStatus sfSoundStream_GetStatus(const sfSoundStream* soundStream);
|
CSFML_AUDIO_API sfSoundStatus sfSoundStream_getStatus(const sfSoundStream* soundStream);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Return the number of channels of a sound stream
|
/// \brief Return the number of channels of a sound stream
|
||||||
@@ -132,7 +132,7 @@ CSFML_AUDIO_API sfSoundStatus sfSoundStream_GetStatus(const sfSoundStream* sound
|
|||||||
/// \return Number of channels
|
/// \return Number of channels
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API unsigned int sfSoundStream_GetChannelCount(const sfSoundStream* soundStream);
|
CSFML_AUDIO_API unsigned int sfSoundStream_getChannelCount(const sfSoundStream* soundStream);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the sample rate of a sound stream
|
/// \brief Get the sample rate of a sound stream
|
||||||
@@ -145,7 +145,7 @@ CSFML_AUDIO_API unsigned int sfSoundStream_GetChannelCount(const sfSoundStream*
|
|||||||
/// \return Sample rate, in number of samples per second
|
/// \return Sample rate, in number of samples per second
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API unsigned int sfSoundStream_GetSampleRate(const sfSoundStream* soundStream);
|
CSFML_AUDIO_API unsigned int sfSoundStream_getSampleRate(const sfSoundStream* soundStream);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set the pitch of a sound stream
|
/// \brief Set the pitch of a sound stream
|
||||||
@@ -160,7 +160,7 @@ CSFML_AUDIO_API unsigned int sfSoundStream_GetSampleRate(const sfSoundStream* so
|
|||||||
/// \param pitch New pitch to apply to the stream
|
/// \param pitch New pitch to apply to the stream
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API void sfSoundStream_SetPitch(sfSoundStream* soundStream, float pitch);
|
CSFML_AUDIO_API void sfSoundStream_setPitch(sfSoundStream* soundStream, float pitch);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set the volume of a sound stream
|
/// \brief Set the volume of a sound stream
|
||||||
@@ -172,7 +172,7 @@ CSFML_AUDIO_API void sfSoundStream_SetPitch(sfSoundStream* soundStream, float pi
|
|||||||
/// \param volume Volume of the stream
|
/// \param volume Volume of the stream
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API void sfSoundStream_SetVolume(sfSoundStream* soundStream, float volume);
|
CSFML_AUDIO_API void sfSoundStream_setVolume(sfSoundStream* soundStream, float volume);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set the 3D position of a sound stream in the audio scene
|
/// \brief Set the 3D position of a sound stream in the audio scene
|
||||||
@@ -185,7 +185,7 @@ CSFML_AUDIO_API void sfSoundStream_SetVolume(sfSoundStream* soundStream, float v
|
|||||||
/// \param position Position of the stream in the scene
|
/// \param position Position of the stream in the scene
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API void sfSoundStream_SetPosition(sfSoundStream* soundStream, sfVector3f position);
|
CSFML_AUDIO_API void sfSoundStream_setPosition(sfSoundStream* soundStream, sfVector3f position);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Make a sound stream's position relative to the listener or absolute
|
/// \brief Make a sound stream's position relative to the listener or absolute
|
||||||
@@ -200,7 +200,7 @@ CSFML_AUDIO_API void sfSoundStream_SetPosition(sfSoundStream* soundStream, sfVec
|
|||||||
/// \param relative sfTrue to set the position relative, sfFalse to set it absolute
|
/// \param relative sfTrue to set the position relative, sfFalse to set it absolute
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API void sfSoundStream_SetRelativeToListener(sfSoundStream* soundStream, sfBool relative);
|
CSFML_AUDIO_API void sfSoundStream_setRelativeToListener(sfSoundStream* soundStream, sfBool relative);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set the minimum distance of a sound stream
|
/// \brief Set the minimum distance of a sound stream
|
||||||
@@ -216,7 +216,7 @@ CSFML_AUDIO_API void sfSoundStream_SetRelativeToListener(sfSoundStream* soundStr
|
|||||||
/// \param distance New minimum distance of the stream
|
/// \param distance New minimum distance of the stream
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API void sfSoundStream_SetMinDistance(sfSoundStream* soundStream, float distance);
|
CSFML_AUDIO_API void sfSoundStream_setMinDistance(sfSoundStream* soundStream, float distance);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set the attenuation factor of a sound stream
|
/// \brief Set the attenuation factor of a sound stream
|
||||||
@@ -234,7 +234,7 @@ CSFML_AUDIO_API void sfSoundStream_SetMinDistance(sfSoundStream* soundStream, fl
|
|||||||
/// \param attenuation New attenuation factor of the stream
|
/// \param attenuation New attenuation factor of the stream
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API void sfSoundStream_SetAttenuation(sfSoundStream* soundStream, float attenuation);
|
CSFML_AUDIO_API void sfSoundStream_setAttenuation(sfSoundStream* soundStream, float attenuation);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Change the current playing position of a sound stream
|
/// \brief Change the current playing position of a sound stream
|
||||||
@@ -246,21 +246,21 @@ CSFML_AUDIO_API void sfSoundStream_SetAttenuation(sfSoundStream* soundStream, fl
|
|||||||
/// \param timeOffset New playing position
|
/// \param timeOffset New playing position
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API void sfSoundStream_SetPlayingOffset(sfSoundStream* soundStream, sfTime timeOffset);
|
CSFML_AUDIO_API void sfSoundStream_setPlayingOffset(sfSoundStream* soundStream, sfTime timeOffset);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set whether or not a sound stream should loop after reaching the end
|
/// \brief Set whether or not a sound stream should loop after reaching the end
|
||||||
///
|
///
|
||||||
/// If set, the stream will restart from beginning after
|
/// If set, the stream will restart from beginning after
|
||||||
/// reaching the end and so on, until it is stopped or
|
/// reaching the end and so on, until it is stopped or
|
||||||
/// sfSoundStream_SetLoop(stream, sfFalse) is called.
|
/// sfSoundStream_setLoop(stream, sfFalse) is called.
|
||||||
/// The default looping state for sound streams is false.
|
/// The default looping state for sound streams is false.
|
||||||
///
|
///
|
||||||
/// \param soundStream Sound stream object
|
/// \param soundStream Sound stream object
|
||||||
/// \param loop sfTrue to play in loop, sfFalse to play once
|
/// \param loop sfTrue to play in loop, sfFalse to play once
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API void sfSoundStream_SetLoop(sfSoundStream* soundStream, sfBool loop);
|
CSFML_AUDIO_API void sfSoundStream_setLoop(sfSoundStream* soundStream, sfBool loop);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the pitch of a sound stream
|
/// \brief Get the pitch of a sound stream
|
||||||
@@ -270,7 +270,7 @@ CSFML_AUDIO_API void sfSoundStream_SetLoop(sfSoundStream* soundStream, sfBool lo
|
|||||||
/// \return Pitch of the stream
|
/// \return Pitch of the stream
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API float sfSoundStream_GetPitch(const sfSoundStream* soundStream);
|
CSFML_AUDIO_API float sfSoundStream_getPitch(const sfSoundStream* soundStream);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the volume of a sound stream
|
/// \brief Get the volume of a sound stream
|
||||||
@@ -280,7 +280,7 @@ CSFML_AUDIO_API float sfSoundStream_GetPitch(const sfSoundStream* soundStream);
|
|||||||
/// \return Volume of the stream, in the range [0, 100]
|
/// \return Volume of the stream, in the range [0, 100]
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API float sfSoundStream_GetVolume(const sfSoundStream* soundStream);
|
CSFML_AUDIO_API float sfSoundStream_getVolume(const sfSoundStream* soundStream);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the 3D position of a sound stream in the audio scene
|
/// \brief Get the 3D position of a sound stream in the audio scene
|
||||||
@@ -290,7 +290,7 @@ CSFML_AUDIO_API float sfSoundStream_GetVolume(const sfSoundStream* soundStream);
|
|||||||
/// \return Position of the stream in the world
|
/// \return Position of the stream in the world
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API sfVector3f sfSoundStream_GetPosition(const sfSoundStream* soundStream);
|
CSFML_AUDIO_API sfVector3f sfSoundStream_getPosition(const sfSoundStream* soundStream);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Tell whether a sound stream's position is relative to the
|
/// \brief Tell whether a sound stream's position is relative to the
|
||||||
@@ -301,7 +301,7 @@ CSFML_AUDIO_API sfVector3f sfSoundStream_GetPosition(const sfSoundStream* soundS
|
|||||||
/// \return sfTrue if the position is relative, sfFalse if it's absolute
|
/// \return sfTrue if the position is relative, sfFalse if it's absolute
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API sfBool sfSoundStream_IsRelativeToListener(const sfSoundStream* soundStream);
|
CSFML_AUDIO_API sfBool sfSoundStream_isRelativeToListener(const sfSoundStream* soundStream);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the minimum distance of a sound stream
|
/// \brief Get the minimum distance of a sound stream
|
||||||
@@ -311,7 +311,7 @@ CSFML_AUDIO_API sfBool sfSoundStream_IsRelativeToListener(const sfSoundStream* s
|
|||||||
/// \return Minimum distance of the stream
|
/// \return Minimum distance of the stream
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API float sfSoundStream_GetMinDistance(const sfSoundStream* soundStream);
|
CSFML_AUDIO_API float sfSoundStream_getMinDistance(const sfSoundStream* soundStream);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the attenuation factor of a sound stream
|
/// \brief Get the attenuation factor of a sound stream
|
||||||
@@ -321,7 +321,7 @@ CSFML_AUDIO_API float sfSoundStream_GetMinDistance(const sfSoundStream* soundStr
|
|||||||
/// \return Attenuation factor of the stream
|
/// \return Attenuation factor of the stream
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API float sfSoundStream_GetAttenuation(const sfSoundStream* soundStream);
|
CSFML_AUDIO_API float sfSoundStream_getAttenuation(const sfSoundStream* soundStream);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Tell whether or not a sound stream is in loop mode
|
/// \brief Tell whether or not a sound stream is in loop mode
|
||||||
@@ -331,7 +331,7 @@ CSFML_AUDIO_API float sfSoundStream_GetAttenuation(const sfSoundStream* soundStr
|
|||||||
/// \return sfTrue if the music is looping, sfFalse otherwise
|
/// \return sfTrue if the music is looping, sfFalse otherwise
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API sfBool sfSoundStream_GetLoop(const sfSoundStream* soundStream);
|
CSFML_AUDIO_API sfBool sfSoundStream_getLoop(const sfSoundStream* soundStream);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the current playing position of a sound stream
|
/// \brief Get the current playing position of a sound stream
|
||||||
@@ -341,7 +341,7 @@ CSFML_AUDIO_API sfBool sfSoundStream_GetLoop(const sfSoundStream* soundStream);
|
|||||||
/// \return Current playing position
|
/// \return Current playing position
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API sfTime sfSoundStream_GetPlayingOffset(const sfSoundStream* soundStream);
|
CSFML_AUDIO_API sfTime sfSoundStream_getPlayingOffset(const sfSoundStream* soundStream);
|
||||||
|
|
||||||
|
|
||||||
#endif // SFML_SOUNDSTREAM_H
|
#endif // SFML_SOUNDSTREAM_H
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)//
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
//
|
//
|
||||||
|
|||||||
+16
-5
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -30,7 +30,18 @@
|
|||||||
// Define the CSFML version
|
// Define the CSFML version
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
#define CSFML_VERSION_MAJOR 2
|
#define CSFML_VERSION_MAJOR 2
|
||||||
#define CSFML_VERSION_MINOR 0
|
#define CSFML_VERSION_MINOR 2
|
||||||
|
#define CSFML_VERSION_PATCH 0
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
// Check if we need to mark functions as extern "C"
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define CSFML_EXTERN_C extern "C"
|
||||||
|
#else
|
||||||
|
#define CSFML_EXTERN_C extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
@@ -71,7 +82,7 @@
|
|||||||
|
|
||||||
// Windows compilers need specific (and different) keywords for export and import
|
// Windows compilers need specific (and different) keywords for export and import
|
||||||
#define CSFML_API_EXPORT extern "C" __declspec(dllexport)
|
#define CSFML_API_EXPORT extern "C" __declspec(dllexport)
|
||||||
#define CSFML_API_IMPORT extern __declspec(dllimport)
|
#define CSFML_API_IMPORT CSFML_EXTERN_C __declspec(dllimport)
|
||||||
|
|
||||||
// For Visual C++ compilers, we also need to turn off this annoying C4251 warning
|
// For Visual C++ compilers, we also need to turn off this annoying C4251 warning
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
@@ -87,13 +98,13 @@
|
|||||||
// GCC 4 has special keywords for showing/hidding symbols,
|
// GCC 4 has special keywords for showing/hidding symbols,
|
||||||
// the same keyword is used for both importing and exporting
|
// the same keyword is used for both importing and exporting
|
||||||
#define CSFML_API_EXPORT extern "C" __attribute__ ((__visibility__ ("default")))
|
#define CSFML_API_EXPORT extern "C" __attribute__ ((__visibility__ ("default")))
|
||||||
#define CSFML_API_IMPORT extern __attribute__ ((__visibility__ ("default")))
|
#define CSFML_API_IMPORT CSFML_EXTERN_C __attribute__ ((__visibility__ ("default")))
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
// GCC < 4 has no mechanism to explicitely hide symbols, everything's exported
|
// GCC < 4 has no mechanism to explicitely hide symbols, everything's exported
|
||||||
#define CSFML_API_EXPORT extern "C"
|
#define CSFML_API_EXPORT extern "C"
|
||||||
#define CSFML_API_IMPORT extern
|
#define CSFML_API_IMPORT CSFML_EXTERN_C
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -45,6 +45,7 @@
|
|||||||
#include <SFML/Graphics/RenderTexture.h>
|
#include <SFML/Graphics/RenderTexture.h>
|
||||||
#include <SFML/Graphics/Shader.h>
|
#include <SFML/Graphics/Shader.h>
|
||||||
#include <SFML/Graphics/Shape.h>
|
#include <SFML/Graphics/Shape.h>
|
||||||
|
#include <SFML/Graphics/Sprite.h>
|
||||||
#include <SFML/Graphics/Text.h>
|
#include <SFML/Graphics/Text.h>
|
||||||
#include <SFML/Graphics/Texture.h>
|
#include <SFML/Graphics/Texture.h>
|
||||||
#include <SFML/Graphics/Transform.h>
|
#include <SFML/Graphics/Transform.h>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -32,16 +32,54 @@
|
|||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Available blending modes for drawing
|
/// \brief Enumeration of the blending factors
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
sfBlendAlpha, ///< Pixel = Src * a + Dest * (1 - a)
|
sfBlendFactorZero, ///< (0, 0, 0, 0)
|
||||||
sfBlendAdd, ///< Pixel = Src + Dest
|
sfBlendFactorOne, ///< (1, 1, 1, 1)
|
||||||
sfBlendMultiply, ///< Pixel = Src * Dest
|
sfBlendFactorSrcColor, ///< (src.r, src.g, src.b, src.a)
|
||||||
sfBlendNone ///< No blending
|
sfBlendFactorOneMinusSrcColor, ///< (1, 1, 1, 1) - (src.r, src.g, src.b, src.a)
|
||||||
|
sfBlendFactorDstColor, ///< (dst.r, dst.g, dst.b, dst.a)
|
||||||
|
sfBlendFactorOneMinusDstColor, ///< (1, 1, 1, 1) - (dst.r, dst.g, dst.b, dst.a)
|
||||||
|
sfBlendFactorSrcAlpha, ///< (src.a, src.a, src.a, src.a)
|
||||||
|
sfBlendFactorOneMinusSrcAlpha, ///< (1, 1, 1, 1) - (src.a, src.a, src.a, src.a)
|
||||||
|
sfBlendFactorDstAlpha, ///< (dst.a, dst.a, dst.a, dst.a)
|
||||||
|
sfBlendFactorOneMinusDstAlpha ///< (1, 1, 1, 1) - (dst.a, dst.a, dst.a, dst.a)
|
||||||
|
} sfBlendFactor;
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Enumeration of the blending equations
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sfBlendEquationAdd, ///< Pixel = Src * SrcFactor + Dst * DstFactor
|
||||||
|
sfBlendEquationSubtract ///< Pixel = Src * SrcFactor - Dst * DstFactor
|
||||||
|
} sfBlendEquation;
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Blending mode for drawing
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sfBlendFactor colorSrcFactor; ///< Source blending factor for the color channels
|
||||||
|
sfBlendFactor colorDstFactor; ///< Destination blending factor for the color channels
|
||||||
|
sfBlendEquation colorEquation; ///< Blending equation for the color channels
|
||||||
|
sfBlendFactor alphaSrcFactor; ///< Source blending factor for the alpha channel
|
||||||
|
sfBlendFactor alphaDstFactor; ///< Destination blending factor for the alpha channel
|
||||||
|
sfBlendEquation alphaEquation; ///< Blending equation for the alpha channel
|
||||||
} sfBlendMode;
|
} sfBlendMode;
|
||||||
|
|
||||||
|
|
||||||
|
CSFML_GRAPHICS_API const sfBlendMode sfBlendAlpha; ///< Blend source and dest according to dest alpha
|
||||||
|
CSFML_GRAPHICS_API const sfBlendMode sfBlendAdd; ///< Add source to dest
|
||||||
|
CSFML_GRAPHICS_API const sfBlendMode sfBlendMultiply; ///< Multiply source and dest
|
||||||
|
CSFML_GRAPHICS_API const sfBlendMode sfBlendNone; ///< Overwrite dest with source
|
||||||
|
|
||||||
|
|
||||||
#endif // SFML_BLENDMODE_H
|
#endif // SFML_BLENDMODE_H
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -31,6 +31,7 @@
|
|||||||
#include <SFML/Graphics/Export.h>
|
#include <SFML/Graphics/Export.h>
|
||||||
#include <SFML/Graphics/Color.h>
|
#include <SFML/Graphics/Color.h>
|
||||||
#include <SFML/Graphics/Rect.h>
|
#include <SFML/Graphics/Rect.h>
|
||||||
|
#include <SFML/Graphics/Transform.h>
|
||||||
#include <SFML/Graphics/Types.h>
|
#include <SFML/Graphics/Types.h>
|
||||||
#include <SFML/System/Vector2.h>
|
#include <SFML/System/Vector2.h>
|
||||||
|
|
||||||
@@ -51,7 +52,7 @@ CSFML_GRAPHICS_API sfCircleShape* sfCircleShape_create(void);
|
|||||||
/// \return Copied object
|
/// \return Copied object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfCircleShape* sfCircleShape_copy(sfCircleShape* shape);
|
CSFML_GRAPHICS_API sfCircleShape* sfCircleShape_copy(const sfCircleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Destroy an existing circle Shape
|
/// \brief Destroy an existing circle Shape
|
||||||
@@ -146,7 +147,7 @@ CSFML_GRAPHICS_API float sfCircleShape_getRotation(const sfCircleShape* shape);
|
|||||||
/// \return Current scale factors
|
/// \return Current scale factors
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfVector2f sfCircleShape_GetScale(const sfCircleShape* shape);
|
CSFML_GRAPHICS_API sfVector2f sfCircleShape_getScale(const sfCircleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the local origin of a circle shape
|
/// \brief Get the local origin of a circle shape
|
||||||
@@ -156,7 +157,7 @@ CSFML_GRAPHICS_API sfVector2f sfCircleShape_GetScale(const sfCircleShape* shape)
|
|||||||
/// \return Current origin
|
/// \return Current origin
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfVector2f sfCircleShape_GetOrigin(const sfCircleShape* shape);
|
CSFML_GRAPHICS_API sfVector2f sfCircleShape_getOrigin(const sfCircleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Move a circle shape by a given offset
|
/// \brief Move a circle shape by a given offset
|
||||||
@@ -202,7 +203,7 @@ CSFML_GRAPHICS_API void sfCircleShape_scale(sfCircleShape* shape, sfVector2f fac
|
|||||||
/// \return Transform combining the position/rotation/scale/origin of the object
|
/// \return Transform combining the position/rotation/scale/origin of the object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API const sfTransform* sfCircleShape_getTransform(const sfCircleShape* shape);
|
CSFML_GRAPHICS_API sfTransform sfCircleShape_getTransform(const sfCircleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the inverse of the combined transform of a circle shape
|
/// \brief Get the inverse of the combined transform of a circle shape
|
||||||
@@ -212,7 +213,7 @@ CSFML_GRAPHICS_API const sfTransform* sfCircleShape_getTransform(const sfCircleS
|
|||||||
/// \return Inverse of the combined transformations applied to the object
|
/// \return Inverse of the combined transformations applied to the object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API const sfTransform* sfCircleShape_getInverseTransform(const sfCircleShape* shape);
|
CSFML_GRAPHICS_API sfTransform sfCircleShape_getInverseTransform(const sfCircleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Change the source texture of a circle shape
|
/// \brief Change the source texture of a circle shape
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -31,6 +31,7 @@
|
|||||||
#include <SFML/Graphics/Export.h>
|
#include <SFML/Graphics/Export.h>
|
||||||
#include <SFML/Graphics/Color.h>
|
#include <SFML/Graphics/Color.h>
|
||||||
#include <SFML/Graphics/Rect.h>
|
#include <SFML/Graphics/Rect.h>
|
||||||
|
#include <SFML/Graphics/Transform.h>
|
||||||
#include <SFML/Graphics/Types.h>
|
#include <SFML/Graphics/Types.h>
|
||||||
#include <SFML/System/Vector2.h>
|
#include <SFML/System/Vector2.h>
|
||||||
|
|
||||||
@@ -51,7 +52,7 @@ CSFML_GRAPHICS_API sfConvexShape* sfConvexShape_create(void);
|
|||||||
/// \return Copied object
|
/// \return Copied object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfConvexShape* sfConvexShape_copy(sfConvexShape* shape);
|
CSFML_GRAPHICS_API sfConvexShape* sfConvexShape_copy(const sfConvexShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Destroy an existing convex Shape
|
/// \brief Destroy an existing convex Shape
|
||||||
@@ -202,7 +203,7 @@ CSFML_GRAPHICS_API void sfConvexShape_scale(sfConvexShape* shape, sfVector2f fac
|
|||||||
/// \return Transform combining the position/rotation/scale/origin of the object
|
/// \return Transform combining the position/rotation/scale/origin of the object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API const sfTransform* sfConvexShape_getTransform(const sfConvexShape* shape);
|
CSFML_GRAPHICS_API sfTransform sfConvexShape_getTransform(const sfConvexShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the inverse of the combined transform of a convex shape
|
/// \brief Get the inverse of the combined transform of a convex shape
|
||||||
@@ -212,7 +213,7 @@ CSFML_GRAPHICS_API const sfTransform* sfConvexShape_getTransform(const sfConvexS
|
|||||||
/// \return Inverse of the combined transformations applied to the object
|
/// \return Inverse of the combined transformations applied to the object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API const sfTransform* sfConvexShape_getInverseTransform(const sfConvexShape* shape);
|
CSFML_GRAPHICS_API sfTransform sfConvexShape_getInverseTransform(const sfConvexShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Change the source texture of a convex shape
|
/// \brief Change the source texture of a convex shape
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -29,6 +29,7 @@
|
|||||||
// Headers
|
// Headers
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
#include <SFML/Graphics/Export.h>
|
#include <SFML/Graphics/Export.h>
|
||||||
|
#include <SFML/Graphics/FontInfo.h>
|
||||||
#include <SFML/Graphics/Glyph.h>
|
#include <SFML/Graphics/Glyph.h>
|
||||||
#include <SFML/Graphics/Types.h>
|
#include <SFML/Graphics/Types.h>
|
||||||
#include <SFML/System/InputStream.h>
|
#include <SFML/System/InputStream.h>
|
||||||
@@ -74,7 +75,7 @@ CSFML_GRAPHICS_API sfFont* sfFont_createFromStream(sfInputStream* stream);
|
|||||||
/// \return Copied object
|
/// \return Copied object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfFont* sfFont_copy(sfFont* font);
|
CSFML_GRAPHICS_API sfFont* sfFont_copy(const sfFont* font);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Destroy an existing font
|
/// \brief Destroy an existing font
|
||||||
@@ -108,19 +109,45 @@ CSFML_GRAPHICS_API sfGlyph sfFont_getGlyph(sfFont* font, sfUint32 codePoint, uns
|
|||||||
/// \return Kerning offset, in pixels
|
/// \return Kerning offset, in pixels
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API int sfFont_getKerning(sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize);
|
CSFML_GRAPHICS_API float sfFont_getKerning(sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the line spacing value
|
/// \brief Get the line spacing value
|
||||||
///
|
///
|
||||||
/// \param font Source font
|
/// \param font Source font
|
||||||
/// \param codePoint Unicode code point of the character to get
|
|
||||||
/// \param characterSize Character size, in pixels
|
/// \param characterSize Character size, in pixels
|
||||||
///
|
///
|
||||||
/// \return Line spacing, in pixels
|
/// \return Line spacing, in pixels
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API int sfFont_getLineSpacing(sfFont* font, unsigned int characterSize);
|
CSFML_GRAPHICS_API float sfFont_getLineSpacing(sfFont* font, unsigned int characterSize);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get the position of the underline
|
||||||
|
///
|
||||||
|
/// Underline position is the vertical offset to apply between the
|
||||||
|
/// baseline and the underline.
|
||||||
|
///
|
||||||
|
/// \param font Source font
|
||||||
|
/// \param characterSize Reference character size
|
||||||
|
///
|
||||||
|
/// \return Underline position, in pixels
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API float sfFont_getUnderlinePosition(sfFont* font, unsigned int characterSize);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get the thickness of the underline
|
||||||
|
///
|
||||||
|
/// Underline thickness is the vertical size of the underline.
|
||||||
|
///
|
||||||
|
/// \param font Source font
|
||||||
|
/// \param characterSize Reference character size
|
||||||
|
///
|
||||||
|
/// \return Underline thickness, in pixels
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API float sfFont_getUnderlineThickness(sfFont* font, unsigned int characterSize);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the texture containing the glyphs of a given size in a font
|
/// \brief Get the texture containing the glyphs of a given size in a font
|
||||||
@@ -134,12 +161,18 @@ CSFML_GRAPHICS_API int sfFont_getLineSpacing(sfFont* font, unsigned int characte
|
|||||||
CSFML_GRAPHICS_API const sfTexture* sfFont_getTexture(sfFont* font, unsigned int characterSize);
|
CSFML_GRAPHICS_API const sfTexture* sfFont_getTexture(sfFont* font, unsigned int characterSize);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the built-in default font (Arial)
|
/// \brief Get the font information
|
||||||
///
|
///
|
||||||
/// \return Pointer to the default font
|
/// The returned structure will remain valid only if the font
|
||||||
|
/// is still valid. If the font is invalid an invalid structure
|
||||||
|
/// is returned.
|
||||||
|
///
|
||||||
|
/// \param font Source font
|
||||||
|
///
|
||||||
|
/// \return A structure that holds the font information
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API const sfFont* sfFont_getDefaultFont(void);
|
CSFML_GRAPHICS_API sfFontInfo sfFont_getInfo(const sfFont* font);
|
||||||
|
|
||||||
|
|
||||||
#endif // SFML_IMAGE_H
|
#endif // SFML_FONT_H
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -22,22 +22,21 @@
|
|||||||
//
|
//
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef SFML_TRANSFORMSTRUCT_H
|
#ifndef SFML_FONTINFO_H
|
||||||
#define SFML_TRANSFORMSTRUCT_H
|
#define SFML_FONTINFO_H
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
// Headers
|
// Headers
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
#include <SFML/Graphics/Transform.hpp>
|
#include <SFML/Graphics/Export.h>
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
// Internal structure of sfTransform
|
/// sfFontInfo holds various information about a font
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
struct sfTransform
|
typedef struct
|
||||||
{
|
{
|
||||||
sf::Transform This;
|
const char* family;
|
||||||
};
|
} sfFontInfo;
|
||||||
|
|
||||||
|
|
||||||
#endif // SFML_TRANSFORMSTRUCT_H
|
#endif // SFML_FONTINFO_H
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -37,9 +37,9 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
int advance; ///< Offset to move horizontically to the next character
|
float advance; ///< Offset to move horizontically to the next character
|
||||||
sfIntRect bounds; ///< Bounding rectangle of the glyph, in coordinates relative to the baseline
|
sfFloatRect bounds; ///< Bounding rectangle of the glyph, in coordinates relative to the baseline
|
||||||
sfIntRect textureRect; ///< Texture coordinates of the glyph inside the font's image
|
sfIntRect textureRect; ///< Texture coordinates of the glyph inside the font's image
|
||||||
} sfGlyph;
|
} sfGlyph;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -133,7 +133,7 @@ CSFML_GRAPHICS_API sfImage* sfImage_createFromStream(sfInputStream* stream);
|
|||||||
/// \return Copied object
|
/// \return Copied object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfImage* sfImage_copy(sfImage* image);
|
CSFML_GRAPHICS_API sfImage* sfImage_copy(const sfImage* image);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Destroy an existing image
|
/// \brief Destroy an existing image
|
||||||
@@ -181,7 +181,7 @@ CSFML_GRAPHICS_API sfVector2u sfImage_getSize(const sfImage* image);
|
|||||||
/// \param alpha Alpha value to assign to transparent pixels
|
/// \param alpha Alpha value to assign to transparent pixels
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfImage_createMaskFromColor(sfColor color, sfUint8 alpha);
|
CSFML_GRAPHICS_API void sfImage_createMaskFromColor(sfImage* image, sfColor color, sfUint8 alpha);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Copy pixels from an image onto another
|
/// \brief Copy pixels from an image onto another
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
/// \brief Types of primitives that a sf::VertexArray can render
|
/// \brief Types of primitives that a sf::VertexArray can render
|
||||||
///
|
///
|
||||||
/// Points and lines have no area, therefore their thickness
|
/// Points and lines have no area, therefore their thickness
|
||||||
/// will always be 1 pixel, regarldess the current transform
|
/// will always be 1 pixel, regardless the current transform
|
||||||
/// and view.
|
/// and view.
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -31,6 +31,7 @@
|
|||||||
#include <SFML/Graphics/Export.h>
|
#include <SFML/Graphics/Export.h>
|
||||||
#include <SFML/Graphics/Color.h>
|
#include <SFML/Graphics/Color.h>
|
||||||
#include <SFML/Graphics/Rect.h>
|
#include <SFML/Graphics/Rect.h>
|
||||||
|
#include <SFML/Graphics/Transform.h>
|
||||||
#include <SFML/Graphics/Types.h>
|
#include <SFML/Graphics/Types.h>
|
||||||
#include <SFML/System/Vector2.h>
|
#include <SFML/System/Vector2.h>
|
||||||
|
|
||||||
@@ -41,7 +42,7 @@
|
|||||||
/// \return A new sfRectangleShape object, or NULL if it failed
|
/// \return A new sfRectangleShape object, or NULL if it failed
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfRectangleShape* sfRectangleShape_Create(void);
|
CSFML_GRAPHICS_API sfRectangleShape* sfRectangleShape_create(void);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Copy an existing rectangle shape
|
/// \brief Copy an existing rectangle shape
|
||||||
@@ -51,7 +52,7 @@ CSFML_GRAPHICS_API sfRectangleShape* sfRectangleShape_Create(void);
|
|||||||
/// \return Copied object
|
/// \return Copied object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfRectangleShape* sfRectangleShape_Copy(sfRectangleShape* shape);
|
CSFML_GRAPHICS_API sfRectangleShape* sfRectangleShape_copy(const sfRectangleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Destroy an existing rectangle shape
|
/// \brief Destroy an existing rectangle shape
|
||||||
@@ -59,46 +60,46 @@ CSFML_GRAPHICS_API sfRectangleShape* sfRectangleShape_Copy(sfRectangleShape* sha
|
|||||||
/// \param Shape Shape to delete
|
/// \param Shape Shape to delete
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfRectangleShape_Destroy(sfRectangleShape* shape);
|
CSFML_GRAPHICS_API void sfRectangleShape_destroy(sfRectangleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set the position of a rectangle shape
|
/// \brief Set the position of a rectangle shape
|
||||||
///
|
///
|
||||||
/// This function completely overwrites the previous position.
|
/// This function completely overwrites the previous position.
|
||||||
/// See sfRectangleShape_Move to apply an offset based on the previous position instead.
|
/// See sfRectangleShape_move to apply an offset based on the previous position instead.
|
||||||
/// The default position of a circle Shape object is (0, 0).
|
/// The default position of a circle Shape object is (0, 0).
|
||||||
///
|
///
|
||||||
/// \param shape Shape object
|
/// \param shape Shape object
|
||||||
/// \param position New position
|
/// \param position New position
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfRectangleShape_SetPosition(sfRectangleShape* shape, sfVector2f position);
|
CSFML_GRAPHICS_API void sfRectangleShape_setPosition(sfRectangleShape* shape, sfVector2f position);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set the orientation of a rectangle shape
|
/// \brief Set the orientation of a rectangle shape
|
||||||
///
|
///
|
||||||
/// This function completely overwrites the previous rotation.
|
/// This function completely overwrites the previous rotation.
|
||||||
/// See sfRectangleShape_Rotate to add an angle based on the previous rotation instead.
|
/// See sfRectangleShape_rotate to add an angle based on the previous rotation instead.
|
||||||
/// The default rotation of a circle Shape object is 0.
|
/// The default rotation of a circle Shape object is 0.
|
||||||
///
|
///
|
||||||
/// \param shape Shape object
|
/// \param shape Shape object
|
||||||
/// \param angle New rotation, in degrees
|
/// \param angle New rotation, in degrees
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfRectangleShape_SetRotation(sfRectangleShape* shape, float angle);
|
CSFML_GRAPHICS_API void sfRectangleShape_setRotation(sfRectangleShape* shape, float angle);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set the scale factors of a rectangle shape
|
/// \brief Set the scale factors of a rectangle shape
|
||||||
///
|
///
|
||||||
/// This function completely overwrites the previous scale.
|
/// This function completely overwrites the previous scale.
|
||||||
/// See sfRectangleShape_Scale to add a factor based on the previous scale instead.
|
/// See sfRectangleShape_scale to add a factor based on the previous scale instead.
|
||||||
/// The default scale of a circle Shape object is (1, 1).
|
/// The default scale of a circle Shape object is (1, 1).
|
||||||
///
|
///
|
||||||
/// \param shape Shape object
|
/// \param shape Shape object
|
||||||
/// \param scale New scale factors
|
/// \param scale New scale factors
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfRectangleShape_SetScale(sfRectangleShape* shape, sfVector2f scale);
|
CSFML_GRAPHICS_API void sfRectangleShape_setScale(sfRectangleShape* shape, sfVector2f scale);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set the local origin of a rectangle shape
|
/// \brief Set the local origin of a rectangle shape
|
||||||
@@ -114,7 +115,7 @@ CSFML_GRAPHICS_API void sfRectangleShape_SetScale(sfRectangleShape* shape, sfVec
|
|||||||
/// \param origin New origin
|
/// \param origin New origin
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfRectangleShape_SetOrigin(sfRectangleShape* shape, sfVector2f origin);
|
CSFML_GRAPHICS_API void sfRectangleShape_setOrigin(sfRectangleShape* shape, sfVector2f origin);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the position of a rectangle shape
|
/// \brief Get the position of a rectangle shape
|
||||||
@@ -124,7 +125,7 @@ CSFML_GRAPHICS_API void sfRectangleShape_SetOrigin(sfRectangleShape* shape, sfVe
|
|||||||
/// \return Current position
|
/// \return Current position
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfVector2f sfRectangleShape_GetPosition(const sfRectangleShape* shape);
|
CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getPosition(const sfRectangleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the orientation of a rectangle shape
|
/// \brief Get the orientation of a rectangle shape
|
||||||
@@ -136,7 +137,7 @@ CSFML_GRAPHICS_API sfVector2f sfRectangleShape_GetPosition(const sfRectangleShap
|
|||||||
/// \return Current rotation, in degrees
|
/// \return Current rotation, in degrees
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API float sfRectangleShape_GetRotation(const sfRectangleShape* shape);
|
CSFML_GRAPHICS_API float sfRectangleShape_getRotation(const sfRectangleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the current scale of a rectangle shape
|
/// \brief Get the current scale of a rectangle shape
|
||||||
@@ -146,7 +147,7 @@ CSFML_GRAPHICS_API float sfRectangleShape_GetRotation(const sfRectangleShape* sh
|
|||||||
/// \return Current scale factors
|
/// \return Current scale factors
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfVector2f sfRectangleShape_GetScale(const sfRectangleShape* shape);
|
CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getScale(const sfRectangleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the local origin of a rectangle shape
|
/// \brief Get the local origin of a rectangle shape
|
||||||
@@ -156,43 +157,43 @@ CSFML_GRAPHICS_API sfVector2f sfRectangleShape_GetScale(const sfRectangleShape*
|
|||||||
/// \return Current origin
|
/// \return Current origin
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfVector2f sfRectangleShape_GetOrigin(const sfRectangleShape* shape);
|
CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getOrigin(const sfRectangleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Move a rectangle shape by a given offset
|
/// \brief Move a rectangle shape by a given offset
|
||||||
///
|
///
|
||||||
/// This function adds to the current position of the object,
|
/// This function adds to the current position of the object,
|
||||||
/// unlike sfRectangleShape_SetPosition which overwrites it.
|
/// unlike sfRectangleShape_setPosition which overwrites it.
|
||||||
///
|
///
|
||||||
/// \param shape Shape object
|
/// \param shape Shape object
|
||||||
/// \param offset Offset
|
/// \param offset Offset
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfRectangleShape_Move(sfRectangleShape* shape, sfVector2f offset);
|
CSFML_GRAPHICS_API void sfRectangleShape_move(sfRectangleShape* shape, sfVector2f offset);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Rotate a rectangle shape
|
/// \brief Rotate a rectangle shape
|
||||||
///
|
///
|
||||||
/// This function adds to the current rotation of the object,
|
/// This function adds to the current rotation of the object,
|
||||||
/// unlike sfRectangleShape_SetRotation which overwrites it.
|
/// unlike sfRectangleShape_setRotation which overwrites it.
|
||||||
///
|
///
|
||||||
/// \param shape Shape object
|
/// \param shape Shape object
|
||||||
/// \param angle Angle of rotation, in degrees
|
/// \param angle Angle of rotation, in degrees
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfRectangleShape_Rotate(sfRectangleShape* shape, float angle);
|
CSFML_GRAPHICS_API void sfRectangleShape_rotate(sfRectangleShape* shape, float angle);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Scale a rectangle shape
|
/// \brief Scale a rectangle shape
|
||||||
///
|
///
|
||||||
/// This function multiplies the current scale of the object,
|
/// This function multiplies the current scale of the object,
|
||||||
/// unlike sfRectangleShape_SetScale which overwrites it.
|
/// unlike sfRectangleShape_setScale which overwrites it.
|
||||||
///
|
///
|
||||||
/// \param shape Shape object
|
/// \param shape Shape object
|
||||||
/// \param factors Scale factors
|
/// \param factors Scale factors
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfRectangleShape_Scale(sfRectangleShape* shape, sfVector2f factors);
|
CSFML_GRAPHICS_API void sfRectangleShape_scale(sfRectangleShape* shape, sfVector2f factors);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the combined transform of a rectangle shape
|
/// \brief Get the combined transform of a rectangle shape
|
||||||
@@ -202,7 +203,7 @@ CSFML_GRAPHICS_API void sfRectangleShape_Scale(sfRectangleShape* shape, sfVector
|
|||||||
/// \return Transform combining the position/rotation/scale/origin of the object
|
/// \return Transform combining the position/rotation/scale/origin of the object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API const sfTransform* sfRectangleShape_GetTransform(const sfRectangleShape* shape);
|
CSFML_GRAPHICS_API sfTransform sfRectangleShape_getTransform(const sfRectangleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the inverse of the combined transform of a rectangle shape
|
/// \brief Get the inverse of the combined transform of a rectangle shape
|
||||||
@@ -212,7 +213,7 @@ CSFML_GRAPHICS_API const sfTransform* sfRectangleShape_GetTransform(const sfRect
|
|||||||
/// \return Inverse of the combined transformations applied to the object
|
/// \return Inverse of the combined transformations applied to the object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API const sfTransform* sfRectangleShape_GetInverseTransform(const sfRectangleShape* shape);
|
CSFML_GRAPHICS_API sfTransform sfRectangleShape_getInverseTransform(const sfRectangleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Change the source texture of a rectangle shape
|
/// \brief Change the source texture of a rectangle shape
|
||||||
@@ -233,7 +234,7 @@ CSFML_GRAPHICS_API const sfTransform* sfRectangleShape_GetInverseTransform(const
|
|||||||
/// \param resetRect Should the texture rect be reset to the size of the new texture?
|
/// \param resetRect Should the texture rect be reset to the size of the new texture?
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfRectangleShape_SetTexture(sfRectangleShape* shape, const sfTexture* texture, sfBool resetRect);
|
CSFML_GRAPHICS_API void sfRectangleShape_setTexture(sfRectangleShape* shape, const sfTexture* texture, sfBool resetRect);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set the sub-rectangle of the texture that a rectangle shape will display
|
/// \brief Set the sub-rectangle of the texture that a rectangle shape will display
|
||||||
@@ -246,7 +247,7 @@ CSFML_GRAPHICS_API void sfRectangleShape_SetTexture(sfRectangleShape* shape, con
|
|||||||
/// \param rect Rectangle defining the region of the texture to display
|
/// \param rect Rectangle defining the region of the texture to display
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfRectangleShape_SetTextureRect(sfRectangleShape* shape, sfIntRect rect);
|
CSFML_GRAPHICS_API void sfRectangleShape_setTextureRect(sfRectangleShape* shape, sfIntRect rect);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set the fill color of a rectangle shape
|
/// \brief Set the fill color of a rectangle shape
|
||||||
@@ -262,7 +263,7 @@ CSFML_GRAPHICS_API void sfRectangleShape_SetTextureRect(sfRectangleShape* shape,
|
|||||||
/// \param color New color of the shape
|
/// \param color New color of the shape
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfRectangleShape_SetFillColor(sfRectangleShape* shape, sfColor color);
|
CSFML_GRAPHICS_API void sfRectangleShape_setFillColor(sfRectangleShape* shape, sfColor color);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set the outline color of a rectangle shape
|
/// \brief Set the outline color of a rectangle shape
|
||||||
@@ -274,7 +275,7 @@ CSFML_GRAPHICS_API void sfRectangleShape_SetFillColor(sfRectangleShape* shape, s
|
|||||||
/// \param color New outline color of the shape
|
/// \param color New outline color of the shape
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfRectangleShape_SetOutlineColor(sfRectangleShape* shape, sfColor color);
|
CSFML_GRAPHICS_API void sfRectangleShape_setOutlineColor(sfRectangleShape* shape, sfColor color);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set the thickness of a rectangle shape's outline
|
/// \brief Set the thickness of a rectangle shape's outline
|
||||||
@@ -287,7 +288,7 @@ CSFML_GRAPHICS_API void sfRectangleShape_SetOutlineColor(sfRectangleShape* shape
|
|||||||
/// \param thickness New outline thickness
|
/// \param thickness New outline thickness
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfRectangleShape_SetOutlineThickness(sfRectangleShape* shape, float thickness);
|
CSFML_GRAPHICS_API void sfRectangleShape_setOutlineThickness(sfRectangleShape* shape, float thickness);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the source texture of a rectangle shape
|
/// \brief Get the source texture of a rectangle shape
|
||||||
@@ -301,7 +302,7 @@ CSFML_GRAPHICS_API void sfRectangleShape_SetOutlineThickness(sfRectangleShape* s
|
|||||||
/// \return Pointer to the shape's texture
|
/// \return Pointer to the shape's texture
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API const sfTexture* sfRectangleShape_GetTexture(const sfRectangleShape* shape);
|
CSFML_GRAPHICS_API const sfTexture* sfRectangleShape_getTexture(const sfRectangleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the sub-rectangle of the texture displayed by a rectangle shape
|
/// \brief Get the sub-rectangle of the texture displayed by a rectangle shape
|
||||||
@@ -311,7 +312,7 @@ CSFML_GRAPHICS_API const sfTexture* sfRectangleShape_GetTexture(const sfRectangl
|
|||||||
/// \return Texture rectangle of the shape
|
/// \return Texture rectangle of the shape
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfIntRect sfRectangleShape_GetTextureRect(const sfRectangleShape* shape);
|
CSFML_GRAPHICS_API sfIntRect sfRectangleShape_getTextureRect(const sfRectangleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the fill color of a rectangle shape
|
/// \brief Get the fill color of a rectangle shape
|
||||||
@@ -321,7 +322,7 @@ CSFML_GRAPHICS_API sfIntRect sfRectangleShape_GetTextureRect(const sfRectangleSh
|
|||||||
/// \return Fill color of the shape
|
/// \return Fill color of the shape
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfColor sfRectangleShape_GetFillColor(const sfRectangleShape* shape);
|
CSFML_GRAPHICS_API sfColor sfRectangleShape_getFillColor(const sfRectangleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the outline color of a rectangle shape
|
/// \brief Get the outline color of a rectangle shape
|
||||||
@@ -331,7 +332,7 @@ CSFML_GRAPHICS_API sfColor sfRectangleShape_GetFillColor(const sfRectangleShape*
|
|||||||
/// \return Outline color of the shape
|
/// \return Outline color of the shape
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfColor sfRectangleShape_GetOutlineColor(const sfRectangleShape* shape);
|
CSFML_GRAPHICS_API sfColor sfRectangleShape_getOutlineColor(const sfRectangleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the outline thickness of a rectangle shape
|
/// \brief Get the outline thickness of a rectangle shape
|
||||||
@@ -341,7 +342,7 @@ CSFML_GRAPHICS_API sfColor sfRectangleShape_GetOutlineColor(const sfRectangleSha
|
|||||||
/// \return Outline thickness of the shape
|
/// \return Outline thickness of the shape
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API float sfRectangleShape_GetOutlineThickness(const sfRectangleShape* shape);
|
CSFML_GRAPHICS_API float sfRectangleShape_getOutlineThickness(const sfRectangleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the total number of points of a rectangle shape
|
/// \brief Get the total number of points of a rectangle shape
|
||||||
@@ -351,7 +352,7 @@ CSFML_GRAPHICS_API float sfRectangleShape_GetOutlineThickness(const sfRectangleS
|
|||||||
/// \return Number of points of the shape
|
/// \return Number of points of the shape
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API unsigned int sfRectangleShape_GetPointCount(const sfRectangleShape* shape);
|
CSFML_GRAPHICS_API unsigned int sfRectangleShape_getPointCount(const sfRectangleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get a point of a rectangle shape
|
/// \brief Get a point of a rectangle shape
|
||||||
@@ -359,12 +360,12 @@ CSFML_GRAPHICS_API unsigned int sfRectangleShape_GetPointCount(const sfRectangle
|
|||||||
/// The result is undefined if \a index is out of the valid range.
|
/// The result is undefined if \a index is out of the valid range.
|
||||||
///
|
///
|
||||||
/// \param shape Shape object
|
/// \param shape Shape object
|
||||||
/// \param index Index of the point to get, in range [0 .. GetPointCount() - 1]
|
/// \param index Index of the point to get, in range [0 .. getPointCount() - 1]
|
||||||
///
|
///
|
||||||
/// \return Index-th point of the shape
|
/// \return Index-th point of the shape
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfVector2f sfRectangleShape_GetPoint(const sfRectangleShape* shape, unsigned int index);
|
CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getPoint(const sfRectangleShape* shape, unsigned int index);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set the size of a rectangle shape
|
/// \brief Set the size of a rectangle shape
|
||||||
@@ -373,7 +374,7 @@ CSFML_GRAPHICS_API sfVector2f sfRectangleShape_GetPoint(const sfRectangleShape*
|
|||||||
/// \param size New size of the rectangle
|
/// \param size New size of the rectangle
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfRectangleShape_SetSize(sfRectangleShape* shape, sfVector2f size);
|
CSFML_GRAPHICS_API void sfRectangleShape_setSize(sfRectangleShape* shape, sfVector2f size);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the size of a rectangle shape
|
/// \brief Get the size of a rectangle shape
|
||||||
@@ -383,7 +384,7 @@ CSFML_GRAPHICS_API void sfRectangleShape_SetSize(sfRectangleShape* shape, sfVect
|
|||||||
/// \return height Size of the rectangle
|
/// \return height Size of the rectangle
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfVector2f sfRectangleShape_GetSize(const sfRectangleShape* shape);
|
CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getSize(const sfRectangleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the local bounding rectangle of a rectangle shape
|
/// \brief Get the local bounding rectangle of a rectangle shape
|
||||||
@@ -399,7 +400,7 @@ CSFML_GRAPHICS_API sfVector2f sfRectangleShape_GetSize(const sfRectangleShape* s
|
|||||||
/// \return Local bounding rectangle of the entity
|
/// \return Local bounding rectangle of the entity
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfFloatRect sfRectangleShape_GetLocalBounds(const sfRectangleShape* shape);
|
CSFML_GRAPHICS_API sfFloatRect sfRectangleShape_getLocalBounds(const sfRectangleShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the global bounding rectangle of a rectangle shape
|
/// \brief Get the global bounding rectangle of a rectangle shape
|
||||||
@@ -415,7 +416,7 @@ CSFML_GRAPHICS_API sfFloatRect sfRectangleShape_GetLocalBounds(const sfRectangle
|
|||||||
/// \return Global bounding rectangle of the entity
|
/// \return Global bounding rectangle of the entity
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfFloatRect sfRectangleShape_GetGlobalBounds(const sfRectangleShape* shape);
|
CSFML_GRAPHICS_API sfFloatRect sfRectangleShape_getGlobalBounds(const sfRectangleShape* shape);
|
||||||
|
|
||||||
|
|
||||||
#endif // SFML_RECTANGLESHAPE_H
|
#endif // SFML_RECTANGLESHAPE_H
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -30,6 +30,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
#include <SFML/Graphics/Export.h>
|
#include <SFML/Graphics/Export.h>
|
||||||
#include <SFML/Graphics/BlendMode.h>
|
#include <SFML/Graphics/BlendMode.h>
|
||||||
|
#include <SFML/Graphics/Transform.h>
|
||||||
#include <SFML/Graphics/Types.h>
|
#include <SFML/Graphics/Types.h>
|
||||||
|
|
||||||
|
|
||||||
@@ -40,7 +41,7 @@
|
|||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
sfBlendMode blendMode; ///< Blending mode
|
sfBlendMode blendMode; ///< Blending mode
|
||||||
sfTransform* transform; ///< Transform
|
sfTransform transform; ///< Transform
|
||||||
const sfTexture* texture; ///< Texture
|
const sfTexture* texture; ///< Texture
|
||||||
const sfShader* shader; ///< Shader
|
const sfShader* shader; ///< Shader
|
||||||
} sfRenderStates;
|
} sfRenderStates;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -137,16 +137,57 @@ CSFML_GRAPHICS_API const sfView* sfRenderTexture_getDefaultView(const sfRenderTe
|
|||||||
CSFML_GRAPHICS_API sfIntRect sfRenderTexture_getViewport(const sfRenderTexture* renderTexture, const sfView* view);
|
CSFML_GRAPHICS_API sfIntRect sfRenderTexture_getViewport(const sfRenderTexture* renderTexture, const sfView* view);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Convert a point in texture coordinates into view coordinates
|
/// \brief Convert a point from texture coordinates to world coordinates
|
||||||
|
///
|
||||||
|
/// This function finds the 2D position that matches the
|
||||||
|
/// given pixel of the render-texture. In other words, it does
|
||||||
|
/// the inverse of what the graphics card does, to find the
|
||||||
|
/// initial position of a rendered pixel.
|
||||||
|
///
|
||||||
|
/// Initially, both coordinate systems (world units and target pixels)
|
||||||
|
/// match perfectly. But if you define a custom view or resize your
|
||||||
|
/// render-texture, this assertion is not true anymore, ie. a point
|
||||||
|
/// located at (10, 50) in your render-texture may map to the point
|
||||||
|
/// (150, 75) in your 2D world -- if the view is translated by (140, 25).
|
||||||
|
///
|
||||||
|
/// This version uses a custom view for calculations, see the other
|
||||||
|
/// overload of the function if you want to use the current view of the
|
||||||
|
/// render-texture.
|
||||||
///
|
///
|
||||||
/// \param renderTexture Render texture object
|
/// \param renderTexture Render texture object
|
||||||
/// \param point Point to convert, relative to the texture
|
/// \param point Pixel to convert
|
||||||
/// \param targetView Target view to convert the point to (pass NULL to use the current view)
|
/// \param view The view to use for converting the point
|
||||||
///
|
///
|
||||||
/// \return The converted point, in "world" units
|
/// \return The converted point, in "world" units
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfVector2f sfRenderTexture_convertCoords(const sfRenderTexture* renderTexture, sfVector2i point, const sfView* targetView);
|
CSFML_GRAPHICS_API sfVector2f sfRenderTexture_mapPixelToCoords(const sfRenderTexture* renderTexture, sfVector2i point, const sfView* view);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Convert a point from world coordinates to texture coordinates
|
||||||
|
///
|
||||||
|
/// This function finds the pixel of the render-texture that matches
|
||||||
|
/// the given 2D point. In other words, it goes through the same process
|
||||||
|
/// as the graphics card, to compute the final position of a rendered point.
|
||||||
|
///
|
||||||
|
/// Initially, both coordinate systems (world units and target pixels)
|
||||||
|
/// match perfectly. But if you define a custom view or resize your
|
||||||
|
/// render-texture, this assertion is not true anymore, ie. a point
|
||||||
|
/// located at (150, 75) in your 2D world may map to the pixel
|
||||||
|
/// (10, 50) of your render-texture -- if the view is translated by (140, 25).
|
||||||
|
///
|
||||||
|
/// This version uses a custom view for calculations, see the other
|
||||||
|
/// overload of the function if you want to use the current view of the
|
||||||
|
/// render-texture.
|
||||||
|
///
|
||||||
|
/// \param renderTexture Render texture object
|
||||||
|
/// \param point Point to convert
|
||||||
|
/// \param view The view to use for converting the point
|
||||||
|
///
|
||||||
|
/// \return The converted point, in target coordinates (pixels)
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API sfVector2i sfRenderTexture_mapCoordsToPixel(const sfRenderTexture* renderTexture, sfVector2f point, const sfView* view);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Draw a drawable object to the render-target
|
/// \brief Draw a drawable object to the render-target
|
||||||
@@ -255,5 +296,23 @@ CSFML_GRAPHICS_API void sfRenderTexture_setSmooth(sfRenderTexture* renderTexture
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfBool sfRenderTexture_isSmooth(const sfRenderTexture* renderTexture);
|
CSFML_GRAPHICS_API sfBool sfRenderTexture_isSmooth(const sfRenderTexture* renderTexture);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Enable or disable texture repeating
|
||||||
|
///
|
||||||
|
/// \param renderTexture Render texture object
|
||||||
|
/// \param repeated sfTrue to enable repeating, sfFalse to disable it
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API void sfRenderTexture_setRepeated(sfRenderTexture* renderTexture, sfBool repeated);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Tell whether the texture is repeated or not
|
||||||
|
///
|
||||||
|
/// \param renderTexture Render texture object
|
||||||
|
///
|
||||||
|
/// \return sfTrue if repeat mode is enabled, sfFalse if it is disabled
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API sfBool sfRenderTexture_isRepeated(const sfRenderTexture* renderTexture);
|
||||||
|
|
||||||
#endif // SFML_RENDERTEXTURE_H
|
#endif // SFML_RENDERTEXTURE_H
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -53,6 +53,17 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings);
|
CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Construct a new render window (with a UTF-32 title)
|
||||||
|
///
|
||||||
|
/// \param mode Video mode to use
|
||||||
|
/// \param title Title of the window (UTF-32)
|
||||||
|
/// \param style Window style
|
||||||
|
/// \param settings Creation settings (pass NULL to use default values)
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_createUnicode(sfVideoMode mode, const sfUint32* title, sfUint32 style, const sfContextSettings* settings);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Construct a render window from an existing control
|
/// \brief Construct a render window from an existing control
|
||||||
///
|
///
|
||||||
@@ -97,12 +108,12 @@ CSFML_GRAPHICS_API sfBool sfRenderWindow_isOpen(const sfRenderWindow* renderWind
|
|||||||
CSFML_GRAPHICS_API sfContextSettings sfRenderWindow_getSettings(const sfRenderWindow* renderWindow);
|
CSFML_GRAPHICS_API sfContextSettings sfRenderWindow_getSettings(const sfRenderWindow* renderWindow);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the event on top of events stack of a render window, if any, and pop it
|
/// \brief Get the event on top of event queue of a render window, if any, and pop it
|
||||||
///
|
///
|
||||||
/// \param renderWindow Render window object
|
/// \param renderWindow Render window object
|
||||||
/// \param event Event to fill, if any
|
/// \param event Event to fill, if any
|
||||||
///
|
///
|
||||||
/// \return sfTrue if an event was returned, sfFalse if events stack was empty
|
/// \return sfTrue if an event was returned, sfFalse if event queue was empty
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfBool sfRenderWindow_pollEvent(sfRenderWindow* renderWindow, sfEvent* event);
|
CSFML_GRAPHICS_API sfBool sfRenderWindow_pollEvent(sfRenderWindow* renderWindow, sfEvent* event);
|
||||||
@@ -167,10 +178,19 @@ CSFML_GRAPHICS_API void sfRenderWindow_setSize(sfRenderWindow* renderWindow, sfV
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfRenderWindow_setTitle(sfRenderWindow* renderWindow, const char* title);
|
CSFML_GRAPHICS_API void sfRenderWindow_setTitle(sfRenderWindow* renderWindow, const char* title);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Change the title of a render window (with a UTF-32 string)
|
||||||
|
///
|
||||||
|
/// \param renderWindow Render window object
|
||||||
|
/// \param title New title
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API void sfRenderWindow_setUnicodeTitle(sfRenderWindow* renderWindow, const sfUint32* title);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Change a render window's icon
|
/// \brief Change a render window's icon
|
||||||
///
|
///
|
||||||
/// \param renderWindow Renderw indow object
|
/// \param renderWindow Render window object
|
||||||
/// \param width Icon's width, in pixels
|
/// \param width Icon's width, in pixels
|
||||||
/// \param height Icon's height, in pixels
|
/// \param height Icon's height, in pixels
|
||||||
/// \param pixels Pointer to the pixels in memory, format must be RGBA 32 bits
|
/// \param pixels Pointer to the pixels in memory, format must be RGBA 32 bits
|
||||||
@@ -227,6 +247,32 @@ CSFML_GRAPHICS_API void sfRenderWindow_setKeyRepeatEnabled(sfRenderWindow* rende
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfBool sfRenderWindow_setActive(sfRenderWindow* renderWindow, sfBool active);
|
CSFML_GRAPHICS_API sfBool sfRenderWindow_setActive(sfRenderWindow* renderWindow, sfBool active);
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
/// \brief Request the current render window to be made the active
|
||||||
|
/// foreground window
|
||||||
|
///
|
||||||
|
/// At any given time, only one window may have the input focus
|
||||||
|
/// to receive input events such as keystrokes or mouse events.
|
||||||
|
/// If a window requests focus, it only hints to the operating
|
||||||
|
/// system, that it would like to be focused. The operating system
|
||||||
|
/// is free to deny the request.
|
||||||
|
/// This is not to be confused with sfWindow_setActive().
|
||||||
|
///
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API void sfRenderWindow_requestFocus(sfRenderWindow* renderWindow);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Check whether the render window has the input focus
|
||||||
|
///
|
||||||
|
/// At any given time, only one window may have the input focus
|
||||||
|
/// to receive input events such as keystrokes or most mouse
|
||||||
|
/// events.
|
||||||
|
///
|
||||||
|
/// \return True if window has focus, false otherwise
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API sfBool sfRenderWindow_hasFocus(const sfRenderWindow* renderWindow);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Display a render window on screen
|
/// \brief Display a render window on screen
|
||||||
///
|
///
|
||||||
@@ -313,16 +359,60 @@ CSFML_GRAPHICS_API const sfView* sfRenderWindow_getDefaultView(const sfRenderWin
|
|||||||
CSFML_GRAPHICS_API sfIntRect sfRenderWindow_getViewport(const sfRenderWindow* renderWindow, const sfView* view);
|
CSFML_GRAPHICS_API sfIntRect sfRenderWindow_getViewport(const sfRenderWindow* renderWindow, const sfView* view);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Convert a point in window coordinates into view coordinates
|
/// \brief Convert a point from window coordinates to world coordinates
|
||||||
|
///
|
||||||
|
/// This function finds the 2D position that matches the
|
||||||
|
/// given pixel of the render-window. In other words, it does
|
||||||
|
/// the inverse of what the graphics card does, to find the
|
||||||
|
/// initial position of a rendered pixel.
|
||||||
|
///
|
||||||
|
/// Initially, both coordinate systems (world units and target pixels)
|
||||||
|
/// match perfectly. But if you define a custom view or resize your
|
||||||
|
/// render-window, this assertion is not true anymore, ie. a point
|
||||||
|
/// located at (10, 50) in your render-window may map to the point
|
||||||
|
/// (150, 75) in your 2D world -- if the view is translated by (140, 25).
|
||||||
|
///
|
||||||
|
/// This function is typically used to find which point (or object) is
|
||||||
|
/// located below the mouse cursor.
|
||||||
|
///
|
||||||
|
/// This version uses a custom view for calculations, see the other
|
||||||
|
/// overload of the function if you want to use the current view of the
|
||||||
|
/// render-window.
|
||||||
///
|
///
|
||||||
/// \param renderWindow Render window object
|
/// \param renderWindow Render window object
|
||||||
/// \param point Point to convert, relative to the window
|
/// \param point Pixel to convert
|
||||||
/// \param targetView Target view to convert the point to (pass NULL to use the current view)
|
/// \param view The view to use for converting the point
|
||||||
///
|
///
|
||||||
/// \return The converted point, in "world" units
|
/// \return The converted point, in "world" units
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfVector2f sfRenderWindow_convertCoords(const sfRenderWindow* renderWindow, sfVector2i point, const sfView* targetView);
|
CSFML_GRAPHICS_API sfVector2f sfRenderWindow_mapPixelToCoords(const sfRenderWindow* renderWindow, sfVector2i point, const sfView* view);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Convert a point from world coordinates to window coordinates
|
||||||
|
///
|
||||||
|
/// This function finds the pixel of the render-window that matches
|
||||||
|
/// the given 2D point. In other words, it goes through the same process
|
||||||
|
/// as the graphics card, to compute the final position of a rendered point.
|
||||||
|
///
|
||||||
|
/// Initially, both coordinate systems (world units and target pixels)
|
||||||
|
/// match perfectly. But if you define a custom view or resize your
|
||||||
|
/// render-window, this assertion is not true anymore, ie. a point
|
||||||
|
/// located at (150, 75) in your 2D world may map to the pixel
|
||||||
|
/// (10, 50) of your render-window -- if the view is translated by (140, 25).
|
||||||
|
///
|
||||||
|
/// This version uses a custom view for calculations, see the other
|
||||||
|
/// overload of the function if you want to use the current view of the
|
||||||
|
/// render-window.
|
||||||
|
///
|
||||||
|
/// \param renderWindow Render window object
|
||||||
|
/// \param point Point to convert
|
||||||
|
/// \param view The view to use for converting the point
|
||||||
|
///
|
||||||
|
/// \return The converted point, in target coordinates (pixels)
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API sfVector2i sfRenderWindow_mapCoordsToPixel(const sfRenderWindow* renderWindow, sfVector2f point, const sfView* view);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Draw a drawable object to the render-target
|
/// \brief Draw a drawable object to the render-target
|
||||||
@@ -420,5 +510,44 @@ CSFML_GRAPHICS_API void sfRenderWindow_resetGLStates(sfRenderWindow* renderWindo
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfImage* sfRenderWindow_capture(const sfRenderWindow* renderWindow);
|
CSFML_GRAPHICS_API sfImage* sfRenderWindow_capture(const sfRenderWindow* renderWindow);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get the current position of the mouse relative to a render-window
|
||||||
|
///
|
||||||
|
/// This function returns the current position of the mouse
|
||||||
|
/// cursor relative to the given render-window, or desktop if NULL is passed.
|
||||||
|
///
|
||||||
|
/// \param relativeTo Reference window
|
||||||
|
///
|
||||||
|
/// \return Position of the mouse cursor, relative to the given render window
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API sfVector2i sfMouse_getPositionRenderWindow(const sfRenderWindow* relativeTo);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Set the current position of the mouse relative to a render window
|
||||||
|
///
|
||||||
|
/// This function sets the current position of the mouse
|
||||||
|
/// cursor relative to the given render-window, or desktop if NULL is passed.
|
||||||
|
///
|
||||||
|
/// \param position New position of the mouse
|
||||||
|
/// \param relativeTo Reference window
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API void sfMouse_setPositionRenderWindow(sfVector2i position, const sfRenderWindow* relativeTo);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get the current position of a touch in window coordinates
|
||||||
|
///
|
||||||
|
/// This function returns the current touch position
|
||||||
|
/// relative to the given render window, or desktop if NULL is passed.
|
||||||
|
///
|
||||||
|
/// \param finger Finger index
|
||||||
|
/// \param relativeTo Reference window
|
||||||
|
///
|
||||||
|
/// \return Current position of \a finger, or undefined if it's not down
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API sfVector2i sfTouch_getPositionRenderWindow(unsigned int finger, const sfRenderWindow* relativeTo);
|
||||||
|
|
||||||
|
|
||||||
#endif // SFML_RENDERWINDOW_H
|
#endif // SFML_RENDERWINDOW_H
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -30,6 +30,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
#include <SFML/Graphics/Export.h>
|
#include <SFML/Graphics/Export.h>
|
||||||
#include <SFML/Graphics/Color.h>
|
#include <SFML/Graphics/Color.h>
|
||||||
|
#include <SFML/Graphics/Transform.h>
|
||||||
#include <SFML/Graphics/Types.h>
|
#include <SFML/Graphics/Types.h>
|
||||||
#include <SFML/System/InputStream.h>
|
#include <SFML/System/InputStream.h>
|
||||||
#include <SFML/System/Vector2.h>
|
#include <SFML/System/Vector2.h>
|
||||||
@@ -259,7 +260,7 @@ CSFML_GRAPHICS_API void sfShader_setVector3Parameter(sfShader* shader, const cha
|
|||||||
/// uniform vec4 color; // this is the variable in the shader
|
/// uniform vec4 color; // this is the variable in the shader
|
||||||
/// \endcode
|
/// \endcode
|
||||||
/// \code
|
/// \code
|
||||||
/// sfShader_setColorParameter(shader, "color", sfColor_FromRGB(255, 128, 0));
|
/// sfShader_setColorParameter(shader, "color", sfColor_fromRGB(255, 128, 0));
|
||||||
/// \endcode
|
/// \endcode
|
||||||
///
|
///
|
||||||
/// \param shader Shader object
|
/// \param shader Shader object
|
||||||
@@ -290,7 +291,7 @@ CSFML_GRAPHICS_API void sfShader_setColorParameter(sfShader* shader, const char*
|
|||||||
/// \param transform Transform to assign
|
/// \param transform Transform to assign
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfShader_setTransformParameter(sfShader* shader, const char* name, const sfTransform* transform);
|
CSFML_GRAPHICS_API void sfShader_setTransformParameter(sfShader* shader, const char* name, sfTransform transform);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Change a texture parameter of a shader
|
/// \brief Change a texture parameter of a shader
|
||||||
@@ -351,33 +352,26 @@ CSFML_GRAPHICS_API void sfShader_setCurrentTextureParameter(sfShader* shader, co
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Bind a shader for rendering (activate it)
|
/// \brief Bind a shader for rendering (activate it)
|
||||||
///
|
///
|
||||||
/// This function is normally for internal use only, unless
|
/// This function is not part of the graphics API, it mustn't be
|
||||||
/// you want to use the shader with a custom OpenGL rendering
|
/// used when drawing SFML entities. It must be used only if you
|
||||||
/// instead of a SFML drawable.
|
/// mix sfShader with OpenGL code.
|
||||||
|
///
|
||||||
/// \code
|
/// \code
|
||||||
/// sfWindow_setActive(window, sfTrue);
|
/// sfShader *s1, *s2;
|
||||||
/// sfShader_bind(shader);
|
/// ...
|
||||||
/// ... render OpenGL geometry ...
|
/// sfShader_bind(s1);
|
||||||
/// sfShader_unbind(shader);
|
/// // draw OpenGL stuff that use s1...
|
||||||
|
/// sfShader_bind(s2);
|
||||||
|
/// // draw OpenGL stuff that use s2...
|
||||||
|
/// sfShader_bind(0);
|
||||||
|
/// // draw OpenGL stuff that use no shader...
|
||||||
/// \endcode
|
/// \endcode
|
||||||
///
|
///
|
||||||
/// \param shader Shader to bind
|
/// \param shader Shader to bind, can be null to use no shader
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfShader_bind(const sfShader* shader);
|
CSFML_GRAPHICS_API void sfShader_bind(const sfShader* shader);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
|
||||||
/// \brief Unbind a shader (deactivate it)
|
|
||||||
///
|
|
||||||
/// This function is normally for internal use only, unless
|
|
||||||
/// you want to use the shader with a custom OpenGL rendering
|
|
||||||
/// instead of a SFML drawable.
|
|
||||||
///
|
|
||||||
/// \param shader Shader to unbind
|
|
||||||
///
|
|
||||||
////////////////////////////////////////////////////////////
|
|
||||||
CSFML_GRAPHICS_API void sfShader_unbind(const sfShader* shader);
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Tell whether or not the system supports shaders
|
/// \brief Tell whether or not the system supports shaders
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -31,6 +31,7 @@
|
|||||||
#include <SFML/Graphics/Export.h>
|
#include <SFML/Graphics/Export.h>
|
||||||
#include <SFML/Graphics/Color.h>
|
#include <SFML/Graphics/Color.h>
|
||||||
#include <SFML/Graphics/Rect.h>
|
#include <SFML/Graphics/Rect.h>
|
||||||
|
#include <SFML/Graphics/Transform.h>
|
||||||
#include <SFML/Graphics/Types.h>
|
#include <SFML/Graphics/Types.h>
|
||||||
#include <SFML/System/Vector2.h>
|
#include <SFML/System/Vector2.h>
|
||||||
|
|
||||||
@@ -201,7 +202,7 @@ CSFML_GRAPHICS_API void sfShape_scale(sfShape* shape, sfVector2f factors);
|
|||||||
/// \return Transform combining the position/rotation/scale/origin of the object
|
/// \return Transform combining the position/rotation/scale/origin of the object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API const sfTransform* sfShape_getTransform(const sfShape* shape);
|
CSFML_GRAPHICS_API sfTransform sfShape_getTransform(const sfShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the inverse of the combined transform of a shape
|
/// \brief Get the inverse of the combined transform of a shape
|
||||||
@@ -211,7 +212,7 @@ CSFML_GRAPHICS_API const sfTransform* sfShape_getTransform(const sfShape* shape)
|
|||||||
/// \return Inverse of the combined transformations applied to the object
|
/// \return Inverse of the combined transformations applied to the object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API const sfTransform* sfShape_getInverseTransform(const sfShape* shape);
|
CSFML_GRAPHICS_API sfTransform sfShape_getInverseTransform(const sfShape* shape);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Change the source texture of a shape
|
/// \brief Change the source texture of a shape
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -32,6 +32,7 @@
|
|||||||
#include <SFML/Graphics/BlendMode.h>
|
#include <SFML/Graphics/BlendMode.h>
|
||||||
#include <SFML/Graphics/Color.h>
|
#include <SFML/Graphics/Color.h>
|
||||||
#include <SFML/Graphics/Rect.h>
|
#include <SFML/Graphics/Rect.h>
|
||||||
|
#include <SFML/Graphics/Transform.h>
|
||||||
#include <SFML/Graphics/Types.h>
|
#include <SFML/Graphics/Types.h>
|
||||||
#include <SFML/System/Vector2.h>
|
#include <SFML/System/Vector2.h>
|
||||||
|
|
||||||
@@ -52,7 +53,7 @@ CSFML_GRAPHICS_API sfSprite* sfSprite_create(void);
|
|||||||
/// \return Copied object
|
/// \return Copied object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfSprite* sfSprite_copy(sfSprite* sprite);
|
CSFML_GRAPHICS_API sfSprite* sfSprite_copy(const sfSprite* sprite);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Destroy an existing sprite
|
/// \brief Destroy an existing sprite
|
||||||
@@ -203,7 +204,7 @@ CSFML_GRAPHICS_API void sfSprite_scale(sfSprite* sprite, sfVector2f factors);
|
|||||||
/// \return Transform combining the position/rotation/scale/origin of the object
|
/// \return Transform combining the position/rotation/scale/origin of the object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API const sfTransform* sfSprite_getTransform(const sfSprite* sprite);
|
CSFML_GRAPHICS_API sfTransform sfSprite_getTransform(const sfSprite* sprite);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the inverse of the combined transform of a sprite
|
/// \brief Get the inverse of the combined transform of a sprite
|
||||||
@@ -213,7 +214,7 @@ CSFML_GRAPHICS_API const sfTransform* sfSprite_getTransform(const sfSprite* spri
|
|||||||
/// \return Inverse of the combined transformations applied to the object
|
/// \return Inverse of the combined transformations applied to the object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API const sfTransform* sfSprite_getInverseTransform(const sfSprite* sprite);
|
CSFML_GRAPHICS_API sfTransform sfSprite_getInverseTransform(const sfSprite* sprite);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Change the source texture of a sprite
|
/// \brief Change the source texture of a sprite
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -32,6 +32,7 @@
|
|||||||
#include <SFML/Graphics/Color.h>
|
#include <SFML/Graphics/Color.h>
|
||||||
#include <SFML/Graphics/Rect.h>
|
#include <SFML/Graphics/Rect.h>
|
||||||
#include <SFML/Graphics/Types.h>
|
#include <SFML/Graphics/Types.h>
|
||||||
|
#include <SFML/Graphics/Transform.h>
|
||||||
#include <SFML/System/Vector2.h>
|
#include <SFML/System/Vector2.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
@@ -41,10 +42,11 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
sfTextRegular = 0, ///< Regular characters, no style
|
sfTextRegular = 0, ///< Regular characters, no style
|
||||||
sfTextBold = 1 << 0, ///< Characters are bold
|
sfTextBold = 1 << 0, ///< Bold characters
|
||||||
sfTextItalic = 1 << 1, ///< Characters are in italic
|
sfTextItalic = 1 << 1, ///< Italic characters
|
||||||
sfTextUnderlined = 1 << 2 ///< Characters are underlined
|
sfTextUnderlined = 1 << 2, ///< Underlined characters
|
||||||
|
sfTextStrikeThrough = 1 << 3 ///< Strike through characters
|
||||||
} sfTextStyle;
|
} sfTextStyle;
|
||||||
|
|
||||||
|
|
||||||
@@ -64,7 +66,7 @@ CSFML_GRAPHICS_API sfText* sfText_create(void);
|
|||||||
/// \return Copied object
|
/// \return Copied object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfText* sfText_copy(sfText* text);
|
CSFML_GRAPHICS_API sfText* sfText_copy(const sfText* text);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Destroy an existing text
|
/// \brief Destroy an existing text
|
||||||
@@ -215,7 +217,7 @@ CSFML_GRAPHICS_API void sfText_scale(sfText* text, sfVector2f factors);
|
|||||||
/// \return Transform combining the position/rotation/scale/origin of the object
|
/// \return Transform combining the position/rotation/scale/origin of the object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API const sfTransform* sfText_getTransform(const sfText* text);
|
CSFML_GRAPHICS_API sfTransform sfText_getTransform(const sfText* text);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the inverse of the combined transform of a text
|
/// \brief Get the inverse of the combined transform of a text
|
||||||
@@ -225,7 +227,7 @@ CSFML_GRAPHICS_API const sfTransform* sfText_getTransform(const sfText* text);
|
|||||||
/// \return Inverse of the combined transformations applied to the object
|
/// \return Inverse of the combined transformations applied to the object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API const sfTransform* sfText_getInverseTransform(const sfText* text);
|
CSFML_GRAPHICS_API sfTransform sfText_getInverseTransform(const sfText* text);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set the string of a text (from an ANSI string)
|
/// \brief Set the string of a text (from an ANSI string)
|
||||||
@@ -256,8 +258,6 @@ CSFML_GRAPHICS_API void sfText_setUnicodeString(sfText* text, const sfUint32* st
|
|||||||
/// a pointer to the one that you passed to this function.
|
/// a pointer to the one that you passed to this function.
|
||||||
/// If the font is destroyed and the text tries to
|
/// If the font is destroyed and the text tries to
|
||||||
/// use it, the behaviour is undefined.
|
/// use it, the behaviour is undefined.
|
||||||
/// Texts have a valid font by default, which the built-in
|
|
||||||
/// sfFont_getDefaultFont().
|
|
||||||
///
|
///
|
||||||
/// \param text Text object
|
/// \param text Text object
|
||||||
/// \param font New font
|
/// \param font New font
|
||||||
@@ -301,11 +301,11 @@ CSFML_GRAPHICS_API void sfText_setStyle(sfText* text, sfUint32 style);
|
|||||||
CSFML_GRAPHICS_API void sfText_setColor(sfText* text, sfColor color);
|
CSFML_GRAPHICS_API void sfText_setColor(sfText* text, sfColor color);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the text of a text (returns an ANSI string)
|
/// \brief Get the string of a text (returns an ANSI string)
|
||||||
///
|
///
|
||||||
/// \param text Text object
|
/// \param text Text object
|
||||||
///
|
///
|
||||||
/// \return String an a locale-dependant ANSI string
|
/// \return String as a locale-dependant ANSI string
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API const char* sfText_getString(const sfText* text);
|
CSFML_GRAPHICS_API const char* sfText_getString(const sfText* text);
|
||||||
@@ -323,6 +323,10 @@ CSFML_GRAPHICS_API const sfUint32* sfText_getUnicodeString(const sfText* text);
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the font used by a text
|
/// \brief Get the font used by a text
|
||||||
///
|
///
|
||||||
|
/// If the text has no font attached, a NULL pointer is returned.
|
||||||
|
/// The returned pointer is const, which means that you can't
|
||||||
|
/// modify the font when you retrieve it with this function.
|
||||||
|
///
|
||||||
/// \param text Text object
|
/// \param text Text object
|
||||||
///
|
///
|
||||||
/// \return Pointer to the font
|
/// \return Pointer to the font
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -101,7 +101,7 @@ CSFML_GRAPHICS_API sfTexture* sfTexture_createFromImage(const sfImage* image, co
|
|||||||
/// \return Copied object
|
/// \return Copied object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfTexture* sfTexture_copy(sfTexture* texture);
|
CSFML_GRAPHICS_API sfTexture* sfTexture_copy(const sfTexture* texture);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Destroy an existing texture
|
/// \brief Destroy an existing texture
|
||||||
@@ -177,14 +177,6 @@ CSFML_GRAPHICS_API void sfTexture_updateFromWindow(sfTexture* texture, const sfW
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfTexture_updateFromRenderWindow(sfTexture* texture, const sfRenderWindow* renderWindow, unsigned int x, unsigned int y);
|
CSFML_GRAPHICS_API void sfTexture_updateFromRenderWindow(sfTexture* texture, const sfRenderWindow* renderWindow, unsigned int x, unsigned int y);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
|
||||||
/// \brief Activate a texture for rendering
|
|
||||||
///
|
|
||||||
/// \param texture Texture to bind
|
|
||||||
///
|
|
||||||
////////////////////////////////////////////////////////////
|
|
||||||
CSFML_GRAPHICS_API void sfTexture_bind(const sfTexture* texture);
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Enable or disable the smooth filter on a texture
|
/// \brief Enable or disable the smooth filter on a texture
|
||||||
///
|
///
|
||||||
@@ -237,6 +229,29 @@ CSFML_GRAPHICS_API void sfTexture_setRepeated(sfTexture* texture, sfBool repeate
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfBool sfTexture_isRepeated(const sfTexture* texture);
|
CSFML_GRAPHICS_API sfBool sfTexture_isRepeated(const sfTexture* texture);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Bind a texture for rendering
|
||||||
|
///
|
||||||
|
/// This function is not part of the graphics API, it mustn't be
|
||||||
|
/// used when drawing SFML entities. It must be used only if you
|
||||||
|
/// mix sfTexture with OpenGL code.
|
||||||
|
///
|
||||||
|
/// \code
|
||||||
|
/// sfTexture *t1, *t2;
|
||||||
|
/// ...
|
||||||
|
/// sfTexture_bind(t1);
|
||||||
|
/// // draw OpenGL stuff that use t1...
|
||||||
|
/// sfTexture_bind(t2);
|
||||||
|
/// // draw OpenGL stuff that use t2...
|
||||||
|
/// sfTexture_bind(NULL);
|
||||||
|
/// // draw OpenGL stuff that use no texture...
|
||||||
|
/// \endcode
|
||||||
|
///
|
||||||
|
/// \param texture Pointer to the texture to bind, can be null to use no texture
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API void sfTexture_bind(const sfTexture* texture);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the maximum texture size allowed
|
/// \brief Get the maximum texture size allowed
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -34,15 +34,22 @@
|
|||||||
#include <SFML/System/Vector2.h>
|
#include <SFML/System/Vector2.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Create a new transform
|
/// \brief Encapsulate a 3x3 transform matrix
|
||||||
///
|
|
||||||
/// This function creates an identity transform.
|
|
||||||
///
|
|
||||||
/// \return A new sfTransform object
|
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfTransform* sfTransform_create(void);
|
typedef struct
|
||||||
|
{
|
||||||
|
float matrix[9];
|
||||||
|
} sfTransform;
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Identity transform (does nothing)
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API const sfTransform sfTransform_Identity;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Create a new transform from a matrix
|
/// \brief Create a new transform from a matrix
|
||||||
@@ -60,46 +67,29 @@ CSFML_GRAPHICS_API sfTransform* sfTransform_create(void);
|
|||||||
/// \return A new sfTransform object
|
/// \return A new sfTransform object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfTransform* sfTransform_createFromMatrix(float a00, float a01, float a02,
|
CSFML_GRAPHICS_API sfTransform sfTransform_fromMatrix(float a00, float a01, float a02,
|
||||||
float a10, float a11, float a12,
|
float a10, float a11, float a12,
|
||||||
float a20, float a21, float a22);
|
float a20, float a21, float a22);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
|
||||||
/// \brief Copy an existing transform
|
|
||||||
///
|
|
||||||
/// \param transform Transform to copy
|
|
||||||
///
|
|
||||||
/// \return Copied object
|
|
||||||
///
|
|
||||||
////////////////////////////////////////////////////////////
|
|
||||||
CSFML_GRAPHICS_API sfTransform* sfTransform_copy(sfTransform* transform);
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
|
||||||
/// \brief Destroy an existing transform
|
|
||||||
///
|
|
||||||
/// \param transform Transform to delete
|
|
||||||
///
|
|
||||||
////////////////////////////////////////////////////////////
|
|
||||||
CSFML_GRAPHICS_API void sfTransform_destroy(sfTransform* transform);
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Return the 4x4 matrix of a transform
|
/// \brief Return the 4x4 matrix of a transform
|
||||||
///
|
///
|
||||||
/// This function returns a pointer to an array of 16 floats
|
/// This function fills an array of 16 floats with the transform
|
||||||
/// containing the transform elements as a 4x4 matrix, which
|
/// converted as a 4x4 matrix, which is directly compatible with
|
||||||
/// is directly compatible with OpenGL functions.
|
/// OpenGL functions.
|
||||||
///
|
///
|
||||||
/// \code
|
/// \code
|
||||||
/// sfTransform* transform = ...;
|
/// sfTransform transform = ...;
|
||||||
/// glLoadMatrixf(sfTransform_getMatrix(transform));
|
/// float matrix[16];
|
||||||
|
/// sfTransform_getMatrix(&transform, matrix)
|
||||||
|
/// glLoadMatrixf(matrix);
|
||||||
/// \endcode
|
/// \endcode
|
||||||
///
|
///
|
||||||
/// \param transform Transform object
|
/// \param transform Transform object
|
||||||
///
|
/// \param matrix Pointer to the 16-element array to fill with the matrix
|
||||||
/// \return Pointer to a 4x4 matrix
|
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API const float* sfTransform_getMatrix(const sfTransform* transform);
|
CSFML_GRAPHICS_API void sfTransform_getMatrix(const sfTransform* transform, float* matrix);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Return the inverse of a transform
|
/// \brief Return the inverse of a transform
|
||||||
@@ -108,10 +98,10 @@ CSFML_GRAPHICS_API const float* sfTransform_getMatrix(const sfTransform* transfo
|
|||||||
/// is returned.
|
/// is returned.
|
||||||
///
|
///
|
||||||
/// \param transform Transform object
|
/// \param transform Transform object
|
||||||
/// \param result Returned inverse matrix
|
/// \return The inverse matrix
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfTransform_getInverse(const sfTransform* transform, sfTransform* result);
|
CSFML_GRAPHICS_API sfTransform sfTransform_getInverse(const sfTransform* transform);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Apply a transform to a 2D point
|
/// \brief Apply a transform to a 2D point
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -30,6 +30,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
#include <SFML/Graphics/Export.h>
|
#include <SFML/Graphics/Export.h>
|
||||||
#include <SFML/Graphics/Types.h>
|
#include <SFML/Graphics/Types.h>
|
||||||
|
#include <SFML/Graphics/Transform.h>
|
||||||
#include <SFML/System/Vector2.h>
|
#include <SFML/System/Vector2.h>
|
||||||
|
|
||||||
|
|
||||||
@@ -49,7 +50,7 @@ CSFML_GRAPHICS_API sfTransformable* sfTransformable_create(void);
|
|||||||
/// \return Copied object
|
/// \return Copied object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfTransformable* sfTransformable_copy(sfTransformable* transformable);
|
CSFML_GRAPHICS_API sfTransformable* sfTransformable_copy(const sfTransformable* transformable);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Destroy an existing transformable
|
/// \brief Destroy an existing transformable
|
||||||
@@ -200,7 +201,7 @@ CSFML_GRAPHICS_API void sfTransformable_scale(sfTransformable* transformable, sf
|
|||||||
/// \return Transform combining the position/rotation/scale/origin of the object
|
/// \return Transform combining the position/rotation/scale/origin of the object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API const sfTransform* sfTransformable_getTransform(const sfTransformable* transformable);
|
CSFML_GRAPHICS_API sfTransform sfTransformable_getTransform(const sfTransformable* transformable);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the inverse of the combined transform of a transformable
|
/// \brief Get the inverse of the combined transform of a transformable
|
||||||
@@ -210,7 +211,7 @@ CSFML_GRAPHICS_API const sfTransform* sfTransformable_getTransform(const sfTrans
|
|||||||
/// \return Inverse of the combined transformations applied to the object
|
/// \return Inverse of the combined transformations applied to the object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API const sfTransform* sfTransformable_getInverseTransform(const sfTransformable* transformable);
|
CSFML_GRAPHICS_API sfTransform sfTransformable_getInverseTransform(const sfTransformable* transformable);
|
||||||
|
|
||||||
|
|
||||||
#endif // SFML_TRANSFORMABLE_H
|
#endif // SFML_TRANSFORMABLE_H
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -38,7 +38,6 @@ typedef struct sfShape sfShape;
|
|||||||
typedef struct sfSprite sfSprite;
|
typedef struct sfSprite sfSprite;
|
||||||
typedef struct sfText sfText;
|
typedef struct sfText sfText;
|
||||||
typedef struct sfTexture sfTexture;
|
typedef struct sfTexture sfTexture;
|
||||||
typedef struct sfTransform sfTransform;
|
|
||||||
typedef struct sfTransformable sfTransformable;
|
typedef struct sfTransformable sfTransformable;
|
||||||
typedef struct sfVertexArray sfVertexArray;
|
typedef struct sfVertexArray sfVertexArray;
|
||||||
typedef struct sfView sfView;
|
typedef struct sfView sfView;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -51,7 +51,7 @@ CSFML_GRAPHICS_API sfVertexArray* sfVertexArray_create(void);
|
|||||||
/// \return Copied object
|
/// \return Copied object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfVertexArray* sfVertexArray_copy(sfVertexArray* vertexArray);
|
CSFML_GRAPHICS_API sfVertexArray* sfVertexArray_copy(const sfVertexArray* vertexArray);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Destroy an existing vertex array
|
/// \brief Destroy an existing vertex array
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -62,7 +62,7 @@ CSFML_GRAPHICS_API sfView* sfView_createFromRect(sfFloatRect rectangle);
|
|||||||
/// \return Copied object
|
/// \return Copied object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfView* sfView_copy(sfView* view);
|
CSFML_GRAPHICS_API sfView* sfView_copy(const sfView* view);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Destroy an existing view
|
/// \brief Destroy an existing view
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -30,6 +30,8 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <SFML/System.h>
|
#include <SFML/System.h>
|
||||||
|
#include <SFML/Network/Ftp.h>
|
||||||
|
#include <SFML/Network/Http.h>
|
||||||
#include <SFML/Network/IpAddress.h>
|
#include <SFML/Network/IpAddress.h>
|
||||||
#include <SFML/Network/Packet.h>
|
#include <SFML/Network/Packet.h>
|
||||||
#include <SFML/Network/SocketSelector.h>
|
#include <SFML/Network/SocketSelector.h>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
+13
-13
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -38,19 +38,19 @@
|
|||||||
/// \brief Enumeration of transfer modes
|
/// \brief Enumeration of transfer modes
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
enum sfFtpTransferMode
|
typedef enum
|
||||||
{
|
{
|
||||||
sfFtpBinary, ///< Binary mode (file is transfered as a sequence of bytes)
|
sfFtpBinary, ///< Binary mode (file is transfered as a sequence of bytes)
|
||||||
sfFtpAscii, ///< Text mode using ASCII encoding
|
sfFtpAscii, ///< Text mode using ASCII encoding
|
||||||
sfFtpEbcdic ///< Text mode using EBCDIC encoding
|
sfFtpEbcdic ///< Text mode using EBCDIC encoding
|
||||||
};
|
} sfFtpTransferMode;
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Status codes possibly returned by a FTP response
|
/// \brief Status codes possibly returned by a FTP response
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
enum sfFtpStatus
|
typedef enum
|
||||||
{
|
{
|
||||||
// 1xx: the requested action is being initiated,
|
// 1xx: the requested action is being initiated,
|
||||||
// expect another reply before proceeding with a new command
|
// expect another reply before proceeding with a new command
|
||||||
@@ -110,7 +110,7 @@ enum sfFtpStatus
|
|||||||
sfFtpConnectionFailed = 1001, ///< Connection with server failed
|
sfFtpConnectionFailed = 1001, ///< Connection with server failed
|
||||||
sfFtpConnectionClosed = 1002, ///< Connection with server closed
|
sfFtpConnectionClosed = 1002, ///< Connection with server closed
|
||||||
sfFtpInvalidFile = 1003 ///< Invalid file to upload / download
|
sfFtpInvalidFile = 1003 ///< Invalid file to upload / download
|
||||||
};
|
} sfFtpStatus;
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
@@ -155,25 +155,25 @@ CSFML_NETWORK_API sfFtpStatus sfFtpListingResponse_getStatus(const sfFtpListingR
|
|||||||
CSFML_NETWORK_API const char* sfFtpListingResponse_getMessage(const sfFtpListingResponse* ftpListingResponse);
|
CSFML_NETWORK_API const char* sfFtpListingResponse_getMessage(const sfFtpListingResponse* ftpListingResponse);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Return the number of filenames contained in a FTP listing response
|
/// \brief Return the number of directory/file names contained in a FTP listing response
|
||||||
///
|
///
|
||||||
/// \param ftpListingResponse Ftp listing response
|
/// \param ftpListingResponse Ftp listing response
|
||||||
///
|
///
|
||||||
/// \return Total number of filenames available
|
/// \return Total number of names available
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_NETWORK_API size_t sfFtpListingResponse_getCount(const sfFtpListingResponse* ftpListingResponse);
|
CSFML_NETWORK_API size_t sfFtpListingResponse_getCount(const sfFtpListingResponse* ftpListingResponse);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Return a filename contained in a FTP listing response
|
/// \brief Return a directory/file name contained in a FTP listing response
|
||||||
///
|
///
|
||||||
/// \param ftpListingResponse Ftp listing response
|
/// \param ftpListingResponse Ftp listing response
|
||||||
/// \param index Index of the filename to get (in range [0 .. GetCount])
|
/// \param index Index of the name to get (in range [0 .. getCount])
|
||||||
///
|
///
|
||||||
/// \return Array containing the requested filenames
|
/// \return The requested name
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_NETWORK_API const char* sfFtpListingResponse_getFilename(const sfFtpListingResponse* ftpListingResponse, size_t index);
|
CSFML_NETWORK_API const char* sfFtpListingResponse_getName(const sfFtpListingResponse* ftpListingResponse, size_t index);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Destroy a FTP directory response
|
/// \brief Destroy a FTP directory response
|
||||||
@@ -299,12 +299,12 @@ CSFML_NETWORK_API void sfFtp_destroy(sfFtp* ftp);
|
|||||||
/// \param ftp Ftp object
|
/// \param ftp Ftp object
|
||||||
/// \param server Name or address of the FTP server to connect to
|
/// \param server Name or address of the FTP server to connect to
|
||||||
/// \param port Port used for the connection
|
/// \param port Port used for the connection
|
||||||
/// \param timeout Maximum time to wait, in milliseconds
|
/// \param timeout Maximum time to wait
|
||||||
///
|
///
|
||||||
/// \return Server response to the request
|
/// \return Server response to the request
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_connect(sfFtp* ftp, sfIpAddress server, unsigned short port, sfUint32 timeout);
|
CSFML_NETWORK_API sfFtpResponse* sfFtp_connect(sfFtp* ftp, sfIpAddress server, unsigned short port, sfTime timeout);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Log in using an anonymous account
|
/// \brief Log in using an anonymous account
|
||||||
|
|||||||
+25
-18
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -37,48 +37,55 @@
|
|||||||
/// \brief Enumerate the available HTTP methods for a request
|
/// \brief Enumerate the available HTTP methods for a request
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
enum sfHttpMethod
|
typedef enum
|
||||||
{
|
{
|
||||||
sfHttpGet, ///< Request in get mode, standard method to retrieve a page
|
sfHttpGet, ///< Request in get mode, standard method to retrieve a page
|
||||||
sfHttpPost, ///< Request in post mode, usually to send data to a page
|
sfHttpPost, ///< Request in post mode, usually to send data to a page
|
||||||
sfHttpHead ///< Request a page's header only
|
sfHttpHead, ///< Request a page's header only
|
||||||
};
|
sfHttpPut, ///< Request in put mode, useful for a REST API
|
||||||
|
sfHttpDelete ///< Request in delete mode, useful for a REST API
|
||||||
|
} sfHttpMethod;
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Enumerate all the valid status codes for a response
|
/// \brief Enumerate all the valid status codes for a response
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
enum sfHttpStatus
|
typedef enum
|
||||||
{
|
{
|
||||||
// 2xx: success
|
// 2xx: success
|
||||||
sfHttpOk = 200, ///< Most common code returned when operation was successful
|
sfHttpOk = 200, ///< Most common code returned when operation was successful
|
||||||
sfHttpCreated = 201, ///< The resource has successfully been created
|
sfHttpCreated = 201, ///< The resource has successfully been created
|
||||||
sfHttpAccepted = 202, ///< The request has been accepted, but will be processed later by the server
|
sfHttpAccepted = 202, ///< The request has been accepted, but will be processed later by the server
|
||||||
sfHttpNoContent = 204, ///< Sent when the server didn't send any data in return
|
sfHttpNoContent = 204, ///< Sent when the server didn't send any data in return
|
||||||
|
sfHttpResetContent = 205, ///< The server informs the client that it should clear the view (form) that caused the request to be sent
|
||||||
|
sfHttpPartialContent = 206, ///< The server has sent a part of the resource, as a response to a partial GET request
|
||||||
|
|
||||||
// 3xx: redirection
|
// 3xx: redirection
|
||||||
sfHttpMultipleChoices = 300, ///< The requested page can be accessed from several locations
|
sfHttpMultipleChoices = 300, ///< The requested page can be accessed from several locations
|
||||||
sfHttpMovedPermanently = 301, ///< The requested page has permanently moved to a new location
|
sfHttpMovedPermanently = 301, ///< The requested page has permanently moved to a new location
|
||||||
sfHttpMovedTemporarily = 302, ///< The requested page has temporarily moved to a new location
|
sfHttpMovedTemporarily = 302, ///< The requested page has temporarily moved to a new location
|
||||||
sfHttpNotModified = 304, ///< For conditionnal requests, means the requested page hasn't changed and doesn't need to be refreshed
|
sfHttpNotModified = 304, ///< For conditional requests, means the requested page hasn't changed and doesn't need to be refreshed
|
||||||
|
|
||||||
// 4xx: client error
|
// 4xx: client error
|
||||||
sfHttpBadRequest = 400, ///< The server couldn't understand the request (syntax error)
|
sfHttpBadRequest = 400, ///< The server couldn't understand the request (syntax error)
|
||||||
sfHttpUnauthorized = 401, ///< The requested page needs an authentification to be accessed
|
sfHttpUnauthorized = 401, ///< The requested page needs an authentication to be accessed
|
||||||
sfHttpForbidden = 403, ///< The requested page cannot be accessed at all, even with authentification
|
sfHttpForbidden = 403, ///< The requested page cannot be accessed at all, even with authentication
|
||||||
sfHttpNotFound = 404, ///< The requested page doesn't exist
|
sfHttpNotFound = 404, ///< The requested page doesn't exist
|
||||||
|
sfHttpRangeNotSatisfiable = 407, ///< The server can't satisfy the partial GET request (with a "Range" header field)
|
||||||
|
|
||||||
// 5xx: server error
|
// 5xx: server error
|
||||||
sfHttpInternalServerError = 500, ///< The server encountered an unexpected error
|
sfHttpInternalServerError = 500, ///< The server encountered an unexpected error
|
||||||
sfHttpNotImplemented = 501, ///< The server doesn't implement a requested feature
|
sfHttpNotImplemented = 501, ///< The server doesn't implement a requested feature
|
||||||
sfHttpBadGateway = 502, ///< The gateway server has received an error from the source server
|
sfHttpBadGateway = 502, ///< The gateway server has received an error from the source server
|
||||||
sfHttpServiceNotAvailable = 503, ///< The server is temporarily unavailable (overloaded, in maintenance, ...)
|
sfHttpServiceNotAvailable = 503, ///< The server is temporarily unavailable (overloaded, in maintenance, ...)
|
||||||
|
sfHttpGatewayTimeout = 504, ///< The gateway server couldn't receive a response from the source server
|
||||||
|
sfHttpVersionNotSupported = 505, ///< The server doesn't support the requested HTTP version
|
||||||
|
|
||||||
// 10xx: SFML custom codes
|
// 10xx: SFML custom codes
|
||||||
sfHttpInvalidResponse = 1000, ///< Response is not a valid HTTP one
|
sfHttpInvalidResponse = 1000, ///< Response is not a valid HTTP one
|
||||||
sfHttpConnectionFailed = 1001 ///< Connection with server failed
|
sfHttpConnectionFailed = 1001 ///< Connection with server failed
|
||||||
};
|
} sfHttpStatus;
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
@@ -275,7 +282,7 @@ CSFML_NETWORK_API void sfHttp_setHost(sfHttp* http, const char* host, unsigned s
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Send a HTTP request and return the server's response.
|
/// \brief Send a HTTP request and return the server's response.
|
||||||
///
|
///
|
||||||
/// You must have a valid host before sending a request (see sfHttp_SetHost).
|
/// You must have a valid host before sending a request (see sfHttp_setHost).
|
||||||
/// Any missing mandatory header field in the request will be added
|
/// Any missing mandatory header field in the request will be added
|
||||||
/// with an appropriate value.
|
/// with an appropriate value.
|
||||||
/// Warning: this function waits for the server's response and may
|
/// Warning: this function waits for the server's response and may
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -46,19 +46,19 @@ typedef struct
|
|||||||
/// \brief Empty object that represents invalid addresses
|
/// \brief Empty object that represents invalid addresses
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_NETWORK_API sfIpAddress sfIpAddress_None;
|
CSFML_NETWORK_API const sfIpAddress sfIpAddress_None;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Local host IP address (127.0.0.1, or "localhost")
|
/// \brief Local host IP address (127.0.0.1, or "localhost")
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_NETWORK_API sfIpAddress sfIpAddress_LocalHost;
|
CSFML_NETWORK_API const sfIpAddress sfIpAddress_LocalHost;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief UDP broadcast address (255.255.255.255)
|
/// \brief UDP broadcast address (255.255.255.255)
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_NETWORK_API sfIpAddress sfIpAddress_Broadcast;
|
CSFML_NETWORK_API const sfIpAddress sfIpAddress_Broadcast;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Create an address from a string
|
/// \brief Create an address from a string
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -49,7 +49,7 @@ CSFML_NETWORK_API sfPacket* sfPacket_create(void);
|
|||||||
/// \return A new sfPacket object which is a copy of \a packet
|
/// \return A new sfPacket object which is a copy of \a packet
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_NETWORK_API sfPacket* sfPacket_copy(sfPacket* packet);
|
CSFML_NETWORK_API sfPacket* sfPacket_copy(const sfPacket* packet);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Destroy a packet
|
/// \brief Destroy a packet
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -49,7 +49,7 @@ CSFML_NETWORK_API sfSocketSelector* sfSocketSelector_create(void);
|
|||||||
/// \return A new sfSocketSelector object which is a copy of \a selector
|
/// \return A new sfSocketSelector object which is a copy of \a selector
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_NETWORK_API sfSocketSelector* sfSocketSelector_copy(sfSocketSelector* selector);
|
CSFML_NETWORK_API sfSocketSelector* sfSocketSelector_copy(const sfSocketSelector* selector);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Destroy a socket selector
|
/// \brief Destroy a socket selector
|
||||||
@@ -121,7 +121,7 @@ CSFML_NETWORK_API sfBool sfSocketSelector_wait(sfSocketSelector* selector, sfTim
|
|||||||
/// \brief Test a socket to know if it is ready to receive data
|
/// \brief Test a socket to know if it is ready to receive data
|
||||||
///
|
///
|
||||||
/// This function must be used after a call to
|
/// This function must be used after a call to
|
||||||
/// sfSocketSelector_Wait, to know which sockets are ready to
|
/// sfSocketSelector_wait, to know which sockets are ready to
|
||||||
/// receive data. If a socket is ready, a call to Receive will
|
/// receive data. If a socket is ready, a call to Receive will
|
||||||
/// never block because we know that there is data available to read.
|
/// never block because we know that there is data available to read.
|
||||||
/// Note that if this function returns sfTrue for a sfTcpListener,
|
/// Note that if this function returns sfTrue for a sfTcpListener,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -54,7 +54,7 @@ CSFML_NETWORK_API void sfTcpListener_destroy(sfTcpListener* listener);
|
|||||||
///
|
///
|
||||||
/// In blocking mode, calls will not return until they have
|
/// In blocking mode, calls will not return until they have
|
||||||
/// completed their task. For example, a call to
|
/// completed their task. For example, a call to
|
||||||
/// sfTcpListener_Accept in blocking mode won't return until
|
/// sfTcpListener_accept in blocking mode won't return until
|
||||||
/// a new connection was actually received.
|
/// a new connection was actually received.
|
||||||
/// In non-blocking mode, calls will always return immediately,
|
/// In non-blocking mode, calls will always return immediately,
|
||||||
/// using the return code to signal whether there was data
|
/// using the return code to signal whether there was data
|
||||||
@@ -112,6 +112,10 @@ CSFML_NETWORK_API sfSocketStatus sfTcpListener_listen(sfTcpListener* listener, u
|
|||||||
/// If the socket is in blocking mode, this function will
|
/// If the socket is in blocking mode, this function will
|
||||||
/// not return until a connection is actually received.
|
/// not return until a connection is actually received.
|
||||||
///
|
///
|
||||||
|
/// The \a connected argument points to a valid sfTcpSocket pointer
|
||||||
|
/// in case of success (the function returns sfSocketDone), it points
|
||||||
|
/// to a NULL pointer otherwise.
|
||||||
|
///
|
||||||
/// \param listener TCP listener object
|
/// \param listener TCP listener object
|
||||||
/// \param connected Socket that will hold the new connection
|
/// \param connected Socket that will hold the new connection
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -119,7 +119,7 @@ CSFML_NETWORK_API sfSocketStatus sfUdpSocket_bind(sfUdpSocket* socket, unsigned
|
|||||||
/// \param socket UDP socket object
|
/// \param socket UDP socket object
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_NETWORK_API void sfUdpSocket_Unbind(sfUdpSocket* socket);
|
CSFML_NETWORK_API void sfUdpSocket_unbind(sfUdpSocket* socket);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Send raw data to a remote peer with a UDP socket
|
/// \brief Send raw data to a remote peer with a UDP socket
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -49,7 +49,7 @@ CSFML_SYSTEM_API sfClock* sfClock_create(void);
|
|||||||
/// \return A new sfClock object which is a copy of \a clock
|
/// \return A new sfClock object which is a copy of \a clock
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_SYSTEM_API sfClock* sfClock_copy(sfClock* clock);
|
CSFML_SYSTEM_API sfClock* sfClock_copy(const sfClock* clock);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Destroy a clock
|
/// \brief Destroy a clock
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)//
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
+81
-50
@@ -1,7 +1,8 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)//
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
//
|
//
|
||||||
@@ -31,6 +32,7 @@
|
|||||||
#include <SFML/Window/Joystick.h>
|
#include <SFML/Window/Joystick.h>
|
||||||
#include <SFML/Window/Keyboard.h>
|
#include <SFML/Window/Keyboard.h>
|
||||||
#include <SFML/Window/Mouse.h>
|
#include <SFML/Window/Mouse.h>
|
||||||
|
#include <SFML/Window/Sensor.h>
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
@@ -39,24 +41,30 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
sfEvtClosed,
|
sfEvtClosed, ///< The window requested to be closed (no data)
|
||||||
sfEvtResized,
|
sfEvtResized, ///< The window was resized (data in event.size)
|
||||||
sfEvtLostFocus,
|
sfEvtLostFocus, ///< The window lost the focus (no data)
|
||||||
sfEvtGainedFocus,
|
sfEvtGainedFocus, ///< The window gained the focus (no data)
|
||||||
sfEvtTextEntered,
|
sfEvtTextEntered, ///< A character was entered (data in event.text)
|
||||||
sfEvtKeyPressed,
|
sfEvtKeyPressed, ///< A key was pressed (data in event.key)
|
||||||
sfEvtKeyReleased,
|
sfEvtKeyReleased, ///< A key was released (data in event.key)
|
||||||
sfEvtMouseWheelMoved,
|
sfEvtMouseWheelMoved, ///< The mouse wheel was scrolled (data in event.mouseWheel)
|
||||||
sfEvtMouseButtonPressed,
|
sfEvtMouseButtonPressed, ///< A mouse button was pressed (data in event.mouseButton)
|
||||||
sfEvtMouseButtonReleased,
|
sfEvtMouseButtonReleased, ///< A mouse button was released (data in event.mouseButton)
|
||||||
sfEvtMouseMoved,
|
sfEvtMouseMoved, ///< The mouse cursor moved (data in event.mouseMove)
|
||||||
sfEvtMouseEntered,
|
sfEvtMouseEntered, ///< The mouse cursor entered the area of the window (no data)
|
||||||
sfEvtMouseLeft,
|
sfEvtMouseLeft, ///< The mouse cursor left the area of the window (no data)
|
||||||
sfEvtJoystickButtonPressed,
|
sfEvtJoystickButtonPressed, ///< A joystick button was pressed (data in event.joystickButton)
|
||||||
sfEvtJoystickButtonReleased,
|
sfEvtJoystickButtonReleased, ///< A joystick button was released (data in event.joystickButton)
|
||||||
sfEvtJoystickMoved,
|
sfEvtJoystickMoved, ///< The joystick moved along an axis (data in event.joystickMove)
|
||||||
sfEvtJoystickConnected,
|
sfEvtJoystickConnected, ///< A joystick was connected (data in event.joystickConnect)
|
||||||
sfEvtJoystickDisconnected
|
sfEvtJoystickDisconnected, ///< A joystick was disconnected (data in event.joystickConnect)
|
||||||
|
sfEvtTouchBegan, ///< A touch event began (data in event.touch)
|
||||||
|
sfEvtTouchMoved, ///< A touch moved (data in event.touch)
|
||||||
|
sfEvtTouchEnded, ///< A touch event ended (data in event.touch)
|
||||||
|
sfEvtSensorChanged, ///< A sensor value changed (data in event.sensor)
|
||||||
|
|
||||||
|
sfEvtCount, ///< Keep last -- the total number of event types
|
||||||
} sfEventType;
|
} sfEventType;
|
||||||
|
|
||||||
|
|
||||||
@@ -64,7 +72,7 @@ typedef enum
|
|||||||
/// \brief Keyboard event parameters
|
/// \brief Keyboard event parameters
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
struct sfKeyEvent
|
typedef struct
|
||||||
{
|
{
|
||||||
sfEventType type;
|
sfEventType type;
|
||||||
sfKeyCode code;
|
sfKeyCode code;
|
||||||
@@ -72,97 +80,121 @@ struct sfKeyEvent
|
|||||||
sfBool control;
|
sfBool control;
|
||||||
sfBool shift;
|
sfBool shift;
|
||||||
sfBool system;
|
sfBool system;
|
||||||
};
|
} sfKeyEvent;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Text event parameters
|
/// \brief Text event parameters
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
struct sfTextEvent
|
typedef struct
|
||||||
{
|
{
|
||||||
sfEventType type;
|
sfEventType type;
|
||||||
sfUint32 unicode;
|
sfUint32 unicode;
|
||||||
};
|
} sfTextEvent;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Mouse move event parameters
|
/// \brief Mouse move event parameters
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
struct sfMouseMoveEvent
|
typedef struct
|
||||||
{
|
{
|
||||||
sfEventType type;
|
sfEventType type;
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
};
|
} sfMouseMoveEvent;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Mouse buttons events parameters
|
/// \brief Mouse buttons events parameters
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
struct sfMouseButtonEvent
|
typedef struct
|
||||||
{
|
{
|
||||||
sfEventType type;
|
sfEventType type;
|
||||||
sfMouseButton button;
|
sfMouseButton button;
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
};
|
} sfMouseButtonEvent;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Mouse wheel events parameters
|
/// \brief Mouse wheel events parameters
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
struct sfMouseWheelEvent
|
typedef struct
|
||||||
{
|
{
|
||||||
sfEventType type;
|
sfEventType type;
|
||||||
int delta;
|
int delta;
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
};
|
} sfMouseWheelEvent;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Joystick axis move event parameters
|
/// \brief Joystick axis move event parameters
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
struct sfJoystickMoveEvent
|
typedef struct
|
||||||
{
|
{
|
||||||
sfEventType type;
|
sfEventType type;
|
||||||
unsigned int joystickId;
|
unsigned int joystickId;
|
||||||
sfJoystickAxis axis;
|
sfJoystickAxis axis;
|
||||||
float position;
|
float position;
|
||||||
};
|
} sfJoystickMoveEvent;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Joystick buttons events parameters
|
/// \brief Joystick buttons events parameters
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
struct sfJoystickButtonEvent
|
typedef struct
|
||||||
{
|
{
|
||||||
sfEventType type;
|
sfEventType type;
|
||||||
unsigned int joystickId;
|
unsigned int joystickId;
|
||||||
unsigned int button;
|
unsigned int button;
|
||||||
};
|
} sfJoystickButtonEvent;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Joystick connection/disconnection event parameters
|
/// \brief Joystick connection/disconnection event parameters
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
struct sfJoystickConnectEvent
|
typedef struct
|
||||||
{
|
{
|
||||||
sfEventType type;
|
sfEventType type;
|
||||||
unsigned int joystickId;
|
unsigned int joystickId;
|
||||||
};
|
} sfJoystickConnectEvent;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Size events parameters
|
/// \brief Size events parameters
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
struct sfSizeEvent
|
typedef struct
|
||||||
{
|
{
|
||||||
sfEventType type;
|
sfEventType type;
|
||||||
unsigned int width;
|
unsigned int width;
|
||||||
unsigned int height;
|
unsigned int height;
|
||||||
};
|
} sfSizeEvent;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Touch events parameters
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sfEventType type;
|
||||||
|
unsigned int finger;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
} sfTouchEvent;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Sensor event parameters
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sfEventType type;
|
||||||
|
sfSensorType sensorType;
|
||||||
|
float x;
|
||||||
|
float y;
|
||||||
|
float z;
|
||||||
|
} sfSensorEvent;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief sfEvent defines a system event and its parameters
|
/// \brief sfEvent defines a system event and its parameters
|
||||||
@@ -170,19 +202,18 @@ struct sfSizeEvent
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
typedef union
|
typedef union
|
||||||
{
|
{
|
||||||
////////////////////////////////////////////////////////////
|
sfEventType type; ///< Type of the event
|
||||||
// Member data
|
sfSizeEvent size; ///< Size event parameters
|
||||||
////////////////////////////////////////////////////////////
|
sfKeyEvent key; ///< Key event parameters
|
||||||
sfEventType type; ///< Type of the event
|
sfTextEvent text; ///< Text event parameters
|
||||||
struct sfSizeEvent size;
|
sfMouseMoveEvent mouseMove; ///< Mouse move event parameters
|
||||||
struct sfKeyEvent key;
|
sfMouseButtonEvent mouseButton; ///< Mouse button event parameters
|
||||||
struct sfTextEvent text;
|
sfMouseWheelEvent mouseWheel; ///< Mouse wheel event parameters
|
||||||
struct sfMouseMoveEvent mouseMove;
|
sfJoystickMoveEvent joystickMove; ///< Joystick move event parameters
|
||||||
struct sfMouseButtonEvent mouseButton;
|
sfJoystickButtonEvent joystickButton; ///< Joystick button event parameters
|
||||||
struct sfMouseWheelEvent mouseWheel;
|
sfJoystickConnectEvent joystickConnect; ///< Joystick (dis)connect event parameters
|
||||||
struct sfJoystickMoveEvent joystickMove;
|
sfTouchEvent touch; ///< Touch events parameters
|
||||||
struct sfJoystickButtonEvent joystickButton;
|
sfSensorEvent sensor; ///< Sensor event parameters
|
||||||
struct sfJoystickConnectEvent joystickConnect;
|
|
||||||
} sfEvent;
|
} sfEvent;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)//
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
//
|
//
|
||||||
@@ -28,6 +29,7 @@
|
|||||||
// Headers
|
// Headers
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
#include <SFML/Window/Export.h>
|
#include <SFML/Window/Export.h>
|
||||||
|
#include <SFML/Window/JoystickIdentification.h>
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
@@ -120,6 +122,19 @@ CSFML_WINDOW_API sfBool sfJoystick_isButtonPressed(unsigned int joystick, unsign
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_WINDOW_API float sfJoystick_getAxisPosition(unsigned int joystick, sfJoystickAxis axis);
|
CSFML_WINDOW_API float sfJoystick_getAxisPosition(unsigned int joystick, sfJoystickAxis axis);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get the joystick information
|
||||||
|
///
|
||||||
|
/// The result of this function will only remain valid until
|
||||||
|
/// the next time the function is called.
|
||||||
|
///
|
||||||
|
/// \param joystick Index of the joystick
|
||||||
|
///
|
||||||
|
/// \return Structure containing joystick information.
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_WINDOW_API sfJoystickIdentification sfJoystick_getIdentification(unsigned int joystick);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Update the states of all joysticks
|
/// \brief Update the states of all joysticks
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// SFML - Simple and Fast Multimedia Library
|
||||||
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
|
//
|
||||||
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
//
|
||||||
|
// Permission is granted to anyone to use this software for any purpose,
|
||||||
|
// including commercial applications, and to alter it and redistribute it freely,
|
||||||
|
// subject to the following restrictions:
|
||||||
|
//
|
||||||
|
// 1. The origin of this software must not be misrepresented;
|
||||||
|
// you must not claim that you wrote the original software.
|
||||||
|
// If you use this software in a product, an acknowledgment
|
||||||
|
// in the product documentation would be appreciated but is not required.
|
||||||
|
//
|
||||||
|
// 2. Altered source versions must be plainly marked as such,
|
||||||
|
// and must not be misrepresented as being the original software.
|
||||||
|
//
|
||||||
|
// 3. This notice may not be removed or altered from any source distribution.
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef SFML_JOYSTICKIDENDIFICATION_H
|
||||||
|
#define SFML_JOYSTICKIDENDIFICATION_H
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
// Headers
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
#include <SFML/Window/Export.h>
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// sfJoystickIdentification holds a joystick's identification
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
const char* name;
|
||||||
|
unsigned int vendorId;
|
||||||
|
unsigned int productId;
|
||||||
|
} sfJoystickIdentification;
|
||||||
|
|
||||||
|
|
||||||
|
#endif // SFML_JOYSTICKIDENDIFICATION_H
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)//
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
//
|
//
|
||||||
@@ -36,6 +37,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
sfKeyUnknown = -1, ///< Unhandled key
|
||||||
sfKeyA, ///< The A key
|
sfKeyA, ///< The A key
|
||||||
sfKeyB, ///< The B key
|
sfKeyB, ///< The B key
|
||||||
sfKeyC, ///< The C key
|
sfKeyC, ///< The C key
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)//
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -0,0 +1,89 @@
|
|||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// SFML - Simple and Fast Multimedia Library
|
||||||
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
|
//
|
||||||
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
//
|
||||||
|
// Permission is granted to anyone to use this software for any purpose,
|
||||||
|
// including commercial applications, and to alter it and redistribute it freely,
|
||||||
|
// subject to the following restrictions:
|
||||||
|
//
|
||||||
|
// 1. The origin of this software must not be misrepresented;
|
||||||
|
// you must not claim that you wrote the original software.
|
||||||
|
// If you use this software in a product, an acknowledgment
|
||||||
|
// in the product documentation would be appreciated but is not required.
|
||||||
|
//
|
||||||
|
// 2. Altered source versions must be plainly marked as such,
|
||||||
|
// and must not be misrepresented as being the original software.
|
||||||
|
//
|
||||||
|
// 3. This notice may not be removed or altered from any source distribution.
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef SFML_SENSOR_H
|
||||||
|
#define SFML_SENSOR_H
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
// Headers
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
#include <SFML/Window/Export.h>
|
||||||
|
#include <SFML/Window/Types.h>
|
||||||
|
#include <SFML/System/Vector3.h>
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Sensor Types
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sfSensorAccelerometer, ///< Measures the raw acceleration (m/s^2)
|
||||||
|
sfSensorGyroscope, ///< Measures the raw rotation rates (degrees/s)
|
||||||
|
sfSensorMagnetometer, ///< Measures the ambient magnetic field (micro-teslas)
|
||||||
|
sfSensorGravity, ///< Measures the direction and intensity of gravity, independent of device acceleration (m/s^2)
|
||||||
|
sfSensorUserAcceleration, ///< Measures the direction and intensity of device acceleration, independent of the gravity (m/s^2)
|
||||||
|
sfSensorOrientation, ///< Measures the absolute 3D orientation (degrees)
|
||||||
|
|
||||||
|
sfSensorCount ///< Keep last -- the total number of sensor types
|
||||||
|
} sfSensorType;
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Check if a sensor is available on the underlying platform
|
||||||
|
///
|
||||||
|
/// \param sensor Sensor to check
|
||||||
|
///
|
||||||
|
/// \return sfTrue if the sensor is available, sfFalse otherwise
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_WINDOW_API sfBool sfSensor_isAvailable(sfSensorType sensor);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Enable or disable a sensor
|
||||||
|
///
|
||||||
|
/// All sensors are disabled by default, to avoid consuming too
|
||||||
|
/// much battery power. Once a sensor is enabled, it starts
|
||||||
|
/// sending events of the corresponding type.
|
||||||
|
///
|
||||||
|
/// This function does nothing if the sensor is unavailable.
|
||||||
|
///
|
||||||
|
/// \param sensor Sensor to enable
|
||||||
|
/// \param enabled sfTrue to enable, sfFalse to disable
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_WINDOW_API void sfSensor_setEnabled(sfSensorType sensor, sfBool enabled);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get the current sensor value
|
||||||
|
///
|
||||||
|
/// \param sensor Sensor to read
|
||||||
|
///
|
||||||
|
/// \return The current sensor value
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_WINDOW_API sfVector3f sfSensor_getValue(sfSensorType sensor);
|
||||||
|
|
||||||
|
|
||||||
|
#endif // SFML_SENSOR_H
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// SFML - Simple and Fast Multimedia Library
|
||||||
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
|
//
|
||||||
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
//
|
||||||
|
// Permission is granted to anyone to use this software for any purpose,
|
||||||
|
// including commercial applications, and to alter it and redistribute it freely,
|
||||||
|
// subject to the following restrictions:
|
||||||
|
//
|
||||||
|
// 1. The origin of this software must not be misrepresented;
|
||||||
|
// you must not claim that you wrote the original software.
|
||||||
|
// If you use this software in a product, an acknowledgment
|
||||||
|
// in the product documentation would be appreciated but is not required.
|
||||||
|
//
|
||||||
|
// 2. Altered source versions must be plainly marked as such,
|
||||||
|
// and must not be misrepresented as being the original software.
|
||||||
|
//
|
||||||
|
// 3. This notice may not be removed or altered from any source distribution.
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef SFML_TOUCH_H
|
||||||
|
#define SFML_TOUCH_H
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
// Headers
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
#include <SFML/Window/Export.h>
|
||||||
|
#include <SFML/Window/Types.h>
|
||||||
|
#include <SFML/System/Vector2.h>
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Check if a touch event is currently down
|
||||||
|
///
|
||||||
|
/// \param finger Finger index
|
||||||
|
///
|
||||||
|
/// \return sfTrue if \a finger is currently touching the screen, sfFalse otherwise
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_WINDOW_API sfBool sfTouch_isDown(unsigned int finger);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get the current position of a touch in window coordinates
|
||||||
|
///
|
||||||
|
/// This function returns the current touch position
|
||||||
|
/// relative to the given window, or desktop if NULL is passed.
|
||||||
|
///
|
||||||
|
/// \param finger Finger index
|
||||||
|
/// \param relativeTo Reference window
|
||||||
|
///
|
||||||
|
/// \return Current position of \a finger, or undefined if it's not down
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_WINDOW_API sfVector2i sfTouch_getPosition(unsigned int finger, const sfWindow* relativeTo);
|
||||||
|
|
||||||
|
|
||||||
|
#endif // SFML_TOUCH_H
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)//
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
/// \brief Enumeration of window creation styles
|
/// \brief Enumeration of window creation styles
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
enum
|
typedef enum
|
||||||
{
|
{
|
||||||
sfNone = 0, ///< No border / title bar (this flag and all others are mutually exclusive)
|
sfNone = 0, ///< No border / title bar (this flag and all others are mutually exclusive)
|
||||||
sfTitlebar = 1 << 0, ///< Title bar + fixed border
|
sfTitlebar = 1 << 0, ///< Title bar + fixed border
|
||||||
@@ -48,7 +48,7 @@ enum
|
|||||||
sfClose = 1 << 2, ///< Titlebar + close button
|
sfClose = 1 << 2, ///< Titlebar + close button
|
||||||
sfFullscreen = 1 << 3, ///< Fullscreen mode (this flag and all others are mutually exclusive)
|
sfFullscreen = 1 << 3, ///< Fullscreen mode (this flag and all others are mutually exclusive)
|
||||||
sfDefaultStyle = sfTitlebar | sfResize | sfClose ///< Default window style
|
sfDefaultStyle = sfTitlebar | sfResize | sfClose ///< Default window style
|
||||||
};
|
} sfWindowStyle;
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
@@ -88,6 +88,29 @@ typedef struct
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_WINDOW_API sfWindow* sfWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings);
|
CSFML_WINDOW_API sfWindow* sfWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Construct a new window (with a UTF-32 title)
|
||||||
|
///
|
||||||
|
/// This function creates the window with the size and pixel
|
||||||
|
/// depth defined in \a mode. An optional style can be passed to
|
||||||
|
/// customize the look and behaviour of the window (borders,
|
||||||
|
/// title bar, resizable, closable, ...). If \a style contains
|
||||||
|
/// sfFullscreen, then \a mode must be a valid video mode.
|
||||||
|
///
|
||||||
|
/// The fourth parameter is a pointer to a structure specifying
|
||||||
|
/// advanced OpenGL context settings such as antialiasing,
|
||||||
|
/// depth-buffer bits, etc.
|
||||||
|
///
|
||||||
|
/// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window)
|
||||||
|
/// \param title Title of the window (UTF-32)
|
||||||
|
/// \param style Window style
|
||||||
|
/// \param settings Additional settings for the underlying OpenGL context
|
||||||
|
///
|
||||||
|
/// \return A new sfWindow object
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_WINDOW_API sfWindow* sfWindow_createUnicode(sfVideoMode mode, const sfUint32* title, sfUint32 style, const sfContextSettings* settings);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Construct a window from an existing control
|
/// \brief Construct a window from an existing control
|
||||||
///
|
///
|
||||||
@@ -132,7 +155,7 @@ CSFML_WINDOW_API void sfWindow_close(sfWindow* window);
|
|||||||
/// \brief Tell whether or not a window is opened
|
/// \brief Tell whether or not a window is opened
|
||||||
///
|
///
|
||||||
/// This function returns whether or not the window exists.
|
/// This function returns whether or not the window exists.
|
||||||
/// Note that a hidden window (sfWindow_SetVisible(sfFalse)) will return
|
/// Note that a hidden window (sfWindow_setVisible(sfFalse)) will return
|
||||||
/// sfTrue.
|
/// sfTrue.
|
||||||
///
|
///
|
||||||
/// \param window Window object
|
/// \param window Window object
|
||||||
@@ -158,18 +181,18 @@ CSFML_WINDOW_API sfBool sfWindow_isOpen(const sfWindow* window);
|
|||||||
CSFML_WINDOW_API sfContextSettings sfWindow_getSettings(const sfWindow* window);
|
CSFML_WINDOW_API sfContextSettings sfWindow_getSettings(const sfWindow* window);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Pop the event on top of events stack, if any, and return it
|
/// \brief Pop the event on top of event queue, if any, and return it
|
||||||
///
|
///
|
||||||
/// This function is not blocking: if there's no pending event then
|
/// This function is not blocking: if there's no pending event then
|
||||||
/// it will return false and leave \a event unmodified.
|
/// it will return false and leave \a event unmodified.
|
||||||
/// Note that more than one event may be present in the events stack,
|
/// Note that more than one event may be present in the event queue,
|
||||||
/// thus you should always call this function in a loop
|
/// thus you should always call this function in a loop
|
||||||
/// to make sure that you process every pending event.
|
/// to make sure that you process every pending event.
|
||||||
///
|
///
|
||||||
/// \param window Window object
|
/// \param window Window object
|
||||||
/// \param event Event to be returned
|
/// \param event Event to be returned
|
||||||
///
|
///
|
||||||
/// \return sfTrue if an event was returned, or sfFalse if the events stack was empty
|
/// \return sfTrue if an event was returned, or sfFalse if the event queue was empty
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_WINDOW_API sfBool sfWindow_pollEvent(sfWindow* window, sfEvent* event);
|
CSFML_WINDOW_API sfBool sfWindow_pollEvent(sfWindow* window, sfEvent* event);
|
||||||
@@ -247,6 +270,15 @@ CSFML_WINDOW_API void sfWindow_setSize(sfWindow* window, sfVector2u size);
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_WINDOW_API void sfWindow_setTitle(sfWindow* window, const char* title);
|
CSFML_WINDOW_API void sfWindow_setTitle(sfWindow* window, const char* title);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Change the title of a window (with a UTF-32 string)
|
||||||
|
///
|
||||||
|
/// \param window Window object
|
||||||
|
/// \param title New title
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_WINDOW_API void sfWindow_setUnicodeTitle(sfWindow* window, const sfUint32* title);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Change a window's icon
|
/// \brief Change a window's icon
|
||||||
///
|
///
|
||||||
@@ -317,6 +349,7 @@ CSFML_WINDOW_API void sfWindow_setKeyRepeatEnabled(sfWindow* window, sfBool enab
|
|||||||
/// on the previous thread first if it was active.
|
/// on the previous thread first if it was active.
|
||||||
/// Only one window can be active on a thread at a time, thus
|
/// Only one window can be active on a thread at a time, thus
|
||||||
/// the window previously active (if any) automatically gets deactivated.
|
/// the window previously active (if any) automatically gets deactivated.
|
||||||
|
/// This is not to be confused with sfWindow_requestFocus().
|
||||||
///
|
///
|
||||||
/// \param window Window object
|
/// \param window Window object
|
||||||
/// \param active sfTrue to activate, sfFalse to deactivate
|
/// \param active sfTrue to activate, sfFalse to deactivate
|
||||||
@@ -326,6 +359,32 @@ CSFML_WINDOW_API void sfWindow_setKeyRepeatEnabled(sfWindow* window, sfBool enab
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_WINDOW_API sfBool sfWindow_setActive(sfWindow* window, sfBool active);
|
CSFML_WINDOW_API sfBool sfWindow_setActive(sfWindow* window, sfBool active);
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
/// \brief Request the current window to be made the active
|
||||||
|
/// foreground window
|
||||||
|
///
|
||||||
|
/// At any given time, only one window may have the input focus
|
||||||
|
/// to receive input events such as keystrokes or mouse events.
|
||||||
|
/// If a window requests focus, it only hints to the operating
|
||||||
|
/// system, that it would like to be focused. The operating system
|
||||||
|
/// is free to deny the request.
|
||||||
|
/// This is not to be confused with sfWindow_setActive().
|
||||||
|
///
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
CSFML_WINDOW_API void sfWindow_requestFocus(sfWindow* window);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Check whether the window has the input focus
|
||||||
|
///
|
||||||
|
/// At any given time, only one window may have the input focus
|
||||||
|
/// to receive input events such as keystrokes or most mouse
|
||||||
|
/// events.
|
||||||
|
///
|
||||||
|
/// \return True if window has focus, false otherwise
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_WINDOW_API sfBool sfWindow_hasFocus(const sfWindow* window);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Display on screen what has been rendered to the
|
/// \brief Display on screen what has been rendered to the
|
||||||
/// window so far
|
/// window so far
|
||||||
@@ -343,7 +402,7 @@ CSFML_WINDOW_API void sfWindow_display(sfWindow* window);
|
|||||||
/// \brief Limit the framerate to a maximum fixed frequency
|
/// \brief Limit the framerate to a maximum fixed frequency
|
||||||
///
|
///
|
||||||
/// If a limit is set, the window will use a small delay after
|
/// If a limit is set, the window will use a small delay after
|
||||||
/// each call to sfWindow_Display to ensure that the current frame
|
/// each call to sfWindow_display to ensure that the current frame
|
||||||
/// lasted long enough to match the framerate limit.
|
/// lasted long enough to match the framerate limit.
|
||||||
///
|
///
|
||||||
/// \param window Window object
|
/// \param window Window object
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
CSFML
|
CSFML
|
||||||
-----
|
-----
|
||||||
|
|
||||||
CSFML - Copyright (c) 2007-2011 Laurent Gomila - laurent.gom@gmail.com
|
CSFML - Copyright (C) 2007-2015 Laurent Gomila - laurent@sfml-dev.org
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or
|
This software is provided 'as-is', without any express or
|
||||||
implied warranty. In no event will the authors be held
|
implied warranty. In no event will the authors be held
|
||||||
|
|||||||
+10
-5
@@ -8,12 +8,12 @@ It is originally written in C++, and this project is its official binding for th
|
|||||||
Authors
|
Authors
|
||||||
-------
|
-------
|
||||||
|
|
||||||
Laurent Gomila - main developer (laurent.gom@gmail.com)
|
Laurent Gomila - main developer (laurent@sfml-dev.org)
|
||||||
|
|
||||||
Download
|
Download
|
||||||
--------
|
--------
|
||||||
|
|
||||||
You can get the latest official release on SFML website (http://www.sfml-dev.org/download.php).
|
You can get the latest official release on SFML website (http://www.sfml-dev.org/download/csfml).
|
||||||
You can also get the current development version from the git repository (https://github.com/LaurentGomila/CSFML).
|
You can also get the current development version from the git repository (https://github.com/LaurentGomila/CSFML).
|
||||||
|
|
||||||
Learn
|
Learn
|
||||||
@@ -23,14 +23,19 @@ There is no tutorial for CSFML, but since it's a binding you can use the C++ res
|
|||||||
* The official tutorials (http://www.sfml-dev.org/tutorials/)
|
* The official tutorials (http://www.sfml-dev.org/tutorials/)
|
||||||
* The online API documentation (http://www.sfml-dev.org/documentation/)
|
* The online API documentation (http://www.sfml-dev.org/documentation/)
|
||||||
* The community wiki (https://github.com/LaurentGomila/SFML/wiki/)
|
* The community wiki (https://github.com/LaurentGomila/SFML/wiki/)
|
||||||
* The community forum (http://www.sfml-dev.org/forum/)
|
* The community forum (http://en.sfml-dev.org/forums/) (or http://fr.sfml-dev.org/forums/ for french people)
|
||||||
|
|
||||||
Of course, you can also find the CSFM API documentation in the SDK.
|
Of course, you can also find the CSFM API documentation in the SDK.
|
||||||
|
|
||||||
|
Building
|
||||||
|
--------
|
||||||
|
|
||||||
|
The FindSFML.cmake script required by CMake to build CSFML, is located in SFML's cmake/Modules/ directory.
|
||||||
|
|
||||||
Contribute
|
Contribute
|
||||||
----------
|
----------
|
||||||
|
|
||||||
SFML and CSFML are open-source projects, and they need your help to go on growing and improving.
|
SFML and CSFML are open-source projects, and they need your help to go on growing and improving.
|
||||||
Don't hesitate to post suggestions or bug reports on the forum (http://www.sfml-dev.org/forum/),
|
Don't hesitate to post suggestions or bug reports on the forum (http://en.sfml-dev.org/forums/),
|
||||||
submit patches by e-mail, or post new bugs/features requests on the task tracker (https://github.com/LaurentGomila/CSFML/issues/).
|
submit patches by e-mail, or post new bugs/features requests on the task tracker (https://github.com/LaurentGomila/CSFML/issues/).
|
||||||
You can even fork the project on github, maintain your own version and send us pull requests periodically to merge your work.
|
You can even fork the project on GitHub, maintain your own version and send us pull requests periodically to merge your work.
|
||||||
@@ -32,4 +32,4 @@ set(SRC
|
|||||||
# define the csfml-audio target
|
# define the csfml-audio target
|
||||||
csfml_add_library(csfml-audio
|
csfml_add_library(csfml-audio
|
||||||
SOURCES ${SRC}
|
SOURCES ${SRC}
|
||||||
DEPENDS ${SFML_AUDIO_LIBRARY} ${SFML_SYSTEM_LIBRARY})
|
DEPENDS ${SFML_AUDIO_LIBRARY} ${SFML_SYSTEM_LIBRARY} ${SFML_AUDIO_DEPENDENCIES} ${SFML_SYSTEM_DEPENDENCIES})
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -74,3 +74,19 @@ sfVector3f sfListener_getDirection()
|
|||||||
sfVector3f direction = {sfmlDirection.x, sfmlDirection.y, sfmlDirection.z};
|
sfVector3f direction = {sfmlDirection.x, sfmlDirection.y, sfmlDirection.z};
|
||||||
return direction;
|
return direction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
void sfListener_setUpVector(sfVector3f upVector)
|
||||||
|
{
|
||||||
|
sf::Listener::setUpVector(upVector.x, upVector.y, upVector.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
sfVector3f sfListener_getUpVector()
|
||||||
|
{
|
||||||
|
sf::Vector3f sfmlUpVector = sf::Listener::getUpVector();
|
||||||
|
sfVector3f upVector = {sfmlUpVector.x, sfmlUpVector.y, sfmlUpVector.z};
|
||||||
|
return upVector;
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -38,7 +38,7 @@ sfSound* sfSound_create(void)
|
|||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
sfSound* sfSound_copy(sfSound* sound)
|
sfSound* sfSound_copy(const sfSound* sound)
|
||||||
{
|
{
|
||||||
CSFML_CHECK_RETURN(sound, NULL);
|
CSFML_CHECK_RETURN(sound, NULL);
|
||||||
|
|
||||||
@@ -196,7 +196,7 @@ sfVector3f sfSound_getPosition(const sfSound* sound)
|
|||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API sfBool sfSound_isRelativeToListener(const sfSound* sound)
|
sfBool sfSound_isRelativeToListener(const sfSound* sound)
|
||||||
{
|
{
|
||||||
CSFML_CALL_RETURN(sound, isRelativeToListener(), sfFalse);
|
CSFML_CALL_RETURN(sound, isRelativeToListener(), sfFalse);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -63,7 +63,7 @@ sfSoundBuffer* sfSoundBuffer_createFromMemory(const void* data, size_t sizeInByt
|
|||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromStream(sfInputStream* stream)
|
sfSoundBuffer* sfSoundBuffer_createFromStream(sfInputStream* stream)
|
||||||
{
|
{
|
||||||
CSFML_CHECK_RETURN(stream, NULL);
|
CSFML_CHECK_RETURN(stream, NULL);
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ sfSoundBuffer* sfSoundBuffer_createFromSamples(const sfInt16* samples, size_t sa
|
|||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
sfSoundBuffer* sfSoundBuffer_copy(sfSoundBuffer* soundBuffer)
|
sfSoundBuffer* sfSoundBuffer_copy(const sfSoundBuffer* soundBuffer)
|
||||||
{
|
{
|
||||||
CSFML_CHECK_RETURN(soundBuffer, NULL);
|
CSFML_CHECK_RETURN(soundBuffer, NULL);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// SFML - Simple and Fast Multimedia Library
|
// SFML - Simple and Fast Multimedia Library
|
||||||
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
|
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied warranty.
|
// This software is provided 'as-is', without any express or implied warranty.
|
||||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||||
@@ -48,9 +48,9 @@ void sfSoundRecorder_destroy(sfSoundRecorder* soundRecorder)
|
|||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
void sfSoundRecorder_start(sfSoundRecorder* soundRecorder, unsigned int sampleRate)
|
sfBool sfSoundRecorder_start(sfSoundRecorder* soundRecorder, unsigned int sampleRate)
|
||||||
{
|
{
|
||||||
CSFML_CALL(soundRecorder, start(sampleRate));
|
CSFML_CALL_RETURN(soundRecorder, start(sampleRate), sfFalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -71,5 +71,57 @@ unsigned int sfSoundRecorder_getSampleRate(const sfSoundRecorder* soundRecorder)
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
sfBool sfSoundRecorder_isAvailable(void)
|
sfBool sfSoundRecorder_isAvailable(void)
|
||||||
{
|
{
|
||||||
return sf::SoundRecorder::isAvailable() ? sfTrue : sfFalse;
|
return sf::SoundRecorder::isAvailable();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
void sfSoundRecorder_setProcessingInterval(sfSoundRecorder* soundRecorder, sfTime interval)
|
||||||
|
{
|
||||||
|
CSFML_CALL(soundRecorder, setProcessingInterval(interval));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
const char** sfSoundRecorder_getAvailableDevices(size_t* count)
|
||||||
|
{
|
||||||
|
static std::vector<std::string> stringDevices = sf::SoundRecorder::getAvailableDevices();
|
||||||
|
static std::vector<const char*> cstringDevices;
|
||||||
|
|
||||||
|
if (cstringDevices.empty() && !stringDevices.empty())
|
||||||
|
{
|
||||||
|
for (std::vector<std::string>::const_iterator it = stringDevices.begin(); it != stringDevices.end(); ++it)
|
||||||
|
{
|
||||||
|
cstringDevices.push_back(it->c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count)
|
||||||
|
*count = cstringDevices.size();
|
||||||
|
|
||||||
|
return !cstringDevices.empty() ? &cstringDevices[0] : NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
const char* sfSoundRecorder_getDefaultDevice()
|
||||||
|
{
|
||||||
|
static std::string defaultDevice = sf::SoundRecorder::getDefaultDevice();
|
||||||
|
|
||||||
|
return !defaultDevice.empty() ? defaultDevice.c_str() : NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
sfBool sfSoundRecorder_setDevice(sfSoundRecorder* soundRecorder, const char* name)
|
||||||
|
{
|
||||||
|
CSFML_CALL_RETURN(soundRecorder, setDevice(name), sfFalse);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
const char* sfSoundRecorder_getDevice(sfSoundRecorder* soundRecorder)
|
||||||
|
{
|
||||||
|
CSFML_CHECK_RETURN(soundRecorder, NULL);
|
||||||
|
|
||||||
|
soundRecorder->DeviceName = soundRecorder->This.getDevice();
|
||||||
|
|
||||||
|
return soundRecorder->DeviceName.c_str();
|
||||||
}
|
}
|
||||||
Loaded 100 of 182 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user