Compare commits

..

1 commit

Author SHA1 Message Date
Kipernal d23fe7d68c
Added support for stencil testing. 2019-07-01 23:25:43 +02:00
457 changed files with 5924 additions and 53051 deletions

View file

@ -1,55 +0,0 @@
name: CI
on: [push, pull_request]
jobs:
build:
name: ${{ matrix.platform.name }} ${{ matrix.config.name }}
runs-on: ${{ matrix.platform.os }}
strategy:
matrix:
platform:
- { name: Windows VS2017, os: windows-2016 }
- { name: Windows VS2019, os: windows-latest }
- { name: Linux GCC, os: ubuntu-latest }
- { name: Linux Clang, os: ubuntu-latest, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ }
- { name: MacOS XCode, os: macos-latest }
config:
- { name: Shared, flags: -DBUILD_SHARED_LIBS=TRUE }
- { name: Static, flags: -DBUILD_SHARED_LIBS=FALSE }
include:
- platform: { name: MacOS XCode, os: macos-latest }
config: { name: Frameworks, flags: -DSFML_BUILD_FRAMEWORKS=TRUE }
- platform: { name: MacOS XCode, os: macos-latest }
config: { name: iOS, flags: -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/cmake/toolchains/iOS.toolchain.cmake -DIOS_PLATFORM=SIMULATOR }
- platform: { name: Android, os: ubuntu-latest }
config: { name: x86, flags: -DCMAKE_ANDROID_ARCH_ABI=x86 -DCMAKE_SYSTEM_NAME=Android -DSFML_BUILD_TEST_SUITE=FALSE -DCMAKE_ANDROID_NDK=$GITHUB_WORKSPACE/android-ndk-r18b -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang -DCMAKE_ANDROID_STL_TYPE=c++_shared -DCMAKE_ANDROID_API=26 }
- platform: { name: Android, os: ubuntu-latest }
config: { name: armeabi-v7a, flags: -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_SYSTEM_NAME=Android -DSFML_BUILD_TEST_SUITE=FALSE -DCMAKE_ANDROID_NDK=$GITHUB_WORKSPACE/android-ndk-r18b -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang -DCMAKE_ANDROID_STL_TYPE=c++_shared -DCMAKE_ANDROID_API=26 }
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Install Linux Dependencies
if: runner.os == 'Linux'
run: sudo apt-get install libxrandr-dev libxcursor-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev
- name: Install Android Components
if: matrix.platform.name == 'Android'
run: |
echo "y" | /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "cmake;3.10.2.4988404" --sdk_root=ANDROID_SDK_ROOT
sudo ln -sf /usr/local/lib/android/sdk/cmake/3.10.2.4988404/bin/cmake /usr/bin/cmake
wget -nv https://dl.google.com/android/repository/android-ndk-r18b-linux-x86_64.zip -P $GITHUB_WORKSPACE
unzip -qq -d $GITHUB_WORKSPACE android-ndk-r18b-linux-x86_64.zip
- name: Configure CMake
shell: bash
run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/install -DSFML_BUILD_EXAMPLES=TRUE -DCMAKE_VERBOSE_MAKEFILE=ON -DSFML_BUILD_TEST_SUITE=TRUE ${{matrix.platform.flags}} ${{matrix.config.flags}}
- name: Build
shell: bash
run: cmake --build $GITHUB_WORKSPACE/build --config Release --target install

View file

@ -4,7 +4,6 @@ addons:
apt_packages:
- cmake
- libxrandr-dev
- libxcursor-dev
- libudev-dev
- libopenal-dev
- libflac-dev
@ -15,7 +14,7 @@ addons:
before_script:
- mkdir build && cd build
- cmake .. $CMAKE_FLAGS -DCMAKE_INSTALL_PREFIX=../install -DSFML_BUILD_EXAMPLES=TRUE -DCMAKE_VERBOSE_MAKEFILE=ON
- cmake .. $CMAKE_FLAGS -DCMAKE_INSTALL_PREFIX=../install -DSFML_BUILD_EXAMPLES=TRUE
script:
- cmake --build . --target install
@ -55,19 +54,19 @@ matrix:
os: osx
osx_image: xcode10
env:
- CMAKE_FLAGS="-DSFML_BUILD_TEST_SUITE=TRUE"
- CMAKE_FLAGS="-DSFML_DEPENDENCIES_INSTALL_PREFIX=../install -DSFML_BUILD_TEST_SUITE=TRUE"
- name: "macOS Xcode 10 Frameworks"
os: osx
osx_image: xcode10
env:
- CMAKE_FLAGS="-DSFML_BUILD_TEST_SUITE=TRUE -DSFML_BUILD_FRAMEWORKS=TRUE"
- CMAKE_FLAGS="-DSFML_DEPENDENCIES_INSTALL_PREFIX=../install -DSFML_BUILD_TEST_SUITE=TRUE -DSFML_BUILD_FRAMEWORKS=TRUE"
- name: "macOS Xcode 10 Static"
os: osx
osx_image: xcode10
env:
- CMAKE_FLAGS="-DSFML_BUILD_TEST_SUITE=TRUE -DBUILD_SHARED_LIBS=FALSE"
- CMAKE_FLAGS="-DSFML_DEPENDENCIES_INSTALL_PREFIX=../install -DSFML_BUILD_TEST_SUITE=TRUE -DBUILD_SHARED_LIBS=FALSE"
- name: "iOS Xcode 10"
os: osx
@ -75,38 +74,16 @@ matrix:
env:
- CMAKE_FLAGS="-GXcode -DSFML_BUILD_TEST_SUITE=TRUE -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/iOS.toolchain.cmake -DIOS_PLATFORM=SIMULATOR"
- name: "Visual Studio 15 2017 Dynamic"
- name: "Visual studio 15 2017 Dynamic"
os: windows
env:
- CMAKE_FLAGS="-DSFML_BUILD_TEST_SUITE=FALSE"
- name: "Visual Studio 15 2017 Static"
- name: "Visual studio 15 2017 Static"
os: windows
env:
- CMAKE_FLAGS="-DBUILD_SHARED_LIBS=FALSE -DSFML_BUILD_TEST_SUITE=TRUE"
- name: "Visual Studio 16 2019 Dynamic"
os: windows
env:
- CMAKE_FLAGS="-DSFML_BUILD_TEST_SUITE=FALSE"
- MSBUILD_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin"
- VS160COMNTOOLS="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools"
- PATH=$MSBUILD_PATH:$PATH
install:
- choco install visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64"
- choco install visualstudio2019-workload-nativedesktop
- name: "Visual Studio 16 2019 Static"
os: windows
env:
- CMAKE_FLAGS="-DBUILD_SHARED_LIBS=FALSE -DSFML_BUILD_TEST_SUITE=TRUE"
- MSBUILD_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin"
- VS160COMNTOOLS="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools"
- PATH=$MSBUILD_PATH:$PATH
install:
- choco install visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64"
- choco install visualstudio2019-workload-nativedesktop
- name: "Android armeabi-v7a"
language: android
android: &androidComponents
@ -119,6 +96,7 @@ matrix:
install: &androidInstall
- echo y | sdkmanager "cmake;3.10.2.4988404"
- echo y | sdkmanager "lldb;3.1"
- sudo ln -sf /usr/local/android-sdk/cmake/3.10.2.4988404/bin/cmake /usr/bin/cmake
- wget https://dl.google.com/android/repository/android-ndk-r18b-linux-x86_64.zip
- unzip -qq android-ndk-r18b-linux-x86_64.zip

View file

