├── .gitattributes ├── .gitignore ├── .vscode └── c_cpp_properties.json ├── LICENSE ├── README.md ├── audio ├── Audio_wrap.c └── audio.go ├── build.sh ├── examples ├── basic_window │ ├── README.md │ ├── build.bat │ ├── go.mod │ └── main.go └── tennis │ ├── README.md │ ├── asset_licenses.md │ ├── build.bat │ ├── go.mod │ ├── main.go │ └── resources │ ├── ball.wav │ ├── sfml_logo.png │ └── tuffy.ttf ├── go.mod ├── graphics ├── Graphics_wrap.c └── graphics.go ├── interfaces ├── Audio.i ├── Graphics.i ├── System.i └── Window.i ├── sfml.sh ├── swig.sh ├── system ├── System_wrap.c └── system.go └── window ├── Window_wrap.c └── window.go /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | *.gor 7 | 8 | # Folders 9 | _obj 10 | _test 11 | 12 | # Architecture specific extensions/prefixes 13 | *.[568vq] 14 | [568vq].out 15 | 16 | *.cgo1.go 17 | *.cgo2.c 18 | _cgo_defun.c 19 | _cgo_gotypes.go 20 | _cgo_export.* 21 | 22 | _testmain.go 23 | 24 | *.exe 25 | *.test 26 | 27 | 28 | *.sublime-workspace 29 | *.sw* 30 | *.un* 31 | 32 | coverage*.out 33 | 34 | /SFML/ 35 | /CSFML/ 36 | /swig/ 37 | 38 | go-sfml 39 | -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Mac", 5 | "includePath": [ 6 | "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1", 7 | "/usr/local/include", 8 | "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include", 9 | "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include", 10 | "/usr/include", 11 | "/usr/include/machine", 12 | "${workspaceRoot}", 13 | "${workspaceRoot}/CSFML/include" 14 | ], 15 | "defines": [], 16 | "intelliSenseMode": "clang-x64", 17 | "browse": { 18 | "path": [ 19 | "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1", 20 | "/usr/local/include", 21 | "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include", 22 | "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include", 23 | "/usr/include", 24 | "/usr/include/machine", 25 | "${workspaceRoot}", 26 | "${workspaceRoot}/CSFML/include" 27 | ], 28 | "limitSymbolsToIncludedHeaders": true, 29 | "databaseFilename": "" 30 | } 31 | }, 32 | { 33 | "name": "Linux", 34 | "includePath": [ 35 | "/usr/include", 36 | "/usr/local/include", 37 | "${workspaceRoot}" 38 | ], 39 | "defines": [], 40 | "intelliSenseMode": "clang-x64", 41 | "browse": { 42 | "path": [ 43 | "/usr/include", 44 | "/usr/local/include", 45 | "${workspaceRoot}" 46 | ], 47 | "limitSymbolsToIncludedHeaders": true, 48 | "databaseFilename": "" 49 | } 50 | }, 51 | { 52 | "name": "Win32", 53 | "includePath": [ 54 | "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include", 55 | "${workspaceRoot}" 56 | ], 57 | "defines": [ 58 | "_DEBUG", 59 | "UNICODE" 60 | ], 61 | "intelliSenseMode": "msvc-x64", 62 | "browse": { 63 | "path": [ 64 | "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/*", 65 | "${workspaceRoot}" 66 | ], 67 | "limitSymbolsToIncludedHeaders": true, 68 | "databaseFilename": "" 69 | } 70 | } 71 | ], 72 | "version": 2 73 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Telroshan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # go-sfml 2 | 3 | Go bindings for [SFML](http://www.sfml-dev.org), the Simple and Fast Multimedia Library, version [2.5.1](https://www.sfml-dev.org/changelog.php#sfml-2.5.1) 4 | 5 | Originally made by [teh-cmc](https://github.com/teh-cmc) 6 | 7 | These bindings *are entirely generated* using [SWIG](http://www.swig.org/) and the official [C bindings of SFML](https://www.sfml-dev.org/download/csfml/). 8 | Hence they should be fairly easy to maintain & keep in sync with future releases from upstream 9 | 10 | ## Table of Contents 11 | 12 | 13 | 14 | 15 | 16 | - [Portability](#portability) 17 | - [Usage](#usage) 18 | - [Installation](#installation) 19 | - [First setup](#first-setup) 20 | - [Get the module](#get-the-module) 21 | - [Troubleshooting](#troubleshooting) 22 | - [Error: `SFML/Window.h: No such file or directory`](#error-sfmlwindowh-no-such-file-or-directory) 23 | - [Error: `imports github.com/telroshan/go-sfml/v2/window: build constraints exclude all Go files in [...]`](#error-imports-githubcomtelroshango-sfmlv2window-build-constraints-exclude-all-go-files-in-) 24 | - [Error: `csfml-window-2.dll could not be found`](#error-csfml-window-2dll-could-not-be-found) 25 | - [Bat script](#bat-script) 26 | - [API](#api) 27 | - [Modules](#modules) 28 | - [Examples](#examples) 29 | - [Basic example](#basic-example) 30 | - [Other examples](#other-examples) 31 | - [Building go-sfml](#building-go-sfml) 32 | - [Download & compile SFML + CSFML](#download--compile-sfml--csfml) 33 | - [Troubleshooting](#troubleshooting-1) 34 | - [Error: `/usr/bin/env: ‘bash\r’: No such file or directory`](#error-usrbinenv-bashr-no-such-file-or-directory) 35 | - [Error: `CMake Error [...] Could not find X11` _(or a similar error with just another name instead of `X11`)_](#error-cmake-error--could-not-find-x11-or-a-similar-error-with-just-another-name-instead-of-x11) 36 | - [Setup swig](#setup-swig) 37 | - [Option 1 - Install it from your package manager](#option-1---install-it-from-your-package-manager) 38 | - [Option 2 - Build it locally](#option-2---build-it-locally) 39 | - [Troubleshooting](#troubleshooting-2) 40 | - [Error: `/usr/bin/env: ‘bash\r’: No such file or directory`](#error-usrbinenv-bashr-no-such-file-or-directory-1) 41 | - [Error: `Cannot find pcre-config script from PCRE (Perl Compatible Regular Expressions)`](#error-cannot-find-pcre-config-script-from-pcre-perl-compatible-regular-expressions) 42 | - [Build go bindings](#build-go-bindings) 43 | - [Troubleshooting](#troubleshooting-3) 44 | - [Error: `/usr/bin/env: ‘bash\r’: No such file or directory`](#error-usrbinenv-bashr-no-such-file-or-directory-2) 45 | - [Error: `swig: command not found`](#error-swig-command-not-found) 46 | - [Error: `Unable to find 'swig.swg'`](#error-unable-to-find-swigswg) 47 | - [Error: `patchelf: command not found`](#error-patchelf-command-not-found) 48 | 49 | 50 | 51 | --- 52 | 53 | ## Portability 54 | 55 | I have only tested these on Windows 10 56 | 57 | Feel free to open issues and/or PRs if you're running into problems on other platforms 58 | 59 | ## Usage 60 | 61 | ### Installation 62 | #### First setup 63 | I'll cover Windows in this section _(I build go-sfml using [WSL](https://docs.microsoft.com/en-us/windows/wsl/install), but build my go apps on Windows)_ 64 | 65 | 1. Download [CSFML 2.5.1](https://www.sfml-dev.org/download/csfml/) and extract it wherever you like _(assuming `C:\CSFML_2.5.1` for the next steps)_. I'm downloading the 64 bits version since I'm on a 64 bits Windows 66 | 2. Download and install the [GCC compiler](https://gcc.gnu.org/install/binaries.html) _(in my case, the [mingw x86_64-win32-sjlj](https://github.com/niXman/mingw-builds-binaries/releases) one)_ 67 | 3. We now need to define the `CGO_CFLAGS` and `CGO_LDFLAGS` environment variables so the linker knows where the CSFML headers and compiled libraries are at 68 | 69 | Assuming CSFML is extracted at `C:\CSFML_2.5.1`, we can run the following in a command line : 70 | ``` 71 | set CGO_CFLAGS="-IC:\CSFML_2.5.1\include" 72 | set CGO_LDFLAGS="-LC:\CSFML_2.5.1\lib\gcc" 73 | ``` 74 | Feel free to set those variables system-wide so you don't have to define them on the fly everytime 75 | 76 | Notice the **-I** and **-L** before the paths, with no whitespace in between 77 | 78 | 4. Build the example to ensure your setup is working 79 | ```bash 80 | cd examples/basic_window 81 | go get && go build 82 | ``` 83 | 5. Copy the CSFML DLLs next to your executable, for the basic example we only need `csfml-window-2.dll` and `csfml-graphics-2.dll` that you'll find into `C:\CSFML_2.5.1\bin` 84 | 6. Run the exe, a red window should appear! 85 | #### Get the module 86 | For future projects, simply run 87 | ```bash 88 | go get github.com/telroshan/go-sfml/v2 89 | ``` 90 | And import the modules you need 91 | ```Go 92 | import ( 93 | "github.com/telroshan/go-sfml/v2/graphics" 94 | "github.com/telroshan/go-sfml/v2/window" 95 | "github.com/telroshan/go-sfml/v2/system" 96 | "github.com/telroshan/go-sfml/v2/audio" 97 | ) 98 | ``` 99 | #### Troubleshooting 100 | ##### Error: `SFML/Window.h: No such file or directory` 101 | → Make sure you have downloaded the CSFML version that matches your system _(don't download the 32 bits one if you're on a 64 bits Windows)_ 102 | 103 | → Make sure you included the subfolder matching your compiler _(gcc here)_ for `CGO_LDFLAGS`, and didn't make it point to the `lib` root folder itself 104 | 105 | → Make sure you defined the environment variables in the same command line that you ran `go build` into _(the variables defined with the [`set`](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/set_1) command won't exist outside of the command line they've been set into)_ 106 | 107 | → Make sure you typed the variable names correctly, i.e `CGO_CFLAGS` and `CGO_LDFLAGS` 108 | 109 | → Make sure you didn't invert the paths between the two variables. `CGO_CFLAGS` should point to the `include` folder whereas `CGO_LDFLAGS` should point to the libs 110 | 111 | → Make sure you made no typo with the syntax of -I and -L for those variables 112 | ##### Error: `imports github.com/telroshan/go-sfml/v2/window: build constraints exclude all Go files in [...]` 113 | → You need to define the environment variable [`CGO_ENABLED`](https://pkg.go.dev/cmd/cgo). As the doc says: 114 | > The cgo tool is enabled by default for native builds on systems where it is expected to work. It is disabled by default when cross-compiling. You can control this by setting the CGO_ENABLED environment variable when running the go tool: set it to 1 to enable the use of cgo, and to 0 to disable it. 115 | ``` 116 | set CGO_ENABLED=1 117 | ``` 118 | ##### Error: `csfml-window-2.dll could not be found` 119 | → You probably didn't copy CSFML DLLs next to your executable, as mentioned in step 5 120 | 121 | ### Bat script 122 | Alternatively to steps 3 to 5 from the [previous section](#installation), you could use a bat script to automate that process for you, such as [the one in the basic window example](https://github.com/Telroshan/go-sfml/blob/master/examples/basic_window/build.bat) 123 | ```bat 124 | @ECHO OFF 125 | 126 | rem This script sets the environment variables to be able to build the app, and copies the CSFML DLLs over if there aren't any in the folder 127 | 128 | rem Edit the CSFML_PATH variable to match the path of your CSFML installation 129 | set CSFML_PATH=C:\CSFML_2.5.1 130 | rem Edit the COMPILER_NAME variable if you're not using gcc 131 | set COMPILER_NAME=gcc 132 | 133 | set CGO_CFLAGS="-I%CSFML_PATH%\include" 134 | set CGO_LDFLAGS="-L%CSFML_PATH%\lib\%COMPILER_NAME%" 135 | 136 | go get 137 | if %ERRORLEVEL% NEQ 0 (echo go get failed && exit /b %ERRORLEVEL%) 138 | 139 | go build 140 | if %ERRORLEVEL% NEQ 0 (echo go build failed && exit /b %ERRORLEVEL%) 141 | 142 | echo Build complete 143 | 144 | if not exist "%~dp0*.dll" ( 145 | echo No DLLs in folder, getting them from CSFML folder 146 | xcopy /s "%CSFML_PATH%\bin" "%~dp0" 147 | if %ERRORLEVEL% NEQ 0 (echo failed to copy DLLs && exit /b %ERRORLEVEL%) 148 | ) 149 | ``` 150 | 151 | ### API 152 | The generated APIs very closely follow those of [SFML's C bindings](https://www.sfml-dev.org/download/csfml/): the [tutorials](http://www.sfml-dev.org/tutorials/) & [documentation](http://www.sfml-dev.org/documentation/) available for the official C++ implementation, as well as an editor with a well configured Go-autocompletion, will get you a long way 153 | 154 | ### Modules 155 | 156 | The original C & C++ implementations of SFML come with 5 modules: [*Audio*](https://www.sfml-dev.org/documentation/2.4.0/group__audio.php), [*Graphics*](https://www.sfml-dev.org/documentation/2.4.0/group__graphics.php), [*Network*](https://www.sfml-dev.org/documentation/2.4.0/group__network.php), [*System*](https://www.sfml-dev.org/documentation/2.4.0/group__system.php) and [*Window*](https://www.sfml-dev.org/documentation/2.4.0/group__window.php) 157 | 158 | Of these 5 modules: 159 | - ***Audio***, ***Graphics*** & ***Window*** come with complete Go packages counterparts 160 | - ***System*** also has a dedicated Go package, but only contains the `sfVector2` & `sfVector3` classes; everything else is already available in one form or another in Go's standard library 161 | - ***Network*** has been entirely discard, use Go's standard library instead 162 | 163 | ### Examples 164 | #### Basic example 165 | Here's a straightforward example of creating a window and handling events: 166 | ```Go 167 | package main 168 | 169 | import ( 170 | "runtime" 171 | 172 | "github.com/telroshan/go-sfml/v2/graphics" 173 | "github.com/telroshan/go-sfml/v2/window" 174 | ) 175 | 176 | func init() { runtime.LockOSThread() } 177 | 178 | func main() { 179 | vm := window.NewSfVideoMode() 180 | defer window.DeleteSfVideoMode(vm) 181 | vm.SetWidth(800) 182 | vm.SetHeight(600) 183 | vm.SetBitsPerPixel(32) 184 | 185 | /* Create the main window */ 186 | cs := window.NewSfContextSettings() 187 | defer window.DeleteSfContextSettings(cs) 188 | w := graphics.SfRenderWindow_create(vm, "SFML window", uint(window.SfResize|window.SfClose), cs) 189 | defer window.SfWindow_destroy(w) 190 | 191 | ev := window.NewSfEvent() 192 | defer window.DeleteSfEvent(ev) 193 | 194 | /* Start the game loop */ 195 | for window.SfWindow_isOpen(w) > 0 { 196 | /* Process events */ 197 | for window.SfWindow_pollEvent(w, ev) > 0 { 198 | /* Close window: exit */ 199 | if ev.GetEvType() == window.SfEventType(window.SfEvtClosed) { 200 | return 201 | } 202 | } 203 | graphics.SfRenderWindow_clear(w, graphics.GetSfRed()) 204 | graphics.SfRenderWindow_display(w) 205 | } 206 | } 207 | ``` 208 | 209 | For comparison's sake, the exact same thing in C: 210 | ```C 211 | #include 212 | #include 213 | 214 | int main() { 215 | sfVideoMode mode = {800, 600, 32}; 216 | sfRenderWindow* window; 217 | sfEvent event; 218 | 219 | /* Create the main window */ 220 | window = sfRenderWindow_create(mode, "SFML window", sfResize | sfClose, NULL); 221 | if (!window) 222 | return 1; 223 | 224 | /* Start the game loop */ 225 | while (sfRenderWindow_isOpen(window)) { 226 | /* Process events */ 227 | while (sfRenderWindow_pollEvent(window, &event)) { 228 | /* Close window : exit */ 229 | if (event.type == sfEvtClosed) 230 | sfRenderWindow_close(window); 231 | } 232 | /* Clear the screen */ 233 | sfRenderWindow_clear(window, sfRed); 234 | sfRenderWindow_display(window); 235 | } 236 | 237 | /* Cleanup resources */ 238 | sfRenderWindow_destroy(window); 239 | } 240 | ``` 241 | 242 | #### Other examples 243 | You'll find other examples in the [examples folder](https://github.com/Telroshan/go-sfml/tree/master/examples) 244 | 1. [Basic window](https://github.com/Telroshan/go-sfml/tree/master/examples/basic_window) : just the same as above 245 | 2. [Tennis](https://github.com/Telroshan/go-sfml/tree/master/examples/tennis) : go version of [SFML's tennis example](https://github.com/SFML/SFML/tree/master/examples/tennis) 246 | 247 | Feel free to open PRs if you have any example you'd like to share! 248 | 249 | ## Building go-sfml 250 | If you just want to use go-sfml for SFML 2.5.1 into your go project, you may want to read the [Usage section](#usage) instead 251 | 252 | If you want to build your own bindings for a different version of SFML, then this section is for you! 253 | 254 | _Note_: the following steps were realized in Windows' [Ubuntu bash](https://docs.microsoft.com/en-us/windows/wsl/install). Feel free to open issues and/or PRs if you're running into problems on other Unix-based platforms 255 | 256 | ### Download & compile SFML + CSFML 257 | 1. Install [SFML dependencies](https://www.sfml-dev.org/tutorials/2.5/compile-with-cmake.php#installing-dependencies) first 258 | 2. Run the `sfml.sh` script to handle the process of downloading SFML/CSFML and compiling them for you 259 | 260 | #### Troubleshooting 261 | ##### Error: `/usr/bin/env: ‘bash\r’: No such file or directory` 262 | → You're probably having [CRLF](https://developer.mozilla.org/en-US/docs/Glossary/CRLF) issues _(happened to me when cloning the repo on Windows initially before switching to WSL)_ 263 | 264 | → Use `dos2unix` _(install it if you don't have the command)_ on the 3 scripts : `dos2unix sfml.sh swig.sh build.sh` 265 | 266 | ##### Error: `CMake Error [...] Could not find X11` _(or a similar error with just another name instead of `X11`)_ 267 |
268 | Could not find X11
269 | Call Stack (most recent call first):
270 |   src/SFML/Window/CMakeLists.txt (find_package)
271 | 
272 | → You probably didn't install every [SFML dependency](https://www.sfml-dev.org/tutorials/2.5/compile-with-cmake.php#installing-dependencies). Don't forget the development headers as well! For example on Ubuntu, you'll want to install `libx11-dev`, `xorg-dev`, `libudev-dev`, and so on 273 | 274 | ### Setup swig 275 | #### Option 1 - Install it from your package manager 276 | 1. Depending on your platform, you may simply download the available package. For example on Ubuntu, `sudo apt install swig` 277 | #### Option 2 - Build it locally 278 | 1. Run `sudo apt install libpcre3-dev` _(swig requires this package)_ 279 | 2. Run the `swig.sh` script 280 | 3. Check where swig thinks its lib is, by running `./swig/swig -swiglib`. It should output ${path/to/go-sfml}/swig/Lib 281 | 4. If the output doesn't match, fix that by overriding the `SWIG_LIB` environment variable. You may run export SWIG_LIB=${path/to/go-sfml}/swig/Lib to override the var just for your current session, or [make it persistent](https://help.ubuntu.com/community/EnvironmentVariables#Persistent_environment_variables) 282 | 5. Run `./swig/swig -swiglib` again to ensure swig has the correct path to its own lib 283 | 6. Update the `build.sh` script and change the [line 23](https://github.com/telroshan/go-sfml/blob/master/build.sh#L23) : the script is looking for a [global command](#option-1---install-it-from-your-package-manager) `swig`, you must replace that path by `./swig/swig` to use the local build instead 284 | #### Troubleshooting 285 | ##### Error: `/usr/bin/env: ‘bash\r’: No such file or directory` 286 | → You're probably having [CRLF](https://developer.mozilla.org/en-US/docs/Glossary/CRLF) issues _(happened to me when cloning the repo on Windows initially before switching to WSL)_ 287 | 288 | → Use `dos2unix` _(install it if you don't have the command)_ on the 3 scripts : `dos2unix sfml.sh swig.sh build.sh` 289 | ##### Error: `Cannot find pcre-config script from PCRE (Perl Compatible Regular Expressions)` 290 | → You probably didn't install libpcre3-dev as mentioned in step 1. Run `sudo apt install libpcre3-dev` and try again 291 | 292 | ### Build go bindings 293 | 1. Run `sudo apt install patchelf` _(the build script uses this package to fix the missing links from the built CSFML libraries to the SFML ones)_ 294 | 2. Run `build.sh` 295 | #### Troubleshooting 296 | ##### Error: `/usr/bin/env: ‘bash\r’: No such file or directory` 297 | → You're probably having [CRLF](https://developer.mozilla.org/en-US/docs/Glossary/CRLF) issues _(happened to me when cloning the repo on Windows initially before switching to WSL)_ 298 | 299 | → Use `dos2unix` _(install it if you don't have the command)_ on the 3 scripts : `dos2unix sfml.sh swig.sh build.sh` 300 | ##### Error: `swig: command not found` 301 | → You probably either did not [install the `swig` package](#option-1---install-it-from-your-package-manager), or [built it locally](#option-2---build-it-locally) but forgot to follow the step 6 to update the path used by the `build.sh` script 302 | ##### Error: `Unable to find 'swig.swg'` 303 | → You probably went for the swig [local build](#option-2---build-it-locally), but didn't check for its lib path. Please follow steps 3 to 5 of that section 304 | ##### Error: `patchelf: command not found` 305 | → You probably didn't install `patchelf` as mentioned in step 1 306 | 307 | You're now ready to go! 308 | 309 | Feel free to open issues and/or PRs if you're running into problems that are not mentioned in the troubleshooting sub-sections 310 | 311 | -------------------------------------------------------------------------------- /audio/Audio_wrap.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 4.0.1 4 | * 5 | * This file is not intended to be easily readable and contains a number of 6 | * coding conventions designed to improve portability and efficiency. Do not make 7 | * changes to this file unless you know what you are doing--modify the SWIG 8 | * interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | /* source: /mnt/e/workspace/git/go-sfml/CSFML/include/SFML/Audio/Audio.i */ 12 | 13 | #define SWIGMODULE audio 14 | /* ----------------------------------------------------------------------------- 15 | * This section contains generic SWIG labels for method/variable 16 | * declarations/attributes, and other compiler dependent labels. 17 | * ----------------------------------------------------------------------------- */ 18 | 19 | /* template workaround for compilers that cannot correctly implement the C++ standard */ 20 | #ifndef SWIGTEMPLATEDISAMBIGUATOR 21 | # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) 22 | # define SWIGTEMPLATEDISAMBIGUATOR template 23 | # elif defined(__HP_aCC) 24 | /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ 25 | /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ 26 | # define SWIGTEMPLATEDISAMBIGUATOR template 27 | # else 28 | # define SWIGTEMPLATEDISAMBIGUATOR 29 | # endif 30 | #endif 31 | 32 | /* inline attribute */ 33 | #ifndef SWIGINLINE 34 | # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) 35 | # define SWIGINLINE inline 36 | # else 37 | # define SWIGINLINE 38 | # endif 39 | #endif 40 | 41 | /* attribute recognised by some compilers to avoid 'unused' warnings */ 42 | #ifndef SWIGUNUSED 43 | # if defined(__GNUC__) 44 | # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 45 | # define SWIGUNUSED __attribute__ ((__unused__)) 46 | # else 47 | # define SWIGUNUSED 48 | # endif 49 | # elif defined(__ICC) 50 | # define SWIGUNUSED __attribute__ ((__unused__)) 51 | # else 52 | # define SWIGUNUSED 53 | # endif 54 | #endif 55 | 56 | #ifndef SWIG_MSC_UNSUPPRESS_4505 57 | # if defined(_MSC_VER) 58 | # pragma warning(disable : 4505) /* unreferenced local function has been removed */ 59 | # endif 60 | #endif 61 | 62 | #ifndef SWIGUNUSEDPARM 63 | # ifdef __cplusplus 64 | # define SWIGUNUSEDPARM(p) 65 | # else 66 | # define SWIGUNUSEDPARM(p) p SWIGUNUSED 67 | # endif 68 | #endif 69 | 70 | /* internal SWIG method */ 71 | #ifndef SWIGINTERN 72 | # define SWIGINTERN static SWIGUNUSED 73 | #endif 74 | 75 | /* internal inline SWIG method */ 76 | #ifndef SWIGINTERNINLINE 77 | # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE 78 | #endif 79 | 80 | /* exporting methods */ 81 | #if defined(__GNUC__) 82 | # if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) 83 | # ifndef GCC_HASCLASSVISIBILITY 84 | # define GCC_HASCLASSVISIBILITY 85 | # endif 86 | # endif 87 | #endif 88 | 89 | #ifndef SWIGEXPORT 90 | # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) 91 | # if defined(STATIC_LINKED) 92 | # define SWIGEXPORT 93 | # else 94 | # define SWIGEXPORT __declspec(dllexport) 95 | # endif 96 | # else 97 | # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) 98 | # define SWIGEXPORT __attribute__ ((visibility("default"))) 99 | # else 100 | # define SWIGEXPORT 101 | # endif 102 | # endif 103 | #endif 104 | 105 | /* calling conventions for Windows */ 106 | #ifndef SWIGSTDCALL 107 | # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) 108 | # define SWIGSTDCALL __stdcall 109 | # else 110 | # define SWIGSTDCALL 111 | # endif 112 | #endif 113 | 114 | /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ 115 | #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) 116 | # define _CRT_SECURE_NO_DEPRECATE 117 | #endif 118 | 119 | /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ 120 | #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) 121 | # define _SCL_SECURE_NO_DEPRECATE 122 | #endif 123 | 124 | /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ 125 | #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) 126 | # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 127 | #endif 128 | 129 | /* Intel's compiler complains if a variable which was never initialised is 130 | * cast to void, which is a common idiom which we use to indicate that we 131 | * are aware a variable isn't used. So we just silence that warning. 132 | * See: https://github.com/swig/swig/issues/192 for more discussion. 133 | */ 134 | #ifdef __INTEL_COMPILER 135 | # pragma warning disable 592 136 | #endif 137 | 138 | 139 | #include 140 | #include 141 | #include 142 | #include 143 | #include 144 | 145 | 146 | 147 | typedef long long intgo; 148 | typedef unsigned long long uintgo; 149 | 150 | 151 | # if !defined(__clang__) && (defined(__i386__) || defined(__x86_64__)) 152 | # define SWIGSTRUCTPACKED __attribute__((__packed__, __gcc_struct__)) 153 | # else 154 | # define SWIGSTRUCTPACKED __attribute__((__packed__)) 155 | # endif 156 | 157 | 158 | 159 | typedef struct { char *p; intgo n; } _gostring_; 160 | typedef struct { void* array; intgo len; intgo cap; } _goslice_; 161 | 162 | 163 | 164 | 165 | #define swiggo_size_assert_eq(x, y, name) typedef char name[(x-y)*(x-y)*-2+1]; 166 | #define swiggo_size_assert(t, n) swiggo_size_assert_eq(sizeof(t), n, swiggo_sizeof_##t##_is_not_##n) 167 | 168 | swiggo_size_assert(char, 1) 169 | swiggo_size_assert(short, 2) 170 | swiggo_size_assert(int, 4) 171 | typedef long long swiggo_long_long; 172 | swiggo_size_assert(swiggo_long_long, 8) 173 | swiggo_size_assert(float, 4) 174 | swiggo_size_assert(double, 8) 175 | 176 | #ifdef __cplusplus 177 | extern "C" { 178 | #endif 179 | extern void crosscall2(void (*fn)(void *, int), void *, int); 180 | extern char* _cgo_topofstack(void) __attribute__ ((weak)); 181 | extern void _cgo_allocate(void *, int); 182 | extern void _cgo_panic(void *, int); 183 | #ifdef __cplusplus 184 | } 185 | #endif 186 | 187 | static char *_swig_topofstack() { 188 | if (_cgo_topofstack) { 189 | return _cgo_topofstack(); 190 | } else { 191 | return 0; 192 | } 193 | } 194 | 195 | static void _swig_gopanic(const char *p) { 196 | struct { 197 | const char *p; 198 | } SWIGSTRUCTPACKED a; 199 | a.p = p; 200 | crosscall2(_cgo_panic, &a, (int) sizeof a); 201 | } 202 | 203 | 204 | 205 | 206 | #define SWIG_contract_assert(expr, msg) \ 207 | if (!(expr)) { _swig_gopanic(msg); } else 208 | 209 | 210 | static _gostring_ Swig_AllocateString(const char *p, size_t l) { 211 | _gostring_ ret; 212 | ret.p = (char*)malloc(l); 213 | memcpy(ret.p, p, l); 214 | ret.n = l; 215 | return ret; 216 | } 217 | 218 | 219 | static void Swig_free(void* p) { 220 | free(p); 221 | } 222 | 223 | static void* Swig_malloc(int c) { 224 | return malloc(c); 225 | } 226 | 227 | 228 | /* Includes the header in the wrapper code */ 229 | #include 230 | 231 | #ifdef __cplusplus 232 | extern "C" { 233 | #endif 234 | 235 | void _wrap_Swig_free_audio_781f6cb27eac316e(void *_swig_go_0) { 236 | void *arg1 = (void *) 0 ; 237 | 238 | arg1 = *(void **)&_swig_go_0; 239 | 240 | Swig_free(arg1); 241 | 242 | } 243 | 244 | 245 | void *_wrap_Swig_malloc_audio_781f6cb27eac316e(intgo _swig_go_0) { 246 | int arg1 ; 247 | void *result = 0 ; 248 | void *_swig_go_result; 249 | 250 | arg1 = (int)_swig_go_0; 251 | 252 | result = (void *)Swig_malloc(arg1); 253 | *(void **)&_swig_go_result = (void *)result; 254 | return _swig_go_result; 255 | } 256 | 257 | 258 | void _wrap_sfListener_setGlobalVolume_audio_781f6cb27eac316e(float _swig_go_0) { 259 | float arg1 ; 260 | 261 | arg1 = (float)_swig_go_0; 262 | 263 | sfListener_setGlobalVolume(arg1); 264 | 265 | } 266 | 267 | 268 | float _wrap_sfListener_getGlobalVolume_audio_781f6cb27eac316e() { 269 | float result; 270 | float _swig_go_result; 271 | 272 | 273 | result = (float)sfListener_getGlobalVolume(); 274 | _swig_go_result = result; 275 | return _swig_go_result; 276 | } 277 | 278 | 279 | void _wrap_sfListener_setPosition_audio_781f6cb27eac316e(sfVector3f *_swig_go_0) { 280 | sfVector3f arg1 ; 281 | sfVector3f *argp1 ; 282 | 283 | 284 | argp1 = (sfVector3f *)_swig_go_0; 285 | if (argp1 == NULL) { 286 | _swig_gopanic("Attempt to dereference null sfVector3f"); 287 | } 288 | arg1 = (sfVector3f)*argp1; 289 | 290 | 291 | sfListener_setPosition(arg1); 292 | 293 | } 294 | 295 | 296 | sfVector3f *_wrap_sfListener_getPosition_audio_781f6cb27eac316e() { 297 | sfVector3f result; 298 | sfVector3f *_swig_go_result; 299 | 300 | 301 | result = sfListener_getPosition(); 302 | { 303 | sfVector3f * resultptr = (sfVector3f *)malloc(sizeof(sfVector3f)); 304 | memmove(resultptr, &result, sizeof(sfVector3f)); 305 | *(sfVector3f **)&_swig_go_result = resultptr; 306 | } 307 | return _swig_go_result; 308 | } 309 | 310 | 311 | void _wrap_sfListener_setDirection_audio_781f6cb27eac316e(sfVector3f *_swig_go_0) { 312 | sfVector3f arg1 ; 313 | sfVector3f *argp1 ; 314 | 315 | 316 | argp1 = (sfVector3f *)_swig_go_0; 317 | if (argp1 == NULL) { 318 | _swig_gopanic("Attempt to dereference null sfVector3f"); 319 | } 320 | arg1 = (sfVector3f)*argp1; 321 | 322 | 323 | sfListener_setDirection(arg1); 324 | 325 | } 326 | 327 | 328 | sfVector3f *_wrap_sfListener_getDirection_audio_781f6cb27eac316e() { 329 | sfVector3f result; 330 | sfVector3f *_swig_go_result; 331 | 332 | 333 | result = sfListener_getDirection(); 334 | { 335 | sfVector3f * resultptr = (sfVector3f *)malloc(sizeof(sfVector3f)); 336 | memmove(resultptr, &result, sizeof(sfVector3f)); 337 | *(sfVector3f **)&_swig_go_result = resultptr; 338 | } 339 | return _swig_go_result; 340 | } 341 | 342 | 343 | void _wrap_sfListener_setUpVector_audio_781f6cb27eac316e(sfVector3f *_swig_go_0) { 344 | sfVector3f arg1 ; 345 | sfVector3f *argp1 ; 346 | 347 | 348 | argp1 = (sfVector3f *)_swig_go_0; 349 | if (argp1 == NULL) { 350 | _swig_gopanic("Attempt to dereference null sfVector3f"); 351 | } 352 | arg1 = (sfVector3f)*argp1; 353 | 354 | 355 | sfListener_setUpVector(arg1); 356 | 357 | } 358 | 359 | 360 | sfVector3f *_wrap_sfListener_getUpVector_audio_781f6cb27eac316e() { 361 | sfVector3f result; 362 | sfVector3f *_swig_go_result; 363 | 364 | 365 | result = sfListener_getUpVector(); 366 | { 367 | sfVector3f * resultptr = (sfVector3f *)malloc(sizeof(sfVector3f)); 368 | memmove(resultptr, &result, sizeof(sfVector3f)); 369 | *(sfVector3f **)&_swig_go_result = resultptr; 370 | } 371 | return _swig_go_result; 372 | } 373 | 374 | 375 | void _wrap_sfTimeSpan_offset_set_audio_781f6cb27eac316e(sfTimeSpan *_swig_go_0, sfTime *_swig_go_1) { 376 | sfTimeSpan *arg1 = (sfTimeSpan *) 0 ; 377 | sfTime arg2 ; 378 | sfTime *argp2 ; 379 | 380 | arg1 = *(sfTimeSpan **)&_swig_go_0; 381 | 382 | argp2 = (sfTime *)_swig_go_1; 383 | if (argp2 == NULL) { 384 | _swig_gopanic("Attempt to dereference null sfTime"); 385 | } 386 | arg2 = (sfTime)*argp2; 387 | 388 | 389 | if (arg1) (arg1)->offset = arg2; 390 | 391 | } 392 | 393 | 394 | sfTime *_wrap_sfTimeSpan_offset_get_audio_781f6cb27eac316e(sfTimeSpan *_swig_go_0) { 395 | sfTimeSpan *arg1 = (sfTimeSpan *) 0 ; 396 | sfTime result; 397 | sfTime *_swig_go_result; 398 | 399 | arg1 = *(sfTimeSpan **)&_swig_go_0; 400 | 401 | result = ((arg1)->offset); 402 | { 403 | sfTime * resultptr = (sfTime *)malloc(sizeof(sfTime)); 404 | memmove(resultptr, &result, sizeof(sfTime)); 405 | *(sfTime **)&_swig_go_result = resultptr; 406 | } 407 | return _swig_go_result; 408 | } 409 | 410 | 411 | void _wrap_sfTimeSpan_length_set_audio_781f6cb27eac316e(sfTimeSpan *_swig_go_0, sfTime *_swig_go_1) { 412 | sfTimeSpan *arg1 = (sfTimeSpan *) 0 ; 413 | sfTime arg2 ; 414 | sfTime *argp2 ; 415 | 416 | arg1 = *(sfTimeSpan **)&_swig_go_0; 417 | 418 | argp2 = (sfTime *)_swig_go_1; 419 | if (argp2 == NULL) { 420 | _swig_gopanic("Attempt to dereference null sfTime"); 421 | } 422 | arg2 = (sfTime)*argp2; 423 | 424 | 425 | if (arg1) (arg1)->length = arg2; 426 | 427 | } 428 | 429 | 430 | sfTime *_wrap_sfTimeSpan_length_get_audio_781f6cb27eac316e(sfTimeSpan *_swig_go_0) { 431 | sfTimeSpan *arg1 = (sfTimeSpan *) 0 ; 432 | sfTime result; 433 | sfTime *_swig_go_result; 434 | 435 | arg1 = *(sfTimeSpan **)&_swig_go_0; 436 | 437 | result = ((arg1)->length); 438 | { 439 | sfTime * resultptr = (sfTime *)malloc(sizeof(sfTime)); 440 | memmove(resultptr, &result, sizeof(sfTime)); 441 | *(sfTime **)&_swig_go_result = resultptr; 442 | } 443 | return _swig_go_result; 444 | } 445 | 446 | 447 | sfTimeSpan *_wrap_new_sfTimeSpan_audio_781f6cb27eac316e() { 448 | sfTimeSpan *result = 0 ; 449 | sfTimeSpan *_swig_go_result; 450 | 451 | 452 | result = (sfTimeSpan *)calloc(1, sizeof(sfTimeSpan)); 453 | *(sfTimeSpan **)&_swig_go_result = (sfTimeSpan *)result; 454 | return _swig_go_result; 455 | } 456 | 457 | 458 | void _wrap_delete_sfTimeSpan_audio_781f6cb27eac316e(sfTimeSpan *_swig_go_0) { 459 | sfTimeSpan *arg1 = (sfTimeSpan *) 0 ; 460 | 461 | arg1 = *(sfTimeSpan **)&_swig_go_0; 462 | 463 | free((char *) arg1); 464 | 465 | } 466 | 467 | 468 | struct sfMusic *_wrap_sfMusic_createFromFile_audio_781f6cb27eac316e(_gostring_ _swig_go_0) { 469 | char *arg1 = (char *) 0 ; 470 | sfMusic *result = 0 ; 471 | struct sfMusic *_swig_go_result; 472 | 473 | 474 | arg1 = (char *)malloc(_swig_go_0.n + 1); 475 | memcpy(arg1, _swig_go_0.p, _swig_go_0.n); 476 | arg1[_swig_go_0.n] = '\0'; 477 | 478 | 479 | result = (sfMusic *)sfMusic_createFromFile((char const *)arg1); 480 | *(sfMusic **)&_swig_go_result = (sfMusic *)result; 481 | free(arg1); 482 | return _swig_go_result; 483 | } 484 | 485 | 486 | struct sfMusic *_wrap_sfMusic_createFromMemory_audio_781f6cb27eac316e(void *_swig_go_0, long long _swig_go_1) { 487 | void *arg1 = (void *) 0 ; 488 | size_t arg2 ; 489 | sfMusic *result = 0 ; 490 | struct sfMusic *_swig_go_result; 491 | 492 | arg1 = *(void **)&_swig_go_0; 493 | arg2 = (size_t)_swig_go_1; 494 | 495 | result = (sfMusic *)sfMusic_createFromMemory((void const *)arg1,arg2); 496 | *(sfMusic **)&_swig_go_result = (sfMusic *)result; 497 | return _swig_go_result; 498 | } 499 | 500 | 501 | struct sfMusic *_wrap_sfMusic_createFromStream_audio_781f6cb27eac316e(sfInputStream *_swig_go_0) { 502 | sfInputStream *arg1 = (sfInputStream *) 0 ; 503 | sfMusic *result = 0 ; 504 | struct sfMusic *_swig_go_result; 505 | 506 | arg1 = *(sfInputStream **)&_swig_go_0; 507 | 508 | result = (sfMusic *)sfMusic_createFromStream(arg1); 509 | *(sfMusic **)&_swig_go_result = (sfMusic *)result; 510 | return _swig_go_result; 511 | } 512 | 513 | 514 | void _wrap_sfMusic_destroy_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0) { 515 | sfMusic *arg1 = (sfMusic *) 0 ; 516 | 517 | arg1 = *(sfMusic **)&_swig_go_0; 518 | 519 | sfMusic_destroy(arg1); 520 | 521 | } 522 | 523 | 524 | void _wrap_sfMusic_setLoop_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0, intgo _swig_go_1) { 525 | sfMusic *arg1 = (sfMusic *) 0 ; 526 | sfBool arg2 ; 527 | 528 | arg1 = *(sfMusic **)&_swig_go_0; 529 | arg2 = (sfBool)_swig_go_1; 530 | 531 | sfMusic_setLoop(arg1,arg2); 532 | 533 | } 534 | 535 | 536 | intgo _wrap_sfMusic_getLoop_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0) { 537 | sfMusic *arg1 = (sfMusic *) 0 ; 538 | sfBool result; 539 | intgo _swig_go_result; 540 | 541 | arg1 = *(sfMusic **)&_swig_go_0; 542 | 543 | result = (sfBool)sfMusic_getLoop((struct sfMusic const *)arg1); 544 | _swig_go_result = result; 545 | return _swig_go_result; 546 | } 547 | 548 | 549 | sfTime *_wrap_sfMusic_getDuration_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0) { 550 | sfMusic *arg1 = (sfMusic *) 0 ; 551 | sfTime result; 552 | sfTime *_swig_go_result; 553 | 554 | arg1 = *(sfMusic **)&_swig_go_0; 555 | 556 | result = sfMusic_getDuration((struct sfMusic const *)arg1); 557 | { 558 | sfTime * resultptr = (sfTime *)malloc(sizeof(sfTime)); 559 | memmove(resultptr, &result, sizeof(sfTime)); 560 | *(sfTime **)&_swig_go_result = resultptr; 561 | } 562 | return _swig_go_result; 563 | } 564 | 565 | 566 | sfTimeSpan *_wrap_sfMusic_getLoopPoints_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0) { 567 | sfMusic *arg1 = (sfMusic *) 0 ; 568 | sfTimeSpan result; 569 | sfTimeSpan *_swig_go_result; 570 | 571 | arg1 = *(sfMusic **)&_swig_go_0; 572 | 573 | result = sfMusic_getLoopPoints((struct sfMusic const *)arg1); 574 | { 575 | sfTimeSpan * resultptr = (sfTimeSpan *)malloc(sizeof(sfTimeSpan)); 576 | memmove(resultptr, &result, sizeof(sfTimeSpan)); 577 | *(sfTimeSpan **)&_swig_go_result = resultptr; 578 | } 579 | return _swig_go_result; 580 | } 581 | 582 | 583 | void _wrap_sfMusic_setLoopPoints_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0, sfTimeSpan *_swig_go_1) { 584 | sfMusic *arg1 = (sfMusic *) 0 ; 585 | sfTimeSpan arg2 ; 586 | sfTimeSpan *argp2 ; 587 | 588 | arg1 = *(sfMusic **)&_swig_go_0; 589 | 590 | argp2 = (sfTimeSpan *)_swig_go_1; 591 | if (argp2 == NULL) { 592 | _swig_gopanic("Attempt to dereference null sfTimeSpan"); 593 | } 594 | arg2 = (sfTimeSpan)*argp2; 595 | 596 | 597 | sfMusic_setLoopPoints(arg1,arg2); 598 | 599 | } 600 | 601 | 602 | void _wrap_sfMusic_play_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0) { 603 | sfMusic *arg1 = (sfMusic *) 0 ; 604 | 605 | arg1 = *(sfMusic **)&_swig_go_0; 606 | 607 | sfMusic_play(arg1); 608 | 609 | } 610 | 611 | 612 | void _wrap_sfMusic_pause_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0) { 613 | sfMusic *arg1 = (sfMusic *) 0 ; 614 | 615 | arg1 = *(sfMusic **)&_swig_go_0; 616 | 617 | sfMusic_pause(arg1); 618 | 619 | } 620 | 621 | 622 | void _wrap_sfMusic_stop_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0) { 623 | sfMusic *arg1 = (sfMusic *) 0 ; 624 | 625 | arg1 = *(sfMusic **)&_swig_go_0; 626 | 627 | sfMusic_stop(arg1); 628 | 629 | } 630 | 631 | 632 | intgo _wrap_sfMusic_getChannelCount_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0) { 633 | sfMusic *arg1 = (sfMusic *) 0 ; 634 | unsigned int result; 635 | intgo _swig_go_result; 636 | 637 | arg1 = *(sfMusic **)&_swig_go_0; 638 | 639 | result = (unsigned int)sfMusic_getChannelCount((struct sfMusic const *)arg1); 640 | _swig_go_result = result; 641 | return _swig_go_result; 642 | } 643 | 644 | 645 | intgo _wrap_sfMusic_getSampleRate_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0) { 646 | sfMusic *arg1 = (sfMusic *) 0 ; 647 | unsigned int result; 648 | intgo _swig_go_result; 649 | 650 | arg1 = *(sfMusic **)&_swig_go_0; 651 | 652 | result = (unsigned int)sfMusic_getSampleRate((struct sfMusic const *)arg1); 653 | _swig_go_result = result; 654 | return _swig_go_result; 655 | } 656 | 657 | 658 | intgo _wrap_sfMusic_getStatus_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0) { 659 | sfMusic *arg1 = (sfMusic *) 0 ; 660 | sfSoundStatus result; 661 | intgo _swig_go_result; 662 | 663 | arg1 = *(sfMusic **)&_swig_go_0; 664 | 665 | result = (sfSoundStatus)sfMusic_getStatus((struct sfMusic const *)arg1); 666 | _swig_go_result = (intgo)result; 667 | return _swig_go_result; 668 | } 669 | 670 | 671 | sfTime *_wrap_sfMusic_getPlayingOffset_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0) { 672 | sfMusic *arg1 = (sfMusic *) 0 ; 673 | sfTime result; 674 | sfTime *_swig_go_result; 675 | 676 | arg1 = *(sfMusic **)&_swig_go_0; 677 | 678 | result = sfMusic_getPlayingOffset((struct sfMusic const *)arg1); 679 | { 680 | sfTime * resultptr = (sfTime *)malloc(sizeof(sfTime)); 681 | memmove(resultptr, &result, sizeof(sfTime)); 682 | *(sfTime **)&_swig_go_result = resultptr; 683 | } 684 | return _swig_go_result; 685 | } 686 | 687 | 688 | void _wrap_sfMusic_setPitch_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0, float _swig_go_1) { 689 | sfMusic *arg1 = (sfMusic *) 0 ; 690 | float arg2 ; 691 | 692 | arg1 = *(sfMusic **)&_swig_go_0; 693 | arg2 = (float)_swig_go_1; 694 | 695 | sfMusic_setPitch(arg1,arg2); 696 | 697 | } 698 | 699 | 700 | void _wrap_sfMusic_setVolume_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0, float _swig_go_1) { 701 | sfMusic *arg1 = (sfMusic *) 0 ; 702 | float arg2 ; 703 | 704 | arg1 = *(sfMusic **)&_swig_go_0; 705 | arg2 = (float)_swig_go_1; 706 | 707 | sfMusic_setVolume(arg1,arg2); 708 | 709 | } 710 | 711 | 712 | void _wrap_sfMusic_setPosition_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0, sfVector3f *_swig_go_1) { 713 | sfMusic *arg1 = (sfMusic *) 0 ; 714 | sfVector3f arg2 ; 715 | sfVector3f *argp2 ; 716 | 717 | arg1 = *(sfMusic **)&_swig_go_0; 718 | 719 | argp2 = (sfVector3f *)_swig_go_1; 720 | if (argp2 == NULL) { 721 | _swig_gopanic("Attempt to dereference null sfVector3f"); 722 | } 723 | arg2 = (sfVector3f)*argp2; 724 | 725 | 726 | sfMusic_setPosition(arg1,arg2); 727 | 728 | } 729 | 730 | 731 | void _wrap_sfMusic_setRelativeToListener_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0, intgo _swig_go_1) { 732 | sfMusic *arg1 = (sfMusic *) 0 ; 733 | sfBool arg2 ; 734 | 735 | arg1 = *(sfMusic **)&_swig_go_0; 736 | arg2 = (sfBool)_swig_go_1; 737 | 738 | sfMusic_setRelativeToListener(arg1,arg2); 739 | 740 | } 741 | 742 | 743 | void _wrap_sfMusic_setMinDistance_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0, float _swig_go_1) { 744 | sfMusic *arg1 = (sfMusic *) 0 ; 745 | float arg2 ; 746 | 747 | arg1 = *(sfMusic **)&_swig_go_0; 748 | arg2 = (float)_swig_go_1; 749 | 750 | sfMusic_setMinDistance(arg1,arg2); 751 | 752 | } 753 | 754 | 755 | void _wrap_sfMusic_setAttenuation_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0, float _swig_go_1) { 756 | sfMusic *arg1 = (sfMusic *) 0 ; 757 | float arg2 ; 758 | 759 | arg1 = *(sfMusic **)&_swig_go_0; 760 | arg2 = (float)_swig_go_1; 761 | 762 | sfMusic_setAttenuation(arg1,arg2); 763 | 764 | } 765 | 766 | 767 | void _wrap_sfMusic_setPlayingOffset_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0, sfTime *_swig_go_1) { 768 | sfMusic *arg1 = (sfMusic *) 0 ; 769 | sfTime arg2 ; 770 | sfTime *argp2 ; 771 | 772 | arg1 = *(sfMusic **)&_swig_go_0; 773 | 774 | argp2 = (sfTime *)_swig_go_1; 775 | if (argp2 == NULL) { 776 | _swig_gopanic("Attempt to dereference null sfTime"); 777 | } 778 | arg2 = (sfTime)*argp2; 779 | 780 | 781 | sfMusic_setPlayingOffset(arg1,arg2); 782 | 783 | } 784 | 785 | 786 | float _wrap_sfMusic_getPitch_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0) { 787 | sfMusic *arg1 = (sfMusic *) 0 ; 788 | float result; 789 | float _swig_go_result; 790 | 791 | arg1 = *(sfMusic **)&_swig_go_0; 792 | 793 | result = (float)sfMusic_getPitch((struct sfMusic const *)arg1); 794 | _swig_go_result = result; 795 | return _swig_go_result; 796 | } 797 | 798 | 799 | float _wrap_sfMusic_getVolume_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0) { 800 | sfMusic *arg1 = (sfMusic *) 0 ; 801 | float result; 802 | float _swig_go_result; 803 | 804 | arg1 = *(sfMusic **)&_swig_go_0; 805 | 806 | result = (float)sfMusic_getVolume((struct sfMusic const *)arg1); 807 | _swig_go_result = result; 808 | return _swig_go_result; 809 | } 810 | 811 | 812 | sfVector3f *_wrap_sfMusic_getPosition_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0) { 813 | sfMusic *arg1 = (sfMusic *) 0 ; 814 | sfVector3f result; 815 | sfVector3f *_swig_go_result; 816 | 817 | arg1 = *(sfMusic **)&_swig_go_0; 818 | 819 | result = sfMusic_getPosition((struct sfMusic const *)arg1); 820 | { 821 | sfVector3f * resultptr = (sfVector3f *)malloc(sizeof(sfVector3f)); 822 | memmove(resultptr, &result, sizeof(sfVector3f)); 823 | *(sfVector3f **)&_swig_go_result = resultptr; 824 | } 825 | return _swig_go_result; 826 | } 827 | 828 | 829 | intgo _wrap_sfMusic_isRelativeToListener_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0) { 830 | sfMusic *arg1 = (sfMusic *) 0 ; 831 | sfBool result; 832 | intgo _swig_go_result; 833 | 834 | arg1 = *(sfMusic **)&_swig_go_0; 835 | 836 | result = (sfBool)sfMusic_isRelativeToListener((struct sfMusic const *)arg1); 837 | _swig_go_result = result; 838 | return _swig_go_result; 839 | } 840 | 841 | 842 | float _wrap_sfMusic_getMinDistance_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0) { 843 | sfMusic *arg1 = (sfMusic *) 0 ; 844 | float result; 845 | float _swig_go_result; 846 | 847 | arg1 = *(sfMusic **)&_swig_go_0; 848 | 849 | result = (float)sfMusic_getMinDistance((struct sfMusic const *)arg1); 850 | _swig_go_result = result; 851 | return _swig_go_result; 852 | } 853 | 854 | 855 | float _wrap_sfMusic_getAttenuation_audio_781f6cb27eac316e(struct sfMusic *_swig_go_0) { 856 | sfMusic *arg1 = (sfMusic *) 0 ; 857 | float result; 858 | float _swig_go_result; 859 | 860 | arg1 = *(sfMusic **)&_swig_go_0; 861 | 862 | result = (float)sfMusic_getAttenuation((struct sfMusic const *)arg1); 863 | _swig_go_result = result; 864 | return _swig_go_result; 865 | } 866 | 867 | 868 | struct sfSound *_wrap_sfSound_create_audio_781f6cb27eac316e() { 869 | sfSound *result = 0 ; 870 | struct sfSound *_swig_go_result; 871 | 872 | 873 | result = (sfSound *)sfSound_create(); 874 | *(sfSound **)&_swig_go_result = (sfSound *)result; 875 | return _swig_go_result; 876 | } 877 | 878 | 879 | struct sfSound *_wrap_sfSound_copy_audio_781f6cb27eac316e(struct sfSound *_swig_go_0) { 880 | sfSound *arg1 = (sfSound *) 0 ; 881 | sfSound *result = 0 ; 882 | struct sfSound *_swig_go_result; 883 | 884 | arg1 = *(sfSound **)&_swig_go_0; 885 | 886 | result = (sfSound *)sfSound_copy((struct sfSound const *)arg1); 887 | *(sfSound **)&_swig_go_result = (sfSound *)result; 888 | return _swig_go_result; 889 | } 890 | 891 | 892 | void _wrap_sfSound_destroy_audio_781f6cb27eac316e(struct sfSound *_swig_go_0) { 893 | sfSound *arg1 = (sfSound *) 0 ; 894 | 895 | arg1 = *(sfSound **)&_swig_go_0; 896 | 897 | sfSound_destroy(arg1); 898 | 899 | } 900 | 901 | 902 | void _wrap_sfSound_play_audio_781f6cb27eac316e(struct sfSound *_swig_go_0) { 903 | sfSound *arg1 = (sfSound *) 0 ; 904 | 905 | arg1 = *(sfSound **)&_swig_go_0; 906 | 907 | sfSound_play(arg1); 908 | 909 | } 910 | 911 | 912 | void _wrap_sfSound_pause_audio_781f6cb27eac316e(struct sfSound *_swig_go_0) { 913 | sfSound *arg1 = (sfSound *) 0 ; 914 | 915 | arg1 = *(sfSound **)&_swig_go_0; 916 | 917 | sfSound_pause(arg1); 918 | 919 | } 920 | 921 | 922 | void _wrap_sfSound_stop_audio_781f6cb27eac316e(struct sfSound *_swig_go_0) { 923 | sfSound *arg1 = (sfSound *) 0 ; 924 | 925 | arg1 = *(sfSound **)&_swig_go_0; 926 | 927 | sfSound_stop(arg1); 928 | 929 | } 930 | 931 | 932 | void _wrap_sfSound_setBuffer_audio_781f6cb27eac316e(struct sfSound *_swig_go_0, struct sfSoundBuffer *_swig_go_1) { 933 | sfSound *arg1 = (sfSound *) 0 ; 934 | sfSoundBuffer *arg2 = (sfSoundBuffer *) 0 ; 935 | 936 | arg1 = *(sfSound **)&_swig_go_0; 937 | arg2 = *(sfSoundBuffer **)&_swig_go_1; 938 | 939 | sfSound_setBuffer(arg1,(struct sfSoundBuffer const *)arg2); 940 | 941 | } 942 | 943 | 944 | struct sfSoundBuffer *_wrap_sfSound_getBuffer_audio_781f6cb27eac316e(struct sfSound *_swig_go_0) { 945 | sfSound *arg1 = (sfSound *) 0 ; 946 | sfSoundBuffer *result = 0 ; 947 | struct sfSoundBuffer *_swig_go_result; 948 | 949 | arg1 = *(sfSound **)&_swig_go_0; 950 | 951 | result = (sfSoundBuffer *)sfSound_getBuffer((struct sfSound const *)arg1); 952 | *(sfSoundBuffer **)&_swig_go_result = (sfSoundBuffer *)result; 953 | return _swig_go_result; 954 | } 955 | 956 | 957 | void _wrap_sfSound_setLoop_audio_781f6cb27eac316e(struct sfSound *_swig_go_0, intgo _swig_go_1) { 958 | sfSound *arg1 = (sfSound *) 0 ; 959 | sfBool arg2 ; 960 | 961 | arg1 = *(sfSound **)&_swig_go_0; 962 | arg2 = (sfBool)_swig_go_1; 963 | 964 | sfSound_setLoop(arg1,arg2); 965 | 966 | } 967 | 968 | 969 | intgo _wrap_sfSound_getLoop_audio_781f6cb27eac316e(struct sfSound *_swig_go_0) { 970 | sfSound *arg1 = (sfSound *) 0 ; 971 | sfBool result; 972 | intgo _swig_go_result; 973 | 974 | arg1 = *(sfSound **)&_swig_go_0; 975 | 976 | result = (sfBool)sfSound_getLoop((struct sfSound const *)arg1); 977 | _swig_go_result = result; 978 | return _swig_go_result; 979 | } 980 | 981 | 982 | intgo _wrap_sfSound_getStatus_audio_781f6cb27eac316e(struct sfSound *_swig_go_0) { 983 | sfSound *arg1 = (sfSound *) 0 ; 984 | sfSoundStatus result; 985 | intgo _swig_go_result; 986 | 987 | arg1 = *(sfSound **)&_swig_go_0; 988 | 989 | result = (sfSoundStatus)sfSound_getStatus((struct sfSound const *)arg1); 990 | _swig_go_result = (intgo)result; 991 | return _swig_go_result; 992 | } 993 | 994 | 995 | void _wrap_sfSound_setPitch_audio_781f6cb27eac316e(struct sfSound *_swig_go_0, float _swig_go_1) { 996 | sfSound *arg1 = (sfSound *) 0 ; 997 | float arg2 ; 998 | 999 | arg1 = *(sfSound **)&_swig_go_0; 1000 | arg2 = (float)_swig_go_1; 1001 | 1002 | sfSound_setPitch(arg1,arg2); 1003 | 1004 | } 1005 | 1006 | 1007 | void _wrap_sfSound_setVolume_audio_781f6cb27eac316e(struct sfSound *_swig_go_0, float _swig_go_1) { 1008 | sfSound *arg1 = (sfSound *) 0 ; 1009 | float arg2 ; 1010 | 1011 | arg1 = *(sfSound **)&_swig_go_0; 1012 | arg2 = (float)_swig_go_1; 1013 | 1014 | sfSound_setVolume(arg1,arg2); 1015 | 1016 | } 1017 | 1018 | 1019 | void _wrap_sfSound_setPosition_audio_781f6cb27eac316e(struct sfSound *_swig_go_0, sfVector3f *_swig_go_1) { 1020 | sfSound *arg1 = (sfSound *) 0 ; 1021 | sfVector3f arg2 ; 1022 | sfVector3f *argp2 ; 1023 | 1024 | arg1 = *(sfSound **)&_swig_go_0; 1025 | 1026 | argp2 = (sfVector3f *)_swig_go_1; 1027 | if (argp2 == NULL) { 1028 | _swig_gopanic("Attempt to dereference null sfVector3f"); 1029 | } 1030 | arg2 = (sfVector3f)*argp2; 1031 | 1032 | 1033 | sfSound_setPosition(arg1,arg2); 1034 | 1035 | } 1036 | 1037 | 1038 | void _wrap_sfSound_setRelativeToListener_audio_781f6cb27eac316e(struct sfSound *_swig_go_0, intgo _swig_go_1) { 1039 | sfSound *arg1 = (sfSound *) 0 ; 1040 | sfBool arg2 ; 1041 | 1042 | arg1 = *(sfSound **)&_swig_go_0; 1043 | arg2 = (sfBool)_swig_go_1; 1044 | 1045 | sfSound_setRelativeToListener(arg1,arg2); 1046 | 1047 | } 1048 | 1049 | 1050 | void _wrap_sfSound_setMinDistance_audio_781f6cb27eac316e(struct sfSound *_swig_go_0, float _swig_go_1) { 1051 | sfSound *arg1 = (sfSound *) 0 ; 1052 | float arg2 ; 1053 | 1054 | arg1 = *(sfSound **)&_swig_go_0; 1055 | arg2 = (float)_swig_go_1; 1056 | 1057 | sfSound_setMinDistance(arg1,arg2); 1058 | 1059 | } 1060 | 1061 | 1062 | void _wrap_sfSound_setAttenuation_audio_781f6cb27eac316e(struct sfSound *_swig_go_0, float _swig_go_1) { 1063 | sfSound *arg1 = (sfSound *) 0 ; 1064 | float arg2 ; 1065 | 1066 | arg1 = *(sfSound **)&_swig_go_0; 1067 | arg2 = (float)_swig_go_1; 1068 | 1069 | sfSound_setAttenuation(arg1,arg2); 1070 | 1071 | } 1072 | 1073 | 1074 | void _wrap_sfSound_setPlayingOffset_audio_781f6cb27eac316e(struct sfSound *_swig_go_0, sfTime *_swig_go_1) { 1075 | sfSound *arg1 = (sfSound *) 0 ; 1076 | sfTime arg2 ; 1077 | sfTime *argp2 ; 1078 | 1079 | arg1 = *(sfSound **)&_swig_go_0; 1080 | 1081 | argp2 = (sfTime *)_swig_go_1; 1082 | if (argp2 == NULL) { 1083 | _swig_gopanic("Attempt to dereference null sfTime"); 1084 | } 1085 | arg2 = (sfTime)*argp2; 1086 | 1087 | 1088 | sfSound_setPlayingOffset(arg1,arg2); 1089 | 1090 | } 1091 | 1092 | 1093 | float _wrap_sfSound_getPitch_audio_781f6cb27eac316e(struct sfSound *_swig_go_0) { 1094 | sfSound *arg1 = (sfSound *) 0 ; 1095 | float result; 1096 | float _swig_go_result; 1097 | 1098 | arg1 = *(sfSound **)&_swig_go_0; 1099 | 1100 | result = (float)sfSound_getPitch((struct sfSound const *)arg1); 1101 | _swig_go_result = result; 1102 | return _swig_go_result; 1103 | } 1104 | 1105 | 1106 | float _wrap_sfSound_getVolume_audio_781f6cb27eac316e(struct sfSound *_swig_go_0) { 1107 | sfSound *arg1 = (sfSound *) 0 ; 1108 | float result; 1109 | float _swig_go_result; 1110 | 1111 | arg1 = *(sfSound **)&_swig_go_0; 1112 | 1113 | result = (float)sfSound_getVolume((struct sfSound const *)arg1); 1114 | _swig_go_result = result; 1115 | return _swig_go_result; 1116 | } 1117 | 1118 | 1119 | sfVector3f *_wrap_sfSound_getPosition_audio_781f6cb27eac316e(struct sfSound *_swig_go_0) { 1120 | sfSound *arg1 = (sfSound *) 0 ; 1121 | sfVector3f result; 1122 | sfVector3f *_swig_go_result; 1123 | 1124 | arg1 = *(sfSound **)&_swig_go_0; 1125 | 1126 | result = sfSound_getPosition((struct sfSound const *)arg1); 1127 | { 1128 | sfVector3f * resultptr = (sfVector3f *)malloc(sizeof(sfVector3f)); 1129 | memmove(resultptr, &result, sizeof(sfVector3f)); 1130 | *(sfVector3f **)&_swig_go_result = resultptr; 1131 | } 1132 | return _swig_go_result; 1133 | } 1134 | 1135 | 1136 | intgo _wrap_sfSound_isRelativeToListener_audio_781f6cb27eac316e(struct sfSound *_swig_go_0) { 1137 | sfSound *arg1 = (sfSound *) 0 ; 1138 | sfBool result; 1139 | intgo _swig_go_result; 1140 | 1141 | arg1 = *(sfSound **)&_swig_go_0; 1142 | 1143 | result = (sfBool)sfSound_isRelativeToListener((struct sfSound const *)arg1); 1144 | _swig_go_result = result; 1145 | return _swig_go_result; 1146 | } 1147 | 1148 | 1149 | float _wrap_sfSound_getMinDistance_audio_781f6cb27eac316e(struct sfSound *_swig_go_0) { 1150 | sfSound *arg1 = (sfSound *) 0 ; 1151 | float result; 1152 | float _swig_go_result; 1153 | 1154 | arg1 = *(sfSound **)&_swig_go_0; 1155 | 1156 | result = (float)sfSound_getMinDistance((struct sfSound const *)arg1); 1157 | _swig_go_result = result; 1158 | return _swig_go_result; 1159 | } 1160 | 1161 | 1162 | float _wrap_sfSound_getAttenuation_audio_781f6cb27eac316e(struct sfSound *_swig_go_0) { 1163 | sfSound *arg1 = (sfSound *) 0 ; 1164 | float result; 1165 | float _swig_go_result; 1166 | 1167 | arg1 = *(sfSound **)&_swig_go_0; 1168 | 1169 | result = (float)sfSound_getAttenuation((struct sfSound const *)arg1); 1170 | _swig_go_result = result; 1171 | return _swig_go_result; 1172 | } 1173 | 1174 | 1175 | sfTime *_wrap_sfSound_getPlayingOffset_audio_781f6cb27eac316e(struct sfSound *_swig_go_0) { 1176 | sfSound *arg1 = (sfSound *) 0 ; 1177 | sfTime result; 1178 | sfTime *_swig_go_result; 1179 | 1180 | arg1 = *(sfSound **)&_swig_go_0; 1181 | 1182 | result = sfSound_getPlayingOffset((struct sfSound const *)arg1); 1183 | { 1184 | sfTime * resultptr = (sfTime *)malloc(sizeof(sfTime)); 1185 | memmove(resultptr, &result, sizeof(sfTime)); 1186 | *(sfTime **)&_swig_go_result = resultptr; 1187 | } 1188 | return _swig_go_result; 1189 | } 1190 | 1191 | 1192 | struct sfSoundBuffer *_wrap_sfSoundBuffer_createFromFile_audio_781f6cb27eac316e(_gostring_ _swig_go_0) { 1193 | char *arg1 = (char *) 0 ; 1194 | sfSoundBuffer *result = 0 ; 1195 | struct sfSoundBuffer *_swig_go_result; 1196 | 1197 | 1198 | arg1 = (char *)malloc(_swig_go_0.n + 1); 1199 | memcpy(arg1, _swig_go_0.p, _swig_go_0.n); 1200 | arg1[_swig_go_0.n] = '\0'; 1201 | 1202 | 1203 | result = (sfSoundBuffer *)sfSoundBuffer_createFromFile((char const *)arg1); 1204 | *(sfSoundBuffer **)&_swig_go_result = (sfSoundBuffer *)result; 1205 | free(arg1); 1206 | return _swig_go_result; 1207 | } 1208 | 1209 | 1210 | struct sfSoundBuffer *_wrap_sfSoundBuffer_createFromMemory_audio_781f6cb27eac316e(void *_swig_go_0, long long _swig_go_1) { 1211 | void *arg1 = (void *) 0 ; 1212 | size_t arg2 ; 1213 | sfSoundBuffer *result = 0 ; 1214 | struct sfSoundBuffer *_swig_go_result; 1215 | 1216 | arg1 = *(void **)&_swig_go_0; 1217 | arg2 = (size_t)_swig_go_1; 1218 | 1219 | result = (sfSoundBuffer *)sfSoundBuffer_createFromMemory((void const *)arg1,arg2); 1220 | *(sfSoundBuffer **)&_swig_go_result = (sfSoundBuffer *)result; 1221 | return _swig_go_result; 1222 | } 1223 | 1224 | 1225 | struct sfSoundBuffer *_wrap_sfSoundBuffer_createFromStream_audio_781f6cb27eac316e(sfInputStream *_swig_go_0) { 1226 | sfInputStream *arg1 = (sfInputStream *) 0 ; 1227 | sfSoundBuffer *result = 0 ; 1228 | struct sfSoundBuffer *_swig_go_result; 1229 | 1230 | arg1 = *(sfInputStream **)&_swig_go_0; 1231 | 1232 | result = (sfSoundBuffer *)sfSoundBuffer_createFromStream(arg1); 1233 | *(sfSoundBuffer **)&_swig_go_result = (sfSoundBuffer *)result; 1234 | return _swig_go_result; 1235 | } 1236 | 1237 | 1238 | struct sfSoundBuffer *_wrap_sfSoundBuffer_createFromSamples_audio_781f6cb27eac316e(short *_swig_go_0, long long _swig_go_1, intgo _swig_go_2, intgo _swig_go_3) { 1239 | sfInt16 *arg1 = (sfInt16 *) 0 ; 1240 | sfUint64 arg2 ; 1241 | unsigned int arg3 ; 1242 | unsigned int arg4 ; 1243 | sfSoundBuffer *result = 0 ; 1244 | struct sfSoundBuffer *_swig_go_result; 1245 | 1246 | arg1 = *(sfInt16 **)&_swig_go_0; 1247 | arg2 = (sfUint64)_swig_go_1; 1248 | arg3 = (unsigned int)_swig_go_2; 1249 | arg4 = (unsigned int)_swig_go_3; 1250 | 1251 | result = (sfSoundBuffer *)sfSoundBuffer_createFromSamples((short const *)arg1,arg2,arg3,arg4); 1252 | *(sfSoundBuffer **)&_swig_go_result = (sfSoundBuffer *)result; 1253 | return _swig_go_result; 1254 | } 1255 | 1256 | 1257 | struct sfSoundBuffer *_wrap_sfSoundBuffer_copy_audio_781f6cb27eac316e(struct sfSoundBuffer *_swig_go_0) { 1258 | sfSoundBuffer *arg1 = (sfSoundBuffer *) 0 ; 1259 | sfSoundBuffer *result = 0 ; 1260 | struct sfSoundBuffer *_swig_go_result; 1261 | 1262 | arg1 = *(sfSoundBuffer **)&_swig_go_0; 1263 | 1264 | result = (sfSoundBuffer *)sfSoundBuffer_copy((struct sfSoundBuffer const *)arg1); 1265 | *(sfSoundBuffer **)&_swig_go_result = (sfSoundBuffer *)result; 1266 | return _swig_go_result; 1267 | } 1268 | 1269 | 1270 | void _wrap_sfSoundBuffer_destroy_audio_781f6cb27eac316e(struct sfSoundBuffer *_swig_go_0) { 1271 | sfSoundBuffer *arg1 = (sfSoundBuffer *) 0 ; 1272 | 1273 | arg1 = *(sfSoundBuffer **)&_swig_go_0; 1274 | 1275 | sfSoundBuffer_destroy(arg1); 1276 | 1277 | } 1278 | 1279 | 1280 | intgo _wrap_sfSoundBuffer_saveToFile_audio_781f6cb27eac316e(struct sfSoundBuffer *_swig_go_0, _gostring_ _swig_go_1) { 1281 | sfSoundBuffer *arg1 = (sfSoundBuffer *) 0 ; 1282 | char *arg2 = (char *) 0 ; 1283 | sfBool result; 1284 | intgo _swig_go_result; 1285 | 1286 | arg1 = *(sfSoundBuffer **)&_swig_go_0; 1287 | 1288 | arg2 = (char *)malloc(_swig_go_1.n + 1); 1289 | memcpy(arg2, _swig_go_1.p, _swig_go_1.n); 1290 | arg2[_swig_go_1.n] = '\0'; 1291 | 1292 | 1293 | result = (sfBool)sfSoundBuffer_saveToFile((struct sfSoundBuffer const *)arg1,(char const *)arg2); 1294 | _swig_go_result = result; 1295 | free(arg2); 1296 | return _swig_go_result; 1297 | } 1298 | 1299 | 1300 | short *_wrap_sfSoundBuffer_getSamples_audio_781f6cb27eac316e(struct sfSoundBuffer *_swig_go_0) { 1301 | sfSoundBuffer *arg1 = (sfSoundBuffer *) 0 ; 1302 | sfInt16 *result = 0 ; 1303 | short *_swig_go_result; 1304 | 1305 | arg1 = *(sfSoundBuffer **)&_swig_go_0; 1306 | 1307 | result = (sfInt16 *)sfSoundBuffer_getSamples((struct sfSoundBuffer const *)arg1); 1308 | *(sfInt16 **)&_swig_go_result = (sfInt16 *)result; 1309 | return _swig_go_result; 1310 | } 1311 | 1312 | 1313 | long long _wrap_sfSoundBuffer_getSampleCount_audio_781f6cb27eac316e(struct sfSoundBuffer *_swig_go_0) { 1314 | sfSoundBuffer *arg1 = (sfSoundBuffer *) 0 ; 1315 | sfUint64 result; 1316 | long long _swig_go_result; 1317 | 1318 | arg1 = *(sfSoundBuffer **)&_swig_go_0; 1319 | 1320 | result = (sfUint64)sfSoundBuffer_getSampleCount((struct sfSoundBuffer const *)arg1); 1321 | _swig_go_result = result; 1322 | return _swig_go_result; 1323 | } 1324 | 1325 | 1326 | intgo _wrap_sfSoundBuffer_getSampleRate_audio_781f6cb27eac316e(struct sfSoundBuffer *_swig_go_0) { 1327 | sfSoundBuffer *arg1 = (sfSoundBuffer *) 0 ; 1328 | unsigned int result; 1329 | intgo _swig_go_result; 1330 | 1331 | arg1 = *(sfSoundBuffer **)&_swig_go_0; 1332 | 1333 | result = (unsigned int)sfSoundBuffer_getSampleRate((struct sfSoundBuffer const *)arg1); 1334 | _swig_go_result = result; 1335 | return _swig_go_result; 1336 | } 1337 | 1338 | 1339 | intgo _wrap_sfSoundBuffer_getChannelCount_audio_781f6cb27eac316e(struct sfSoundBuffer *_swig_go_0) { 1340 | sfSoundBuffer *arg1 = (sfSoundBuffer *) 0 ; 1341 | unsigned int result; 1342 | intgo _swig_go_result; 1343 | 1344 | arg1 = *(sfSoundBuffer **)&_swig_go_0; 1345 | 1346 | result = (unsigned int)sfSoundBuffer_getChannelCount((struct sfSoundBuffer const *)arg1); 1347 | _swig_go_result = result; 1348 | return _swig_go_result; 1349 | } 1350 | 1351 | 1352 | sfTime *_wrap_sfSoundBuffer_getDuration_audio_781f6cb27eac316e(struct sfSoundBuffer *_swig_go_0) { 1353 | sfSoundBuffer *arg1 = (sfSoundBuffer *) 0 ; 1354 | sfTime result; 1355 | sfTime *_swig_go_result; 1356 | 1357 | arg1 = *(sfSoundBuffer **)&_swig_go_0; 1358 | 1359 | result = sfSoundBuffer_getDuration((struct sfSoundBuffer const *)arg1); 1360 | { 1361 | sfTime * resultptr = (sfTime *)malloc(sizeof(sfTime)); 1362 | memmove(resultptr, &result, sizeof(sfTime)); 1363 | *(sfTime **)&_swig_go_result = resultptr; 1364 | } 1365 | return _swig_go_result; 1366 | } 1367 | 1368 | 1369 | struct sfSoundBufferRecorder *_wrap_sfSoundBufferRecorder_create_audio_781f6cb27eac316e() { 1370 | sfSoundBufferRecorder *result = 0 ; 1371 | struct sfSoundBufferRecorder *_swig_go_result; 1372 | 1373 | 1374 | result = (sfSoundBufferRecorder *)sfSoundBufferRecorder_create(); 1375 | *(sfSoundBufferRecorder **)&_swig_go_result = (sfSoundBufferRecorder *)result; 1376 | return _swig_go_result; 1377 | } 1378 | 1379 | 1380 | void _wrap_sfSoundBufferRecorder_destroy_audio_781f6cb27eac316e(struct sfSoundBufferRecorder *_swig_go_0) { 1381 | sfSoundBufferRecorder *arg1 = (sfSoundBufferRecorder *) 0 ; 1382 | 1383 | arg1 = *(sfSoundBufferRecorder **)&_swig_go_0; 1384 | 1385 | sfSoundBufferRecorder_destroy(arg1); 1386 | 1387 | } 1388 | 1389 | 1390 | intgo _wrap_sfSoundBufferRecorder_start_audio_781f6cb27eac316e(struct sfSoundBufferRecorder *_swig_go_0, intgo _swig_go_1) { 1391 | sfSoundBufferRecorder *arg1 = (sfSoundBufferRecorder *) 0 ; 1392 | unsigned int arg2 ; 1393 | sfBool result; 1394 | intgo _swig_go_result; 1395 | 1396 | arg1 = *(sfSoundBufferRecorder **)&_swig_go_0; 1397 | arg2 = (unsigned int)_swig_go_1; 1398 | 1399 | result = (sfBool)sfSoundBufferRecorder_start(arg1,arg2); 1400 | _swig_go_result = result; 1401 | return _swig_go_result; 1402 | } 1403 | 1404 | 1405 | void _wrap_sfSoundBufferRecorder_stop_audio_781f6cb27eac316e(struct sfSoundBufferRecorder *_swig_go_0) { 1406 | sfSoundBufferRecorder *arg1 = (sfSoundBufferRecorder *) 0 ; 1407 | 1408 | arg1 = *(sfSoundBufferRecorder **)&_swig_go_0; 1409 | 1410 | sfSoundBufferRecorder_stop(arg1); 1411 | 1412 | } 1413 | 1414 | 1415 | intgo _wrap_sfSoundBufferRecorder_getSampleRate_audio_781f6cb27eac316e(struct sfSoundBufferRecorder *_swig_go_0) { 1416 | sfSoundBufferRecorder *arg1 = (sfSoundBufferRecorder *) 0 ; 1417 | unsigned int result; 1418 | intgo _swig_go_result; 1419 | 1420 | arg1 = *(sfSoundBufferRecorder **)&_swig_go_0; 1421 | 1422 | result = (unsigned int)sfSoundBufferRecorder_getSampleRate((struct sfSoundBufferRecorder const *)arg1); 1423 | _swig_go_result = result; 1424 | return _swig_go_result; 1425 | } 1426 | 1427 | 1428 | struct sfSoundBuffer *_wrap_sfSoundBufferRecorder_getBuffer_audio_781f6cb27eac316e(struct sfSoundBufferRecorder *_swig_go_0) { 1429 | sfSoundBufferRecorder *arg1 = (sfSoundBufferRecorder *) 0 ; 1430 | sfSoundBuffer *result = 0 ; 1431 | struct sfSoundBuffer *_swig_go_result; 1432 | 1433 | arg1 = *(sfSoundBufferRecorder **)&_swig_go_0; 1434 | 1435 | result = (sfSoundBuffer *)sfSoundBufferRecorder_getBuffer((struct sfSoundBufferRecorder const *)arg1); 1436 | *(sfSoundBuffer **)&_swig_go_result = (sfSoundBuffer *)result; 1437 | return _swig_go_result; 1438 | } 1439 | 1440 | 1441 | intgo _wrap_sfSoundBufferRecorder_setDevice_audio_781f6cb27eac316e(struct sfSoundBufferRecorder *_swig_go_0, _gostring_ _swig_go_1) { 1442 | sfSoundBufferRecorder *arg1 = (sfSoundBufferRecorder *) 0 ; 1443 | char *arg2 = (char *) 0 ; 1444 | sfBool result; 1445 | intgo _swig_go_result; 1446 | 1447 | arg1 = *(sfSoundBufferRecorder **)&_swig_go_0; 1448 | 1449 | arg2 = (char *)malloc(_swig_go_1.n + 1); 1450 | memcpy(arg2, _swig_go_1.p, _swig_go_1.n); 1451 | arg2[_swig_go_1.n] = '\0'; 1452 | 1453 | 1454 | result = (sfBool)sfSoundBufferRecorder_setDevice(arg1,(char const *)arg2); 1455 | _swig_go_result = result; 1456 | free(arg2); 1457 | return _swig_go_result; 1458 | } 1459 | 1460 | 1461 | _gostring_ _wrap_sfSoundBufferRecorder_getDevice_audio_781f6cb27eac316e(struct sfSoundBufferRecorder *_swig_go_0) { 1462 | sfSoundBufferRecorder *arg1 = (sfSoundBufferRecorder *) 0 ; 1463 | char *result = 0 ; 1464 | _gostring_ _swig_go_result; 1465 | 1466 | arg1 = *(sfSoundBufferRecorder **)&_swig_go_0; 1467 | 1468 | result = (char *)sfSoundBufferRecorder_getDevice(arg1); 1469 | _swig_go_result = Swig_AllocateString((char*)result, result ? strlen((char*)result) : 0); 1470 | return _swig_go_result; 1471 | } 1472 | 1473 | 1474 | struct sfSoundRecorder *_wrap_sfSoundRecorder_create_audio_781f6cb27eac316e(void* _swig_go_0, void* _swig_go_1, void* _swig_go_2, void *_swig_go_3) { 1475 | sfSoundRecorderStartCallback arg1 = (sfSoundRecorderStartCallback) 0 ; 1476 | sfSoundRecorderProcessCallback arg2 = (sfSoundRecorderProcessCallback) 0 ; 1477 | sfSoundRecorderStopCallback arg3 = (sfSoundRecorderStopCallback) 0 ; 1478 | void *arg4 = (void *) 0 ; 1479 | sfSoundRecorder *result = 0 ; 1480 | struct sfSoundRecorder *_swig_go_result; 1481 | 1482 | arg1 = *(sfSoundRecorderStartCallback *)&_swig_go_0; 1483 | arg2 = *(sfSoundRecorderProcessCallback *)&_swig_go_1; 1484 | arg3 = *(sfSoundRecorderStopCallback *)&_swig_go_2; 1485 | arg4 = *(void **)&_swig_go_3; 1486 | 1487 | result = (sfSoundRecorder *)sfSoundRecorder_create(arg1,arg2,arg3,arg4); 1488 | *(sfSoundRecorder **)&_swig_go_result = (sfSoundRecorder *)result; 1489 | return _swig_go_result; 1490 | } 1491 | 1492 | 1493 | void _wrap_sfSoundRecorder_destroy_audio_781f6cb27eac316e(struct sfSoundRecorder *_swig_go_0) { 1494 | sfSoundRecorder *arg1 = (sfSoundRecorder *) 0 ; 1495 | 1496 | arg1 = *(sfSoundRecorder **)&_swig_go_0; 1497 | 1498 | sfSoundRecorder_destroy(arg1); 1499 | 1500 | } 1501 | 1502 | 1503 | intgo _wrap_sfSoundRecorder_start_audio_781f6cb27eac316e(struct sfSoundRecorder *_swig_go_0, intgo _swig_go_1) { 1504 | sfSoundRecorder *arg1 = (sfSoundRecorder *) 0 ; 1505 | unsigned int arg2 ; 1506 | sfBool result; 1507 | intgo _swig_go_result; 1508 | 1509 | arg1 = *(sfSoundRecorder **)&_swig_go_0; 1510 | arg2 = (unsigned int)_swig_go_1; 1511 | 1512 | result = (sfBool)sfSoundRecorder_start(arg1,arg2); 1513 | _swig_go_result = result; 1514 | return _swig_go_result; 1515 | } 1516 | 1517 | 1518 | void _wrap_sfSoundRecorder_stop_audio_781f6cb27eac316e(struct sfSoundRecorder *_swig_go_0) { 1519 | sfSoundRecorder *arg1 = (sfSoundRecorder *) 0 ; 1520 | 1521 | arg1 = *(sfSoundRecorder **)&_swig_go_0; 1522 | 1523 | sfSoundRecorder_stop(arg1); 1524 | 1525 | } 1526 | 1527 | 1528 | intgo _wrap_sfSoundRecorder_getSampleRate_audio_781f6cb27eac316e(struct sfSoundRecorder *_swig_go_0) { 1529 | sfSoundRecorder *arg1 = (sfSoundRecorder *) 0 ; 1530 | unsigned int result; 1531 | intgo _swig_go_result; 1532 | 1533 | arg1 = *(sfSoundRecorder **)&_swig_go_0; 1534 | 1535 | result = (unsigned int)sfSoundRecorder_getSampleRate((struct sfSoundRecorder const *)arg1); 1536 | _swig_go_result = result; 1537 | return _swig_go_result; 1538 | } 1539 | 1540 | 1541 | intgo _wrap_sfSoundRecorder_isAvailable_audio_781f6cb27eac316e() { 1542 | sfBool result; 1543 | intgo _swig_go_result; 1544 | 1545 | 1546 | result = (sfBool)sfSoundRecorder_isAvailable(); 1547 | _swig_go_result = result; 1548 | return _swig_go_result; 1549 | } 1550 | 1551 | 1552 | void _wrap_sfSoundRecorder_setProcessingInterval_audio_781f6cb27eac316e(struct sfSoundRecorder *_swig_go_0, sfTime *_swig_go_1) { 1553 | sfSoundRecorder *arg1 = (sfSoundRecorder *) 0 ; 1554 | sfTime arg2 ; 1555 | sfTime *argp2 ; 1556 | 1557 | arg1 = *(sfSoundRecorder **)&_swig_go_0; 1558 | 1559 | argp2 = (sfTime *)_swig_go_1; 1560 | if (argp2 == NULL) { 1561 | _swig_gopanic("Attempt to dereference null sfTime"); 1562 | } 1563 | arg2 = (sfTime)*argp2; 1564 | 1565 | 1566 | sfSoundRecorder_setProcessingInterval(arg1,arg2); 1567 | 1568 | } 1569 | 1570 | 1571 | _gostring_* _wrap_sfSoundRecorder_getAvailableDevices_audio_781f6cb27eac316e(long long *_swig_go_0) { 1572 | size_t *arg1 = (size_t *) 0 ; 1573 | char **result = 0 ; 1574 | _gostring_* _swig_go_result; 1575 | 1576 | arg1 = *(size_t **)&_swig_go_0; 1577 | 1578 | result = (char **)sfSoundRecorder_getAvailableDevices(arg1); 1579 | *(char ***)&_swig_go_result = (char **)result; 1580 | return _swig_go_result; 1581 | } 1582 | 1583 | 1584 | _gostring_ _wrap_sfSoundRecorder_getDefaultDevice_audio_781f6cb27eac316e() { 1585 | char *result = 0 ; 1586 | _gostring_ _swig_go_result; 1587 | 1588 | 1589 | result = (char *)sfSoundRecorder_getDefaultDevice(); 1590 | _swig_go_result = Swig_AllocateString((char*)result, result ? strlen((char*)result) : 0); 1591 | return _swig_go_result; 1592 | } 1593 | 1594 | 1595 | intgo _wrap_sfSoundRecorder_setDevice_audio_781f6cb27eac316e(struct sfSoundRecorder *_swig_go_0, _gostring_ _swig_go_1) { 1596 | sfSoundRecorder *arg1 = (sfSoundRecorder *) 0 ; 1597 | char *arg2 = (char *) 0 ; 1598 | sfBool result; 1599 | intgo _swig_go_result; 1600 | 1601 | arg1 = *(sfSoundRecorder **)&_swig_go_0; 1602 | 1603 | arg2 = (char *)malloc(_swig_go_1.n + 1); 1604 | memcpy(arg2, _swig_go_1.p, _swig_go_1.n); 1605 | arg2[_swig_go_1.n] = '\0'; 1606 | 1607 | 1608 | result = (sfBool)sfSoundRecorder_setDevice(arg1,(char const *)arg2); 1609 | _swig_go_result = result; 1610 | free(arg2); 1611 | return _swig_go_result; 1612 | } 1613 | 1614 | 1615 | _gostring_ _wrap_sfSoundRecorder_getDevice_audio_781f6cb27eac316e(struct sfSoundRecorder *_swig_go_0) { 1616 | sfSoundRecorder *arg1 = (sfSoundRecorder *) 0 ; 1617 | char *result = 0 ; 1618 | _gostring_ _swig_go_result; 1619 | 1620 | arg1 = *(sfSoundRecorder **)&_swig_go_0; 1621 | 1622 | result = (char *)sfSoundRecorder_getDevice(arg1); 1623 | _swig_go_result = Swig_AllocateString((char*)result, result ? strlen((char*)result) : 0); 1624 | return _swig_go_result; 1625 | } 1626 | 1627 | 1628 | void _wrap_sfSoundRecorder_setChannelCount_audio_781f6cb27eac316e(struct sfSoundRecorder *_swig_go_0, intgo _swig_go_1) { 1629 | sfSoundRecorder *arg1 = (sfSoundRecorder *) 0 ; 1630 | unsigned int arg2 ; 1631 | 1632 | arg1 = *(sfSoundRecorder **)&_swig_go_0; 1633 | arg2 = (unsigned int)_swig_go_1; 1634 | 1635 | sfSoundRecorder_setChannelCount(arg1,arg2); 1636 | 1637 | } 1638 | 1639 | 1640 | intgo _wrap_sfSoundRecorder_getChannelCount_audio_781f6cb27eac316e(struct sfSoundRecorder *_swig_go_0) { 1641 | sfSoundRecorder *arg1 = (sfSoundRecorder *) 0 ; 1642 | unsigned int result; 1643 | intgo _swig_go_result; 1644 | 1645 | arg1 = *(sfSoundRecorder **)&_swig_go_0; 1646 | 1647 | result = (unsigned int)sfSoundRecorder_getChannelCount((struct sfSoundRecorder const *)arg1); 1648 | _swig_go_result = result; 1649 | return _swig_go_result; 1650 | } 1651 | 1652 | 1653 | intgo _wrap_sfStopped_audio_781f6cb27eac316e() { 1654 | int result; 1655 | intgo _swig_go_result; 1656 | 1657 | 1658 | result = sfStopped; 1659 | 1660 | _swig_go_result = result; 1661 | return _swig_go_result; 1662 | } 1663 | 1664 | 1665 | intgo _wrap_sfPaused_audio_781f6cb27eac316e() { 1666 | int result; 1667 | intgo _swig_go_result; 1668 | 1669 | 1670 | result = sfPaused; 1671 | 1672 | _swig_go_result = result; 1673 | return _swig_go_result; 1674 | } 1675 | 1676 | 1677 | intgo _wrap_sfPlaying_audio_781f6cb27eac316e() { 1678 | int result; 1679 | intgo _swig_go_result; 1680 | 1681 | 1682 | result = sfPlaying; 1683 | 1684 | _swig_go_result = result; 1685 | return _swig_go_result; 1686 | } 1687 | 1688 | 1689 | void _wrap_sfSoundStreamChunk_samples_set_audio_781f6cb27eac316e(sfSoundStreamChunk *_swig_go_0, short *_swig_go_1) { 1690 | sfSoundStreamChunk *arg1 = (sfSoundStreamChunk *) 0 ; 1691 | sfInt16 *arg2 = (sfInt16 *) 0 ; 1692 | 1693 | arg1 = *(sfSoundStreamChunk **)&_swig_go_0; 1694 | arg2 = *(sfInt16 **)&_swig_go_1; 1695 | 1696 | if (arg1) (arg1)->samples = arg2; 1697 | 1698 | } 1699 | 1700 | 1701 | short *_wrap_sfSoundStreamChunk_samples_get_audio_781f6cb27eac316e(sfSoundStreamChunk *_swig_go_0) { 1702 | sfSoundStreamChunk *arg1 = (sfSoundStreamChunk *) 0 ; 1703 | sfInt16 *result = 0 ; 1704 | short *_swig_go_result; 1705 | 1706 | arg1 = *(sfSoundStreamChunk **)&_swig_go_0; 1707 | 1708 | result = (sfInt16 *) ((arg1)->samples); 1709 | *(sfInt16 **)&_swig_go_result = (sfInt16 *)result; 1710 | return _swig_go_result; 1711 | } 1712 | 1713 | 1714 | void _wrap_sfSoundStreamChunk_sampleCount_set_audio_781f6cb27eac316e(sfSoundStreamChunk *_swig_go_0, intgo _swig_go_1) { 1715 | sfSoundStreamChunk *arg1 = (sfSoundStreamChunk *) 0 ; 1716 | unsigned int arg2 ; 1717 | 1718 | arg1 = *(sfSoundStreamChunk **)&_swig_go_0; 1719 | arg2 = (unsigned int)_swig_go_1; 1720 | 1721 | if (arg1) (arg1)->sampleCount = arg2; 1722 | 1723 | } 1724 | 1725 | 1726 | intgo _wrap_sfSoundStreamChunk_sampleCount_get_audio_781f6cb27eac316e(sfSoundStreamChunk *_swig_go_0) { 1727 | sfSoundStreamChunk *arg1 = (sfSoundStreamChunk *) 0 ; 1728 | unsigned int result; 1729 | intgo _swig_go_result; 1730 | 1731 | arg1 = *(sfSoundStreamChunk **)&_swig_go_0; 1732 | 1733 | result = (unsigned int) ((arg1)->sampleCount); 1734 | _swig_go_result = result; 1735 | return _swig_go_result; 1736 | } 1737 | 1738 | 1739 | sfSoundStreamChunk *_wrap_new_sfSoundStreamChunk_audio_781f6cb27eac316e() { 1740 | sfSoundStreamChunk *result = 0 ; 1741 | sfSoundStreamChunk *_swig_go_result; 1742 | 1743 | 1744 | result = (sfSoundStreamChunk *)calloc(1, sizeof(sfSoundStreamChunk)); 1745 | *(sfSoundStreamChunk **)&_swig_go_result = (sfSoundStreamChunk *)result; 1746 | return _swig_go_result; 1747 | } 1748 | 1749 | 1750 | void _wrap_delete_sfSoundStreamChunk_audio_781f6cb27eac316e(sfSoundStreamChunk *_swig_go_0) { 1751 | sfSoundStreamChunk *arg1 = (sfSoundStreamChunk *) 0 ; 1752 | 1753 | arg1 = *(sfSoundStreamChunk **)&_swig_go_0; 1754 | 1755 | free((char *) arg1); 1756 | 1757 | } 1758 | 1759 | 1760 | struct sfSoundStream *_wrap_sfSoundStream_create_audio_781f6cb27eac316e(void* _swig_go_0, void* _swig_go_1, intgo _swig_go_2, intgo _swig_go_3, void *_swig_go_4) { 1761 | sfSoundStreamGetDataCallback arg1 = (sfSoundStreamGetDataCallback) 0 ; 1762 | sfSoundStreamSeekCallback arg2 = (sfSoundStreamSeekCallback) 0 ; 1763 | unsigned int arg3 ; 1764 | unsigned int arg4 ; 1765 | void *arg5 = (void *) 0 ; 1766 | sfSoundStream *result = 0 ; 1767 | struct sfSoundStream *_swig_go_result; 1768 | 1769 | arg1 = *(sfSoundStreamGetDataCallback *)&_swig_go_0; 1770 | arg2 = *(sfSoundStreamSeekCallback *)&_swig_go_1; 1771 | arg3 = (unsigned int)_swig_go_2; 1772 | arg4 = (unsigned int)_swig_go_3; 1773 | arg5 = *(void **)&_swig_go_4; 1774 | 1775 | result = (sfSoundStream *)sfSoundStream_create(arg1,arg2,arg3,arg4,arg5); 1776 | *(sfSoundStream **)&_swig_go_result = (sfSoundStream *)result; 1777 | return _swig_go_result; 1778 | } 1779 | 1780 | 1781 | void _wrap_sfSoundStream_destroy_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0) { 1782 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 1783 | 1784 | arg1 = *(sfSoundStream **)&_swig_go_0; 1785 | 1786 | sfSoundStream_destroy(arg1); 1787 | 1788 | } 1789 | 1790 | 1791 | void _wrap_sfSoundStream_play_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0) { 1792 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 1793 | 1794 | arg1 = *(sfSoundStream **)&_swig_go_0; 1795 | 1796 | sfSoundStream_play(arg1); 1797 | 1798 | } 1799 | 1800 | 1801 | void _wrap_sfSoundStream_pause_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0) { 1802 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 1803 | 1804 | arg1 = *(sfSoundStream **)&_swig_go_0; 1805 | 1806 | sfSoundStream_pause(arg1); 1807 | 1808 | } 1809 | 1810 | 1811 | void _wrap_sfSoundStream_stop_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0) { 1812 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 1813 | 1814 | arg1 = *(sfSoundStream **)&_swig_go_0; 1815 | 1816 | sfSoundStream_stop(arg1); 1817 | 1818 | } 1819 | 1820 | 1821 | intgo _wrap_sfSoundStream_getStatus_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0) { 1822 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 1823 | sfSoundStatus result; 1824 | intgo _swig_go_result; 1825 | 1826 | arg1 = *(sfSoundStream **)&_swig_go_0; 1827 | 1828 | result = (sfSoundStatus)sfSoundStream_getStatus((struct sfSoundStream const *)arg1); 1829 | _swig_go_result = (intgo)result; 1830 | return _swig_go_result; 1831 | } 1832 | 1833 | 1834 | intgo _wrap_sfSoundStream_getChannelCount_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0) { 1835 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 1836 | unsigned int result; 1837 | intgo _swig_go_result; 1838 | 1839 | arg1 = *(sfSoundStream **)&_swig_go_0; 1840 | 1841 | result = (unsigned int)sfSoundStream_getChannelCount((struct sfSoundStream const *)arg1); 1842 | _swig_go_result = result; 1843 | return _swig_go_result; 1844 | } 1845 | 1846 | 1847 | intgo _wrap_sfSoundStream_getSampleRate_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0) { 1848 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 1849 | unsigned int result; 1850 | intgo _swig_go_result; 1851 | 1852 | arg1 = *(sfSoundStream **)&_swig_go_0; 1853 | 1854 | result = (unsigned int)sfSoundStream_getSampleRate((struct sfSoundStream const *)arg1); 1855 | _swig_go_result = result; 1856 | return _swig_go_result; 1857 | } 1858 | 1859 | 1860 | void _wrap_sfSoundStream_setPitch_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0, float _swig_go_1) { 1861 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 1862 | float arg2 ; 1863 | 1864 | arg1 = *(sfSoundStream **)&_swig_go_0; 1865 | arg2 = (float)_swig_go_1; 1866 | 1867 | sfSoundStream_setPitch(arg1,arg2); 1868 | 1869 | } 1870 | 1871 | 1872 | void _wrap_sfSoundStream_setVolume_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0, float _swig_go_1) { 1873 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 1874 | float arg2 ; 1875 | 1876 | arg1 = *(sfSoundStream **)&_swig_go_0; 1877 | arg2 = (float)_swig_go_1; 1878 | 1879 | sfSoundStream_setVolume(arg1,arg2); 1880 | 1881 | } 1882 | 1883 | 1884 | void _wrap_sfSoundStream_setPosition_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0, sfVector3f *_swig_go_1) { 1885 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 1886 | sfVector3f arg2 ; 1887 | sfVector3f *argp2 ; 1888 | 1889 | arg1 = *(sfSoundStream **)&_swig_go_0; 1890 | 1891 | argp2 = (sfVector3f *)_swig_go_1; 1892 | if (argp2 == NULL) { 1893 | _swig_gopanic("Attempt to dereference null sfVector3f"); 1894 | } 1895 | arg2 = (sfVector3f)*argp2; 1896 | 1897 | 1898 | sfSoundStream_setPosition(arg1,arg2); 1899 | 1900 | } 1901 | 1902 | 1903 | void _wrap_sfSoundStream_setRelativeToListener_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0, intgo _swig_go_1) { 1904 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 1905 | sfBool arg2 ; 1906 | 1907 | arg1 = *(sfSoundStream **)&_swig_go_0; 1908 | arg2 = (sfBool)_swig_go_1; 1909 | 1910 | sfSoundStream_setRelativeToListener(arg1,arg2); 1911 | 1912 | } 1913 | 1914 | 1915 | void _wrap_sfSoundStream_setMinDistance_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0, float _swig_go_1) { 1916 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 1917 | float arg2 ; 1918 | 1919 | arg1 = *(sfSoundStream **)&_swig_go_0; 1920 | arg2 = (float)_swig_go_1; 1921 | 1922 | sfSoundStream_setMinDistance(arg1,arg2); 1923 | 1924 | } 1925 | 1926 | 1927 | void _wrap_sfSoundStream_setAttenuation_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0, float _swig_go_1) { 1928 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 1929 | float arg2 ; 1930 | 1931 | arg1 = *(sfSoundStream **)&_swig_go_0; 1932 | arg2 = (float)_swig_go_1; 1933 | 1934 | sfSoundStream_setAttenuation(arg1,arg2); 1935 | 1936 | } 1937 | 1938 | 1939 | void _wrap_sfSoundStream_setPlayingOffset_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0, sfTime *_swig_go_1) { 1940 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 1941 | sfTime arg2 ; 1942 | sfTime *argp2 ; 1943 | 1944 | arg1 = *(sfSoundStream **)&_swig_go_0; 1945 | 1946 | argp2 = (sfTime *)_swig_go_1; 1947 | if (argp2 == NULL) { 1948 | _swig_gopanic("Attempt to dereference null sfTime"); 1949 | } 1950 | arg2 = (sfTime)*argp2; 1951 | 1952 | 1953 | sfSoundStream_setPlayingOffset(arg1,arg2); 1954 | 1955 | } 1956 | 1957 | 1958 | void _wrap_sfSoundStream_setLoop_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0, intgo _swig_go_1) { 1959 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 1960 | sfBool arg2 ; 1961 | 1962 | arg1 = *(sfSoundStream **)&_swig_go_0; 1963 | arg2 = (sfBool)_swig_go_1; 1964 | 1965 | sfSoundStream_setLoop(arg1,arg2); 1966 | 1967 | } 1968 | 1969 | 1970 | float _wrap_sfSoundStream_getPitch_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0) { 1971 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 1972 | float result; 1973 | float _swig_go_result; 1974 | 1975 | arg1 = *(sfSoundStream **)&_swig_go_0; 1976 | 1977 | result = (float)sfSoundStream_getPitch((struct sfSoundStream const *)arg1); 1978 | _swig_go_result = result; 1979 | return _swig_go_result; 1980 | } 1981 | 1982 | 1983 | float _wrap_sfSoundStream_getVolume_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0) { 1984 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 1985 | float result; 1986 | float _swig_go_result; 1987 | 1988 | arg1 = *(sfSoundStream **)&_swig_go_0; 1989 | 1990 | result = (float)sfSoundStream_getVolume((struct sfSoundStream const *)arg1); 1991 | _swig_go_result = result; 1992 | return _swig_go_result; 1993 | } 1994 | 1995 | 1996 | sfVector3f *_wrap_sfSoundStream_getPosition_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0) { 1997 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 1998 | sfVector3f result; 1999 | sfVector3f *_swig_go_result; 2000 | 2001 | arg1 = *(sfSoundStream **)&_swig_go_0; 2002 | 2003 | result = sfSoundStream_getPosition((struct sfSoundStream const *)arg1); 2004 | { 2005 | sfVector3f * resultptr = (sfVector3f *)malloc(sizeof(sfVector3f)); 2006 | memmove(resultptr, &result, sizeof(sfVector3f)); 2007 | *(sfVector3f **)&_swig_go_result = resultptr; 2008 | } 2009 | return _swig_go_result; 2010 | } 2011 | 2012 | 2013 | intgo _wrap_sfSoundStream_isRelativeToListener_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0) { 2014 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 2015 | sfBool result; 2016 | intgo _swig_go_result; 2017 | 2018 | arg1 = *(sfSoundStream **)&_swig_go_0; 2019 | 2020 | result = (sfBool)sfSoundStream_isRelativeToListener((struct sfSoundStream const *)arg1); 2021 | _swig_go_result = result; 2022 | return _swig_go_result; 2023 | } 2024 | 2025 | 2026 | float _wrap_sfSoundStream_getMinDistance_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0) { 2027 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 2028 | float result; 2029 | float _swig_go_result; 2030 | 2031 | arg1 = *(sfSoundStream **)&_swig_go_0; 2032 | 2033 | result = (float)sfSoundStream_getMinDistance((struct sfSoundStream const *)arg1); 2034 | _swig_go_result = result; 2035 | return _swig_go_result; 2036 | } 2037 | 2038 | 2039 | float _wrap_sfSoundStream_getAttenuation_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0) { 2040 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 2041 | float result; 2042 | float _swig_go_result; 2043 | 2044 | arg1 = *(sfSoundStream **)&_swig_go_0; 2045 | 2046 | result = (float)sfSoundStream_getAttenuation((struct sfSoundStream const *)arg1); 2047 | _swig_go_result = result; 2048 | return _swig_go_result; 2049 | } 2050 | 2051 | 2052 | intgo _wrap_sfSoundStream_getLoop_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0) { 2053 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 2054 | sfBool result; 2055 | intgo _swig_go_result; 2056 | 2057 | arg1 = *(sfSoundStream **)&_swig_go_0; 2058 | 2059 | result = (sfBool)sfSoundStream_getLoop((struct sfSoundStream const *)arg1); 2060 | _swig_go_result = result; 2061 | return _swig_go_result; 2062 | } 2063 | 2064 | 2065 | sfTime *_wrap_sfSoundStream_getPlayingOffset_audio_781f6cb27eac316e(struct sfSoundStream *_swig_go_0) { 2066 | sfSoundStream *arg1 = (sfSoundStream *) 0 ; 2067 | sfTime result; 2068 | sfTime *_swig_go_result; 2069 | 2070 | arg1 = *(sfSoundStream **)&_swig_go_0; 2071 | 2072 | result = sfSoundStream_getPlayingOffset((struct sfSoundStream const *)arg1); 2073 | { 2074 | sfTime * resultptr = (sfTime *)malloc(sizeof(sfTime)); 2075 | memmove(resultptr, &result, sizeof(sfTime)); 2076 | *(sfTime **)&_swig_go_result = resultptr; 2077 | } 2078 | return _swig_go_result; 2079 | } 2080 | 2081 | 2082 | #ifdef __cplusplus 2083 | } 2084 | #endif 2085 | 2086 | -------------------------------------------------------------------------------- /audio/audio.go: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 4.0.1 4 | * 5 | * This file is not intended to be easily readable and contains a number of 6 | * coding conventions designed to improve portability and efficiency. Do not make 7 | * changes to this file unless you know what you are doing--modify the SWIG 8 | * interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | // source: /mnt/e/workspace/git/go-sfml/CSFML/include/SFML/Audio/Audio.i 12 | 13 | package audio 14 | 15 | /* 16 | #define intgo swig_intgo 17 | typedef void *swig_voidp; 18 | 19 | #include 20 | 21 | 22 | typedef long long intgo; 23 | typedef unsigned long long uintgo; 24 | 25 | 26 | 27 | typedef struct { char *p; intgo n; } _gostring_; 28 | typedef struct { void* array; intgo len; intgo cap; } _goslice_; 29 | 30 | 31 | typedef _gostring_ swig_type_1; 32 | typedef long long swig_type_2; 33 | typedef _gostring_ swig_type_3; 34 | typedef long long swig_type_4; 35 | typedef long long swig_type_5; 36 | typedef _gostring_ swig_type_6; 37 | typedef long long swig_type_7; 38 | typedef _gostring_ swig_type_8; 39 | typedef _gostring_ swig_type_9; 40 | typedef void* swig_type_10; 41 | typedef void* swig_type_11; 42 | typedef void* swig_type_12; 43 | typedef _gostring_ swig_type_13; 44 | typedef _gostring_ swig_type_14; 45 | typedef _gostring_ swig_type_15; 46 | typedef void* swig_type_16; 47 | typedef void* swig_type_17; 48 | extern void _wrap_Swig_free_audio_781f6cb27eac316e(uintptr_t arg1); 49 | extern uintptr_t _wrap_Swig_malloc_audio_781f6cb27eac316e(swig_intgo arg1); 50 | extern void _wrap_sfListener_setGlobalVolume_audio_781f6cb27eac316e(float arg1); 51 | extern float _wrap_sfListener_getGlobalVolume_audio_781f6cb27eac316e(void); 52 | extern void _wrap_sfListener_setPosition_audio_781f6cb27eac316e(uintptr_t arg1); 53 | extern uintptr_t _wrap_sfListener_getPosition_audio_781f6cb27eac316e(void); 54 | extern void _wrap_sfListener_setDirection_audio_781f6cb27eac316e(uintptr_t arg1); 55 | extern uintptr_t _wrap_sfListener_getDirection_audio_781f6cb27eac316e(void); 56 | extern void _wrap_sfListener_setUpVector_audio_781f6cb27eac316e(uintptr_t arg1); 57 | extern uintptr_t _wrap_sfListener_getUpVector_audio_781f6cb27eac316e(void); 58 | extern void _wrap_sfTimeSpan_offset_set_audio_781f6cb27eac316e(uintptr_t arg1, uintptr_t arg2); 59 | extern uintptr_t _wrap_sfTimeSpan_offset_get_audio_781f6cb27eac316e(uintptr_t arg1); 60 | extern void _wrap_sfTimeSpan_length_set_audio_781f6cb27eac316e(uintptr_t arg1, uintptr_t arg2); 61 | extern uintptr_t _wrap_sfTimeSpan_length_get_audio_781f6cb27eac316e(uintptr_t arg1); 62 | extern uintptr_t _wrap_new_sfTimeSpan_audio_781f6cb27eac316e(void); 63 | extern void _wrap_delete_sfTimeSpan_audio_781f6cb27eac316e(uintptr_t arg1); 64 | extern uintptr_t _wrap_sfMusic_createFromFile_audio_781f6cb27eac316e(swig_type_1 arg1); 65 | extern uintptr_t _wrap_sfMusic_createFromMemory_audio_781f6cb27eac316e(uintptr_t arg1, swig_type_2 arg2); 66 | extern uintptr_t _wrap_sfMusic_createFromStream_audio_781f6cb27eac316e(uintptr_t arg1); 67 | extern void _wrap_sfMusic_destroy_audio_781f6cb27eac316e(uintptr_t arg1); 68 | extern void _wrap_sfMusic_setLoop_audio_781f6cb27eac316e(uintptr_t arg1, swig_intgo arg2); 69 | extern swig_intgo _wrap_sfMusic_getLoop_audio_781f6cb27eac316e(uintptr_t arg1); 70 | extern uintptr_t _wrap_sfMusic_getDuration_audio_781f6cb27eac316e(uintptr_t arg1); 71 | extern uintptr_t _wrap_sfMusic_getLoopPoints_audio_781f6cb27eac316e(uintptr_t arg1); 72 | extern void _wrap_sfMusic_setLoopPoints_audio_781f6cb27eac316e(uintptr_t arg1, uintptr_t arg2); 73 | extern void _wrap_sfMusic_play_audio_781f6cb27eac316e(uintptr_t arg1); 74 | extern void _wrap_sfMusic_pause_audio_781f6cb27eac316e(uintptr_t arg1); 75 | extern void _wrap_sfMusic_stop_audio_781f6cb27eac316e(uintptr_t arg1); 76 | extern swig_intgo _wrap_sfMusic_getChannelCount_audio_781f6cb27eac316e(uintptr_t arg1); 77 | extern swig_intgo _wrap_sfMusic_getSampleRate_audio_781f6cb27eac316e(uintptr_t arg1); 78 | extern swig_intgo _wrap_sfMusic_getStatus_audio_781f6cb27eac316e(uintptr_t arg1); 79 | extern uintptr_t _wrap_sfMusic_getPlayingOffset_audio_781f6cb27eac316e(uintptr_t arg1); 80 | extern void _wrap_sfMusic_setPitch_audio_781f6cb27eac316e(uintptr_t arg1, float arg2); 81 | extern void _wrap_sfMusic_setVolume_audio_781f6cb27eac316e(uintptr_t arg1, float arg2); 82 | extern void _wrap_sfMusic_setPosition_audio_781f6cb27eac316e(uintptr_t arg1, uintptr_t arg2); 83 | extern void _wrap_sfMusic_setRelativeToListener_audio_781f6cb27eac316e(uintptr_t arg1, swig_intgo arg2); 84 | extern void _wrap_sfMusic_setMinDistance_audio_781f6cb27eac316e(uintptr_t arg1, float arg2); 85 | extern void _wrap_sfMusic_setAttenuation_audio_781f6cb27eac316e(uintptr_t arg1, float arg2); 86 | extern void _wrap_sfMusic_setPlayingOffset_audio_781f6cb27eac316e(uintptr_t arg1, uintptr_t arg2); 87 | extern float _wrap_sfMusic_getPitch_audio_781f6cb27eac316e(uintptr_t arg1); 88 | extern float _wrap_sfMusic_getVolume_audio_781f6cb27eac316e(uintptr_t arg1); 89 | extern uintptr_t _wrap_sfMusic_getPosition_audio_781f6cb27eac316e(uintptr_t arg1); 90 | extern swig_intgo _wrap_sfMusic_isRelativeToListener_audio_781f6cb27eac316e(uintptr_t arg1); 91 | extern float _wrap_sfMusic_getMinDistance_audio_781f6cb27eac316e(uintptr_t arg1); 92 | extern float _wrap_sfMusic_getAttenuation_audio_781f6cb27eac316e(uintptr_t arg1); 93 | extern uintptr_t _wrap_sfSound_create_audio_781f6cb27eac316e(void); 94 | extern uintptr_t _wrap_sfSound_copy_audio_781f6cb27eac316e(uintptr_t arg1); 95 | extern void _wrap_sfSound_destroy_audio_781f6cb27eac316e(uintptr_t arg1); 96 | extern void _wrap_sfSound_play_audio_781f6cb27eac316e(uintptr_t arg1); 97 | extern void _wrap_sfSound_pause_audio_781f6cb27eac316e(uintptr_t arg1); 98 | extern void _wrap_sfSound_stop_audio_781f6cb27eac316e(uintptr_t arg1); 99 | extern void _wrap_sfSound_setBuffer_audio_781f6cb27eac316e(uintptr_t arg1, uintptr_t arg2); 100 | extern uintptr_t _wrap_sfSound_getBuffer_audio_781f6cb27eac316e(uintptr_t arg1); 101 | extern void _wrap_sfSound_setLoop_audio_781f6cb27eac316e(uintptr_t arg1, swig_intgo arg2); 102 | extern swig_intgo _wrap_sfSound_getLoop_audio_781f6cb27eac316e(uintptr_t arg1); 103 | extern swig_intgo _wrap_sfSound_getStatus_audio_781f6cb27eac316e(uintptr_t arg1); 104 | extern void _wrap_sfSound_setPitch_audio_781f6cb27eac316e(uintptr_t arg1, float arg2); 105 | extern void _wrap_sfSound_setVolume_audio_781f6cb27eac316e(uintptr_t arg1, float arg2); 106 | extern void _wrap_sfSound_setPosition_audio_781f6cb27eac316e(uintptr_t arg1, uintptr_t arg2); 107 | extern void _wrap_sfSound_setRelativeToListener_audio_781f6cb27eac316e(uintptr_t arg1, swig_intgo arg2); 108 | extern void _wrap_sfSound_setMinDistance_audio_781f6cb27eac316e(uintptr_t arg1, float arg2); 109 | extern void _wrap_sfSound_setAttenuation_audio_781f6cb27eac316e(uintptr_t arg1, float arg2); 110 | extern void _wrap_sfSound_setPlayingOffset_audio_781f6cb27eac316e(uintptr_t arg1, uintptr_t arg2); 111 | extern float _wrap_sfSound_getPitch_audio_781f6cb27eac316e(uintptr_t arg1); 112 | extern float _wrap_sfSound_getVolume_audio_781f6cb27eac316e(uintptr_t arg1); 113 | extern uintptr_t _wrap_sfSound_getPosition_audio_781f6cb27eac316e(uintptr_t arg1); 114 | extern swig_intgo _wrap_sfSound_isRelativeToListener_audio_781f6cb27eac316e(uintptr_t arg1); 115 | extern float _wrap_sfSound_getMinDistance_audio_781f6cb27eac316e(uintptr_t arg1); 116 | extern float _wrap_sfSound_getAttenuation_audio_781f6cb27eac316e(uintptr_t arg1); 117 | extern uintptr_t _wrap_sfSound_getPlayingOffset_audio_781f6cb27eac316e(uintptr_t arg1); 118 | extern uintptr_t _wrap_sfSoundBuffer_createFromFile_audio_781f6cb27eac316e(swig_type_3 arg1); 119 | extern uintptr_t _wrap_sfSoundBuffer_createFromMemory_audio_781f6cb27eac316e(uintptr_t arg1, swig_type_4 arg2); 120 | extern uintptr_t _wrap_sfSoundBuffer_createFromStream_audio_781f6cb27eac316e(uintptr_t arg1); 121 | extern uintptr_t _wrap_sfSoundBuffer_createFromSamples_audio_781f6cb27eac316e(swig_voidp arg1, swig_type_5 arg2, swig_intgo arg3, swig_intgo arg4); 122 | extern uintptr_t _wrap_sfSoundBuffer_copy_audio_781f6cb27eac316e(uintptr_t arg1); 123 | extern void _wrap_sfSoundBuffer_destroy_audio_781f6cb27eac316e(uintptr_t arg1); 124 | extern swig_intgo _wrap_sfSoundBuffer_saveToFile_audio_781f6cb27eac316e(uintptr_t arg1, swig_type_6 arg2); 125 | extern swig_voidp _wrap_sfSoundBuffer_getSamples_audio_781f6cb27eac316e(uintptr_t arg1); 126 | extern swig_type_7 _wrap_sfSoundBuffer_getSampleCount_audio_781f6cb27eac316e(uintptr_t arg1); 127 | extern swig_intgo _wrap_sfSoundBuffer_getSampleRate_audio_781f6cb27eac316e(uintptr_t arg1); 128 | extern swig_intgo _wrap_sfSoundBuffer_getChannelCount_audio_781f6cb27eac316e(uintptr_t arg1); 129 | extern uintptr_t _wrap_sfSoundBuffer_getDuration_audio_781f6cb27eac316e(uintptr_t arg1); 130 | extern uintptr_t _wrap_sfSoundBufferRecorder_create_audio_781f6cb27eac316e(void); 131 | extern void _wrap_sfSoundBufferRecorder_destroy_audio_781f6cb27eac316e(uintptr_t arg1); 132 | extern swig_intgo _wrap_sfSoundBufferRecorder_start_audio_781f6cb27eac316e(uintptr_t arg1, swig_intgo arg2); 133 | extern void _wrap_sfSoundBufferRecorder_stop_audio_781f6cb27eac316e(uintptr_t arg1); 134 | extern swig_intgo _wrap_sfSoundBufferRecorder_getSampleRate_audio_781f6cb27eac316e(uintptr_t arg1); 135 | extern uintptr_t _wrap_sfSoundBufferRecorder_getBuffer_audio_781f6cb27eac316e(uintptr_t arg1); 136 | extern swig_intgo _wrap_sfSoundBufferRecorder_setDevice_audio_781f6cb27eac316e(uintptr_t arg1, swig_type_8 arg2); 137 | extern swig_type_9 _wrap_sfSoundBufferRecorder_getDevice_audio_781f6cb27eac316e(uintptr_t arg1); 138 | extern uintptr_t _wrap_sfSoundRecorder_create_audio_781f6cb27eac316e(swig_type_10 arg1, swig_type_11 arg2, swig_type_12 arg3, uintptr_t arg4); 139 | extern void _wrap_sfSoundRecorder_destroy_audio_781f6cb27eac316e(uintptr_t arg1); 140 | extern swig_intgo _wrap_sfSoundRecorder_start_audio_781f6cb27eac316e(uintptr_t arg1, swig_intgo arg2); 141 | extern void _wrap_sfSoundRecorder_stop_audio_781f6cb27eac316e(uintptr_t arg1); 142 | extern swig_intgo _wrap_sfSoundRecorder_getSampleRate_audio_781f6cb27eac316e(uintptr_t arg1); 143 | extern swig_intgo _wrap_sfSoundRecorder_isAvailable_audio_781f6cb27eac316e(void); 144 | extern void _wrap_sfSoundRecorder_setProcessingInterval_audio_781f6cb27eac316e(uintptr_t arg1, uintptr_t arg2); 145 | extern swig_voidp _wrap_sfSoundRecorder_getAvailableDevices_audio_781f6cb27eac316e(swig_voidp arg1); 146 | extern swig_type_13 _wrap_sfSoundRecorder_getDefaultDevice_audio_781f6cb27eac316e(void); 147 | extern swig_intgo _wrap_sfSoundRecorder_setDevice_audio_781f6cb27eac316e(uintptr_t arg1, swig_type_14 arg2); 148 | extern swig_type_15 _wrap_sfSoundRecorder_getDevice_audio_781f6cb27eac316e(uintptr_t arg1); 149 | extern void _wrap_sfSoundRecorder_setChannelCount_audio_781f6cb27eac316e(uintptr_t arg1, swig_intgo arg2); 150 | extern swig_intgo _wrap_sfSoundRecorder_getChannelCount_audio_781f6cb27eac316e(uintptr_t arg1); 151 | extern swig_intgo _wrap_sfStopped_audio_781f6cb27eac316e(void); 152 | extern swig_intgo _wrap_sfPaused_audio_781f6cb27eac316e(void); 153 | extern swig_intgo _wrap_sfPlaying_audio_781f6cb27eac316e(void); 154 | extern void _wrap_sfSoundStreamChunk_samples_set_audio_781f6cb27eac316e(uintptr_t arg1, swig_voidp arg2); 155 | extern swig_voidp _wrap_sfSoundStreamChunk_samples_get_audio_781f6cb27eac316e(uintptr_t arg1); 156 | extern void _wrap_sfSoundStreamChunk_sampleCount_set_audio_781f6cb27eac316e(uintptr_t arg1, swig_intgo arg2); 157 | extern swig_intgo _wrap_sfSoundStreamChunk_sampleCount_get_audio_781f6cb27eac316e(uintptr_t arg1); 158 | extern uintptr_t _wrap_new_sfSoundStreamChunk_audio_781f6cb27eac316e(void); 159 | extern void _wrap_delete_sfSoundStreamChunk_audio_781f6cb27eac316e(uintptr_t arg1); 160 | extern uintptr_t _wrap_sfSoundStream_create_audio_781f6cb27eac316e(swig_type_16 arg1, swig_type_17 arg2, swig_intgo arg3, swig_intgo arg4, uintptr_t arg5); 161 | extern void _wrap_sfSoundStream_destroy_audio_781f6cb27eac316e(uintptr_t arg1); 162 | extern void _wrap_sfSoundStream_play_audio_781f6cb27eac316e(uintptr_t arg1); 163 | extern void _wrap_sfSoundStream_pause_audio_781f6cb27eac316e(uintptr_t arg1); 164 | extern void _wrap_sfSoundStream_stop_audio_781f6cb27eac316e(uintptr_t arg1); 165 | extern swig_intgo _wrap_sfSoundStream_getStatus_audio_781f6cb27eac316e(uintptr_t arg1); 166 | extern swig_intgo _wrap_sfSoundStream_getChannelCount_audio_781f6cb27eac316e(uintptr_t arg1); 167 | extern swig_intgo _wrap_sfSoundStream_getSampleRate_audio_781f6cb27eac316e(uintptr_t arg1); 168 | extern void _wrap_sfSoundStream_setPitch_audio_781f6cb27eac316e(uintptr_t arg1, float arg2); 169 | extern void _wrap_sfSoundStream_setVolume_audio_781f6cb27eac316e(uintptr_t arg1, float arg2); 170 | extern void _wrap_sfSoundStream_setPosition_audio_781f6cb27eac316e(uintptr_t arg1, uintptr_t arg2); 171 | extern void _wrap_sfSoundStream_setRelativeToListener_audio_781f6cb27eac316e(uintptr_t arg1, swig_intgo arg2); 172 | extern void _wrap_sfSoundStream_setMinDistance_audio_781f6cb27eac316e(uintptr_t arg1, float arg2); 173 | extern void _wrap_sfSoundStream_setAttenuation_audio_781f6cb27eac316e(uintptr_t arg1, float arg2); 174 | extern void _wrap_sfSoundStream_setPlayingOffset_audio_781f6cb27eac316e(uintptr_t arg1, uintptr_t arg2); 175 | extern void _wrap_sfSoundStream_setLoop_audio_781f6cb27eac316e(uintptr_t arg1, swig_intgo arg2); 176 | extern float _wrap_sfSoundStream_getPitch_audio_781f6cb27eac316e(uintptr_t arg1); 177 | extern float _wrap_sfSoundStream_getVolume_audio_781f6cb27eac316e(uintptr_t arg1); 178 | extern uintptr_t _wrap_sfSoundStream_getPosition_audio_781f6cb27eac316e(uintptr_t arg1); 179 | extern swig_intgo _wrap_sfSoundStream_isRelativeToListener_audio_781f6cb27eac316e(uintptr_t arg1); 180 | extern float _wrap_sfSoundStream_getMinDistance_audio_781f6cb27eac316e(uintptr_t arg1); 181 | extern float _wrap_sfSoundStream_getAttenuation_audio_781f6cb27eac316e(uintptr_t arg1); 182 | extern swig_intgo _wrap_sfSoundStream_getLoop_audio_781f6cb27eac316e(uintptr_t arg1); 183 | extern uintptr_t _wrap_sfSoundStream_getPlayingOffset_audio_781f6cb27eac316e(uintptr_t arg1); 184 | #undef intgo 185 | */ 186 | // #cgo LDFLAGS: -lcsfml-audio 187 | import "C" 188 | 189 | import "unsafe" 190 | import _ "runtime/cgo" 191 | import "sync" 192 | 193 | 194 | type _ unsafe.Pointer 195 | 196 | 197 | 198 | var Swig_escape_always_false bool 199 | var Swig_escape_val interface{} 200 | 201 | 202 | type _swig_fnptr *byte 203 | type _swig_memberptr *byte 204 | 205 | 206 | type _ sync.Mutex 207 | 208 | 209 | type swig_gostring struct { p uintptr; n int } 210 | func swigCopyString(s string) string { 211 | p := *(*swig_gostring)(unsafe.Pointer(&s)) 212 | r := string((*[0x7fffffff]byte)(unsafe.Pointer(p.p))[:p.n]) 213 | Swig_free(p.p) 214 | return r 215 | } 216 | 217 | func Swig_free(arg1 uintptr) { 218 | _swig_i_0 := arg1 219 | C._wrap_Swig_free_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 220 | } 221 | 222 | func Swig_malloc(arg1 int) (_swig_ret uintptr) { 223 | var swig_r uintptr 224 | _swig_i_0 := arg1 225 | swig_r = (uintptr)(C._wrap_Swig_malloc_audio_781f6cb27eac316e(C.swig_intgo(_swig_i_0))) 226 | return swig_r 227 | } 228 | 229 | const CSFML_VERSION_MAJOR int = 2 230 | const CSFML_VERSION_MINOR int = 5 231 | const CSFML_VERSION_PATCH int = 1 232 | const SfFalse int = 0 233 | const SfTrue int = 1 234 | func SfListener_setGlobalVolume(arg1 float32) { 235 | _swig_i_0 := arg1 236 | C._wrap_sfListener_setGlobalVolume_audio_781f6cb27eac316e(C.float(_swig_i_0)) 237 | } 238 | 239 | func SfListener_getGlobalVolume() (_swig_ret float32) { 240 | var swig_r float32 241 | swig_r = (float32)(C._wrap_sfListener_getGlobalVolume_audio_781f6cb27eac316e()) 242 | return swig_r 243 | } 244 | 245 | func SfListener_setPosition(arg1 SfVector3f) { 246 | _swig_i_0 := arg1.Swigcptr() 247 | C._wrap_sfListener_setPosition_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 248 | } 249 | 250 | func SfListener_getPosition() (_swig_ret SfVector3f) { 251 | var swig_r SfVector3f 252 | swig_r = (SfVector3f)(SwigcptrSfVector3f(C._wrap_sfListener_getPosition_audio_781f6cb27eac316e())) 253 | return swig_r 254 | } 255 | 256 | func SfListener_setDirection(arg1 SfVector3f) { 257 | _swig_i_0 := arg1.Swigcptr() 258 | C._wrap_sfListener_setDirection_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 259 | } 260 | 261 | func SfListener_getDirection() (_swig_ret SfVector3f) { 262 | var swig_r SfVector3f 263 | swig_r = (SfVector3f)(SwigcptrSfVector3f(C._wrap_sfListener_getDirection_audio_781f6cb27eac316e())) 264 | return swig_r 265 | } 266 | 267 | func SfListener_setUpVector(arg1 SfVector3f) { 268 | _swig_i_0 := arg1.Swigcptr() 269 | C._wrap_sfListener_setUpVector_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 270 | } 271 | 272 | func SfListener_getUpVector() (_swig_ret SfVector3f) { 273 | var swig_r SfVector3f 274 | swig_r = (SfVector3f)(SwigcptrSfVector3f(C._wrap_sfListener_getUpVector_audio_781f6cb27eac316e())) 275 | return swig_r 276 | } 277 | 278 | type SwigcptrSfTimeSpan uintptr 279 | 280 | func (p SwigcptrSfTimeSpan) Swigcptr() uintptr { 281 | return (uintptr)(p) 282 | } 283 | 284 | func (p SwigcptrSfTimeSpan) SwigIsSfTimeSpan() { 285 | } 286 | 287 | func (arg1 SwigcptrSfTimeSpan) SetOffset(arg2 SfTime) { 288 | _swig_i_0 := arg1 289 | _swig_i_1 := arg2.Swigcptr() 290 | C._wrap_sfTimeSpan_offset_set_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.uintptr_t(_swig_i_1)) 291 | } 292 | 293 | func (arg1 SwigcptrSfTimeSpan) GetOffset() (_swig_ret SfTime) { 294 | var swig_r SfTime 295 | _swig_i_0 := arg1 296 | swig_r = (SfTime)(SwigcptrSfTime(C._wrap_sfTimeSpan_offset_get_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)))) 297 | return swig_r 298 | } 299 | 300 | func (arg1 SwigcptrSfTimeSpan) SetLength(arg2 SfTime) { 301 | _swig_i_0 := arg1 302 | _swig_i_1 := arg2.Swigcptr() 303 | C._wrap_sfTimeSpan_length_set_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.uintptr_t(_swig_i_1)) 304 | } 305 | 306 | func (arg1 SwigcptrSfTimeSpan) GetLength() (_swig_ret SfTime) { 307 | var swig_r SfTime 308 | _swig_i_0 := arg1 309 | swig_r = (SfTime)(SwigcptrSfTime(C._wrap_sfTimeSpan_length_get_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)))) 310 | return swig_r 311 | } 312 | 313 | func NewSfTimeSpan() (_swig_ret SfTimeSpan) { 314 | var swig_r SfTimeSpan 315 | swig_r = (SfTimeSpan)(SwigcptrSfTimeSpan(C._wrap_new_sfTimeSpan_audio_781f6cb27eac316e())) 316 | return swig_r 317 | } 318 | 319 | func DeleteSfTimeSpan(arg1 SfTimeSpan) { 320 | _swig_i_0 := arg1.Swigcptr() 321 | C._wrap_delete_sfTimeSpan_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 322 | } 323 | 324 | type SfTimeSpan interface { 325 | Swigcptr() uintptr 326 | SwigIsSfTimeSpan() 327 | SetOffset(arg2 SfTime) 328 | GetOffset() (_swig_ret SfTime) 329 | SetLength(arg2 SfTime) 330 | GetLength() (_swig_ret SfTime) 331 | } 332 | 333 | func SfMusic_createFromFile(arg1 string) (_swig_ret Struct_SS_sfMusic) { 334 | var swig_r Struct_SS_sfMusic 335 | _swig_i_0 := arg1 336 | swig_r = (Struct_SS_sfMusic)(SwigcptrStruct_SS_sfMusic(C._wrap_sfMusic_createFromFile_audio_781f6cb27eac316e(*(*C.swig_type_1)(unsafe.Pointer(&_swig_i_0))))) 337 | if Swig_escape_always_false { 338 | Swig_escape_val = arg1 339 | } 340 | return swig_r 341 | } 342 | 343 | func SfMusic_createFromMemory(arg1 uintptr, arg2 int64) (_swig_ret Struct_SS_sfMusic) { 344 | var swig_r Struct_SS_sfMusic 345 | _swig_i_0 := arg1 346 | _swig_i_1 := arg2 347 | swig_r = (Struct_SS_sfMusic)(SwigcptrStruct_SS_sfMusic(C._wrap_sfMusic_createFromMemory_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.swig_type_2(_swig_i_1)))) 348 | return swig_r 349 | } 350 | 351 | func SfMusic_createFromStream(arg1 SfInputStream) (_swig_ret Struct_SS_sfMusic) { 352 | var swig_r Struct_SS_sfMusic 353 | _swig_i_0 := arg1.Swigcptr() 354 | swig_r = (Struct_SS_sfMusic)(SwigcptrStruct_SS_sfMusic(C._wrap_sfMusic_createFromStream_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)))) 355 | return swig_r 356 | } 357 | 358 | func SfMusic_destroy(arg1 Struct_SS_sfMusic) { 359 | _swig_i_0 := arg1.Swigcptr() 360 | C._wrap_sfMusic_destroy_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 361 | } 362 | 363 | func SfMusic_setLoop(arg1 Struct_SS_sfMusic, arg2 int) { 364 | _swig_i_0 := arg1.Swigcptr() 365 | _swig_i_1 := arg2 366 | C._wrap_sfMusic_setLoop_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.swig_intgo(_swig_i_1)) 367 | } 368 | 369 | func SfMusic_getLoop(arg1 Struct_SS_sfMusic) (_swig_ret int) { 370 | var swig_r int 371 | _swig_i_0 := arg1.Swigcptr() 372 | swig_r = (int)(C._wrap_sfMusic_getLoop_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 373 | return swig_r 374 | } 375 | 376 | func SfMusic_getDuration(arg1 Struct_SS_sfMusic) (_swig_ret SfTime) { 377 | var swig_r SfTime 378 | _swig_i_0 := arg1.Swigcptr() 379 | swig_r = (SfTime)(SwigcptrSfTime(C._wrap_sfMusic_getDuration_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)))) 380 | return swig_r 381 | } 382 | 383 | func SfMusic_getLoopPoints(arg1 Struct_SS_sfMusic) (_swig_ret SfTimeSpan) { 384 | var swig_r SfTimeSpan 385 | _swig_i_0 := arg1.Swigcptr() 386 | swig_r = (SfTimeSpan)(SwigcptrSfTimeSpan(C._wrap_sfMusic_getLoopPoints_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)))) 387 | return swig_r 388 | } 389 | 390 | func SfMusic_setLoopPoints(arg1 Struct_SS_sfMusic, arg2 SfTimeSpan) { 391 | _swig_i_0 := arg1.Swigcptr() 392 | _swig_i_1 := arg2.Swigcptr() 393 | C._wrap_sfMusic_setLoopPoints_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.uintptr_t(_swig_i_1)) 394 | } 395 | 396 | func SfMusic_play(arg1 Struct_SS_sfMusic) { 397 | _swig_i_0 := arg1.Swigcptr() 398 | C._wrap_sfMusic_play_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 399 | } 400 | 401 | func SfMusic_pause(arg1 Struct_SS_sfMusic) { 402 | _swig_i_0 := arg1.Swigcptr() 403 | C._wrap_sfMusic_pause_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 404 | } 405 | 406 | func SfMusic_stop(arg1 Struct_SS_sfMusic) { 407 | _swig_i_0 := arg1.Swigcptr() 408 | C._wrap_sfMusic_stop_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 409 | } 410 | 411 | func SfMusic_getChannelCount(arg1 Struct_SS_sfMusic) (_swig_ret uint) { 412 | var swig_r uint 413 | _swig_i_0 := arg1.Swigcptr() 414 | swig_r = (uint)(C._wrap_sfMusic_getChannelCount_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 415 | return swig_r 416 | } 417 | 418 | func SfMusic_getSampleRate(arg1 Struct_SS_sfMusic) (_swig_ret uint) { 419 | var swig_r uint 420 | _swig_i_0 := arg1.Swigcptr() 421 | swig_r = (uint)(C._wrap_sfMusic_getSampleRate_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 422 | return swig_r 423 | } 424 | 425 | func SfMusic_getStatus(arg1 Struct_SS_sfMusic) (_swig_ret SfSoundStatus) { 426 | var swig_r SfSoundStatus 427 | _swig_i_0 := arg1.Swigcptr() 428 | swig_r = (SfSoundStatus)(C._wrap_sfMusic_getStatus_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 429 | return swig_r 430 | } 431 | 432 | func SfMusic_getPlayingOffset(arg1 Struct_SS_sfMusic) (_swig_ret SfTime) { 433 | var swig_r SfTime 434 | _swig_i_0 := arg1.Swigcptr() 435 | swig_r = (SfTime)(SwigcptrSfTime(C._wrap_sfMusic_getPlayingOffset_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)))) 436 | return swig_r 437 | } 438 | 439 | func SfMusic_setPitch(arg1 Struct_SS_sfMusic, arg2 float32) { 440 | _swig_i_0 := arg1.Swigcptr() 441 | _swig_i_1 := arg2 442 | C._wrap_sfMusic_setPitch_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.float(_swig_i_1)) 443 | } 444 | 445 | func SfMusic_setVolume(arg1 Struct_SS_sfMusic, arg2 float32) { 446 | _swig_i_0 := arg1.Swigcptr() 447 | _swig_i_1 := arg2 448 | C._wrap_sfMusic_setVolume_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.float(_swig_i_1)) 449 | } 450 | 451 | func SfMusic_setPosition(arg1 Struct_SS_sfMusic, arg2 SfVector3f) { 452 | _swig_i_0 := arg1.Swigcptr() 453 | _swig_i_1 := arg2.Swigcptr() 454 | C._wrap_sfMusic_setPosition_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.uintptr_t(_swig_i_1)) 455 | } 456 | 457 | func SfMusic_setRelativeToListener(arg1 Struct_SS_sfMusic, arg2 int) { 458 | _swig_i_0 := arg1.Swigcptr() 459 | _swig_i_1 := arg2 460 | C._wrap_sfMusic_setRelativeToListener_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.swig_intgo(_swig_i_1)) 461 | } 462 | 463 | func SfMusic_setMinDistance(arg1 Struct_SS_sfMusic, arg2 float32) { 464 | _swig_i_0 := arg1.Swigcptr() 465 | _swig_i_1 := arg2 466 | C._wrap_sfMusic_setMinDistance_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.float(_swig_i_1)) 467 | } 468 | 469 | func SfMusic_setAttenuation(arg1 Struct_SS_sfMusic, arg2 float32) { 470 | _swig_i_0 := arg1.Swigcptr() 471 | _swig_i_1 := arg2 472 | C._wrap_sfMusic_setAttenuation_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.float(_swig_i_1)) 473 | } 474 | 475 | func SfMusic_setPlayingOffset(arg1 Struct_SS_sfMusic, arg2 SfTime) { 476 | _swig_i_0 := arg1.Swigcptr() 477 | _swig_i_1 := arg2.Swigcptr() 478 | C._wrap_sfMusic_setPlayingOffset_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.uintptr_t(_swig_i_1)) 479 | } 480 | 481 | func SfMusic_getPitch(arg1 Struct_SS_sfMusic) (_swig_ret float32) { 482 | var swig_r float32 483 | _swig_i_0 := arg1.Swigcptr() 484 | swig_r = (float32)(C._wrap_sfMusic_getPitch_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 485 | return swig_r 486 | } 487 | 488 | func SfMusic_getVolume(arg1 Struct_SS_sfMusic) (_swig_ret float32) { 489 | var swig_r float32 490 | _swig_i_0 := arg1.Swigcptr() 491 | swig_r = (float32)(C._wrap_sfMusic_getVolume_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 492 | return swig_r 493 | } 494 | 495 | func SfMusic_getPosition(arg1 Struct_SS_sfMusic) (_swig_ret SfVector3f) { 496 | var swig_r SfVector3f 497 | _swig_i_0 := arg1.Swigcptr() 498 | swig_r = (SfVector3f)(SwigcptrSfVector3f(C._wrap_sfMusic_getPosition_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)))) 499 | return swig_r 500 | } 501 | 502 | func SfMusic_isRelativeToListener(arg1 Struct_SS_sfMusic) (_swig_ret int) { 503 | var swig_r int 504 | _swig_i_0 := arg1.Swigcptr() 505 | swig_r = (int)(C._wrap_sfMusic_isRelativeToListener_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 506 | return swig_r 507 | } 508 | 509 | func SfMusic_getMinDistance(arg1 Struct_SS_sfMusic) (_swig_ret float32) { 510 | var swig_r float32 511 | _swig_i_0 := arg1.Swigcptr() 512 | swig_r = (float32)(C._wrap_sfMusic_getMinDistance_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 513 | return swig_r 514 | } 515 | 516 | func SfMusic_getAttenuation(arg1 Struct_SS_sfMusic) (_swig_ret float32) { 517 | var swig_r float32 518 | _swig_i_0 := arg1.Swigcptr() 519 | swig_r = (float32)(C._wrap_sfMusic_getAttenuation_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 520 | return swig_r 521 | } 522 | 523 | func SfSound_create() (_swig_ret Struct_SS_sfSound) { 524 | var swig_r Struct_SS_sfSound 525 | swig_r = (Struct_SS_sfSound)(SwigcptrStruct_SS_sfSound(C._wrap_sfSound_create_audio_781f6cb27eac316e())) 526 | return swig_r 527 | } 528 | 529 | func SfSound_copy(arg1 Struct_SS_sfSound) (_swig_ret Struct_SS_sfSound) { 530 | var swig_r Struct_SS_sfSound 531 | _swig_i_0 := arg1.Swigcptr() 532 | swig_r = (Struct_SS_sfSound)(SwigcptrStruct_SS_sfSound(C._wrap_sfSound_copy_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)))) 533 | return swig_r 534 | } 535 | 536 | func SfSound_destroy(arg1 Struct_SS_sfSound) { 537 | _swig_i_0 := arg1.Swigcptr() 538 | C._wrap_sfSound_destroy_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 539 | } 540 | 541 | func SfSound_play(arg1 Struct_SS_sfSound) { 542 | _swig_i_0 := arg1.Swigcptr() 543 | C._wrap_sfSound_play_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 544 | } 545 | 546 | func SfSound_pause(arg1 Struct_SS_sfSound) { 547 | _swig_i_0 := arg1.Swigcptr() 548 | C._wrap_sfSound_pause_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 549 | } 550 | 551 | func SfSound_stop(arg1 Struct_SS_sfSound) { 552 | _swig_i_0 := arg1.Swigcptr() 553 | C._wrap_sfSound_stop_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 554 | } 555 | 556 | func SfSound_setBuffer(arg1 Struct_SS_sfSound, arg2 Struct_SS_sfSoundBuffer) { 557 | _swig_i_0 := arg1.Swigcptr() 558 | _swig_i_1 := arg2.Swigcptr() 559 | C._wrap_sfSound_setBuffer_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.uintptr_t(_swig_i_1)) 560 | } 561 | 562 | func SfSound_getBuffer(arg1 Struct_SS_sfSound) (_swig_ret Struct_SS_sfSoundBuffer) { 563 | var swig_r Struct_SS_sfSoundBuffer 564 | _swig_i_0 := arg1.Swigcptr() 565 | swig_r = (Struct_SS_sfSoundBuffer)(SwigcptrStruct_SS_sfSoundBuffer(C._wrap_sfSound_getBuffer_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)))) 566 | return swig_r 567 | } 568 | 569 | func SfSound_setLoop(arg1 Struct_SS_sfSound, arg2 int) { 570 | _swig_i_0 := arg1.Swigcptr() 571 | _swig_i_1 := arg2 572 | C._wrap_sfSound_setLoop_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.swig_intgo(_swig_i_1)) 573 | } 574 | 575 | func SfSound_getLoop(arg1 Struct_SS_sfSound) (_swig_ret int) { 576 | var swig_r int 577 | _swig_i_0 := arg1.Swigcptr() 578 | swig_r = (int)(C._wrap_sfSound_getLoop_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 579 | return swig_r 580 | } 581 | 582 | func SfSound_getStatus(arg1 Struct_SS_sfSound) (_swig_ret SfSoundStatus) { 583 | var swig_r SfSoundStatus 584 | _swig_i_0 := arg1.Swigcptr() 585 | swig_r = (SfSoundStatus)(C._wrap_sfSound_getStatus_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 586 | return swig_r 587 | } 588 | 589 | func SfSound_setPitch(arg1 Struct_SS_sfSound, arg2 float32) { 590 | _swig_i_0 := arg1.Swigcptr() 591 | _swig_i_1 := arg2 592 | C._wrap_sfSound_setPitch_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.float(_swig_i_1)) 593 | } 594 | 595 | func SfSound_setVolume(arg1 Struct_SS_sfSound, arg2 float32) { 596 | _swig_i_0 := arg1.Swigcptr() 597 | _swig_i_1 := arg2 598 | C._wrap_sfSound_setVolume_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.float(_swig_i_1)) 599 | } 600 | 601 | func SfSound_setPosition(arg1 Struct_SS_sfSound, arg2 SfVector3f) { 602 | _swig_i_0 := arg1.Swigcptr() 603 | _swig_i_1 := arg2.Swigcptr() 604 | C._wrap_sfSound_setPosition_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.uintptr_t(_swig_i_1)) 605 | } 606 | 607 | func SfSound_setRelativeToListener(arg1 Struct_SS_sfSound, arg2 int) { 608 | _swig_i_0 := arg1.Swigcptr() 609 | _swig_i_1 := arg2 610 | C._wrap_sfSound_setRelativeToListener_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.swig_intgo(_swig_i_1)) 611 | } 612 | 613 | func SfSound_setMinDistance(arg1 Struct_SS_sfSound, arg2 float32) { 614 | _swig_i_0 := arg1.Swigcptr() 615 | _swig_i_1 := arg2 616 | C._wrap_sfSound_setMinDistance_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.float(_swig_i_1)) 617 | } 618 | 619 | func SfSound_setAttenuation(arg1 Struct_SS_sfSound, arg2 float32) { 620 | _swig_i_0 := arg1.Swigcptr() 621 | _swig_i_1 := arg2 622 | C._wrap_sfSound_setAttenuation_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.float(_swig_i_1)) 623 | } 624 | 625 | func SfSound_setPlayingOffset(arg1 Struct_SS_sfSound, arg2 SfTime) { 626 | _swig_i_0 := arg1.Swigcptr() 627 | _swig_i_1 := arg2.Swigcptr() 628 | C._wrap_sfSound_setPlayingOffset_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.uintptr_t(_swig_i_1)) 629 | } 630 | 631 | func SfSound_getPitch(arg1 Struct_SS_sfSound) (_swig_ret float32) { 632 | var swig_r float32 633 | _swig_i_0 := arg1.Swigcptr() 634 | swig_r = (float32)(C._wrap_sfSound_getPitch_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 635 | return swig_r 636 | } 637 | 638 | func SfSound_getVolume(arg1 Struct_SS_sfSound) (_swig_ret float32) { 639 | var swig_r float32 640 | _swig_i_0 := arg1.Swigcptr() 641 | swig_r = (float32)(C._wrap_sfSound_getVolume_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 642 | return swig_r 643 | } 644 | 645 | func SfSound_getPosition(arg1 Struct_SS_sfSound) (_swig_ret SfVector3f) { 646 | var swig_r SfVector3f 647 | _swig_i_0 := arg1.Swigcptr() 648 | swig_r = (SfVector3f)(SwigcptrSfVector3f(C._wrap_sfSound_getPosition_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)))) 649 | return swig_r 650 | } 651 | 652 | func SfSound_isRelativeToListener(arg1 Struct_SS_sfSound) (_swig_ret int) { 653 | var swig_r int 654 | _swig_i_0 := arg1.Swigcptr() 655 | swig_r = (int)(C._wrap_sfSound_isRelativeToListener_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 656 | return swig_r 657 | } 658 | 659 | func SfSound_getMinDistance(arg1 Struct_SS_sfSound) (_swig_ret float32) { 660 | var swig_r float32 661 | _swig_i_0 := arg1.Swigcptr() 662 | swig_r = (float32)(C._wrap_sfSound_getMinDistance_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 663 | return swig_r 664 | } 665 | 666 | func SfSound_getAttenuation(arg1 Struct_SS_sfSound) (_swig_ret float32) { 667 | var swig_r float32 668 | _swig_i_0 := arg1.Swigcptr() 669 | swig_r = (float32)(C._wrap_sfSound_getAttenuation_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 670 | return swig_r 671 | } 672 | 673 | func SfSound_getPlayingOffset(arg1 Struct_SS_sfSound) (_swig_ret SfTime) { 674 | var swig_r SfTime 675 | _swig_i_0 := arg1.Swigcptr() 676 | swig_r = (SfTime)(SwigcptrSfTime(C._wrap_sfSound_getPlayingOffset_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)))) 677 | return swig_r 678 | } 679 | 680 | func SfSoundBuffer_createFromFile(arg1 string) (_swig_ret Struct_SS_sfSoundBuffer) { 681 | var swig_r Struct_SS_sfSoundBuffer 682 | _swig_i_0 := arg1 683 | swig_r = (Struct_SS_sfSoundBuffer)(SwigcptrStruct_SS_sfSoundBuffer(C._wrap_sfSoundBuffer_createFromFile_audio_781f6cb27eac316e(*(*C.swig_type_3)(unsafe.Pointer(&_swig_i_0))))) 684 | if Swig_escape_always_false { 685 | Swig_escape_val = arg1 686 | } 687 | return swig_r 688 | } 689 | 690 | func SfSoundBuffer_createFromMemory(arg1 uintptr, arg2 int64) (_swig_ret Struct_SS_sfSoundBuffer) { 691 | var swig_r Struct_SS_sfSoundBuffer 692 | _swig_i_0 := arg1 693 | _swig_i_1 := arg2 694 | swig_r = (Struct_SS_sfSoundBuffer)(SwigcptrStruct_SS_sfSoundBuffer(C._wrap_sfSoundBuffer_createFromMemory_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.swig_type_4(_swig_i_1)))) 695 | return swig_r 696 | } 697 | 698 | func SfSoundBuffer_createFromStream(arg1 SfInputStream) (_swig_ret Struct_SS_sfSoundBuffer) { 699 | var swig_r Struct_SS_sfSoundBuffer 700 | _swig_i_0 := arg1.Swigcptr() 701 | swig_r = (Struct_SS_sfSoundBuffer)(SwigcptrStruct_SS_sfSoundBuffer(C._wrap_sfSoundBuffer_createFromStream_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)))) 702 | return swig_r 703 | } 704 | 705 | func SfSoundBuffer_createFromSamples(arg1 *int16, arg2 uint64, arg3 uint, arg4 uint) (_swig_ret Struct_SS_sfSoundBuffer) { 706 | var swig_r Struct_SS_sfSoundBuffer 707 | _swig_i_0 := arg1 708 | _swig_i_1 := arg2 709 | _swig_i_2 := arg3 710 | _swig_i_3 := arg4 711 | swig_r = (Struct_SS_sfSoundBuffer)(SwigcptrStruct_SS_sfSoundBuffer(C._wrap_sfSoundBuffer_createFromSamples_audio_781f6cb27eac316e(C.swig_voidp(_swig_i_0), C.swig_type_5(_swig_i_1), C.swig_intgo(_swig_i_2), C.swig_intgo(_swig_i_3)))) 712 | return swig_r 713 | } 714 | 715 | func SfSoundBuffer_copy(arg1 Struct_SS_sfSoundBuffer) (_swig_ret Struct_SS_sfSoundBuffer) { 716 | var swig_r Struct_SS_sfSoundBuffer 717 | _swig_i_0 := arg1.Swigcptr() 718 | swig_r = (Struct_SS_sfSoundBuffer)(SwigcptrStruct_SS_sfSoundBuffer(C._wrap_sfSoundBuffer_copy_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)))) 719 | return swig_r 720 | } 721 | 722 | func SfSoundBuffer_destroy(arg1 Struct_SS_sfSoundBuffer) { 723 | _swig_i_0 := arg1.Swigcptr() 724 | C._wrap_sfSoundBuffer_destroy_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 725 | } 726 | 727 | func SfSoundBuffer_saveToFile(arg1 Struct_SS_sfSoundBuffer, arg2 string) (_swig_ret int) { 728 | var swig_r int 729 | _swig_i_0 := arg1.Swigcptr() 730 | _swig_i_1 := arg2 731 | swig_r = (int)(C._wrap_sfSoundBuffer_saveToFile_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), *(*C.swig_type_6)(unsafe.Pointer(&_swig_i_1)))) 732 | if Swig_escape_always_false { 733 | Swig_escape_val = arg2 734 | } 735 | return swig_r 736 | } 737 | 738 | func SfSoundBuffer_getSamples(arg1 Struct_SS_sfSoundBuffer) (_swig_ret *int16) { 739 | var swig_r *int16 740 | _swig_i_0 := arg1.Swigcptr() 741 | swig_r = (*int16)(C._wrap_sfSoundBuffer_getSamples_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 742 | return swig_r 743 | } 744 | 745 | func SfSoundBuffer_getSampleCount(arg1 Struct_SS_sfSoundBuffer) (_swig_ret uint64) { 746 | var swig_r uint64 747 | _swig_i_0 := arg1.Swigcptr() 748 | swig_r = (uint64)(C._wrap_sfSoundBuffer_getSampleCount_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 749 | return swig_r 750 | } 751 | 752 | func SfSoundBuffer_getSampleRate(arg1 Struct_SS_sfSoundBuffer) (_swig_ret uint) { 753 | var swig_r uint 754 | _swig_i_0 := arg1.Swigcptr() 755 | swig_r = (uint)(C._wrap_sfSoundBuffer_getSampleRate_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 756 | return swig_r 757 | } 758 | 759 | func SfSoundBuffer_getChannelCount(arg1 Struct_SS_sfSoundBuffer) (_swig_ret uint) { 760 | var swig_r uint 761 | _swig_i_0 := arg1.Swigcptr() 762 | swig_r = (uint)(C._wrap_sfSoundBuffer_getChannelCount_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 763 | return swig_r 764 | } 765 | 766 | func SfSoundBuffer_getDuration(arg1 Struct_SS_sfSoundBuffer) (_swig_ret SfTime) { 767 | var swig_r SfTime 768 | _swig_i_0 := arg1.Swigcptr() 769 | swig_r = (SfTime)(SwigcptrSfTime(C._wrap_sfSoundBuffer_getDuration_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)))) 770 | return swig_r 771 | } 772 | 773 | func SfSoundBufferRecorder_create() (_swig_ret Struct_SS_sfSoundBufferRecorder) { 774 | var swig_r Struct_SS_sfSoundBufferRecorder 775 | swig_r = (Struct_SS_sfSoundBufferRecorder)(SwigcptrStruct_SS_sfSoundBufferRecorder(C._wrap_sfSoundBufferRecorder_create_audio_781f6cb27eac316e())) 776 | return swig_r 777 | } 778 | 779 | func SfSoundBufferRecorder_destroy(arg1 Struct_SS_sfSoundBufferRecorder) { 780 | _swig_i_0 := arg1.Swigcptr() 781 | C._wrap_sfSoundBufferRecorder_destroy_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 782 | } 783 | 784 | func SfSoundBufferRecorder_start(arg1 Struct_SS_sfSoundBufferRecorder, arg2 uint) (_swig_ret int) { 785 | var swig_r int 786 | _swig_i_0 := arg1.Swigcptr() 787 | _swig_i_1 := arg2 788 | swig_r = (int)(C._wrap_sfSoundBufferRecorder_start_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.swig_intgo(_swig_i_1))) 789 | return swig_r 790 | } 791 | 792 | func SfSoundBufferRecorder_stop(arg1 Struct_SS_sfSoundBufferRecorder) { 793 | _swig_i_0 := arg1.Swigcptr() 794 | C._wrap_sfSoundBufferRecorder_stop_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 795 | } 796 | 797 | func SfSoundBufferRecorder_getSampleRate(arg1 Struct_SS_sfSoundBufferRecorder) (_swig_ret uint) { 798 | var swig_r uint 799 | _swig_i_0 := arg1.Swigcptr() 800 | swig_r = (uint)(C._wrap_sfSoundBufferRecorder_getSampleRate_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 801 | return swig_r 802 | } 803 | 804 | func SfSoundBufferRecorder_getBuffer(arg1 Struct_SS_sfSoundBufferRecorder) (_swig_ret Struct_SS_sfSoundBuffer) { 805 | var swig_r Struct_SS_sfSoundBuffer 806 | _swig_i_0 := arg1.Swigcptr() 807 | swig_r = (Struct_SS_sfSoundBuffer)(SwigcptrStruct_SS_sfSoundBuffer(C._wrap_sfSoundBufferRecorder_getBuffer_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)))) 808 | return swig_r 809 | } 810 | 811 | func SfSoundBufferRecorder_setDevice(arg1 Struct_SS_sfSoundBufferRecorder, arg2 string) (_swig_ret int) { 812 | var swig_r int 813 | _swig_i_0 := arg1.Swigcptr() 814 | _swig_i_1 := arg2 815 | swig_r = (int)(C._wrap_sfSoundBufferRecorder_setDevice_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), *(*C.swig_type_8)(unsafe.Pointer(&_swig_i_1)))) 816 | if Swig_escape_always_false { 817 | Swig_escape_val = arg2 818 | } 819 | return swig_r 820 | } 821 | 822 | func SfSoundBufferRecorder_getDevice(arg1 Struct_SS_sfSoundBufferRecorder) (_swig_ret string) { 823 | var swig_r string 824 | _swig_i_0 := arg1.Swigcptr() 825 | swig_r_p := C._wrap_sfSoundBufferRecorder_getDevice_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 826 | swig_r = *(*string)(unsafe.Pointer(&swig_r_p)) 827 | var swig_r_1 string 828 | swig_r_1 = swigCopyString(swig_r) 829 | return swig_r_1 830 | } 831 | 832 | func SfSoundRecorder_create(arg1 _swig_fnptr, arg2 _swig_fnptr, arg3 _swig_fnptr, arg4 uintptr) (_swig_ret Struct_SS_sfSoundRecorder) { 833 | var swig_r Struct_SS_sfSoundRecorder 834 | _swig_i_0 := arg1 835 | _swig_i_1 := arg2 836 | _swig_i_2 := arg3 837 | _swig_i_3 := arg4 838 | swig_r = (Struct_SS_sfSoundRecorder)(SwigcptrStruct_SS_sfSoundRecorder(C._wrap_sfSoundRecorder_create_audio_781f6cb27eac316e(C.swig_type_10(_swig_i_0), C.swig_type_11(_swig_i_1), C.swig_type_12(_swig_i_2), C.uintptr_t(_swig_i_3)))) 839 | return swig_r 840 | } 841 | 842 | func SfSoundRecorder_destroy(arg1 Struct_SS_sfSoundRecorder) { 843 | _swig_i_0 := arg1.Swigcptr() 844 | C._wrap_sfSoundRecorder_destroy_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 845 | } 846 | 847 | func SfSoundRecorder_start(arg1 Struct_SS_sfSoundRecorder, arg2 uint) (_swig_ret int) { 848 | var swig_r int 849 | _swig_i_0 := arg1.Swigcptr() 850 | _swig_i_1 := arg2 851 | swig_r = (int)(C._wrap_sfSoundRecorder_start_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.swig_intgo(_swig_i_1))) 852 | return swig_r 853 | } 854 | 855 | func SfSoundRecorder_stop(arg1 Struct_SS_sfSoundRecorder) { 856 | _swig_i_0 := arg1.Swigcptr() 857 | C._wrap_sfSoundRecorder_stop_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 858 | } 859 | 860 | func SfSoundRecorder_getSampleRate(arg1 Struct_SS_sfSoundRecorder) (_swig_ret uint) { 861 | var swig_r uint 862 | _swig_i_0 := arg1.Swigcptr() 863 | swig_r = (uint)(C._wrap_sfSoundRecorder_getSampleRate_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 864 | return swig_r 865 | } 866 | 867 | func SfSoundRecorder_isAvailable() (_swig_ret int) { 868 | var swig_r int 869 | swig_r = (int)(C._wrap_sfSoundRecorder_isAvailable_audio_781f6cb27eac316e()) 870 | return swig_r 871 | } 872 | 873 | func SfSoundRecorder_setProcessingInterval(arg1 Struct_SS_sfSoundRecorder, arg2 SfTime) { 874 | _swig_i_0 := arg1.Swigcptr() 875 | _swig_i_1 := arg2.Swigcptr() 876 | C._wrap_sfSoundRecorder_setProcessingInterval_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.uintptr_t(_swig_i_1)) 877 | } 878 | 879 | func SfSoundRecorder_getAvailableDevices(arg1 *int64) (_swig_ret *string) { 880 | var swig_r *string 881 | _swig_i_0 := arg1 882 | swig_r = (*string)(C._wrap_sfSoundRecorder_getAvailableDevices_audio_781f6cb27eac316e(C.swig_voidp(_swig_i_0))) 883 | return swig_r 884 | } 885 | 886 | func SfSoundRecorder_getDefaultDevice() (_swig_ret string) { 887 | var swig_r string 888 | swig_r_p := C._wrap_sfSoundRecorder_getDefaultDevice_audio_781f6cb27eac316e() 889 | swig_r = *(*string)(unsafe.Pointer(&swig_r_p)) 890 | var swig_r_1 string 891 | swig_r_1 = swigCopyString(swig_r) 892 | return swig_r_1 893 | } 894 | 895 | func SfSoundRecorder_setDevice(arg1 Struct_SS_sfSoundRecorder, arg2 string) (_swig_ret int) { 896 | var swig_r int 897 | _swig_i_0 := arg1.Swigcptr() 898 | _swig_i_1 := arg2 899 | swig_r = (int)(C._wrap_sfSoundRecorder_setDevice_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), *(*C.swig_type_14)(unsafe.Pointer(&_swig_i_1)))) 900 | if Swig_escape_always_false { 901 | Swig_escape_val = arg2 902 | } 903 | return swig_r 904 | } 905 | 906 | func SfSoundRecorder_getDevice(arg1 Struct_SS_sfSoundRecorder) (_swig_ret string) { 907 | var swig_r string 908 | _swig_i_0 := arg1.Swigcptr() 909 | swig_r_p := C._wrap_sfSoundRecorder_getDevice_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 910 | swig_r = *(*string)(unsafe.Pointer(&swig_r_p)) 911 | var swig_r_1 string 912 | swig_r_1 = swigCopyString(swig_r) 913 | return swig_r_1 914 | } 915 | 916 | func SfSoundRecorder_setChannelCount(arg1 Struct_SS_sfSoundRecorder, arg2 uint) { 917 | _swig_i_0 := arg1.Swigcptr() 918 | _swig_i_1 := arg2 919 | C._wrap_sfSoundRecorder_setChannelCount_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.swig_intgo(_swig_i_1)) 920 | } 921 | 922 | func SfSoundRecorder_getChannelCount(arg1 Struct_SS_sfSoundRecorder) (_swig_ret uint) { 923 | var swig_r uint 924 | _swig_i_0 := arg1.Swigcptr() 925 | swig_r = (uint)(C._wrap_sfSoundRecorder_getChannelCount_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 926 | return swig_r 927 | } 928 | 929 | type SfSoundStatus int 930 | func _swig_getsfStopped() (_swig_ret int) { 931 | var swig_r int 932 | swig_r = (int)(C._wrap_sfStopped_audio_781f6cb27eac316e()) 933 | return swig_r 934 | } 935 | 936 | var SfStopped int = _swig_getsfStopped() 937 | func _swig_getsfPaused() (_swig_ret int) { 938 | var swig_r int 939 | swig_r = (int)(C._wrap_sfPaused_audio_781f6cb27eac316e()) 940 | return swig_r 941 | } 942 | 943 | var SfPaused int = _swig_getsfPaused() 944 | func _swig_getsfPlaying() (_swig_ret int) { 945 | var swig_r int 946 | swig_r = (int)(C._wrap_sfPlaying_audio_781f6cb27eac316e()) 947 | return swig_r 948 | } 949 | 950 | var SfPlaying int = _swig_getsfPlaying() 951 | type SwigcptrSfSoundStreamChunk uintptr 952 | 953 | func (p SwigcptrSfSoundStreamChunk) Swigcptr() uintptr { 954 | return (uintptr)(p) 955 | } 956 | 957 | func (p SwigcptrSfSoundStreamChunk) SwigIsSfSoundStreamChunk() { 958 | } 959 | 960 | func (arg1 SwigcptrSfSoundStreamChunk) SetSamples(arg2 *int16) { 961 | _swig_i_0 := arg1 962 | _swig_i_1 := arg2 963 | C._wrap_sfSoundStreamChunk_samples_set_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.swig_voidp(_swig_i_1)) 964 | } 965 | 966 | func (arg1 SwigcptrSfSoundStreamChunk) GetSamples() (_swig_ret *int16) { 967 | var swig_r *int16 968 | _swig_i_0 := arg1 969 | swig_r = (*int16)(C._wrap_sfSoundStreamChunk_samples_get_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 970 | return swig_r 971 | } 972 | 973 | func (arg1 SwigcptrSfSoundStreamChunk) SetSampleCount(arg2 uint) { 974 | _swig_i_0 := arg1 975 | _swig_i_1 := arg2 976 | C._wrap_sfSoundStreamChunk_sampleCount_set_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.swig_intgo(_swig_i_1)) 977 | } 978 | 979 | func (arg1 SwigcptrSfSoundStreamChunk) GetSampleCount() (_swig_ret uint) { 980 | var swig_r uint 981 | _swig_i_0 := arg1 982 | swig_r = (uint)(C._wrap_sfSoundStreamChunk_sampleCount_get_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 983 | return swig_r 984 | } 985 | 986 | func NewSfSoundStreamChunk() (_swig_ret SfSoundStreamChunk) { 987 | var swig_r SfSoundStreamChunk 988 | swig_r = (SfSoundStreamChunk)(SwigcptrSfSoundStreamChunk(C._wrap_new_sfSoundStreamChunk_audio_781f6cb27eac316e())) 989 | return swig_r 990 | } 991 | 992 | func DeleteSfSoundStreamChunk(arg1 SfSoundStreamChunk) { 993 | _swig_i_0 := arg1.Swigcptr() 994 | C._wrap_delete_sfSoundStreamChunk_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 995 | } 996 | 997 | type SfSoundStreamChunk interface { 998 | Swigcptr() uintptr 999 | SwigIsSfSoundStreamChunk() 1000 | SetSamples(arg2 *int16) 1001 | GetSamples() (_swig_ret *int16) 1002 | SetSampleCount(arg2 uint) 1003 | GetSampleCount() (_swig_ret uint) 1004 | } 1005 | 1006 | func SfSoundStream_create(arg1 _swig_fnptr, arg2 _swig_fnptr, arg3 uint, arg4 uint, arg5 uintptr) (_swig_ret Struct_SS_sfSoundStream) { 1007 | var swig_r Struct_SS_sfSoundStream 1008 | _swig_i_0 := arg1 1009 | _swig_i_1 := arg2 1010 | _swig_i_2 := arg3 1011 | _swig_i_3 := arg4 1012 | _swig_i_4 := arg5 1013 | swig_r = (Struct_SS_sfSoundStream)(SwigcptrStruct_SS_sfSoundStream(C._wrap_sfSoundStream_create_audio_781f6cb27eac316e(C.swig_type_16(_swig_i_0), C.swig_type_17(_swig_i_1), C.swig_intgo(_swig_i_2), C.swig_intgo(_swig_i_3), C.uintptr_t(_swig_i_4)))) 1014 | return swig_r 1015 | } 1016 | 1017 | func SfSoundStream_destroy(arg1 Struct_SS_sfSoundStream) { 1018 | _swig_i_0 := arg1.Swigcptr() 1019 | C._wrap_sfSoundStream_destroy_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 1020 | } 1021 | 1022 | func SfSoundStream_play(arg1 Struct_SS_sfSoundStream) { 1023 | _swig_i_0 := arg1.Swigcptr() 1024 | C._wrap_sfSoundStream_play_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 1025 | } 1026 | 1027 | func SfSoundStream_pause(arg1 Struct_SS_sfSoundStream) { 1028 | _swig_i_0 := arg1.Swigcptr() 1029 | C._wrap_sfSoundStream_pause_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 1030 | } 1031 | 1032 | func SfSoundStream_stop(arg1 Struct_SS_sfSoundStream) { 1033 | _swig_i_0 := arg1.Swigcptr() 1034 | C._wrap_sfSoundStream_stop_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)) 1035 | } 1036 | 1037 | func SfSoundStream_getStatus(arg1 Struct_SS_sfSoundStream) (_swig_ret SfSoundStatus) { 1038 | var swig_r SfSoundStatus 1039 | _swig_i_0 := arg1.Swigcptr() 1040 | swig_r = (SfSoundStatus)(C._wrap_sfSoundStream_getStatus_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 1041 | return swig_r 1042 | } 1043 | 1044 | func SfSoundStream_getChannelCount(arg1 Struct_SS_sfSoundStream) (_swig_ret uint) { 1045 | var swig_r uint 1046 | _swig_i_0 := arg1.Swigcptr() 1047 | swig_r = (uint)(C._wrap_sfSoundStream_getChannelCount_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 1048 | return swig_r 1049 | } 1050 | 1051 | func SfSoundStream_getSampleRate(arg1 Struct_SS_sfSoundStream) (_swig_ret uint) { 1052 | var swig_r uint 1053 | _swig_i_0 := arg1.Swigcptr() 1054 | swig_r = (uint)(C._wrap_sfSoundStream_getSampleRate_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 1055 | return swig_r 1056 | } 1057 | 1058 | func SfSoundStream_setPitch(arg1 Struct_SS_sfSoundStream, arg2 float32) { 1059 | _swig_i_0 := arg1.Swigcptr() 1060 | _swig_i_1 := arg2 1061 | C._wrap_sfSoundStream_setPitch_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.float(_swig_i_1)) 1062 | } 1063 | 1064 | func SfSoundStream_setVolume(arg1 Struct_SS_sfSoundStream, arg2 float32) { 1065 | _swig_i_0 := arg1.Swigcptr() 1066 | _swig_i_1 := arg2 1067 | C._wrap_sfSoundStream_setVolume_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.float(_swig_i_1)) 1068 | } 1069 | 1070 | func SfSoundStream_setPosition(arg1 Struct_SS_sfSoundStream, arg2 SfVector3f) { 1071 | _swig_i_0 := arg1.Swigcptr() 1072 | _swig_i_1 := arg2.Swigcptr() 1073 | C._wrap_sfSoundStream_setPosition_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.uintptr_t(_swig_i_1)) 1074 | } 1075 | 1076 | func SfSoundStream_setRelativeToListener(arg1 Struct_SS_sfSoundStream, arg2 int) { 1077 | _swig_i_0 := arg1.Swigcptr() 1078 | _swig_i_1 := arg2 1079 | C._wrap_sfSoundStream_setRelativeToListener_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.swig_intgo(_swig_i_1)) 1080 | } 1081 | 1082 | func SfSoundStream_setMinDistance(arg1 Struct_SS_sfSoundStream, arg2 float32) { 1083 | _swig_i_0 := arg1.Swigcptr() 1084 | _swig_i_1 := arg2 1085 | C._wrap_sfSoundStream_setMinDistance_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.float(_swig_i_1)) 1086 | } 1087 | 1088 | func SfSoundStream_setAttenuation(arg1 Struct_SS_sfSoundStream, arg2 float32) { 1089 | _swig_i_0 := arg1.Swigcptr() 1090 | _swig_i_1 := arg2 1091 | C._wrap_sfSoundStream_setAttenuation_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.float(_swig_i_1)) 1092 | } 1093 | 1094 | func SfSoundStream_setPlayingOffset(arg1 Struct_SS_sfSoundStream, arg2 SfTime) { 1095 | _swig_i_0 := arg1.Swigcptr() 1096 | _swig_i_1 := arg2.Swigcptr() 1097 | C._wrap_sfSoundStream_setPlayingOffset_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.uintptr_t(_swig_i_1)) 1098 | } 1099 | 1100 | func SfSoundStream_setLoop(arg1 Struct_SS_sfSoundStream, arg2 int) { 1101 | _swig_i_0 := arg1.Swigcptr() 1102 | _swig_i_1 := arg2 1103 | C._wrap_sfSoundStream_setLoop_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0), C.swig_intgo(_swig_i_1)) 1104 | } 1105 | 1106 | func SfSoundStream_getPitch(arg1 Struct_SS_sfSoundStream) (_swig_ret float32) { 1107 | var swig_r float32 1108 | _swig_i_0 := arg1.Swigcptr() 1109 | swig_r = (float32)(C._wrap_sfSoundStream_getPitch_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 1110 | return swig_r 1111 | } 1112 | 1113 | func SfSoundStream_getVolume(arg1 Struct_SS_sfSoundStream) (_swig_ret float32) { 1114 | var swig_r float32 1115 | _swig_i_0 := arg1.Swigcptr() 1116 | swig_r = (float32)(C._wrap_sfSoundStream_getVolume_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 1117 | return swig_r 1118 | } 1119 | 1120 | func SfSoundStream_getPosition(arg1 Struct_SS_sfSoundStream) (_swig_ret SfVector3f) { 1121 | var swig_r SfVector3f 1122 | _swig_i_0 := arg1.Swigcptr() 1123 | swig_r = (SfVector3f)(SwigcptrSfVector3f(C._wrap_sfSoundStream_getPosition_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)))) 1124 | return swig_r 1125 | } 1126 | 1127 | func SfSoundStream_isRelativeToListener(arg1 Struct_SS_sfSoundStream) (_swig_ret int) { 1128 | var swig_r int 1129 | _swig_i_0 := arg1.Swigcptr() 1130 | swig_r = (int)(C._wrap_sfSoundStream_isRelativeToListener_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 1131 | return swig_r 1132 | } 1133 | 1134 | func SfSoundStream_getMinDistance(arg1 Struct_SS_sfSoundStream) (_swig_ret float32) { 1135 | var swig_r float32 1136 | _swig_i_0 := arg1.Swigcptr() 1137 | swig_r = (float32)(C._wrap_sfSoundStream_getMinDistance_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 1138 | return swig_r 1139 | } 1140 | 1141 | func SfSoundStream_getAttenuation(arg1 Struct_SS_sfSoundStream) (_swig_ret float32) { 1142 | var swig_r float32 1143 | _swig_i_0 := arg1.Swigcptr() 1144 | swig_r = (float32)(C._wrap_sfSoundStream_getAttenuation_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 1145 | return swig_r 1146 | } 1147 | 1148 | func SfSoundStream_getLoop(arg1 Struct_SS_sfSoundStream) (_swig_ret int) { 1149 | var swig_r int 1150 | _swig_i_0 := arg1.Swigcptr() 1151 | swig_r = (int)(C._wrap_sfSoundStream_getLoop_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0))) 1152 | return swig_r 1153 | } 1154 | 1155 | func SfSoundStream_getPlayingOffset(arg1 Struct_SS_sfSoundStream) (_swig_ret SfTime) { 1156 | var swig_r SfTime 1157 | _swig_i_0 := arg1.Swigcptr() 1158 | swig_r = (SfTime)(SwigcptrSfTime(C._wrap_sfSoundStream_getPlayingOffset_audio_781f6cb27eac316e(C.uintptr_t(_swig_i_0)))) 1159 | return swig_r 1160 | } 1161 | 1162 | 1163 | type SwigcptrStruct_SS_sfSoundBuffer uintptr 1164 | type Struct_SS_sfSoundBuffer interface { 1165 | Swigcptr() uintptr; 1166 | } 1167 | func (p SwigcptrStruct_SS_sfSoundBuffer) Swigcptr() uintptr { 1168 | return uintptr(p) 1169 | } 1170 | 1171 | type SwigcptrStruct_SS_sfSoundBufferRecorder uintptr 1172 | type Struct_SS_sfSoundBufferRecorder interface { 1173 | Swigcptr() uintptr; 1174 | } 1175 | func (p SwigcptrStruct_SS_sfSoundBufferRecorder) Swigcptr() uintptr { 1176 | return uintptr(p) 1177 | } 1178 | 1179 | type SwigcptrStruct_SS_sfSoundRecorder uintptr 1180 | type Struct_SS_sfSoundRecorder interface { 1181 | Swigcptr() uintptr; 1182 | } 1183 | func (p SwigcptrStruct_SS_sfSoundRecorder) Swigcptr() uintptr { 1184 | return uintptr(p) 1185 | } 1186 | 1187 | type SwigcptrSfVector3f uintptr 1188 | type SfVector3f interface { 1189 | Swigcptr() uintptr; 1190 | } 1191 | func (p SwigcptrSfVector3f) Swigcptr() uintptr { 1192 | return uintptr(p) 1193 | } 1194 | 1195 | type SwigcptrStruct_SS_sfMusic uintptr 1196 | type Struct_SS_sfMusic interface { 1197 | Swigcptr() uintptr; 1198 | } 1199 | func (p SwigcptrStruct_SS_sfMusic) Swigcptr() uintptr { 1200 | return uintptr(p) 1201 | } 1202 | 1203 | type SwigcptrSfTime uintptr 1204 | type SfTime interface { 1205 | Swigcptr() uintptr; 1206 | } 1207 | func (p SwigcptrSfTime) Swigcptr() uintptr { 1208 | return uintptr(p) 1209 | } 1210 | 1211 | type SwigcptrStruct_SS_sfSound uintptr 1212 | type Struct_SS_sfSound interface { 1213 | Swigcptr() uintptr; 1214 | } 1215 | func (p SwigcptrStruct_SS_sfSound) Swigcptr() uintptr { 1216 | return uintptr(p) 1217 | } 1218 | 1219 | type SwigcptrSfInputStream uintptr 1220 | type SfInputStream interface { 1221 | Swigcptr() uintptr; 1222 | } 1223 | func (p SwigcptrSfInputStream) Swigcptr() uintptr { 1224 | return uintptr(p) 1225 | } 1226 | 1227 | type SwigcptrStruct_SS_sfSoundStream uintptr 1228 | type Struct_SS_sfSoundStream interface { 1229 | Swigcptr() uintptr; 1230 | } 1231 | func (p SwigcptrStruct_SS_sfSoundStream) Swigcptr() uintptr { 1232 | return uintptr(p) 1233 | } 1234 | 1235 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ## [Requires 'sfml.sh' & 'swig.sh' to have been run successfully] 4 | ## Builds the cgo bindings and install the final go packages 5 | 6 | set -e 7 | 8 | SFML="SFML" 9 | CSFML="CSFML" 10 | SFML_MODULES=(Audio Graphics System Window) 11 | 12 | for m in "${SFML_MODULES[@]}"; do 13 | mm=$(echo $m | tr '[:upper:]' '[:lower:]') 14 | 15 | echo -n "Fixing missing library links to SFML..." 16 | patchelf --set-rpath "$PWD/$SFML/lib" "$CSFML/lib/libcsfml-$mm.so" 17 | echo " OK." 18 | 19 | mkdir -p "$PWD/$mm" 20 | 21 | echo -n "building bindings for SFML's $m module..." 22 | cp "$PWD/interfaces/$m.i" "$PWD/$CSFML/include/$SFML/$m/$m.i" 23 | swig -go -cgo -intgosize 64 -I"$PWD/$CSFML/include" "$PWD/$CSFML/include/$SFML/$m/$m.i" 24 | cp "$PWD/$CSFML/include/$SFML/$m/$mm.go" "$PWD/$CSFML/include/$SFML/$m/${m}_wrap.c" "$PWD/$mm" 25 | sed -i "/import \"C\"/i \/\/ #cgo LDFLAGS: -lcsfml-$mm" "$PWD/$m/$mm.go" 26 | echo " OK." 27 | 28 | echo -n "compiling go package for SFML's $m module..." 29 | GO111MODULE=off CGO_LDFLAGS="-L$PWD/CSFML/lib -lcsfml-$mm" CGO_CFLAGS="-I$PWD/$CSFML/include" go install "./$mm" 30 | echo " OK." 31 | done 32 | 33 | echo "Build completed." -------------------------------------------------------------------------------- /examples/basic_window/README.md: -------------------------------------------------------------------------------- 1 | # Basic window example 2 | 3 | 1. Open `build.bat` script and update its `CSFML_PATH` variable to match the path of your CSFML installation 4 | 2. Run the `build.bat` script 5 | 3. Run `basic_window.exe`, the following result should appear! 6 | 7 | ![image](https://user-images.githubusercontent.com/19146183/182536297-c974050f-28df-4658-b8cb-51e4d89d610c.png) 8 | 9 | If you're having issues building & running this example, please read the [general README](https://github.com/Telroshan/go-sfml#usage), and feel free to open an issue if your problem is not listed in here. -------------------------------------------------------------------------------- /examples/basic_window/build.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | rem This script sets the environment variables to be able to build the app, and copies the CSFML DLLs over if there aren't any in the folder 4 | 5 | rem Edit the CSFML_PATH variable to match the path of your CSFML installation 6 | set CSFML_PATH=C:\CSFML_2.5.1 7 | rem Edit the COMPILER_NAME variable if you're not using gcc 8 | set COMPILER_NAME=gcc 9 | 10 | set CGO_CFLAGS="-I%CSFML_PATH%\include" 11 | set CGO_LDFLAGS="-L%CSFML_PATH%\lib\%COMPILER_NAME%" 12 | 13 | go get 14 | if %ERRORLEVEL% NEQ 0 (echo go get failed && exit /b %ERRORLEVEL%) 15 | 16 | go build 17 | if %ERRORLEVEL% NEQ 0 (echo go build failed && exit /b %ERRORLEVEL%) 18 | 19 | echo Build complete 20 | 21 | if not exist "%~dp0*.dll" ( 22 | echo No DLLs in folder, getting them from CSFML folder 23 | xcopy /s "%CSFML_PATH%\bin" "%~dp0" 24 | if %ERRORLEVEL% NEQ 0 (echo failed to copy DLLs && exit /b %ERRORLEVEL%) 25 | ) -------------------------------------------------------------------------------- /examples/basic_window/go.mod: -------------------------------------------------------------------------------- 1 | module basic_window 2 | 3 | go 1.18 4 | -------------------------------------------------------------------------------- /examples/basic_window/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "runtime" 5 | 6 | "github.com/telroshan/go-sfml/v2/graphics" 7 | "github.com/telroshan/go-sfml/v2/window" 8 | ) 9 | 10 | func init() { runtime.LockOSThread() } 11 | 12 | func main() { 13 | vm := window.NewSfVideoMode() 14 | defer window.DeleteSfVideoMode(vm) 15 | vm.SetWidth(800) 16 | vm.SetHeight(600) 17 | vm.SetBitsPerPixel(32) 18 | 19 | /* Create the main window */ 20 | cs := window.NewSfContextSettings() 21 | defer window.DeleteSfContextSettings(cs) 22 | w := graphics.SfRenderWindow_create(vm, "SFML window", uint(window.SfResize|window.SfClose), cs) 23 | defer window.SfWindow_destroy(w) 24 | 25 | ev := window.NewSfEvent() 26 | defer window.DeleteSfEvent(ev) 27 | 28 | /* Start the game loop */ 29 | for window.SfWindow_isOpen(w) > 0 { 30 | /* Process events */ 31 | for window.SfWindow_pollEvent(w, ev) > 0 { 32 | /* Close window: exit */ 33 | if ev.GetEvType() == window.SfEventType(window.SfEvtClosed) { 34 | return 35 | } 36 | } 37 | graphics.SfRenderWindow_clear(w, graphics.GetSfRed()) 38 | graphics.SfRenderWindow_display(w) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /examples/tennis/README.md: -------------------------------------------------------------------------------- 1 | # Tennis example 2 | 3 | Go version of the [eponymous SFML example](https://github.com/SFML/SFML/tree/master/examples/tennis) 4 | 5 | This code follows the same structure, call orders, with the same comments _(with just fixed maths lol)_ as the original, so it should give you a good idea on how to transpose C++ SFML code to go-sfml! 6 | 7 | 1. Open `build.bat` script and update its `CSFML_PATH` variable to match the path of your CSFML installation 8 | 2. Run the `build.bat` script 9 | 3. Please note that you may need the `openal32.dll` to run the executable, you'll find it in SFML's _(not CSFML)_ `bin` folder 10 | 4. Run `tennis.exe`, the following result should appear! 11 | 12 | ![tennis](https://user-images.githubusercontent.com/19146183/182578103-eaef7229-0cc2-43a1-b184-9bf4950de8e7.gif) 13 | 14 | If you're having issues building & running this example, please read the [general README](https://github.com/Telroshan/go-sfml#usage), and feel free to open an issue if your problem is not listed in here. -------------------------------------------------------------------------------- /examples/tennis/asset_licenses.md: -------------------------------------------------------------------------------- 1 | # Assets used by SFML's example projects. 2 | 3 | All assets are under public domain (CC0): 4 | 5 | | Name | Author | Link | 6 | | ------------------------------- | ------------------------- | -------------------------- | 7 | | Tuffy 1.1 font | Thatcher Ulrich | [Ulrich's fonts][1] | 8 | | ball.wav | MrZeusTheCoder | [public-domain][2] | 9 | 10 | [1]: http://tulrich.com/fonts/ 11 | [2]: https://github.com/MrZeusTheCoder/public-domain 12 | -------------------------------------------------------------------------------- /examples/tennis/build.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | rem This script sets the environment variables to be able to build the app, and copies the CSFML DLLs over if there aren't any in the folder 4 | 5 | rem Edit the CSFML_PATH variable to match the path of your CSFML installation 6 | set CSFML_PATH=C:\CSFML_2.5.1 7 | rem Edit the COMPILER_NAME variable if you're not using gcc 8 | set COMPILER_NAME=gcc 9 | 10 | set CGO_CFLAGS="-I%CSFML_PATH%\include" 11 | set CGO_LDFLAGS="-L%CSFML_PATH%\lib\%COMPILER_NAME%" 12 | 13 | go get 14 | if %ERRORLEVEL% NEQ 0 (echo go get failed && exit /b %ERRORLEVEL%) 15 | 16 | go build 17 | if %ERRORLEVEL% NEQ 0 (echo go build failed && exit /b %ERRORLEVEL%) 18 | 19 | echo Build complete 20 | 21 | if not exist "%~dp0*.dll" ( 22 | echo No DLLs in folder, getting them from CSFML folder 23 | xcopy /s "%CSFML_PATH%\bin" "%~dp0" 24 | if %ERRORLEVEL% NEQ 0 (echo failed to copy DLLs && exit /b %ERRORLEVEL%) 25 | ) -------------------------------------------------------------------------------- /examples/tennis/go.mod: -------------------------------------------------------------------------------- 1 | module tennis 2 | 3 | go 1.18 4 | 5 | -------------------------------------------------------------------------------- /examples/tennis/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "math" 5 | "math/rand" 6 | "path" 7 | "runtime" 8 | "time" 9 | 10 | "github.com/telroshan/go-sfml/v2/audio" 11 | "github.com/telroshan/go-sfml/v2/graphics" 12 | "github.com/telroshan/go-sfml/v2/window" 13 | ) 14 | 15 | const cTrue = 1 16 | const cFalse = 0 17 | 18 | const DegToRad = math.Pi / 180 19 | 20 | func makeVector2(x float32, y float32) graphics.SfVector2f { 21 | v := graphics.NewSfVector2f() 22 | v.SetX(x) 23 | v.SetY(y) 24 | return v 25 | } 26 | 27 | func getNullIntRect() graphics.SfIntRect { 28 | return (graphics.SfIntRect)(graphics.SwigcptrSfIntRect(0)) 29 | } 30 | 31 | func getNullRenderState() graphics.SfRenderStates { 32 | return (graphics.SfRenderStates)(graphics.SwigcptrSfRenderStates(0)) 33 | } 34 | 35 | func init() { runtime.LockOSThread() } 36 | 37 | func main() { 38 | s1 := rand.NewSource(time.Now().UnixNano()) 39 | r1 := rand.New(s1) 40 | 41 | // Define some constants 42 | const gameWidth = 800 43 | const gameHeight = 600 44 | const paddleWidth float32 = 25 45 | const paddleHeight float32 = 100 46 | const ballRadius float32 = 10 47 | const resourcesDir = "resources" 48 | 49 | // Create the window of the application 50 | vm := window.NewSfVideoMode() 51 | defer window.DeleteSfVideoMode(vm) 52 | vm.SetWidth(gameWidth) 53 | vm.SetHeight(gameHeight) 54 | vm.SetBitsPerPixel(32) 55 | cs := window.NewSfContextSettings() 56 | defer window.DeleteSfContextSettings(cs) 57 | w := graphics.SfRenderWindow_create(vm, "SFML Tennis", uint(window.SfTitlebar|window.SfClose), cs) 58 | defer window.SfWindow_destroy(w) 59 | window.SfWindow_setVerticalSyncEnabled(w, cTrue) 60 | 61 | // Load the sounds used in the game 62 | ballSoundBuffer := audio.SfSoundBuffer_createFromFile(path.Join(resourcesDir, "ball.wav")) 63 | if ballSoundBuffer == nil || ballSoundBuffer.Swigcptr() == cFalse { 64 | panic("Couldn't load ball.wav") 65 | } 66 | defer audio.SfSoundBuffer_destroy(ballSoundBuffer) 67 | ballSound := audio.SfSound_create() 68 | defer audio.SfSound_destroy(ballSound) 69 | audio.SfSound_setBuffer(ballSound, ballSoundBuffer) 70 | 71 | // Create the SFML logo texture: 72 | sfmlLogoTexture := graphics.SfTexture_createFromFile(path.Join(resourcesDir, "sfml_logo.png"), getNullIntRect()) 73 | defer graphics.SfTexture_destroy(sfmlLogoTexture) 74 | if sfmlLogoTexture == nil || sfmlLogoTexture.Swigcptr() == cFalse { 75 | panic("Couldn't load sfml_logo.png") 76 | } 77 | sfmlLogo := graphics.SfSprite_create() 78 | defer graphics.SfSprite_destroy(sfmlLogo) 79 | graphics.SfSprite_setTexture(sfmlLogo, sfmlLogoTexture, cTrue) 80 | graphics.SfSprite_setPosition(sfmlLogo, makeVector2(170, 50)) 81 | 82 | // Create the left paddle 83 | leftPaddle := graphics.SfRectangleShape_create() 84 | defer graphics.SfRectangleShape_destroy(leftPaddle) 85 | graphics.SfRectangleShape_setSize(leftPaddle, makeVector2(paddleWidth-3, paddleHeight-3)) 86 | graphics.SfRectangleShape_setOutlineThickness(leftPaddle, 3) 87 | graphics.SfRectangleShape_setOutlineColor(leftPaddle, graphics.GetSfBlack()) 88 | graphics.SfRectangleShape_setFillColor(leftPaddle, graphics.SfColor_fromRGB(100, 100, 200)) 89 | graphics.SfRectangleShape_setOrigin(leftPaddle, makeVector2(paddleWidth/2, paddleHeight/2)) 90 | 91 | // Create the right paddle 92 | rightPaddle := graphics.SfRectangleShape_create() 93 | defer graphics.SfRectangleShape_destroy(rightPaddle) 94 | graphics.SfRectangleShape_setSize(rightPaddle, makeVector2(paddleWidth-3, paddleHeight-3)) 95 | graphics.SfRectangleShape_setOutlineThickness(rightPaddle, 3) 96 | graphics.SfRectangleShape_setOutlineColor(rightPaddle, graphics.GetSfBlack()) 97 | graphics.SfRectangleShape_setFillColor(rightPaddle, graphics.SfColor_fromRGB(200, 100, 100)) 98 | graphics.SfRectangleShape_setOrigin(rightPaddle, makeVector2(paddleWidth/2, paddleHeight/2)) 99 | 100 | // Create the ball 101 | ball := graphics.SfCircleShape_create() 102 | defer graphics.SfCircleShape_destroy(ball) 103 | graphics.SfCircleShape_setRadius(ball, ballRadius-3) 104 | graphics.SfCircleShape_setOutlineThickness(ball, 2) 105 | graphics.SfCircleShape_setOutlineColor(ball, graphics.GetSfBlack()) 106 | graphics.SfCircleShape_setFillColor(ball, graphics.GetSfWhite()) 107 | graphics.SfCircleShape_setOrigin(ball, makeVector2(ballRadius/2, ballRadius/2)) 108 | 109 | // Load the text font 110 | font := graphics.SfFont_createFromFile(path.Join(resourcesDir, "tuffy.ttf")) 111 | if font == nil || font.Swigcptr() == cFalse { 112 | panic("Couldn't load tuffy.ttf") 113 | } 114 | 115 | // Initialize the pause message 116 | pauseMessage := graphics.SfText_create() 117 | graphics.SfText_setFont(pauseMessage, font) 118 | graphics.SfText_setCharacterSize(pauseMessage, 40) 119 | graphics.SfText_setPosition(pauseMessage, makeVector2(170, 200)) 120 | graphics.SfText_setFillColor(pauseMessage, graphics.GetSfWhite()) 121 | graphics.SfText_setString(pauseMessage, "Welcome to SFML Tennis!\n\nPress space to start the game.") 122 | 123 | // Define the paddles properties 124 | const AITime = time.Millisecond * 100 125 | const paddleSpeed float32 = 400 126 | var rightPaddleSpeed float32 = 0 127 | const ballSpeed = 400 128 | var ballAngle float32 = 0 129 | const margin = 0.1 130 | const angleMaxSpread float32 = 20 131 | 132 | isPlaying := false 133 | 134 | ev := window.NewSfEvent() 135 | defer window.DeleteSfEvent(ev) 136 | 137 | aiTimer := time.Now() 138 | timeStamp := time.Now() 139 | 140 | for window.SfWindow_isOpen(w) > 0 { 141 | // Handle events 142 | for window.SfWindow_pollEvent(w, ev) > 0 { 143 | // Window closed or escape key pressed: exit 144 | if ev.GetEvType() == window.SfEventType(window.SfEvtClosed) || 145 | (ev.GetEvType() == window.SfEventType(window.SfEvtKeyPressed) && ev.GetKey().GetCode() == window.SfKeyCode(window.SfKeyEscape)) { 146 | window.SfWindow_close(w) 147 | break 148 | } 149 | 150 | // Space key pressed: play 151 | if ((ev.GetEvType() == window.SfEventType(window.SfEvtKeyPressed) && ev.GetKey().GetCode() == window.SfKeyCode(window.SfKeySpace)) || 152 | ev.GetEvType() == window.SfEventType(window.SfEvtTouchBegan)) && !isPlaying { 153 | // (re)start the game 154 | isPlaying = true 155 | timeStamp = time.Now() 156 | 157 | // Reset the position of the paddles and ball 158 | graphics.SfRectangleShape_setPosition(leftPaddle, makeVector2(10+paddleWidth/2, gameHeight/2)) 159 | graphics.SfRectangleShape_setPosition(rightPaddle, makeVector2(gameWidth-10-paddleWidth/2, gameHeight/2)) 160 | graphics.SfCircleShape_setPosition(ball, makeVector2(gameWidth/2, gameHeight/2)) 161 | 162 | // Reset the ball angle 163 | ballAngle = r1.Float32() * 360 164 | // Make sure the ball initial angle is not too much vertical 165 | for math.Abs(math.Cos(float64(ballAngle*DegToRad))) < 0.7 { 166 | ballAngle = r1.Float32() * 360 167 | } 168 | } 169 | 170 | // Window size changed, adjust view appropriately 171 | if ev.GetEvType() == window.SfEventType(window.SfEvtResized) { 172 | view := graphics.SfView_create() 173 | defer graphics.SfView_destroy(view) 174 | graphics.SfView_setSize(view, makeVector2(gameWidth, gameHeight)) 175 | graphics.SfView_setCenter(view, makeVector2(gameWidth/2, gameHeight/2)) 176 | graphics.SfRenderWindow_setView(w, view) 177 | } 178 | } 179 | 180 | if isPlaying { 181 | deltaTime := float32(time.Now().Sub(timeStamp).Seconds()) 182 | timeStamp = time.Now() 183 | 184 | leftPaddlePos := graphics.SfRectangleShape_getPosition(leftPaddle) 185 | if window.SfKeyboard_isKeyPressed(window.SfKeyCode(window.SfKeyUp)) == cTrue && 186 | leftPaddlePos.GetY()-paddleHeight/2 > 5 { 187 | graphics.SfRectangleShape_move(leftPaddle, makeVector2(0, -paddleSpeed*deltaTime)) 188 | } 189 | if window.SfKeyboard_isKeyPressed(window.SfKeyCode(window.SfKeyDown)) == cTrue && 190 | leftPaddlePos.GetY()+paddleHeight/2 < gameHeight-5 { 191 | graphics.SfRectangleShape_move(leftPaddle, makeVector2(0, paddleSpeed*deltaTime)) 192 | } 193 | leftPaddlePos = graphics.SfRectangleShape_getPosition(leftPaddle) 194 | 195 | if window.SfTouch_isDown(0) == cTrue { 196 | pos := window.SfTouch_getPosition(0, w) 197 | mappedPos := graphics.SfRenderWindow_mapPixelToCoords(w, pos, graphics.SfRenderWindow_getView(w)) 198 | graphics.SfRectangleShape_setPosition(leftPaddle, makeVector2(leftPaddlePos.GetX(), mappedPos.GetY())) 199 | } 200 | 201 | // Move the computer's paddle 202 | rightPaddlePos := graphics.SfRectangleShape_getPosition(rightPaddle) 203 | if rightPaddleSpeed < 0 && rightPaddlePos.GetY()-paddleHeight/2 > 5 || 204 | rightPaddleSpeed > 0 && rightPaddlePos.GetY()+paddleHeight/2 < gameHeight-5 { 205 | graphics.SfRectangleShape_move(rightPaddle, makeVector2(0, rightPaddleSpeed*deltaTime)) 206 | } 207 | rightPaddlePos = graphics.SfRectangleShape_getPosition(rightPaddle) 208 | 209 | // Update the computer's paddle direction according to the ball position 210 | ballPos := graphics.SfCircleShape_getPosition(ball) 211 | if time.Since(aiTimer) > AITime { 212 | aiTimer = time.Now() 213 | if ballPos.GetY()+ballRadius > rightPaddlePos.GetY()+paddleHeight/2 { 214 | rightPaddleSpeed = paddleSpeed 215 | } else if ballPos.GetY()-ballRadius < rightPaddlePos.GetY()-paddleHeight/2 { 216 | rightPaddleSpeed = -paddleSpeed 217 | } else { 218 | rightPaddleSpeed = 0 219 | } 220 | } 221 | 222 | // Move the ball 223 | xDirection := float32(math.Cos(float64(ballAngle * DegToRad))) 224 | yDirection := float32(math.Sin(float64(ballAngle * DegToRad))) 225 | graphics.SfCircleShape_move(ball, makeVector2(xDirection*ballSpeed*deltaTime, yDirection*ballSpeed*deltaTime)) 226 | 227 | const inputString = "Press space to restart or\nescape to exit." 228 | 229 | // Check collisions between the ball and the screen 230 | if ballPos.GetX()-ballRadius < 0 { 231 | isPlaying = false 232 | graphics.SfText_setString(pauseMessage, "You Lost!\n\n"+inputString) 233 | } else if ballPos.GetX()+ballRadius > gameWidth { 234 | isPlaying = false 235 | graphics.SfText_setString(pauseMessage, "You Won!\n\n"+inputString) 236 | } 237 | 238 | if ballPos.GetY()-ballRadius < 0 { 239 | audio.SfSound_play(ballSound) 240 | ballAngle = -ballAngle 241 | graphics.SfCircleShape_setPosition(ball, makeVector2(ballPos.GetX(), ballRadius+margin)) 242 | } else if ballPos.GetY()+ballRadius > gameHeight { 243 | audio.SfSound_play(ballSound) 244 | ballAngle = -ballAngle 245 | graphics.SfCircleShape_setPosition(ball, makeVector2(ballPos.GetX(), gameHeight-ballRadius-margin)) 246 | } 247 | 248 | // Check the collisions between the ball and the paddles 249 | // Left Paddle 250 | if ballPos.GetX()-ballRadius < leftPaddlePos.GetX()+paddleWidth/2 && 251 | ballPos.GetX()-ballRadius > leftPaddlePos.GetX() && 252 | ballPos.GetY()+ballRadius >= leftPaddlePos.GetY()-paddleHeight/2 && 253 | ballPos.GetY()-ballRadius <= leftPaddlePos.GetY()+paddleHeight/2 { 254 | if ballPos.GetY()+ballRadius > leftPaddlePos.GetY()+paddleHeight/2 { 255 | ballAngle = 180 - ballAngle + r1.Float32()*angleMaxSpread 256 | } else { 257 | ballAngle = 180 - ballAngle - r1.Float32()*angleMaxSpread 258 | } 259 | 260 | audio.SfSound_play(ballSound) 261 | graphics.SfCircleShape_setPosition(ball, makeVector2(leftPaddlePos.GetX()+ballRadius+paddleWidth/2+margin, ballPos.GetY())) 262 | } 263 | 264 | // Right Paddle 265 | if ballPos.GetX()+ballRadius > rightPaddlePos.GetX()-paddleWidth/2 && 266 | ballPos.GetX()+ballRadius < rightPaddlePos.GetX() && 267 | ballPos.GetY()+ballRadius >= rightPaddlePos.GetY()-paddleHeight/2 && 268 | ballPos.GetY()-ballRadius <= rightPaddlePos.GetY()+paddleHeight/2 { 269 | if ballPos.GetY()+ballRadius > rightPaddlePos.GetY()+paddleHeight/2 { 270 | ballAngle = 180 - ballAngle + r1.Float32()*angleMaxSpread 271 | } else { 272 | ballAngle = 180 - ballAngle - r1.Float32()*angleMaxSpread 273 | } 274 | 275 | audio.SfSound_play(ballSound) 276 | graphics.SfCircleShape_setPosition(ball, makeVector2(rightPaddlePos.GetX()-ballRadius-paddleWidth/2-margin, ballPos.GetY())) 277 | } 278 | 279 | ballAngle = float32(int(ballAngle)%360) + (ballAngle - float32(int(ballAngle))) 280 | } 281 | 282 | // Clear the window 283 | graphics.SfRenderWindow_clear(w, graphics.SfColor_fromRGB(50, 50, 50)) 284 | 285 | if isPlaying { 286 | // Draw the paddles and the ball 287 | graphics.SfRenderWindow_drawRectangleShape(w, leftPaddle, getNullRenderState()) 288 | graphics.SfRenderWindow_drawRectangleShape(w, rightPaddle, getNullRenderState()) 289 | graphics.SfRenderWindow_drawCircleShape(w, ball, getNullRenderState()) 290 | } else { 291 | // Draw the pause message 292 | graphics.SfRenderWindow_drawText(w, pauseMessage, getNullRenderState()) 293 | graphics.SfRenderWindow_drawSprite(w, sfmlLogo, getNullRenderState()) 294 | } 295 | 296 | graphics.SfRenderWindow_display(w) 297 | } 298 | } 299 | -------------------------------------------------------------------------------- /examples/tennis/resources/ball.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Telroshan/go-sfml/8def5bad75c65b8efae4bdaaa6e64a7258824f27/examples/tennis/resources/ball.wav -------------------------------------------------------------------------------- /examples/tennis/resources/sfml_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Telroshan/go-sfml/8def5bad75c65b8efae4bdaaa6e64a7258824f27/examples/tennis/resources/sfml_logo.png -------------------------------------------------------------------------------- /examples/tennis/resources/tuffy.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Telroshan/go-sfml/8def5bad75c65b8efae4bdaaa6e64a7258824f27/examples/tennis/resources/tuffy.ttf -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/telroshan/go-sfml/v2 2 | 3 | go 1.18 4 | -------------------------------------------------------------------------------- /interfaces/Audio.i: -------------------------------------------------------------------------------- 1 | %module "audio" 2 | %{ 3 | /* Includes the header in the wrapper code */ 4 | #include 5 | %} 6 | 7 | /* Parse the header file to generate wrappers */ 8 | 9 | %define MACOSX %enddef 10 | %define __APPLE__ %enddef 11 | %define MACOSX %enddef 12 | %define macintosh %enddef 13 | %define Macintosh %enddef 14 | %define CSFML_SYSTEM_MACOS %enddef 15 | 16 | %include 17 | %include "Export.h" 18 | 19 | %include "Listener.h" 20 | %include "Music.h" 21 | %include "Sound.h" 22 | %include "SoundBuffer.h" 23 | %include "SoundBufferRecorder.h" 24 | %include "SoundRecorder.h" 25 | %include "SoundStatus.h" 26 | %include "SoundStream.h" 27 | %include "Types.h" 28 | -------------------------------------------------------------------------------- /interfaces/Graphics.i: -------------------------------------------------------------------------------- 1 | %module "graphics" 2 | %{ 3 | /* Includes the header in the wrapper code */ 4 | #include 5 | #include 6 | %} 7 | 8 | /* Parse the header file to generate wrappers */ 9 | 10 | %define MACOSX %enddef 11 | %define __APPLE__ %enddef 12 | %define MACOSX %enddef 13 | %define macintosh %enddef 14 | %define Macintosh %enddef 15 | %define CSFML_SYSTEM_MACOS %enddef 16 | 17 | %ignore sfRenderWindow_capture; 18 | %ignore sfShader_setFloatParameter; 19 | %ignore sfShader_setFloat2Parameter; 20 | %ignore sfShader_setFloat3Parameter; 21 | %ignore sfShader_setFloat4Parameter; 22 | %ignore sfShader_setVector2Parameter; 23 | %ignore sfShader_setVector3Parameter; 24 | %ignore sfShader_setColorParameter; 25 | %ignore sfShader_setTransformParameter; 26 | %ignore sfShader_setTextureParameter; 27 | %ignore sfShader_setCurrentTextureParameter; 28 | 29 | %include 30 | %include "Export.h" 31 | 32 | %include 33 | %include 34 | 35 | %include "BlendMode.h" 36 | %include "CircleShape.h" 37 | %include "Color.h" 38 | %include "ConvexShape.h" 39 | %include "Font.h" 40 | %include "FontInfo.h" 41 | %include "Glsl.h" 42 | %include "Glyph.h" 43 | %include "Image.h" 44 | %include "PrimitiveType.h" 45 | %include "Rect.h" 46 | %include "RectangleShape.h" 47 | %include "RenderStates.h" 48 | %include "RenderTexture.h" 49 | %include "RenderWindow.h" 50 | %include "Shader.h" 51 | %include "Shape.h" 52 | %include "Sprite.h" 53 | %include "Text.h" 54 | %include "Texture.h" 55 | %include "Transform.h" 56 | %include "Transformable.h" 57 | %include "Types.h" 58 | %include "Vertex.h" 59 | %include "VertexArray.h" 60 | %include "VertexBuffer.h" 61 | %include "View.h" 62 | -------------------------------------------------------------------------------- /interfaces/System.i: -------------------------------------------------------------------------------- 1 | %module "system" 2 | %{ 3 | /* Includes the header in the wrapper code */ 4 | #include 5 | %} 6 | 7 | /* Parse the header file to generate wrappers */ 8 | 9 | %define MACOSX %enddef 10 | %define __APPLE__ %enddef 11 | %define MACOSX %enddef 12 | %define macintosh %enddef 13 | %define Macintosh %enddef 14 | %define CSFML_SYSTEM_MACOS %enddef 15 | 16 | %include 17 | %include "Export.h" 18 | 19 | %include "Vector2.h" 20 | %include "Vector3.h" 21 | -------------------------------------------------------------------------------- /interfaces/Window.i: -------------------------------------------------------------------------------- 1 | %module "window" 2 | %{ 3 | /* Includes the header in the wrapper code */ 4 | #include 5 | #include 6 | %} 7 | 8 | /* Parse the header file to generate wrappers */ 9 | 10 | %define MACOSX %enddef 11 | %define __APPLE__ %enddef 12 | %define MACOSX %enddef 13 | %define macintosh %enddef 14 | %define Macintosh %enddef 15 | %define CSFML_SYSTEM_MACOS %enddef 16 | 17 | %rename type evType; 18 | 19 | %include 20 | %include "Export.h" 21 | 22 | %include 23 | %include 24 | 25 | %include "Clipboard.h" 26 | %include "Context.h" 27 | %include "Cursor.h" 28 | %include "Event.h" 29 | %include "Joystick.h" 30 | %include "JoystickIdentification.h" 31 | %include "Keyboard.h" 32 | %include "Mouse.h" 33 | %include "Sensor.h" 34 | %include "Touch.h" 35 | %include "Types.h" 36 | %include "VideoMode.h" 37 | %include "Window.h" 38 | %include "WindowHandle.h" 39 | -------------------------------------------------------------------------------- /sfml.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ## Clones and builds SFML & CSFML at the specified versions 4 | 5 | set -e 6 | 7 | SFML="SFML" 8 | SFML_VERSION="2.5.1" 9 | SFML_CMAKE_OPTIONS="" 10 | SFML_CMAKE_OPTIONS+=" -DBUILD_SHARED_LIBS=ON" 11 | SFML_CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE=Release" 12 | SFML_CMAKE_OPTIONS+=" -DCMAKE_INSTALL_FRAMEWORK_PREFIX=$PWD/$SFML/frameworks/" 13 | SFML_CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=$PWD/$SFML/libs" 14 | # SFML_CMAKE_OPTIONS+=" -DIBTOOL=$(which ibtool)" 15 | SFML_CMAKE_OPTIONS+=" -DSFML_BUILD_DOC=OFF" 16 | SFML_CMAKE_OPTIONS+=" -DSFML_BUILD_EXAMPLES=ON" 17 | SFML_CMAKE_OPTIONS+=" -DSFML_BUILD_FRAMEWORKS=OFF" 18 | SFML_CMAKE_OPTIONS+=" -DSFML_INSTALL_XCODE_TEMPLATES=OFF" 19 | SFML_CMAKE_OPTIONS+=" -DSFML_OPENGL_ES=OFF" 20 | 21 | CSFML="CSFML" 22 | CSFML_VERSION="2.5.1" 23 | CSFML_CMAKE_OPTIONS="" 24 | CSFML_CMAKE_OPTIONS+=" -DBUILD_SHARED_LIBS=ON" 25 | CSFML_CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE=Release" 26 | CSFML_CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=$PWD/$CSFML/libs" 27 | CSFML_CMAKE_OPTIONS+=" -DCSFML_BUILD_DOC=OFF" 28 | # CSFML_CMAKE_OPTIONS+=" -DCSFML_LINK_SFML_STATICALLY=ON" 29 | CSFML_CMAKE_OPTIONS+=" -DSFML_INCLUDE_DIR=$PWD/$SFML/include" 30 | CSFML_CMAKE_OPTIONS+=" -DCMAKE_MODULE_PATH=$PWD/$SFML/cmake/Modules/" 31 | CSFML_CMAKE_OPTIONS+=" -DSFML_SYSTEM_LIBRARY_RELEASE=$PWD/$SFML/lib/libsfml-system.dylib" 32 | CSFML_CMAKE_OPTIONS+=" -DSFML_WINDOW_LIBRARY_RELEASE=$PWD/$SFML/lib/libsfml-window.dylib" 33 | CSFML_CMAKE_OPTIONS+=" -DSFML_NETWORK_LIBRARY_RELEASE=$PWD/$SFML/lib/libsfml-network.dylib" 34 | CSFML_CMAKE_OPTIONS+=" -DSFML_GRAPHICS_LIBRARY_RELEASE=$PWD/$SFML/lib/libsfml-graphics.dylib" 35 | CSFML_CMAKE_OPTIONS+=" -DSFML_AUDIO_LIBRARY_RELEASE=$PWD/$SFML/lib/libsfml-audio.dylib" 36 | 37 | clone_and_checkout() { 38 | if [ ! -d "$1" ]; then 39 | echo -n "cloning $1 v$2..." 40 | git clone https://github.com/SFML/$1.git 41 | echo " OK." 42 | else 43 | echo "$1 has already been cloned, skipping." 44 | fi 45 | echo -n "checking out to $1's '$2' tag..." 46 | git -C $1 checkout $2 47 | echo " OK." 48 | } 49 | clone_and_checkout "$SFML" "$SFML_VERSION" 50 | clone_and_checkout "$CSFML" "$CSFML_VERSION" 51 | 52 | clean_and_build() { 53 | cd "$1" 54 | echo "temporary moved to $PWD/" 55 | echo -en "\tcleansing $1..." 56 | git clean -fd 57 | echo " OK." 58 | echo -en "\tbuilding metatools for $1..." 59 | cmake $2 . 60 | echo " OK." 61 | echo -en "\tbuilding $1..." 62 | make 63 | echo " OK." 64 | cd - 65 | echo "moved back to $PWD/" 66 | } 67 | clean_and_build "$SFML" "$SFML_CMAKE_OPTIONS" 68 | 69 | export SFML_DIR=$PWD/$SFML 70 | clean_and_build "$CSFML" "$CSFML_CMAKE_OPTIONS" 71 | -------------------------------------------------------------------------------- /swig.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | SWIG="swig" 6 | SWIG_VERSION="v4.0.2" 7 | 8 | clone_and_checkout() { 9 | if [ ! -d "$1" ]; then 10 | echo -n "cloning $1 v$2..." 11 | git clone https://github.com/swig/$1.git 12 | echo " OK." 13 | else 14 | echo "$1 has already been cloned, skipping." 15 | fi 16 | echo -n "checking out to $1's '$2' tag..." 17 | git -C $1 checkout $2 18 | echo " OK." 19 | } 20 | clone_and_checkout "$SWIG" "$SWIG_VERSION" 21 | 22 | echo -n "building $SWIG:$SWIG_VERSION..." 23 | cd $SWIG 24 | ./autogen.sh 25 | ./configure 26 | make 27 | cd - 28 | echo " OK." -------------------------------------------------------------------------------- /system/System_wrap.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 4.0.1 4 | * 5 | * This file is not intended to be easily readable and contains a number of 6 | * coding conventions designed to improve portability and efficiency. Do not make 7 | * changes to this file unless you know what you are doing--modify the SWIG 8 | * interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | /* source: /mnt/e/workspace/git/go-sfml/CSFML/include/SFML/System/System.i */ 12 | 13 | #define SWIGMODULE system 14 | /* ----------------------------------------------------------------------------- 15 | * This section contains generic SWIG labels for method/variable 16 | * declarations/attributes, and other compiler dependent labels. 17 | * ----------------------------------------------------------------------------- */ 18 | 19 | /* template workaround for compilers that cannot correctly implement the C++ standard */ 20 | #ifndef SWIGTEMPLATEDISAMBIGUATOR 21 | # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) 22 | # define SWIGTEMPLATEDISAMBIGUATOR template 23 | # elif defined(__HP_aCC) 24 | /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ 25 | /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ 26 | # define SWIGTEMPLATEDISAMBIGUATOR template 27 | # else 28 | # define SWIGTEMPLATEDISAMBIGUATOR 29 | # endif 30 | #endif 31 | 32 | /* inline attribute */ 33 | #ifndef SWIGINLINE 34 | # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) 35 | # define SWIGINLINE inline 36 | # else 37 | # define SWIGINLINE 38 | # endif 39 | #endif 40 | 41 | /* attribute recognised by some compilers to avoid 'unused' warnings */ 42 | #ifndef SWIGUNUSED 43 | # if defined(__GNUC__) 44 | # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 45 | # define SWIGUNUSED __attribute__ ((__unused__)) 46 | # else 47 | # define SWIGUNUSED 48 | # endif 49 | # elif defined(__ICC) 50 | # define SWIGUNUSED __attribute__ ((__unused__)) 51 | # else 52 | # define SWIGUNUSED 53 | # endif 54 | #endif 55 | 56 | #ifndef SWIG_MSC_UNSUPPRESS_4505 57 | # if defined(_MSC_VER) 58 | # pragma warning(disable : 4505) /* unreferenced local function has been removed */ 59 | # endif 60 | #endif 61 | 62 | #ifndef SWIGUNUSEDPARM 63 | # ifdef __cplusplus 64 | # define SWIGUNUSEDPARM(p) 65 | # else 66 | # define SWIGUNUSEDPARM(p) p SWIGUNUSED 67 | # endif 68 | #endif 69 | 70 | /* internal SWIG method */ 71 | #ifndef SWIGINTERN 72 | # define SWIGINTERN static SWIGUNUSED 73 | #endif 74 | 75 | /* internal inline SWIG method */ 76 | #ifndef SWIGINTERNINLINE 77 | # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE 78 | #endif 79 | 80 | /* exporting methods */ 81 | #if defined(__GNUC__) 82 | # if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) 83 | # ifndef GCC_HASCLASSVISIBILITY 84 | # define GCC_HASCLASSVISIBILITY 85 | # endif 86 | # endif 87 | #endif 88 | 89 | #ifndef SWIGEXPORT 90 | # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) 91 | # if defined(STATIC_LINKED) 92 | # define SWIGEXPORT 93 | # else 94 | # define SWIGEXPORT __declspec(dllexport) 95 | # endif 96 | # else 97 | # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) 98 | # define SWIGEXPORT __attribute__ ((visibility("default"))) 99 | # else 100 | # define SWIGEXPORT 101 | # endif 102 | # endif 103 | #endif 104 | 105 | /* calling conventions for Windows */ 106 | #ifndef SWIGSTDCALL 107 | # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) 108 | # define SWIGSTDCALL __stdcall 109 | # else 110 | # define SWIGSTDCALL 111 | # endif 112 | #endif 113 | 114 | /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ 115 | #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) 116 | # define _CRT_SECURE_NO_DEPRECATE 117 | #endif 118 | 119 | /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ 120 | #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) 121 | # define _SCL_SECURE_NO_DEPRECATE 122 | #endif 123 | 124 | /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ 125 | #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) 126 | # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 127 | #endif 128 | 129 | /* Intel's compiler complains if a variable which was never initialised is 130 | * cast to void, which is a common idiom which we use to indicate that we 131 | * are aware a variable isn't used. So we just silence that warning. 132 | * See: https://github.com/swig/swig/issues/192 for more discussion. 133 | */ 134 | #ifdef __INTEL_COMPILER 135 | # pragma warning disable 592 136 | #endif 137 | 138 | 139 | #include 140 | #include 141 | #include 142 | #include 143 | #include 144 | 145 | 146 | 147 | typedef long long intgo; 148 | typedef unsigned long long uintgo; 149 | 150 | 151 | # if !defined(__clang__) && (defined(__i386__) || defined(__x86_64__)) 152 | # define SWIGSTRUCTPACKED __attribute__((__packed__, __gcc_struct__)) 153 | # else 154 | # define SWIGSTRUCTPACKED __attribute__((__packed__)) 155 | # endif 156 | 157 | 158 | 159 | typedef struct { char *p; intgo n; } _gostring_; 160 | typedef struct { void* array; intgo len; intgo cap; } _goslice_; 161 | 162 | 163 | 164 | 165 | #define swiggo_size_assert_eq(x, y, name) typedef char name[(x-y)*(x-y)*-2+1]; 166 | #define swiggo_size_assert(t, n) swiggo_size_assert_eq(sizeof(t), n, swiggo_sizeof_##t##_is_not_##n) 167 | 168 | swiggo_size_assert(char, 1) 169 | swiggo_size_assert(short, 2) 170 | swiggo_size_assert(int, 4) 171 | typedef long long swiggo_long_long; 172 | swiggo_size_assert(swiggo_long_long, 8) 173 | swiggo_size_assert(float, 4) 174 | swiggo_size_assert(double, 8) 175 | 176 | #ifdef __cplusplus 177 | extern "C" { 178 | #endif 179 | extern void crosscall2(void (*fn)(void *, int), void *, int); 180 | extern char* _cgo_topofstack(void) __attribute__ ((weak)); 181 | extern void _cgo_allocate(void *, int); 182 | extern void _cgo_panic(void *, int); 183 | #ifdef __cplusplus 184 | } 185 | #endif 186 | 187 | static char *_swig_topofstack() { 188 | if (_cgo_topofstack) { 189 | return _cgo_topofstack(); 190 | } else { 191 | return 0; 192 | } 193 | } 194 | 195 | static void _swig_gopanic(const char *p) { 196 | struct { 197 | const char *p; 198 | } SWIGSTRUCTPACKED a; 199 | a.p = p; 200 | crosscall2(_cgo_panic, &a, (int) sizeof a); 201 | } 202 | 203 | 204 | 205 | 206 | #define SWIG_contract_assert(expr, msg) \ 207 | if (!(expr)) { _swig_gopanic(msg); } else 208 | 209 | 210 | static void Swig_free(void* p) { 211 | free(p); 212 | } 213 | 214 | static void* Swig_malloc(int c) { 215 | return malloc(c); 216 | } 217 | 218 | 219 | /* Includes the header in the wrapper code */ 220 | #include 221 | 222 | #ifdef __cplusplus 223 | extern "C" { 224 | #endif 225 | 226 | void _wrap_Swig_free_system_7a9d30970f9a732c(void *_swig_go_0) { 227 | void *arg1 = (void *) 0 ; 228 | 229 | arg1 = *(void **)&_swig_go_0; 230 | 231 | Swig_free(arg1); 232 | 233 | } 234 | 235 | 236 | void *_wrap_Swig_malloc_system_7a9d30970f9a732c(intgo _swig_go_0) { 237 | int arg1 ; 238 | void *result = 0 ; 239 | void *_swig_go_result; 240 | 241 | arg1 = (int)_swig_go_0; 242 | 243 | result = (void *)Swig_malloc(arg1); 244 | *(void **)&_swig_go_result = (void *)result; 245 | return _swig_go_result; 246 | } 247 | 248 | 249 | void _wrap_sfVector2i_x_set_system_7a9d30970f9a732c(sfVector2i *_swig_go_0, intgo _swig_go_1) { 250 | sfVector2i *arg1 = (sfVector2i *) 0 ; 251 | int arg2 ; 252 | 253 | arg1 = *(sfVector2i **)&_swig_go_0; 254 | arg2 = (int)_swig_go_1; 255 | 256 | if (arg1) (arg1)->x = arg2; 257 | 258 | } 259 | 260 | 261 | intgo _wrap_sfVector2i_x_get_system_7a9d30970f9a732c(sfVector2i *_swig_go_0) { 262 | sfVector2i *arg1 = (sfVector2i *) 0 ; 263 | int result; 264 | intgo _swig_go_result; 265 | 266 | arg1 = *(sfVector2i **)&_swig_go_0; 267 | 268 | result = (int) ((arg1)->x); 269 | _swig_go_result = result; 270 | return _swig_go_result; 271 | } 272 | 273 | 274 | void _wrap_sfVector2i_y_set_system_7a9d30970f9a732c(sfVector2i *_swig_go_0, intgo _swig_go_1) { 275 | sfVector2i *arg1 = (sfVector2i *) 0 ; 276 | int arg2 ; 277 | 278 | arg1 = *(sfVector2i **)&_swig_go_0; 279 | arg2 = (int)_swig_go_1; 280 | 281 | if (arg1) (arg1)->y = arg2; 282 | 283 | } 284 | 285 | 286 | intgo _wrap_sfVector2i_y_get_system_7a9d30970f9a732c(sfVector2i *_swig_go_0) { 287 | sfVector2i *arg1 = (sfVector2i *) 0 ; 288 | int result; 289 | intgo _swig_go_result; 290 | 291 | arg1 = *(sfVector2i **)&_swig_go_0; 292 | 293 | result = (int) ((arg1)->y); 294 | _swig_go_result = result; 295 | return _swig_go_result; 296 | } 297 | 298 | 299 | sfVector2i *_wrap_new_sfVector2i_system_7a9d30970f9a732c() { 300 | sfVector2i *result = 0 ; 301 | sfVector2i *_swig_go_result; 302 | 303 | 304 | result = (sfVector2i *)calloc(1, sizeof(sfVector2i)); 305 | *(sfVector2i **)&_swig_go_result = (sfVector2i *)result; 306 | return _swig_go_result; 307 | } 308 | 309 | 310 | void _wrap_delete_sfVector2i_system_7a9d30970f9a732c(sfVector2i *_swig_go_0) { 311 | sfVector2i *arg1 = (sfVector2i *) 0 ; 312 | 313 | arg1 = *(sfVector2i **)&_swig_go_0; 314 | 315 | free((char *) arg1); 316 | 317 | } 318 | 319 | 320 | void _wrap_sfVector2u_x_set_system_7a9d30970f9a732c(sfVector2u *_swig_go_0, intgo _swig_go_1) { 321 | sfVector2u *arg1 = (sfVector2u *) 0 ; 322 | unsigned int arg2 ; 323 | 324 | arg1 = *(sfVector2u **)&_swig_go_0; 325 | arg2 = (unsigned int)_swig_go_1; 326 | 327 | if (arg1) (arg1)->x = arg2; 328 | 329 | } 330 | 331 | 332 | intgo _wrap_sfVector2u_x_get_system_7a9d30970f9a732c(sfVector2u *_swig_go_0) { 333 | sfVector2u *arg1 = (sfVector2u *) 0 ; 334 | unsigned int result; 335 | intgo _swig_go_result; 336 | 337 | arg1 = *(sfVector2u **)&_swig_go_0; 338 | 339 | result = (unsigned int) ((arg1)->x); 340 | _swig_go_result = result; 341 | return _swig_go_result; 342 | } 343 | 344 | 345 | void _wrap_sfVector2u_y_set_system_7a9d30970f9a732c(sfVector2u *_swig_go_0, intgo _swig_go_1) { 346 | sfVector2u *arg1 = (sfVector2u *) 0 ; 347 | unsigned int arg2 ; 348 | 349 | arg1 = *(sfVector2u **)&_swig_go_0; 350 | arg2 = (unsigned int)_swig_go_1; 351 | 352 | if (arg1) (arg1)->y = arg2; 353 | 354 | } 355 | 356 | 357 | intgo _wrap_sfVector2u_y_get_system_7a9d30970f9a732c(sfVector2u *_swig_go_0) { 358 | sfVector2u *arg1 = (sfVector2u *) 0 ; 359 | unsigned int result; 360 | intgo _swig_go_result; 361 | 362 | arg1 = *(sfVector2u **)&_swig_go_0; 363 | 364 | result = (unsigned int) ((arg1)->y); 365 | _swig_go_result = result; 366 | return _swig_go_result; 367 | } 368 | 369 | 370 | sfVector2u *_wrap_new_sfVector2u_system_7a9d30970f9a732c() { 371 | sfVector2u *result = 0 ; 372 | sfVector2u *_swig_go_result; 373 | 374 | 375 | result = (sfVector2u *)calloc(1, sizeof(sfVector2u)); 376 | *(sfVector2u **)&_swig_go_result = (sfVector2u *)result; 377 | return _swig_go_result; 378 | } 379 | 380 | 381 | void _wrap_delete_sfVector2u_system_7a9d30970f9a732c(sfVector2u *_swig_go_0) { 382 | sfVector2u *arg1 = (sfVector2u *) 0 ; 383 | 384 | arg1 = *(sfVector2u **)&_swig_go_0; 385 | 386 | free((char *) arg1); 387 | 388 | } 389 | 390 | 391 | void _wrap_sfVector2f_x_set_system_7a9d30970f9a732c(sfVector2f *_swig_go_0, float _swig_go_1) { 392 | sfVector2f *arg1 = (sfVector2f *) 0 ; 393 | float arg2 ; 394 | 395 | arg1 = *(sfVector2f **)&_swig_go_0; 396 | arg2 = (float)_swig_go_1; 397 | 398 | if (arg1) (arg1)->x = arg2; 399 | 400 | } 401 | 402 | 403 | float _wrap_sfVector2f_x_get_system_7a9d30970f9a732c(sfVector2f *_swig_go_0) { 404 | sfVector2f *arg1 = (sfVector2f *) 0 ; 405 | float result; 406 | float _swig_go_result; 407 | 408 | arg1 = *(sfVector2f **)&_swig_go_0; 409 | 410 | result = (float) ((arg1)->x); 411 | _swig_go_result = result; 412 | return _swig_go_result; 413 | } 414 | 415 | 416 | void _wrap_sfVector2f_y_set_system_7a9d30970f9a732c(sfVector2f *_swig_go_0, float _swig_go_1) { 417 | sfVector2f *arg1 = (sfVector2f *) 0 ; 418 | float arg2 ; 419 | 420 | arg1 = *(sfVector2f **)&_swig_go_0; 421 | arg2 = (float)_swig_go_1; 422 | 423 | if (arg1) (arg1)->y = arg2; 424 | 425 | } 426 | 427 | 428 | float _wrap_sfVector2f_y_get_system_7a9d30970f9a732c(sfVector2f *_swig_go_0) { 429 | sfVector2f *arg1 = (sfVector2f *) 0 ; 430 | float result; 431 | float _swig_go_result; 432 | 433 | arg1 = *(sfVector2f **)&_swig_go_0; 434 | 435 | result = (float) ((arg1)->y); 436 | _swig_go_result = result; 437 | return _swig_go_result; 438 | } 439 | 440 | 441 | sfVector2f *_wrap_new_sfVector2f_system_7a9d30970f9a732c() { 442 | sfVector2f *result = 0 ; 443 | sfVector2f *_swig_go_result; 444 | 445 | 446 | result = (sfVector2f *)calloc(1, sizeof(sfVector2f)); 447 | *(sfVector2f **)&_swig_go_result = (sfVector2f *)result; 448 | return _swig_go_result; 449 | } 450 | 451 | 452 | void _wrap_delete_sfVector2f_system_7a9d30970f9a732c(sfVector2f *_swig_go_0) { 453 | sfVector2f *arg1 = (sfVector2f *) 0 ; 454 | 455 | arg1 = *(sfVector2f **)&_swig_go_0; 456 | 457 | free((char *) arg1); 458 | 459 | } 460 | 461 | 462 | void _wrap_sfVector3f_x_set_system_7a9d30970f9a732c(sfVector3f *_swig_go_0, float _swig_go_1) { 463 | sfVector3f *arg1 = (sfVector3f *) 0 ; 464 | float arg2 ; 465 | 466 | arg1 = *(sfVector3f **)&_swig_go_0; 467 | arg2 = (float)_swig_go_1; 468 | 469 | if (arg1) (arg1)->x = arg2; 470 | 471 | } 472 | 473 | 474 | float _wrap_sfVector3f_x_get_system_7a9d30970f9a732c(sfVector3f *_swig_go_0) { 475 | sfVector3f *arg1 = (sfVector3f *) 0 ; 476 | float result; 477 | float _swig_go_result; 478 | 479 | arg1 = *(sfVector3f **)&_swig_go_0; 480 | 481 | result = (float) ((arg1)->x); 482 | _swig_go_result = result; 483 | return _swig_go_result; 484 | } 485 | 486 | 487 | void _wrap_sfVector3f_y_set_system_7a9d30970f9a732c(sfVector3f *_swig_go_0, float _swig_go_1) { 488 | sfVector3f *arg1 = (sfVector3f *) 0 ; 489 | float arg2 ; 490 | 491 | arg1 = *(sfVector3f **)&_swig_go_0; 492 | arg2 = (float)_swig_go_1; 493 | 494 | if (arg1) (arg1)->y = arg2; 495 | 496 | } 497 | 498 | 499 | float _wrap_sfVector3f_y_get_system_7a9d30970f9a732c(sfVector3f *_swig_go_0) { 500 | sfVector3f *arg1 = (sfVector3f *) 0 ; 501 | float result; 502 | float _swig_go_result; 503 | 504 | arg1 = *(sfVector3f **)&_swig_go_0; 505 | 506 | result = (float) ((arg1)->y); 507 | _swig_go_result = result; 508 | return _swig_go_result; 509 | } 510 | 511 | 512 | void _wrap_sfVector3f_z_set_system_7a9d30970f9a732c(sfVector3f *_swig_go_0, float _swig_go_1) { 513 | sfVector3f *arg1 = (sfVector3f *) 0 ; 514 | float arg2 ; 515 | 516 | arg1 = *(sfVector3f **)&_swig_go_0; 517 | arg2 = (float)_swig_go_1; 518 | 519 | if (arg1) (arg1)->z = arg2; 520 | 521 | } 522 | 523 | 524 | float _wrap_sfVector3f_z_get_system_7a9d30970f9a732c(sfVector3f *_swig_go_0) { 525 | sfVector3f *arg1 = (sfVector3f *) 0 ; 526 | float result; 527 | float _swig_go_result; 528 | 529 | arg1 = *(sfVector3f **)&_swig_go_0; 530 | 531 | result = (float) ((arg1)->z); 532 | _swig_go_result = result; 533 | return _swig_go_result; 534 | } 535 | 536 | 537 | sfVector3f *_wrap_new_sfVector3f_system_7a9d30970f9a732c() { 538 | sfVector3f *result = 0 ; 539 | sfVector3f *_swig_go_result; 540 | 541 | 542 | result = (sfVector3f *)calloc(1, sizeof(sfVector3f)); 543 | *(sfVector3f **)&_swig_go_result = (sfVector3f *)result; 544 | return _swig_go_result; 545 | } 546 | 547 | 548 | void _wrap_delete_sfVector3f_system_7a9d30970f9a732c(sfVector3f *_swig_go_0) { 549 | sfVector3f *arg1 = (sfVector3f *) 0 ; 550 | 551 | arg1 = *(sfVector3f **)&_swig_go_0; 552 | 553 | free((char *) arg1); 554 | 555 | } 556 | 557 | 558 | #ifdef __cplusplus 559 | } 560 | #endif 561 | 562 | -------------------------------------------------------------------------------- /system/system.go: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * This file was automatically generated by SWIG (http://www.swig.org). 3 | * Version 4.0.1 4 | * 5 | * This file is not intended to be easily readable and contains a number of 6 | * coding conventions designed to improve portability and efficiency. Do not make 7 | * changes to this file unless you know what you are doing--modify the SWIG 8 | * interface file instead. 9 | * ----------------------------------------------------------------------------- */ 10 | 11 | // source: /mnt/e/workspace/git/go-sfml/CSFML/include/SFML/System/System.i 12 | 13 | package system 14 | 15 | /* 16 | #define intgo swig_intgo 17 | typedef void *swig_voidp; 18 | 19 | #include 20 | 21 | 22 | typedef long long intgo; 23 | typedef unsigned long long uintgo; 24 | 25 | 26 | 27 | typedef struct { char *p; intgo n; } _gostring_; 28 | typedef struct { void* array; intgo len; intgo cap; } _goslice_; 29 | 30 | 31 | extern void _wrap_Swig_free_system_7a9d30970f9a732c(uintptr_t arg1); 32 | extern uintptr_t _wrap_Swig_malloc_system_7a9d30970f9a732c(swig_intgo arg1); 33 | extern void _wrap_sfVector2i_x_set_system_7a9d30970f9a732c(uintptr_t arg1, swig_intgo arg2); 34 | extern swig_intgo _wrap_sfVector2i_x_get_system_7a9d30970f9a732c(uintptr_t arg1); 35 | extern void _wrap_sfVector2i_y_set_system_7a9d30970f9a732c(uintptr_t arg1, swig_intgo arg2); 36 | extern swig_intgo _wrap_sfVector2i_y_get_system_7a9d30970f9a732c(uintptr_t arg1); 37 | extern uintptr_t _wrap_new_sfVector2i_system_7a9d30970f9a732c(void); 38 | extern void _wrap_delete_sfVector2i_system_7a9d30970f9a732c(uintptr_t arg1); 39 | extern void _wrap_sfVector2u_x_set_system_7a9d30970f9a732c(uintptr_t arg1, swig_intgo arg2); 40 | extern swig_intgo _wrap_sfVector2u_x_get_system_7a9d30970f9a732c(uintptr_t arg1); 41 | extern void _wrap_sfVector2u_y_set_system_7a9d30970f9a732c(uintptr_t arg1, swig_intgo arg2); 42 | extern swig_intgo _wrap_sfVector2u_y_get_system_7a9d30970f9a732c(uintptr_t arg1); 43 | extern uintptr_t _wrap_new_sfVector2u_system_7a9d30970f9a732c(void); 44 | extern void _wrap_delete_sfVector2u_system_7a9d30970f9a732c(uintptr_t arg1); 45 | extern void _wrap_sfVector2f_x_set_system_7a9d30970f9a732c(uintptr_t arg1, float arg2); 46 | extern float _wrap_sfVector2f_x_get_system_7a9d30970f9a732c(uintptr_t arg1); 47 | extern void _wrap_sfVector2f_y_set_system_7a9d30970f9a732c(uintptr_t arg1, float arg2); 48 | extern float _wrap_sfVector2f_y_get_system_7a9d30970f9a732c(uintptr_t arg1); 49 | extern uintptr_t _wrap_new_sfVector2f_system_7a9d30970f9a732c(void); 50 | extern void _wrap_delete_sfVector2f_system_7a9d30970f9a732c(uintptr_t arg1); 51 | extern void _wrap_sfVector3f_x_set_system_7a9d30970f9a732c(uintptr_t arg1, float arg2); 52 | extern float _wrap_sfVector3f_x_get_system_7a9d30970f9a732c(uintptr_t arg1); 53 | extern void _wrap_sfVector3f_y_set_system_7a9d30970f9a732c(uintptr_t arg1, float arg2); 54 | extern float _wrap_sfVector3f_y_get_system_7a9d30970f9a732c(uintptr_t arg1); 55 | extern void _wrap_sfVector3f_z_set_system_7a9d30970f9a732c(uintptr_t arg1, float arg2); 56 | extern float _wrap_sfVector3f_z_get_system_7a9d30970f9a732c(uintptr_t arg1); 57 | extern uintptr_t _wrap_new_sfVector3f_system_7a9d30970f9a732c(void); 58 | extern void _wrap_delete_sfVector3f_system_7a9d30970f9a732c(uintptr_t arg1); 59 | #undef intgo 60 | */ 61 | // #cgo LDFLAGS: -lcsfml-system 62 | import "C" 63 | 64 | import "unsafe" 65 | import _ "runtime/cgo" 66 | import "sync" 67 | 68 | 69 | type _ unsafe.Pointer 70 | 71 | 72 | 73 | var Swig_escape_always_false bool 74 | var Swig_escape_val interface{} 75 | 76 | 77 | type _swig_fnptr *byte 78 | type _swig_memberptr *byte 79 | 80 | 81 | type _ sync.Mutex 82 | 83 | func Swig_free(arg1 uintptr) { 84 | _swig_i_0 := arg1 85 | C._wrap_Swig_free_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0)) 86 | } 87 | 88 | func Swig_malloc(arg1 int) (_swig_ret uintptr) { 89 | var swig_r uintptr 90 | _swig_i_0 := arg1 91 | swig_r = (uintptr)(C._wrap_Swig_malloc_system_7a9d30970f9a732c(C.swig_intgo(_swig_i_0))) 92 | return swig_r 93 | } 94 | 95 | const CSFML_VERSION_MAJOR int = 2 96 | const CSFML_VERSION_MINOR int = 5 97 | const CSFML_VERSION_PATCH int = 1 98 | const SfFalse int = 0 99 | const SfTrue int = 1 100 | type SwigcptrSfVector2i uintptr 101 | 102 | func (p SwigcptrSfVector2i) Swigcptr() uintptr { 103 | return (uintptr)(p) 104 | } 105 | 106 | func (p SwigcptrSfVector2i) SwigIsSfVector2i() { 107 | } 108 | 109 | func (arg1 SwigcptrSfVector2i) SetX(arg2 int) { 110 | _swig_i_0 := arg1 111 | _swig_i_1 := arg2 112 | C._wrap_sfVector2i_x_set_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0), C.swig_intgo(_swig_i_1)) 113 | } 114 | 115 | func (arg1 SwigcptrSfVector2i) GetX() (_swig_ret int) { 116 | var swig_r int 117 | _swig_i_0 := arg1 118 | swig_r = (int)(C._wrap_sfVector2i_x_get_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0))) 119 | return swig_r 120 | } 121 | 122 | func (arg1 SwigcptrSfVector2i) SetY(arg2 int) { 123 | _swig_i_0 := arg1 124 | _swig_i_1 := arg2 125 | C._wrap_sfVector2i_y_set_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0), C.swig_intgo(_swig_i_1)) 126 | } 127 | 128 | func (arg1 SwigcptrSfVector2i) GetY() (_swig_ret int) { 129 | var swig_r int 130 | _swig_i_0 := arg1 131 | swig_r = (int)(C._wrap_sfVector2i_y_get_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0))) 132 | return swig_r 133 | } 134 | 135 | func NewSfVector2i() (_swig_ret SfVector2i) { 136 | var swig_r SfVector2i 137 | swig_r = (SfVector2i)(SwigcptrSfVector2i(C._wrap_new_sfVector2i_system_7a9d30970f9a732c())) 138 | return swig_r 139 | } 140 | 141 | func DeleteSfVector2i(arg1 SfVector2i) { 142 | _swig_i_0 := arg1.Swigcptr() 143 | C._wrap_delete_sfVector2i_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0)) 144 | } 145 | 146 | type SfVector2i interface { 147 | Swigcptr() uintptr 148 | SwigIsSfVector2i() 149 | SetX(arg2 int) 150 | GetX() (_swig_ret int) 151 | SetY(arg2 int) 152 | GetY() (_swig_ret int) 153 | } 154 | 155 | type SwigcptrSfVector2u uintptr 156 | 157 | func (p SwigcptrSfVector2u) Swigcptr() uintptr { 158 | return (uintptr)(p) 159 | } 160 | 161 | func (p SwigcptrSfVector2u) SwigIsSfVector2u() { 162 | } 163 | 164 | func (arg1 SwigcptrSfVector2u) SetX(arg2 uint) { 165 | _swig_i_0 := arg1 166 | _swig_i_1 := arg2 167 | C._wrap_sfVector2u_x_set_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0), C.swig_intgo(_swig_i_1)) 168 | } 169 | 170 | func (arg1 SwigcptrSfVector2u) GetX() (_swig_ret uint) { 171 | var swig_r uint 172 | _swig_i_0 := arg1 173 | swig_r = (uint)(C._wrap_sfVector2u_x_get_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0))) 174 | return swig_r 175 | } 176 | 177 | func (arg1 SwigcptrSfVector2u) SetY(arg2 uint) { 178 | _swig_i_0 := arg1 179 | _swig_i_1 := arg2 180 | C._wrap_sfVector2u_y_set_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0), C.swig_intgo(_swig_i_1)) 181 | } 182 | 183 | func (arg1 SwigcptrSfVector2u) GetY() (_swig_ret uint) { 184 | var swig_r uint 185 | _swig_i_0 := arg1 186 | swig_r = (uint)(C._wrap_sfVector2u_y_get_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0))) 187 | return swig_r 188 | } 189 | 190 | func NewSfVector2u() (_swig_ret SfVector2u) { 191 | var swig_r SfVector2u 192 | swig_r = (SfVector2u)(SwigcptrSfVector2u(C._wrap_new_sfVector2u_system_7a9d30970f9a732c())) 193 | return swig_r 194 | } 195 | 196 | func DeleteSfVector2u(arg1 SfVector2u) { 197 | _swig_i_0 := arg1.Swigcptr() 198 | C._wrap_delete_sfVector2u_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0)) 199 | } 200 | 201 | type SfVector2u interface { 202 | Swigcptr() uintptr 203 | SwigIsSfVector2u() 204 | SetX(arg2 uint) 205 | GetX() (_swig_ret uint) 206 | SetY(arg2 uint) 207 | GetY() (_swig_ret uint) 208 | } 209 | 210 | type SwigcptrSfVector2f uintptr 211 | 212 | func (p SwigcptrSfVector2f) Swigcptr() uintptr { 213 | return (uintptr)(p) 214 | } 215 | 216 | func (p SwigcptrSfVector2f) SwigIsSfVector2f() { 217 | } 218 | 219 | func (arg1 SwigcptrSfVector2f) SetX(arg2 float32) { 220 | _swig_i_0 := arg1 221 | _swig_i_1 := arg2 222 | C._wrap_sfVector2f_x_set_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0), C.float(_swig_i_1)) 223 | } 224 | 225 | func (arg1 SwigcptrSfVector2f) GetX() (_swig_ret float32) { 226 | var swig_r float32 227 | _swig_i_0 := arg1 228 | swig_r = (float32)(C._wrap_sfVector2f_x_get_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0))) 229 | return swig_r 230 | } 231 | 232 | func (arg1 SwigcptrSfVector2f) SetY(arg2 float32) { 233 | _swig_i_0 := arg1 234 | _swig_i_1 := arg2 235 | C._wrap_sfVector2f_y_set_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0), C.float(_swig_i_1)) 236 | } 237 | 238 | func (arg1 SwigcptrSfVector2f) GetY() (_swig_ret float32) { 239 | var swig_r float32 240 | _swig_i_0 := arg1 241 | swig_r = (float32)(C._wrap_sfVector2f_y_get_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0))) 242 | return swig_r 243 | } 244 | 245 | func NewSfVector2f() (_swig_ret SfVector2f) { 246 | var swig_r SfVector2f 247 | swig_r = (SfVector2f)(SwigcptrSfVector2f(C._wrap_new_sfVector2f_system_7a9d30970f9a732c())) 248 | return swig_r 249 | } 250 | 251 | func DeleteSfVector2f(arg1 SfVector2f) { 252 | _swig_i_0 := arg1.Swigcptr() 253 | C._wrap_delete_sfVector2f_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0)) 254 | } 255 | 256 | type SfVector2f interface { 257 | Swigcptr() uintptr 258 | SwigIsSfVector2f() 259 | SetX(arg2 float32) 260 | GetX() (_swig_ret float32) 261 | SetY(arg2 float32) 262 | GetY() (_swig_ret float32) 263 | } 264 | 265 | type SwigcptrSfVector3f uintptr 266 | 267 | func (p SwigcptrSfVector3f) Swigcptr() uintptr { 268 | return (uintptr)(p) 269 | } 270 | 271 | func (p SwigcptrSfVector3f) SwigIsSfVector3f() { 272 | } 273 | 274 | func (arg1 SwigcptrSfVector3f) SetX(arg2 float32) { 275 | _swig_i_0 := arg1 276 | _swig_i_1 := arg2 277 | C._wrap_sfVector3f_x_set_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0), C.float(_swig_i_1)) 278 | } 279 | 280 | func (arg1 SwigcptrSfVector3f) GetX() (_swig_ret float32) { 281 | var swig_r float32 282 | _swig_i_0 := arg1 283 | swig_r = (float32)(C._wrap_sfVector3f_x_get_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0))) 284 | return swig_r 285 | } 286 | 287 | func (arg1 SwigcptrSfVector3f) SetY(arg2 float32) { 288 | _swig_i_0 := arg1 289 | _swig_i_1 := arg2 290 | C._wrap_sfVector3f_y_set_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0), C.float(_swig_i_1)) 291 | } 292 | 293 | func (arg1 SwigcptrSfVector3f) GetY() (_swig_ret float32) { 294 | var swig_r float32 295 | _swig_i_0 := arg1 296 | swig_r = (float32)(C._wrap_sfVector3f_y_get_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0))) 297 | return swig_r 298 | } 299 | 300 | func (arg1 SwigcptrSfVector3f) SetZ(arg2 float32) { 301 | _swig_i_0 := arg1 302 | _swig_i_1 := arg2 303 | C._wrap_sfVector3f_z_set_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0), C.float(_swig_i_1)) 304 | } 305 | 306 | func (arg1 SwigcptrSfVector3f) GetZ() (_swig_ret float32) { 307 | var swig_r float32 308 | _swig_i_0 := arg1 309 | swig_r = (float32)(C._wrap_sfVector3f_z_get_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0))) 310 | return swig_r 311 | } 312 | 313 | func NewSfVector3f() (_swig_ret SfVector3f) { 314 | var swig_r SfVector3f 315 | swig_r = (SfVector3f)(SwigcptrSfVector3f(C._wrap_new_sfVector3f_system_7a9d30970f9a732c())) 316 | return swig_r 317 | } 318 | 319 | func DeleteSfVector3f(arg1 SfVector3f) { 320 | _swig_i_0 := arg1.Swigcptr() 321 | C._wrap_delete_sfVector3f_system_7a9d30970f9a732c(C.uintptr_t(_swig_i_0)) 322 | } 323 | 324 | type SfVector3f interface { 325 | Swigcptr() uintptr 326 | SwigIsSfVector3f() 327 | SetX(arg2 float32) 328 | GetX() (_swig_ret float32) 329 | SetY(arg2 float32) 330 | GetY() (_swig_ret float32) 331 | SetZ(arg2 float32) 332 | GetZ() (_swig_ret float32) 333 | } 334 | 335 | 336 | --------------------------------------------------------------------------------