89 Commits
Author SHA1 Message Date
Zachariah Brown 2e272c187f Merge pull request #75 from SFML/feature/2.3_prep
Bumped version number to 2.3 and updated readme.txt
2015-05-21 12:45:47 -04:00
Zachariah Brown 910bcc86d0 Merge pull request #80 from vonagam/fix_rpath_for_os_x
Fix rpath for OS X
2015-05-21 12:44:48 -04:00
Dmitry Maganov 448949ef7a fix rpath for OS X 2015-05-19 22:42:38 +06:00
Zachariah Brown 33bf91a1da Bumped version number to 2.3 and updated readme.txt 2015-05-07 08:43:08 -04:00
Laurent Gomila 9f4c4abaca Merge pull request #77 from Gyscos/master
Use size_t instead of unsigned int to follow SFML change
2015-05-02 10:12:59 +02:00
Laurent Gomila 4069448128 Merge pull request #78 from BlaXpirit/feature/color_subtract
Added subtract function for Colors
2015-05-01 22:21:06 +02:00
Alexandre Bury 4720e109b6 Use size_t instead of unsigned int in Graphics
Also use sfUint64 for sampleCount in sfSoundBuffer_createFromSamples
2015-05-01 13:20:43 -07:00
Laurent Gomila f3153dc9c1 Merge pull request #79 from SFML/feature/precise_mouse_events
Added support for the MouseWheelScrolled event
2015-05-01 22:20:19 +02:00
Zachariah Brown a424e91a54 Added support for the MouseWheelScrolled event 2015-05-01 15:20:45 -04:00
Oleh Prypin 1d0d7164c8 Added subtract function for Colors 2015-05-01 21:09:52 +03:00
Laurent Gomila 1486a30e2f Merge pull request #74 from LaurentGomila/feature/gl_improvements
Added support for context creation flags and texture/shader native handles
2015-03-31 15:08:25 +02:00
Zachariah Brown 88a59374bc Added support for context creation flags and texture/shader native handles 2015-03-31 08:14:32 -04:00
Laurent Gomila 78eea7face Merge pull request #76 from LaurentGomila/bugfix/missing_headers
Added missing headers to the general headers
2015-03-30 22:42:52 +02:00
Zachariah Brown 90b168aaaf Added missing includes to the general headers 2015-03-30 15:42:08 -04:00
Laurent Gomila 2ca7fbfb61 Merge pull request #71 from LaurentGomila/feature/color_int_ctor
Added the ctor to create a sfColor from an sfUint32
2015-03-22 22:39:29 +01:00
Zachariah Brown 2d9ae6cd04 Added the ctor to create a sfColor from an sfUint32 2015-03-22 14:48:16 -04:00
Laurent Gomila 0fe078ec8a Merge pull request #72 from LaurentGomila/feature/partial_send
Added support for patial TCP sends
2015-03-22 18:41:29 +01:00
Laurent Gomila 10d785df80 Merge pull request #73 from LaurentGomila/bugfix/sample_count_type
Changed getSampleCount return type to sfUint64 to better match SFML
2015-03-22 18:40:39 +01:00
Zachariah Brown 728a0e0002 Changed getSampleCount return type to sfUint64 to better match SFML 2015-03-22 07:05:47 -04:00
Zachariah Brown 3de58bfef4 Added support for patial TCP sends 2015-03-22 07:01:05 -04:00
Laurent Gomila 57d3ee0d89 Merge pull request #69 from jcowgill/fix-conversion-null
Fix pointer conversion warning when compiling without NDEBUG on Linux
2015-03-04 18:45:04 +01:00
James Cowgill e5c4b0927d Fix pointer conversion warning when compiling without NDEBUG on Linux 2015-03-03 22:43:34 +00:00
Laurent Gomila 141fbf55f6 Merge pull request #53 from eXpl0it3r/feature/version_2.2
Updated CSFML's version to 2.2.0.
2015-03-03 21:33:04 +01:00
Lukas Dürrenberger aad6f7b2d1 Updated CSFML's version to 2.2.0. 2015-02-28 11:25:49 +01:00
Laurent Gomila 944b267262 Merge pull request #67 from BlaXpirit/master
Remove non-ASCII symbols in Sensor.h
2015-02-27 17:52:57 +01:00
Laurent Gomila caf9aba55e Merge pull request #68 from zsbzsb/update/touch_get_position_renderwindow
Added sfTouch_getPositionRenderWindow(...) function
2015-02-27 17:51:40 +01:00
Zachariah Brown 109a02c829 Added sfTouch_getPositionRenderWindow(...) function 2015-02-26 21:30:37 -05:00
Oleh Prypin d849c0eae5 Removed non-ASCII symbols in Sensor.hpp
https://github.com/LaurentGomila/SFML/issues/806
2015-02-27 01:52:51 +02:00
Laurent Gomila 7c6e4e64b5 Merge pull request #66 from zsbzsb/bugfix/get_device_return
Fixed wrong macro usage preventing debug compilation
2015-02-26 20:33:14 +01:00
Zachariah Brown 93dd72dc26 Fixed wrong macro usage preventing debug compilation 2015-02-26 14:27:52 -05:00
Laurent Gomila 91a09b3ce5 Merge pull request #65 from zsbzsb/feature/sensor_touch_events
Added support for sensor and touch events
2015-02-26 19:51:46 +01:00
Zachariah Brown 7c5a55746a Added support for sensor and touch events 2015-02-26 12:00:22 -05:00
Laurent Gomila a499927784 Merge pull request #63 from zsbzsb/feature/touch_api
Added touch API
2015-02-26 15:17:43 +01:00
Zachariah Brown 4cc30a1f21 Added touch API 2015-02-26 09:05:41 -05:00
Laurent Gomila fb1824b3b0 Merge pull request #62 from zsbzsb/feature/sensor_api
Added sensor API
2015-02-26 14:09:30 +01:00
Zachariah Brown 1193ded996 Added sensor API 2015-02-26 07:57:12 -05:00
Laurent Gomila c1873e4499 Merge pull request #64 from zsbzsb/update/copyright_year
Fixed a few last old copyright years and email
2015-02-26 07:49:56 +01:00
Zachariah Brown 6ca48631aa Fixed a few last old copyright years and email 2015-02-25 11:56:03 -05:00
Laurent Gomila b7b2ed5d34 Merge pull request #61 from zsbzsb/update/copyright_year
Updated copyright year and email
2015-02-25 09:41:44 +01:00
Zachariah Brown f532c0dc98 Updated copyright year and email 2015-02-24 18:17:39 -05:00
Laurent Gomila 15009493e0 Merge pull request #60 from BlaXpirit/patch-1
Added HTTP methods
2015-02-24 22:57:41 +01:00
Oleh Prypin 2636bec9a1 Added HTTP methods 2015-02-24 22:51:20 +02:00
Laurent Gomila a7ff14c407 Merge pull request #59 from zsbzsb/feature/joystick_identification
Added support for joystick identification
2015-02-24 20:20:59 +01:00
Zachariah Brown 0e6c07a149 Added support for joystick identification 2015-02-24 12:03:32 -05:00
Laurent Gomila e10f7caecb Merge pull request #58 from zsbzsb/feature/fontinfo_struct
Added support for the Font::Info struct
2015-02-24 16:56:10 +01:00
Zachariah Brown 9f4120faf4 Added support for the Font::Info struct 2015-02-24 10:41:32 -05:00
Laurent Gomila 4789261e1e Merge pull request #57 from zsbzsb/feature/sound_recorder
Updated sfSoundRecorder
2015-02-24 15:19:14 +01:00
Zachariah Brown 58781d458e Updated SoundRecorder to support multiple recording devices 2015-02-24 09:03:31 -05:00
Laurent Gomila 6fa1212560 Merge pull request #56 from zsbzsb/feature/underline
Added underline functions to sfFont
2015-02-24 08:40:11 +01:00
Zachariah Brown 62188c38ec Added missing get underline thickness and position functions 2015-02-23 21:01:39 -05:00
Zachariah Brown 6667deca6f Removed excessive documentation to remain more consistant with the rest of the code base 2015-02-23 20:59:55 -05:00
Laurent Gomila 302048d29e Merge pull request #55 from eXpl0it3r/bugfix/readme
Updated the readme.txt and added a comment about FindSFML.cmake.
2015-01-06 16:28:19 +01:00
Lukas Dürrenberger c8b2e62da0 Updated the readme.txt and added a comment about FindSFML.cmake. 2015-01-06 16:17:01 +01:00
Laurent Gomila 2a2951e608 Merge pull request #51 from FRex/master
Added extern "C" inside ifdef __cplusplus to allow including and linking CSFML correctly in C++.
2015-01-02 17:23:54 +01:00
FRex 29382a4492 Added checks for __cplusplus so that CSFML can be used in C++. 2015-01-02 02:12:52 +01:00
Laurent Gomila 848b4d3aaa Merge pull request #49 from delehef/master
Compile with OS X 10.10
2014-11-22 23:09:56 +01:00
Franklin Delehelle 31ac05d8f4 Compile with OS X 10.10
Fixes the OS X version detection regex to allow compiling under OS X
10.10+.
2014-11-22 18:44:40 +01:00
Laurent Gomila 8de6cde2d1 Merge pull request #48 from zsbzsb/feature/window_focus
Added methods to check and request window focus
2014-10-09 22:48:24 +02:00
Zachariah Brown 766398d86e Added methods to check and request window focus 2014-10-09 15:23:25 -04:00
Laurent Gomila d105eded16 Merge pull request #47 from zsbzsb/update/font_metrics
Changed the font metrics to return floats instead of ints
2014-10-09 17:30:19 +02:00
Laurent Gomila 59a7060088 Merge pull request #46 from zsbzsb/feature/strike_through
Added text strikethrough and updated the style documentation
2014-10-09 17:30:05 +02:00
Zachariah Brown 1f8b022d17 Changed the font metrics to return floats instead of ints 2014-10-09 09:35:37 -04:00
Zachariah Brown 1529d3fa34 Added text strikethrough and updated the style documentation 2014-10-09 09:05:03 -04:00
Laurent Gomila c0b80724b4 Merge pull request #45 from zsbzsb/update/copyright_year
Updated copyright year
2014-10-03 07:58:12 +02:00
Zachariah Brown fdf58188ca Updated copyright year 2014-09-08 08:19:33 -04:00
Laurent Gomila 9a2c8d0ecb Merge pull request #43 from zsbzsb/feature/processing_interval
Updated CSFML to support sf::SoundRecorder::setProcessingInterval(...)
2014-09-05 21:12:48 +02:00
Zachariah Brown 87d69530a0 Updated CSFML to support sf::SoundRecorder::setProcessingInterval(...) 2014-09-05 14:52:22 -04:00
Laurent Gomila b790fbd28f Merge pull request #42 from zsbzsb/feature/up_vector
Updated CSFML to match the changes related to the up vector changes
2014-09-05 20:33:16 +02:00
Zachariah Brown 6abeaed4aa Updated CSFML to match the changes related to the up vector changes 2014-09-05 14:26:10 -04:00
Laurent Gomila 42c2fb1f5c Merge pull request #39 from ResponSySS/patch-1
Give a name to window style enum
2014-06-22 15:28:14 +02:00
ResponSyS ed44d9e0db Give a name to window style enum
Window style sfUint32 enum was unnanmed, which made it hard to find in the documentation.
2014-06-22 15:23:15 +02:00
Laurent Gomila 2a1a11ca4b Merge pull request #38 from zsbzsb/master
Updated CSFML to match the blending mode changes
2014-06-10 13:40:40 +02:00
Zachariah Brown d6849a3d57 Updated CSFML to match the blending mode changes 2014-06-09 16:57:44 -04:00
Laurent Gomila 8478569b4b Merge pull request #37 from zsbzsb/link_dynamically
Added CMake option to link dynamically
2014-06-06 23:24:55 +02:00
Zachariah Brown 4e509ff160 Added option to allow SFML to be linked dynamically 2014-06-06 16:38:20 -04:00
Laurent Gomila a6fdf83073 Merge pull request #36 from zsbzsb/master
Removed export macros in the function definitions
2014-04-11 08:32:55 +02:00
Laurent Gomila 4b4d84da0b Merge pull request #35 from eXpl0it3r/master
Renamed a few missed variables when the config filehad been updated.
2014-04-11 08:32:21 +02:00
Zachariah Brown ccf18cf8f9 Removed export macros in the function definitions 2014-04-10 21:07:35 -04:00
Lukas Dürrenberger b465c53afe Renamed a few missed variables when the config filehad been updated. 2014-04-11 02:57:30 +02:00
Laurent Gomila bc9ae12596 Added missing include in CMake file 2013-11-24 20:27:42 +01:00
Laurent Gomila 6669a6590a Updated build files to reflect the latest changes in SFML 2013-11-04 22:39:52 +01:00
Laurent Gomila 85a648ccc6 Removed useless line in build scripts 2013-09-02 17:41:18 +02:00
Laurent Gomila bd0faf69c5 Updated version number 2013-07-21 09:30:53 +02:00
Laurent Gomila 91e11cc095 sfTcpListener_accept now returns a null pointer when it fails 2013-07-09 15:46:17 +02:00
Laurent Gomila 12b7c5a6a5 Updated links in readme.txt 2013-06-26 23:31:12 +02:00
Laurent Gomila acfb53c8d5 Merge pull request #25 from krepa098/master
Added sfRenderTexture_set/isRepeated
2013-06-01 10:38:54 -07:00
krepa098 a707c5e0c7 added sfRenderTexture_setRepeated, sfRenderTexture_isRepeated 2013-06-01 18:05:41 +02:00
Laurent Gomila c7cabf8fb2 Added readme.txt to the install rules 2013-05-03 13:32:17 +02:00
Laurent Gomila f06b95526c Updated the documentation stylesheet 2013-04-25 21:40:56 +02:00
181 changed files with 2379 additions and 679 deletions