@ -47,11 +47,6 @@ project(SFML)
# include the configuration file
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake)
# we use the paths from the cmake GNUInstallDirs module as defaults
# you can override these if you like
# https://cmake.org/cmake/help/v3.0/module/GNUInstallDirs.html
include(GNUInstallDirs)
# setup version numbers
set(VERSION_MAJOR 2)
set(VERSION_MINOR 5)
@ -97,8 +92,14 @@ if(SFML_OS_MACOSX)
# add an option to build frameworks instead of dylibs (release only)
sfml_set_option(SFML_BUILD_FRAMEWORKS FALSE BOOL "TRUE to build SFML as frameworks libraries (release only), FALSE to build according to BUILD_SHARED_LIBS")
# add an option to let the user specify a custom directory for external frameworks installation
sfml_set_option(SFML_DEPENDENCIES_INSTALL_PREFIX "/Library/Frameworks" PATH "External frameworks (FLAC, Freetype, Vorbis, ...) installation directory")
# add an option to automatically install Xcode templates
sfml_set_option(SFML_INSTALL_XCODE_TEMPLATES FALSE BOOL "TRUE to automatically install the Xcode templates, FALSE to do nothing about it. The templates are compatible with Xcode 4 and 5.")
else()
# add an option to let the user specify a custom directory for external libraries installation
sfml_set_option(SFML_DEPENDENCIES_INSTALL_PREFIX "." PATH "External libraries (FLAC, Freetype, Vorbis, ...) installation directory")
endif()
# iOS specific options
@ -124,8 +125,9 @@ if(SFML_OS_ANDROID)
# install everything in $NDK/sources/ because this path is appended by the NDK (convenient)
set(CMAKE_INSTALL_PREFIX ${CMAKE_ANDROID_NDK}/sources/third_party/sfml)
# we install libs in a subdirectory named after the ABI
set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/${CMAKE_ANDROID_ARCH_ABI}")
# we install libs in a subdirectory named after the ABI (lib/mips/*.so)
set(LIB_SUFFIX "/${CMAKE_ANDROID_ARCH_ABI}")
# pass shared STL configuration (if any)
if (CMAKE_ANDROID_STL_TYPE MATCHES "_shared")
add_definitions("-DSTL_LIBRARY=${CMAKE_ANDROID_STL_TYPE}")
@ -156,6 +158,9 @@ elseif(SFML_OS_MACOSX)
elseif(SFML_OS_ANDROID)
set(DEFAULT_INSTALL_MISC_DIR ${CMAKE_ANDROID_NDK}/sources/third_party/sfml)
endif()
# add an option to let the user specify a custom directory for doc, examples, licence, readme and other miscellaneous files
sfml_set_option(SFML_MISC_INSTALL_PREFIX "${DEFAULT_INSTALL_MISC_DIR}" PATH "Prefix installation path for miscellaneous files")
# force building sfml-window, if sfml-graphics module is built
if(SFML_BUILD_GRAPHICS AND NOT SFML_BUILD_WINDOW)
@ -412,8 +417,8 @@ else()
COMPONENT devel)
endif()
install(FILES license.md DESTINATION ${CMAKE_INSTALL_DOCDIR})
install(FILES readme.md DESTINATION ${CMAKE_INSTALL_DOCDIR})
install(FILES license.md DESTINATION ${SFML_MISC_INSTALL_PREFIX})
install(FILES readme.md DESTINATION ${SFML_MISC_INSTALL_PREFIX})
# install 3rd-party libraries and tools
if(SFML_OS_WINDOWS)
@ -421,22 +426,22 @@ if(SFML_OS_WINDOWS)
if(NOT SFML_USE_SYSTEM_DEPS)
# install the binaries of SFML dependencies
if(ARCH_32BITS)
install(DIRECTORY extlibs/bin/x86/ DESTINATION ${CMAKE_INSTALL_BINDIR})
install(DIRECTORY extlibs/bin/x86/ DESTINATION ${SFML_DEPENDENCIES_INSTALL_PREFIX}/bin)
if(SFML_COMPILER_MSVC AND SFML_MSVC_VERSION LESS 14)
install(DIRECTORY extlibs/libs-msvc/x86/ DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY extlibs/libs-msvc/x86/ DESTINATION ${SFML_DEPENDENCIES_INSTALL_PREFIX}/lib)
elseif(SFML_COMPILER_MSVC)
install(DIRECTORY extlibs/libs-msvc-universal/x86/ DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY extlibs/libs-msvc-universal/x86/ DESTINATION ${SFML_DEPENDENCIES_INSTALL_PREFIX}/lib)
else()
install(DIRECTORY extlibs/libs-mingw/x86/ DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY extlibs/libs-mingw/x86/ DESTINATION ${SFML_DEPENDENCIES_INSTALL_PREFIX}/lib)
endif()
elseif(ARCH_64BITS)
install(DIRECTORY extlibs/bin/x64/ DESTINATION ${CMAKE_INSTALL_BINDIR})
install(DIRECTORY extlibs/bin/x64/ DESTINATION ${SFML_DEPENDENCIES_INSTALL_PREFIX}/bin)
if(SFML_COMPILER_MSVC AND SFML_MSVC_VERSION LESS 14)
install(DIRECTORY extlibs/libs-msvc/x64/ DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY extlibs/libs-msvc/x64/ DESTINATION ${SFML_DEPENDENCIES_INSTALL_PREFIX}/lib)
elseif(SFML_COMPILER_MSVC)
install(DIRECTORY extlibs/libs-msvc-universal/x64/ DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY extlibs/libs-msvc-universal/x64/ DESTINATION ${SFML_DEPENDENCIES_INSTALL_PREFIX}/lib)
else()
install(DIRECTORY extlibs/libs-mingw/x64/ DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY extlibs/libs-mingw/x64/ DESTINATION ${SFML_DEPENDENCIES_INSTALL_PREFIX}/lib)
endif()
endif()
endif()
@ -445,33 +450,33 @@ elseif(SFML_OS_MACOSX)
# install extlibs dependencies only when used
if(SFML_BUILD_GRAPHICS)
if(FREETYPE_LIBRARY STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/freetype.framework")
install(DIRECTORY extlibs/libs-osx/Frameworks/freetype.framework DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY extlibs/libs-osx/Frameworks/freetype.framework DESTINATION ${SFML_DEPENDENCIES_INSTALL_PREFIX})
endif()
endif()
if(SFML_BUILD_AUDIO)
if(FLAC_LIBRARY STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/FLAC.framework")
install(DIRECTORY extlibs/libs-osx/Frameworks/FLAC.framework DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY extlibs/libs-osx/Frameworks/FLAC.framework DESTINATION ${SFML_DEPENDENCIES_INSTALL_PREFIX})
endif()
if(OGG_LIBRARY STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/ogg.framework")
install(DIRECTORY extlibs/libs-osx/Frameworks/ogg.framework DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY extlibs/libs-osx/Frameworks/ogg.framework DESTINATION ${SFML_DEPENDENCIES_INSTALL_PREFIX})
endif()
if(VORBIS_LIBRARY STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/vorbis.framework")
install(DIRECTORY extlibs/libs-osx/Frameworks/vorbis.framework DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY extlibs/libs-osx/Frameworks/vorbis.framework DESTINATION ${SFML_DEPENDENCIES_INSTALL_PREFIX})
endif()
if(VORBISENC_LIBRARY STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/vorbisenc.framework")
install(DIRECTORY extlibs/libs-osx/Frameworks/vorbisenc.framework DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY extlibs/libs-osx/Frameworks/vorbisenc.framework DESTINATION ${SFML_DEPENDENCIES_INSTALL_PREFIX})
endif()
if(VORBISFILE_LIBRARY STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/vorbisfile.framework")
install(DIRECTORY extlibs/libs-osx/Frameworks/vorbisfile.framework DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY extlibs/libs-osx/Frameworks/vorbisfile.framework DESTINATION ${SFML_DEPENDENCIES_INSTALL_PREFIX})
endif()
if(OPENAL_LIBRARY STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/OpenAL.framework")
install(DIRECTORY "${OPENAL_LIBRARY}" DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY "${OPENAL_LIBRARY}" DESTINATION ${SFML_DEPENDENCIES_INSTALL_PREFIX})
endif()
endif()
@ -493,7 +498,7 @@ elseif(SFML_OS_MACOSX)
elseif(SFML_OS_IOS)
# fix CMake install rules broken for iOS (see http://public.kitware.com/Bug/view.php?id=12506)
install(DIRECTORY "${CMAKE_BINARY_DIR}/lib/\$ENV{CONFIGURATION}/" DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY "${CMAKE_BINARY_DIR}/lib/\$ENV{CONFIGURATION}/" DESTINATION lib${LIB_SUFFIX})
if(NOT SFML_USE_SYSTEM_DEPS)
# since the iOS libraries are built as static, we must install the SFML dependencies

View file

@ -71,7 +71,7 @@ endif()
# set pkgconfig install directory
# this could be e.g. macports on mac or msys2 on windows etc.
set(SFML_PKGCONFIG_DIR "/${CMAKE_INSTALL_LIBDIR}/pkgconfig")
set(SFML_PKGCONFIG_DIR "/lib${LIB_SUFFIX}/pkgconfig")
if(SFML_OS_FREEBSD OR SFML_OS_OPENBSD)
set(SFML_PKGCONFIG_DIR "/libdata/pkgconfig")

View file

@ -175,9 +175,9 @@ macro(sfml_add_library target)
# add the install rule
install(TARGETS ${target} EXPORT SFMLConfigExport
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT bin
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT bin
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel
RUNTIME DESTINATION bin COMPONENT bin
LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT bin
ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT devel
FRAMEWORK DESTINATION "." COMPONENT bin)
# add <project>/include as public include directory
@ -257,10 +257,44 @@ macro(sfml_add_example target)
target_link_libraries(${target} PRIVATE ${THIS_DEPENDS})
endif()
set(target_install_dir ${SFML_MISC_INSTALL_PREFIX}/examples/${target})
if(BUILD_SHARED_LIBS AND (SFML_OS_LINUX OR SFML_OS_FREEBSD))
file(RELATIVE_PATH rel_lib_dir
${CMAKE_INSTALL_PREFIX}/${target_install_dir}
${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
set_target_properties(${target} PROPERTIES
INSTALL_RPATH "$ORIGIN/${rel_lib_dir}")
endif()
if (SFML_OS_IOS)
sfml_set_common_ios_properties(${target})
endif()
# add the install rule
install(TARGETS ${target}
RUNTIME DESTINATION ${target_install_dir} COMPONENT examples
BUNDLE DESTINATION ${target_install_dir} COMPONENT examples
RESOURCE DESTINATION ${target_install_dir} COMPONENT examples)
# install the example's source code
install(FILES ${THIS_SOURCES}
DESTINATION ${target_install_dir}
COMPONENT examples)
if (THIS_RESOURCES_DIR)
# install the example's resources as well
get_filename_component(THIS_RESOURCES_DIR "${THIS_RESOURCES_DIR}" ABSOLUTE)
if(NOT EXISTS "${THIS_RESOURCES_DIR}")
message(FATAL_ERROR "Given resources directory to install does not exist: ${THIS_RESOURCES_DIR}")
endif()
install(DIRECTORY ${THIS_RESOURCES_DIR}
DESTINATION ${target_install_dir}
COMPONENT examples)
endif()
endmacro()
# add a new target which is a SFML test
@ -407,7 +441,7 @@ function(sfml_export_targets)
if (SFML_BUILD_FRAMEWORKS)
set(config_package_location "SFML.framework/Resources/CMake")
else()
set(config_package_location ${CMAKE_INSTALL_LIBDIR}/cmake/SFML)
set(config_package_location lib${LIB_SUFFIX}/cmake/SFML)
endif()
configure_package_config_file("${CURRENT_DIR}/SFMLConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/SFMLConfig.cmake"
INSTALL_DESTINATION "${config_package_location}")

View file

@ -77,7 +77,7 @@ set(FIND_SFML_PATHS
/opt)
find_path(SFML_DOC_DIR SFML.tag
PATH_SUFFIXES SFML/doc share/doc/SFML
PATH_SUFFIXES SFML/doc share/SFML/doc
PATHS ${FIND_SFML_PATHS})

View file

@ -47,7 +47,6 @@ if(SFML_STATIC_LIBRARIES)
if(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD)
sfml_bind_dependency(TARGET X11 FRIENDLY_NAME "X11" SEARCH_NAMES "X11")
sfml_bind_dependency(TARGET X11 FRIENDLY_NAME "Xrandr" SEARCH_NAMES "Xrandr")
sfml_bind_dependency(TARGET X11 FRIENDLY_NAME "Xcursor" SEARCH_NAMES "Xcursor")
endif()
if(FIND_SFML_OS_LINUX)
@ -72,11 +71,11 @@ if(SFML_STATIC_LIBRARIES)
if(FIND_SFML_AUDIO_COMPONENT_INDEX GREATER -1)
sfml_bind_dependency(TARGET OpenAL FRIENDLY_NAME "OpenAL" SEARCH_NAMES "OpenAL" "openal" "openal32")
if (NOT FIND_SFML_OS_IOS)
sfml_bind_dependency(TARGET VORBIS FRIENDLY_NAME "VorbisFile" SEARCH_NAMES "vorbisfile")
sfml_bind_dependency(TARGET VORBIS FRIENDLY_NAME "VorbisEnc" SEARCH_NAMES "vorbisenc")
sfml_bind_dependency(TARGET Vorbis FRIENDLY_NAME "VorbisFile" SEARCH_NAMES "vorbisfile")
sfml_bind_dependency(TARGET Vorbis FRIENDLY_NAME "VorbisEnc" SEARCH_NAMES "vorbisenc")
endif()
sfml_bind_dependency(TARGET VORBIS FRIENDLY_NAME "Vorbis" SEARCH_NAMES "vorbis")
sfml_bind_dependency(TARGET VORBIS FRIENDLY_NAME "Ogg" SEARCH_NAMES "ogg")
sfml_bind_dependency(TARGET Vorbis FRIENDLY_NAME "Vorbis" SEARCH_NAMES "vorbis")
sfml_bind_dependency(TARGET Vorbis FRIENDLY_NAME "Ogg" SEARCH_NAMES "ogg")
sfml_bind_dependency(TARGET FLAC FRIENDLY_NAME "FLAC" SEARCH_NAMES "FLAC")
endif()

View file

@ -52,14 +52,11 @@ add_custom_target(doc ALL
WORKING_DIRECTORY ${DOXYGEN_INPUT_DIR})
# setup install rules
install(FILES ${DOXYGEN_OUTPUT_DIR}/SFML.tag
DESTINATION ${CMAKE_INSTALL_DOCDIR}
COMPONENT doc)
install(DIRECTORY ${DOXYGEN_OUTPUT_DIR}/html
DESTINATION ${CMAKE_INSTALL_DOCDIR}
DESTINATION ${SFML_MISC_INSTALL_PREFIX}/doc
COMPONENT doc)
if(DOXYGEN_HHC_PROGRAM)
install(FILES ${DOXYGEN_OUTPUT_DIR}/sfml.chm
DESTINATION ${CMAKE_INSTALL_DOCDIR}
DESTINATION ${SFML_MISC_INSTALL_PREFIX}/doc
COMPONENT doc)
endif()

View file

@ -3,7 +3,7 @@
///
/// \section welcome Welcome
/// Welcome to the official SFML documentation. Here you will find a detailed
/// view of all the SFML classes and functions. <br/>
/// view of all the SFML <a href="./annotated.php">classes</a> and functions. <br/>
/// If you are looking for tutorials, you can visit the official website
/// at <a href="https://www.sfml-dev.org/">www.sfml-dev.org</a>.
///

View file

@ -1,3 +1,5 @@
# CLI based examples
if (NOT SFML_OS_IOS)
if(SFML_BUILD_NETWORK)
@ -25,7 +27,6 @@ if(SFML_BUILD_GRAPHICS)
add_subdirectory(joystick)
add_subdirectory(shader)
add_subdirectory(island)
add_subdirectory(vulkan)
endif()
if(SFML_OS_WINDOWS)

View file

@ -7,4 +7,4 @@ set(SRC ${SRCROOT}/X11.cpp)
# define the X11 target
sfml_add_example(X11Example GUI_APP
SOURCES ${SRC}
DEPENDS sfml-window X11)
DEPENDS sfml-window OpenGL X11)

View file

@ -4,10 +4,7 @@
////////////////////////////////////////////////////////////
#include <SFML/Window.hpp>
#include <SFML/System/Err.hpp>
#define GLAD_GL_IMPLEMENTATION
#include "gl.h"
#include <SFML/OpenGL.hpp>
#include <X11/Xlib.h>
#include <iostream>
#include <cmath>
@ -26,13 +23,7 @@ void initialize(sf::Window& window)
// Setup OpenGL states
// Set color and depth clear value
#ifdef SFML_OPENGL_ES
glClearDepthf(1.f);
#else
glClearDepth(1.f);
#endif
glClearColor(0.f, 0.5f, 0.5f, 0.f);
// Enable Z-buffer read and write
@ -42,14 +33,9 @@ void initialize(sf::Window& window)
// Setup a perspective projection
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
static const float pi = 3.141592654f;
float extent = std::tan(90.0f * pi / 360.0f);
#ifdef SFML_OPENGL_ES
glFrustumf(-extent, extent, -extent, extent, 1.0f, 500.0f);
#else
glFrustum(-extent, extent, -extent, extent, 1.0f, 500.0f);
#endif
static const double pi = 3.141592654;
GLdouble extent = std::tan(90.0 * pi / 360.0);
glFrustum(-extent, extent, -extent, extent, 1.0, 500.0);
// Enable position and texture coordinates vertex components
glEnableClientState(GL_VERTEX_ARRAY);
@ -191,15 +177,6 @@ int main()
// Create a clock for measuring elapsed time
sf::Clock clock;
// Load OpenGL or OpenGL ES entry points using glad
sfmlView1.setActive();
#ifdef SFML_OPENGL_ES
gladLoadGLES1(reinterpret_cast<GLADloadfunc>(sf::Context::getFunction));
#else
gladLoadGL(reinterpret_cast<GLADloadfunc>(sf::Context::getFunction));
#endif
// Initialize our views
initialize(sfmlView1);
initialize(sfmlView2);

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Marco Antognini (antognini.marco@gmail.com),
// Copyright (C) 2007-2019 Marco Antognini (antognini.marco@gmail.com),
// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Marco Antognini (antognini.marco@gmail.com),
// Copyright (C) 2007-2019 Marco Antognini (antognini.marco@gmail.com),
// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Marco Antognini (antognini.marco@gmail.com),
// Copyright (C) 2007-2019 Marco Antognini (antognini.marco@gmail.com),
// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Marco Antognini (antognini.marco@gmail.com),
// Copyright (C) 2007-2019 Marco Antognini (antognini.marco@gmail.com),
// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Marco Antognini (antognini.marco@gmail.com),
// Copyright (C) 2007-2019 Marco Antognini (antognini.marco@gmail.com),
// Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.

View file

@ -25,7 +25,7 @@
<key>LSMinimumSystemVersion</key>
<string>10.6</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2007-2020 Marco Antognini and Laurent Gomila. Shared under zlib/libpng License.</string>
<string>Copyright © 2007-2019 Marco Antognini and Laurent Gomila. Shared under zlib/libpng License.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>

View file

@ -16,5 +16,5 @@ endif()
sfml_add_example(opengl GUI_APP
SOURCES ${SRC}
BUNDLE_RESOURCES ${RESOURCES}
DEPENDS sfml-graphics
DEPENDS sfml-graphics OpenGL
RESOURCES_DIR resources)

View file

@ -3,14 +3,17 @@
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>
#define GLAD_GL_IMPLEMENTATION
#include "gl.h"
#include <SFML/OpenGL.hpp>
#ifdef SFML_SYSTEM_IOS
#include <SFML/Main.hpp>
#endif
#ifdef SFML_OPENGL_ES
#define glClearDepth glClearDepthf
#define glFrustum glFrustumf
#endif
#ifndef GL_SRGB8_ALPHA8
#define GL_SRGB8_ALPHA8 0x8C43
#endif
@ -80,21 +83,10 @@ int main()
// Make the window the active window for OpenGL calls
window.setActive(true);
// Load OpenGL or OpenGL ES entry points using glad
#ifdef SFML_OPENGL_ES
gladLoadGLES1(reinterpret_cast<GLADloadfunc>(sf::Context::getFunction));
#else
gladLoadGL(reinterpret_cast<GLADloadfunc>(sf::Context::getFunction));
#endif
// Enable Z-buffer read and write
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
#ifdef SFML_OPENGL_ES
glClearDepthf(1.f);
#else
glClearDepth(1.f);
#endif
// Disable lighting
glDisable(GL_LIGHTING);
@ -106,11 +98,7 @@ int main()
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
GLfloat ratio = static_cast<float>(window.getSize().x) / window.getSize().y;
#ifdef SFML_OPENGL_ES
glFrustumf(-ratio, ratio, -1.f, 1.f, 1.f, 500.f);
#else
glFrustum(-ratio, ratio, -1.f, 1.f, 1.f, 500.f);
#endif
// Bind the texture
glEnable(GL_TEXTURE_2D);
@ -233,7 +221,7 @@ int main()
if (event.type == sf::Event::Resized)
{
sf::Vector2u textureSize = backgroundTexture.getSize();
// Make the window the active window for OpenGL calls
window.setActive(true);
@ -241,15 +229,11 @@ int main()
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
GLfloat ratio = static_cast<float>(event.size.width) / event.size.height;
#ifdef SFML_OPENGL_ES
glFrustumf(-ratio, ratio, -1.f, 1.f, 1.f, 500.f);
#else
glFrustum(-ratio, ratio, -1.f, 1.f, 1.f, 500.f);
#endif
// Make the window no longer the active window for OpenGL calls
window.setActive(false);
sf::View view;
view.setSize(textureSize.x, textureSize.y);
view.setCenter(textureSize.x/2.f, textureSize.y/2.f);
@ -270,13 +254,13 @@ int main()
// We get the position of the mouse cursor (or touch), so that we can move the box accordingly
sf::Vector2i pos;
#ifdef SFML_SYSTEM_IOS
pos = sf::Touch::getPosition(0);
#else
pos = sf::Mouse::getPosition();
#endif
float x = pos.x * 200.f / window.getSize().x - 100.f;
float y = -pos.y * 200.f / window.getSize().y + 100.f;

File diff suppressed because it is too large Load diff

View file

@ -1,11 +0,0 @@
set(SRCROOT ${PROJECT_SOURCE_DIR}/examples/vulkan)
# all source files
set(SRC ${SRCROOT}/Vulkan.cpp)
# define the window target
sfml_add_example(vulkan GUI_APP
SOURCES ${SRC}
DEPENDS sfml-graphics
RESOURCES_DIR resources)

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

View file

@ -1,16 +0,0 @@
#version 450
#extension GL_ARB_separate_shader_objects : enable
layout(binding = 1) uniform sampler2D texSampler;
layout(location = 0) in vec4 fragColor;
layout(location = 1) in vec2 fragTexCoord;
layout(location = 0) out vec4 outColor;
void main() {
outColor = fragColor * texture(texSampler, fragTexCoord);
if (outColor.a < 0.5)
discard;
}

View file

@ -1,25 +0,0 @@
#version 450
#extension GL_ARB_separate_shader_objects : enable
layout(binding = 0) uniform UniformBufferObject {
mat4 model;
mat4 view;
mat4 proj;
} ubo;
layout(location = 0) in vec3 inPosition;
layout(location = 1) in vec4 inColor;
layout(location = 2) in vec2 inTexCoord;
layout(location = 0) out vec4 fragColor;
layout(location = 1) out vec2 fragTexCoord;
out gl_PerVertex {
vec4 gl_Position;
};
void main() {
gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 1.0);
fragColor = inColor;
fragTexCoord = inTexCoord;
}

File diff suppressed because it is too large Load diff

View file

@ -7,4 +7,4 @@ set(SRC ${SRCROOT}/Window.cpp)
# define the window target
sfml_add_example(window GUI_APP
SOURCES ${SRC}
DEPENDS sfml-window)
DEPENDS sfml-window OpenGL)

View file

@ -2,14 +2,17 @@
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Window.hpp>
#define GLAD_GL_IMPLEMENTATION
#include "gl.h"
#include <SFML/OpenGL.hpp>
#ifdef SFML_SYSTEM_IOS
#include <SFML/Main.hpp>
#endif
#ifdef SFML_OPENGL_ES
#define glClearDepth glClearDepthf
#define glFrustum glFrustumf
#endif
////////////////////////////////////////////////////////////
/// Entry point of application
///
@ -28,19 +31,8 @@ int main()
// Make it the active window for OpenGL calls
window.setActive();
// Load OpenGL or OpenGL ES entry points using glad
#ifdef SFML_OPENGL_ES
gladLoadGLES1(reinterpret_cast<GLADloadfunc>(sf::Context::getFunction));
#else
gladLoadGL(reinterpret_cast<GLADloadfunc>(sf::Context::getFunction));
#endif
// Set the color and depth clear values
#ifdef SFML_OPENGL_ES
glClearDepthf(1.f);
#else
glClearDepth(1.f);
#endif
glClearColor(0.f, 0.f, 0.f, 1.f);
// Enable Z-buffer read and write
@ -58,11 +50,7 @@ int main()
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
GLfloat ratio = static_cast<float>(window.getSize().x) / window.getSize().y;
#ifdef SFML_OPENGL_ES
glFrustumf(-ratio, ratio, -1.f, 1.f, 1.f, 500.f);
#else
glFrustum(-ratio, ratio, -1.f, 1.f, 1.f, 500.f);
#endif
// Define a 3D cube (6 faces made of 2 triangles composed by 3 vertices)
GLfloat cube[] =
@ -146,11 +134,7 @@ int main()
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
GLfloat ratio = static_cast<float>(event.size.width) / event.size.height;
#ifdef SFML_OPENGL_ES
glFrustumf(-ratio, ratio, -1.f, 1.f, 1.f, 500.f);
#else
glFrustum(-ratio, ratio, -1.f, 1.f, 1.f, 500.f);
#endif
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,586 +0,0 @@
/**
* Loader generated by glad 2.0.0-beta on Wed Jul 17 02:23:29 2019
*
* Generator: C/C++
* Specification: wgl
* Extensions: 10
*
* APIs:
* - wgl=1.0
*
* Options:
* - MX_GLOBAL = False
* - ON_DEMAND = False
* - LOADER = True
* - ALIAS = True
* - HEADER_ONLY = True
* - DEBUG = False
* - MX = False
*
* Commandline:
* --api='wgl=1.0' --extensions='WGL_ARB_create_context,WGL_ARB_create_context_profile,WGL_ARB_extensions_string,WGL_ARB_framebuffer_sRGB,WGL_ARB_multisample,WGL_ARB_pbuffer,WGL_ARB_pixel_format,WGL_EXT_extensions_string,WGL_EXT_framebuffer_sRGB,WGL_EXT_swap_control' c --loader --alias --header-only
*
* Online:
* http://glad.sh/#api=wgl%3D1.0&extensions=WGL_ARB_create_context%2CWGL_ARB_create_context_profile%2CWGL_ARB_extensions_string%2CWGL_ARB_framebuffer_sRGB%2CWGL_ARB_multisample%2CWGL_ARB_pbuffer%2CWGL_ARB_pixel_format%2CWGL_EXT_extensions_string%2CWGL_EXT_framebuffer_sRGB%2CWGL_EXT_swap_control&generator=c&options=LOADER%2CALIAS%2CHEADER_ONLY
*
*/
#ifndef SF_GLAD_WGL_H_
#define SF_GLAD_WGL_H_
#include <windows.h>
#include <glad/gl.h>
#define SF_GLAD_WGL
#define GLAD_OPTION_WGL_LOADER
#define GLAD_OPTION_WGL_ALIAS
#define GLAD_OPTION_WGL_HEADER_ONLY
#ifdef __cplusplus
extern "C" {
#endif
#ifndef GLAD_PLATFORM_H_
#define GLAD_PLATFORM_H_
#ifndef GLAD_PLATFORM_WIN32
#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__)
#define GLAD_PLATFORM_WIN32 1
#else
#define GLAD_PLATFORM_WIN32 0
#endif
#endif
#ifndef GLAD_PLATFORM_APPLE
#ifdef __APPLE__
#define GLAD_PLATFORM_APPLE 1
#else
#define GLAD_PLATFORM_APPLE 0
#endif
#endif
#ifndef GLAD_PLATFORM_EMSCRIPTEN
#ifdef __EMSCRIPTEN__
#define GLAD_PLATFORM_EMSCRIPTEN 1
#else
#define GLAD_PLATFORM_EMSCRIPTEN 0
#endif
#endif
#ifndef GLAD_PLATFORM_UWP
#if defined(_MSC_VER) && !defined(GLAD_INTERNAL_HAVE_WINAPIFAMILY)
#ifdef __has_include
#if __has_include(<winapifamily.h>)
#define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
#endif
#elif _MSC_VER >= 1700 && !_USING_V110_SDK71_
#define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
#endif
#endif
#ifdef GLAD_INTERNAL_HAVE_WINAPIFAMILY
#include <winapifamily.h>
#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
#define GLAD_PLATFORM_UWP 1
#endif
#endif
#ifndef GLAD_PLATFORM_UWP
#define GLAD_PLATFORM_UWP 0
#endif
#endif
#ifdef __GNUC__
#define GLAD_GNUC_EXTENSION __extension__
#else
#define GLAD_GNUC_EXTENSION
#endif
#ifndef GLAD_API_CALL
#if defined(GLAD_API_CALL_EXPORT)
#if GLAD_PLATFORM_WIN32 || defined(__CYGWIN__)
#if defined(GLAD_API_CALL_EXPORT_BUILD)
#if defined(__GNUC__)
#define GLAD_API_CALL __attribute__ ((dllexport)) extern
#else
#define GLAD_API_CALL __declspec(dllexport) extern
#endif
#else
#if defined(__GNUC__)
#define GLAD_API_CALL __attribute__ ((dllimport)) extern
#else
#define GLAD_API_CALL __declspec(dllimport) extern
#endif
#endif
#elif defined(__GNUC__) && defined(GLAD_API_CALL_EXPORT_BUILD)
#define GLAD_API_CALL __attribute__ ((visibility ("default"))) extern
#else
#define GLAD_API_CALL extern
#endif
#else
#define GLAD_API_CALL extern
#endif
#endif
#ifdef APIENTRY
#define GLAD_API_PTR APIENTRY
#elif GLAD_PLATFORM_WIN32
#define GLAD_API_PTR __stdcall
#else
#define GLAD_API_PTR
#endif
#ifndef GLAPI
#define GLAPI GLAD_API_CALL
#endif
#ifndef GLAPIENTRY
#define GLAPIENTRY GLAD_API_PTR
#endif
#define GLAD_MAKE_VERSION(major, minor) (major * 10000 + minor)
#define GLAD_VERSION_MAJOR(version) (version / 10000)
#define GLAD_VERSION_MINOR(version) (version % 10000)
#define GLAD_GENERATOR_VERSION "2.0.0-beta"
typedef void (*GLADapiproc)(void);
typedef GLADapiproc (*GLADloadfunc)(const char *name);
typedef GLADapiproc (*GLADuserptrloadfunc)(void *userptr, const char *name);
typedef void (*GLADprecallback)(const char *name, GLADapiproc apiproc, int len_args, ...);
typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apiproc, int len_args, ...);
#endif /* GLAD_PLATFORM_H_ */
#define ERROR_INVALID_PROFILE_ARB 0x2096
#define ERROR_INVALID_VERSION_ARB 0x2095
#define WGL_ACCELERATION_ARB 0x2003
#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
#define WGL_ACCUM_BITS_ARB 0x201D
#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
#define WGL_ACCUM_RED_BITS_ARB 0x201E
#define WGL_ALPHA_BITS_ARB 0x201B
#define WGL_ALPHA_SHIFT_ARB 0x201C
#define WGL_AUX_BUFFERS_ARB 0x2024
#define WGL_BLUE_BITS_ARB 0x2019
#define WGL_BLUE_SHIFT_ARB 0x201A
#define WGL_COLOR_BITS_ARB 0x2014
#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001
#define WGL_CONTEXT_FLAGS_ARB 0x2094
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
#define WGL_DEPTH_BITS_ARB 0x2022
#define WGL_DOUBLE_BUFFER_ARB 0x2011
#define WGL_DRAW_TO_BITMAP_ARB 0x2002
#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
#define WGL_DRAW_TO_WINDOW_ARB 0x2001
#define WGL_FONT_LINES 0
#define WGL_FONT_POLYGONS 1
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
#define WGL_FULL_ACCELERATION_ARB 0x2027
#define WGL_GENERIC_ACCELERATION_ARB 0x2026
#define WGL_GREEN_BITS_ARB 0x2017
#define WGL_GREEN_SHIFT_ARB 0x2018
#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
#define WGL_NEED_PALETTE_ARB 0x2004
#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
#define WGL_NO_ACCELERATION_ARB 0x2025
#define WGL_NUMBER_OVERLAYS_ARB 0x2008
#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
#define WGL_PBUFFER_HEIGHT_ARB 0x2035
#define WGL_PBUFFER_LARGEST_ARB 0x2033
#define WGL_PBUFFER_LOST_ARB 0x2036
#define WGL_PBUFFER_WIDTH_ARB 0x2034
#define WGL_PIXEL_TYPE_ARB 0x2013
#define WGL_RED_BITS_ARB 0x2015
#define WGL_RED_SHIFT_ARB 0x2016
#define WGL_SAMPLES_ARB 0x2042
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
#define WGL_SHARE_ACCUM_ARB 0x200E
#define WGL_SHARE_DEPTH_ARB 0x200C
#define WGL_SHARE_STENCIL_ARB 0x200D
#define WGL_STENCIL_BITS_ARB 0x2023
#define WGL_STEREO_ARB 0x2012
#define WGL_SUPPORT_GDI_ARB 0x200F
#define WGL_SUPPORT_OPENGL_ARB 0x2010
#define WGL_SWAP_COPY_ARB 0x2029
#define WGL_SWAP_EXCHANGE_ARB 0x2028
#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
#define WGL_SWAP_MAIN_PLANE 0x00000001
#define WGL_SWAP_METHOD_ARB 0x2007
#define WGL_SWAP_OVERLAY1 0x00000002
#define WGL_SWAP_OVERLAY10 0x00000400
#define WGL_SWAP_OVERLAY11 0x00000800
#define WGL_SWAP_OVERLAY12 0x00001000
#define WGL_SWAP_OVERLAY13 0x00002000
#define WGL_SWAP_OVERLAY14 0x00004000
#define WGL_SWAP_OVERLAY15 0x00008000
#define WGL_SWAP_OVERLAY2 0x00000004
#define WGL_SWAP_OVERLAY3 0x00000008
#define WGL_SWAP_OVERLAY4 0x00000010
#define WGL_SWAP_OVERLAY5 0x00000020
#define WGL_SWAP_OVERLAY6 0x00000040
#define WGL_SWAP_OVERLAY7 0x00000080
#define WGL_SWAP_OVERLAY8 0x00000100
#define WGL_SWAP_OVERLAY9 0x00000200
#define WGL_SWAP_UNDEFINED_ARB 0x202A
#define WGL_SWAP_UNDERLAY1 0x00010000
#define WGL_SWAP_UNDERLAY10 0x02000000
#define WGL_SWAP_UNDERLAY11 0x04000000
#define WGL_SWAP_UNDERLAY12 0x08000000
#define WGL_SWAP_UNDERLAY13 0x10000000
#define WGL_SWAP_UNDERLAY14 0x20000000
#define WGL_SWAP_UNDERLAY15 0x40000000
#define WGL_SWAP_UNDERLAY2 0x00020000
#define WGL_SWAP_UNDERLAY3 0x00040000
#define WGL_SWAP_UNDERLAY4 0x00080000
#define WGL_SWAP_UNDERLAY5 0x00100000
#define WGL_SWAP_UNDERLAY6 0x00200000
#define WGL_SWAP_UNDERLAY7 0x00400000
#define WGL_SWAP_UNDERLAY8 0x00800000
#define WGL_SWAP_UNDERLAY9 0x01000000
#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
#define WGL_TRANSPARENT_ARB 0x200A
#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
#define WGL_TYPE_COLORINDEX_ARB 0x202C
#define WGL_TYPE_RGBA_ARB 0x202B
struct _GPU_DEVICE {
DWORD cb;
CHAR DeviceName[32];
CHAR DeviceString[128];
DWORD Flags;
RECT rcVirtualScreen;
};
DECLARE_HANDLE(HPBUFFERARB);
DECLARE_HANDLE(HPBUFFEREXT);
DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
DECLARE_HANDLE(HPVIDEODEV);
DECLARE_HANDLE(HPGPUNV);
DECLARE_HANDLE(HGPUNV);
DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
typedef struct _GPU_DEVICE GPU_DEVICE;
typedef struct _GPU_DEVICE *PGPU_DEVICE;
#define WGL_VERSION_1_0 1
GLAD_API_CALL int SF_GLAD_WGL_VERSION_1_0;
#define WGL_ARB_create_context 1
GLAD_API_CALL int SF_GLAD_WGL_ARB_create_context;
#define WGL_ARB_create_context_profile 1
GLAD_API_CALL int SF_GLAD_WGL_ARB_create_context_profile;
#define WGL_ARB_extensions_string 1
GLAD_API_CALL int SF_GLAD_WGL_ARB_extensions_string;
#define WGL_ARB_framebuffer_sRGB 1
GLAD_API_CALL int SF_GLAD_WGL_ARB_framebuffer_sRGB;
#define WGL_ARB_multisample 1
GLAD_API_CALL int SF_GLAD_WGL_ARB_multisample;
#define WGL_ARB_pbuffer 1
GLAD_API_CALL int SF_GLAD_WGL_ARB_pbuffer;
#define WGL_ARB_pixel_format 1
GLAD_API_CALL int SF_GLAD_WGL_ARB_pixel_format;
#define WGL_EXT_extensions_string 1
GLAD_API_CALL int SF_GLAD_WGL_EXT_extensions_string;
#define WGL_EXT_framebuffer_sRGB 1
GLAD_API_CALL int SF_GLAD_WGL_EXT_framebuffer_sRGB;
#define WGL_EXT_swap_control 1
GLAD_API_CALL int SF_GLAD_WGL_EXT_swap_control;
typedef int (GLAD_API_PTR *PFNCHOOSEPIXELFORMATPROC)(HDC hDc, const PIXELFORMATDESCRIPTOR * pPfd);
typedef int (GLAD_API_PTR *PFNDESCRIBEPIXELFORMATPROC)(HDC hdc, int ipfd, UINT cjpfd, const PIXELFORMATDESCRIPTOR * ppfd);
typedef UINT (GLAD_API_PTR *PFNGETENHMETAFILEPIXELFORMATPROC)(HENHMETAFILE hemf, const PIXELFORMATDESCRIPTOR * ppfd);
typedef int (GLAD_API_PTR *PFNGETPIXELFORMATPROC)(HDC hdc);
typedef BOOL (GLAD_API_PTR *PFNSETPIXELFORMATPROC)(HDC hdc, int ipfd, const PIXELFORMATDESCRIPTOR * ppfd);
typedef BOOL (GLAD_API_PTR *PFNSWAPBUFFERSPROC)(HDC hdc);
typedef BOOL (GLAD_API_PTR *PFNWGLCHOOSEPIXELFORMATARBPROC)(HDC hdc, const int * piAttribIList, const FLOAT * pfAttribFList, UINT nMaxFormats, int * piFormats, UINT * nNumFormats);
typedef BOOL (GLAD_API_PTR *PFNWGLCOPYCONTEXTPROC)(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask);
typedef HGLRC (GLAD_API_PTR *PFNWGLCREATECONTEXTPROC)(HDC hDc);
typedef HGLRC (GLAD_API_PTR *PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC hDC, HGLRC hShareContext, const int * attribList);
typedef HGLRC (GLAD_API_PTR *PFNWGLCREATELAYERCONTEXTPROC)(HDC hDc, int level);
typedef HPBUFFERARB (GLAD_API_PTR *PFNWGLCREATEPBUFFERARBPROC)(HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int * piAttribList);
typedef BOOL (GLAD_API_PTR *PFNWGLDELETECONTEXTPROC)(HGLRC oldContext);
typedef BOOL (GLAD_API_PTR *PFNWGLDESCRIBELAYERPLANEPROC)(HDC hDc, int pixelFormat, int layerPlane, UINT nBytes, const LAYERPLANEDESCRIPTOR * plpd);
typedef BOOL (GLAD_API_PTR *PFNWGLDESTROYPBUFFERARBPROC)(HPBUFFERARB hPbuffer);
typedef HGLRC (GLAD_API_PTR *PFNWGLGETCURRENTCONTEXTPROC)(void);
typedef HDC (GLAD_API_PTR *PFNWGLGETCURRENTDCPROC)(void);
typedef const char * (GLAD_API_PTR *PFNWGLGETEXTENSIONSSTRINGARBPROC)(HDC hdc);
typedef const char * (GLAD_API_PTR *PFNWGLGETEXTENSIONSSTRINGEXTPROC)(void);
typedef int (GLAD_API_PTR *PFNWGLGETLAYERPALETTEENTRIESPROC)(HDC hdc, int iLayerPlane, int iStart, int cEntries, const COLORREF * pcr);
typedef HDC (GLAD_API_PTR *PFNWGLGETPBUFFERDCARBPROC)(HPBUFFERARB hPbuffer);
typedef BOOL (GLAD_API_PTR *PFNWGLGETPIXELFORMATATTRIBFVARBPROC)(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int * piAttributes, FLOAT * pfValues);
typedef BOOL (GLAD_API_PTR *PFNWGLGETPIXELFORMATATTRIBIVARBPROC)(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int * piAttributes, int * piValues);
typedef PROC (GLAD_API_PTR *PFNWGLGETPROCADDRESSPROC)(LPCSTR lpszProc);
typedef int (GLAD_API_PTR *PFNWGLGETSWAPINTERVALEXTPROC)(void);
typedef BOOL (GLAD_API_PTR *PFNWGLMAKECURRENTPROC)(HDC hDc, HGLRC newContext);
typedef BOOL (GLAD_API_PTR *PFNWGLQUERYPBUFFERARBPROC)(HPBUFFERARB hPbuffer, int iAttribute, int * piValue);
typedef BOOL (GLAD_API_PTR *PFNWGLREALIZELAYERPALETTEPROC)(HDC hdc, int iLayerPlane, BOOL bRealize);
typedef int (GLAD_API_PTR *PFNWGLRELEASEPBUFFERDCARBPROC)(HPBUFFERARB hPbuffer, HDC hDC);
typedef int (GLAD_API_PTR *PFNWGLSETLAYERPALETTEENTRIESPROC)(HDC hdc, int iLayerPlane, int iStart, int cEntries, const COLORREF * pcr);
typedef BOOL (GLAD_API_PTR *PFNWGLSHARELISTSPROC)(HGLRC hrcSrvShare, HGLRC hrcSrvSource);
typedef BOOL (GLAD_API_PTR *PFNWGLSWAPINTERVALEXTPROC)(int interval);
typedef BOOL (GLAD_API_PTR *PFNWGLSWAPLAYERBUFFERSPROC)(HDC hdc, UINT fuFlags);
typedef BOOL (GLAD_API_PTR *PFNWGLUSEFONTBITMAPSPROC)(HDC hDC, DWORD first, DWORD count, DWORD listBase);
typedef BOOL (GLAD_API_PTR *PFNWGLUSEFONTBITMAPSAPROC)(HDC hDC, DWORD first, DWORD count, DWORD listBase);
typedef BOOL (GLAD_API_PTR *PFNWGLUSEFONTBITMAPSWPROC)(HDC hDC, DWORD first, DWORD count, DWORD listBase);
typedef BOOL (GLAD_API_PTR *PFNWGLUSEFONTOUTLINESPROC)(HDC hDC, DWORD first, DWORD count, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf);
typedef BOOL (GLAD_API_PTR *PFNWGLUSEFONTOUTLINESAPROC)(HDC hDC, DWORD first, DWORD count, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf);
typedef BOOL (GLAD_API_PTR *PFNWGLUSEFONTOUTLINESWPROC)(HDC hDC, DWORD first, DWORD count, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf);
GLAD_API_CALL PFNWGLCHOOSEPIXELFORMATARBPROC sf_glad_wglChoosePixelFormatARB;
#define wglChoosePixelFormatARB sf_glad_wglChoosePixelFormatARB
GLAD_API_CALL PFNWGLCREATECONTEXTATTRIBSARBPROC sf_glad_wglCreateContextAttribsARB;
#define wglCreateContextAttribsARB sf_glad_wglCreateContextAttribsARB
GLAD_API_CALL PFNWGLCREATEPBUFFERARBPROC sf_glad_wglCreatePbufferARB;
#define wglCreatePbufferARB sf_glad_wglCreatePbufferARB
GLAD_API_CALL PFNWGLDESTROYPBUFFERARBPROC sf_glad_wglDestroyPbufferARB;
#define wglDestroyPbufferARB sf_glad_wglDestroyPbufferARB
GLAD_API_CALL PFNWGLGETEXTENSIONSSTRINGARBPROC sf_glad_wglGetExtensionsStringARB;
#define wglGetExtensionsStringARB sf_glad_wglGetExtensionsStringARB
GLAD_API_CALL PFNWGLGETEXTENSIONSSTRINGEXTPROC sf_glad_wglGetExtensionsStringEXT;
#define wglGetExtensionsStringEXT sf_glad_wglGetExtensionsStringEXT
GLAD_API_CALL PFNWGLGETPBUFFERDCARBPROC sf_glad_wglGetPbufferDCARB;
#define wglGetPbufferDCARB sf_glad_wglGetPbufferDCARB
GLAD_API_CALL PFNWGLGETPIXELFORMATATTRIBFVARBPROC sf_glad_wglGetPixelFormatAttribfvARB;
#define wglGetPixelFormatAttribfvARB sf_glad_wglGetPixelFormatAttribfvARB
GLAD_API_CALL PFNWGLGETPIXELFORMATATTRIBIVARBPROC sf_glad_wglGetPixelFormatAttribivARB;
#define wglGetPixelFormatAttribivARB sf_glad_wglGetPixelFormatAttribivARB
GLAD_API_CALL PFNWGLGETSWAPINTERVALEXTPROC sf_glad_wglGetSwapIntervalEXT;
#define wglGetSwapIntervalEXT sf_glad_wglGetSwapIntervalEXT
GLAD_API_CALL PFNWGLQUERYPBUFFERARBPROC sf_glad_wglQueryPbufferARB;
#define wglQueryPbufferARB sf_glad_wglQueryPbufferARB
GLAD_API_CALL PFNWGLRELEASEPBUFFERDCARBPROC sf_glad_wglReleasePbufferDCARB;
#define wglReleasePbufferDCARB sf_glad_wglReleasePbufferDCARB
GLAD_API_CALL PFNWGLSWAPINTERVALEXTPROC sf_glad_wglSwapIntervalEXT;
#define wglSwapIntervalEXT sf_glad_wglSwapIntervalEXT
#ifdef __cplusplus
}
#endif
#endif
/* Source */
#ifdef SF_GLAD_WGL_IMPLEMENTATION
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef GLAD_IMPL_UTIL_C_
#define GLAD_IMPL_UTIL_C_
#ifdef _MSC_VER
#define GLAD_IMPL_UTIL_SSCANF sscanf_s
#else
#define GLAD_IMPL_UTIL_SSCANF sscanf
#endif
#endif /* GLAD_IMPL_UTIL_C_ */
int SF_GLAD_WGL_VERSION_1_0 = 0;
int SF_GLAD_WGL_ARB_create_context = 0;
int SF_GLAD_WGL_ARB_create_context_profile = 0;
int SF_GLAD_WGL_ARB_extensions_string = 0;
int SF_GLAD_WGL_ARB_framebuffer_sRGB = 0;
int SF_GLAD_WGL_ARB_multisample = 0;
int SF_GLAD_WGL_ARB_pbuffer = 0;
int SF_GLAD_WGL_ARB_pixel_format = 0;
int SF_GLAD_WGL_EXT_extensions_string = 0;
int SF_GLAD_WGL_EXT_framebuffer_sRGB = 0;
int SF_GLAD_WGL_EXT_swap_control = 0;
PFNWGLCHOOSEPIXELFORMATARBPROC sf_glad_wglChoosePixelFormatARB = NULL;
PFNWGLCREATECONTEXTATTRIBSARBPROC sf_glad_wglCreateContextAttribsARB = NULL;
PFNWGLCREATEPBUFFERARBPROC sf_glad_wglCreatePbufferARB = NULL;
PFNWGLDESTROYPBUFFERARBPROC sf_glad_wglDestroyPbufferARB = NULL;
PFNWGLGETEXTENSIONSSTRINGARBPROC sf_glad_wglGetExtensionsStringARB = NULL;
PFNWGLGETEXTENSIONSSTRINGEXTPROC sf_glad_wglGetExtensionsStringEXT = NULL;
PFNWGLGETPBUFFERDCARBPROC sf_glad_wglGetPbufferDCARB = NULL;
PFNWGLGETPIXELFORMATATTRIBFVARBPROC sf_glad_wglGetPixelFormatAttribfvARB = NULL;
PFNWGLGETPIXELFORMATATTRIBIVARBPROC sf_glad_wglGetPixelFormatAttribivARB = NULL;
PFNWGLGETSWAPINTERVALEXTPROC sf_glad_wglGetSwapIntervalEXT = NULL;
PFNWGLQUERYPBUFFERARBPROC sf_glad_wglQueryPbufferARB = NULL;
PFNWGLRELEASEPBUFFERDCARBPROC sf_glad_wglReleasePbufferDCARB = NULL;
PFNWGLSWAPINTERVALEXTPROC sf_glad_wglSwapIntervalEXT = NULL;
static void sf_glad_wgl_load_WGL_ARB_create_context(GLADuserptrloadfunc load, void *userptr) {
if(!SF_GLAD_WGL_ARB_create_context) return;
sf_glad_wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC) load(userptr, "wglCreateContextAttribsARB");
}
static void sf_glad_wgl_load_WGL_ARB_extensions_string(GLADuserptrloadfunc load, void *userptr) {
if(!SF_GLAD_WGL_ARB_extensions_string) return;
sf_glad_wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC) load(userptr, "wglGetExtensionsStringARB");
}
static void sf_glad_wgl_load_WGL_ARB_pbuffer(GLADuserptrloadfunc load, void *userptr) {
if(!SF_GLAD_WGL_ARB_pbuffer) return;
sf_glad_wglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC) load(userptr, "wglCreatePbufferARB");
sf_glad_wglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC) load(userptr, "wglDestroyPbufferARB");
sf_glad_wglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC) load(userptr, "wglGetPbufferDCARB");
sf_glad_wglQueryPbufferARB = (PFNWGLQUERYPBUFFERARBPROC) load(userptr, "wglQueryPbufferARB");
sf_glad_wglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC) load(userptr, "wglReleasePbufferDCARB");
}
static void sf_glad_wgl_load_WGL_ARB_pixel_format(GLADuserptrloadfunc load, void *userptr) {
if(!SF_GLAD_WGL_ARB_pixel_format) return;
sf_glad_wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC) load(userptr, "wglChoosePixelFormatARB");
sf_glad_wglGetPixelFormatAttribfvARB = (PFNWGLGETPIXELFORMATATTRIBFVARBPROC) load(userptr, "wglGetPixelFormatAttribfvARB");
sf_glad_wglGetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC) load(userptr, "wglGetPixelFormatAttribivARB");
}
static void sf_glad_wgl_load_WGL_EXT_extensions_string(GLADuserptrloadfunc load, void *userptr) {
if(!SF_GLAD_WGL_EXT_extensions_string) return;
sf_glad_wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC) load(userptr, "wglGetExtensionsStringEXT");
}
static void sf_glad_wgl_load_WGL_EXT_swap_control(GLADuserptrloadfunc load, void *userptr) {
if(!SF_GLAD_WGL_EXT_swap_control) return;
sf_glad_wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC) load(userptr, "wglGetSwapIntervalEXT");
sf_glad_wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC) load(userptr, "wglSwapIntervalEXT");
}
static void sf_glad_wgl_resolve_aliases(void) {
}
static int sf_glad_wgl_has_extension(HDC hdc, const char *ext) {
const char *terminator;
const char *loc;
const char *extensions;
if(wglGetExtensionsStringEXT == NULL && wglGetExtensionsStringARB == NULL)
return 0;
if(wglGetExtensionsStringARB == NULL || hdc == INVALID_HANDLE_VALUE)
extensions = wglGetExtensionsStringEXT();
else
extensions = wglGetExtensionsStringARB(hdc);
if(extensions == NULL || ext == NULL)
return 0;
while(1) {
loc = strstr(extensions, ext);
if(loc == NULL)
break;
terminator = loc + strlen(ext);
if((loc == extensions || *(loc - 1) == ' ') &&
(*terminator == ' ' || *terminator == '\0'))
{
return 1;
}
extensions = terminator;
}
return 0;
}
static GLADapiproc sf_glad_wgl_get_proc_from_userptr(void *userptr, const char* name) {
return (GLAD_GNUC_EXTENSION (GLADapiproc (*)(const char *name)) userptr)(name);
}
static int sf_glad_wgl_find_extensions_wgl(HDC hdc) {
SF_GLAD_WGL_ARB_create_context = sf_glad_wgl_has_extension(hdc, "WGL_ARB_create_context");
SF_GLAD_WGL_ARB_create_context_profile = sf_glad_wgl_has_extension(hdc, "WGL_ARB_create_context_profile");
SF_GLAD_WGL_ARB_extensions_string = sf_glad_wgl_has_extension(hdc, "WGL_ARB_extensions_string");
SF_GLAD_WGL_ARB_framebuffer_sRGB = sf_glad_wgl_has_extension(hdc, "WGL_ARB_framebuffer_sRGB");
SF_GLAD_WGL_ARB_multisample = sf_glad_wgl_has_extension(hdc, "WGL_ARB_multisample");
SF_GLAD_WGL_ARB_pbuffer = sf_glad_wgl_has_extension(hdc, "WGL_ARB_pbuffer");
SF_GLAD_WGL_ARB_pixel_format = sf_glad_wgl_has_extension(hdc, "WGL_ARB_pixel_format");
SF_GLAD_WGL_EXT_extensions_string = sf_glad_wgl_has_extension(hdc, "WGL_EXT_extensions_string");
SF_GLAD_WGL_EXT_framebuffer_sRGB = sf_glad_wgl_has_extension(hdc, "WGL_EXT_framebuffer_sRGB");
SF_GLAD_WGL_EXT_swap_control = sf_glad_wgl_has_extension(hdc, "WGL_EXT_swap_control");
return 1;
}
static int sf_glad_wgl_find_core_wgl(void) {
int major = 1, minor = 0;
SF_GLAD_WGL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1;
return GLAD_MAKE_VERSION(major, minor);
}
static int gladLoadWGLUserPtr(HDC hdc, GLADuserptrloadfunc load, void *userptr) {
int version;
wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC) load(userptr, "wglGetExtensionsStringARB");
wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC) load(userptr, "wglGetExtensionsStringEXT");
if(wglGetExtensionsStringARB == NULL && wglGetExtensionsStringEXT == NULL) return 0;
version = sf_glad_wgl_find_core_wgl();
if (!sf_glad_wgl_find_extensions_wgl(hdc)) return 0;
sf_glad_wgl_load_WGL_ARB_create_context(load, userptr);
sf_glad_wgl_load_WGL_ARB_extensions_string(load, userptr);
sf_glad_wgl_load_WGL_ARB_pbuffer(load, userptr);
sf_glad_wgl_load_WGL_ARB_pixel_format(load, userptr);
sf_glad_wgl_load_WGL_EXT_extensions_string(load, userptr);
sf_glad_wgl_load_WGL_EXT_swap_control(load, userptr);
return version;
}
static int gladLoadWGL(HDC hdc, GLADloadfunc load) {
return gladLoadWGLUserPtr(hdc, sf_glad_wgl_get_proc_from_userptr, GLAD_GNUC_EXTENSION (void*) load);
}
#ifdef SF_GLAD_WGL
static int gladLoaderLoadWGL(HDC hdc) {
return gladLoadWGLUserPtr(hdc, sf_glad_wgl_get_proc_from_userptr, GLAD_GNUC_EXTENSION (void*) wglGetProcAddress);
}
#endif /* SF_GLAD_WGL */
#endif /* SF_GLAD_WGL_IMPLEMENTATION */

View file

@ -1,170 +0,0 @@
//
// File: vk_icd.h
//
/*
* Copyright (c) 2015-2016 The Khronos Group Inc.
* Copyright (c) 2015-2016 Valve Corporation
* Copyright (c) 2015-2016 LunarG, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef VKICD_H
#define VKICD_H
#include "vulkan.h"
#include <stdbool.h>
// Loader-ICD version negotiation API. Versions add the following features:
// Version 0 - Initial. Doesn't support vk_icdGetInstanceProcAddr
// or vk_icdNegotiateLoaderICDInterfaceVersion.
// Version 1 - Add support for vk_icdGetInstanceProcAddr.
// Version 2 - Add Loader/ICD Interface version negotiation
// via vk_icdNegotiateLoaderICDInterfaceVersion.
// Version 3 - Add ICD creation/destruction of KHR_surface objects.
// Version 4 - Add unknown physical device extension qyering via
// vk_icdGetPhysicalDeviceProcAddr.
// Version 5 - Tells ICDs that the loader is now paying attention to the
// application version of Vulkan passed into the ApplicationInfo
// structure during vkCreateInstance. This will tell the ICD
// that if the loader is older, it should automatically fail a
// call for any API version > 1.0. Otherwise, the loader will
// manually determine if it can support the expected version.
#define CURRENT_LOADER_ICD_INTERFACE_VERSION 5
#define MIN_SUPPORTED_LOADER_ICD_INTERFACE_VERSION 0
#define MIN_PHYS_DEV_EXTENSION_ICD_INTERFACE_VERSION 4
typedef VkResult(VKAPI_PTR *PFN_vkNegotiateLoaderICDInterfaceVersion)(uint32_t *pVersion);
// This is defined in vk_layer.h which will be found by the loader, but if an ICD is building against this
// file directly, it won't be found.
#ifndef PFN_GetPhysicalDeviceProcAddr
typedef PFN_vkVoidFunction(VKAPI_PTR *PFN_GetPhysicalDeviceProcAddr)(VkInstance instance, const char *pName);
#endif
/*
* The ICD must reserve space for a pointer for the loader's dispatch
* table, at the start of <each object>.
* The ICD must initialize this variable using the SET_LOADER_MAGIC_VALUE macro.
*/
#define ICD_LOADER_MAGIC 0x01CDC0DE
typedef union {
uintptr_t loaderMagic;
void *loaderData;
} VK_LOADER_DATA;
static inline void set_loader_magic_value(void *pNewObject) {
VK_LOADER_DATA *loader_info = (VK_LOADER_DATA *)pNewObject;
loader_info->loaderMagic = ICD_LOADER_MAGIC;
}
static inline bool valid_loader_magic_value(void *pNewObject) {
const VK_LOADER_DATA *loader_info = (VK_LOADER_DATA *)pNewObject;
return (loader_info->loaderMagic & 0xffffffff) == ICD_LOADER_MAGIC;
}
/*
* Windows and Linux ICDs will treat VkSurfaceKHR as a pointer to a struct that
* contains the platform-specific connection and surface information.
*/
typedef enum {
VK_ICD_WSI_PLATFORM_MIR,
VK_ICD_WSI_PLATFORM_WAYLAND,
VK_ICD_WSI_PLATFORM_WIN32,
VK_ICD_WSI_PLATFORM_XCB,
VK_ICD_WSI_PLATFORM_XLIB,
VK_ICD_WSI_PLATFORM_ANDROID,
VK_ICD_WSI_PLATFORM_MACOS,
VK_ICD_WSI_PLATFORM_IOS,
VK_ICD_WSI_PLATFORM_DISPLAY
} VkIcdWsiPlatform;
typedef struct {
VkIcdWsiPlatform platform;
} VkIcdSurfaceBase;
#ifdef VK_USE_PLATFORM_MIR_KHR
typedef struct {
VkIcdSurfaceBase base;
MirConnection *connection;
MirSurface *mirSurface;
} VkIcdSurfaceMir;
#endif // VK_USE_PLATFORM_MIR_KHR
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
typedef struct {
VkIcdSurfaceBase base;
struct wl_display *display;
struct wl_surface *surface;
} VkIcdSurfaceWayland;
#endif // VK_USE_PLATFORM_WAYLAND_KHR
#ifdef VK_USE_PLATFORM_WIN32_KHR
typedef struct {
VkIcdSurfaceBase base;
HINSTANCE hinstance;
HWND hwnd;
} VkIcdSurfaceWin32;
#endif // VK_USE_PLATFORM_WIN32_KHR
#ifdef VK_USE_PLATFORM_XCB_KHR
typedef struct {
VkIcdSurfaceBase base;
xcb_connection_t *connection;
xcb_window_t window;
} VkIcdSurfaceXcb;
#endif // VK_USE_PLATFORM_XCB_KHR
#ifdef VK_USE_PLATFORM_XLIB_KHR
typedef struct {
VkIcdSurfaceBase base;
Display *dpy;
Window window;
} VkIcdSurfaceXlib;
#endif // VK_USE_PLATFORM_XLIB_KHR
#ifdef VK_USE_PLATFORM_ANDROID_KHR
typedef struct {
VkIcdSurfaceBase base;
struct ANativeWindow *window;
} VkIcdSurfaceAndroid;
#endif // VK_USE_PLATFORM_ANDROID_KHR
#ifdef VK_USE_PLATFORM_MACOS_MVK
typedef struct {
VkIcdSurfaceBase base;
const void *pView;
} VkIcdSurfaceMacOS;
#endif // VK_USE_PLATFORM_MACOS_MVK
#ifdef VK_USE_PLATFORM_IOS_MVK
typedef struct {
VkIcdSurfaceBase base;
const void *pView;
} VkIcdSurfaceIOS;
#endif // VK_USE_PLATFORM_IOS_MVK
typedef struct {
VkIcdSurfaceBase base;
VkDisplayModeKHR displayMode;
uint32_t planeIndex;
uint32_t planeStackIndex;
VkSurfaceTransformFlagBitsKHR transform;
float globalAlpha;
VkDisplayPlaneAlphaFlagBitsKHR alphaMode;
VkExtent2D imageExtent;
} VkIcdSurfaceDisplay;
#endif // VKICD_H