No files matched your search

+21 -11
View File
@@ -1,11 +1,17 @@
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8.3)
# 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 3)
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
View File
@@ -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()
+24 -57
View File
@@ -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,25 +32,38 @@ 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()
# link the target to its external dependencies (C++ SFML libraries) # link the target to its external dependencies (C++ SFML libraries)
target_link_libraries(${target} ${THIS_DEPENDS}) target_link_libraries(${target} ${THIS_DEPENDS})
# build dylibs
if(SFML_OS_MACOSX AND BUILD_SHARED_LIBS)
# adapt install directory to allow distributing dylibs in user’s application bundle
set_target_properties(${target} PROPERTIES
BUILD_WITH_INSTALL_RPATH 1
INSTALL_NAME_DIR "@rpath")
endif()
# add the install rule # add the install rule
install(TARGETS ${target} install(TARGETS ${target}
RUNTIME DESTINATION bin COMPONENT bin RUNTIME DESTINATION bin COMPONENT bin
+1 -3
View File
@@ -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
View File
@@ -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
View File
File diff suppressed because it is too large. Load diff
+7 -6
View File
@@ -1,8 +1,9 @@
</div>
<p id="footer"> <div id="footer-container">
&nbsp;::&nbsp; Copyright &copy; 2007 Laurent Gomila, all rights reserved &nbsp;::&nbsp; <div id="footer">
Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.5.2</a> &nbsp;::&nbsp; Copyright © Laurent Gomila &nbsp;::&nbsp;
</p> Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> &nbsp;::&nbsp;
</div>
</div>
</body> </body>
</html> </html>
+11 -8
View File
@@ -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">
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

+3 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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 +36,8 @@
#include <SFML/Audio/SoundBuffer.h> #include <SFML/Audio/SoundBuffer.h>
#include <SFML/Audio/SoundBufferRecorder.h> #include <SFML/Audio/SoundBufferRecorder.h>
#include <SFML/Audio/SoundRecorder.h> #include <SFML/Audio/SoundRecorder.h>
#include <SFML/Audio/SoundStatus.h>
#include <SFML/Audio/SoundStream.h>
#endif // SFML_AUDIO_H #endif // SFML_AUDIO_H
+1 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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 -10
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
+3 -3
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
@@ -92,7 +92,7 @@ CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromStream(sfInputStream* str
/// \return A new sfSoundBuffer object (NULL if failed) /// \return A new sfSoundBuffer object (NULL if failed)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromSamples(const sfInt16* samples, size_t sampleCount, unsigned int channelCount, unsigned int sampleRate); CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromSamples(const sfInt16* samples, sfUint64 sampleCount, unsigned int channelCount, unsigned int sampleRate);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Create a new sound buffer by copying an existing one /// \brief Create a new sound buffer by copying an existing one
@@ -152,7 +152,7 @@ CSFML_AUDIO_API const sfInt16* sfSoundBuffer_getSamples(const sfSoundBuffer* sou
/// \return Number of samples /// \return Number of samples
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_AUDIO_API size_t sfSoundBuffer_getSampleCount(const sfSoundBuffer* soundBuffer); CSFML_AUDIO_API sfUint64 sfSoundBuffer_getSampleCount(const sfSoundBuffer* soundBuffer);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get the sample rate of a sound buffer /// \brief Get the sample rate of a sound buffer
+1 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
+75 -2
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
+2 -1
View File
@@ -1,7 +1,8 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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 3
#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
+3 -2
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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,14 +35,15 @@
#include <SFML/Graphics/Color.h> #include <SFML/Graphics/Color.h>
#include <SFML/Graphics/ConvexShape.h> #include <SFML/Graphics/ConvexShape.h>
#include <SFML/Graphics/Font.h> #include <SFML/Graphics/Font.h>
#include <SFML/Graphics/FontInfo.h>
#include <SFML/Graphics/Glyph.h> #include <SFML/Graphics/Glyph.h>
#include <SFML/Graphics/Image.h> #include <SFML/Graphics/Image.h>
#include <SFML/Graphics/PrimitiveType.h> #include <SFML/Graphics/PrimitiveType.h>
#include <SFML/Graphics/Rect.h> #include <SFML/Graphics/Rect.h>
#include <SFML/Graphics/RectangleShape.h> #include <SFML/Graphics/RectangleShape.h>
#include <SFML/Graphics/RenderStates.h> #include <SFML/Graphics/RenderStates.h>
#include <SFML/Graphics/RenderWindow.h>
#include <SFML/Graphics/RenderTexture.h> #include <SFML/Graphics/RenderTexture.h>
#include <SFML/Graphics/RenderWindow.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/Sprite.h>
+44 -6
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
+5 -4
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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,6 +34,7 @@
#include <SFML/Graphics/Transform.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>
#include <stddef.h>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@@ -352,7 +353,7 @@ CSFML_GRAPHICS_API float sfCircleShape_getOutlineThickness(const sfCircleShape*
/// \return Number of points of the shape /// \return Number of points of the shape
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API unsigned int sfCircleShape_getPointCount(const sfCircleShape* shape); CSFML_GRAPHICS_API size_t sfCircleShape_getPointCount(const sfCircleShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get a point of a circle shape /// \brief Get a point of a circle shape
@@ -365,7 +366,7 @@ CSFML_GRAPHICS_API unsigned int sfCircleShape_getPointCount(const sfCircleShape*
/// \return Index-th point of the shape /// \return Index-th point of the shape
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfCircleShape_getPoint(const sfCircleShape* shape, unsigned int index); CSFML_GRAPHICS_API sfVector2f sfCircleShape_getPoint(const sfCircleShape* shape, size_t index);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Set the radius of a circle /// \brief Set the radius of a circle
@@ -393,7 +394,7 @@ CSFML_GRAPHICS_API float sfCircleShape_getRadius(const sfCircleShape* shape);
/// \param count New number of points of the circle /// \param count New number of points of the circle
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfCircleShape_setPointCount(sfCircleShape* shape, unsigned int count); CSFML_GRAPHICS_API void sfCircleShape_setPointCount(sfCircleShape* shape, size_t count);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get the local bounding rectangle of a circle shape /// \brief Get the local bounding rectangle of a circle shape
+30 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
@@ -80,6 +80,24 @@ CSFML_GRAPHICS_API sfColor sfColor_fromRGB(sfUint8 red, sfUint8 green, sfUint8 b
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfColor sfColor_fromRGBA(sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha); CSFML_GRAPHICS_API sfColor sfColor_fromRGBA(sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha);
////////////////////////////////////////////////////////////
/// \brief Construct the color from 32-bit unsigned integer
///
/// \param color Number containing the RGBA components (in that order)
///
/// \return sfColor constructed from the 32-bit unsigned integer
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfColor sfColor_fromInteger(sfUint32 color);
////////////////////////////////////////////////////////////
/// \brief Convert a color to a 32-bit unsigned integer
///
/// \return Color represented as a 32-bit unsigned integer
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfUint32 sfColor_toInteger(sfColor color);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Add two colors /// \brief Add two colors
/// ///
@@ -91,6 +109,17 @@ CSFML_GRAPHICS_API sfColor sfColor_fromRGBA(sfUint8 red, sfUint8 green, sfUint8
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfColor sfColor_add(sfColor color1, sfColor color2); CSFML_GRAPHICS_API sfColor sfColor_add(sfColor color1, sfColor color2);
////////////////////////////////////////////////////////////
/// \brief Subtract two colors
///
/// \param color1 First color
/// \param color2 Second color
///
/// \return Component-wise saturated subtraction of the two colors
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfColor sfColor_subtract(sfColor color1, sfColor color2);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Modulate two colors /// \brief Modulate two colors
/// ///
+6 -5
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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,6 +34,7 @@
#include <SFML/Graphics/Transform.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>
#include <stddef.h>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@@ -352,7 +353,7 @@ CSFML_GRAPHICS_API float sfConvexShape_getOutlineThickness(const sfConvexShape*
/// \return Number of points of the shape /// \return Number of points of the shape
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API unsigned int sfConvexShape_getPointCount(const sfConvexShape* shape); CSFML_GRAPHICS_API size_t sfConvexShape_getPointCount(const sfConvexShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get a point of a convex shape /// \brief Get a point of a convex shape
@@ -365,7 +366,7 @@ CSFML_GRAPHICS_API unsigned int sfConvexShape_getPointCount(const sfConvexShape*
/// \return Index-th point of the shape /// \return Index-th point of the shape
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfConvexShape_getPoint(const sfConvexShape* shape, unsigned int index); CSFML_GRAPHICS_API sfVector2f sfConvexShape_getPoint(const sfConvexShape* shape, size_t index);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Set the number of points of a convex shap /// \brief Set the number of points of a convex shap
@@ -376,7 +377,7 @@ CSFML_GRAPHICS_API sfVector2f sfConvexShape_getPoint(const sfConvexShape* shape,
/// \param count New number of points of the shape /// \param count New number of points of the shape
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfConvexShape_setPointCount(sfConvexShape* shape, unsigned int count); CSFML_GRAPHICS_API void sfConvexShape_setPointCount(sfConvexShape* shape, size_t count);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Set the position of a point in a convex shape /// \brief Set the position of a point in a convex shape
@@ -392,7 +393,7 @@ CSFML_GRAPHICS_API void sfConvexShape_setPointCount(sfConvexShape* shape, unsign
/// \param point New point /// \param point New point
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfConvexShape_setPoint(sfConvexShape* shape, unsigned int index, sfVector2f point); CSFML_GRAPHICS_API void sfConvexShape_setPoint(sfConvexShape* shape, size_t index, sfVector2f point);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get the local bounding rectangle of a convex shape /// \brief Get the local bounding rectangle of a convex shape
+1 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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 -4
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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>
@@ -108,7 +109,7 @@ 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
@@ -119,7 +120,34 @@ CSFML_GRAPHICS_API int sfFont_getKerning(sfFont* font, sfUint32 first, sfUint32
/// \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
@@ -132,5 +160,19 @@ 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 font information
///
/// 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 sfFontInfo sfFont_getInfo(const sfFont* font);
#endif // SFML_IMAGE_H
#endif // SFML_FONT_H
+42
View File
@@ -0,0 +1,42 @@
////////////////////////////////////////////////////////////
//
// 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_FONTINFO_H
#define SFML_FONTINFO_H
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics/Export.h>
////////////////////////////////////////////////////////////
/// sfFontInfo holds various information about a font
////////////////////////////////////////////////////////////
typedef struct
{
const char* family;
} sfFontInfo;
#endif // SFML_FONTINFO_H
+4 -4
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
+4 -3
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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,6 +34,7 @@
#include <SFML/Graphics/Transform.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>
#include <stddef.h>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@@ -352,7 +353,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 size_t sfRectangleShape_getPointCount(const sfRectangleShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get a point of a rectangle shape /// \brief Get a point of a rectangle shape
@@ -365,7 +366,7 @@ CSFML_GRAPHICS_API unsigned int sfRectangleShape_getPointCount(const sfRectangle
/// \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, size_t index);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Set the size of a rectangle shape /// \brief Set the size of a rectangle shape
+1 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
+21 -2
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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 +36,7 @@
#include <SFML/Graphics/RenderStates.h> #include <SFML/Graphics/RenderStates.h>
#include <SFML/Graphics/Vertex.h> #include <SFML/Graphics/Vertex.h>
#include <SFML/System/Vector2.h> #include <SFML/System/Vector2.h>
#include <stddef.h>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@@ -216,7 +217,7 @@ CSFML_GRAPHICS_API void sfRenderTexture_drawVertexArray(sfRenderTexture* renderT
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderTexture_drawPrimitives(sfRenderTexture* renderTexture, CSFML_GRAPHICS_API void sfRenderTexture_drawPrimitives(sfRenderTexture* renderTexture,
const sfVertex* vertices, unsigned int vertexCount, const sfVertex* vertices, size_t vertexCount,
sfPrimitiveType type, const sfRenderStates* states); sfPrimitiveType type, const sfRenderStates* states);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@@ -296,5 +297,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
+46 -5
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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,6 +40,7 @@
#include <SFML/Window/WindowHandle.h> #include <SFML/Window/WindowHandle.h>
#include <SFML/Window/Window.h> #include <SFML/Window/Window.h>
#include <SFML/System/Vector2.h> #include <SFML/System/Vector2.h>
#include <stddef.h>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@@ -247,6 +248,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
/// ///
@@ -415,7 +442,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_drawVertexArray(sfRenderWindow* renderWin
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_drawPrimitives(sfRenderWindow* renderWindow, CSFML_GRAPHICS_API void sfRenderWindow_drawPrimitives(sfRenderWindow* renderWindow,
const sfVertex* vertices, unsigned int vertexCount, const sfVertex* vertices, size_t vertexCount,
sfPrimitiveType type, const sfRenderStates* states); sfPrimitiveType type, const sfRenderStates* states);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@@ -485,20 +512,20 @@ 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 relatively to a render-window /// \brief Get the current position of the mouse relative to a render-window
/// ///
/// This function returns the current position of the mouse /// This function returns the current position of the mouse
/// cursor relative to the given render-window, or desktop if NULL is passed. /// cursor relative to the given render-window, or desktop if NULL is passed.
/// ///
/// \param relativeTo Reference window /// \param relativeTo Reference window
/// ///
/// \return Position of the mouse cursor, relative to the given render-window /// \return Position of the mouse cursor, relative to the given render window
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2i sfMouse_getPositionRenderWindow(const sfRenderWindow* relativeTo); CSFML_GRAPHICS_API sfVector2i sfMouse_getPositionRenderWindow(const sfRenderWindow* relativeTo);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Set the current position of the mouse relatively to a render-window /// \brief Set the current position of the mouse relative to a render window
/// ///
/// This function sets the current position of the mouse /// This function sets the current position of the mouse
/// cursor relative to the given render-window, or desktop if NULL is passed. /// cursor relative to the given render-window, or desktop if NULL is passed.
@@ -509,5 +536,19 @@ CSFML_GRAPHICS_API sfVector2i sfMouse_getPositionRenderWindow(const sfRenderWind
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfMouse_setPositionRenderWindow(sfVector2i position, const sfRenderWindow* relativeTo); 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
+15 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
@@ -349,6 +349,20 @@ CSFML_GRAPHICS_API void sfShader_setTextureParameter(sfShader* shader, const cha
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShader_setCurrentTextureParameter(sfShader* shader, const char* name); CSFML_GRAPHICS_API void sfShader_setCurrentTextureParameter(sfShader* shader, const char* name);
////////////////////////////////////////////////////////////
/// \brief Get the underlying OpenGL handle of the shader.
///
/// You shouldn't need to use this function, unless you have
/// very specific stuff to implement that SFML doesn't support,
/// or implement a temporary workaround until a bug is fixed.
///
/// \param shader Shader object
///
/// \return OpenGL handle of the shader or 0 if not yet loaded
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API unsigned int sfShader_getNativeHandle(const sfShader* shader);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Bind a shader for rendering (activate it) /// \brief Bind a shader for rendering (activate it)
/// ///
+6 -5
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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,10 +34,11 @@
#include <SFML/Graphics/Transform.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>
#include <stddef.h>
typedef unsigned int (*sfShapeGetPointCountCallback)(void*); ///< Type of the callback used to get the number of points in a shape typedef size_t (*sfShapeGetPointCountCallback)(void*); ///< Type of the callback used to get the number of points in a shape
typedef sfVector2f (*sfShapeGetPointCallback)(unsigned int, void*); ///< Type of the callback used to get a point of a shape typedef sfVector2f (*sfShapeGetPointCallback)(size_t, void*); ///< Type of the callback used to get a point of a shape
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Create a new shape /// \brief Create a new shape
@@ -351,7 +352,7 @@ CSFML_GRAPHICS_API float sfShape_getOutlineThickness(const sfShape* shape);
/// \return Number of points of the shape /// \return Number of points of the shape
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API unsigned int sfShape_getPointCount(const sfShape* shape); CSFML_GRAPHICS_API size_t sfShape_getPointCount(const sfShape* shape);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get a point of a shape /// \brief Get a point of a shape
@@ -364,7 +365,7 @@ CSFML_GRAPHICS_API unsigned int sfShape_getPointCount(const sfShape* shape);
/// \return Index-th point of the shape /// \return Index-th point of the shape
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVector2f sfShape_getPoint(const sfShape* shape, unsigned int index); CSFML_GRAPHICS_API sfVector2f sfShape_getPoint(const sfShape* shape, size_t index);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get the local bounding rectangle of a shape /// \brief Get the local bounding rectangle of a shape
+1 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
+6 -5
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
@@ -42,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;
+15 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
@@ -229,6 +229,20 @@ 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 Get the underlying OpenGL handle of the texture.
///
/// You shouldn't need to use this function, unless you have
/// very specific stuff to implement that SFML doesn't support,
/// or implement a temporary workaround until a bug is fixed.
///
/// \param texture The texture object
///
/// \return OpenGL handle of the texture or 0 if not yet created
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API unsigned int sfTexture_getNativeHandle(const sfTexture* texture);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Bind a texture for rendering /// \brief Bind a texture for rendering
/// ///
+1 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
+5 -4
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
@@ -33,6 +33,7 @@
#include <SFML/Graphics/Rect.h> #include <SFML/Graphics/Rect.h>
#include <SFML/Graphics/Types.h> #include <SFML/Graphics/Types.h>
#include <SFML/Graphics/Vertex.h> #include <SFML/Graphics/Vertex.h>
#include <stddef.h>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@@ -69,7 +70,7 @@ CSFML_GRAPHICS_API void sfVertexArray_destroy(sfVertexArray* vertexArray);
/// \return Number of vertices in the array /// \return Number of vertices in the array
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API unsigned int sfVertexArray_getVertexCount(const sfVertexArray* vertexArray); CSFML_GRAPHICS_API size_t sfVertexArray_getVertexCount(const sfVertexArray* vertexArray);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get access to a vertex by its index /// \brief Get access to a vertex by its index
@@ -84,7 +85,7 @@ CSFML_GRAPHICS_API unsigned int sfVertexArray_getVertexCount(const sfVertexArray
/// \return Pointer to the index-th vertex /// \return Pointer to the index-th vertex
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfVertex* sfVertexArray_getVertex(sfVertexArray* vertexArray, unsigned int index); CSFML_GRAPHICS_API sfVertex* sfVertexArray_getVertex(sfVertexArray* vertexArray, size_t index);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Clear a vertex array /// \brief Clear a vertex array
@@ -112,7 +113,7 @@ CSFML_GRAPHICS_API void sfVertexArray_clear(sfVertexArray* vertexArray);
/// \param vertexCount New size of the array (number of vertices) /// \param vertexCount New size of the array (number of vertices)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfVertexArray_resize(sfVertexArray* vertexArray, unsigned int vertexCount); CSFML_GRAPHICS_API void sfVertexArray_resize(sfVertexArray* vertexArray, size_t vertexCount);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Add a vertex to a vertex array array /// \brief Add a vertex to a vertex array array
+1 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
+2 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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,6 +35,7 @@
#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>
#include <SFML/Network/SocketStatus.h>
#include <SFML/Network/TcpListener.h> #include <SFML/Network/TcpListener.h>
#include <SFML/Network/TcpSocket.h> #include <SFML/Network/TcpSocket.h>
#include <SFML/Network/UdpSocket.h> #include <SFML/Network/UdpSocket.h>
+1 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
+9 -7
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
@@ -39,9 +39,11 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
typedef enum 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; } sfHttpMethod;
@@ -63,12 +65,12 @@ typedef enum
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) sfHttpRangeNotSatisfiable = 407, ///< The server can't satisfy the partial GET request (with a "Range" header field)
+1 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
+2 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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,6 +34,7 @@ typedef enum
{ {
sfSocketDone, ///< The socket has sent / received the data sfSocketDone, ///< The socket has sent / received the data
sfSocketNotReady, ///< The socket is not ready to send / receive data yet sfSocketNotReady, ///< The socket is not ready to send / receive data yet
sfSocketPartial, ///< The socket sent a part of the data
sfSocketDisconnected, ///< The TCP socket has been disconnected sfSocketDisconnected, ///< The TCP socket has been disconnected
sfSocketError ///< An unexpected error happened sfSocketError ///< An unexpected error happened
+5 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
@@ -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
/// ///
+23 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
@@ -150,6 +150,9 @@ CSFML_NETWORK_API void sfTcpSocket_disconnect(sfTcpSocket* socket);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Send raw data to the remote peer of a TCP socket /// \brief Send raw data to the remote peer of a TCP socket
/// ///
/// To be able to handle partial sends over non-blocking
/// sockets, use the sfTcpSocket_sendPartial(sfTcpSocket*, const void*, std::size_t, size_t*)
/// overload instead.
/// This function will fail if the socket is not connected. /// This function will fail if the socket is not connected.
/// ///
/// \param socket TCP socket object /// \param socket TCP socket object
@@ -161,6 +164,21 @@ CSFML_NETWORK_API void sfTcpSocket_disconnect(sfTcpSocket* socket);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_send(sfTcpSocket* socket, const void* data, size_t size); CSFML_NETWORK_API sfSocketStatus sfTcpSocket_send(sfTcpSocket* socket, const void* data, size_t size);
////////////////////////////////////////////////////////////
/// \brief Send raw data to the remote peer
///
/// This function will fail if the socket is not connected.
///
/// \param socket TCP socket object
/// \param data Pointer to the sequence of bytes to send
/// \param size Number of bytes to send
/// \param sent The number of bytes sent will be written here
///
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_sendPartial(sfTcpSocket* socket, const void* data, size_t size, size_t* sent);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Receive raw data from the remote peer of a TCP socket /// \brief Receive raw data from the remote peer of a TCP socket
/// ///
@@ -181,6 +199,10 @@ CSFML_NETWORK_API sfSocketStatus sfTcpSocket_receive(sfTcpSocket* socket, void*
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Send a formatted packet of data to the remote peer of a TCP socket /// \brief Send a formatted packet of data to the remote peer of a TCP socket
/// ///
/// In non-blocking mode, if this function returns sfSocketPartial,
/// you must retry sending the same unmodified packet before sending
/// anything else in order to guarantee the packet arrives at the remote
/// peer uncorrupted.
/// This function will fail if the socket is not connected. /// This function will fail if the socket is not connected.
/// ///
/// \param socket TCP socket object /// \param socket TCP socket object
+1 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
+2 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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,6 +35,7 @@
#include <SFML/System/Mutex.h> #include <SFML/System/Mutex.h>
#include <SFML/System/Sleep.h> #include <SFML/System/Sleep.h>
#include <SFML/System/Thread.h> #include <SFML/System/Thread.h>
#include <SFML/System/Time.h>
#include <SFML/System/Vector2.h> #include <SFML/System/Vector2.h>
#include <SFML/System/Vector3.h> #include <SFML/System/Vector3.h>
+1 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
+2 -1
View File
@@ -1,7 +1,8 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
+4 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
@@ -33,8 +33,11 @@
#include <SFML/Window/Context.h> #include <SFML/Window/Context.h>
#include <SFML/Window/Event.h> #include <SFML/Window/Event.h>
#include <SFML/Window/Joystick.h> #include <SFML/Window/Joystick.h>
#include <SFML/Window/JoystickIdentification.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>
#include <SFML/Window/Touch.h>
#include <SFML/Window/VideoMode.h> #include <SFML/Window/VideoMode.h>
#include <SFML/Window/Window.h> #include <SFML/Window/Window.h>
+1 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
+79 -33
View File
@@ -1,7 +1,8 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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,31 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
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) (deprecated)
sfEvtMouseButtonPressed, sfEvtMouseWheelScrolled, ///< The mouse wheel was scrolled (data in event.mouseWheelScroll)
sfEvtMouseButtonReleased, sfEvtMouseButtonPressed, ///< A mouse button was pressed (data in event.mouseButton)
sfEvtMouseMoved, sfEvtMouseButtonReleased, ///< A mouse button was released (data in event.mouseButton)
sfEvtMouseEntered, sfEvtMouseMoved, ///< The mouse cursor moved (data in event.mouseMove)
sfEvtMouseLeft, sfEvtMouseEntered, ///< The mouse cursor entered the area of the window (no data)
sfEvtJoystickButtonPressed, sfEvtMouseLeft, ///< The mouse cursor left the area of the window (no data)
sfEvtJoystickButtonReleased, sfEvtJoystickButtonPressed, ///< A joystick button was pressed (data in event.joystickButton)
sfEvtJoystickMoved, sfEvtJoystickButtonReleased, ///< A joystick button was released (data in event.joystickButton)
sfEvtJoystickConnected, sfEvtJoystickMoved, ///< The joystick moved along an axis (data in event.joystickMove)
sfEvtJoystickDisconnected sfEvtJoystickConnected, ///< A joystick was connected (data in event.joystickConnect)
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;
@@ -108,7 +117,7 @@ typedef struct
} sfMouseButtonEvent; } sfMouseButtonEvent;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Mouse wheel events parameters /// \brief Mouse wheel events parameters (deprecated)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
typedef struct typedef struct
@@ -119,6 +128,19 @@ typedef struct
int y; int y;
} sfMouseWheelEvent; } sfMouseWheelEvent;
////////////////////////////////////////////////////////////
/// \brief Mouse wheel events parameters
///
////////////////////////////////////////////////////////////
typedef struct
{
sfEventType type;
sfMouseWheel wheel;
float delta;
int x;
int y;
} sfMouseWheelScrollEvent;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Joystick axis move event parameters /// \brief Joystick axis move event parameters
/// ///
@@ -163,6 +185,30 @@ typedef struct
unsigned int height; unsigned int height;
} sfSizeEvent; } 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 +216,19 @@ typedef struct
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
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
sfSizeEvent size; sfMouseMoveEvent mouseMove; ///< Mouse move event parameters
sfKeyEvent key; sfMouseButtonEvent mouseButton; ///< Mouse button event parameters
sfTextEvent text; sfMouseWheelEvent mouseWheel; ///< Mouse wheel event parameters (deprecated)
sfMouseMoveEvent mouseMove; sfMouseWheelScrollEvent mouseWheelScroll; ///< Mouse wheel event parameters
sfMouseButtonEvent mouseButton; sfJoystickMoveEvent joystickMove; ///< Joystick move event parameters
sfMouseWheelEvent mouseWheel; sfJoystickButtonEvent joystickButton; ///< Joystick button event parameters
sfJoystickMoveEvent joystickMove; sfJoystickConnectEvent joystickConnect; ///< Joystick (dis)connect event parameters
sfJoystickButtonEvent joystickButton; sfTouchEvent touch; ///< Touch events parameters
sfJoystickConnectEvent joystickConnect; sfSensorEvent sensor; ///< Sensor event parameters
} sfEvent; } sfEvent;
+1 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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 -1
View File
@@ -1,7 +1,8 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
+2 -1
View File
@@ -1,7 +1,8 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
// //
+12 -1
View File
@@ -1,7 +1,8 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
// //
@@ -47,6 +48,16 @@ typedef enum
sfMouseButtonCount ///< Keep last -- the total number of mouse buttons sfMouseButtonCount ///< Keep last -- the total number of mouse buttons
} sfMouseButton; } sfMouseButton;
////////////////////////////////////////////////////////////
/// \brief Mouse wheels
///
////////////////////////////////////////////////////////////
typedef enum
{
sfMouseVerticalWheel, ///< The vertical mouse wheel
sfMouseHorizontalWheel ///< The horizontal mouse wheel
} sfMouseWheel;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Check if a mouse button is pressed /// \brief Check if a mouse button is pressed
+89
View File
@@ -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
+61
View File
@@ -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 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
+2 -1
View File
@@ -1,7 +1,8 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
// //
+43 -3
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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,19 @@ 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;
////////////////////////////////////////////////////////////
/// \brief Enumeration of the context attribute flags
///
////////////////////////////////////////////////////////////
typedef enum
{
sfContextDefault = 0, ///< Non-debug, compatibility context (this and the core attribute are mutually exclusive)
sfContextCore = 1 << 0, ///< Core attribute
sfContextDebug = 1 << 2 ///< Debug attribute
} sfContextAttribute;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@@ -62,6 +74,7 @@ typedef struct
unsigned int antialiasingLevel; ///< Level of antialiasing unsigned int antialiasingLevel; ///< Level of antialiasing
unsigned int majorVersion; ///< Major number of the context version to create unsigned int majorVersion; ///< Major number of the context version to create
unsigned int minorVersion; ///< Minor number of the context version to create unsigned int minorVersion; ///< Minor number of the context version to create
sfUint32 attributeFlags; ///< The attribute flags to create the context with
} sfContextSettings; } sfContextSettings;
@@ -349,6 +362,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
@@ -358,6 +372,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
+1 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
CSFML CSFML
----- -----
CSFML - Copyright (C) 2007-2013 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
+16 -10
View File
@@ -1,36 +1,42 @@
CSFML - Simple and Fast Multimedia Library for C CSFML - Simple and Fast Multimedia Library for C
================================================ ================================================
SFML is a simple, fast, cross-platform and object-oriented multimedia API. It provides access to windowing, graphics, SFML is a simple, fast, cross-platform and object-oriented multimedia API. It provides access to windowing,
audio and network. graphics, audio and network.
It is originally written in C++, and this project is its official binding for the C language. It is originally written in C++, and this project is its official binding for the C language.
Authors Authors
------- -------
Laurent Gomila - main developer (laurent.gom@gmail.com) Laurent Gomila - main developer (laurent@sfml-dev.org)
Zachariah Brown - active maintainer (crazyzprogrammer@hotmail.com)
Download Download
-------- --------
You can get the latest official release on SFML website (http://www.sfml-dev.org/download/csfml). 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/SFML/CSFML).
Learn Learn
----- -----
There is no tutorial for CSFML, but since it's a binding you can use the C++ resources: There is no tutorial for CSFML, but since it's a binding you can use the C++ resources:
* The official tutorials (http://www.sfml-dev.org/tutorials.php) * The official tutorials (http://www.sfml-dev.org/tutorials/)
* The online API documentation (http://www.sfml-dev.org/documentation.php) * 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/SFML/SFML/wiki/)
* The community forum (http://en.sfml-dev.org/forums/) (or http://fr.sfml-dev.org/forums/ for french people) * 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://en.sfml-dev.org/forums/), 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/). or post new bugs/features requests on the task tracker (https://github.com/SFML/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.
+1 -1
View File
@@ -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})
+17 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
+2 -2
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
@@ -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);
} }
+4 -4
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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);
@@ -80,7 +80,7 @@ CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromStream(sfInputStream* str
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfSoundBuffer* sfSoundBuffer_createFromSamples(const sfInt16* samples, size_t sampleCount, unsigned int channelCount, unsigned int sampleRate) sfSoundBuffer* sfSoundBuffer_createFromSamples(const sfInt16* samples, sfUint64 sampleCount, unsigned int channelCount, unsigned int sampleRate)
{ {
sfSoundBuffer* buffer = new sfSoundBuffer; sfSoundBuffer* buffer = new sfSoundBuffer;
@@ -125,7 +125,7 @@ const sfInt16* sfSoundBuffer_getSamples(const sfSoundBuffer* soundBuffer)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
size_t sfSoundBuffer_getSampleCount(const sfSoundBuffer* soundBuffer) sfUint64 sfSoundBuffer_getSampleCount(const sfSoundBuffer* soundBuffer)
{ {
CSFML_CALL_RETURN(soundBuffer, getSampleCount(), 0); CSFML_CALL_RETURN(soundBuffer, getSampleCount(), 0);
} }
+1 -1
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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.
+56 -4
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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();
} }
+8 -2
View File
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 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,6 +51,11 @@ public :
{ {
} }
void setProcessingInterval(sfTime interval)
{
sf::SoundRecorder::setProcessingInterval(sf::microseconds(interval.microseconds));
}
private : private :
virtual bool onStart() virtual bool onStart()
@@ -83,7 +88,7 @@ private :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Internal structure of sfPacket // Internal structure of sfSoundRecorder
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
struct sfSoundRecorder struct sfSoundRecorder
{ {
@@ -96,6 +101,7 @@ struct sfSoundRecorder
} }
sfSoundRecorderImpl This; sfSoundRecorderImpl This;
std::string DeviceName;
}; };
Loaded 100 of 181 files, more files were not shown because too many files have changed in this diff. Show more