View file

@ -1,195 +0,0 @@
//
// File: vk_layer.h
//
/*
* Copyright (c) 2015-2017 The Khronos Group Inc.
* Copyright (c) 2015-2017 Valve Corporation
* Copyright (c) 2015-2017 LunarG, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/* Need to define dispatch table
* Core struct can then have ptr to dispatch table at the top
* Along with object ptrs for current and next OBJ
*/
#pragma once
#include "vulkan.h"
#if defined(__GNUC__) && __GNUC__ >= 4
#define VK_LAYER_EXPORT __attribute__((visibility("default")))
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
#define VK_LAYER_EXPORT __attribute__((visibility("default")))
#else
#define VK_LAYER_EXPORT
#endif
#define MAX_NUM_UNKNOWN_EXTS 250
// Loader-Layer version negotiation API. Versions add the following features:
// Versions 0/1 - Initial. Doesn't support vk_layerGetPhysicalDeviceProcAddr
// or vk_icdNegotiateLoaderLayerInterfaceVersion.
// Version 2 - Add support for vk_layerGetPhysicalDeviceProcAddr and
// vk_icdNegotiateLoaderLayerInterfaceVersion.
#define CURRENT_LOADER_LAYER_INTERFACE_VERSION 2
#define MIN_SUPPORTED_LOADER_LAYER_INTERFACE_VERSION 1
#define VK_CURRENT_CHAIN_VERSION 1
// Typedef for use in the interfaces below
typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_GetPhysicalDeviceProcAddr)(VkInstance instance, const char* pName);
// Version negotiation values
typedef enum VkNegotiateLayerStructType {
LAYER_NEGOTIATE_UNINTIALIZED = 0,
LAYER_NEGOTIATE_INTERFACE_STRUCT = 1,
} VkNegotiateLayerStructType;
// Version negotiation structures
typedef struct VkNegotiateLayerInterface {
VkNegotiateLayerStructType sType;
void *pNext;
uint32_t loaderLayerInterfaceVersion;
PFN_vkGetInstanceProcAddr pfnGetInstanceProcAddr;
PFN_vkGetDeviceProcAddr pfnGetDeviceProcAddr;
PFN_GetPhysicalDeviceProcAddr pfnGetPhysicalDeviceProcAddr;
} VkNegotiateLayerInterface;
// Version negotiation functions
typedef VkResult (VKAPI_PTR *PFN_vkNegotiateLoaderLayerInterfaceVersion)(VkNegotiateLayerInterface *pVersionStruct);
// Function prototype for unknown physical device extension command
typedef VkResult(VKAPI_PTR *PFN_PhysDevExt)(VkPhysicalDevice phys_device);
// ------------------------------------------------------------------------------------------------
// CreateInstance and CreateDevice support structures
/* Sub type of structure for instance and device loader ext of CreateInfo.
* When sType == VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO
* or sType == VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO
* then VkLayerFunction indicates struct type pointed to by pNext
*/
typedef enum VkLayerFunction_ {
VK_LAYER_LINK_INFO = 0,
VK_LOADER_DATA_CALLBACK = 1
} VkLayerFunction;
typedef struct VkLayerInstanceLink_ {
struct VkLayerInstanceLink_ *pNext;
PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr;
PFN_GetPhysicalDeviceProcAddr pfnNextGetPhysicalDeviceProcAddr;
} VkLayerInstanceLink;
/*
* When creating the device chain the loader needs to pass
* down information about it's device structure needed at
* the end of the chain. Passing the data via the
* VkLayerDeviceInfo avoids issues with finding the
* exact instance being used.
*/
typedef struct VkLayerDeviceInfo_ {
void *device_info;
PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr;
} VkLayerDeviceInfo;
typedef VkResult (VKAPI_PTR *PFN_vkSetInstanceLoaderData)(VkInstance instance,
void *object);
typedef VkResult (VKAPI_PTR *PFN_vkSetDeviceLoaderData)(VkDevice device,
void *object);
typedef struct {
VkStructureType sType; // VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO
const void *pNext;
VkLayerFunction function;
union {
VkLayerInstanceLink *pLayerInfo;
PFN_vkSetInstanceLoaderData pfnSetInstanceLoaderData;
} u;
} VkLayerInstanceCreateInfo;
typedef struct VkLayerDeviceLink_ {
struct VkLayerDeviceLink_ *pNext;
PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr;
PFN_vkGetDeviceProcAddr pfnNextGetDeviceProcAddr;
} VkLayerDeviceLink;
typedef struct {
VkStructureType sType; // VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO
const void *pNext;
VkLayerFunction function;
union {
VkLayerDeviceLink *pLayerInfo;
PFN_vkSetDeviceLoaderData pfnSetDeviceLoaderData;
} u;
} VkLayerDeviceCreateInfo;
#ifdef __cplusplus
extern "C" {
#endif
VKAPI_ATTR VkResult VKAPI_CALL vkNegotiateLoaderLayerInterfaceVersion(VkNegotiateLayerInterface *pVersionStruct);
typedef enum VkChainType {
VK_CHAIN_TYPE_UNKNOWN = 0,
VK_CHAIN_TYPE_ENUMERATE_INSTANCE_EXTENSION_PROPERTIES = 1,
VK_CHAIN_TYPE_ENUMERATE_INSTANCE_LAYER_PROPERTIES = 2,
VK_CHAIN_TYPE_ENUMERATE_INSTANCE_VERSION = 3,
} VkChainType;
typedef struct VkChainHeader {
VkChainType type;
uint32_t version;
uint32_t size;
} VkChainHeader;
typedef struct VkEnumerateInstanceExtensionPropertiesChain {
VkChainHeader header;
VkResult(VKAPI_PTR *pfnNextLayer)(const struct VkEnumerateInstanceExtensionPropertiesChain *, const char *, uint32_t *,
VkExtensionProperties *);
const struct VkEnumerateInstanceExtensionPropertiesChain *pNextLink;
#if defined(__cplusplus)
inline VkResult CallDown(const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties) const {
return pfnNextLayer(pNextLink, pLayerName, pPropertyCount, pProperties);
}
#endif
} VkEnumerateInstanceExtensionPropertiesChain;
typedef struct VkEnumerateInstanceLayerPropertiesChain {
VkChainHeader header;
VkResult(VKAPI_PTR *pfnNextLayer)(const struct VkEnumerateInstanceLayerPropertiesChain *, uint32_t *, VkLayerProperties *);
const struct VkEnumerateInstanceLayerPropertiesChain *pNextLink;
#if defined(__cplusplus)
inline VkResult CallDown(uint32_t *pPropertyCount, VkLayerProperties *pProperties) const {
return pfnNextLayer(pNextLink, pPropertyCount, pProperties);
}
#endif
} VkEnumerateInstanceLayerPropertiesChain;
typedef struct VkEnumerateInstanceVersionChain {
VkChainHeader header;
VkResult(VKAPI_PTR *pfnNextLayer)(const struct VkEnumerateInstanceVersionChain *, uint32_t *);
const struct VkEnumerateInstanceVersionChain *pNextLink;
#if defined(__cplusplus)
inline VkResult CallDown(uint32_t *pApiVersion) const {
return pfnNextLayer(pNextLink, pApiVersion);
}
#endif
} VkEnumerateInstanceVersionChain;
#ifdef __cplusplus
}
#endif

View file

@ -1,92 +0,0 @@
//
// File: vk_platform.h
//
/*
** Copyright (c) 2014-2017 The Khronos Group Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
#ifndef VK_PLATFORM_H_
#define VK_PLATFORM_H_
#ifdef __cplusplus
extern "C"
{
#endif // __cplusplus
/*
***************************************************************************************************
* Platform-specific directives and type declarations
***************************************************************************************************
*/
/* Platform-specific calling convention macros.
*
* Platforms should define these so that Vulkan clients call Vulkan commands
* with the same calling conventions that the Vulkan implementation expects.
*
* VKAPI_ATTR - Placed before the return type in function declarations.
* Useful for C++11 and GCC/Clang-style function attribute syntax.
* VKAPI_CALL - Placed after the return type in function declarations.
* Useful for MSVC-style calling convention syntax.
* VKAPI_PTR - Placed between the '(' and '*' in function pointer types.
*
* Function declaration: VKAPI_ATTR void VKAPI_CALL vkCommand(void);
* Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void);
*/
#if defined(_WIN32)
// On Windows, Vulkan commands use the stdcall convention
#define VKAPI_ATTR
#define VKAPI_CALL __stdcall
#define VKAPI_PTR VKAPI_CALL
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7
#error "Vulkan isn't supported for the 'armeabi' NDK ABI"
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)
// On Android 32-bit ARM targets, Vulkan functions use the "hardfloat"
// calling convention, i.e. float parameters are passed in registers. This
// is true even if the rest of the application passes floats on the stack,
// as it does by default when compiling for the armeabi-v7a NDK ABI.
#define VKAPI_ATTR __attribute__((pcs("aapcs-vfp")))
#define VKAPI_CALL
#define VKAPI_PTR VKAPI_ATTR
#else
// On other platforms, use the default calling convention
#define VKAPI_ATTR
#define VKAPI_CALL
#define VKAPI_PTR
#endif
#include <stddef.h>
#if !defined(VK_NO_STDINT_H)
#if defined(_MSC_VER) && (_MSC_VER < 1600)
typedef signed __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef signed __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef signed __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#endif
#endif // !defined(VK_NO_STDINT_H)
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif

View file

@ -1,69 +0,0 @@
//
// File: vk_sdk_platform.h
//
/*
* Copyright (c) 2015-2016 The Khronos Group Inc.
* Copyright (c) 2015-2016 Valve Corporation
* Copyright (c) 2015-2016 LunarG, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef VK_SDK_PLATFORM_H
#define VK_SDK_PLATFORM_H
#if defined(_WIN32)
#define NOMINMAX
#ifndef __cplusplus
#undef inline
#define inline __inline
#endif // __cplusplus
#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/)
// C99:
// Microsoft didn't implement C99 in Visual Studio; but started adding it with
// VS2013. However, VS2013 still didn't have snprintf(). The following is a
// work-around (Note: The _CRT_SECURE_NO_WARNINGS macro must be set in the
// "CMakeLists.txt" file).
// NOTE: This is fixed in Visual Studio 2015.
#define snprintf _snprintf
#endif
#define strdup _strdup
#endif // _WIN32
// Check for noexcept support using clang, with fallback to Windows or GCC version numbers
#ifndef NOEXCEPT
#if defined(__clang__)
#if __has_feature(cxx_noexcept)
#define HAS_NOEXCEPT
#endif
#else
#if defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC__ * 10 + __GNUC_MINOR__ >= 46
#define HAS_NOEXCEPT
#else
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026 && defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS
#define HAS_NOEXCEPT
#endif
#endif
#endif
#ifdef HAS_NOEXCEPT
#define NOEXCEPT noexcept
#else
#define NOEXCEPT
#endif
#endif
#endif // VK_SDK_PLATFORM_H

View file

@ -1,79 +0,0 @@
#ifndef VULKAN_H_
#define VULKAN_H_ 1
/*
** Copyright (c) 2015-2018 The Khronos Group Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
#include "vk_platform.h"
#include "vulkan_core.h"
#ifdef VK_USE_PLATFORM_ANDROID_KHR
#include "vulkan_android.h"
#endif
#ifdef VK_USE_PLATFORM_IOS_MVK
#include "vulkan_ios.h"
#endif
#ifdef VK_USE_PLATFORM_MACOS_MVK
#include "vulkan_macos.h"
#endif
#ifdef VK_USE_PLATFORM_MIR_KHR
#include <mir_toolkit/client_types.h>
#include "vulkan_mir.h"
#endif
#ifdef VK_USE_PLATFORM_VI_NN
#include "vulkan_vi.h"
#endif
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
#include <wayland-client.h>
#include "vulkan_wayland.h"
#endif
#ifdef VK_USE_PLATFORM_WIN32_KHR
#include <windows.h>
#include "vulkan_win32.h"
#endif
#ifdef VK_USE_PLATFORM_XCB_KHR
#include <xcb/xcb.h>
#include "vulkan_xcb.h"
#endif
#ifdef VK_USE_PLATFORM_XLIB_KHR
#include <X11/Xlib.h>
#include "vulkan_xlib.h"
#endif
#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>
#include "vulkan_xlib_xrandr.h"
#endif
#endif // VULKAN_H_

View file

@ -1,126 +0,0 @@
#ifndef VULKAN_ANDROID_H_
#define VULKAN_ANDROID_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2018 The Khronos Group Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_KHR_android_surface 1
struct ANativeWindow;
#define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
#define VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface"
typedef VkFlags VkAndroidSurfaceCreateFlagsKHR;
typedef struct VkAndroidSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkAndroidSurfaceCreateFlagsKHR flags;
struct ANativeWindow* window;
} VkAndroidSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR(
VkInstance instance,
const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#define VK_ANDROID_external_memory_android_hardware_buffer 1
struct AHardwareBuffer;
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 3
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME "VK_ANDROID_external_memory_android_hardware_buffer"
typedef struct VkAndroidHardwareBufferUsageANDROID {
VkStructureType sType;
void* pNext;
uint64_t androidHardwareBufferUsage;
} VkAndroidHardwareBufferUsageANDROID;
typedef struct VkAndroidHardwareBufferPropertiesANDROID {
VkStructureType sType;
void* pNext;
VkDeviceSize allocationSize;
uint32_t memoryTypeBits;
} VkAndroidHardwareBufferPropertiesANDROID;
typedef struct VkAndroidHardwareBufferFormatPropertiesANDROID {
VkStructureType sType;
void* pNext;
VkFormat format;
uint64_t externalFormat;
VkFormatFeatureFlags formatFeatures;
VkComponentMapping samplerYcbcrConversionComponents;
VkSamplerYcbcrModelConversion suggestedYcbcrModel;
VkSamplerYcbcrRange suggestedYcbcrRange;
VkChromaLocation suggestedXChromaOffset;
VkChromaLocation suggestedYChromaOffset;
} VkAndroidHardwareBufferFormatPropertiesANDROID;
typedef struct VkImportAndroidHardwareBufferInfoANDROID {
VkStructureType sType;
const void* pNext;
struct AHardwareBuffer* buffer;
} VkImportAndroidHardwareBufferInfoANDROID;
typedef struct VkMemoryGetAndroidHardwareBufferInfoANDROID {
VkStructureType sType;
const void* pNext;
VkDeviceMemory memory;
} VkMemoryGetAndroidHardwareBufferInfoANDROID;
typedef struct VkExternalFormatANDROID {
VkStructureType sType;
void* pNext;
uint64_t externalFormat;
} VkExternalFormatANDROID;
typedef VkResult (VKAPI_PTR *PFN_vkGetAndroidHardwareBufferPropertiesANDROID)(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties);
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryAndroidHardwareBufferANDROID)(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetAndroidHardwareBufferPropertiesANDROID(
VkDevice device,
const struct AHardwareBuffer* buffer,
VkAndroidHardwareBufferPropertiesANDROID* pProperties);
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryAndroidHardwareBufferANDROID(
VkDevice device,
const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo,
struct AHardwareBuffer** pBuffer);
#endif
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,58 +0,0 @@
#ifndef VULKAN_IOS_H_
#define VULKAN_IOS_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2018 The Khronos Group Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_MVK_ios_surface 1
#define VK_MVK_IOS_SURFACE_SPEC_VERSION 2
#define VK_MVK_IOS_SURFACE_EXTENSION_NAME "VK_MVK_ios_surface"
typedef VkFlags VkIOSSurfaceCreateFlagsMVK;
typedef struct VkIOSSurfaceCreateInfoMVK {
VkStructureType sType;
const void* pNext;
VkIOSSurfaceCreateFlagsMVK flags;
const void* pView;
} VkIOSSurfaceCreateInfoMVK;
typedef VkResult (VKAPI_PTR *PFN_vkCreateIOSSurfaceMVK)(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateIOSSurfaceMVK(
VkInstance instance,
const VkIOSSurfaceCreateInfoMVK* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,58 +0,0 @@
#ifndef VULKAN_MACOS_H_
#define VULKAN_MACOS_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2018 The Khronos Group Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_MVK_macos_surface 1
#define VK_MVK_MACOS_SURFACE_SPEC_VERSION 2
#define VK_MVK_MACOS_SURFACE_EXTENSION_NAME "VK_MVK_macos_surface"
typedef VkFlags VkMacOSSurfaceCreateFlagsMVK;
typedef struct VkMacOSSurfaceCreateInfoMVK {
VkStructureType sType;
const void* pNext;
VkMacOSSurfaceCreateFlagsMVK flags;
const void* pView;
} VkMacOSSurfaceCreateInfoMVK;
typedef VkResult (VKAPI_PTR *PFN_vkCreateMacOSSurfaceMVK)(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateMacOSSurfaceMVK(
VkInstance instance,
const VkMacOSSurfaceCreateInfoMVK* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,65 +0,0 @@
#ifndef VULKAN_MIR_H_
#define VULKAN_MIR_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2018 The Khronos Group Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_KHR_mir_surface 1
#define VK_KHR_MIR_SURFACE_SPEC_VERSION 4
#define VK_KHR_MIR_SURFACE_EXTENSION_NAME "VK_KHR_mir_surface"
typedef VkFlags VkMirSurfaceCreateFlagsKHR;
typedef struct VkMirSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkMirSurfaceCreateFlagsKHR flags;
MirConnection* connection;
MirSurface* mirSurface;
} VkMirSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateMirSurfaceKHR)(VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, MirConnection* connection);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateMirSurfaceKHR(
VkInstance instance,
const VkMirSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceMirPresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
MirConnection* connection);
#endif
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,58 +0,0 @@
#ifndef VULKAN_VI_H_
#define VULKAN_VI_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2018 The Khronos Group Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_NN_vi_surface 1
#define VK_NN_VI_SURFACE_SPEC_VERSION 1
#define VK_NN_VI_SURFACE_EXTENSION_NAME "VK_NN_vi_surface"
typedef VkFlags VkViSurfaceCreateFlagsNN;
typedef struct VkViSurfaceCreateInfoNN {
VkStructureType sType;
const void* pNext;
VkViSurfaceCreateFlagsNN flags;
void* window;
} VkViSurfaceCreateInfoNN;
typedef VkResult (VKAPI_PTR *PFN_vkCreateViSurfaceNN)(VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateViSurfaceNN(
VkInstance instance,
const VkViSurfaceCreateInfoNN* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,65 +0,0 @@
#ifndef VULKAN_WAYLAND_H_
#define VULKAN_WAYLAND_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2018 The Khronos Group Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_KHR_wayland_surface 1
#define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 6
#define VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME "VK_KHR_wayland_surface"
typedef VkFlags VkWaylandSurfaceCreateFlagsKHR;
typedef struct VkWaylandSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkWaylandSurfaceCreateFlagsKHR flags;
struct wl_display* display;
struct wl_surface* surface;
} VkWaylandSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateWaylandSurfaceKHR)(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR(
VkInstance instance,
const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWaylandPresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
struct wl_display* display);
#endif
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,276 +0,0 @@
#ifndef VULKAN_WIN32_H_
#define VULKAN_WIN32_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2018 The Khronos Group Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_KHR_win32_surface 1
#define VK_KHR_WIN32_SURFACE_SPEC_VERSION 6
#define VK_KHR_WIN32_SURFACE_EXTENSION_NAME "VK_KHR_win32_surface"
typedef VkFlags VkWin32SurfaceCreateFlagsKHR;
typedef struct VkWin32SurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkWin32SurfaceCreateFlagsKHR flags;
HINSTANCE hinstance;
HWND hwnd;
} VkWin32SurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateWin32SurfaceKHR)(VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateWin32SurfaceKHR(
VkInstance instance,
const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWin32PresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex);
#endif
#define VK_KHR_external_memory_win32 1
#define VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
#define VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_KHR_external_memory_win32"
typedef struct VkImportMemoryWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
VkExternalMemoryHandleTypeFlagBits handleType;
HANDLE handle;
LPCWSTR name;
} VkImportMemoryWin32HandleInfoKHR;
typedef struct VkExportMemoryWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
const SECURITY_ATTRIBUTES* pAttributes;
DWORD dwAccess;
LPCWSTR name;
} VkExportMemoryWin32HandleInfoKHR;
typedef struct VkMemoryWin32HandlePropertiesKHR {
VkStructureType sType;
void* pNext;
uint32_t memoryTypeBits;
} VkMemoryWin32HandlePropertiesKHR;
typedef struct VkMemoryGetWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
VkDeviceMemory memory;
VkExternalMemoryHandleTypeFlagBits handleType;
} VkMemoryGetWin32HandleInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleKHR)(VkDevice device, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandlePropertiesKHR)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleKHR(
VkDevice device,
const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo,
HANDLE* pHandle);
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandlePropertiesKHR(
VkDevice device,
VkExternalMemoryHandleTypeFlagBits handleType,
HANDLE handle,
VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties);
#endif
#define VK_KHR_win32_keyed_mutex 1
#define VK_KHR_WIN32_KEYED_MUTEX_SPEC_VERSION 1
#define VK_KHR_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_KHR_win32_keyed_mutex"
typedef struct VkWin32KeyedMutexAcquireReleaseInfoKHR {
VkStructureType sType;
const void* pNext;
uint32_t acquireCount;
const VkDeviceMemory* pAcquireSyncs;
const uint64_t* pAcquireKeys;
const uint32_t* pAcquireTimeouts;
uint32_t releaseCount;
const VkDeviceMemory* pReleaseSyncs;
const uint64_t* pReleaseKeys;
} VkWin32KeyedMutexAcquireReleaseInfoKHR;
#define VK_KHR_external_semaphore_win32 1
#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION 1
#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME "VK_KHR_external_semaphore_win32"
typedef struct VkImportSemaphoreWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
VkSemaphore semaphore;
VkSemaphoreImportFlags flags;
VkExternalSemaphoreHandleTypeFlagBits handleType;
HANDLE handle;
LPCWSTR name;
} VkImportSemaphoreWin32HandleInfoKHR;
typedef struct VkExportSemaphoreWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
const SECURITY_ATTRIBUTES* pAttributes;
DWORD dwAccess;
LPCWSTR name;
} VkExportSemaphoreWin32HandleInfoKHR;
typedef struct VkD3D12FenceSubmitInfoKHR {
VkStructureType sType;
const void* pNext;
uint32_t waitSemaphoreValuesCount;
const uint64_t* pWaitSemaphoreValues;
uint32_t signalSemaphoreValuesCount;
const uint64_t* pSignalSemaphoreValues;
} VkD3D12FenceSubmitInfoKHR;
typedef struct VkSemaphoreGetWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
VkSemaphore semaphore;
VkExternalSemaphoreHandleTypeFlagBits handleType;
} VkSemaphoreGetWin32HandleInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreWin32HandleKHR)(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo);
typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreWin32HandleKHR)(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreWin32HandleKHR(
VkDevice device,
const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo);
VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreWin32HandleKHR(
VkDevice device,
const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo,
HANDLE* pHandle);
#endif
#define VK_KHR_external_fence_win32 1
#define VK_KHR_EXTERNAL_FENCE_WIN32_SPEC_VERSION 1
#define VK_KHR_EXTERNAL_FENCE_WIN32_EXTENSION_NAME "VK_KHR_external_fence_win32"
typedef struct VkImportFenceWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
VkFence fence;
VkFenceImportFlags flags;
VkExternalFenceHandleTypeFlagBits handleType;
HANDLE handle;
LPCWSTR name;
} VkImportFenceWin32HandleInfoKHR;
typedef struct VkExportFenceWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
const SECURITY_ATTRIBUTES* pAttributes;
DWORD dwAccess;
LPCWSTR name;
} VkExportFenceWin32HandleInfoKHR;
typedef struct VkFenceGetWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
VkFence fence;
VkExternalFenceHandleTypeFlagBits handleType;
} VkFenceGetWin32HandleInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkImportFenceWin32HandleKHR)(VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo);
typedef VkResult (VKAPI_PTR *PFN_vkGetFenceWin32HandleKHR)(VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkImportFenceWin32HandleKHR(
VkDevice device,
const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo);
VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceWin32HandleKHR(
VkDevice device,
const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo,
HANDLE* pHandle);
#endif
#define VK_NV_external_memory_win32 1
#define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
#define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32"
typedef struct VkImportMemoryWin32HandleInfoNV {
VkStructureType sType;
const void* pNext;
VkExternalMemoryHandleTypeFlagsNV handleType;
HANDLE handle;
} VkImportMemoryWin32HandleInfoNV;
typedef struct VkExportMemoryWin32HandleInfoNV {
VkStructureType sType;
const void* pNext;
const SECURITY_ATTRIBUTES* pAttributes;
DWORD dwAccess;
} VkExportMemoryWin32HandleInfoNV;
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleNV)(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleNV(
VkDevice device,
VkDeviceMemory memory,
VkExternalMemoryHandleTypeFlagsNV handleType,
HANDLE* pHandle);
#endif
#define VK_NV_win32_keyed_mutex 1
#define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1
#define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex"
typedef struct VkWin32KeyedMutexAcquireReleaseInfoNV {
VkStructureType sType;
const void* pNext;
uint32_t acquireCount;
const VkDeviceMemory* pAcquireSyncs;
const uint64_t* pAcquireKeys;
const uint32_t* pAcquireTimeoutMilliseconds;
uint32_t releaseCount;
const VkDeviceMemory* pReleaseSyncs;
const uint64_t* pReleaseKeys;
} VkWin32KeyedMutexAcquireReleaseInfoNV;
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,66 +0,0 @@
#ifndef VULKAN_XCB_H_
#define VULKAN_XCB_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2018 The Khronos Group Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_KHR_xcb_surface 1
#define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
#define VK_KHR_XCB_SURFACE_EXTENSION_NAME "VK_KHR_xcb_surface"
typedef VkFlags VkXcbSurfaceCreateFlagsKHR;
typedef struct VkXcbSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkXcbSurfaceCreateFlagsKHR flags;
xcb_connection_t* connection;
xcb_window_t window;
} VkXcbSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateXcbSurfaceKHR)(VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR(
VkInstance instance,
const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXcbPresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
xcb_connection_t* connection,
xcb_visualid_t visual_id);
#endif
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,66 +0,0 @@
#ifndef VULKAN_XLIB_H_
#define VULKAN_XLIB_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2018 The Khronos Group Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_KHR_xlib_surface 1
#define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
#define VK_KHR_XLIB_SURFACE_EXTENSION_NAME "VK_KHR_xlib_surface"
typedef VkFlags VkXlibSurfaceCreateFlagsKHR;
typedef struct VkXlibSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkXlibSurfaceCreateFlagsKHR flags;
Display* dpy;
Window window;
} VkXlibSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateXlibSurfaceKHR)(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR(
VkInstance instance,
const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXlibPresentationSupportKHR(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
Display* dpy,
VisualID visualID);
#endif
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,54 +0,0 @@
#ifndef VULKAN_XLIB_XRANDR_H_
#define VULKAN_XLIB_XRANDR_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2015-2018 The Khronos Group Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#define VK_EXT_acquire_xlib_display 1
#define VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION 1
#define VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME "VK_EXT_acquire_xlib_display"
typedef VkResult (VKAPI_PTR *PFN_vkAcquireXlibDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, VkDisplayKHR display);
typedef VkResult (VKAPI_PTR *PFN_vkGetRandROutputDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkAcquireXlibDisplayEXT(
VkPhysicalDevice physicalDevice,
Display* dpy,
VkDisplayKHR display);
VKAPI_ATTR VkResult VKAPI_CALL vkGetRandROutputDisplayEXT(
VkPhysicalDevice physicalDevice,
Display* dpy,
RROutput rrOutput,
VkDisplayKHR* pDisplay);
#endif
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -206,13 +206,13 @@ private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
SoundFileReader* m_reader; //!< Reader that handles I/O on the file's format
InputStream* m_stream; //!< Input stream used to access the file's data
bool m_streamOwned; //!< Is the stream internal or external?
Uint64 m_sampleOffset; //!< Sample Read Position
Uint64 m_sampleCount; //!< Total number of samples in the file
unsigned int m_channelCount; //!< Number of channels of the sound
unsigned int m_sampleRate; //!< Number of samples per second
SoundFileReader* m_reader; ///< Reader that handles I/O on the file's format
InputStream* m_stream; ///< Input stream used to access the file's data
bool m_streamOwned; ///< Is the stream internal or external?
Uint64 m_sampleOffset; ///< Sample Read Position
Uint64 m_sampleCount; ///< Total number of samples in the file
unsigned int m_channelCount; ///< Number of channels of the sound
unsigned int m_sampleRate; ///< Number of samples per second
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -79,8 +79,8 @@ public:
}
T offset; //!< The beginning offset of the time range
T length; //!< The length of the time range
T offset; ///< The beginning offset of the time range
T length; ///< The length of the time range
};
// Define the relevant Span types
@ -276,10 +276,10 @@ private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
InputSoundFile m_file; //!< The streamed music file
std::vector<Int16> m_samples; //!< Temporary buffer of samples
Mutex m_mutex; //!< Mutex protecting the data
Span<Uint64> m_loopSpan; //!< Loop Range Specifier
InputSoundFile m_file; ///< The streamed music file
std::vector<Int16> m_samples; ///< Temporary buffer of samples
Mutex m_mutex; ///< Mutex protecting the data
Span<Uint64> m_loopSpan; ///< Loop Range Specifier
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -93,7 +93,7 @@ private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
SoundFileWriter* m_writer; //!< Writer that handles I/O on the file's format
SoundFileWriter* m_writer; ///< Writer that handles I/O on the file's format
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -217,7 +217,7 @@ private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
const SoundBuffer* m_buffer; //!< Sound buffer bound to the source
const SoundBuffer* m_buffer; ///< Sound buffer bound to the source
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -267,15 +267,15 @@ private:
////////////////////////////////////////////////////////////
// Types
////////////////////////////////////////////////////////////
typedef std::set<Sound*> SoundList; //!< Set of unique sound instances
typedef std::set<Sound*> SoundList; ///< Set of unique sound instances
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
unsigned int m_buffer; //!< OpenAL buffer identifier
std::vector<Int16> m_samples; //!< Samples buffer
Time m_duration; //!< Sound duration
mutable SoundList m_sounds; //!< List of sounds that are using this buffer
unsigned int m_buffer; ///< OpenAL buffer identifier
std::vector<Int16> m_samples; ///< Samples buffer
Time m_duration; ///< Sound duration
mutable SoundList m_sounds; ///< List of sounds that are using this buffer
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -96,8 +96,8 @@ private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
std::vector<Int16> m_samples; //!< Temporary sample buffer to hold the recorded data
SoundBuffer m_buffer; //!< Sound buffer that will contain the recorded data
std::vector<Int16> m_samples; ///< Temporary sample buffer to hold the recorded data
SoundBuffer m_buffer; ///< Sound buffer that will contain the recorded data
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -160,8 +160,8 @@ private:
////////////////////////////////////////////////////////////
// Static member data
////////////////////////////////////////////////////////////
static ReaderFactoryArray s_readers; //!< List of all registered readers
static WriterFactoryArray s_writers; //!< List of all registered writers
static ReaderFactoryArray s_readers; ///< List of all registered readers
static WriterFactoryArray s_writers; ///< List of all registered writers
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -50,9 +50,9 @@ public:
////////////////////////////////////////////////////////////
struct Info
{
Uint64 sampleCount; //!< Total number of samples in the file
unsigned int channelCount; //!< Number of channels of the sound
unsigned int sampleRate; //!< Samples rate of the sound, in samples per second
Uint64 sampleCount; ///< Total number of samples in the file
unsigned int channelCount; ///< Number of channels of the sound
unsigned int sampleRate; ///< Samples rate of the sound, in samples per second
};
////////////////////////////////////////////////////////////

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -285,13 +285,13 @@ private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
Thread m_thread; //!< Thread running the background recording task
std::vector<Int16> m_samples; //!< Buffer to store captured samples
unsigned int m_sampleRate; //!< Sample rate
Time m_processingInterval; //!< Time period between calls to onProcessSamples
bool m_isCapturing; //!< Capturing state
std::string m_deviceName; //!< Name of the audio capture device
unsigned int m_channelCount; //!< Number of recording channels
Thread m_thread; ///< Thread running the background recording task
std::vector<Int16> m_samples; ///< Buffer to store captured samples
unsigned int m_sampleRate; ///< Sample rate
Time m_processingInterval; ///< Time period between calls to onProcessSamples
bool m_isCapturing; ///< Capturing state
std::string m_deviceName; ///< Name of the audio capture device
unsigned int m_channelCount; ///< Number of recording channels
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -49,9 +49,9 @@ public:
////////////////////////////////////////////////////////////
enum Status
{
Stopped, //!< Sound is not playing
Paused, //!< Sound is paused
Playing //!< Sound is playing
Stopped, ///< Sound is not playing
Paused, ///< Sound is paused
Playing ///< Sound is playing
};
////////////////////////////////////////////////////////////
@ -306,7 +306,7 @@ protected:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
unsigned int m_source; //!< OpenAL source identifier
unsigned int m_source; ///< OpenAL source identifier
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -52,8 +52,8 @@ public:
////////////////////////////////////////////////////////////
struct Chunk
{
const Int16* samples; //!< Pointer to the audio samples
std::size_t sampleCount; //!< Number of samples pointed by Samples
const Int16* samples; ///< Pointer to the audio samples
std::size_t sampleCount; ///< Number of samples pointed by Samples
};
////////////////////////////////////////////////////////////
@ -182,7 +182,7 @@ protected:
enum
{
NoLoop = -1 //!< "Invalid" endSeeks value, telling us to continue uninterrupted
NoLoop = -1 ///< "Invalid" endSeeks value, telling us to continue uninterrupted
};
////////////////////////////////////////////////////////////
@ -251,20 +251,6 @@ protected:
////////////////////////////////////////////////////////////
virtual Int64 onLoop();
////////////////////////////////////////////////////////////
/// \brief Set the processing interval
///
/// The processing interval controls the period at which the
/// audio buffers are filled by calls to onGetData. A smaller
/// interval may be useful for low-latency streams. Note that
/// the given period is only a hint and the actual period may
/// vary. The default processing interval is 10 ms.
///
/// \param interval Processing interval
///
////////////////////////////////////////////////////////////
void setProcessingInterval(Time interval);
private:
////////////////////////////////////////////////////////////
@ -313,25 +299,24 @@ private:
enum
{
BufferCount = 3, //!< Number of audio buffers used by the streaming loop
BufferRetries = 2 //!< Number of retries (excluding initial try) for onGetData()
BufferCount = 3, ///< Number of audio buffers used by the streaming loop
BufferRetries = 2 ///< Number of retries (excluding initial try) for onGetData()
};
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
Thread m_thread; //!< Thread running the background tasks
mutable Mutex m_threadMutex; //!< Thread mutex
Status m_threadStartState; //!< State the thread starts in (Playing, Paused, Stopped)
bool m_isStreaming; //!< Streaming state (true = playing, false = stopped)
unsigned int m_buffers[BufferCount]; //!< Sound buffers used to store temporary audio data
unsigned int m_channelCount; //!< Number of channels (1 = mono, 2 = stereo, ...)
unsigned int m_sampleRate; //!< Frequency (samples / second)
Uint32 m_format; //!< Format of the internal sound buffers
bool m_loop; //!< Loop flag (true to loop, false to play once)
Uint64 m_samplesProcessed; //!< Number of samples processed since beginning of the stream
Int64 m_bufferSeeks[BufferCount]; //!< If buffer is an "end buffer", holds next seek position, else NoLoop. For play offset calculation.
Time m_processingInterval; //!< Interval for checking and filling the internal sound buffers.
Thread m_thread; ///< Thread running the background tasks
mutable Mutex m_threadMutex; ///< Thread mutex
Status m_threadStartState; ///< State the thread starts in (Playing, Paused, Stopped)
bool m_isStreaming; ///< Streaming state (true = playing, false = stopped)
unsigned int m_buffers[BufferCount]; ///< Sound buffers used to store temporary audio data
unsigned int m_channelCount; ///< Number of channels (1 = mono, 2 = stereo, ...)
unsigned int m_sampleRate; ///< Frequency (samples / second)
Uint32 m_format; ///< Format of the internal sound buffers
bool m_loop; ///< Loop flag (true to loop, false to play once)
Uint64 m_samplesProcessed; ///< Number of buffers processed since beginning of the stream
Int64 m_bufferSeeks[BufferCount]; ///< If buffer is an "end buffer", holds next seek position, else NoLoop. For play offset calculation.
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -36,7 +36,7 @@
////////////////////////////////////////////////////////////
// Identify the operating system
// see https://sourceforge.net/p/predef/wiki/Home/
// see http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system
////////////////////////////////////////////////////////////
#if defined(_WIN32)

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -48,6 +48,7 @@
#include <SFML/Graphics/Shader.hpp>
#include <SFML/Graphics/Shape.hpp>
#include <SFML/Graphics/Sprite.hpp>
#include <SFML/Graphics/StencilMode.hpp>
#include <SFML/Graphics/Text.hpp>
#include <SFML/Graphics/Texture.hpp>
#include <SFML/Graphics/Transform.hpp>

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -48,16 +48,16 @@ struct SFML_GRAPHICS_API BlendMode
////////////////////////////////////////////////////////
enum Factor
{
Zero, //!< (0, 0, 0, 0)
One, //!< (1, 1, 1, 1)
SrcColor, //!< (src.r, src.g, src.b, src.a)
OneMinusSrcColor, //!< (1, 1, 1, 1) - (src.r, src.g, src.b, src.a)
DstColor, //!< (dst.r, dst.g, dst.b, dst.a)
OneMinusDstColor, //!< (1, 1, 1, 1) - (dst.r, dst.g, dst.b, dst.a)
SrcAlpha, //!< (src.a, src.a, src.a, src.a)
OneMinusSrcAlpha, //!< (1, 1, 1, 1) - (src.a, src.a, src.a, src.a)
DstAlpha, //!< (dst.a, dst.a, dst.a, dst.a)
OneMinusDstAlpha //!< (1, 1, 1, 1) - (dst.a, dst.a, dst.a, dst.a)
Zero, ///< (0, 0, 0, 0)
One, ///< (1, 1, 1, 1)
SrcColor, ///< (src.r, src.g, src.b, src.a)
OneMinusSrcColor, ///< (1, 1, 1, 1) - (src.r, src.g, src.b, src.a)
DstColor, ///< (dst.r, dst.g, dst.b, dst.a)
OneMinusDstColor, ///< (1, 1, 1, 1) - (dst.r, dst.g, dst.b, dst.a)
SrcAlpha, ///< (src.a, src.a, src.a, src.a)
OneMinusSrcAlpha, ///< (1, 1, 1, 1) - (src.a, src.a, src.a, src.a)
DstAlpha, ///< (dst.a, dst.a, dst.a, dst.a)
OneMinusDstAlpha ///< (1, 1, 1, 1) - (dst.a, dst.a, dst.a, dst.a)
};
////////////////////////////////////////////////////////
@ -68,9 +68,9 @@ struct SFML_GRAPHICS_API BlendMode
////////////////////////////////////////////////////////
enum Equation
{
Add, //!< Pixel = Src * SrcFactor + Dst * DstFactor
Subtract, //!< Pixel = Src * SrcFactor - Dst * DstFactor
ReverseSubtract //!< Pixel = Dst * DstFactor - Src * SrcFactor
Add, ///< Pixel = Src * SrcFactor + Dst * DstFactor
Subtract, ///< Pixel = Src * SrcFactor - Dst * DstFactor
ReverseSubtract ///< Pixel = Dst * DstFactor - Src * SrcFactor
};
////////////////////////////////////////////////////////////
@ -112,12 +112,12 @@ struct SFML_GRAPHICS_API BlendMode
////////////////////////////////////////////////////////////
// Member Data
////////////////////////////////////////////////////////////
Factor colorSrcFactor; //!< Source blending factor for the color channels
Factor colorDstFactor; //!< Destination blending factor for the color channels
Equation colorEquation; //!< Blending equation for the color channels
Factor alphaSrcFactor; //!< Source blending factor for the alpha channel
Factor alphaDstFactor; //!< Destination blending factor for the alpha channel
Equation alphaEquation; //!< Blending equation for the alpha channel
Factor colorSrcFactor; ///< Source blending factor for the color channels
Factor colorDstFactor; ///< Destination blending factor for the color channels
Equation colorEquation; ///< Blending equation for the color channels
Factor alphaSrcFactor; ///< Source blending factor for the alpha channel
Factor alphaDstFactor; ///< Destination blending factor for the alpha channel
Equation alphaEquation; ///< Blending equation for the alpha channel
};
////////////////////////////////////////////////////////////
@ -147,10 +147,10 @@ SFML_GRAPHICS_API bool operator !=(const BlendMode& left, const BlendMode& right
////////////////////////////////////////////////////////////
// Commonly used blending modes
////////////////////////////////////////////////////////////
SFML_GRAPHICS_API extern const BlendMode BlendAlpha; //!< Blend source and dest according to dest alpha
SFML_GRAPHICS_API extern const BlendMode BlendAdd; //!< Add source to dest
SFML_GRAPHICS_API extern const BlendMode BlendMultiply; //!< Multiply source and dest
SFML_GRAPHICS_API extern const BlendMode BlendNone; //!< Overwrite dest with source
SFML_GRAPHICS_API extern const BlendMode BlendAlpha; ///< Blend source and dest according to dest alpha
SFML_GRAPHICS_API extern const BlendMode BlendAdd; ///< Add source to dest
SFML_GRAPHICS_API extern const BlendMode BlendMultiply; ///< Multiply source and dest
SFML_GRAPHICS_API extern const BlendMode BlendNone; ///< Overwrite dest with source
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -111,8 +111,8 @@ private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
float m_radius; //!< Radius of the circle
std::size_t m_pointCount; //!< Number of points composing the circle
float m_radius; ///< Radius of the circle
std::size_t m_pointCount; ///< Number of points composing the circle
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -80,23 +80,23 @@ public:
////////////////////////////////////////////////////////////
// Static member data
////////////////////////////////////////////////////////////
static const Color Black; //!< Black predefined color
static const Color White; //!< White predefined color
static const Color Red; //!< Red predefined color
static const Color Green; //!< Green predefined color
static const Color Blue; //!< Blue predefined color
static const Color Yellow; //!< Yellow predefined color
static const Color Magenta; //!< Magenta predefined color
static const Color Cyan; //!< Cyan predefined color
static const Color Transparent; //!< Transparent (black) predefined color
static const Color Black; ///< Black predefined color
static const Color White; ///< White predefined color
static const Color Red; ///< Red predefined color
static const Color Green; ///< Green predefined color
static const Color Blue; ///< Blue predefined color
static const Color Yellow; ///< Yellow predefined color
static const Color Magenta; ///< Magenta predefined color
static const Color Cyan; ///< Cyan predefined color
static const Color Transparent; ///< Transparent (black) predefined color
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
Uint8 r; //!< Red component
Uint8 g; //!< Green component
Uint8 b; //!< Blue component
Uint8 a; //!< Alpha (opacity) component
Uint8 r; ///< Red component
Uint8 g; ///< Green component
Uint8 b; ///< Blue component
Uint8 a; ///< Alpha (opacity) component
};
////////////////////////////////////////////////////////////

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -112,7 +112,7 @@ private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
std::vector<Vector2f> m_points; //!< Points composing the convex polygon
std::vector<Vector2f> m_points; ///< Points composing the convex polygon
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -57,7 +57,7 @@ public:
////////////////////////////////////////////////////////////
struct Info
{
std::string family; //!< The font family
std::string family; ///< The font family
};
public:
@ -166,10 +166,6 @@ public:
/// might be available. If the glyph is not available at the
/// requested size, an empty glyph is returned.
///
/// You may want to use \ref hasGlyph to determine if the
/// glyph exists before requesting it. If the glyph does not
/// exist, a font specific default is returned.
///
/// Be aware that using a negative value for the outline
/// thickness will cause distorted rendering.
///
@ -183,24 +179,6 @@ public:
////////////////////////////////////////////////////////////
const Glyph& getGlyph(Uint32 codePoint, unsigned int characterSize, bool bold, float outlineThickness = 0) const;
////////////////////////////////////////////////////////////
/// \brief Determine if this font has a glyph representing the requested code point
///
/// Most fonts only include a very limited selection of glyphs from
/// specific Unicode subsets, like Latin, Cyrillic, or Asian characters.
///
/// While code points without representation will return a font specific
/// default character, it might be useful to verify whether specific
/// code points are included to determine whether a font is suited
/// to display text in a specific language.
///
/// \param codePoint Unicode code point to check
///
/// \return True if the codepoint has a glyph representation, false otherwise
///
////////////////////////////////////////////////////////////
bool hasGlyph(Uint32 codePoint) const;
////////////////////////////////////////////////////////////
/// \brief Get the kerning offset of two glyphs
///
@ -275,32 +253,6 @@ public:
////////////////////////////////////////////////////////////
const Texture& getTexture(unsigned int characterSize) const;
////////////////////////////////////////////////////////////
/// \brief Enable or disable the smooth filter
///
/// When the filter is activated, the font appears smoother
/// so that pixels are less noticeable. However if you want
/// the font to look exactly the same as its source file,
/// you should disable it.
/// The smooth filter is enabled by default.
///
/// \param smooth True to enable smoothing, false to disable it
///
/// \see isSmooth
///
////////////////////////////////////////////////////////////
void setSmooth(bool smooth);
////////////////////////////////////////////////////////////
/// \brief Tell whether the smooth filter is enabled or not
///
/// \return True if smoothing is enabled, false if it is disabled
///
/// \see setSmooth
///
////////////////////////////////////////////////////////////
bool isSmooth() const;
////////////////////////////////////////////////////////////
/// \brief Overload of assignment operator
///
@ -321,15 +273,15 @@ private:
{
Row(unsigned int rowTop, unsigned int rowHeight) : width(0), top(rowTop), height(rowHeight) {}
unsigned int width; //!< Current width of the row
unsigned int top; //!< Y position of the row into the texture
unsigned int height; //!< Height of the row
unsigned int width; ///< Current width of the row
unsigned int top; ///< Y position of the row into the texture
unsigned int height; ///< Height of the row
};
////////////////////////////////////////////////////////////
// Types
////////////////////////////////////////////////////////////
typedef std::map<Uint64, Glyph> GlyphTable; //!< Table mapping a codepoint to its glyph
typedef std::map<Uint64, Glyph> GlyphTable; ///< Table mapping a codepoint to its glyph
////////////////////////////////////////////////////////////
/// \brief Structure defining a page of glyphs
@ -339,10 +291,10 @@ private:
{
Page();
GlyphTable glyphs; //!< Table mapping code points to their corresponding glyph
Texture texture; //!< Texture containing the pixels of the glyphs
unsigned int nextRow; //!< Y position of the next new row in the texture
std::vector<Row> rows; //!< List containing the position of all the existing rows
GlyphTable glyphs; ///< Table mapping code points to their corresponding glyph
Texture texture; ///< Texture containing the pixels of the glyphs
unsigned int nextRow; ///< Y position of the next new row in the texture
std::vector<Row> rows; ///< List containing the position of all the existing rows
};
////////////////////////////////////////////////////////////
@ -389,22 +341,21 @@ private:
////////////////////////////////////////////////////////////
// Types
////////////////////////////////////////////////////////////
typedef std::map<unsigned int, Page> PageTable; //!< Table mapping a character size to its page (texture)
typedef std::map<unsigned int, Page> PageTable; ///< Table mapping a character size to its page (texture)
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
void* m_library; //!< Pointer to the internal library interface (it is typeless to avoid exposing implementation details)
void* m_face; //!< Pointer to the internal font face (it is typeless to avoid exposing implementation details)
void* m_streamRec; //!< Pointer to the stream rec instance (it is typeless to avoid exposing implementation details)
void* m_stroker; //!< Pointer to the stroker (it is typeless to avoid exposing implementation details)
int* m_refCount; //!< Reference counter used by implicit sharing
bool m_isSmooth; //!< Status of the smooth filter
Info m_info; //!< Information about the font
mutable PageTable m_pages; //!< Table containing the glyphs pages by character size
mutable std::vector<Uint8> m_pixelBuffer; //!< Pixel buffer holding a glyph's pixels before being written to the texture
void* m_library; ///< Pointer to the internal library interface (it is typeless to avoid exposing implementation details)
void* m_face; ///< Pointer to the internal font face (it is typeless to avoid exposing implementation details)
void* m_streamRec; ///< Pointer to the stream rec instance (it is typeless to avoid exposing implementation details)
void* m_stroker; ///< Pointer to the stroker (it is typeless to avoid exposing implementation details)
int* m_refCount; ///< Reference counter used by implicit sharing
Info m_info; ///< Information about the font
mutable PageTable m_pages; ///< Table containing the glyphs pages by character size
mutable std::vector<Uint8> m_pixelBuffer; ///< Pixel buffer holding a glyph's pixels before being written to the texture
#ifdef SFML_SYSTEM_ANDROID
void* m_stream; //!< Asset file streamer (if loaded from file)
void* m_stream; ///< Asset file streamer (if loaded from file)
#endif
};

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -81,7 +81,7 @@ struct Matrix
copyMatrix(transform, *this);
}
float array[Columns * Rows]; //!< Array holding matrix data
float array[Columns * Rows]; ///< Array holding matrix data
};
////////////////////////////////////////////////////////////
@ -148,8 +148,8 @@ struct Vector4
copyVector(color, *this);
}
T x; //!< 1st component (X) of the 4D vector
T y; //!< 2nd component (Y) of the 4D vector
T z; //!< 3rd component (Z) of the 4D vector
T w; //!< 4th component (W) of the 4D vector
T x; ///< 1st component (X) of the 4D vector
T y; ///< 2nd component (Y) of the 4D vector
T z; ///< 3rd component (Z) of the 4D vector
T w; ///< 4th component (W) of the 4D vector
};

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -51,9 +51,9 @@ public:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
float advance; //!< Offset to move horizontally to the next character
FloatRect bounds; //!< Bounding rectangle of the glyph, in coordinates relative to the baseline
IntRect textureRect; //!< Texture coordinates of the glyph inside the font's texture
float advance; ///< Offset to move horizontally to the next character
FloatRect bounds; ///< Bounding rectangle of the glyph, in coordinates relative to the baseline
IntRect textureRect; ///< Texture coordinates of the glyph inside the font's texture
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -263,8 +263,8 @@ private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
Vector2u m_size; //!< Image size
std::vector<Uint8> m_pixels; //!< Pixels of the image
Vector2u m_size; ///< Image size
std::vector<Uint8> m_pixels; ///< Pixels of the image
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -38,18 +38,18 @@ namespace sf
////////////////////////////////////////////////////////////
enum PrimitiveType
{
Points, //!< List of individual points
Lines, //!< List of individual lines
LineStrip, //!< List of connected lines, a point uses the previous point to form a line
Triangles, //!< List of individual triangles
TriangleStrip, //!< List of connected triangles, a point uses the two previous points to form a triangle
TriangleFan, //!< List of connected triangles, a point uses the common center and the previous point to form a triangle
Quads, //!< List of individual quads (deprecated, don't work with OpenGL ES)
Points, ///< List of individual points
Lines, ///< List of individual lines
LineStrip, ///< List of connected lines, a point uses the previous point to form a line
Triangles, ///< List of individual triangles
TriangleStrip, ///< List of connected triangles, a point uses the two previous points to form a triangle
TriangleFan, ///< List of connected triangles, a point uses the common center and the previous point to form a triangle
Quads, ///< List of individual quads (deprecated, don't work with OpenGL ES)
// Deprecated names
LinesStrip = LineStrip, //!< \deprecated Use LineStrip instead
TrianglesStrip = TriangleStrip, //!< \deprecated Use TriangleStrip instead
TrianglesFan = TriangleFan //!< \deprecated Use TriangleFan instead
LinesStrip = LineStrip, ///< \deprecated Use LineStrip instead
TrianglesStrip = TriangleStrip, ///< \deprecated Use TriangleStrip instead
TrianglesFan = TriangleFan ///< \deprecated Use TriangleFan instead
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -151,33 +151,13 @@ public:
////////////////////////////////////////////////////////////
bool intersects(const Rect<T>& rectangle, Rect<T>& intersection) const;
////////////////////////////////////////////////////////////
/// \brief Get the position of the rectangle's top-left corner
///
/// \return Position of rectangle
///
/// \see getSize
///
////////////////////////////////////////////////////////////
sf::Vector2<T> getPosition() const;
////////////////////////////////////////////////////////////
/// \brief Get the size of the rectangle
///
/// \return Size of rectangle
///
/// \see getPosition
///
////////////////////////////////////////////////////////////
sf::Vector2<T> getSize() const;
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
T left; //!< Left coordinate of the rectangle
T top; //!< Top coordinate of the rectangle
T width; //!< Width of the rectangle
T height; //!< Height of the rectangle
T left; ///< Left coordinate of the rectangle
T top; ///< Top coordinate of the rectangle
T width; ///< Width of the rectangle
T height; ///< Height of the rectangle
};
////////////////////////////////////////////////////////////

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -141,18 +141,6 @@ bool Rect<T>::intersects(const Rect<T>& rectangle, Rect<T>& intersection) const
}
}
template <typename T>
sf::Vector2<T> Rect<T>::getPosition() const
{
return sf::Vector2<T>(left, top);
}
template <typename T>
sf::Vector2<T> Rect<T>::getSize() const
{
return sf::Vector2<T>(width, height);
}
////////////////////////////////////////////////////////////
template <typename T>

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -99,7 +99,7 @@ private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
Vector2f m_size; //!< Size of the rectangle
Vector2f m_size; ///< Size of the rectangle
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -31,6 +31,7 @@
#include <SFML/Graphics/Export.hpp>
#include <SFML/Graphics/BlendMode.hpp>
#include <SFML/Graphics/Transform.hpp>
#include <SFML/Graphics/StencilMode.hpp>
namespace sf
@ -53,6 +54,7 @@ public:
/// to using sf::RenderStates::Default.
/// The default set defines:
/// \li the BlendAlpha blend mode
/// \li the default StencilMode (no stencil)
/// \li the identity transform
/// \li a null texture
/// \li a null shader
@ -68,6 +70,14 @@ public:
////////////////////////////////////////////////////////////
RenderStates(const BlendMode& theBlendMode);
////////////////////////////////////////////////////////////
/// \brief Construct a default set of render states with a custom stencil mode
///
/// \param theStencilMode Stencil mode to use
///
////////////////////////////////////////////////////////////
RenderStates(const StencilMode& theStencilMode);
////////////////////////////////////////////////////////////
/// \brief Construct a default set of render states with a custom transform
///
@ -93,7 +103,7 @@ public:
RenderStates(const Shader* theShader);
////////////////////////////////////////////////////////////
/// \brief Construct a set of render states with all its attributes
/// \brief Construct a set of render states with most of its attributes
///
/// \param theBlendMode Blend mode to use
/// \param theTransform Transform to use
@ -104,18 +114,32 @@ public:
RenderStates(const BlendMode& theBlendMode, const Transform& theTransform,
const Texture* theTexture, const Shader* theShader);
////////////////////////////////////////////////////////////
/// \brief Construct a set of render states with all its attributes
///
/// \param theBlendMode Blend mode to use
/// \param theStencilMode Stencil mode to use
/// \param theTransform Transform to use
/// \param theTexture Texture to use
/// \param theShader Shader to use
///
////////////////////////////////////////////////////////////
RenderStates(const BlendMode& theBlendMode, const StencilMode& theStencilMode,
const Transform& theTransform, const Texture* theTexture, const Shader* theShader);
////////////////////////////////////////////////////////////
// Static member data
////////////////////////////////////////////////////////////
static const RenderStates Default; //!< Special instance holding the default render states
static const RenderStates Default; ///< Special instance holding the default render states
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
BlendMode blendMode; //!< Blending mode
Transform transform; //!< Transform
const Texture* texture; //!< Texture
const Shader* shader; //!< Shader
BlendMode blendMode; ///< Blending mode
StencilMode stencilMode; ///< Stencil mode
Transform transform; ///< Transform
const Texture* texture; ///< Texture
const Shader* shader; ///< Shader
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -38,6 +38,7 @@
#include <SFML/Graphics/PrimitiveType.hpp>
#include <SFML/Graphics/Vertex.hpp>
#include <SFML/System/NonCopyable.hpp>
#include <SFML/Graphics/StencilMode.hpp>
namespace sf
@ -70,6 +71,29 @@ public:
////////////////////////////////////////////////////////////
void clear(const Color& color = Color(0, 0, 0, 255));
////////////////////////////////////////////////////////////
/// \brief Clear the stencil buffer to a specific value
///
/// The specified value is truncated to the bit width of
/// the current stencil buffer.
///
/// \param value Stencil value to clear to
///
////////////////////////////////////////////////////////////
void clear(unsigned int value);
////////////////////////////////////////////////////////////
/// \brief Clear the entire target with a single color and stencil value
///
/// The specified stencil value is truncated to the bit
/// width of the current stencil buffer.
///
/// \param color Fill color to use to clear the render target
/// \param value Stencil value to clear to
///
////////////////////////////////////////////////////////////
void clear(const Color& color, unsigned int value);
////////////////////////////////////////////////////////////
/// \brief Change the current active view
///
@ -399,6 +423,14 @@ private:
////////////////////////////////////////////////////////////
void applyBlendMode(const BlendMode& mode);
////////////////////////////////////////////////////////////
/// \brief Apply a new stencil mode
///
/// \param mode Stencil mode to apply
///
////////////////////////////////////////////////////////////
void applyStencilMode(const StencilMode& mode);
////////////////////////////////////////////////////////////
/// \brief Apply a new transform
///
@ -458,23 +490,25 @@ private:
{
enum {VertexCacheSize = 4};
bool enable; //!< Is the cache enabled?
bool glStatesSet; //!< Are our internal GL states set yet?
bool viewChanged; //!< Has the current view changed since last draw?
BlendMode lastBlendMode; //!< Cached blending mode
Uint64 lastTextureId; //!< Cached texture
bool texCoordsArrayEnabled; //!< Is GL_TEXTURE_COORD_ARRAY client state enabled?
bool useVertexCache; //!< Did we previously use the vertex cache?
Vertex vertexCache[VertexCacheSize]; //!< Pre-transformed vertices cache
bool enable; ///< Is the cache enabled?
bool glStatesSet; ///< Are our internal GL states set yet?
bool viewChanged; ///< Has the current view changed since last draw?
bool stencilEnabled; ///< Is stencil testing enabled?
BlendMode lastBlendMode; ///< Cached blending mode
StencilMode lastStencilMode; ///< Cached stencil
Uint64 lastTextureId; ///< Cached texture
bool texCoordsArrayEnabled; ///< Is GL_TEXTURE_COORD_ARRAY client state enabled?
bool useVertexCache; ///< Did we previously use the vertex cache?
Vertex vertexCache[VertexCacheSize]; ///< Pre-transformed vertices cache
};
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
View m_defaultView; //!< Default view
View m_view; //!< Current view
StatesCache m_cache; //!< Render states cache
Uint64 m_id; //!< Unique number that identifies the RenderTarget
View m_defaultView; ///< Default view
View m_view; ///< Current view
StatesCache m_cache; ///< Render states cache
Uint64 m_id; ///< Unique number that identifies the RenderTarget
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -238,8 +238,8 @@ private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
priv::RenderTextureImpl* m_impl; //!< Platform/hardware specific implementation
Texture m_texture; //!< Target texture to draw on
priv::RenderTextureImpl* m_impl; ///< Platform/hardware specific implementation
Texture m_texture; ///< Target texture to draw on
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -183,7 +183,7 @@ private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
unsigned int m_defaultFrameBuffer; //!< Framebuffer to bind when targeting this window
unsigned int m_defaultFrameBuffer; ///< Framebuffer to bind when targeting this window
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -59,9 +59,9 @@ public:
////////////////////////////////////////////////////////////
enum Type
{
Vertex, //!< %Vertex shader
Geometry, //!< Geometry shader
Fragment //!< Fragment (pixel) shader
Vertex, ///< %Vertex shader
Geometry, ///< Geometry shader
Fragment ///< Fragment (pixel) shader
};
////////////////////////////////////////////////////////////
@ -745,10 +745,10 @@ private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
unsigned int m_shaderProgram; //!< OpenGL identifier for the program
int m_currentTexture; //!< Location of the current texture in the shader
TextureTable m_textures; //!< Texture variables in the shader, mapped to their location
UniformTable m_uniforms; //!< Parameters location cache
unsigned int m_shaderProgram; ///< OpenGL identifier for the program
int m_currentTexture; ///< Location of the current texture in the shader
TextureTable m_textures; ///< Texture variables in the shader, mapped to their location
UniformTable m_uniforms; ///< Parameters location cache
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -32,6 +32,7 @@
#include <SFML/Graphics/Drawable.hpp>
#include <SFML/Graphics/Transformable.hpp>
#include <SFML/Graphics/VertexArray.hpp>
#include <SFML/Graphics/VertexBuffer.hpp>
#include <SFML/System/Vector2.hpp>
@ -305,15 +306,17 @@ private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
const Texture* m_texture; //!< Texture of the shape
IntRect m_textureRect; //!< Rectangle defining the area of the source texture to display
Color m_fillColor; //!< Fill color
Color m_outlineColor; //!< Outline color
float m_outlineThickness; //!< Thickness of the shape's outline
VertexArray m_vertices; //!< Vertex array containing the fill geometry
VertexArray m_outlineVertices; //!< Vertex array containing the outline geometry
FloatRect m_insideBounds; //!< Bounding rectangle of the inside (fill)
FloatRect m_bounds; //!< Bounding rectangle of the whole shape (outline + fill)
const Texture* m_texture; ///< Texture of the shape
IntRect m_textureRect; ///< Rectangle defining the area of the source texture to display
Color m_fillColor; ///< Fill color
Color m_outlineColor; ///< Outline color
float m_outlineThickness; ///< Thickness of the shape's outline
VertexArray m_vertices; ///< Vertex array containing the fill geometry
VertexArray m_outlineVertices; ///< Vertex array containing the outline geometry
VertexBuffer m_verticesBuffer; ///< Vertex buffer containing the fill geometry
VertexBuffer m_outlineVerticesBuffer; ///< Vertex buffer containing the outline geometry
FloatRect m_insideBounds; ///< Bounding rectangle of the inside (fill)
FloatRect m_bounds; ///< Bounding rectangle of the whole shape (outline + fill)
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -33,6 +33,7 @@
#include <SFML/Graphics/Transformable.hpp>
#include <SFML/Graphics/Vertex.hpp>
#include <SFML/Graphics/Rect.hpp>
#include <SFML/Graphics/VertexBuffer.hpp>
namespace sf
@ -215,9 +216,10 @@ private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
Vertex m_vertices[4]; //!< Vertices defining the sprite's geometry
const Texture* m_texture; //!< Texture of the sprite
IntRect m_textureRect; //!< Rectangle defining the area of the source texture to display
Vertex m_vertices[4]; ///< Vertices defining the sprite's geometry
VertexBuffer m_verticesBuffer; ///< Vertex buffer containing the sprite's geometry
const Texture* m_texture; ///< Texture of the sprite
IntRect m_textureRect; ///< Rectangle defining the area of the source texture to display
};
} // namespace sf

View file

@ -0,0 +1,210 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2018 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_STENCILMODE_HPP
#define SFML_STENCILMODE_HPP
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics/Export.hpp>
namespace sf
{
////////////////////////////////////////////////////////////
/// \brief Stencil modes for drawing
///
////////////////////////////////////////////////////////////
struct SFML_GRAPHICS_API StencilMode
{
////////////////////////////////////////////////////////
/// \brief Enumeration of the stencil test comparisons that can be performed
///
/// The comparisons are mapped directly to their OpenGL equivalents,
/// specified by glStencilFunc().
////////////////////////////////////////////////////////
enum Comparison
{
Never, ///< The stencil test never passes
Less, ///< The stencil test passes if the new value is less than the value in the stencil buffer
LessEqual, ///< The stencil test passes if the new value is less than or equal to the value in the stencil buffer
Greater, ///< The stencil test passes if the new value is greater than the value in the stencil buffer
GreaterEqual, ///< The stencil test passes if the new value is greater than or equal to the value in the stencil buffer
Equal, ///< The stencil test passes if the new value is strictly equal to the value in the stencil buffer
NotEqual, ///< The stencil test passes if the new value is strictly inequal to the value in the stencil buffer
Always ///< The stencil test always passes
};
////////////////////////////////////////////////////////
/// \brief Enumeration of the stencil buffer update operations
///
/// The update operations are mapped directly to their OpenGL equivalents,
/// specified by glStencilOp().
////////////////////////////////////////////////////////
enum UpdateOperation
{
Keep, ///< If the stencil test passes, the value in the stencil buffer is not modified
Zero, ///< If the stencil test passes, the value in the stencil buffer is set to zero
Replace, ///< If the stencil test passes, the value in the stencil buffer is set to the new value
Increment, ///< If the stencil test passes, the value in the stencil buffer is incremented and if required clamped
Decrement, ///< If the stencil test passes, the value in the stencil buffer is decremented and if required clamped
Invert, ///< If the stencil test passes, the value in the stencil buffer is bitwise inverted
};
////////////////////////////////////////////////////////////
/// \brief Default constructor
///
/// Constructs a stencil mode that disables stencil testing
///
////////////////////////////////////////////////////////////
StencilMode();
////////////////////////////////////////////////////////////
/// \brief Construct a stencil mode given the function, operation and reference value.
///
/// \param stencilFunction Specifies the kind of test to perform against the value in the stencil buffer
/// \param stencilOperation Specifies how the stencil buffer is updated if the test passes
/// \param stencilReference Specifies the reference value to perform the stencil test with and to write into stencil buffer if the operation is Replace and the test passes
/// \param stencilMask Specifies the mask value to apply to both the reference value and the value in the stencil buffer when comparing and updating
/// \param stencilOnly True to update only the stencil buffer, false to update both stencil and color buffers
///
////////////////////////////////////////////////////////////
StencilMode(Comparison stencilFunction, UpdateOperation stencilOperation, unsigned int stencilReference, unsigned int stencilMask, bool stencilOnly);
////////////////////////////////////////////////////////////
// Member Data
////////////////////////////////////////////////////////////
Comparison stencilComparison; ///< The comparison we're performing the stencil test with
UpdateOperation stencilUpdateOperation; ///< The update operation to perform if the stencil test passes
unsigned int stencilReference; ///< The reference value we're performing the stencil test with
unsigned int stencilMask; ///< The mask to apply to both the reference value and the value in the stencil buffer
bool stencilOnly; ///< Whether we should update the color buffer in addition to the stencil buffer
};
////////////////////////////////////////////////////////////
/// \relates StencilMode
/// \brief Overload of the == operator
///
/// \param left Left operand
/// \param right Right operand
///
/// \return True if stencil modes are equal, false if they are different
///
////////////////////////////////////////////////////////////
SFML_GRAPHICS_API bool operator ==(const StencilMode& left, const StencilMode& right);
////////////////////////////////////////////////////////////
/// \relates StencilMode
/// \brief Overload of the != operator
///
/// \param left Left operand
/// \param right Right operand
///
/// \return True if stencil modes are different, false if they are equal
///
////////////////////////////////////////////////////////////
SFML_GRAPHICS_API bool operator !=(const StencilMode& left, const StencilMode& right);
} // namespace sf
#endif // SFML_STENCILMODE_HPP
////////////////////////////////////////////////////////////
/// \class sf::StencilMode
/// \ingroup graphics
///
/// sf::StencilMode is a class that controls stencil testing.
///
/// In addition to drawing to the visible portion of a render target,
/// there is the possibility to "draw" to a so-called stencil buffer.
/// The stencil buffer is a special non-visible buffer that can contain
/// a single value per pixel that is drawn. This can be thought of as a
/// fifth value in addition to red, green, blue and alpha values. The maximum
/// value that can be represented depends on what is supported by the system.
/// Typically support for a 8-bit stencil buffer should always be available.
/// This will also have to be requested when creating a render target via
/// the sf::ContextSettings that is passed during creation. Stencil testing
/// will not work if there is no stencil buffer available in the target
/// that is being drawn to.
///
/// Initially, just like with the visible color buffer, the stencil value of
/// each pixel is set to an undefined value. Calling sf::RenderTarget::clear
/// will set each pixel's stencil value to 0. sf::RenderTarget::clear can be
/// called at any time to reset the stencil values back to 0.
///
/// When drawing an object, before each pixel of the color buffer is updated
/// with its new color value, the stencil test is performed. During this test
/// 2 values are compared with each other: the reference value that is passed
/// via sf::StencilMode and the value that is currently in the stencil buffer.
/// The arithmetic comparison that is performed on the 2 values can also be
/// controlled via sf::StencilMode. Depending on whether the test passes i.e.
/// the comparison yields true, the color buffer is updated with its new RGBA
/// value and if set in sf::StencilMode the stencil buffer is updated
/// accordingly. The new stencil value will be used during stencil testing the
/// next time the pixel is drawn to.
///
/// The class is composed of 4 components, each of which has its
/// own public member variable:
/// \li Stencil Comparison (@ref stencilComparison)
/// \li Stencil Update Operation (@ref stencilUpdateOperation)
/// \li Stencil Reference Value (@ref stencilReference)
/// \li Stencil Mask Value (@ref stencilMask)
/// \li Stencil Only Update (@ref stencilOnly)
///
/// The stencil comparison specifies the comparison that is performed between
/// the reference value of the currently active sf::StencilMode and the value
/// that is currently in the stencil buffer. This comparison determines whether
/// the stencil test passes or fails.
///
/// The stencil update operation specifies how the stencil buffer is updated if
/// the stencil test passes. If the stencil test fails, neither the color or
/// stencil buffers will be modified. If incrementing or decrementing the
/// stencil value the new value will be clamped to the range from 0 to the
/// maximum representable value given the bit width of the stencil buffer
/// e.g. 255 if an 8-bit stencil buffer is being used.
///
/// The reference value is used both during the comparison with the current
/// stencil buffer value and as the new value to be written when the operation
/// is set to Replace.
///
/// The mask value is used to mask the bits of both the reference value and
/// the value in the stencil buffer during the comparison and when updating.
/// The mask can be used to e.g. segment the stencil value bits into separate
/// regions that are used for different purposes.
///
/// In certain situations, it might make sense to only write to the stencil
/// buffer and not the color buffer during a draw. The written stencil buffer
/// value can then be used in subsequent draws as a masking region.
///
/// In SFML, a stencil mode can be specified every time you draw a sf::Drawable
/// object to a render target. It is part of the sf::RenderStates compound
/// that is passed to the member function sf::RenderTarget::draw().
///
/// \see sf::RenderStates, sf::RenderTarget
///
////////////////////////////////////////////////////////////

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -34,6 +34,7 @@
#include <SFML/Graphics/Font.hpp>
#include <SFML/Graphics/Rect.hpp>
#include <SFML/Graphics/VertexArray.hpp>
#include <SFML/Graphics/VertexBuffer.hpp>
#include <SFML/System/String.hpp>
#include <string>
#include <vector>
@ -55,11 +56,11 @@ public:
////////////////////////////////////////////////////////////
enum Style
{
Regular = 0, //!< Regular characters, no style
Bold = 1 << 0, //!< Bold characters
Italic = 1 << 1, //!< Italic characters
Underlined = 1 << 2, //!< Underlined characters
StrikeThrough = 1 << 3 //!< Strike through characters
Regular = 0, ///< Regular characters, no style
Bold = 1 << 0, ///< Bold characters
Italic = 1 << 1, ///< Italic characters
Underlined = 1 << 2, ///< Underlined characters
StrikeThrough = 1 << 3 ///< Strike through characters
};
////////////////////////////////////////////////////////////
@ -435,20 +436,22 @@ private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
String m_string; //!< String to display
const Font* m_font; //!< Font used to display the string
unsigned int m_characterSize; //!< Base size of characters, in pixels
float m_letterSpacingFactor; //!< Spacing factor between letters
float m_lineSpacingFactor; //!< Spacing factor between lines
Uint32 m_style; //!< Text style (see Style enum)
Color m_fillColor; //!< Text fill color
Color m_outlineColor; //!< Text outline color
float m_outlineThickness; //!< Thickness of the text's outline
mutable VertexArray m_vertices; //!< Vertex array containing the fill geometry
mutable VertexArray m_outlineVertices; //!< Vertex array containing the outline geometry
mutable FloatRect m_bounds; //!< Bounding rectangle of the text (in local coordinates)
mutable bool m_geometryNeedUpdate; //!< Does the geometry need to be recomputed?
mutable Uint64 m_fontTextureId; //!< The font texture id
String m_string; ///< String to display
const Font* m_font; ///< Font used to display the string
unsigned int m_characterSize; ///< Base size of characters, in pixels
float m_letterSpacingFactor; ///< Spacing factor between letters
float m_lineSpacingFactor; ///< Spacing factor between lines
Uint32 m_style; ///< Text style (see Style enum)
Color m_fillColor; ///< Text fill color
Color m_outlineColor; ///< Text outline color
float m_outlineThickness; ///< Thickness of the text's outline
mutable VertexArray m_vertices; ///< Vertex array containing the fill geometry
mutable VertexArray m_outlineVertices; ///< Vertex array containing the outline geometry
mutable VertexBuffer m_verticesBuffer; ///< Vertex buffer containing the fill geometry
mutable VertexBuffer m_outlineVerticesBuffer; ///< Vertex buffer containing the outline geometry
mutable FloatRect m_bounds; ///< Bounding rectangle of the text (in local coordinates)
mutable bool m_geometryNeedUpdate; ///< Does the geometry need to be recomputed?
mutable Uint64 m_fontTextureId; ///< The font texture id
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -55,8 +55,8 @@ public:
////////////////////////////////////////////////////////////
enum CoordinateType
{
Normalized, //!< Texture coordinates in range [0 .. 1]
Pixels //!< Texture coordinates in range [0 .. size]
Normalized, ///< Texture coordinates in range [0 .. 1]
Pixels ///< Texture coordinates in range [0 .. size]
};
public:
@ -616,16 +616,16 @@ private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
Vector2u m_size; //!< Public texture size
Vector2u m_actualSize; //!< Actual texture size (can be greater than public size because of padding)
unsigned int m_texture; //!< Internal texture identifier
bool m_isSmooth; //!< Status of the smooth filter
bool m_sRgb; //!< Should the texture source be converted from sRGB?
bool m_isRepeated; //!< Is the texture in repeat mode?
mutable bool m_pixelsFlipped; //!< To work around the inconsistency in Y orientation
bool m_fboAttachment; //!< Is this texture owned by a framebuffer object?
bool m_hasMipmap; //!< Has the mipmap been generated?
Uint64 m_cacheId; //!< Unique number that identifies the texture to the render target's cache
Vector2u m_size; ///< Public texture size
Vector2u m_actualSize; ///< Actual texture size (can be greater than public size because of padding)
unsigned int m_texture; ///< Internal texture identifier
bool m_isSmooth; ///< Status of the smooth filter
bool m_sRgb; ///< Should the texture source be converted from sRGB?
bool m_isRepeated; ///< Is the texture in repeat mode?
mutable bool m_pixelsFlipped; ///< To work around the inconsistency in Y orientation
bool m_fboAttachment; ///< Is this texture owned by a framebuffer object?
bool m_hasMipmap; ///< Has the mipmap been generated?
Uint64 m_cacheId; ///< Unique number that identifies the texture to the render target's cache
};
} // namespace sf

View file

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2020 Laurent Gomila (laurent@sfml-dev.org)
// Copyright (C) 2007-2019 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.
@ -100,12 +100,6 @@ public:
////////////////////////////////////////////////////////////
/// \brief Transform a 2D point
///
/// These two statements are equivalent:
/// \code
/// sf::Vector2f transformedPoint = matrix.transformPoint(x, y);
/// sf::Vector2f transformedPoint = matrix * sf::Vector2f(x, y);
/// \endcode
///
/// \param x X coordinate of the point to transform
/// \param y Y coordinate of the point to transform
///
@ -117,12 +111,6 @@ public:
////////////////////////////////////////////////////////////
/// \brief Transform a 2D point
///
/// These two statements are equivalent:
/// \code
/// sf::Vector2f transformedPoint = matrix.transformPoint(point);
/// sf::Vector2f transformedPoint = matrix * point;
/// \endcode
///
/// \param point Point to transform
///
/// \return Transformed point
@ -150,14 +138,8 @@ public:
/// \brief Combine the current transform with another one
///
/// The result is a transform that is equivalent to applying
/// \a transform followed by *this. Mathematically, it is
/// equivalent to a matrix multiplication (*this) * transform.
///
/// These two statements are equivalent:
/// \code
/// left.combine(right);
/// left *= right;
/// \endcode
/// *this followed by \a transform. Mathematically, it is
/// equivalent to a matrix multiplication.
///
/// \param transform Transform to combine with this transform
///
@ -369,14 +351,14 @@ public:
////////////////////////////////////////////////////////////
// Static member data
////////////////////////////////////////////////////////////
static const Transform Identity; //!< The identity transform (does nothing)
static const Transform Identity; ///< The identity transform (does nothing)
private:
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
float m_matrix[16]; //!< 4x4 matrix defining the transformation
float m_matrix[16]; ///< 4x4 matrix defining the transformation
};
////////////////////////////////////////////////////////////

Some files were not shown because too many files have changed in this diff Show more