[
  {
    "path": ".github/dependabot.yml",
    "content": "# Set update schedule for GitHub Actions\n\nversion: 2\nupdates:\n  - package-ecosystem: \"github-actions\"\n    directory: \"/\"\n    schedule:\n      # Check for updates to GitHub Actions every weekday\n      interval: \"daily\" \n"
  },
  {
    "path": ".github/workflows/assembly.yml",
    "content": "name: assembly-examples\n\non:\n  push:\n    branches:\n    - '*'\n    paths:\n      - assembly/**\n  pull_request:\n    branches:\n    - '*'\n    paths:\n      - assembly/**\n  workflow_dispatch:\n\njobs:\n  make:\n    runs-on: ubuntu-latest\n    strategy:\n      fail-fast: false\n      matrix:\n        tests_list:\n        - { folder: \"assembly/linux-x86_64\" }\n    steps:\n      - uses: actions/checkout@v4\n      - name: install_dependencies\n        run: |\n          sudo apt update\n          sudo apt install -y gnupg libgmp-dev libsdl2-dev libsdl2-image-dev nasm ninja-build\n      - name: build\n        run: |\n              cd ${{ matrix.tests_list.folder }}\n              make all\n"
  },
  {
    "path": ".github/workflows/c.yml",
    "content": "name: c-examples\n\non:\n  push:\n    branches:\n    - '*'\n    paths:\n      - c1*/**\n      - c2*/**\n      - c8*/**\n      - c9*/**\n  pull_request:\n    branches:\n    - '*'\n    paths:\n      - c1*/**\n      - c2*/**\n      - c8*/**\n      - c9*/**\n  workflow_dispatch:\n\njobs:\n  make:\n    runs-on: ubuntu-latest\n    strategy:\n      fail-fast: false\n      matrix:\n        tests_list:\n        - { folder: \"c89\" }\n        - { folder: \"c99\" }\n        - { folder: \"c11\" }\n        - { folder: \"c18\" }\n        - { folder: \"c2x\" }\n    steps:\n      - uses: actions/checkout@v4\n      - name: install_dependencies\n        run: |\n          sudo apt update\n          sudo apt install -y cmake curl gnupg libgmp-dev libsdl2-dev libsdl2-image-dev nasm ninja-build\n      - name: build\n        run: |\n              cd ${{ matrix.tests_list.folder }}\n              make all\n"
  },
  {
    "path": ".github/workflows/cplusplus.yml",
    "content": "name: c-plus-plus-examples\n\non:\n  push:\n    branches:\n    - '*'\n    paths:\n    - 'c*-*/**'\n  pull_request:\n    branches:\n    - '*'\n    paths:\n    - 'c*-*/**'\n\njobs:\n  cmake:\n    runs-on: ubuntu-latest\n    strategy:\n      fail-fast: false\n      matrix:\n        tests_list:\n        - { folder: \"c++11-cmake\" }\n        - { folder: \"c++14-cmake\" }\n        - { folder: \"c++17-cmake\" }\n        - { folder: \"c++20-cmake\" }\n        - { folder: \"c++23-cmake\" }\n    steps:\n      - uses: actions/checkout@v4\n      - name: install_dependencies\n        run: |\n          sudo apt update\n          sudo apt install -y libsdl2-dev ninja-build cmake\n      - name: build\n        run: |\n              cd ${{ matrix.tests_list.folder }}\n              cmake -S . -B build -G Ninja\n              ninja -C build\n  make:\n    runs-on: ubuntu-latest\n    strategy:\n      fail-fast: false\n      matrix:\n        tests_list:\n        - { folder: \"c++98\" }\n        - { folder: \"c++11\" }\n    steps:\n      - uses: actions/checkout@v4\n      - name: install_dependencies\n        run: |\n          sudo apt update\n          sudo apt install -y cmake curl gnupg libgmp-dev libsdl2-dev libsdl2-image-dev mono-devel mono-mcs mono-runtime mono-vbnc nasm ninja-build\n          curl -fsSL https://crystal-lang.org/install.sh | sudo bash -s -- --channel=stable\n      - name: build\n        run: |\n              cd ${{ matrix.tests_list.folder }}\n              make all\n"
  },
  {
    "path": ".github/workflows/expired.yml",
    "content": "name: 'Close stale issues and PRs'\non:\n  schedule:\n    - cron: '0 */8 * * *'\njobs:\n  stale:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/stale@v9\n        with:\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n          exempt-issue-milestones: 'future,alpha,beta,release,bugfix,improvement,enhancement,help wanted'\n          exempt-pr-milestones: 'bugfix,improvement,enhancement,help wanted'\n          exempt-all-pr-assignees: true\n          stale-issue-message: 'This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 30 days.'\n          stale-pr-message: 'This PR is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 30 days.'\n          close-issue-message: 'This issue was closed because it has been stalled for 30 days with no activity.'\n          close-pr-message: 'This PR was closed because it has been stalled for 30 days with no activity.'\n          days-before-issue-stale: 120\n          days-before-pr-stale: 120\n          days-before-issue-close: 30\n          days-before-pr-close: 30\n"
  },
  {
    "path": ".github/workflows/other.yml",
    "content": "name: other-examples\n\non:\n  push:\n    branches:\n    - '*'\n    paths:\n      - crystal/\n      - csharp/\n  pull_request:\n    branches:\n    - '*'\n    paths:\n      - crystal/\n      - csharp/\n  workflow_dispatch:\n\njobs:\n  make:\n    runs-on: ubuntu-latest\n    strategy:\n      fail-fast: false\n      matrix:\n        tests_list:\n        - { folder: \"crystal\" }\n        - { folder: \"csharp\" }\n    steps:\n      - uses: actions/checkout@v4\n      - name: install_dependencies\n        run: |\n          sudo apt update\n          sudo apt install -y cmake curl gnupg libgmp-dev libsdl2-dev libsdl2-image-dev mono-devel mono-mcs mono-runtime mono-vbnc nasm ninja-build\n          curl -fsSL https://crystal-lang.org/install.sh | sudo bash -s -- --channel=stable\n      - name: build\n        run: |\n              cd ${{ matrix.tests_list.folder }}\n              make all\n"
  },
  {
    "path": ".gitignore",
    "content": "# macOS\n.DS_Store\n\n# C3\n*.dSYM\n\n# Java\n*.jar\n\n# Compiled Object files\n*.slo\n*.lo\n*.o\n*.obj\n\n# Compiled Dynamic libraries\n*.so\n*.dylib\n\n# Compiled Static libraries\n*.lai\n*.la\n*.a\n*.lib\n\n# Crystal\ncrystal/sdl.cr/\ncrystal/lib\ncrystal/bin/\n\n# F#\nfsharp/bin/\nfsharp/obj/\n\n# OCaml\n*.cmi\n*.cmx\n\n# Executables\n*.exe\n*.out\n*.app\nmain\nsmall\ngo/go\n\n# Nimrod cache\nnimcache\n\n# Rust\nrust/sdl2/\nCargo.lock\n\n# C++\nc++20-cxx/c++20-cxx\nc*/*.asm\n\n# Temporary databases\n*.dblite\n\n# CMake\nbuild/\nCMakeCache.txt\nCMakeFiles\ninst/\n\n# Ada\n*.ali\n*.ads\n*.adb\n*.adb.std*\n*.bexch\n\n# Zig\nzig/zig-cache\nzig/*.s\nzig/zig\n\n# Common Lisp\nlisp/quicklisp/\nlisp/quicklisp.lisp\n\n# FreeBASIC\nfreebasic/main\n\n# Odin\nodin/main\n\n# Object Pascal\nfpc/*.res\nobjectpascal/*.res\n*.ppu\nfpc/SDL2/\nobjectpascal/SDL2/\n\n# Scala\nscalanative/project/build.properties\nscalanative/target/\nscalanative/project/target/\nscalanative/project/project/\nscalanative/main.jar\n\n# Dart\ndart/.dart_tool\ndart/pubspec.lock\n\n# C#\ncsharp/bin/\ncsharp/obj/\ncsharp/*.exe\n\nzig/.*cache*\n"
  },
  {
    "path": "COMPILES.md",
    "content": "## Does it compile and/or run?\n\n| Directory    | ArchLinux | macOS/M2 | Comment                                          |\n|--------------|-----------|----------|--------------------------------------------------|\n| ada          | yes       | no       | look into Alire                                  |\n| c++11        |           | yes      |                                                  |\n| c++11-cmake  |           | yes      |                                                  |\n| c++14-cmake  |           | yes      |                                                  |\n| c++17-cmake  |           | yes      |                                                  |\n| c++20-cmake  |           | yes      |                                                  |\n| c++23-cmake  |           | yes      |                                                  |\n| c++98        |           | yes      |                                                  |\n| c2x          |           | yes      |                                                  |\n| c11          |           | yes      |                                                  |\n| c18          |           | yes      |                                                  |\n| c89          |           | yes      |                                                  |\n| c99          |           | yes      |                                                  |\n| crystal      |           | yes      |                                                  |\n| csharp       |           | yes      | does not run on M2                               |\n| d            |           | yes      | does not run on M2                               |\n| freebasic    |           |          | not in homebrew                                  |\n| gambas       |           |          | not in homebrew                                  |\n| gccgo        | yes       |          | not in homebrew (might be, with the right flags) |\n| go           | yes       | yes      |                                                  |\n| haskell      |           |          |                                                  |\n| lisp         |           | no       |                                                  |\n| lua          |           |          |                                                  |\n| mruby        |           |          |                                                  |\n| nim          |           |          |                                                  |\n| objectpascal |           |          |                                                  |\n| ocaml        |           |          |                                                  |\n| odin         |           |          |                                                  |\n| pony         |           |          |                                                  |\n| python       |           |          |                                                  |\n| ring         |           |          |                                                  |\n| rust         |           | no       | needs homebrew paths                             |\n| v            |           |          |                                                  |\n| zig          |           | no       | tried adding lib, include and framework paths    |\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright 2023 Alexander F. Rødseth\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "Makefile",
    "content": "SAMPLES = assembly c89 c99 c11 c18 c++98 c++11 d objectivepascal go haskell mruby nim odin pony python ring rust v zig\n\n# These two currently does not build:\n# SAMPLES += ocaml\n\n# gccgo works, but installing gccgo conflicts with go\n# SAMPLES += gccgo\n\n.PHONY: all run clean fullclean\n\nall:\n\t@-$(foreach x,$(SAMPLES),make -C $(x);)\n\nrun:\n\t@-$(foreach x,$(SAMPLES),make -C $(x) run;)\n\nclean:\n\t@-$(foreach x,$(SAMPLES),make -C $(x) clean;)\n\nfullclean:\n\t@-$(foreach x,$(SAMPLES),make -C $(x) fullclean;)\n"
  },
  {
    "path": "README.md",
    "content": "SDL2 Examples\n=============\n\n[![sdl2-examples](https://github.com/xyproto/sdl2-examples/actions/workflows/main.yml/badge.svg)](https://github.com/xyproto/sdl2-examples/actions/workflows/main.yml)\n\n\"hello world\" for SDL2 for various programming languages.\n\nEach sample creates a window, displays an image, then waits two seconds and quits.\n\nAll executables should ideally build and run on Linux, macOS, Windows, BSD* and more, but they should at least work on Linux. Most subdirectories contains `README.md` files with more details, and a `Makefile` to have one way of building each sample.\n\nFor newer versions of macOS, the programs also appear to need an event loop for the window to show up, so I'm in the process of adding that to each example. The window just isn't shown if there is no event loop.\n\n\nRequirements\n------------\n\n* The SDL 2 library.\n* See the README.md file per sample for more information.\n\n\nRequirements for some of the languages\n--------------------------------------\n\n* C compiler that supports C89 (ANSI C), C99 or C11, for the C samples\n* A C++ compiler for the C++ sample\n* GCC 4.8 or later (or clang++) for the C++11 sample\n* Go 1.1 or later and the sdl2 go package (`go get github.com/veandco/go-sdl2/sdl`)\n* MRuby with SDL2 added to the configuration file\n* Nim 0.9.4 and sdl2 installed with babel\n* Python 2 or 3 and PySDL2\n* FPC 2.6.4 (or later than 2.4.0, must have Uint8, Uint16 and Uint32)\n* Lua (tested with Lua 5.3) and lua-sdl2\n* If `tcc` is used for compiling one of the C examples, make sure to add [`-DSDL_DISABLE_IMMINTRIN_H=1`](https://www.mail-archive.com/tinycc-devel@nongnu.org/msg08821.html).\n\n\nLanguages that are not added yet\n--------------------------------\n\n- [ ] Ada (but there is an `ada` branch if you wish to give it a spin. Please create a PR if it works on Arch Linux and/or the Linux CI test passes!).\n- [ ] C3 (but there is a `c3` branch with \"Hello World\" in C3).\n- [ ] Fortran\n- [ ] Scheme\n\nPull requests are welcome.\n\n\nGeneral information\n----------------------\n\n* License: BSD-3\n"
  },
  {
    "path": "assembly/Makefile",
    "content": "PLATFORMS = linux-i386 linux-x86_64\n\n.PHONY: all run clean fullclean\n\nall:\n\t@-$(foreach x,$(PLATFORMS),make -C $(x);)\n\nrun:\n\t@-$(foreach x,$(PLATFORMS),make -C $(x) run;)\n\nclean:\n\t@-$(foreach x,$(PLATFORMS),make -C $(x) clean;)\n\nfullclean:\n\t@-$(foreach x,$(PLATFORMS),make -C $(x) fullclean;)\n"
  },
  {
    "path": "assembly/README.md",
    "content": "Note that the executables that are generated from Assembly are only intended to work on the target system they are crafted for.\n"
  },
  {
    "path": "assembly/linux-i386/Makefile",
    "content": ".PHONY: all msg clean fullclean\n\n# Look for libraries in /usr/lib32 when linking if on i386, i686 or x86_32\nifeq ($(findstring $(shell uname -m),i386 i686 x86_32),)\nLDFLAGS+=-L/usr/lib32\nendif\n\nall: msg main\n\nmsg:\n\t@echo '--- i386 ---'\n\nmain:\n\tnasm -felf32 main.asm -o main.o\n\tld -m elf_i386 main.o -o main -dynamic-linker /lib/ld-linux.so.* -lc -lSDL2 $(LDFLAGS)\n\nrun: msg main\n\ttime ./main\n\nclean:\n\trm -f main main.o\n\nfullclean: clean\n"
  },
  {
    "path": "assembly/linux-i386/README.md",
    "content": "Requirements\n------------\n\n* nasm\n* sdl2\n"
  },
  {
    "path": "assembly/linux-i386/main.asm",
    "content": "section .text\nglobal _start\n\nextern printf\nextern exit\nextern SDL_Init\nextern SDL_CreateWindow\nextern SDL_CreateRenderer\nextern SDL_LoadBMP_RW\nextern SDL_RWFromFile\nextern SDL_CreateTextureFromSurface\nextern SDL_FreeSurface\nextern SDL_RenderClear\nextern SDL_RenderCopy\nextern SDL_RenderPresent\nextern SDL_Delay\nextern SDL_DestroyTexture\nextern SDL_DestroyRenderer\nextern SDL_DestroyWindow\nextern SDL_Quit\nextern SDL_GetError\n\n_start:\n  push 62001\n  call SDL_Init\n  add esp, 4\n  cmp eax, 0\n  jl init_err\n  push 4\n  push 387\n  push 620\n  push 100\n  push 100\n  push create_window_arg0\n  call SDL_CreateWindow\n  add esp, 24\n  cmp eax, 0\n  je create_window_err\n  mov ebx, eax\n  push 6\n  push -1\n  push eax\n  call SDL_CreateRenderer\n  add esp, 12\n  cmp eax, 0\n  je create_renderer_err\n  mov esi, eax\n  push readbin\n  push bmp_path\n  call SDL_RWFromFile\n  add esp, 8\n  push 1\n  push eax\n  call SDL_LoadBMP_RW\n  add esp, 8\n  cmp eax, 0\n  je load_bmp_err\n  mov edi, eax\n  push eax\n  push esi\n  call SDL_CreateTextureFromSurface\n  add esp, 8\n  cmp eax, 0\n  je create_tfs_err\n  push edi\n  mov edi, eax\n  call SDL_FreeSurface\n  add esp, 4\n  push ebx\n  xor ebx, ebx\nloop0:\n  push esi\n  call SDL_RenderClear\n  add esp, 4\n  push 0\n  push 0\n  push edi\n  push esi\n  call SDL_RenderCopy\n  add esp, 16\n  push esi\n  call SDL_RenderPresent\n  add esp, 4\n  push 100\n  call SDL_Delay\n  add esp, 4\n  inc ebx\n  cmp ebx, 20\n  jl loop0\n  pop ebx\n  push edi\n  call SDL_DestroyTexture\n  add esp, 4\n  push esi\n  call SDL_DestroyRenderer\n  add esp, 4\n  push ebx\n  call SDL_DestroyWindow\n  add esp, 4\n  call SDL_Quit\n  push 0\n  call exit\ninit_err:\n  call SDL_GetError\n  push eax\n  push init_err_msg\n  call printf\n  add esp, 8\n  push 8\n  call exit\ncreate_window_err:\n  call SDL_GetError\n  push eax\n  push create_window_err_msg\n  call printf\n  add esp, 8\n  push 8\n  call exit\ncreate_renderer_err:\n  call SDL_GetError\n  push eax\n  push create_renderer_err_msg\n  call printf\n  add esp, 8\n  push ebx\n  call SDL_DestroyWindow\n  add esp, 4\n  call SDL_Quit\n  push 8\n  call exit\nload_bmp_err:\n  call SDL_GetError\n  push eax\n  push load_bmp_err_msg\n  call printf\n  add esp, 8\n  push esi\n  call SDL_DestroyRenderer\n  add esp, 4\n  push ebx\n  call SDL_DestroyWindow\n  add esp, 4\n  call SDL_Quit\n  push 8\n  call exit\ncreate_tfs_err:\n  call SDL_GetError\n  push eax\n  push create_tfs_err_msg\n  call printf\n  add esp, 8\n  push edi\n  call SDL_FreeSurface\n  add esp, 4\n  push esi\n  call SDL_DestroyRenderer\n  add esp, 4\n  push ebx\n  call SDL_DestroyWindow\n  add esp, 4\n  call SDL_Quit\n  push 8\n  call exit\n\n\nsection .data\n\ninit_err_msg            db \"SDL_Init Error: %s\", 10, 0\n\ncreate_window_arg0      db \"Hello World!\", 0\n\ncreate_window_err_msg   db \"SDL_CreateWindow Error: %s\", 10, 0\n\ncreate_renderer_err_msg db \"SDL_CreateRenderer Error: %s\", 10, 0\n\nbmp_path                db \"../../img/grumpy-cat.bmp\", 0\n\nreadbin                 db \"rb\", 0\n\nload_bmp_err_msg        db \"SDL_LoadBMP Error: %s\", 10, 0\n\ncreate_tfs_err_msg      db \"SDL_CreateTextureFromSurface Error: %s\", 10, 0\n"
  },
  {
    "path": "assembly/linux-x86_64/Makefile",
    "content": ".PHONY: all msg clean fullclean\n\nall: msg main\n\nmsg:\n\t@echo '--- x86_64 ---'\n\nmain:\n\tnasm -felf64 main.asm -o main.o\n\tld main.o -o main -dynamic-linker /lib64/ld-linux-x86-64.so.* -lc -lSDL2\n\nrun: msg main\n\ttime ./main\n\nclean:\n\trm -f main main.o\n\nfullclean: clean\n"
  },
  {
    "path": "assembly/linux-x86_64/README.md",
    "content": "Requirements\n------------\n\n* nasm\n* sdl2\n"
  },
  {
    "path": "assembly/linux-x86_64/main.asm",
    "content": "section .text\nglobal _start\n\nextern printf\nextern exit\nextern SDL_Init\nextern SDL_CreateWindow\nextern SDL_CreateRenderer\nextern SDL_LoadBMP_RW\nextern SDL_RWFromFile\nextern SDL_CreateTextureFromSurface\nextern SDL_FreeSurface\nextern SDL_RenderClear\nextern SDL_RenderCopy\nextern SDL_RenderPresent\nextern SDL_Delay\nextern SDL_DestroyTexture\nextern SDL_DestroyRenderer\nextern SDL_DestroyWindow\nextern SDL_Quit\nextern SDL_GetError\n\n_start:\n  mov rdi, 62001\n  call SDL_Init\n  cmp rax, 0\n  jl init_err\n  mov rdi, create_window_arg0\n  mov rsi, 100\n  mov rdx, 100\n  mov rcx, 620\n  mov r8, 387\n  mov r9, 4\n  call SDL_CreateWindow\n  cmp rax, 0\n  je create_window_err\n  mov r12, rax\n  mov rdi, rax\n  mov rsi, -1\n  mov rdx, 6\n  call SDL_CreateRenderer\n  cmp rax, 0\n  je create_renderer_err\n  mov r13, rax\n  mov rdi, bmp_path\n  mov rsi, readbin\n  call SDL_RWFromFile\n  mov rdi, rax\n  mov rsi, 1\n  call SDL_LoadBMP_RW\n  cmp rax, 0\n  je load_bmp_err\n  mov r14, rax\n  mov rdi, r13\n  mov rsi, rax\n  call SDL_CreateTextureFromSurface\n  cmp rax, 0\n  je create_tfs_err\n  mov r15, rax\n  mov rdi, r14\n  call SDL_FreeSurface\n  xor r14, r14\nloop0:\n  mov rdi, r13\n  call SDL_RenderClear\n  mov rdi, r13\n  mov rsi, r15\n  mov rdx, 0\n  mov rcx, 0\n  call SDL_RenderCopy\n  mov rdi, r13\n  call SDL_RenderPresent\n  mov rdi, 100\n  call SDL_Delay\n  inc r14\n  cmp r14, 20\n  jl loop0\n  mov rdi, r15\n  call SDL_DestroyTexture\n  mov rdi, r13\n  call SDL_DestroyRenderer\n  mov rdi, r12\n  call SDL_DestroyWindow\n  call SDL_Quit\n  mov rdi, 0\n  call exit\ninit_err:\n  call SDL_GetError\n  mov rsi, rax\n  mov rdi, init_err_msg\n  call printf\n  mov rdi, 8\n  call exit\ncreate_window_err:\n  call SDL_GetError\n  mov rsi, rax\n  mov rdi, create_window_err_msg\n  call printf\n  mov rdi, 8\n  call exit\ncreate_renderer_err:\n  call SDL_GetError\n  mov rsi, rax\n  mov rdi, create_renderer_err_msg\n  call printf\n  mov rdi, r12\n  call SDL_DestroyWindow\n  call SDL_Quit\n  mov rdi, 8\n  call exit\nload_bmp_err:\n  call SDL_GetError\n  mov rsi, rax\n  mov rdi, load_bmp_err_msg\n  call printf\n  mov rdi, r13\n  call SDL_DestroyRenderer\n  mov rdi, r12\n  call SDL_DestroyWindow\n  call SDL_Quit\n  mov rdi, 8\n  call exit\ncreate_tfs_err:\n  call SDL_GetError\n  mov rsi, rax\n  mov rdi, create_tfs_err_msg\n  call printf\n  mov rdi, r14\n  call SDL_FreeSurface\n  mov rdi, r13\n  call SDL_DestroyRenderer\n  mov rdi, r12\n  call SDL_DestroyWindow\n  call SDL_Quit\n  mov rdi, 8\n  call exit\n\n\nsection .data\n\ninit_err_msg            db \"SDL_Init Error: %s\", 10, 0\n\ncreate_window_arg0      db \"Hello World!\", 0\n\ncreate_window_err_msg   db \"SDL_CreateWindow Error: %s\", 10, 0\n\ncreate_renderer_err_msg db \"SDL_CreateRenderer Error: %s\", 10, 0\n\nbmp_path                db \"../../img/grumpy-cat.bmp\", 0\n\nreadbin                 db \"rb\", 0\n\nload_bmp_err_msg        db \"SDL_LoadBMP Error: %s\", 10, 0\n\ncreate_tfs_err_msg      db \"SDL_CreateTextureFromSurface Error: %s\", 10, 0\n\n;asdf\n"
  },
  {
    "path": "assembly/macos-x86_64/Makefile",
    "content": ".PHONY: all msg clean fullclean\n\nall: msg main\n\nmsg:\n\t@echo '--- x86_64 ---'\n\nmain:\n\tnasm -fmacho64 main.asm -o main.o\n\tld main.o -o main -lc -lSDL2\n\nrun: msg main\n\ttime ./main\n\nclean:\n\trm -f main main.o\n\nfullclean: clean\n"
  },
  {
    "path": "assembly/macos-x86_64/README.md",
    "content": "Requirements\n------------\n\n* nasm\n* Xcode Command Line Tools\n* sdl2\n"
  },
  {
    "path": "assembly/macos-x86_64/main.asm",
    "content": "section .text\nglobal _main\n\nextern _printf\nextern _exit\nextern _SDL_Init\nextern _SDL_CreateWindow\nextern _SDL_CreateRenderer\nextern _SDL_LoadBMP_RW\nextern _SDL_RWFromFile\nextern _SDL_CreateTextureFromSurface\nextern _SDL_FreeSurface\nextern _SDL_RenderClear\nextern _SDL_RenderCopy\nextern _SDL_RenderPresent\nextern _SDL_Delay\t\nextern _SDL_DestroyTexture\nextern _SDL_DestroyRenderer\nextern _SDL_DestroyWindow\nextern _SDL_Quit\nextern _SDL_GetError\n\n_main:\n\tsub rsp, 8\n\tmov rdi, 62001\n\tcall _SDL_Init\n\tcmp rax, 0\n\tjl init_err\n\tmov rdi, create_window_arg0\n\tmov rsi, 100\n\tmov rdx, 100\n\tmov rcx, 960\n\tmov r8, 720\n\tmov r9, 4\n\tcall _SDL_CreateWindow\n\tcmp rax, 0\n\tje create_window_err\n\tmov r12, rax\n\tmov rdi, rax\n\tmov rsi, -1\n\tmov rdx, 6\n\tcall _SDL_CreateRenderer\n\tcmp rax, 0\n\tje create_renderer_err\n\tmov r13, rax\n\tmov rdi, bmp_path\n\tmov rsi, readbin\n\tcall _SDL_RWFromFile\n\tmov rdi, rax\n\tmov rsi, 1\n\tcall _SDL_LoadBMP_RW\n\tcmp rax, 0\n\tje load_bmp_err\n\tmov r14, rax\n\tmov rdi, r13\n\tmov rsi, rax\n\tcall _SDL_CreateTextureFromSurface\n\tcmp rax, 0\n\tje create_tfs_err\n\tmov r15, rax\n\tmov rdi, r14\n\tcall _SDL_FreeSurface\n\txor r14, r14\nloop0:\n\tmov rdi, r13\n\tcall _SDL_RenderClear\n\tmov rdi, r13\n\tmov rsi, r15\n\tmov rdx, 0\n\tmov rcx, 0\n\tcall _SDL_RenderCopy\t\n\tmov rdi, r13\n\tcall _SDL_RenderPresent\t\n\tmov rdi, 100\n\tcall _SDL_Delay\n\tinc r14\n\tcmp r14, 20\n\tjl loop0\n\tmov rdi, r15\n\tcall _SDL_DestroyTexture\n\tmov rdi, r13\n\tcall _SDL_DestroyRenderer\n\tmov rdi, r12\n\tcall _SDL_DestroyWindow\n\tcall _SDL_Quit\n\tmov rdi, 0\n\tcall _exit\ninit_err:\n\tcall _SDL_GetError\n\tmov rsi, rax\n\tmov rdi, init_err_msg\n\tcall _printf\n\tmov rdi, 8\n\tcall _exit\ncreate_window_err:\n\tcall _SDL_GetError\n\tmov rsi, rax\n\tmov rdi, create_window_err_msg\n\tcall _printf\n\tmov rdi, 8\n\tcall _exit\ncreate_renderer_err:\n\tcall _SDL_GetError\n\tmov rsi, rax\n\tmov rdi, create_renderer_err_msg\n\tcall _printf\n\tmov rdi, r12\n\tcall _SDL_DestroyWindow\n\tcall _SDL_Quit\n\tmov rdi, 8\n\tcall _exit\nload_bmp_err:\n\tcall _SDL_GetError\n\tmov rsi, rax\n\tmov rdi, load_bmp_err_msg\n\tcall _printf\n\tmov rdi, r13\n\tcall _SDL_DestroyRenderer\n\tmov rdi, r12\n\tcall _SDL_DestroyWindow\n\tcall _SDL_Quit\n\tmov rdi, 8\n\tcall _exit\ncreate_tfs_err:\n\tcall _SDL_GetError\n\tmov rsi, rax\n\tmov rdi, create_tfs_err_msg\n\tcall _printf\n\tmov rdi, r14\n\tcall _SDL_FreeSurface\n\tmov rdi, r13\n\tcall _SDL_DestroyRenderer\n\tmov rdi, r12\n\tcall _SDL_DestroyWindow\n\tcall _SDL_Quit\n\tmov rdi, 8\n\tcall _exit\n\n\nsection .data\n\ninit_err_msg            db \"SDL_Init Error: %s\", 10, 0\n\ncreate_window_arg0      db \"Hello World!\", 0\n\t\ncreate_window_err_msg   db \"SDL_CreateWindow Error: %s\", 10, 0\n\ncreate_renderer_err_msg db \"SDL_CreateRenderer Error: %s\", 10, 0\n\nbmp_path                db \"../../img/grumpy-cat.bmp\", 0\n\nreadbin                 db \"rb\", 0\n\nload_bmp_err_msg        db \"SDL_LoadBMP Error: %s\", 10, 0\n\ncreate_tfs_err_msg      db \"SDL_CreateTextureFromSurface Error: %s\", 10, 0\n"
  },
  {
    "path": "assembly/windows-x86_64/README.md",
    "content": "Requirements\n------------\n\n* nasm\n* GoLink\n* sdl2\n"
  },
  {
    "path": "assembly/windows-x86_64/main.asm",
    "content": "section .text\nglobal Start\n\nextern printf\nextern exit\nextern SDL_Init\nextern SDL_CreateWindow\nextern SDL_CreateRenderer\nextern SDL_LoadBMP_RW\nextern SDL_RWFromFile\nextern SDL_CreateTextureFromSurface\nextern SDL_FreeSurface\nextern SDL_RenderClear\nextern SDL_RenderCopy\nextern SDL_RenderPresent\nextern SDL_Delay\t\nextern SDL_DestroyTexture\nextern SDL_DestroyRenderer\nextern SDL_DestroyWindow\nextern SDL_Quit\nextern SDL_GetError\n\nStart:\n\tsub rsp, 56\n\tmov rcx, 62001\n\tcall SDL_Init\n\tcmp rax, 0\n\tjl init_err\n\tmov rcx, create_window_arg0\n\tmov rdx, 100\n\tmov r8, 100\n\tmov r9, 960\n\tmov qword [rsp+32], 720\n\tmov qword [rsp+40], 4\n\tcall SDL_CreateWindow\n\tcmp rax, 0\n\tje create_window_err\n\tmov r12, rax\n\tmov rcx, rax\n\tmov rdx, -1\n\tmov r8, 6\n\tcall SDL_CreateRenderer\n\tcmp rax, 0\n\tje create_renderer_err\n\tmov r13, rax\n\tmov rcx, bmp_path\n\tmov rdx, readbin\n\tcall SDL_RWFromFile\n\tmov rcx, rax\n\tmov rdx, 1\n\tcall SDL_LoadBMP_RW\n\tcmp rax, 0\n\tje load_bmp_err\n\tmov r14, rax\n\tmov rcx, r13\n\tmov rdx, rax\n\tcall SDL_CreateTextureFromSurface\n\tcmp rax, 0\n\tje create_tfs_err\n\tmov r15, rax\n\tmov rcx, r14\n\tcall SDL_FreeSurface\n\txor r14, r14\nloop0:\n\tmov rcx, r13\n\tcall SDL_RenderClear\n\tmov rcx, r13\n\tmov rdx, r15\n\tmov r8, 0\n\tmov r9, 0\n\tcall SDL_RenderCopy\t\n\tmov rcx, r13\n\tcall SDL_RenderPresent\t\n\tmov rcx, 100\n\tcall SDL_Delay\n\tinc r14\n\tcmp r14, 20\n\tjl loop0\n\tmov rcx, r15\n\tcall SDL_DestroyTexture\n\tmov rcx, r13\n\tcall SDL_DestroyRenderer\n\tmov rcx, r12\n\tcall SDL_DestroyWindow\n\tcall SDL_Quit\n\tadd rsp, 56\n\tmov rcx, 0\n\tcall exit\ninit_err:\n\tcall SDL_GetError\n\tmov rdx, rax\n\tmov rcx, init_err_msg\n\tcall printf\n\tadd rsp, 56\n\tmov rcx, 8\n\tcall exit\ncreate_window_err:\n\tcall SDL_GetError\n\tmov rdx, rax\n\tmov rcx, create_window_err_msg\n\tcall printf\n\tadd rsp, 56\n\tmov rcx, 8\n\tcall exit\ncreate_renderer_err:\n\tcall SDL_GetError\n\tmov rdx, rax\n\tmov rcx, create_renderer_err_msg\n\tcall printf\n\tmov rcx, r12\n\tcall SDL_DestroyWindow\n\tcall SDL_Quit\n\tadd rsp, 56\n\tmov rcx, 8\n\tcall exit\nload_bmp_err:\n\tcall SDL_GetError\n\tmov rdx, rax\n\tmov rcx, load_bmp_err_msg\n\tcall printf\n\tmov rcx, r13\n\tcall SDL_DestroyRenderer\n\tmov rcx, r12\n\tcall SDL_DestroyWindow\n\tcall SDL_Quit\n\tadd rsp, 56\n\tmov rcx, 8\n\tcall exit\ncreate_tfs_err:\n\tcall SDL_GetError\n\tmov rdx, rax\n\tmov rcx, create_tfs_err_msg\n\tcall printf\n\tmov rcx, r14\n\tcall SDL_FreeSurface\n\tmov rcx, r13\n\tcall SDL_DestroyRenderer\n\tmov rcx, r12\n\tcall SDL_DestroyWindow\n\tcall SDL_Quit\n\tadd rsp, 56\n\tmov rcx, 8\n\tcall exit\n\n\nsection .data\n\ninit_err_msg            db \"SDL_Init Error: %s\", 10, 0\n\ncreate_window_arg0      db \"Hello World!\", 0\n\t\ncreate_window_err_msg   db \"SDL_CreateWindow Error: %s\", 10, 0\n\ncreate_renderer_err_msg db \"SDL_CreateRenderer Error: %s\", 10, 0\n\nbmp_path                db \"..\\..\\img\\grumpy-cat.bmp\", 0\n\nreadbin                 db \"rb\", 0\n\nload_bmp_err_msg        db \"SDL_LoadBMP Error: %s\", 10, 0\n\ncreate_tfs_err_msg      db \"SDL_CreateTextureFromSurface Error: %s\", 10, 0\t\n"
  },
  {
    "path": "bench.sh",
    "content": "#!/bin/sh\n#\n# csv.sh\n#\n# Measure approximately how long it takes to build each example,\n# and how large the resulting executable is.\n#\n# The examples are (mostly) not size-optimized, so the sizes will vary\n# a lot, without saying much about the programming language.\n#\n# For instance, Go produces large executables by default, but when using\n# gccgo, -Os and upx, the executables are orders of magnitude smaller.\n#\n\nbench() {\n  echo -n \"$1;\"\n  pushd \"$1\" > /dev/null\n  make -s clean > /dev/null\n  echo -n $(time -f \"%es\" make -s 2>&1 | tail -1)\n  echo -n ';'\n  echo -n $(du -b \"$2\" | sed 's/[^0-9]//g')\n  popd > /dev/null\n  echo\n}\n\ncmakebench() {\n  echo -n \"$1;\"\n  pushd \"$1\" > /dev/null\n  test -d build && rm -r build || true\n  echo -n $(time -f \"%es\" cmake -S . -B build 2>&1 > /dev/null && make -C build 2>&1 >/dev/null | tr -d '\\n')\n  echo -n ';'\n  echo -n $(du -b \"build/$2\" | sed 's/[^0-9]//g')\n  popd > /dev/null\n  echo\n}\n\ncxxbench() {\n  echo -n \"$1;\"\n  pushd \"$1\" > /dev/null\n  cxx clean > /dev/null\n  echo -n $(time -f \"%es\" cxx 2>&1 >/dev/null | tr -d '\\n')\n  echo -n ';'\n  echo -n $(du -b \"$2\" | sed 's/[^0-9]//g')\n  popd > /dev/null\n  echo\n\n}\n\nstackbench() {\n  echo -n \"$1;\"\n  pushd \"$1\" > /dev/null\n  stack clean > /dev/null\n  echo -n $(time -f \"%es\" stack build 2>&1 | tail -1)\n  echo -n ';'\n  local filename=$(find . -executable -type f -name grumpycat-exe -printf \"%T@ %Tc %p\\n\" | sort -n | tail -1 | rev | cut -d' ' -f1 | rev)\n  echo -n $(du -b $filename) | tr ' ' '\\n' | head -1 | tr -d '\\n'\n  popd > /dev/null\n  echo\n}\n\nmain() {\n  echo 'language;compilation;bytesize'\n  bench go go\n  bench ada main\n  for f in c89 c++98 c99 c11 c++11 c18 c2x; do\n    bench \"$f\" main\n  done\n  for f in *-cmake; do\n    cmakebench \"$f\" main\n  done\n  #cxxbench c++20-cxx c++20-cxx\n  bench crystal bin/main\n  bench csharp main\n  bench d main\n  bench objectivepascal main\n  bench freebasic main\n  stackbench haskell\n  # TODO: Add the other languages as well, except for gccgo, mruby, lua and python\n}\n\nmain\n"
  },
  {
    "path": "c++11/Makefile",
    "content": "CXX?=c++\nSDL2FLAGS=$(shell pkg-config sdl2 --cflags --libs)\nCXXFLAGS?=-std=c++11 -Wall -pedantic -Werror -Wshadow -Wstrict-aliasing -Wstrict-overflow\n\n.PHONY: all msg clean fullclean\n\nall: msg main\n\nmsg:\n\t@echo '--- C++11 ---'\n\nmain: main.cpp\n\t${CXX} ${CXXFLAGS} -O2 -o $@ $< ${SDL2FLAGS}\n\nsmall: main.cpp\n\t${CXX} ${CXXFLAGS} -Os -o main $< ${SDL2FLAGS}\n\t-strip main\n\t-sstrip main\n\ndebug: main.cpp\n\t${CXX} ${CXXFLAGS} -O0 -g -o main $< ${SDL2FLAGS}\n\nasm: main.asm\n\nmain.asm: main.cpp\n\t${CXX} ${CFLAGS} -S -masm=intel -Og -o main.asm $< ${SDL2FLAGS}\n\nrun: msg main\n\ttime ./main\n\nclean:\n\trm -f main *.o main.asm\n\nfullclean: clean\n"
  },
  {
    "path": "c++11/main.cpp",
    "content": "#include <SDL2/SDL.h>\n#include <cstdlib>\n#include <iostream>\n\nint main()\n{\n    using std::cerr;\n    using std::endl;\n\n    if (SDL_Init(SDL_INIT_EVERYTHING) != 0) {\n        cerr << \"SDL_Init Error: \" << SDL_GetError() << endl;\n        return EXIT_FAILURE;\n    }\n\n    SDL_Window* win = SDL_CreateWindow(\"Hello World!\", 100, 100, 620, 387, SDL_WINDOW_SHOWN);\n    if (win == nullptr) {\n        cerr << \"SDL_CreateWindow Error: \" << SDL_GetError() << endl;\n        return EXIT_FAILURE;\n    }\n\n    SDL_Renderer* ren\n        = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);\n    if (ren == nullptr) {\n        cerr << \"SDL_CreateRenderer Error\" << SDL_GetError() << endl;\n\t\tif (win != nullptr) {\n\t\t\tSDL_DestroyWindow(win);\n\t\t}\n\t\tSDL_Quit();\n        return EXIT_FAILURE;\n    }\n\n    SDL_Surface* bmp = SDL_LoadBMP(\"../img/grumpy-cat.bmp\");\n    if (bmp == nullptr) {\n        cerr << \"SDL_LoadBMP Error: \" << SDL_GetError() << endl;\n\t\tif (ren != nullptr) {\n\t\t\tSDL_DestroyRenderer(ren);\n\t\t}\n\t\tif (win != nullptr) {\n\t\t\tSDL_DestroyWindow(win);\n\t\t}\n\t\tSDL_Quit();\n        return EXIT_FAILURE;\n    }\n\n    SDL_Texture* tex = SDL_CreateTextureFromSurface(ren, bmp);\n    if (tex == nullptr) {\n        cerr << \"SDL_CreateTextureFromSurface Error: \" << SDL_GetError() << endl;\n\t\tif (bmp != nullptr) {\n\t\t\tSDL_FreeSurface(bmp);\n\t\t}\n\t\tif (ren != nullptr) {\n\t\t\tSDL_DestroyRenderer(ren);\n\t\t}\n\t\tif (win != nullptr) {\n\t\t\tSDL_DestroyWindow(win);\n\t\t}\n\t\tSDL_Quit();\n        return EXIT_FAILURE;\n    }\n    SDL_FreeSurface(bmp);\n\n    for (int i = 0; i < 20; i++) {\n        SDL_RenderClear(ren);\n        SDL_RenderCopy(ren, tex, nullptr, nullptr);\n        SDL_RenderPresent(ren);\n        SDL_Delay(100);\n    }\n\n    SDL_DestroyTexture(tex);\n    SDL_DestroyRenderer(ren);\n    SDL_DestroyWindow(win);\n    SDL_Quit();\n\n    return EXIT_SUCCESS;\n}\n"
  },
  {
    "path": "c++11-cmake/CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.26)\n\nproject(main)\n\naux_source_directory(. SRC_LIST)\nadd_executable(${PROJECT_NAME} ${SRC_LIST})\n\ntarget_include_directories(${PROJECT_NAME} PRIVATE ../include)\ntarget_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)\ntarget_compile_definitions(${PROJECT_NAME} PRIVATE IMGDIR=\"../img/\")\n\n# For macOS M2 systems with SDL2 installed via Homebrew\nlist(APPEND CMAKE_MODULE_PATH \"/usr/local/lib/cmake/SDL2\" \"/opt/homebrew/lib/cmake/SDL2\")\nlist(APPEND CMAKE_PREFIX_PATH \"/usr/local\" \"/opt/homebrew\")\n\nfind_package(SDL2 QUIET)\n\nif (SDL2_FOUND)\n    message(\"Using SDL2 from find_package\")\n    target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})\n    target_link_libraries(${PROJECT_NAME} PRIVATE ${SDL2_LIBRARIES})\nelse()\n    # Fall back on pkg-config\n    include(FindPkgConfig)\n    pkg_search_module(SDL2 REQUIRED sdl2)\n    message(\"Using SDL2 from pkg-config\")\n    target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})\n    target_link_libraries(${PROJECT_NAME} PRIVATE ${SDL2_LIBRARIES})\nendif()\n"
  },
  {
    "path": "c++11-cmake/README.md",
    "content": "SDL2, C++11 and CMake\n=====================\n\nRequirements\n------------\n\n* CMake\n* Compiler that supports C++ (recent version of g++ or clang++)\n* SDL2\n\nOne way of building with C++11, SDL2 and CMake\n----------------------------------------------\n\n    cmake -S . -B build -DCMAKE_BUILD_TYPE=Release\n    make -C build\n\nRunning\n-------\n\n    build/main\n\nCleaning up the binary file and build directory\n-----------------------------------------------\n\n    rm -rf build/ main\n"
  },
  {
    "path": "c++11-cmake/main.cpp",
    "content": "#include <SDL2/SDL.h>\n#include <cstdlib>\n#include <iostream>\n\nint main()\n{\n    using std::cerr;\n    using std::endl;\n\n    if (SDL_Init(SDL_INIT_EVERYTHING) != 0) {\n        cerr << \"SDL_Init Error: \" << SDL_GetError() << endl;\n        return EXIT_FAILURE;\n    }\n\n    SDL_Window* win = SDL_CreateWindow(\"Hello World!\", 100, 100, 620, 387, SDL_WINDOW_SHOWN);\n    if (win == nullptr) {\n        cerr << \"SDL_CreateWindow Error: \" << SDL_GetError() << endl;\n        return EXIT_FAILURE;\n    }\n\n    SDL_Renderer* ren\n        = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);\n    if (ren == nullptr) {\n        cerr << \"SDL_CreateRenderer Error\" << SDL_GetError() << endl;\n        SDL_DestroyWindow(win);\n        SDL_Quit();\n        return EXIT_FAILURE;\n    }\n\n    SDL_Surface* bmp = SDL_LoadBMP(\"../img/grumpy-cat.bmp\");\n    if (bmp == nullptr) {\n        cerr << \"SDL_LoadBMP Error: \" << SDL_GetError() << endl;\n        SDL_DestroyRenderer(ren);\n        SDL_DestroyWindow(win);\n        SDL_Quit();\n        return EXIT_FAILURE;\n    }\n\n    SDL_Texture* tex = SDL_CreateTextureFromSurface(ren, bmp);\n    if (tex == nullptr) {\n        cerr << \"SDL_CreateTextureFromSurface Error: \" << SDL_GetError() << endl;\n        SDL_FreeSurface(bmp);\n        SDL_DestroyRenderer(ren);\n        SDL_DestroyWindow(win);\n        SDL_Quit();\n        return EXIT_FAILURE;\n    }\n    SDL_FreeSurface(bmp);\n\n    for (int i = 0; i < 20; i++) {\n        SDL_RenderClear(ren);\n        SDL_RenderCopy(ren, tex, nullptr, nullptr);\n        SDL_RenderPresent(ren);\n        SDL_Delay(100);\n    }\n\n    SDL_DestroyTexture(tex);\n    SDL_DestroyRenderer(ren);\n    SDL_DestroyWindow(win);\n    SDL_Quit();\n\n    return EXIT_SUCCESS;\n}\n"
  },
  {
    "path": "c++14-cmake/CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.26)\n\nproject(main)\n\naux_source_directory(. SRC_LIST)\nadd_executable(${PROJECT_NAME} ${SRC_LIST})\n\ntarget_include_directories(${PROJECT_NAME} PRIVATE ../include)\ntarget_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)\ntarget_compile_definitions(${PROJECT_NAME} PRIVATE IMGDIR=\"../img/\")\n\n# For macOS M2 systems with SDL2 installed via Homebrew\nlist(APPEND CMAKE_MODULE_PATH \"/usr/local/lib/cmake/SDL2\" \"/opt/homebrew/lib/cmake/SDL2\")\nlist(APPEND CMAKE_PREFIX_PATH \"/usr/local\" \"/opt/homebrew\")\n\n# Try the modern way first\nfind_package(SDL2 QUIET)\n\nif (SDL2_FOUND)\n    message(\"Using SDL2 from find_package\")\n    target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})\n    target_link_libraries(${PROJECT_NAME} PRIVATE ${SDL2_LIBRARIES})\nelse()\n    # Fall back on pkg-config\n    include(FindPkgConfig)\n    pkg_search_module(SDL2 REQUIRED sdl2)\n    message(\"Using SDL2 from pkg-config\")\n    target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})\n    target_link_libraries(${PROJECT_NAME} PRIVATE ${SDL2_LIBRARIES})\nendif()\n"
  },
  {
    "path": "c++14-cmake/README.md",
    "content": "SDL2, C++14 and CMake\n=====================\n\nRequirements\n------------\n\n* CMake\n* Compiler that supports C++14 (recent version of `g++` or `clang++`)\n* SDL2\n\nOne way of building with C++14, SDL2 and CMake\n----------------------------------------------\n\n    cmake -S . -B build -DCMAKE_BUILD_TYPE=Release\n    make -C build\n\n\nRunning\n-------\n\n    build/main\n\nCleaning up the binary file and build directory\n-----------------------------------------------\n\n    rm -rf build/\n"
  },
  {
    "path": "c++14-cmake/main.cpp",
    "content": "#include <SDL2/SDL.h>\n#include <iostream>\n\n#include \"sdl2.h\"\n\nauto main() -> int\n{\n    using std::cerr;\n    using std::endl;\n\n    auto sys = sdl2::make_sdlsystem(SDL_INIT_EVERYTHING);\n    if (!sys) {\n        cerr << \"Error creating SDL2 system: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    auto win = sdl2::make_window(\"Hello World!\", 100, 100, 620, 387, SDL_WINDOW_SHOWN);\n    if (!win) {\n        cerr << \"Error creating window: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    auto ren\n        = sdl2::make_renderer(win.get(), -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);\n    if (!ren) {\n        cerr << \"Error creating renderer: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    auto file = SDL_RWFromFile(IMGDIR \"grumpy-cat.bmp\", \"rb\");\n    if (file == nullptr) {\n        cerr << \"Error reading file: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    auto bmp = sdl2::make_bmp(file);\n    if (!bmp) {\n        cerr << \"Error creating surface: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    auto tex = sdl2::make_texture(ren.get(), bmp.get());\n    if (!tex) {\n        cerr << \"Error creating texture: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    for (int i = 0; i < 20; i++) {\n        SDL_RenderClear(ren.get());\n        SDL_RenderCopy(ren.get(), tex.get(), nullptr, nullptr);\n        SDL_RenderPresent(ren.get());\n        SDL_Delay(100);\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "c++17-cmake/CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.26)\n\nproject(main)\n\naux_source_directory(. SRC_LIST)\nadd_executable(${PROJECT_NAME} ${SRC_LIST})\n\ntarget_include_directories(${PROJECT_NAME} PRIVATE ../include)\ntarget_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)\ntarget_compile_definitions(${PROJECT_NAME} PRIVATE IMGDIR=\"../img/\")\n\n# For macOS M2 systems with SDL2 installed via Homebrew\nlist(APPEND CMAKE_MODULE_PATH \"/usr/local/lib/cmake/SDL2\" \"/opt/homebrew/lib/cmake/SDL2\")\nlist(APPEND CMAKE_PREFIX_PATH \"/usr/local\" \"/opt/homebrew\")\n\nfind_package(SDL2 QUIET)\n\nif (SDL2_FOUND)\n    message(\"Using SDL2 from find_package\")\n    target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})\n    target_link_libraries(${PROJECT_NAME} PRIVATE ${SDL2_LIBRARIES})\nelse()\n    # Fall back on pkg-config\n    include(FindPkgConfig)\n    pkg_search_module(SDL2 REQUIRED sdl2)\n    message(\"Using SDL2 from pkg-config\")\n    target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})\n    target_link_libraries(${PROJECT_NAME} PRIVATE ${SDL2_LIBRARIES})\nendif()\n"
  },
  {
    "path": "c++17-cmake/README.md",
    "content": "SDL2, C++17 and CMake\n=====================\n\nRequirements\n------------\n\n* CMake\n* Compiler that supports C++17 (recent version of `g++` or `clang++`)\n* SDL2\n\nOne way of building with C++17, SDL2 and CMake\n----------------------------------------------\n\n    cmake -S . -B build -DCMAKE_BUILD_TYPE=Release\n    make -C build\n\nRunning\n-------\n\n    build/main\n\nCleaning up the binary file and build directory\n-----------------------------------------------\n\n    rm -rf build/\n"
  },
  {
    "path": "c++17-cmake/main.cpp",
    "content": "#include <SDL2/SDL.h>\n#include <iostream>\n\n#include \"sdl2.h\"\n\nauto main() -> int\n{\n    using std::cerr;\n    using std::endl;\n\n    auto sys = sdl2::make_sdlsystem(SDL_INIT_EVERYTHING);\n    if (!sys) {\n        cerr << \"Error creating SDL2 system: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    auto win = sdl2::make_window(\"Hello World!\", 100, 100, 620, 387, SDL_WINDOW_SHOWN);\n    if (!win) {\n        cerr << \"Error creating window: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    auto ren\n        = sdl2::make_renderer(win.get(), -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);\n    if (!ren) {\n        cerr << \"Error creating renderer: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    auto file = SDL_RWFromFile(IMGDIR \"grumpy-cat.bmp\", \"rb\");\n    if (file == nullptr) {\n        cerr << \"Error reading file: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    auto bmp = sdl2::make_bmp(file);\n    if (!bmp) {\n        cerr << \"Error creating surface: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    auto tex = sdl2::make_texture(ren.get(), bmp.get());\n    if (!tex) {\n        cerr << \"Error creating texture: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    for (int i = 0; i < 20; i++) {\n        SDL_RenderClear(ren.get());\n        SDL_RenderCopy(ren.get(), tex.get(), nullptr, nullptr);\n        SDL_RenderPresent(ren.get());\n        SDL_Delay(100);\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "c++20-cmake/CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.26)\n\nproject(main)\n\naux_source_directory(. SRC_LIST)\nadd_executable(${PROJECT_NAME} ${SRC_LIST})\n\ntarget_include_directories(${PROJECT_NAME} PRIVATE ../include)\ntarget_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)\ntarget_compile_definitions(${PROJECT_NAME} PRIVATE IMGDIR=\"../img/\")\n\n# For macOS M2 systems with SDL2 installed via Homebrew\nlist(APPEND CMAKE_MODULE_PATH \"/usr/local/lib/cmake/SDL2\" \"/opt/homebrew/lib/cmake/SDL2\")\nlist(APPEND CMAKE_PREFIX_PATH \"/usr/local\" \"/opt/homebrew\")\n\nfind_package(SDL2 QUIET)\n\nif (SDL2_FOUND)\n    message(\"Using SDL2 from find_package\")\n    target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})\n    target_link_libraries(${PROJECT_NAME} PRIVATE ${SDL2_LIBRARIES})\nelse()\n    # Fall back on pkg-config\n    include(FindPkgConfig)\n    pkg_search_module(SDL2 REQUIRED sdl2)\n    message(\"Using SDL2 from pkg-config\")\n    target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})\n    target_link_libraries(${PROJECT_NAME} PRIVATE ${SDL2_LIBRARIES})\nendif()\n"
  },
  {
    "path": "c++20-cmake/README.md",
    "content": "SDL2, C++20 and CMake\n=====================\n\nRequirements\n------------\n\n* CMake\n* Compiler that supports C++20 (recent version of `g++` or `clang++`)\n* SDL2\n\nOne way of building with C++20, SDL2 and CMake\n----------------------------------------------\n\n    cmake -S . -B build -DCMAKE_BUILD_TYPE=Release\n    make -C build\n\nRunning\n-------\n\n    build/main\n\nCleaning up the binary file and build directory\n-----------------------------------------------\n\n    rm -rf build/\n"
  },
  {
    "path": "c++20-cmake/main.cpp",
    "content": "#include <SDL2/SDL.h>\n#include <iostream>\n\n#include \"sdl2.h\"\n\nauto main() -> int\n{\n    using std::cerr;\n    using std::endl;\n\n    auto sys = sdl2::make_sdlsystem(SDL_INIT_EVERYTHING);\n    if (!sys) {\n        cerr << \"Error creating SDL2 system: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    auto win = sdl2::make_window(\"Hello World!\", 100, 100, 620, 387, SDL_WINDOW_SHOWN);\n    if (!win) {\n        cerr << \"Error creating window: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    auto ren\n        = sdl2::make_renderer(win.get(), -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);\n    if (!ren) {\n        cerr << \"Error creating renderer: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    auto file = SDL_RWFromFile(IMGDIR \"grumpy-cat.bmp\", \"rb\");\n    if (file == nullptr) {\n        cerr << \"Error reading file: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    auto bmp = sdl2::make_bmp(file);\n    if (!bmp) {\n        cerr << \"Error creating surface: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    auto tex = sdl2::make_texture(ren.get(), bmp.get());\n    if (!tex) {\n        cerr << \"Error creating texture: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    for (int i = 0; i < 20; i++) {\n        SDL_RenderClear(ren.get());\n        SDL_RenderCopy(ren.get(), tex.get(), nullptr, nullptr);\n        SDL_RenderPresent(ren.get());\n        SDL_Delay(100);\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "c++23-cmake/CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.26)\n\nproject(main)\n\naux_source_directory(. SRC_LIST)\nadd_executable(${PROJECT_NAME} ${SRC_LIST})\n\ntarget_include_directories(${PROJECT_NAME} PRIVATE ../include)\ntarget_compile_features(${PROJECT_NAME} PRIVATE cxx_std_23)\ntarget_compile_definitions(${PROJECT_NAME} PRIVATE IMGDIR=\"../img/\")\n\n# For macOS M2 systems with SDL2 installed via Homebrew\nlist(APPEND CMAKE_MODULE_PATH \"/usr/local/lib/cmake/SDL2\" \"/opt/homebrew/lib/cmake/SDL2\")\nlist(APPEND CMAKE_PREFIX_PATH \"/usr/local\" \"/opt/homebrew\")\n\nfind_package(SDL2 QUIET)\n\nif (SDL2_FOUND)\n    message(\"Using SDL2 from find_package\")\n    target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})\n    target_link_libraries(${PROJECT_NAME} PRIVATE ${SDL2_LIBRARIES})\nelse()\n    # Fall back on pkg-config\n    include(FindPkgConfig)\n    pkg_search_module(SDL2 REQUIRED sdl2)\n    message(\"Using SDL2 from pkg-config\")\n    target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})\n    target_link_libraries(${PROJECT_NAME} PRIVATE ${SDL2_LIBRARIES})\nendif()\n"
  },
  {
    "path": "c++23-cmake/README.md",
    "content": "SDL2, C++23 and CMake\n=====================\n\nRequirements\n------------\n\n* CMake\n* Compiler that supports C++23 (recent versions of `g++` or `clang++`, like GCC 11, supports `-std=c++2b`)\n* SDL2\n\nOne way of building with C++23, SDL2 and CMake\n----------------------------------------------\n\n    cmake -S . -B build -DCMAKE_BUILD_TYPE=Release\n    make -C build\n\nRunning\n-------\n\n    build/main\n\nCleaning up the binary file and build directory\n-----------------------------------------------\n\n    rm -rf build/\n"
  },
  {
    "path": "c++23-cmake/main.cpp",
    "content": "#include <SDL2/SDL.h>\n#include <iostream>\n\n#include \"sdl2.h\"\n\nauto main() -> int\n{\n    using std::cerr;\n    using std::endl;\n\n    auto sys = sdl2::make_sdlsystem(SDL_INIT_EVERYTHING);\n    if (!sys) {\n        cerr << \"Error creating SDL2 system: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    auto win = sdl2::make_window(\"Hello World!\", 100, 100, 620, 387, SDL_WINDOW_SHOWN);\n    if (!win) {\n        cerr << \"Error creating window: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    auto ren\n        = sdl2::make_renderer(win.get(), -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);\n    if (!ren) {\n        cerr << \"Error creating renderer: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    auto file = SDL_RWFromFile(IMGDIR \"grumpy-cat.bmp\", \"rb\");\n    if (file == nullptr) {\n        cerr << \"Error reading file: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    auto bmp = sdl2::make_bmp(file);\n    if (!bmp) {\n        cerr << \"Error creating surface: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    auto tex = sdl2::make_texture(ren.get(), bmp.get());\n    if (!tex) {\n        cerr << \"Error creating texture: \" << SDL_GetError() << endl;\n        return 1;\n    }\n\n    for (int i = 0; i < 20; i++) {\n        SDL_RenderClear(ren.get());\n        SDL_RenderCopy(ren.get(), tex.get(), nullptr, nullptr);\n        SDL_RenderPresent(ren.get());\n        SDL_Delay(100);\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "c++98/Makefile",
    "content": "CXX?=c++\nSDL2FLAGS=$(shell pkg-config sdl2 --cflags --libs)\nCXXFLAGS?=-std=c++98 -Wall -pedantic -Werror -Wshadow -Wstrict-aliasing -Wstrict-overflow\n\n.PHONY: all msg clean fullclean\n\nall: msg main\n\nmsg:\n\t@echo '--- C++98 ---'\n\nmain: main.cpp\n\t${CXX} ${CXXFLAGS} -O2 -o $@ $< ${SDL2FLAGS}\n\nsmall: main.cpp\n\t${CXX} ${CXXFLAGS} -Os -o main $< ${SDL2FLAGS}\n\t-strip main\n\t-sstrip main\n\ndebug: main.cpp\n\t${CXX} ${CXXFLAGS} -O0 -g -o main $< ${SDL2FLAGS}\n\nasm: main.asm\n\nmain.asm: main.cpp\n\t${CXX} ${CFLAGS} -S -masm=intel -Og -o main.asm $< ${SDL2FLAGS}\n\nrun: msg main\n\ttime ./main\n\nclean:\n\trm -f main *.o main.asm\n\nfullclean: clean\n"
  },
  {
    "path": "c++98/README.md",
    "content": "SDL2, C++98 and Make\n====================\n\nRequirements\n------------\n\n* Compiler that supports C++98\n* pkg-config\n* SDL2\n\nmacOS\n-----\n\nInstall pkg-config using brew, or use `-LSDL2` in the Makefile instead of using pkg-config.\n\n"
  },
  {
    "path": "c++98/main.cpp",
    "content": "#include <SDL2/SDL.h>\n#include <cstdlib>\n#include <iostream>\n\nint main()\n{\n    if (SDL_Init(SDL_INIT_EVERYTHING) != 0) {\n        std::cerr << \"SDL_Init Error: \" << SDL_GetError() << std::endl;\n        return EXIT_FAILURE;\n    }\n\n    SDL_Window* win = SDL_CreateWindow(\"Hello World!\", 100, 100, 620, 387, SDL_WINDOW_SHOWN);\n    if (win == NULL) {\n        std::cerr << \"SDL_CreateWindow Error: \" << SDL_GetError() << std::endl;\n        return EXIT_FAILURE;\n    }\n\n    SDL_Renderer* ren\n        = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);\n    if (ren == NULL) {\n        std::cerr << \"SDL_CreateRenderer Error: \" << SDL_GetError() << std::endl;\n        SDL_DestroyWindow(win);\n        SDL_Quit();\n        return EXIT_FAILURE;\n    }\n\n    SDL_Surface* bmp = SDL_LoadBMP(\"../img/grumpy-cat.bmp\");\n    if (bmp == NULL) {\n        std::cerr << \"SDL_LoadBMP Error: \" << SDL_GetError() << std::endl;\n        SDL_DestroyRenderer(ren);\n        SDL_DestroyWindow(win);\n        SDL_Quit();\n        return EXIT_FAILURE;\n    }\n\n    SDL_Texture* tex = SDL_CreateTextureFromSurface(ren, bmp);\n    if (tex == NULL) {\n        std::cerr << \"SDL_CreateTextureFromSurface Error: \" << SDL_GetError() << std::endl;\n        SDL_FreeSurface(bmp);\n        SDL_DestroyRenderer(ren);\n        SDL_DestroyWindow(win);\n        SDL_Quit();\n        return EXIT_FAILURE;\n    }\n    SDL_FreeSurface(bmp);\n\n    for (int i = 0; i < 20; i++) {\n        SDL_RenderClear(ren);\n        SDL_RenderCopy(ren, tex, NULL, NULL);\n        SDL_RenderPresent(ren);\n        SDL_Delay(100);\n    }\n\n    SDL_DestroyTexture(tex);\n    SDL_DestroyRenderer(ren);\n    SDL_DestroyWindow(win);\n    SDL_Quit();\n\n    return EXIT_SUCCESS;\n}\n"
  },
  {
    "path": "c11/Makefile",
    "content": "CC?=gcc\nSDL2FLAGS=$(shell pkg-config sdl2 --cflags --libs)\nCFLAGS?=-std=c11 -Wall -pedantic -Werror -Wshadow -Wstrict-aliasing -Wstrict-overflow\n\n.PHONY: all msg clean fullclean\n\nall: msg main\n\nmsg:\n\t@echo '--- C11 ---'\n\nmain: main.c\n\t${CC} ${CFLAGS} -O2 -o $@ $< ${SDL2FLAGS}\n\nsmall: main.c\n\t${CC} ${CFLAGS} -Os -o main $< ${SDL2FLAGS}\n\t-strip main\n\t-sstrip main\n\ndebug: main.c\n\t${CC} ${CFLAGS} -O1 -g -o main $< ${SDL2FLAGS}\n\nasm: main.asm\n\nmain.asm: main.c\n\t${CC} ${CFLAGS} -S -masm=intel -Og -o main.asm $< ${SDL2FLAGS}\n\nrun: msg main\n\ttime ./main\n\nclean:\n\trm -f main *.o main.asm\n\nfullclean: clean\n"
  },
  {
    "path": "c11/README.md",
    "content": "## Requirements\n\n* C11 compiler\n* pkg-config\n* SDL2\n\n## macOS\n\nInstall pkg-config using brew, or use `-LSDL2` in the Makefile instead of using pkg-config.\n"
  },
  {
    "path": "c11/main.c",
    "content": "#include <SDL2/SDL.h>\n#include <stdio.h>\n#include <stdlib.h>\n\nint main(void)\n{\n\tif (SDL_Init(SDL_INIT_EVERYTHING) != 0) {\n\t\tfprintf(stderr, \"SDL_Init Error: %s\\n\", SDL_GetError());\n\t\treturn EXIT_FAILURE;\n\t}\n\n\tSDL_Window* win = SDL_CreateWindow(\"Hello World!\", 100, 100, 620, 387, SDL_WINDOW_SHOWN);\n\tif (win == NULL) {\n\t\tfprintf(stderr, \"SDL_CreateWindow Error: %s\\n\", SDL_GetError());\n\t\treturn EXIT_FAILURE;\n\t}\n\n\tSDL_Renderer* ren = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);\n\tif (ren == NULL) {\n\t\tfprintf(stderr, \"SDL_CreateRenderer Error: %s\\n\", SDL_GetError());\n\t\tSDL_DestroyWindow(win);\n\t\tSDL_Quit();\n\t\treturn EXIT_FAILURE;\n\t}\n\n\tSDL_Surface* bmp = SDL_LoadBMP(\"../img/grumpy-cat.bmp\");\n\tif (bmp == NULL) {\n\t\tfprintf(stderr, \"SDL_LoadBMP Error: %s\\n\", SDL_GetError());\n\t\tSDL_DestroyRenderer(ren);\n\t\tSDL_DestroyWindow(win);\n\t\tSDL_Quit();\n\t\treturn EXIT_FAILURE;\n\t}\n\n\tSDL_Texture* tex = SDL_CreateTextureFromSurface(ren, bmp);\n\tif (tex == NULL) {\n\t\tfprintf(stderr, \"SDL_CreateTextureFromSurface Error: %s\\n\", SDL_GetError());\n\t\tSDL_FreeSurface(bmp);\n\t\tSDL_DestroyRenderer(ren);\n\t\tSDL_DestroyWindow(win);\n\t\tSDL_Quit();\n\t\treturn EXIT_FAILURE;\n\t}\n\tSDL_FreeSurface(bmp);\n\n\tfor (int i = 0; i < 20; i++) {\n\t\tSDL_RenderClear(ren);\n\t\tSDL_RenderCopy(ren, tex, NULL, NULL);\n\t\tSDL_RenderPresent(ren);\n\t\tSDL_Delay(100);\n\t}\n\n\tSDL_DestroyTexture(tex);\n\tSDL_DestroyRenderer(ren);\n\tSDL_DestroyWindow(win);\n\tSDL_Quit();\n\n\treturn EXIT_SUCCESS;\n}\n"
  },
  {
    "path": "c18/Makefile",
    "content": "CC?=gcc\nSDL2FLAGS=$(shell pkg-config sdl2 --cflags --libs)\nCFLAGS?=-std=c18 -Wall -pedantic -Werror -Wshadow -Wstrict-aliasing -Wstrict-overflow\n\n.PHONY: all msg clean fullclean\n\nall: msg main\n\nmsg:\n\t@echo '--- C18 ---'\n\nmain: main.c\n\t${CC} ${CFLAGS} -O2 -o $@ $< ${SDL2FLAGS}\n\nsmall: main.c\n\t${CC} ${CFLAGS} -Os -o main $< ${SDL2FLAGS}\n\t-strip main\n\t-sstrip main\n\ndebug: main.c\n\t${CC} ${CFLAGS} -O1 -g -o main $< ${SDL2FLAGS}\n\nasm: main.asm\n\nmain.asm: main.c\n\t${CC} ${CFLAGS} -S -masm=intel -Og -o main.asm $< ${SDL2FLAGS}\n\nrun: msg main\n\ttime ./main\n\nclean:\n\trm -f main *.o main.asm\n\nfullclean: clean\n"
  },
  {
    "path": "c18/README.md",
    "content": "## Requirements\n\n* C18 compiler\n* pkg-config\n* SDL2\n\n## macOS\n\nInstall pkg-config using brew, or use `-LSDL2` in the Makefile instead of using pkg-config.\n"
  },
  {
    "path": "c18/main.c",
    "content": "#include <SDL2/SDL.h>\n#include <stdio.h>\n#include <stdlib.h>\n\nint main(void)\n{\n\tif (SDL_Init(SDL_INIT_EVERYTHING) != 0) {\n\t\tfprintf(stderr, \"SDL_Init Error: %s\\n\", SDL_GetError());\n\t\treturn EXIT_FAILURE;\n\t}\n\n\tSDL_Window* win = SDL_CreateWindow(\"Hello World!\", 100, 100, 620, 387, SDL_WINDOW_SHOWN);\n\tif (win == NULL) {\n\t\tfprintf(stderr, \"SDL_CreateWindow Error: %s\\n\", SDL_GetError());\n\t\treturn EXIT_FAILURE;\n\t}\n\n\tSDL_Renderer* ren = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);\n\tif (ren == NULL) {\n\t\tfprintf(stderr, \"SDL_CreateRenderer Error: %s\\n\", SDL_GetError());\n\t\tif (win != NULL) {\n\t\t\tSDL_DestroyWindow(win);\n\t\t}\n\t\tSDL_Quit();\n\t\treturn EXIT_FAILURE;\n\t}\n\n\tSDL_Surface* bmp = SDL_LoadBMP(\"../img/grumpy-cat.bmp\");\n\tif (bmp == NULL) {\n\t\tfprintf(stderr, \"SDL_LoadBMP Error: %s\\n\", SDL_GetError());\n\t\tSDL_DestroyRenderer(ren);\n\t\tSDL_DestroyWindow(win);\n\t\tSDL_Quit();\n\t\treturn EXIT_FAILURE;\n\t}\n\n\tSDL_Texture* tex = SDL_CreateTextureFromSurface(ren, bmp);\n\tif (tex == NULL) {\n\t\tfprintf(stderr, \"SDL_CreateTextureFromSurface Error: %s\\n\", SDL_GetError());\n\t\tSDL_FreeSurface(bmp);\n\t\tSDL_DestroyRenderer(ren);\n\t\tSDL_DestroyWindow(win);\n\t\tSDL_Quit();\n\t\treturn EXIT_FAILURE;\n\t}\n\tSDL_FreeSurface(bmp);\n\n\tfor (int i = 0; i < 20; i++) {\n\t\tSDL_RenderClear(ren);\n\t\tSDL_RenderCopy(ren, tex, NULL, NULL);\n\t\tSDL_RenderPresent(ren);\n\t\tSDL_Delay(100);\n\t}\n\n\tSDL_DestroyTexture(tex);\n\tSDL_DestroyRenderer(ren);\n\tSDL_DestroyWindow(win);\n\tSDL_Quit();\n\n\treturn EXIT_SUCCESS;\n}\n"
  },
  {
    "path": "c2x/Makefile",
    "content": "CC?=gcc\nSDL2FLAGS=$(shell pkg-config sdl2 --cflags --libs)\nCFLAGS?=-std=c2x -Wall -pedantic -Werror -Wshadow -Wstrict-aliasing -Wstrict-overflow\n\n.PHONY: all msg clean fullclean\n\nall: msg main\n\nmsg:\n\t@echo '--- C2X ---'\n\nmain: main.c\n\t${CC} ${CFLAGS} -O2 -o $@ $< ${SDL2FLAGS}\n\nsmall: main.c\n\t${CC} ${CFLAGS} -Os -o main $< ${SDL2FLAGS}\n\t-strip main\n\t-sstrip main\n\ndebug: main.c\n\t${CC} ${CFLAGS} -O1 -g -o main $< ${SDL2FLAGS}\n\nasm: main.asm\n\nmain.asm: main.c\n\t${CC} ${CFLAGS} -S -masm=intel -Og -o main.asm $< ${SDL2FLAGS}\n\nrun: msg main\n\ttime ./main\n\nclean:\n\trm -f main *.o main.asm\n\nfullclean: clean\n"
  },
  {
    "path": "c2x/README.md",
    "content": "## Requirements\n\n* C2X compiler (GCC 9 or later, Clang 9 or later)\n* pkg-config\n* SDL2\n\n## macOS\n\nInstall pkg-config using brew, or use `-LSDL2` in the Makefile instead of using pkg-config.\n"
  },
  {
    "path": "c2x/main.c",
    "content": "#include <SDL2/SDL.h>\n#include <stdio.h>\n#include <stdlib.h>\n\nint main()\n{\n\tif (SDL_Init(SDL_INIT_EVERYTHING) != 0) {\n\t\tfprintf(stderr, \"SDL_Init Error: %s\\n\", SDL_GetError());\n\t\treturn EXIT_FAILURE;\n\t}\n\n\tSDL_Window* win = SDL_CreateWindow(\"Hello World!\", 100, 100, 620, 387, SDL_WINDOW_SHOWN);\n\tif (win == NULL) {\n\t\tfprintf(stderr, \"SDL_CreateWindow Error: %s\\n\", SDL_GetError());\n\t\treturn EXIT_FAILURE;\n\t}\n\n\tSDL_Renderer* ren = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);\n\tif (ren == NULL) {\n\t\tfprintf(stderr, \"SDL_CreateRenderer Error: %s\\n\", SDL_GetError());\n\t\tSDL_DestroyWindow(win);\n\t\tSDL_Quit();\n\t\treturn EXIT_FAILURE;\n\t}\n\n\tSDL_Surface* bmp = SDL_LoadBMP(\"../img/grumpy-cat.bmp\");\n\tif (bmp == NULL) {\n\t\tfprintf(stderr, \"SDL_LoadBMP Error: %s\\n\", SDL_GetError());\n\t\tSDL_DestroyRenderer(ren);\n\t\tSDL_DestroyWindow(win);\n\t\tSDL_Quit();\n\t\treturn EXIT_FAILURE;\n\t}\n\n\tSDL_Texture* tex = SDL_CreateTextureFromSurface(ren, bmp);\n\tif (tex == NULL) {\n\t\tfprintf(stderr, \"SDL_CreateTextureFromSurface Error: %s\\n\", SDL_GetError());\n\t\tSDL_FreeSurface(bmp);\n\t\tSDL_DestroyRenderer(ren);\n\t\tSDL_DestroyWindow(win);\n\t\tSDL_Quit();\n\t\treturn EXIT_FAILURE;\n\t}\n\tSDL_FreeSurface(bmp);\n\n\tfor (int i = 0; i < 20; i++) {\n\t\tSDL_RenderClear(ren);\n\t\tSDL_RenderCopy(ren, tex, NULL, NULL);\n\t\tSDL_RenderPresent(ren);\n\t\tSDL_Delay(100);\n\t}\n\n\tSDL_DestroyTexture(tex);\n\tSDL_DestroyRenderer(ren);\n\tSDL_DestroyWindow(win);\n\tSDL_Quit();\n\n\treturn EXIT_SUCCESS;\n}\n"
  },
  {
    "path": "c89/Makefile",
    "content": "CC?=gcc\nSDL2FLAGS=$(shell pkg-config sdl2 --cflags --libs)\nCFLAGS?=-ansi -Wall -pedantic -Werror -Wshadow -Wstrict-aliasing -Wstrict-overflow\n\n.PHONY: all msg clean fullclean\n\nall: msg main\n\nmsg:\n\t@echo '--- C89 (ANSI C) ---'\n\nmain: main.c\n\t${CC} ${CFLAGS} -O2 -o $@ $< ${SDL2FLAGS}\n\nsmall: main.c\n\t${CC} ${CFLAGS} -Os -o main $< ${SDL2FLAGS}\n\t-strip main\n\t-sstrip main\n\ndebug: main.c\n\t${CC} ${CFLAGS} -O1 -g -o main $< ${SDL2FLAGS}\n\nasm: main.asm\n\nmain.asm: main.c\n\t${CC} ${CFLAGS} -S -masm=intel -Og -o main.asm $< ${SDL2FLAGS}\n\nrun: msg main\n\ttime ./main\n\nclean:\n\trm -f main *.o main.asm\n\nfullclean: clean\n"
  },
  {
    "path": "c89/README.md",
    "content": "## Requirements\n\n* C89 (ANSI C) compiler\n* pkg-config\n* SDL2\n\n## macOS\n\nInstall pkg-config using brew, or use `-LSDL2` in the Makefile instead of using pkg-config.\n"
  },
  {
    "path": "c89/main.c",
    "content": "#include <SDL2/SDL.h>\n#include <stdio.h>\n#include <stdlib.h>\n\nint main(void)\n{\n\tSDL_Window* win;\n\tSDL_Renderer* ren;\n\tSDL_Surface* bmp;\n\tSDL_Texture* tex;\n\tint i;\n\n\tif (SDL_Init(SDL_INIT_EVERYTHING) != 0) {\n\t\tfprintf(stderr, \"SDL_Init Error: %s\\n\", SDL_GetError());\n\t\treturn EXIT_FAILURE;\n\t}\n\n\twin = SDL_CreateWindow(\"Hello World!\", 100, 100, 620, 387, SDL_WINDOW_SHOWN);\n\tif (win == NULL) {\n\t\tfprintf(stderr, \"SDL_CreateWindow Error: %s\\n\", SDL_GetError());\n\t\treturn EXIT_FAILURE;\n\t}\n\n\tren = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);\n\tif (ren == NULL) {\n\t\tfprintf(stderr, \"SDL_CreateRenderer Error: %s\\n\", SDL_GetError());\n\t\tSDL_DestroyWindow(win);\n\t\tSDL_Quit();\n\t\treturn EXIT_FAILURE;\n\t}\n\n\tbmp = SDL_LoadBMP(\"../img/grumpy-cat.bmp\");\n\tif (bmp == NULL) {\n\t\tfprintf(stderr, \"SDL_LoadBMP Error: %s\\n\", SDL_GetError());\n\t\tSDL_DestroyRenderer(ren);\n\t\tSDL_DestroyWindow(win);\n\t\tSDL_Quit();\n\t\treturn EXIT_FAILURE;\n\t}\n\n\ttex = SDL_CreateTextureFromSurface(ren, bmp);\n\tif (tex == NULL) {\n\t\tfprintf(stderr, \"SDL_CreateTextureFromSurface Error: %s\\n\", SDL_GetError());\n\t\tSDL_FreeSurface(bmp);\n\t\tSDL_DestroyRenderer(ren);\n\t\tSDL_DestroyWindow(win);\n\t\tSDL_Quit();\n\t\treturn EXIT_FAILURE;\n\t}\n\tSDL_FreeSurface(bmp);\n\n\tfor (i = 0; i < 20; i++) {\n\t\tSDL_RenderClear(ren);\n\t\tSDL_RenderCopy(ren, tex, NULL, NULL);\n\t\tSDL_RenderPresent(ren);\n\t\tSDL_Delay(100);\n\t}\n\n\tSDL_DestroyTexture(tex);\n\tSDL_DestroyRenderer(ren);\n\tSDL_DestroyWindow(win);\n\tSDL_Quit();\n\n\treturn EXIT_SUCCESS;\n}\n"
  },
  {
    "path": "c99/Makefile",
    "content": "CC?=gcc\nSDL2FLAGS=$(shell pkg-config sdl2 --cflags --libs)\nCFLAGS?=-std=c99 -Wall -pedantic -Werror -Wshadow -Wstrict-aliasing -Wstrict-overflow\n\n.PHONY: all msg clean fullclean\n\nall: msg main\n\nmsg:\n\t@echo '--- C99 ---'\n\nmain: main.c\n\t${CC} ${CFLAGS} -O2 -o $@ $< ${SDL2FLAGS}\n\nsmall: main.c\n\t${CC} ${CFLAGS} -Os -o main $< ${SDL2FLAGS}\n\t-strip main\n\t-sstrip main\n\ndebug: main.c\n\t${CC} ${CFLAGS} -O1 -g -o main $< ${SDL2FLAGS}\n\nasm: main.asm\n\nmain.asm: main.c\n\t${CC} ${CFLAGS} -S -masm=intel -Og -o main.asm $< ${SDL2FLAGS}\n\nrun: msg main\n\ttime ./main\n\nclean:\n\trm -f main *.o main.asm\n\nfullclean: clean\n"
  },
  {
    "path": "c99/README.md",
    "content": "## Requirements\n\n* C99 compiler\n* pkg-config\n* SDL2\n\n## macOS\n\nInstall pkg-config using brew, or use `-LSDL2` in the Makefile instead of using pkg-config.\n"
  },
  {
    "path": "c99/main.c",
    "content": "#include <SDL2/SDL.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <stdbool.h>\n\nint main(void)\n{\n    if (SDL_Init(SDL_INIT_EVERYTHING) != 0) {\n        fprintf(stderr, \"SDL_Init Error: %s\\n\", SDL_GetError());\n        return EXIT_FAILURE;\n    }\n\n    SDL_Window* win = SDL_CreateWindow(\"Hello World!\", -1, -1, 620, 387, SDL_WINDOW_SHOWN);\n    if (win == NULL) {\n        fprintf(stderr, \"SDL_CreateWindow Error: %s\\n\", SDL_GetError());\n        return EXIT_FAILURE;\n    }\n\n    SDL_Renderer* ren = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);\n    if (ren == NULL) {\n        fprintf(stderr, \"SDL_CreateRenderer Error: %s\\n\", SDL_GetError());\n        SDL_DestroyWindow(win);\n        SDL_Quit();\n        return EXIT_FAILURE;\n    }\n\n    SDL_Surface* bmp = SDL_LoadBMP(\"../img/grumpy-cat.bmp\");\n    if (bmp == NULL) {\n        fprintf(stderr, \"SDL_LoadBMP Error: %s\\n\", SDL_GetError());\n        SDL_DestroyRenderer(ren);\n        SDL_DestroyWindow(win);\n        SDL_Quit();\n        return EXIT_FAILURE;\n    }\n\n    SDL_Texture* tex = SDL_CreateTextureFromSurface(ren, bmp);\n    if (tex == NULL) {\n        fprintf(stderr, \"SDL_CreateTextureFromSurface Error: %s\\n\", SDL_GetError());\n        SDL_FreeSurface(bmp);\n        SDL_DestroyRenderer(ren);\n        SDL_DestroyWindow(win);\n        SDL_Quit();\n        return EXIT_FAILURE;\n    }\n    SDL_FreeSurface(bmp);\n\n    SDL_Event e;\n    bool quit = false;\n    Uint32 startTime = SDL_GetTicks();\n\n    while (!quit) {\n        while (SDL_PollEvent(&e)) {\n            if (e.type == SDL_QUIT) {\n                quit = true;\n            }\n            if (e.type == SDL_KEYDOWN) {\n                if (e.key.keysym.sym == SDLK_ESCAPE) {\n                    quit = true;\n                }\n            }\n        }\n\n        Uint32 elapsedTime = SDL_GetTicks() - startTime;\n        if (elapsedTime > 2000) {\n            break;\n        }\n\n        SDL_RenderClear(ren);\n        SDL_RenderCopy(ren, tex, NULL, NULL);\n        SDL_RenderPresent(ren);\n        SDL_Delay(100);\n    }\n\n    SDL_DestroyTexture(tex);\n    SDL_DestroyRenderer(ren);\n    SDL_DestroyWindow(win);\n    SDL_Quit();\n\n    return EXIT_SUCCESS;\n}\n"
  },
  {
    "path": "crystal/Makefile",
    "content": ".PHONY: all msg sdl2 clean fullclean\n\nall: msg bin/main\n\nmsg:\n\t@echo '--- Crystal ---'\n\nbin/main: shard.yml main.cr\n\t@echo -n '[main] Compiling...'\n\t@shards -q build\n\t@echo 'ok'\n\nrun: msg bin/main\n\ttime ./bin/main\n\nclean:\n\trm -f bin/main\n\nfullclean: clean\n\trm -rf bin lib\n"
  },
  {
    "path": "crystal/README.md",
    "content": "# Crystal SDL2 example\n\nTested with Crystal 1.0.0 and Crystal 1.1.0 on Arch Linux.\n\nRequires both `crystal` and `shards`.\n"
  },
  {
    "path": "crystal/main.cr",
    "content": "require \"sdl\"\nrequire \"sdl/image\"\n\nbegin\n  SDL.init(SDL::Init::VIDEO)\n  at_exit { SDL.quit }\n\n  SDL::IMG.init(SDL::IMG::Init::PNG)\n  at_exit { SDL::IMG.quit }\n\n  window = SDL::Window.new(\"Hello World!\", 620, 387)\n  renderer = SDL::Renderer.new(window, SDL::Renderer::Flags::ACCELERATED | SDL::Renderer::Flags::PRESENTVSYNC)\n\n  texture = SDL::IMG.load(File.join(__DIR__, \"..\", \"img\", \"grumpy-cat.png\"), renderer)\n\n  start_time = Time.monotonic\n  quit = false\n\n  until quit\n    case event = SDL::Event.poll\n    when SDL::Event::Quit\n      quit = true\n    when SDL::Event::Keyboard\n      quit = true if event.keydown? && event.sym.escape?\n    end\n\n    break if (Time.monotonic - start_time) > 2.seconds\n\n    renderer.clear\n    renderer.copy(texture)\n    renderer.present\n\n    sleep(100.milliseconds)\n  end\nrescue ex\n  abort \"Error: #{ex.message}\"\nend\n"
  },
  {
    "path": "crystal/shard.yml",
    "content": "name: main\nversion: 0.1.0\n\nauthors:\n  - Alexander F. Rødseth <xyproto@archlinux.org>\n\ndependencies:\n  sdl:\n    github: ysbaddaden/sdl.cr\n\ntargets:\n  main:\n    main: main.cr\n\ncrystal: 1.1.1\n\nlicense: MIT\n"
  },
  {
    "path": "csharp/Makefile",
    "content": ".PHONY: all msg clean fullclean check-config\n\nMONO_VERSION ?= 4.5\n\nifeq ($(shell uname -s), Darwin)\n\tMONO_ETC := $(shell dirname $(shell dirname $(shell realpath $(shell which mono))))/etc/mono\nelse\n\tMONO_ETC := /etc/mono\nendif\n\nMONO_CONFIG := $(MONO_ETC)/config\nMACHINE_CONFIG := $(MONO_ETC)/$(MONO_VERSION)/machine.config\n\nall: msg check-config main\n\nmsg:\n\t@echo '--- C# ---'\n\nmain.exe: main.cs\n\tmcs -unsafe -out:$@ $<\n\nmain: main.exe\n\t@echo \"Mono config file: $(MONO_CONFIG)\"\n\t@echo \"Machine config file: $(MACHINE_CONFIG)\"\n\tmkbundle -o $@ --deps --simple --static --i18n none --machine-config $(MACHINE_CONFIG) --config $(MONO_CONFIG) $<\n\trm -f main.exe\n\nrun: msg main\n\ttime ./main\n\nclean:\n\trm -f main main.exe temp.* *crash*.json\n\ncheck-config:\n\t@if [ ! -f $(MACHINE_CONFIG) ]; then \\\n\t\techo \"ERROR: The file $(MACHINE_CONFIG) does not exist.\"; \\\n\t\texit 1; \\\n\tfi\n\t@if [ ! -f $(MONO_CONFIG) ]; then \\\n\t\techo \"ERROR: The file $(MONO_CONFIG) does not exist.\"; \\\n\t\texit 1; \\\n\tfi\n"
  },
  {
    "path": "csharp/README.md",
    "content": "# C# + SDL2 example\n\nSDL2 must either be installed, or be available as a shared library.\n\n## Arch Linux\n\n### Building and running with Mono\n\nBuilding:\n\n    msc /unsafe main.cs\n\nRunning:\n\n    mono main.exe\n\n### Building and running as a native executable\n\n`mkbundle` comes with `mono`.\n\nBuilding:\n\n    make\n\nRunning:\n\n    ./main\n\n### Building with `csc` and running with Wine\n\nThis builds a Windows GUI executable.\n\nBuilding:\n\n    csc /target:winexe /unsafe main.cs\n\nRunning:\n\n    wine main.exe\n\n## Windows\n\n### Building\n\nEither place csc.exe in the `PATH` and build with that, using:\n\n    csc /target:winexe /unsafe main.cs\n\nOr use the full path, for example:\n\n    C:\\Windows\\Microsoft.NET\\Framework\\v3.5\\csc /target:winexe /unsafe main.cs\n\n## macOS\n\nApple Silicon (M1/M2/M3/aarch64) is not currently supported (as of 2024-08-06).\n\nRunning `make run` will:\n\n* Create a `main.exe` file, but for the wrong CPU.\n* Bundle the `main.exe` file into a `main` executable, which will look correct when using `file`.\n\nBut running `./main` will output an error message a bit like this one:\n\n     Error mapping file: mono_file_map_error failed file:./main length:0x4685824X offset:0x3944448X error:Invalid argument(0x16)\n\nHere is the status of macOS/M1/M2/aarch64 support for Mono:\n\n* https://github.com/mono/mono/issues/21092\n\n### SDL2\n\n`SDL2.dll` is included (zlib license). It can also be downloaded from here: https://www.libsdl.org/download-2.0.php\n\nThis text came together with the `SDL2.dll` binary:\n\n```\nThe Simple DirectMedia Layer (SDL for short) is a cross-platform library\ndesigned to make it easy to write multi-media software, such as games\nand emulators.\n\nThe Simple DirectMedia Layer library source code is available from:\nhttps://www.libsdl.org/\n\nThis library is distributed under the terms of the zlib license:\nhttp://www.zlib.net/zlib_license.html\n```\n\n## macOS\n\nOn a macOS with a M2 CPU, a main.exe and main file is built, but they did not run correctly here, neither directly, with mono or with wine. Pull requests are welcome.\n"
  },
  {
    "path": "csharp/main.cs",
    "content": "using System;\nusing System.Runtime.InteropServices;\nusing System.Text;\n\npublic class HelloWorld\n{\n    // From SDL.h\n    private const UInt32 SDL_INIT_VIDEO = 0x00000020;\n\n    // From SDL_video.h\n    private const Int32 SDL_WINDOWPOS_UNDEFINED = 0x1FFF0000;\n    private const UInt32 SDL_WINDOW_SHOWN = 0x00000004;\n\n    // From SDL_render.h\n    private const UInt32 SDL_RENDERER_ACCELERATED = 0x00000002;\n    private const UInt32 SDL_RENDERER_PRESENTVSYNC = 0x00000004;\n\n    [DllImport(\"SDL2\")]\n    private static extern unsafe Int32 SDL_Init(UInt32 flags);\n\n    [DllImport(\"SDL2\")]\n    private static extern unsafe IntPtr SDL_CreateWindow(\n        [MarshalAs(UnmanagedType.LPStr)] string title,\n        int x,\n        int y,\n        int w,\n        int h,\n        uint flags\n    );\n\n    [DllImport(\"SDL2\")]\n    private static extern unsafe IntPtr SDL_CreateRenderer(\n        IntPtr win,\n        int index,\n        uint flags\n    );\n\n    [DllImport(\"SDL2\")]\n    private static extern unsafe IntPtr SDL_CreateTextureFromSurface(\n        IntPtr renderer,\n        IntPtr surface\n    );\n\n    [DllImport(\"SDL2\")]\n    private static extern unsafe void SDL_DestroyRenderer(\n        IntPtr renderer\n    );\n\n    [DllImport(\"SDL2\")]\n    private static extern unsafe void SDL_DestroyWindow(\n        IntPtr window\n    );\n\n    [DllImport(\"SDL2\")]\n    private static extern unsafe void SDL_FreeSurface(\n        IntPtr surface\n    );\n\n    [DllImport(\"SDL2\")]\n    private static extern unsafe void SDL_DestroyTexture(\n        IntPtr texture\n    );\n\n    [DllImport(\"SDL2\")]\n    private static extern unsafe Int32 SDL_RenderClear(\n        IntPtr renderer\n    );\n\n    [DllImport(\"SDL2\")]\n    private static extern unsafe Int32 SDL_RenderCopy(\n        IntPtr renderer,\n        IntPtr texture,\n        IntPtr srcrect,\n        IntPtr dstrect\n    );\n\n    [DllImport(\"SDL2\")]\n    private static extern unsafe void SDL_RenderPresent(\n        IntPtr renderer\n    );\n\n    [DllImport(\"SDL2\")]\n    private static extern unsafe IntPtr SDL_LoadBMP_RW(\n        IntPtr src,\n        int freesrc\n    );\n\n    [DllImport(\"SDL2\")]\n    private static extern unsafe IntPtr SDL_RWFromFile(\n        [MarshalAs(UnmanagedType.LPStr)] string filename,\n        [MarshalAs(UnmanagedType.LPStr)] string permissions\n    );\n\n    [DllImport(\"SDL2\")]\n    private static extern unsafe void SDL_Quit();\n\n    [DllImport(\"SDL2\")]\n    private static extern unsafe byte* SDL_GetError();\n\n    // Call SDL_GetError() and return the C string as a C# String\n    private static unsafe string SDL_GetErrorString()\n    {\n        StringBuilder sb = new StringBuilder();\n        byte* errStr = SDL_GetError();\n        int i = 0;\n        while (errStr[i] != 0) // trust that the string returned from SDL_GetError() is properly terminated\n        {\n            sb.Append(Convert.ToChar(errStr[i]));\n            i++;\n        }\n        return sb.ToString();\n    }\n\n    // Print the SDL_GetError() error message to stderr, with a preceding topic and also \" Error: \"\n    private static void PrintErr(string topic)\n    {\n        Console.Error.WriteLine(topic + \" Error: \" + SDL_GetErrorString());\n    }\n\n    public class SDLWindow : IDisposable\n    {\n        public IntPtr Handle { get; private set; }\n\n        public SDLWindow(string title, int x, int y, int w, int h, uint flags)\n        {\n            Handle = SDL_CreateWindow(title, x, y, w, h, flags);\n            if (Handle == IntPtr.Zero)\n            {\n                throw new Exception(\"SDL_CreateWindow Error: \" + SDL_GetErrorString());\n            }\n        }\n\n        public void Dispose()\n        {\n            if (Handle != IntPtr.Zero)\n            {\n                SDL_DestroyWindow(Handle);\n                Handle = IntPtr.Zero;\n            }\n        }\n    }\n\n    public class SDLRenderer : IDisposable\n    {\n        public IntPtr Handle { get; private set; }\n\n        public SDLRenderer(SDLWindow window, int index, uint flags)\n        {\n            Handle = SDL_CreateRenderer(window.Handle, index, flags);\n            if (Handle == IntPtr.Zero)\n            {\n                throw new Exception(\"SDL_CreateRenderer Error: \" + SDL_GetErrorString());\n            }\n        }\n\n        public void Dispose()\n        {\n            if (Handle != IntPtr.Zero)\n            {\n                SDL_DestroyRenderer(Handle);\n                Handle = IntPtr.Zero;\n            }\n        }\n    }\n\n    public class SDLTexture : IDisposable\n    {\n        public IntPtr Handle { get; private set; }\n\n        public SDLTexture(SDLRenderer renderer, IntPtr surface)\n        {\n            Handle = SDL_CreateTextureFromSurface(renderer.Handle, surface);\n            if (Handle == IntPtr.Zero)\n            {\n                throw new Exception(\"SDL_CreateTextureFromSurface Error: \" + SDL_GetErrorString());\n            }\n        }\n\n        public void Dispose()\n        {\n            if (Handle != IntPtr.Zero)\n            {\n                SDL_DestroyTexture(Handle);\n                Handle = IntPtr.Zero;\n            }\n        }\n    }\n\n    public static int Main(string[] args)\n    {\n        if (SDL_Init(SDL_INIT_VIDEO) != 0)\n        {\n            PrintErr(\"SDL_Init\");\n            return 1;\n        }\n\n        using (var window = new SDLWindow(\"Hello, World!\", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 620, 387, SDL_WINDOW_SHOWN))\n        using (var renderer = new SDLRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC))\n        {\n            IntPtr rwop = SDL_RWFromFile(\"../img/grumpy-cat.bmp\", \"rb\");\n            if (rwop == IntPtr.Zero)\n            {\n                PrintErr(\"SDL_RWFromFile\");\n                return 1;\n            }\n\n            IntPtr bmp = SDL_LoadBMP_RW(rwop, 1); // this also frees rwop\n            if (bmp == IntPtr.Zero)\n            {\n                PrintErr(\"SDL_LoadBMP_RW\");\n                return 1;\n            }\n\n            using (var texture = new SDLTexture(renderer, bmp))\n            {\n                SDL_FreeSurface(bmp);\n\n                for (int i = 0; i < 20; i++)\n                {\n                    SDL_RenderClear(renderer.Handle);\n                    SDL_RenderCopy(renderer.Handle, texture.Handle, IntPtr.Zero, IntPtr.Zero);\n                    SDL_RenderPresent(renderer.Handle);\n                    System.Threading.Thread.Sleep(100);\n                }\n            }\n        }\n\n        SDL_Quit();\n\n        return 0;\n    }\n}\n"
  },
  {
    "path": "csharp/main.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n  <PropertyGroup>\n    <OutputType>Exe</OutputType>\n    <TargetFramework>net8.0</TargetFramework>\n    <ImplicitUsings>enable</ImplicitUsings>\n    <Nullable>enable</Nullable>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n  </PropertyGroup>\n</Project>\n"
  },
  {
    "path": "d/.gitignore",
    "content": "bin/\nmain\n"
  },
  {
    "path": "d/Makefile",
    "content": ".PHONY: all msg clean fullclean\n\nall: msg main\n\nmsg:\n\t@echo '--- D ---'\n\nmain: source/app.d\n\t@echo -n '[main] Compiling...'\n\t@dub -q build\n\t@echo 'ok'\n\nrun: msg main\n\ttime ./main\n\nclean:\n\trm -f main\n\nfullclean: clean\n"
  },
  {
    "path": "d/README.md",
    "content": "# D + SDL2\n\nThis example is based on public domain code from Peter Cartwright\n\nhttps://github.com/pokedpeter/dlang-derelict-sdl2-example1\n"
  },
  {
    "path": "d/dub.json",
    "content": "{\n\t\"name\": \"main\",\n\t\"authors\": [\n\t\t\"Peter Cartwright\"\n\t],\n\t\"description\": \"An example using Derelict and SDL2 in d\",\n\t\"copyright\": \"Copyright © 2016, Peter Cartwright\",\n\t\"license\": \"public domain\",\n\t\"dependencies\": {\n\t\t\"derelict-sdl2\": \"~>2.1.4\"\n\t},\n\t\"targetPath\": \".\"\n}\n"
  },
  {
    "path": "d/dub.selections.json",
    "content": "{\n\t\"fileVersion\": 1,\n\t\"versions\": {\n\t\t\"derelict-sdl2\": \"2.1.4\",\n\t\t\"derelict-util\": \"2.0.6\"\n\t}\n}\n"
  },
  {
    "path": "d/source/app.d",
    "content": "// Based on https://github.com/pokedpeter/dlang-derelict-sdl2-example1\n\nimport std.stdio;\nimport derelict.sdl2.sdl;\nimport derelict.sdl2.image;\nimport std.conv;\n\nvoid main()\n{\n    DerelictSDL2.load();\n    DerelictSDL2Image.load();\n\n    // Initialise SDL\n    if (SDL_Init(SDL_INIT_VIDEO) != 0) {\n        writeln(\"SDL_Init: \", SDL_GetError());\n    }\n\n    // Initialise IMG\n    int flags = IMG_INIT_PNG;\n    if ((IMG_Init(flags) & flags) != flags) {\n        writeln(\"IMG_Init: \", to!string(IMG_GetError()));\n    }\n\n    // Load image\n    SDL_Surface *imgSurf = IMG_Load(\"../img/grumpy-cat.png\");\n    if (imgSurf is null) {\n        writeln(\"IMG_Load: \", to!string(IMG_GetError()));\n    }\n\n    // Create a window\n    SDL_Window* appWin = SDL_CreateWindow(\n        \"Hello, World!\",\n        SDL_WINDOWPOS_UNDEFINED,\n        SDL_WINDOWPOS_UNDEFINED,\n        imgSurf.w,\n        imgSurf.h,\n        SDL_WINDOW_OPENGL\n    );\n\n    if (appWin is null) {\n        writefln(\"SDL_CreateWindow: \", SDL_GetError());\n        return;\n    }\n\n    // Get the window surface\n    SDL_Surface *winSurf = SDL_GetWindowSurface(appWin);\n    if (winSurf is null) {\n        writeln(\"SDL_GetWindowSurface: \", SDL_GetError());\n    }\n\n    // Define a colour for the surface, based on RGB values\n    int colour = SDL_MapRGB(winSurf.format, 0xFF, 0xFF, 0xFF);\n\n    // Fill the window surface with the colour\n    SDL_FillRect(winSurf, null, colour);\n\n    // Copy loaded image to window surface\n    SDL_Rect dstRect;\n    dstRect.x = 0;\n    dstRect.y = 0;\n    SDL_BlitSurface(imgSurf, null, winSurf, &dstRect);\n\n    // Copy the window surface to the screen\n    SDL_UpdateWindowSurface(appWin);\n\n    // Polling for events\n    for (int i = 0; i < 20; i++) {\n        SDL_Delay(100);\n    }\n\n    // Close and destroy the window\n    if (appWin !is null) {\n        SDL_DestroyWindow(appWin);\n    }\n\n    // Tidy up\n    IMG_Quit();\n    SDL_Quit();\n}\n"
  },
  {
    "path": "dart/Makefile",
    "content": ".PHONY: msg run clean\n\nall: msg main\n\nmsg:\n\t@echo '--- Dart ---'\n\npubspec.lock: pubspec.yaml\n\tdart pub get\n\nmain: pubspec.lock main.dart\n\tdart compile exe main.dart -o main\n\nrun:\n\ttime ./main\n\nclean:\n\trm -f main\n\nfullclean: clean\n\trm -f pubspec.lock\n"
  },
  {
    "path": "dart/main.dart",
    "content": "import 'dart:ffi';\nimport 'package:ffi/ffi.dart';\n\n// From SDL.h\nconst int SDL_INIT_VIDEO = 0x00000020;\n\n// From SDL_video.h\nconst int SDL_WINDOWPOS_UNDEFINED = 0x1FFF0000;\nconst int SDL_WINDOW_SHOWN = 0x00000004;\n\n// From SDL_render.h\nconst int SDL_RENDERER_ACCELERATED = 0x00000002;\nconst int SDL_RENDERER_PRESENTVSYNC = 0x00000004;\n\n// Load the SDL2 library\nfinal DynamicLibrary sdlLib = DynamicLibrary.open('libSDL2.so');\n\n// Define the signature of the C functions\ntypedef SDL_InitC = Int32 Function(Uint32 flags);\ntypedef SDL_InitDart = int Function(int flags);\n\ntypedef SDL_CreateWindowC = Pointer Function(Pointer<Utf8> title, Int32 x, Int32 y, Int32 w, Int32 h, Uint32 flags);\ntypedef SDL_CreateWindowDart = Pointer Function(Pointer<Utf8> title, int x, int y, int w, int h, int flags);\n\ntypedef SDL_CreateRendererC = Pointer Function(Pointer win, Int32 index, Uint32 flags);\ntypedef SDL_CreateRendererDart = Pointer Function(Pointer win, int index, int flags);\n\ntypedef SDL_CreateTextureFromSurfaceC = Pointer Function(Pointer renderer, Pointer surface);\ntypedef SDL_CreateTextureFromSurfaceDart = Pointer Function(Pointer renderer, Pointer surface);\n\ntypedef SDL_DestroyRendererC = Void Function(Pointer renderer);\ntypedef SDL_DestroyRendererDart = void Function(Pointer renderer);\n\ntypedef SDL_DestroyWindowC = Void Function(Pointer window);\ntypedef SDL_DestroyWindowDart = void Function(Pointer window);\n\ntypedef SDL_FreeSurfaceC = Void Function(Pointer surface);\ntypedef SDL_FreeSurfaceDart = void Function(Pointer surface);\n\ntypedef SDL_DestroyTextureC = Void Function(Pointer texture);\ntypedef SDL_DestroyTextureDart = void Function(Pointer texture);\n\ntypedef SDL_RenderClearC = Int32 Function(Pointer renderer);\ntypedef SDL_RenderClearDart = int Function(Pointer renderer);\n\ntypedef SDL_RenderCopyC = Int32 Function(Pointer renderer, Pointer texture, Pointer srcrect, Pointer dstrect);\ntypedef SDL_RenderCopyDart = int Function(Pointer renderer, Pointer texture, Pointer srcrect, Pointer dstrect);\n\ntypedef SDL_RenderPresentC = Void Function(Pointer renderer);\ntypedef SDL_RenderPresentDart = void Function(Pointer renderer);\n\ntypedef SDL_RWFromFileC = Pointer Function(Pointer<Utf8> file, Pointer<Utf8> mode);\ntypedef SDL_RWFromFileDart = Pointer Function(Pointer<Utf8> file, Pointer<Utf8> mode);\n\ntypedef SDL_LoadBMP_RWC = Pointer Function(Pointer src, Int32 freesrc);\ntypedef SDL_LoadBMP_RWDart = Pointer Function(Pointer src, int freesrc);\n\ntypedef SDL_DelayC = Void Function(Uint32 ms);\ntypedef SDL_DelayDart = void Function(int ms);\n\ntypedef SDL_QuitC = Void Function();\ntypedef SDL_QuitDart = void Function();\n\nvoid main() {\n  // Look up the functions\n  final SDL_Init = sdlLib.lookupFunction<SDL_InitC, SDL_InitDart>('SDL_Init');\n  final SDL_CreateWindow = sdlLib.lookupFunction<SDL_CreateWindowC, SDL_CreateWindowDart>('SDL_CreateWindow');\n  final SDL_CreateRenderer = sdlLib.lookupFunction<SDL_CreateRendererC, SDL_CreateRendererDart>('SDL_CreateRenderer');\n  final SDL_CreateTextureFromSurface = sdlLib.lookupFunction<SDL_CreateTextureFromSurfaceC, SDL_CreateTextureFromSurfaceDart>('SDL_CreateTextureFromSurface');\n  final SDL_DestroyRenderer = sdlLib.lookupFunction<SDL_DestroyRendererC, SDL_DestroyRendererDart>('SDL_DestroyRenderer');\n  final SDL_DestroyWindow = sdlLib.lookupFunction<SDL_DestroyWindowC, SDL_DestroyWindowDart>('SDL_DestroyWindow');\n  final SDL_FreeSurface = sdlLib.lookupFunction<SDL_FreeSurfaceC, SDL_FreeSurfaceDart>('SDL_FreeSurface');\n  final SDL_DestroyTexture = sdlLib.lookupFunction<SDL_DestroyTextureC, SDL_DestroyTextureDart>('SDL_DestroyTexture');\n  final SDL_RenderClear = sdlLib.lookupFunction<SDL_RenderClearC, SDL_RenderClearDart>('SDL_RenderClear');\n  final SDL_RenderCopy = sdlLib.lookupFunction<SDL_RenderCopyC, SDL_RenderCopyDart>('SDL_RenderCopy');\n  final SDL_RenderPresent = sdlLib.lookupFunction<SDL_RenderPresentC, SDL_RenderPresentDart>('SDL_RenderPresent');\n  final SDL_RWFromFile = sdlLib.lookupFunction<SDL_RWFromFileC, SDL_RWFromFileDart>('SDL_RWFromFile');\n  final SDL_LoadBMP_RW = sdlLib.lookupFunction<SDL_LoadBMP_RWC, SDL_LoadBMP_RWDart>('SDL_LoadBMP_RW');\n  final SDL_Delay = sdlLib.lookupFunction<SDL_DelayC, SDL_DelayDart>('SDL_Delay');\n  final SDL_Quit = sdlLib.lookupFunction<SDL_QuitC, SDL_QuitDart>('SDL_Quit');\n\n  SDL_Init(SDL_INIT_VIDEO);\n\n  final titleCString = 'Hello, World!'.toNativeUtf8();\n  var window = SDL_CreateWindow(titleCString, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 620, 387, SDL_WINDOW_SHOWN);\n\n  var renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);\n\n  final bmpFileCString = '../img/grumpy-cat.bmp'.toNativeUtf8();\n  final modeCString = 'rb'.toNativeUtf8();\n  var rwop = SDL_RWFromFile(bmpFileCString, modeCString);\n\n  var bmp = SDL_LoadBMP_RW(rwop, 1);\n  var texture = SDL_CreateTextureFromSurface(renderer, bmp);\n  SDL_FreeSurface(bmp);\n\n  for (int i = 0; i < 20; i++) {\n    SDL_RenderClear(renderer);\n    SDL_RenderCopy(renderer, texture, nullptr, nullptr);\n    SDL_RenderPresent(renderer);\n    SDL_Delay(100);\n  }\n\n  SDL_DestroyTexture(texture);\n  SDL_DestroyRenderer(renderer);\n  SDL_DestroyWindow(window);\n\n  calloc.free(titleCString);\n  calloc.free(bmpFileCString);\n  calloc.free(modeCString);\n\n  SDL_Quit();\n}\n"
  },
  {
    "path": "dart/pubspec.yaml",
    "content": "name: main\ndescription: SDL2 Example\nversion: 1.0.0\nhomepage: https://github.com/xyproto/sdl2-examples\n\nenvironment:\n  sdk: '>=3.0.0 <4.0.0'\n\ndependencies:\n  ffi: ^2.0.2\n\nexecutables:\n  main:\n"
  },
  {
    "path": "freebasic/Makefile",
    "content": ".PHONY: all msg clean fullclean\n\nall: msg main\n\nmsg:\n\t@echo '--- FreeBASIC ---'\n\nmain: main.bas\n\t@echo -n '[main] Compiling...'\n\t@fbc main.bas\n\t@echo 'ok'\n\nrun: msg main\n\ttime ./main\n\nfullclean:\nclean:\n\trm -f *.o main\n"
  },
  {
    "path": "freebasic/README.md",
    "content": "# FreeBASIC\n\nTested on Arch Linux with the `fbc-git` package from AUR.\n\nSDL2 must be included with the FreeBASIC installation on your system for this example to work.\n"
  },
  {
    "path": "freebasic/main.bas",
    "content": "#include \"SDL2/SDL.bi\"\n#include \"SDL2/SDL_image.bi\"\n#include \"SDL2/SDL_ttf.bi\"\n\nSDL_Init(SDL_INIT_VIDEO)\nIMG_Init(0)\n\nvar win = SDL_CreateWindow(\"Hello world!\", 100, 100, 620, 387, 0)\nvar ren = SDL_CreateRenderer(win, -1, 0)\n\n'' Load the image into a surface and then into a texture\nvar img = IMG_Load(\"../img/grumpy-cat.bmp\")\nvar tex = SDL_CreateTextureFromSurface(ren, img)\nSDL_FreeSurface(img) : img = NULL\n\nfor i as Integer = 0 to 20\n  SDL_RenderClear(ren)\n  SDL_RenderCopy(ren, tex, NULL, NULL)\n  SDL_RenderPresent(ren)\n  SDL_Delay(100)\nnext i\n\nSDL_DestroyTexture(tex)\nSDL_DestroyRenderer(ren)\nSDL_DestroyWindow(win)\nSDL_Quit()\n"
  },
  {
    "path": "fsharp/Makefile",
    "content": ".PHONY: all msg clean\n\nall: msg bin\n\nmsg:\n\t@echo '--- F# ---'\n\nbin: main.fsproj main.fs\n\tdotnet build --sc --nologo --ucr\n\nrun: msg bin\n\ttime dotnet run\n\nclean:\n\trm -rf bin/ obj/\n"
  },
  {
    "path": "fsharp/main.fs",
    "content": "module Main\n\nopen System\nopen System.Runtime.InteropServices\nopen System.Text\nopen Microsoft.FSharp.NativeInterop\n\nlet SDL_INIT_VIDEO : uint32 = 0x00000020u\nlet SDL_WINDOWPOS_UNDEFINED : int32 = 0x1FFF0000\nlet SDL_WINDOW_SHOWN : uint32 = 0x00000004u\nlet SDL_RENDERER_ACCELERATED : uint32 = 0x00000002u\nlet SDL_RENDERER_PRESENTVSYNC : uint32 = 0x00000004u\n\n[<DllImport(\"SDL2\")>]\nextern int32 SDL_Init(uint32 flags)\n\n[<DllImport(\"SDL2\")>]\nextern IntPtr SDL_CreateWindow(string title, int x, int y, int w, int h, uint32 flags)\n\n[<DllImport(\"SDL2\")>]\nextern IntPtr SDL_CreateRenderer(IntPtr win, int index, uint32 flags)\n\n[<DllImport(\"SDL2\")>]\nextern IntPtr SDL_CreateTextureFromSurface(IntPtr renderer, IntPtr surface)\n\n[<DllImport(\"SDL2\")>]\nextern void SDL_DestroyRenderer(IntPtr renderer)\n\n[<DllImport(\"SDL2\")>]\nextern void SDL_DestroyWindow(IntPtr window)\n\n[<DllImport(\"SDL2\")>]\nextern void SDL_FreeSurface(IntPtr surface)\n\n[<DllImport(\"SDL2\")>]\nextern void SDL_DestroyTexture(IntPtr texture)\n\n[<DllImport(\"SDL2\")>]\nextern int32 SDL_RenderClear(IntPtr renderer)\n\n[<DllImport(\"SDL2\")>]\nextern int32 SDL_RenderCopy(IntPtr renderer, IntPtr texture, IntPtr srcrect, IntPtr dstrect)\n\n[<DllImport(\"SDL2\")>]\nextern void SDL_RenderPresent(IntPtr renderer)\n\n[<DllImport(\"SDL2\")>]\nextern IntPtr SDL_LoadBMP_RW(IntPtr src, int freesrc)\n\n[<DllImport(\"SDL2\")>]\nextern IntPtr SDL_RWFromFile(string filename, string permissions)\n\n[<DllImport(\"SDL2\")>]\nextern void SDL_Quit()\n\n[<DllImport(\"SDL2\")>]\nextern IntPtr SDL_GetError()\n\nlet printErr (topic: string) =\n    let errPtr = SDL_GetError()\n    let errString = Marshal.PtrToStringAnsi(errPtr)\n    Console.Error.WriteLine($\"{topic} Error: {errString}\")\n\n[<EntryPoint>]\nlet main argv =\n    if SDL_Init(SDL_INIT_VIDEO) <> 0 then\n        printErr \"SDL_Init\"\n        1\n    else\n        let win = SDL_CreateWindow(\"Hello, World!\", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 620, 387, SDL_WINDOW_SHOWN)\n        if win = IntPtr.Zero then\n            printErr \"SDL_CreateWindow\"\n            1\n        else\n            let ren = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED ||| SDL_RENDERER_PRESENTVSYNC)\n            if ren = IntPtr.Zero then\n                printErr \"SDL_CreateRenderer\"\n                SDL_DestroyWindow win\n                SDL_Quit()\n                1\n            else\n                let rwop = SDL_RWFromFile(\"../img/grumpy-cat.bmp\", \"rb\")\n                if rwop = IntPtr.Zero then\n                    printErr \"SDL_RWFromFile\"\n                    SDL_DestroyRenderer ren\n                    SDL_DestroyWindow win\n                    SDL_Quit()\n                    1\n                else\n                    let bmp = SDL_LoadBMP_RW(rwop, 1) // this also frees rwop\n                    if bmp = IntPtr.Zero then\n                        printErr \"SDL_LoadBMP_RW\"\n                        SDL_DestroyRenderer ren\n                        SDL_DestroyWindow win\n                        SDL_Quit()\n                        1\n                    else\n                        let tex = SDL_CreateTextureFromSurface(ren, bmp)\n                        SDL_FreeSurface(bmp)\n                        if tex = IntPtr.Zero then\n                            printErr \"SDL_CreateTextureFromSurface\"\n                            SDL_DestroyRenderer ren\n                            SDL_DestroyWindow win\n                            SDL_Quit()\n                            1\n                        else\n                            for i in 1 .. 20 do\n                                SDL_RenderClear ren |> ignore\n                                SDL_RenderCopy(ren, tex, IntPtr.Zero, IntPtr.Zero) |> ignore\n                                SDL_RenderPresent ren\n                                System.Threading.Thread.Sleep(100)\n                            SDL_DestroyTexture tex\n                            SDL_DestroyRenderer ren\n                            SDL_DestroyWindow win\n                            SDL_Quit()\n                            0\n"
  },
  {
    "path": "fsharp/main.fsproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <Configuration>Release</Configuration>\n    <OutputType>Exe</OutputType>\n    <TargetFramework>net8.0</TargetFramework>\n    <RootNamespace>YourNamespace</RootNamespace>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <Compile Include=\"main.fs\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "gambas/.directory",
    "content": "[Desktop Entry]\nIcon=./.icon.png\n"
  },
  {
    "path": "gambas/.gitignore",
    "content": "#---- Gambas files to ignore (v5)\n*.gambas\n.lock\n*~\ncore\ncore.*\nvgcore\nvgcore.*\n.kdbg*\n.*.prof\n.lang/*.pot\n.gambas/*\n.settings\n.startup\n.list\n.info\nmain\n#----\n"
  },
  {
    "path": "gambas/.project",
    "content": "# Gambas Project File 3.0\nTitle=Grumpy Cat\nStartup=MMain\nVersion=1.0.12\nComponent=gb.image\nComponent=gb.sdl2\nComponent=gb.opengl\nTabSize=2\nLanguage=en_US\nPackager=1\n"
  },
  {
    "path": "gambas/.src/MMain.module",
    "content": "' Gambas module file\n\nPrivate hWindow As Window\nPrivate hTimer As Timer\nPrivate hImage As Image\n\nPublic Sub Main()\n\n  hWindow = New Window As \"MainWindow\"\n  With hWindow\n    .Resize(620, 387)\n    .Resizable = False\n    .FrameRate = 60\n    .Title = \"Hello World!\"\n    .Show\n  End With\n\n  hImage = Image.Load(Application.Dir &/ \"../img/grumpy-cat.bmp\")\n\n  hTimer = New Timer As \"QuitTimer\"\n  With hTimer\n    .Delay = 2000\n    .Enabled = True\n  End With\nEnd\n\nPublic Sub MainWindow_Draw()\n  Draw.Clear\n  Draw.Image(hImage, 0, 0, 620, 387)\nEnd\n\nPublic Sub QuitTimer_Timer()\n  hTimer.Enabled = False\n  hWindow.Close()\n  Quit\nEnd\n"
  },
  {
    "path": "gambas/Makefile",
    "content": ".PHONY: all main msg clean fullclean\n\nall: msg main\n\nmsg:\n\t@echo '--- Gambas ---'\n\nmain: main.bas\n\tgbc3\n\tgba3 -o main\n\nrun: msg main\n\ttime ./main\n\nclean:\n\trm -f main\n\nfullclean: clean\n"
  },
  {
    "path": "gccgo/Makefile",
    "content": ".PHONY: all clean debug main msg run small static\n\nCFLAGS?=$(shell pkg-config sdl2 --cflags --libs)\n\nall: CFLAGS+=-O2\nall: main\n\nsmall: CFLAGS+=-Os\nsmall: main\n\tsstrip main\n\ndebug: CFLAGS+=-O0 -g\ndebug: main\n\nstatic: CFLAGS+=-O2 -static\nstatic: main\n\nmain:\n\tgo build -v -compiler gccgo -gccgoflags '${CFLAGS}' -o main\n\nmsg:\n\t@echo '--- GCCGO ---'\n\nrun:\n\t./main\n\nclean:\n\tgo clean\n"
  },
  {
    "path": "gccgo/README.md",
    "content": "Works with gccgo 8.2.1 and the latest version of go-sdl2.\n\nRequirements:\n\n* The SDL2 library and headers installed on your system.\n* For macOS, remember to install the Development Libraries (place the SDL2 framework in `/Library/Frameworks`).\n* The latest version of `gccgo` (tested with `gccgo 8.2.1`).\n* The `sdl2` package:\n\n    go get github.com/veandco/go-sdl2/sdl\n\nBuilding:\n\n    make\n\nRunning:\n\n    ./main\n"
  },
  {
    "path": "gccgo/go.mod",
    "content": "module github.com/xyproto/sdl2-examples/gccgo\n\ngo 1.18\n\nrequire github.com/veandco/go-sdl2 v0.4.36\n"
  },
  {
    "path": "gccgo/go.sum",
    "content": "github.com/veandco/go-sdl2 v0.4.36 h1:Ltydev536rRQodmIrTWFZ3dRp5A+/6t5CYvbi4Kvia0=\ngithub.com/veandco/go-sdl2 v0.4.36/go.mod h1:OROqMhHD43nT4/i9crJukyVecjPNYYuCofep6SNiAjY=\n"
  },
  {
    "path": "gccgo/main.go",
    "content": "package main\n\nimport (\n\t\"log\"\n\t\"path/filepath\"\n\n\t\"github.com/veandco/go-sdl2/img\"\n\t\"github.com/veandco/go-sdl2/sdl\"\n)\n\nfunc main() {\n\t// Initialize\n\tif err := sdl.Init(sdl.INIT_EVERYTHING); err != nil {\n\t\tlog.Fatalln(\"Init Error:\", err)\n\t}\n\t// Make sure to quit when the function returns\n\tdefer sdl.Quit()\n\n\t// Create the window\n\twin, err := sdl.CreateWindow(\"Hello World!\", 100, 100, 620, 387, sdl.WINDOW_SHOWN)\n\tif err != nil {\n\t\tlog.Fatalln(\"CreateWindow Error:\", err)\n\t}\n\tdefer win.Destroy()\n\n\t// Create a renderer\n\tren, err := sdl.CreateRenderer(win, -1, sdl.RENDERER_ACCELERATED|sdl.RENDERER_PRESENTVSYNC)\n\tif err != nil {\n\t\tlog.Fatalln(\"CreateRenderer Error:\", err)\n\t}\n\tdefer ren.Destroy()\n\n\t// Load the image as a texture\n\ttex, err := img.LoadTexture(ren, filepath.Join(\"..\", \"img\", \"grumpy-cat.png\"))\n\tif err != nil {\n\t\tlog.Fatalln(\"LoadTexture Error:\", err)\n\t}\n\tdefer tex.Destroy()\n\n\tfor i := 0; i < 20; i++ {\n\t\t// Clear the renderer and display the image/texture\n\t\tren.Clear()\n\t\tren.Copy(tex, nil, nil)\n\t\tren.Present()\n\n\t\t// Wait 100 ms\n\t\tsdl.Delay(100)\n\t}\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/CONTRIBUTORS.md",
    "content": "Contributors\n============\nHere's the list of contributors with their respective Github URLs.\n* [Jacky Boen](https://github.com/jackyb)\n* [HardWareGuy](https://github.com/HardWareGuy)\n* [akovaski](https://github.com/akovaski)\n* [Jeromy Johnson](https://github.com/whyrusleeping)\n* [Cai Lei](https://github.com/ccll)\n* [Arne Döring](https://github.com/krux02)\n* [Marcus von Appen](https://github.com/marcusva)\n* [Tom Murray](https://github.com/TomMurray)\n* [Ian Davis](https://github.com/iand)\n* [hschendel](https://github.com/hschendel)\n* [Ingo Oeser](https://github.com/nightlyone)\n* [nlordell](https://github.com/nlordell)\n* [Ben Davies](https://github.com/JalfResi)\n* [Bastien Dejean](https://github.com/baskerville)\n* [Pirmin Tapken](https://github.com/PirminTapken)\n* [Robert Lillack](https://github.com/roblillack)\n* [Marcell Jusztin](https://github.com/morcmarc)\n* [Stan Schwertly](https://github.com/Stantheman)\n* [Michael Vetter](https://github.com/jubalh)\n* [Tom Fogal](https://github.com/tfogal)\n* [Philipp Meinen](https://github.com/PhiCode)\n* [Thomas McGrew](https://github.com/mcgrew)\n* [Geoff Catlin](https://github.com/gcatlin)\n* [Schobers](https://github.com/Schobers)\n* [Jan Tuitman](https://github.com/jantuitman)\n* [Nick Powell](https://github.com/THUNDERGROOVE)\n* [Steven R. Wiley](https://github.com/srwiley)\n* [Franco Lazzarino](https://github.com/flazz)\n* [Jason Alan Palmer](https://github.com/jalan)\n* [Seuk Won Kang](https://github.com/kasworld)\n* [Brandon Mulcahy](https://github.com/jangler)\n* [Tim Anema](https://github.com/tanema)\n* [Tyler Compton](https://github.com/velovix)\n* [Nicolas Hess](https://github.com/n0dev)\n* [Stephen Noonan](https://github.com/tycho)\n* [Guilherme Freitas Nemeth](https://github.com/glhrmfrts)\n* [Charney Kaye](https://github.com/charneykaye)\n* [Lars Scheme](https://github.com/gonutz)\n* [Emil Laine](https://github.com/emlai)\n* [Sergey Parshukov](https://github.com/jBugman)\n* [Casey DeLorme](https://github.com/cdelorme)\n* [Andreas T. Jonsson](https://github.com/andreas-jonsson)\n* [Milan Nikolic](https://github.com/gen2brain)\n* [Mike Gerow](https://github.com/gerow)\n* [Lilis Iskandar](https://github.com/veeableful)\n* [tfriedel6](https://github.com/tfriedel6)\n* [Eric Bronner](https://github.com/MoonWatcher582)\n* [Julien Castelain](https://github.com/julien)\n* [Robert Wallis](https://github.com/robert-wallis)\n* [Chae-Young Song](https://github.com/chaeyoungsong)\n* [Robert Wallis](https://github.com/robert-wallis)\n* [Lennart Buhl](https://github.com/r41d)\n* [Giovanni Bajo](https://github.com/rasky)\n* [Laurent Vaucher](https://github.com/slowfrog)\n* [Mike](https://github.com/barbeque)\n* [Tomas Virgl](https://github.com/tvi)\n* [Aye Aye Maung](https://github.com/ZeroXLR)\n* [Anton Malashin](https://github.com/malashin)\n* [John Perkins](https://github.com/mpath)\n* [jclc](https://github.com/jclc)\n* [flga](https://github.com/flga)\n\n_if anyone is missing, let me know!.. or you can add yourself in :)_\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/LICENSE",
    "content": "Copyright (c) 2013, Go-SDL2 Authors\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n\t* Redistributions of source code must retain the above copyright notice,\nthis list of conditions and the following disclaimer.\n\t* Redistributions in binary form must reproduce the above copyright\nnotice, this list of conditions and the following disclaimer in the\ndocumentation and/or other materials provided with the distribution.\n\t* Neither the name of Go-SDL2 nor the names of its contributors may be\nused to endorse or promote products derived from this software without specific\nprior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/_libs/dummy.go",
    "content": "package dummy\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/img/sdl_image.go",
    "content": "// Package img is a simple library to load images of various formats as SDL surfaces.\npackage img\n\n//#include <stdlib.h>\n//#include \"sdl_image_wrapper.h\"\nimport \"C\"\nimport \"unsafe\"\nimport \"errors\"\nimport \"github.com/veandco/go-sdl2/sdl\"\n\n// Flags which may be passed to img.Init() to load support of image formats, can be bitwise OR'd together.\nconst (\n\tINIT_JPG  = 0x00000001 // JPG\n\tINIT_PNG  = 0x00000002 // PNG\n\tINIT_TIF  = 0x00000004 // TIF\n\tINIT_WEBP = 0x00000008 // WebP\n)\n\n// LinkedVersion returns the version of the dynamically linked SDL_image library.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_7.html)\nfunc LinkedVersion() *sdl.Version {\n\treturn (*sdl.Version)(unsafe.Pointer(C.IMG_Linked_Version()))\n}\n\n// Init loads dynamic libraries and prepares them for use. Flags should be one or more flags from IMG_InitFlags OR'd together. It returns the flags successfully initialized, or 0 on failure.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_8.html)\nfunc Init(flags int) error {\n\t_flags := (C.int)(flags)\n\tret := int(C.IMG_Init(_flags))\n\tif ret == 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Quit unloads libraries loaded with img.Init().\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_9.html)\nfunc Quit() {\n\tC.IMG_Quit()\n}\n\n// GetError returns the last error that occurred, or an empty string if there hasn't been an error message set since the last call to sdl.ClearError().\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_45.html)\nfunc GetError() error {\n\te := C.IMG_GetError()\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn errors.New(C.GoString(e))\n}\n\n// LoadTypedRW loads an image from an SDL data source. The 'type' may be one of: \"BMP\", \"GIF\", \"PNG\", etc. If the image format supports a transparent pixel, SDL will set the colorkey for the surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_13.html)\nfunc LoadTypedRW(src *sdl.RWops, freesrc bool, type_ string) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_freesrc := (C.int)(sdl.Btoi(freesrc))\n\t_type := C.CString(type_)\n\tdefer C.free(unsafe.Pointer(_type))\n\t_surface := C.IMG_LoadTyped_RW(_src, _freesrc, _type)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// Load loads a file for use as an image in a new surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_11.html)\nfunc Load(file string) (*sdl.Surface, error) {\n\t_file := C.CString(file)\n\tdefer C.free(unsafe.Pointer(_file))\n\t_surface := C.IMG_Load(_file)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadRW loads an image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_12.html)\nfunc LoadRW(src *sdl.RWops, freesrc bool) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_freesrc := (C.int)(sdl.Btoi(freesrc))\n\t_surface := C.IMG_Load_RW(_src, _freesrc)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadTexture loads an image directly into a render texture.\nfunc LoadTexture(renderer *sdl.Renderer, file string) (*sdl.Texture, error) {\n\t_renderer := (*C.SDL_Renderer)(unsafe.Pointer(renderer))\n\t_file := C.CString(file)\n\tdefer C.free(unsafe.Pointer(_file))\n\t_surface := C.IMG_LoadTexture(_renderer, _file)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Texture)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadTextureRW loads an image from an SDL data source directly into a render texture.\nfunc LoadTextureRW(renderer *sdl.Renderer, src *sdl.RWops, freesrc bool) (*sdl.Texture, error) {\n\t_renderer := (*C.SDL_Renderer)(unsafe.Pointer(renderer))\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_freesrc := (C.int)(sdl.Btoi(freesrc))\n\t_surface := C.IMG_LoadTexture_RW(_renderer, _src, _freesrc)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Texture)(unsafe.Pointer(_surface)), nil\n}\n\n// IsICO reports whether ICO format is supported and image data is readable as an ICO.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_31.html)\nfunc IsICO(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isICO(_src)) > 0\n}\n\n// IsCUR reports whether CUR format is supported and image data is readable as a CUR.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_30.html)\nfunc IsCUR(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isCUR(_src)) > 0\n}\n\n// IsBMP reports whether BMP format is supported and image data is readable as a BMP.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_32.html)\nfunc IsBMP(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isBMP(_src)) > 0\n}\n\n// IsGIF reports whether GIF format is supported and image data is readable as a GIF.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_37.html)\nfunc IsGIF(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isGIF(_src)) > 0\n}\n\n// IsJPG reports whether JPG format is supported and image data is readable as a JPG.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_38.html)\nfunc IsJPG(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isJPG(_src)) > 0\n}\n\n// IsLBM reports whether LBM format is supported and image data is readable as an LBM.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_41.html)\nfunc IsLBM(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isLBM(_src)) > 0\n}\n\n// IsPCX reports whether PCX format is supported and image data is readable as a PCX.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_36.html)\nfunc IsPCX(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isPCX(_src)) > 0\n}\n\n// IsPNG reports whether PNG format is supported and image data is readable as a PNG.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_40.html)\nfunc IsPNG(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isPNG(_src)) > 0\n}\n\n// IsPNM reports whether PNM format is supported and image data is readable as a PNM.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_33.html)\nfunc IsPNM(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isPNM(_src)) > 0\n}\n\n// IsTIF reports whether TIF format is supported and image data is readable as a TIF.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_39.html)\nfunc IsTIF(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isTIF(_src)) > 0\n}\n\n// IsXCF reports whether XCF format is supported and image data is readable as an XCF.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_35.html)\nfunc IsXCF(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isXCF(_src)) > 0\n}\n\n// IsXPM reports whether XPM format is supported and image data is readable as an XPM.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_34.html)\nfunc IsXPM(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isXPM(_src)) > 0\n}\n\n// IsXV reports whether XV format is supported and image data is readable as an XV thumbnail.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_42.html)\nfunc IsXV(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isXV(_src)) > 0\n}\n\n// IsWEBP reports whether WEBP format is supported and image data is readable as a WEBP.\nfunc IsWEBP(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isWEBP(_src)) > 0\n}\n\n// LoadICORW loads an ICO image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_15.html)\nfunc LoadICORW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadICO_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadCURRW loads a CUR image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_14.html)\nfunc LoadCURRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadCUR_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadBMPRW loads a BMP image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_16.html)\nfunc LoadBMPRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadBMP_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadGIFRW loads a GIF image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_21.html)\nfunc LoadGIFRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadGIF_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadJPGRW loads a JPG image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_22.html)\nfunc LoadJPGRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadJPG_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadLBMRW loads an LBM image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_26.html)\nfunc LoadLBMRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadLBM_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadPCXRW loads a PCX image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_20.html)\nfunc LoadPCXRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadPCX_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadPNGRW loads a PNG image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_24.html)\nfunc LoadPNGRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadPNG_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadPNMRW loads a PNM image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_17.html)\nfunc LoadPNMRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadPNM_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadTGARW loads a TGA image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_25.html)\nfunc LoadTGARW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadTGA_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadTIFRW loads a TIF image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_23.html)\nfunc LoadTIFRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadTIF_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadXCFRW loads an XCF image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_19.html)\nfunc LoadXCFRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadXCF_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadXPMRW loads an XPM image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_18.html)\nfunc LoadXPMRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadXPM_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadXVRW loads an XV thumbnail image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_27.html)\nfunc LoadXVRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadXV_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadWEBPRW loads a WEBP image from an SDL data source for use as a surface.\nfunc LoadWEBPRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadWEBP_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// ReadXPMFromArray loads an XPM image from xpm data for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_28.html)\nfunc ReadXPMFromArray(xpm string) (*sdl.Surface, error) {\n\t_xpm := C.CString(xpm)\n\tdefer C.free(unsafe.Pointer(_xpm))\n\t_surface := C.IMG_ReadXPMFromArray(&_xpm)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// SavePNG saves a surface as PNG file.\nfunc SavePNG(surface *sdl.Surface, file string) error {\n\t_surface := (*C.SDL_Surface)(unsafe.Pointer(surface))\n\t_file := C.CString(file)\n\tdefer C.free(unsafe.Pointer(_file))\n\t_ret := C.IMG_SavePNG(_surface, _file)\n\tif _ret < 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// SavePNGRW saves a surface to an SDL data source.\nfunc SavePNGRW(surface *sdl.Surface, dst *sdl.RWops, freedst int) error {\n\t_surface := (*C.SDL_Surface)(unsafe.Pointer(surface))\n\t_dst := (*C.SDL_RWops)(unsafe.Pointer(dst))\n\t_freedst := (C.int)(freedst)\n\t_ret := C.IMG_SavePNG_RW(_surface, _dst, _freedst)\n\tif _ret < 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/img/sdl_image_cgo.go",
    "content": "// +build !static\n\npackage img\n\n//#cgo linux freebsd darwin pkg-config: sdl2\n//#cgo linux freebsd darwin LDFLAGS: -lSDL2_image\n//#cgo windows LDFLAGS: -lSDL2 -lSDL2_image\nimport \"C\"\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/img/sdl_image_cgo_static.go",
    "content": "// +build static\n\npackage img\n\n//#cgo CFLAGS: -I${SRCDIR}/../_libs/include -I${SRCDIR}/../_libs/include/SDL2\n//#cgo LDFLAGS: -L${SRCDIR}/../_libs\n//#cgo linux,386 LDFLAGS: -lSDL2_image_linux_386 -Wl,--no-undefined -lpng_linux_386 -ljpeg_linux_386 -lSDL2_linux_386 -lm -ldl -lz -lasound -lm -ldl -lpthread -lX11 -lXext -lXcursor -lXinerama -lXi -lXrandr -lXss -lXxf86vm -lpthread -lrt\n//#cgo linux,amd64 LDFLAGS: -lSDL2_image_linux_amd64 -Wl,--no-undefined -lpng_linux_amd64 -ljpeg_linux_amd64 -lSDL2_linux_amd64 -lm -ldl -lz -lasound -lm -ldl -lpthread -lX11 -lXext -lXcursor -lXinerama -lXi -lXrandr -lXss -lXxf86vm -lpthread -lrt\n//#cgo windows,386 LDFLAGS: -lSDL2_image_windows_386 -Wl,--no-undefined -lpng_windows_386 -ljpeg_windows_386 -lz_windows_386 -lSDL2_windows_386 -lSDL2main_windows_386 -Wl,--no-undefined -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -lsetupapi -static-libgcc\n//#cgo windows,amd64 LDFLAGS: -lSDL2_image_windows_amd64 -Wl,--no-undefined -lpng_windows_amd64 -ljpeg_windows_amd64 -lz_windows_amd64 -lSDL2_windows_amd64 -lSDL2main_windows_amd64 -Wl,--no-undefined -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -lsetupapi -static-libgcc\n//#cgo darwin,amd64 LDFLAGS: -lSDL2_image_darwin_amd64 -lSDL2_darwin_amd64 -lpng_darwin_amd64 -ljpeg_darwin_amd64 -lm -lz -liconv -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,ForceFeedback -lobjc -Wl,-framework,CoreVideo -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,IOKit -Wl,-framework,Metal\n//#cgo darwin,arm64 LDFLAGS: -lSDL2_image_darwin_arm64 -lSDL2_darwin_arm64 -lpng_darwin_arm64 -ljpeg_darwin_arm64 -lm -lz -liconv -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,ForceFeedback -lobjc -Wl,-framework,CoreVideo -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,IOKit -Wl,-framework,Metal\n//#cgo android,arm LDFLAGS: -lSDL2_image_android_arm -Wl,--no-undefined -lpng_android_arm -ljpeg_android_arm -lSDL2_android_arm -lm -ldl -lz -llog -landroid -lGLESv2 -lGLESv1_CM\n//#cgo linux,arm,!android LDFLAGS: -L/opt/vc/lib -L/opt/vc/lib64 -lSDL2_image_linux_arm -Wl,--no-undefined -lpng_linux_arm -ljpeg_linux_arm -lSDL2_linux_arm -lm -ldl -lz -liconv -lbcm_host -lvcos -lvchiq_arm -pthread\nimport \"C\"\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/img/sdl_image_wrapper.h",
    "content": "#if defined(__WIN32)\n\t#include <SDL2/SDL_image.h>\n\t#include <stdlib.h>\n#else\n\t#include <SDL_image.h>\n#endif\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/TODO.md",
    "content": "## 2.0.16\n\n[x] SDL_FlashWindow() to get a user’s attention\n[x] SDL_GetAudioDeviceSpec() to get the preferred audio format of a device\n[x] SDL_SetWindowAlwaysOnTop() to dynamically change the SDL_WINDOW_ALWAYS_ON_TOP flag for a window\n[x] SDL_SetWindowKeyboardGrab() to support grabbing the keyboard independently of the mouse\n[x] SDL_SoftStretchLinear() to do bilinear scaling between 32-bit software surfaces\n[x] SDL_UpdateNVTexture() to update streaming NV12/21 textures\n[x] SDL_GameControllerSendEffect() and SDL_JoystickSendEffect() to allow sending custom trigger effects to the DualSense controller\n[x] SDL_GameControllerGetSensorDataRate() to get the sensor data rate for PlayStation and Nintendo Switch controllers\n\n### Windows\n\n[?] SDL_SetWindowsMessageHook() to set a function that is called for all Windows messages\n[?] SDL_RenderGetD3D11Device() to get the D3D11 device used by the SDL renderer\n\n### Linux\n\n[x] SDL_HINT_AUDIO_INCLUDE_MONITORS to control whether PulseAudio recording should include monitor devices\n[x] SDL_HINT_AUDIO_DEVICE_STREAM_ROLE to describe the role of your application for audio control panels\n\n### Android:\n\n[?] SDL_AndroidShowToast() to show a lightweight notification\n\n## 2.0.14\n\n[x] SDL_GameControllerGetSerial()\n[x] SDL_GameControllerHasAxis()\n[x] SDL_GameControllerHasButton()\n[x] SDL_GameControllerGetNumTouchpads()\n[x] SDL_GameControllerGetNumTouchpadFingers()\n[x] SDL_GameControllerGetTouchpadFinger()\n[x] SDL_GameControllerHasSensor()\n[x] SDL_GameControllerSetSensorEnabled()\n[x] SDL_GameControllerIsSensorEnabled()\n[x] SDL_GameControllerGetSensorData\n[x] SDL_GameControllerRumbleTriggers()\n[x] SDL_GameControllerHasLED()\n[x] SDL_GameControllerSetLED()\n[x] SDL_JoystickGetSerial()\n[x] SDL_JoystickRumbleTriggers()\n[x] SDL_JoystickHasLED()\n[x] SDL_JoystickSetLED()\n[x] SDL_JoystickAttachVirtual()\n[x] SDL_JoystickDetachVirtual()\n[x] SDL_JoystickIsVirtual()\n[x] SDL_JoystickSetVirtualAxis()\n[x] SDL_JoystickSetVirtualButton()\n[x] SDL_JoystickSetVirtualHat()\n[x] SDL_LockSensors()\n[x] SDL_UnlockSensors()\n[x] SDL_HAPTIC_STEERING_AXIS\n[x] SDL_GetPreferredLocales()\n[x] SDL_OpenURL()\n[x] SDL_HasSurfaceRLE()\n[x] SDL_SIMDRealloc()\n[x] SDL_GetErrorMsg()\n[x] SDL_Metal_GetLayer()\n[x] SDL_Metal_GetDrawableSize()\n[x] SDL_HINT_JOYSTICK_HIDAPI_PS5\n[x] SDL_HINT_MOUSE_RELATIVE_SCALING\n[x] SDL_HINT_PREFERRED_LOCALES\n[x] SDL_HINT_JOYSTICK_RAWINPUT\n[x] SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT\n[x] SDL_HINT_AUDIO_DEVICE_APP_NAME\n[x] SDL_HINT_AUDIO_DEVICE_STREAM_NAME\n[x] SDL_HINT_LINUX_JOYSTICK_DEADZONES\n[x] SDL_HINT_THREAD_PRIORITY_POLICY\n[x] SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL\n[x] SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO\n[x] SDL_HINT_EMSCRIPTEN_ASYNCIFY\n[x] SDL_PIXELFORMAT_XRGB4444\n[x] SDL_PIXELFORMAT_XBGR4444\n[x] SDL_PIXELFORMAT_XRGB1555\n[x] SDL_PIXELFORMAT_XBGR1555\n[x] SDL_PIXELFORMAT_XRGB8888\n[x] SDL_PIXELFORMAT_XBGR8888\n[x] SDL_WINDOW_METAL\n[x] SDL_AndroidRequestPermission()\n\n## 2.0.12\n\n[x] SDL_GameControllerTypeForIndex\n[x] SDL_GameControllerGetType\n[x] SDL_GameControllerFromPlayerIndex\n[x] SDL_GameControllerSetPlayerIndex\n[x] SDL_JoystickFromPlayerIndex\n[x] SDL_JoystickSetPlayerIndex\n[x] SDL_GetTextureScaleMode\n[x] SDL_SetTextureScaleMode\n[x] SDL_LockTextureToSurface\n[x] SDL_BLENDMODE_MUL\n[x] SDL_TouchFingerEvent update\n[x] SDL_HasARMSIMD\n[x] SDL_HINT_DISPLAY_USABLE_BOUNDS\n[x] SDL_HINT_GAMECONTROLLERTYPE\n[x] SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS\n[x] SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE\n[x] SDL_HINT_VIDEO_X11_WINDOW_VISUALID\n[x] SDL_HINT_VIDEO_X11_FORCE_EGL\n[x] SDL_Metal_CreateView\n[x] SDL_Metal_DestroyView\n[x] SDL_GetAndroidSDKVersion\n\n## 2.0.10\n\n[x] SDL_SIMDGetAlignment\n[x] SDL_SIMDAlloc\n[x] SDL_SIMDFree\n[x] SDL_RenderDrawPointF\n[x] SDL_RenderDrawPointsF\n[x] SDL_RenderDrawLineF\n[x] SDL_RenderDrawLinesF\n[x] SDL_RenderDrawRectF\n[x] SDL_RenderDrawRectsF\n[x] SDL_RenderFillRectF\n[x] SDL_RenderFillRectsF\n[x] SDL_RenderCopyF\n[x] SDL_RenderCopyExF\n[x] SDL_GetTouchDeviceType\n[x] SDL_RenderFlush\n[x] SDL_HINT_RENDER_BATCHING\n[x] SDL_HINT_EVENT_LOGGING\n[x] SDL_HINT_GAMECONTROLLERCONFIG_FILE\n[x] SDL_HINT_MOUSE_TOUCH_EVENTS\n\n## 2.0.9\n\n[x] SDL_SENSORUPDATE\n[x] SDL_DISPLAYEVENT\n[x] SDL_JoystickGetDevicePlayerIndex\n[x] SDL_JoystickGetPlayerIndex\n[x] SDL_GameControllerGetPlayerIndex\n[x] SDL_GameControllerRumble\n[x] SDL_JoystickRumble\n[x] SDL_GameControllerMappingForDeviceIndex\n[x] SDL_HINT_MOUSE_DOUBLE_CLICK_TIME\n[x] SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS\n[x] SDL_HasColorKey\n[x] SDL_HasAVX512F\n[x] SDL_IsTablet\n[?] SDL_THREAD_PRIORITY_TIME_CRITICAL\n\n## 2.0.8\n\n### Hints\n\n[x] SDL_HINT_IOS_HIDE_HOME_INDICATOR\n[x] SDL_HINT_RETURN_KEY_HIDES_IME\n[x] SDL_HINT_TV_REMOTE_AS_JOYSTICK\n[x] SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR\n[x] SDL_HINT_VIDEO_DOUBLE_BUFFER\n\n### Surface\n\n[x] SDL_SetYUVConversionMode()\n[x] SDL_GetYUVConversionMode()\n\n### Android\n\n[x] SDL_IsAndroidTV()\n\n### Mac OS X / iOS / tvOS\n\n[x] SDL_RenderGetMetalLayer()\n[x] SDL_RenderGetMetalCommandEncoder()\n\n### Windows UWP\n\n[ ] SDL_WinRTGetDeviceFamily()\n\n## 2.0.7\n\n### General\n\nAudio\n\n- [x] SDL_NewAudioStream()\n- [x] SDL_AudioStreamPut()\n- [x] SDL_AudioStreamGet()\n- [x] SDL_AudioStreamAvailable()\n- [x] SDL_AudioStreamFlush()\n- [x] SDL_AudioStreamClear()\n- [x] SDL_FreeAudioStream()\n\nJoystick\n\n- [x] SDL_LockJoysticks()\n- [x] SDL_UnlockJoysticks()\n\nStdinc\n\n- [ ] SDL_GetMemoryFunctions()\n- [ ] SDL_SetMemoryFunctions()\n- [ ] SDL_GetNumAllocations()\n\n## 2.0.6\n\n### General\n\nBlend Mode\n\n- [x] SDL_ComposeCustomBlendMode()\n\nCPU Info\n\n- [x] SDL_HasNEON()\n\nGame Controller\n\n- [x] SDL_GameControllerGetVendor()\n- [x] SDL_GameControllerGetProduct()\n- [x] SDL_GameControllerGetProductVersion()\n- [x] SDL_GameControllerNumMappings()\n- [x] SDL_GameControllerMappingForIndex()\n\nHints\n\n- [x] SDL_HINT_AUDIO_RESAMPLING_MODE\n- [x] SDL_HINT_RENDER_LOGICAL_SIZE_MODE\n- [x] SDL_HINT_MOUSE_NORMAL_SPEED_SCALE\n- [x] SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE\n- [x] SDL_HINT_TOUCH_MOUSE_EVENTS\n\nJoystick\n\n- [x] SDL_JoystickGetDeviceVendor()\n- [x] SDL_JoystickGetDeviceProduct()\n- [x] SDL_JoystickGetDeviceProductVersion()\n- [x] SDL_JoystickGetDeviceType()\n- [x] SDL_JoystickGetDeviceInstanceID()\n- [x] SDL_JoystickGetVendor()\n- [x] SDL_JoystickGetProduct()\n- [x] SDL_JoystickGetProductVersion()\n- [x] SDL_JoystickGetType()\n- [x] SDL_JoystickGetAxisInitialState()\n\nRW Ops\n\n- [x] SDL_LoadFile()\n- [x] SDL_LoadFile_RW()\n\nSurface\n\n- [x] SDL_DuplicateSurface()\n\nVulkan\n\n- [x] SDL_Vulkan_LoadLibrary()\n- [x] SDL_Vulkan_GetVkGetInstanceProcAddr()\n- [x] SDL_Vulkan_GetInstanceExtensions()\n- [x] SDL_Vulkan_CreateSurface()\n- [x] SDL_Vulkan_GetDrawableSize()\n- [x] SDL_Vulkan_UnloadLibrary()\n\n### Windows\n\nHints\n\n- [x] SDL_HINT_WINDOWS_INTRESOURCE_ICON\n- [x] SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL\n\n## Miscellaneous\n\n- [ ] Add ability to set window title bar color on runtime\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/audio.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,4))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_QueueAudio is not supported before SDL 2.0.4\")\n#endif\n\nstatic int SDL_QueueAudio(SDL_AudioDeviceID dev, const void *data, Uint32 len)\n{\n\treturn -1;\n}\nstatic Uint32 SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev_id)\n{\n\treturn 0;\n}\nstatic void SDL_ClearQueuedAudio(SDL_AudioDeviceID dev)\n{\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,5))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_DequeueAudio is not supported before SDL 2.0.5\")\n#endif\n\nstatic int SDL_DequeueAudio(SDL_AudioDeviceID dev, const void *data, Uint32 len)\n{\n\treturn -1;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,7))\n\nstruct _SDL_AudioStream;\ntypedef struct _SDL_AudioStream SDL_AudioStream;\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_NewAudioStream is not supported before SDL 2.0.7\")\n#endif\n\nstatic SDL_AudioStream * SDL_NewAudioStream(const SDL_AudioFormat src_format, const Uint8 src_channels, const int src_rate, const SDL_AudioFormat dst_format, const Uint8 dst_channels, const int dst_rate)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_AudioStreamPut is not supported before SDL 2.0.7\")\n#endif\n\nstatic int SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_AudioStreamGet is not supported before SDL 2.0.7\")\n#endif\n\nstatic int SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_AudioStreamAvailable is not supported before SDL 2.0.7\")\n#endif\n\nstatic int SDL_AudioStreamAvailable(SDL_AudioStream *stream)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_AudioStreamFlush is not supported before SDL 2.0.7\")\n#endif\n\nstatic int SDL_AudioStreamFlush(SDL_AudioStream *stream)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_AudioStreamClear is not supported before SDL 2.0.7\")\n#endif\n\nstatic int SDL_AudioStreamClear(SDL_AudioStream *stream)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_FreeAudioStream is not supported before SDL 2.0.7\")\n#endif\n\nstatic void SDL_FreeAudioStream(SDL_AudioStream *stream)\n{\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,16))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetAudioDeviceSpec is not supported before SDL 2.0.16\")\n#endif\n\nstatic int SDL_GetAudioDeviceSpec(int index, int iscapture, SDL_AudioSpec *spec)\n{\n\treturn -1;\n}\n\n\n#endif\n*/\nimport \"C\"\nimport (\n\t\"reflect\"\n\t\"unsafe\"\n)\n\n// Audio format masks.\n// (https://wiki.libsdl.org/SDL_AudioFormat)\nconst (\n\tAUDIO_MASK_BITSIZE  = C.SDL_AUDIO_MASK_BITSIZE  // (0xFF)\n\tAUDIO_MASK_DATATYPE = C.SDL_AUDIO_MASK_DATATYPE // (1<<8)\n\tAUDIO_MASK_ENDIAN   = C.SDL_AUDIO_MASK_ENDIAN   // (1<<12)\n\tAUDIO_MASK_SIGNED   = C.SDL_AUDIO_MASK_SIGNED   // (1<<15)\n)\n\n// Audio format values.\n// (https://wiki.libsdl.org/SDL_AudioFormat)\nconst (\n\tAUDIO_S8 = C.AUDIO_S8 // signed 8-bit samples\n\tAUDIO_U8 = C.AUDIO_U8 // unsigned 8-bit samples\n\n\tAUDIO_S16LSB = C.AUDIO_S16LSB // signed 16-bit samples in little-endian byte order\n\tAUDIO_S16MSB = C.AUDIO_S16MSB // signed 16-bit samples in big-endian byte order\n\tAUDIO_S16SYS = C.AUDIO_S16SYS // signed 16-bit samples in native byte order\n\tAUDIO_S16    = C.AUDIO_S16    // AUDIO_S16LSB\n\tAUDIO_U16LSB = C.AUDIO_U16LSB // unsigned 16-bit samples in little-endian byte order\n\tAUDIO_U16MSB = C.AUDIO_U16MSB // unsigned 16-bit samples in big-endian byte order\n\tAUDIO_U16SYS = C.AUDIO_U16SYS // unsigned 16-bit samples in native byte order\n\tAUDIO_U16    = C.AUDIO_U16    // AUDIO_U16LSB\n\n\tAUDIO_S32LSB = C.AUDIO_S32LSB // 32-bit integer samples in little-endian byte order\n\tAUDIO_S32MSB = C.AUDIO_S32MSB // 32-bit integer samples in big-endian byte order\n\tAUDIO_S32SYS = C.AUDIO_S32SYS // 32-bit integer samples in native byte order\n\tAUDIO_S32    = C.AUDIO_S32    // AUDIO_S32LSB\n\n\tAUDIO_F32LSB = C.AUDIO_F32LSB // 32-bit floating point samples in little-endian byte order\n\tAUDIO_F32MSB = C.AUDIO_F32MSB // 32-bit floating point samples in big-endian byte order\n\tAUDIO_F32SYS = C.AUDIO_F32SYS // 32-bit floating point samples in native byte order\n\tAUDIO_F32    = C.AUDIO_F32    // AUDIO_F32LSB\n)\n\n// AllowedChanges flags specify how SDL should behave when a device cannot offer a specific feature. If the application requests a feature that the hardware doesn't offer, SDL will always try to get the closest equivalent. Used in OpenAudioDevice().\n// (https://wiki.libsdl.org/SDL_OpenAudioDevice)\nconst (\n\tAUDIO_ALLOW_FREQUENCY_CHANGE = C.SDL_AUDIO_ALLOW_FREQUENCY_CHANGE\n\tAUDIO_ALLOW_FORMAT_CHANGE    = C.SDL_AUDIO_ALLOW_FORMAT_CHANGE\n\tAUDIO_ALLOW_CHANNELS_CHANGE  = C.SDL_AUDIO_ALLOW_CHANNELS_CHANGE\n\tAUDIO_ALLOW_ANY_CHANGE       = C.SDL_AUDIO_ALLOW_ANY_CHANGE\n)\n\n// An enumeration of audio device states used in GetAudioDeviceStatus() and GetAudioStatus().\n// (https://wiki.libsdl.org/SDL_AudioStatus)\nconst (\n\tAUDIO_STOPPED AudioStatus = C.SDL_AUDIO_STOPPED // audio device is stopped\n\tAUDIO_PLAYING             = C.SDL_AUDIO_PLAYING // audio device is playing\n\tAUDIO_PAUSED              = C.SDL_AUDIO_PAUSED  // audio device is paused\n)\n\n// MIX_MAXVOLUME is the full audio volume value used in MixAudioFormat() and AudioFormat().\n// (https://wiki.libsdl.org/SDL_MixAudioFormat)\nconst MIX_MAXVOLUME = C.SDL_MIX_MAXVOLUME // full audio volume\n\n// AudioFormat is an enumeration of audio formats.\n// (https://wiki.libsdl.org/SDL_AudioFormat)\ntype AudioFormat uint16\n\n// AudioCallback is a function to call when the audio device needs more data.`\n// (https://wiki.libsdl.org/SDL_AudioSpec)\ntype AudioCallback C.SDL_AudioCallback\n\n// AudioFilter is the filter list used in AudioCVT() (internal use)\n// (https://wiki.libsdl.org/SDL_AudioCVT)\ntype AudioFilter C.SDL_AudioFilter\n\n// AudioDeviceID is ID of an audio device previously opened with OpenAudioDevice().\n// (https://wiki.libsdl.org/SDL_OpenAudioDevice)\ntype AudioDeviceID uint32\n\n// AudioStatus is an enumeration of audio device states.\n// (https://wiki.libsdl.org/SDL_AudioStatus)\ntype AudioStatus uint32\ntype cAudioStatus C.SDL_AudioStatus\n\n// AudioSpec contains the audio output format. It also contains a callback that is called when the audio device needs more data.\n// (https://wiki.libsdl.org/SDL_AudioSpec)\ntype AudioSpec struct {\n\tFreq     int32          // DSP frequency (samples per second)\n\tFormat   AudioFormat    // audio data format\n\tChannels uint8          // number of separate sound channels\n\tSilence  uint8          // audio buffer silence value (calculated)\n\tSamples  uint16         // audio buffer size in samples (power of 2)\n\t_        uint16         // padding\n\tSize     uint32         // audio buffer size in bytes (calculated)\n\tCallback AudioCallback  // the function to call when the audio device needs more data\n\tUserData unsafe.Pointer // a pointer that is passed to callback (otherwise ignored by SDL)\n}\ntype cAudioSpec C.SDL_AudioSpec\n\n// AudioCVT contains audio data conversion information.\n// (https://wiki.libsdl.org/SDL_AudioCVT)\ntype AudioCVT struct {\n\tNeeded      int32           // set to 1 if conversion possible\n\tSrcFormat   AudioFormat     // source audio format\n\tDstFormat   AudioFormat     // target audio format\n\tRateIncr    float64         // rate conversion increment\n\tBuf         unsafe.Pointer  // the buffer to hold entire audio data. Use AudioCVT.BufAsSlice() for access via a Go slice\n\tLen         int32           // length of original audio buffer\n\tLenCVT      int32           // length of converted audio buffer\n\tLenMult     int32           // buf must be len*len_mult big\n\tLenRatio    float64         // given len, final size is len*len_ratio\n\tfilters     [10]AudioFilter // filter list (internal use)\n\tfilterIndex int32           // current audio conversion function (internal use)\n}\ntype cAudioCVT C.SDL_AudioCVT\n\n// AudioStream is a new audio conversion interface.\n// (https://wiki.libsdl.org/SDL_AudioStream)\ntype AudioStream C.SDL_AudioStream\n\nfunc (fmt AudioFormat) c() C.SDL_AudioFormat {\n\treturn C.SDL_AudioFormat(fmt)\n}\n\nfunc (id AudioDeviceID) c() C.SDL_AudioDeviceID {\n\treturn C.SDL_AudioDeviceID(id)\n}\n\nfunc (as *AudioSpec) cptr() *C.SDL_AudioSpec {\n\treturn (*C.SDL_AudioSpec)(unsafe.Pointer(as))\n}\n\nfunc (cvt *AudioCVT) cptr() *C.SDL_AudioCVT {\n\treturn (*C.SDL_AudioCVT)(unsafe.Pointer(cvt))\n}\n\nfunc (stream *AudioStream) cptr() *C.SDL_AudioStream {\n\treturn (*C.SDL_AudioStream)(unsafe.Pointer(stream))\n}\n\n// BitSize returns audio formats bit size.\n// (https://wiki.libsdl.org/SDL_AudioFormat)\nfunc (fmt AudioFormat) BitSize() uint8 {\n\treturn uint8(fmt & AUDIO_MASK_BITSIZE)\n}\n\n// IsFloat reports whether audio format is float.\n// (https://wiki.libsdl.org/SDL_AudioFormat)\nfunc (fmt AudioFormat) IsFloat() bool {\n\treturn (fmt & AUDIO_MASK_DATATYPE) > 0\n}\n\n// IsBigEndian reports whether audio format is big-endian.\n// (https://wiki.libsdl.org/SDL_AudioFormat)\nfunc (fmt AudioFormat) IsBigEndian() bool {\n\treturn (fmt & AUDIO_MASK_ENDIAN) > 0\n}\n\n// IsSigned reports whether audio format is signed.\n// (https://wiki.libsdl.org/SDL_AudioFormat)\nfunc (fmt AudioFormat) IsSigned() bool {\n\treturn (fmt & AUDIO_MASK_SIGNED) > 0\n}\n\n// IsInt reports whether audio format is integer.\n// (https://wiki.libsdl.org/SDL_AudioFormat)\nfunc (fmt AudioFormat) IsInt() bool {\n\treturn !fmt.IsFloat()\n}\n\n// IsLittleEndian reports whether audio format is little-endian.\n// (https://wiki.libsdl.org/SDL_AudioFormat)\nfunc (fmt AudioFormat) IsLittleEndian() bool {\n\treturn !fmt.IsBigEndian()\n}\n\n// IsUnsigned reports whether audio format is unsigned.\n// (https://wiki.libsdl.org/SDL_AudioFormat)\nfunc (fmt AudioFormat) IsUnsigned() bool {\n\treturn !fmt.IsSigned()\n}\n\n// AllocBuf allocates the requested memory for AudioCVT buffer.\nfunc (cvt *AudioCVT) AllocBuf(size uintptr) {\n\tcvt.Buf = C.malloc(C.size_t(size))\n}\n\n// FreeBuf deallocates the memory previously allocated from AudioCVT buffer.\nfunc (cvt *AudioCVT) FreeBuf() {\n\tC.free(cvt.Buf)\n}\n\n// BufAsSlice returns AudioCVT.buf as byte slice.\n// NOTE: Must be used after ConvertAudio() because it uses LenCVT as slice length.\nfunc (cvt AudioCVT) BufAsSlice() []byte {\n\tvar b []byte\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&b))\n\tsliceHeader.Len = int(cvt.LenCVT)\n\tsliceHeader.Cap = int(cvt.Len * cvt.LenMult)\n\tsliceHeader.Data = uintptr(unsafe.Pointer(cvt.Buf))\n\treturn b\n}\n\n// GetNumAudioDrivers returns the number of built-in audio drivers.\n// (https://wiki.libsdl.org/SDL_GetNumAudioDrivers)\nfunc GetNumAudioDrivers() int {\n\treturn int(C.SDL_GetNumAudioDrivers())\n}\n\n// GetAudioDriver returns the name of a built in audio driver.\n// (https://wiki.libsdl.org/SDL_GetAudioDriver)\nfunc GetAudioDriver(index int) string {\n\treturn string(C.GoString(C.SDL_GetAudioDriver(C.int(index))))\n}\n\n// AudioInit initializes a particular audio driver.\n// (https://wiki.libsdl.org/SDL_AudioInit)\nfunc AudioInit(driverName string) error {\n\t_driverName := C.CString(driverName)\n\tdefer C.free(unsafe.Pointer(_driverName))\n\tif C.SDL_AudioInit(_driverName) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// AudioQuit shuts down audio if you initialized it with AudioInit().\n// (https://wiki.libsdl.org/SDL_AudioQuit)\nfunc AudioQuit() {\n\tC.SDL_AudioQuit()\n}\n\n// GetCurrentAudioDriver returns the name of the current audio driver.\n// (https://wiki.libsdl.org/SDL_GetCurrentAudioDriver)\nfunc GetCurrentAudioDriver() string {\n\treturn string(C.GoString(C.SDL_GetCurrentAudioDriver()))\n}\n\n// OpenAudio opens the audio device. New programs might want to use OpenAudioDevice() instead.\n// (https://wiki.libsdl.org/SDL_OpenAudio)\nfunc OpenAudio(desired, obtained *AudioSpec) error {\n\tif C.SDL_OpenAudio(desired.cptr(), obtained.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// GetNumAudioDevices returns the number of built-in audio devices.\n// (https://wiki.libsdl.org/SDL_GetNumAudioDevices)\nfunc GetNumAudioDevices(isCapture bool) int {\n\treturn int(C.SDL_GetNumAudioDevices(C.int(Btoi(isCapture))))\n}\n\n// GetAudioDeviceName returns the name of a specific audio device.\n// (https://wiki.libsdl.org/SDL_GetAudioDeviceName)\nfunc GetAudioDeviceName(index int, isCapture bool) string {\n\treturn string(C.GoString(C.SDL_GetAudioDeviceName(C.int(index), C.int(Btoi(isCapture)))))\n}\n\n// OpenAudioDevice opens a specific audio device.\n// (https://wiki.libsdl.org/SDL_OpenAudioDevice)\nfunc OpenAudioDevice(device string, isCapture bool, desired, obtained *AudioSpec, allowedChanges int) (AudioDeviceID, error) {\n\t_device := C.CString(device)\n\tif device == \"\" {\n\t\t_device = nil\n\t}\n\tdefer C.free(unsafe.Pointer(_device))\n\tif id := AudioDeviceID(C.SDL_OpenAudioDevice(_device, C.int(Btoi(isCapture)), desired.cptr(), obtained.cptr(), C.int(allowedChanges))); id > 0 {\n\t\treturn id, nil\n\t}\n\treturn 0, GetError()\n}\n\n// GetAudioStatus returns the current audio state of the audio device. New programs might want to use GetAudioDeviceStatus() instead.\n// (https://wiki.libsdl.org/SDL_GetAudioStatus)\nfunc GetAudioStatus() AudioStatus {\n\treturn (AudioStatus)(C.SDL_GetAudioStatus())\n}\n\n// GetAudioDeviceStatus returns the current audio state of an audio device.\n// (https://wiki.libsdl.org/SDL_GetAudioDeviceStatus)\nfunc GetAudioDeviceStatus(dev AudioDeviceID) AudioStatus {\n\treturn (AudioStatus)(C.SDL_GetAudioDeviceStatus(dev.c()))\n}\n\n// PauseAudio pauses and unpauses the audio device. New programs might want to use SDL_PauseAudioDevice() instead.\n// (https://wiki.libsdl.org/SDL_PauseAudio)\nfunc PauseAudio(pauseOn bool) {\n\tC.SDL_PauseAudio(C.int(Btoi(pauseOn)))\n}\n\n// PauseAudioDevice pauses and unpauses audio playback on a specified device.\n// (https://wiki.libsdl.org/SDL_PauseAudioDevice)\nfunc PauseAudioDevice(dev AudioDeviceID, pauseOn bool) {\n\tC.SDL_PauseAudioDevice(dev.c(), C.int(Btoi(pauseOn)))\n}\n\n// LoadWAVRW loads a WAVE from the data source, automatically freeing that source if freeSrc is true.\n// (https://wiki.libsdl.org/SDL_LoadWAV_RW)\nfunc LoadWAVRW(src *RWops, freeSrc bool) ([]byte, *AudioSpec) {\n\tvar _audioBuf *C.Uint8\n\tvar _audioLen C.Uint32\n\taudioSpec := (*AudioSpec)(unsafe.Pointer(C.SDL_LoadWAV_RW(src.cptr(), C.int(Btoi(freeSrc)), (&AudioSpec{}).cptr(), &_audioBuf, &_audioLen)))\n\n\tvar b []byte\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&b))\n\tsliceHeader.Len = (int)(_audioLen)\n\tsliceHeader.Cap = (int)(_audioLen)\n\tsliceHeader.Data = uintptr(unsafe.Pointer(_audioBuf))\n\treturn b, audioSpec\n}\n\n// LoadWAV loads a WAVE from a file.\n// (https://wiki.libsdl.org/SDL_LoadWAV)\nfunc LoadWAV(file string) ([]byte, *AudioSpec) {\n\t_file := C.CString(file)\n\t_rb := C.CString(\"rb\")\n\tdefer C.free(unsafe.Pointer(_file))\n\tdefer C.free(unsafe.Pointer(_rb))\n\n\tvar _audioBuf *C.Uint8\n\tvar _audioLen C.Uint32\n\taudioSpec := (*AudioSpec)(unsafe.Pointer(C.SDL_LoadWAV_RW(C.SDL_RWFromFile(_file, _rb), 1, (&AudioSpec{}).cptr(), &_audioBuf, &_audioLen)))\n\n\tvar b []byte\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&b))\n\tsliceHeader.Len = (int)(_audioLen)\n\tsliceHeader.Cap = (int)(_audioLen)\n\tsliceHeader.Data = uintptr(unsafe.Pointer(_audioBuf))\n\treturn b, audioSpec\n}\n\n// FreeWAV frees data previously allocated with LoadWAV() or LoadWAVRW().\n// (https://wiki.libsdl.org/SDL_FreeWAV)\nfunc FreeWAV(audioBuf []uint8) {\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&audioBuf))\n\t_audioBuf := (*C.Uint8)(unsafe.Pointer(sliceHeader.Data))\n\tC.SDL_FreeWAV(_audioBuf)\n}\n\n// BuildAudioCVT initializes an AudioCVT structure for conversion.\n// (https://wiki.libsdl.org/SDL_BuildAudioCVT)\nfunc BuildAudioCVT(cvt *AudioCVT, srcFormat AudioFormat, srcChannels uint8, srcRate int, dstFormat AudioFormat, dstChannels uint8, dstRate int) (converted bool, err error) {\n\tswitch int(C.SDL_BuildAudioCVT(cvt.cptr(), srcFormat.c(), C.Uint8(srcChannels), C.int(srcRate), dstFormat.c(), C.Uint8(dstChannels), C.int(dstRate))) {\n\tcase 1:\n\t\treturn true, nil\n\tcase 0:\n\t\treturn false, nil\n\t}\n\treturn false, GetError()\n}\n\n// ConvertAudio converts audio data to a desired audio format.\n// (https://wiki.libsdl.org/SDL_ConvertAudio)\nfunc ConvertAudio(cvt *AudioCVT) error {\n\t_cvt := (*C.SDL_AudioCVT)(unsafe.Pointer(cvt))\n\tif C.SDL_ConvertAudio(_cvt) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// QueueAudio queues more audio on non-callback devices.\n// (https://wiki.libsdl.org/SDL_QueueAudio)\nfunc QueueAudio(dev AudioDeviceID, data []byte) error {\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&data))\n\t_data := unsafe.Pointer(sliceHeader.Data)\n\t_len := (C.Uint32)(sliceHeader.Len)\n\tif C.SDL_QueueAudio(dev.c(), _data, _len) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// DequeueAudio dequeues more audio on non-callback devices. Returns the number of bytes dequeued, which could be less than requested\n// (https://wiki.libsdl.org/SDL_DequeueAudio)\nfunc DequeueAudio(dev AudioDeviceID, data []byte) (n int, err error) {\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&data))\n\t_data := unsafe.Pointer(sliceHeader.Data)\n\t_len := (C.Uint32)(sliceHeader.Len)\n\tif dequeued := int(C.SDL_DequeueAudio(dev.c(), _data, _len)); dequeued > 0 {\n\t\treturn dequeued, nil\n\t}\n\treturn 0, GetError()\n}\n\n// GetQueuedAudioSize returns the number of bytes of still-queued audio.\n// (https://wiki.libsdl.org/SDL_GetQueuedAudioSize)\nfunc GetQueuedAudioSize(dev AudioDeviceID) uint32 {\n\treturn uint32(C.SDL_GetQueuedAudioSize(dev.c()))\n}\n\n// ClearQueuedAudio drops any queued audio data waiting to be sent to the hardware.\n// (https://wiki.libsdl.org/SDL_ClearQueuedAudio)\nfunc ClearQueuedAudio(dev AudioDeviceID) {\n\tC.SDL_ClearQueuedAudio(dev.c())\n}\n\n// MixAudio mixes audio data. New programs might want to use MixAudioFormat() instead.\n// (https://wiki.libsdl.org/SDL_MixAudio)\nfunc MixAudio(dst, src *uint8, len uint32, volume int) {\n\t_dst := (*C.Uint8)(unsafe.Pointer(dst))\n\t_src := (*C.Uint8)(unsafe.Pointer(src))\n\tC.SDL_MixAudio(_dst, _src, C.Uint32(len), C.int(volume))\n}\n\n// MixAudioFormat mixes audio data in a specified format.\n// (https://wiki.libsdl.org/SDL_MixAudioFormat)\nfunc MixAudioFormat(dst, src *uint8, format AudioFormat, len uint32, volume int) {\n\t_dst := (*C.Uint8)(unsafe.Pointer(dst))\n\t_src := (*C.Uint8)(unsafe.Pointer(src))\n\tC.SDL_MixAudioFormat(_dst, _src, format.c(), C.Uint32(len), C.int(volume))\n}\n\n// LockAudio locks the audio device. New programs might want to use LockAudioDevice() instead.\n// (https://wiki.libsdl.org/SDL_LockAudio)\nfunc LockAudio() {\n\tC.SDL_LockAudio()\n}\n\n// LockAudioDevice locks out the audio callback function for a specified device.\n// (https://wiki.libsdl.org/SDL_LockAudioDevice)\nfunc LockAudioDevice(dev AudioDeviceID) {\n\tC.SDL_LockAudioDevice(dev.c())\n}\n\n// UnlockAudio unlocks the audio device. New programs might want to use UnlockAudioDevice() instead.\n// (https://wiki.libsdl.org/SDL_UnlockAudio)\nfunc UnlockAudio() {\n\tC.SDL_UnlockAudio()\n}\n\n// UnlockAudioDevice unlocks the audio callback function for a specified device.\n// (https://wiki.libsdl.org/SDL_UnlockAudioDevice)\nfunc UnlockAudioDevice(dev AudioDeviceID) {\n\tC.SDL_UnlockAudioDevice(dev.c())\n}\n\n// CloseAudio closes the audio device. New programs might want to use CloseAudioDevice() instead.\n// (https://wiki.libsdl.org/SDL_CloseAudio)\nfunc CloseAudio() {\n\tC.SDL_CloseAudio()\n}\n\n// CloseAudioDevice shuts down audio processing and closes the audio device.\n// (https://wiki.libsdl.org/SDL_CloseAudioDevice)\nfunc CloseAudioDevice(dev AudioDeviceID) {\n\tC.SDL_CloseAudioDevice(dev.c())\n}\n\n// NewAudioStream creates a new audio stream\n// TODO: (https://wiki.libsdl.org/SDL_NewAudioStream)\nfunc NewAudioStream(srcFormat AudioFormat, srcChannels uint8, srcRate int, dstFormat AudioFormat, dstChannels uint8, dstRate int) (stream *AudioStream, err error) {\n\t_srcFormat := C.SDL_AudioFormat(srcFormat)\n\t_srcChannels := C.Uint8(srcChannels)\n\t_srcRate := C.int(srcRate)\n\t_dstFormat := C.SDL_AudioFormat(dstFormat)\n\t_dstChannels := C.Uint8(dstChannels)\n\t_dstRate := C.int(dstRate)\n\n\tstream = (*AudioStream)(C.SDL_NewAudioStream(_srcFormat, _srcChannels, _srcRate, _dstFormat, _dstChannels, _dstRate))\n\tif stream == nil {\n\t\terr = GetError()\n\t}\n\treturn\n}\n\n// Put adds data to be converted/resampled to the stream\n// TODO: (https://wiki.libsdl.org/SDL_AudioStreamPut)\nfunc (stream *AudioStream) Put(buf []byte) (err error) {\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&buf))\n\t_buf := unsafe.Pointer(sliceHeader.Data)\n\t_len := C.int(len(buf))\n\tret := int(C.SDL_AudioStreamPut(stream.cptr(), _buf, _len))\n\terr = errorFromInt(ret)\n\treturn\n}\n\n// Get gets converted/resampled data from the stream. Returns the number of bytes read from the stream.\n// (https://wiki.libsdl.org/SDL_AudioStreamGet)\nfunc (stream *AudioStream) Get(buf []byte) (n int, err error) {\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&buf))\n\t_buf := unsafe.Pointer(sliceHeader.Data)\n\t_len := C.int(len(buf))\n\tif ret := int(C.SDL_AudioStreamGet(stream.cptr(), _buf, _len)); ret < 0 {\n\t\treturn 0, errorFromInt(ret)\n\t} else {\n\t\treturn ret, nil\n\t}\n}\n\n// Available gets the number of converted/resampled bytes available\n// TODO: (https://wiki.libsdl.org/SDL_AudioStreamAvailable)\nfunc (stream *AudioStream) Available() (err error) {\n\tret := int(C.SDL_AudioStreamAvailable(stream.cptr()))\n\terr = errorFromInt(ret)\n\treturn\n}\n\n// Flush tells the stream that you're done sending data, and anything being buffered\n// should be converted/resampled and made available immediately.\n// TODO: (https://wiki.libsdl.org/SDL_AudioStreamFlush)\nfunc (stream *AudioStream) Flush() (err error) {\n\tret := int(C.SDL_AudioStreamFlush(stream.cptr()))\n\terr = errorFromInt(ret)\n\treturn\n}\n\n// Clear clears any pending data in the stream without converting it\n// TODO: (https://wiki.libsdl.org/SDL_AudioStreamClear)\nfunc (stream *AudioStream) Clear() {\n\tC.SDL_AudioStreamClear(stream.cptr())\n}\n\n// Free frees the audio stream\n// TODO: (https://wiki.libsdl.org/SDL_AudoiStreamFree)\nfunc (stream *AudioStream) Free() {\n\tC.SDL_FreeAudioStream(stream.cptr())\n}\n\n// GetAudioDeviceSpec returns the preferred audio format of a specific audio device.\n// (https://wiki.libsdl.org/SDL_GetAudioDeviceSpec)\nfunc GetAudioDeviceSpec(index int, isCapture bool) (spec *AudioSpec, err error) {\n\tspec = &AudioSpec{}\n\terr = errorFromInt(int(C.SDL_GetAudioDeviceSpec(C.int(index), C.int(Btoi(isCapture)), spec.cptr())))\n\treturn\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/blendmode.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,6))\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_BLENDMODE_INVALID is not supported before SDL 2.0.6\")\n#endif\n\n#define SDL_BLENDMODE_INVALID (0x7FFFFFFF)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_BlendOperation is not supported before SDL 2.0.6\")\n#endif\n\ntypedef enum\n{\n    SDL_BLENDOPERATION_ADD              = 0x1,\n    SDL_BLENDOPERATION_SUBTRACT         = 0x2,\n    SDL_BLENDOPERATION_REV_SUBTRACT     = 0x3,\n    SDL_BLENDOPERATION_MINIMUM          = 0x4,\n    SDL_BLENDOPERATION_MAXIMUM          = 0x5\n} SDL_BlendOperation;\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_BlendFactor is not supported before SDL 2.0.6\")\n#endif\n\ntypedef enum\n{\n    SDL_BLENDFACTOR_ZERO                = 0x1,\n    SDL_BLENDFACTOR_ONE                 = 0x2,\n    SDL_BLENDFACTOR_SRC_COLOR           = 0x3,\n    SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4,\n    SDL_BLENDFACTOR_SRC_ALPHA           = 0x5,\n    SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6,\n    SDL_BLENDFACTOR_DST_COLOR           = 0x7,\n    SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8,\n    SDL_BLENDFACTOR_DST_ALPHA           = 0x9,\n    SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA\n\n} SDL_BlendFactor;\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_ComposeCustomBlendMode is not supported before SDL 2.0.6\")\n#endif\n\nSDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor, SDL_BlendOperation colorOperation, SDL_BlendFactor srcAlphaFactor, SDL_BlendFactor dstAlphaFactor, SDL_BlendOperation alphaOperation)\n{\n\treturn SDL_BLENDMODE_NONE;\n}\n#endif\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// BlendMode is an enumeration of blend modes used in Render.Copy() and drawing operations.\n// (https://wiki.libsdl.org/SDL_BlendMode)\ntype BlendMode uint32\n\nconst (\n\tBLENDMODE_NONE    = C.SDL_BLENDMODE_NONE  // no blending\n\tBLENDMODE_BLEND   = C.SDL_BLENDMODE_BLEND // alpha blending\n\tBLENDMODE_ADD     = C.SDL_BLENDMODE_ADD   // additive blending\n\tBLENDMODE_MOD     = C.SDL_BLENDMODE_MOD   // color modulate\n\tBLENDMODE_INVALID = C.SDL_BLENDMODE_INVALID\n)\n\nfunc (bm BlendMode) c() C.SDL_BlendMode {\n\treturn C.SDL_BlendMode(C.Uint32(bm))\n}\n\nfunc (bm *BlendMode) cptr() *C.SDL_BlendMode {\n\treturn (*C.SDL_BlendMode)(unsafe.Pointer(bm))\n}\n\n// BlendOperation is an enumeration of blend operations used when creating a custom blend mode with ComposeCustomBlendMode().\n// (https://wiki.libsdl.org/SDL_BlendOperation)\ntype BlendOperation C.SDL_BlendOperation\n\nconst (\n\tBLENDOPERATION_ADD          = C.SDL_BLENDOPERATION_ADD\n\tBLENDOPERATION_SUBTRACT     = C.SDL_BLENDOPERATION_SUBTRACT\n\tBLENDOPERATION_REV_SUBTRACT = C.SDL_BLENDOPERATION_REV_SUBTRACT\n\tBLENDOPERATION_MINIMUM      = C.SDL_BLENDOPERATION_MINIMUM\n\tBLENDOPERATION_MAXIMUM      = C.SDL_BLENDOPERATION_MAXIMUM\n)\n\n// BlendFactor is an enumeration of blend factors used when creating a custom blend mode with ComposeCustomBlendMode().\n// (https://wiki.libsdl.org/SDL_BlendFactor)\ntype BlendFactor C.SDL_BlendFactor\n\nconst (\n\tBLENDFACTOR_ZERO                = C.SDL_BLENDFACTOR_ZERO                // 0, 0, 0, 0\n\tBLENDFACTOR_ONE                 = C.SDL_BLENDFACTOR_ONE                 // 1, 1, 1, 1\n\tBLENDFACTOR_SRC_COLOR           = C.SDL_BLENDFACTOR_SRC_COLOR           // srcR, srcG, srcB, srcA\n\tBLENDFACTOR_ONE_MINUS_SRC_COLOR = C.SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR // 1-srcR, 1-srcG, 1-srcB, 1-srcA\n\tBLENDFACTOR_SRC_ALPHA           = C.SDL_BLENDFACTOR_SRC_ALPHA           // srcA, srcA, srcA, srcA\n\tBLENDFACTOR_ONE_MINUS_SRC_ALPHA = C.SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA // 1-srcA, 1-srcA, 1-srcA, 1-srcA\n\tBLENDFACTOR_DST_COLOR           = C.SDL_BLENDFACTOR_DST_COLOR           // dstR, dstG, dstB, dstA\n\tBLENDFACTOR_ONE_MINUS_DST_COLOR = C.SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR // 1-dstR, 1-dstG, 1-dstB, 1-dstA\n\tBLENDFACTOR_DST_ALPHA           = C.SDL_BLENDFACTOR_DST_ALPHA           // dstA, dstA, dstA, dstA\n\tBLENDFACTOR_ONE_MINUS_DST_ALPHA = C.SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA // 1-dstA, 1-dstA, 1-dstA, 1-dstA\n)\n\n// ComposeCustomBlendMode creates a custom blend mode, which may or may not be supported by a given renderer\n// The result of the blend mode operation will be:\n//     dstRGB = dstRGB * dstColorFactor colorOperation srcRGB * srcColorFactor\n// and\n//     dstA = dstA * dstAlphaFactor alphaOperation srcA * srcAlphaFactor\n// (https://wiki.libsdl.org/SDL_ComposeCustomBlendMode)\nfunc ComposeCustomBlendMode(srcColorFactor, dstColorFactor BlendFactor, colorOperation BlendOperation, srcAlphaFactor, dstAlphaFactor BlendFactor, alphaOperation BlendOperation) BlendMode {\n\t_srcColorFactor := C.SDL_BlendFactor(srcColorFactor)\n\t_dstColorFactor := C.SDL_BlendFactor(dstColorFactor)\n\t_colorOperation := C.SDL_BlendOperation(colorOperation)\n\t_srcAlphaFactor := C.SDL_BlendFactor(srcAlphaFactor)\n\t_dstAlphaFactor := C.SDL_BlendFactor(dstAlphaFactor)\n\t_alphaOperation := C.SDL_BlendOperation(alphaOperation)\n\treturn BlendMode(C.SDL_ComposeCustomBlendMode(_srcColorFactor, _dstColorFactor, _colorOperation, _srcAlphaFactor, _dstAlphaFactor, _alphaOperation))\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/clipboard.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\nimport \"unsafe\"\n\n// SetClipboardText puts UTF-8 text into the clipboard.\n// (https://wiki.libsdl.org/SDL_SetClipboardText)\nfunc SetClipboardText(text string) error {\n\t_text := C.CString(text)\n\tdefer C.free(unsafe.Pointer(_text))\n\tif C.SDL_SetClipboardText(_text) < 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// GetClipboardText returns UTF-8 text from the clipboard.\n// (https://wiki.libsdl.org/SDL_GetClipboardText)\nfunc GetClipboardText() (string, error) {\n\ttext := C.SDL_GetClipboardText()\n\tif text == nil {\n\t\treturn \"\", GetError()\n\t}\n\tdefer C.SDL_free(unsafe.Pointer(text))\n\t_text := C.GoString(text)\n\treturn _text, nil\n}\n\n// HasClipboardText reports whether the clipboard exists and contains a text string that is non-empty.\n// (https://wiki.libsdl.org/SDL_HasClipboardText)\nfunc HasClipboardText() bool {\n\treturn C.SDL_HasClipboardText() > 0\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/cpuinfo.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,9))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_HasAVX512F is not supported before SDL 2.0.9\")\n#endif\n\nstatic inline SDL_bool SDL_HasAVX512F()\n{\n\treturn SDL_FALSE;\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,1))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetSystemRAM is not supported before SDL 2.0.1\")\n#endif\n\nstatic inline int SDL_GetSystemRAM()\n{\n\treturn -1;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,2))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_HasAVX is not supported before SDL 2.0.2\")\n#endif\n\nstatic inline SDL_bool SDL_HasAVX()\n{\n\treturn SDL_FALSE;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,4))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_HasAVX2 is not supported before SDL 2.0.4\")\n#endif\n\nstatic inline SDL_bool SDL_HasAVX2()\n{\n\treturn SDL_FALSE;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,6))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_HasNEON is not supported before SDL 2.0.4\")\n#endif\n\nstatic inline SDL_bool SDL_HasNEON()\n{\n\treturn SDL_FALSE;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,10))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SIMDGetAlignment is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline size_t SDL_SIMDGetAlignment(void)\n{\n\treturn 0;\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SIMDAlloc is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline void * SDL_SIMDAlloc(const size_t len)\n{\n\treturn NULL;\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SIMDFree is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline void SDL_SIMDFree(void *ptr)\n{\n}\n\n#endif\n\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// CACHELINE_SIZE is a cacheline size used for padding.\nconst CACHELINE_SIZE = C.SDL_CACHELINE_SIZE\n\n// GetCPUCount returns the number of CPU cores available.\n// (https://wiki.libsdl.org/SDL_GetCPUCount)\nfunc GetCPUCount() int {\n\treturn int(C.SDL_GetCPUCount())\n}\n\n// GetCPUCacheLineSize returns the L1 cache line size of the CPU.\n// (https://wiki.libsdl.org/SDL_GetCPUCacheLineSize)\nfunc GetCPUCacheLineSize() int {\n\treturn int(C.SDL_GetCPUCacheLineSize())\n}\n\n// HasRDTSC reports whether the CPU has the RDTSC instruction.\n// (https://wiki.libsdl.org/SDL_HasRDTSC)\nfunc HasRDTSC() bool {\n\treturn C.SDL_HasRDTSC() > 0\n}\n\n// HasAltiVec reports whether the CPU has AltiVec features.\n// (https://wiki.libsdl.org/SDL_HasAltiVec)\nfunc HasAltiVec() bool {\n\treturn C.SDL_HasAltiVec() > 0\n}\n\n// HasMMX reports whether the CPU has MMX features.\n// (https://wiki.libsdl.org/SDL_HasMMX)\nfunc HasMMX() bool {\n\treturn C.SDL_HasMMX() > 0\n}\n\n// Has3DNow reports whether the CPU has 3DNow! features.\n// (https://wiki.libsdl.org/SDL_Has3DNow)\nfunc Has3DNow() bool {\n\treturn C.SDL_Has3DNow() > 0\n}\n\n// HasSSE reports whether the CPU has SSE features.\n// (https://wiki.libsdl.org/SDL_HasSSE)\nfunc HasSSE() bool {\n\treturn C.SDL_HasSSE() > 0\n}\n\n// HasSSE2 reports whether the CPU has SSE2 features.\n// (https://wiki.libsdl.org/SDL_HasSSE2)\nfunc HasSSE2() bool {\n\treturn C.SDL_HasSSE2() > 0\n}\n\n// HasSSE3 reports whether the CPU has SSE3 features.\n// (https://wiki.libsdl.org/SDL_HasSSE3)\nfunc HasSSE3() bool {\n\treturn C.SDL_HasSSE3() > 0\n}\n\n// HasSSE41 reports whether the CPU has SSE4.1 features.\n// (https://wiki.libsdl.org/SDL_HasSSE41)\nfunc HasSSE41() bool {\n\treturn C.SDL_HasSSE41() > 0\n}\n\n// HasSSE42 reports whether the CPU has SSE4.2 features.\n// (https://wiki.libsdl.org/SDL_HasSSE42)\nfunc HasSSE42() bool {\n\treturn C.SDL_HasSSE42() > 0\n}\n\n// GetSystemRAM returns the amount of RAM configured in the system.\n// (https://wiki.libsdl.org/SDL_GetSystemRAM)\nfunc GetSystemRAM() int {\n\treturn int(C.SDL_GetSystemRAM())\n}\n\n// HasAVX reports whether the CPU has AVX features.\n// (https://wiki.libsdl.org/SDL_HasAVX)\nfunc HasAVX() bool {\n\treturn C.SDL_HasAVX() > 0\n}\n\n// HasAVX512F reports whether the CPU has AVX-512F (foundation) features.\n// TODO: (https://wiki.libsdl.org/SDL_HasAVX512F)\nfunc HasAVX512F() bool {\n\treturn C.SDL_HasAVX512F() > 0\n}\n\n// HasAVX2 reports whether the CPU has AVX2 features.\n// (https://wiki.libsdl.org/SDL_HasAVX2)\nfunc HasAVX2() bool {\n\treturn C.SDL_HasAVX2() > 0\n}\n\n// HasNEON reports whether the CPU has NEON features.\n// (https://wiki.libsdl.org/SDL_HasNEON)\nfunc HasNEON() bool {\n\treturn C.SDL_HasNEON() > 0\n}\n\n// SIMDGetAlignment reports the alignment this system needs for SIMD allocations.\n// TODO: (https://wiki.libsdl.org/SDL_SIMDGetAlignment)\nfunc SIMDGetAlignment() int {\n\treturn int(C.SDL_SIMDGetAlignment())\n}\n\n// SIMDAlloc allocates memory in a SIMD-friendly way.\n// TODO: (https://wiki.libsdl.org/SDL_SIMDAlloc)\nfunc SIMDAlloc(_len int) unsafe.Pointer {\n\treturn C.SDL_SIMDAlloc(C.size_t(_len))\n}\n\n// SIMDFree deallocates memory obtained from SDL_SIMDAlloc.\n// TODO: (https://wiki.libsdl.org/SDL_SIMDFree)\nfunc SIMDFree(p unsafe.Pointer) {\n\tC.SDL_SIMDFree(p)\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/endian.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\n\n// Endian-specific values.\n// (https://wiki.libsdl.org/CategoryEndian)\nconst (\n\tBYTEORDER  = C.SDL_BYTEORDER  // macro that corresponds to the byte order used by the processor type it was compiled for\n\tLIL_ENDIAN = C.SDL_LIL_ENDIAN // byte order is 1234, where the least significant byte is stored first\n\tBIG_ENDIAN = C.SDL_BIG_ENDIAN // byte order is 4321, where the most significant byte is stored first\n)\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/error.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\nvoid GoSetError(const char *fmt) {\n  SDL_SetError(\"%s\", fmt);\n}\n\n*/\n// #include \"sdl_wrapper.h\"\nimport \"C\"\nimport \"errors\"\n\nvar emptyCString *C.char = C.CString(\"\")\nvar ErrInvalidParameters = errors.New(\"Invalid Parameters\")\n\n// SDL error codes with their corresponding predefined strings.\nconst (\n\tENOMEM      ErrorCode = C.SDL_ENOMEM      // out of memory\n\tEFREAD                = C.SDL_EFREAD      // error reading from datastream\n\tEFWRITE               = C.SDL_EFWRITE     // error writing to datastream\n\tEFSEEK                = C.SDL_EFSEEK      // error seeking in datastream\n\tUNSUPPORTED           = C.SDL_UNSUPPORTED // that operation is not supported\n\tLASTERROR             = C.SDL_LASTERROR   // the highest numbered predefined error\n)\n\n// ErrorCode is an error code used in SDL error messages.\ntype ErrorCode uint32\ntype cErrorCode C.SDL_errorcode\n\nfunc (ec ErrorCode) c() C.SDL_errorcode {\n\treturn C.SDL_errorcode(ec)\n}\n\n// GetError returns the last error that occurred, or an empty string if there hasn't been an error message set since the last call to ClearError().\n// (https://wiki.libsdl.org/SDL_GetError)\nfunc GetError() error {\n\tif err := C.SDL_GetError(); err != nil {\n\t\tgostr := C.GoString(err)\n\t\t// SDL_GetError returns \"an empty string if there hasn't been an error message\"\n\t\tif len(gostr) > 0 {\n\t\t\treturn errors.New(gostr)\n\t\t}\n\t}\n\treturn nil\n}\n\n// SetError set the SDL error message.\n// (https://wiki.libsdl.org/SDL_SetError)\nfunc SetError(err error) {\n\tif err != nil {\n\t\tC.GoSetError(C.CString(err.Error()))\n\t\treturn\n\t}\n\tC.GoSetError(emptyCString)\n}\n\n// ClearError clears any previous error message.\n// (https://wiki.libsdl.org/SDL_ClearError)\nfunc ClearError() {\n\tC.SDL_ClearError()\n}\n\n// Error sets the SDL error message to the specified error code.\nfunc Error(code ErrorCode) {\n\tC.SDL_Error(code.c())\n}\n\n// OutOfMemory sets SDL error message to ENOMEM (out of memory).\nfunc OutOfMemory() {\n\tError(ENOMEM)\n}\n\n// Unsupported sets SDL error message to UNSUPPORTED (that operation is not supported).\nfunc Unsupported() {\n\tError(UNSUPPORTED)\n}\n\n// errorFromInt returns GetError() if passed negative value, otherwise it returns nil.\nfunc errorFromInt(code int) (err error) {\n\tif code < 0 {\n\t\terr = GetError()\n\t\tif err == nil {\n\t\t\terr = errors.New(\"Unknown error (probably using old version of SDL2 and the function called is not supported?)\")\n\t\t}\n\t}\n\treturn\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/events.c",
    "content": "#include \"_cgo_export.h\"\n#include \"events.h\"\n\nSDL_Event event;\n\nvoid setEventFilter()\n{\n\tSDL_SetEventFilter((SDL_EventFilter)goSetEventFilterCallback, NULL);\n}\n\nvoid clearEventFilter()\n{\n\tSDL_SetEventFilter(NULL, NULL);\n}\n\nvoid filterEvents(void *userdata)\n{\n\tSDL_FilterEvents((SDL_EventFilter)goEventFilterCallback, userdata);\n}\n\nvoid addEventWatch(void *userdata)\n{\n\tSDL_AddEventWatch((SDL_EventFilter)goEventFilterCallback, userdata);\n}\n\nvoid delEventWatch(void *userdata)\n{\n\tSDL_DelEventWatch((SDL_EventFilter)goEventFilterCallback, userdata);\n}\n\nint PollEvent()\n{\n\treturn SDL_PollEvent(&event);\n}"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/events.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n#include \"events.h\"\n\n#if !SDL_VERSION_ATLEAST(2,0,9)\n#define SDL_DISPLAYEVENT (0x150)\n#endif\n\n#if !SDL_VERSION_ATLEAST(2,0,2)\n#define SDL_RENDER_TARGETS_RESET (0x2000)\n#endif\n\n#if !SDL_VERSION_ATLEAST(2,0,4)\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_KEYMAPCHANGED is not supported before SDL 2.0.4\")\n#endif\n\n#define SDL_KEYMAPCHANGED (0x304)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_AUDIODEVICEADDED is not supported before SDL 2.0.4\")\n#endif\n\n#define SDL_AUDIODEVICEADDED (0x1100)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_AUDIODEVICEREMOVED is not supported before SDL 2.0.4\")\n#endif\n\n#define SDL_AUDIODEVICEREMOVED (0x1101)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RENDER_DEVICE_RESET is not supported before SDL 2.0.4\")\n#endif\n\n#define SDL_RENDER_DEVICE_RESET (0x2001)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_AudioDeviceEvent is not supported before SDL 2.0.4\")\n#endif\n\ntypedef struct SDL_AudioDeviceEvent\n{\n    Uint32 type;\n    Uint32 timestamp;\n    Uint32 which;\n    Uint8  iscapture;\n    Uint8  padding1;\n    Uint8  padding2;\n    Uint8  padding3;\n} SDL_AudioDeviceEvent;\n#endif\n\n#if !SDL_VERSION_ATLEAST(2,0,5)\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_DROPTEXT is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_DROPTEXT (0x1001)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_DROPBEGIN is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_DROPBEGIN (0x1002)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_DROPCOMPLETE is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_DROPCOMPLETE (0x1003)\n#endif\n\n#if !SDL_VERSION_ATLEAST(2,0,9)\n#define SDL_SENSORUPDATE (0x1200)\n\ntypedef struct SDL_SensorEvent {\n    Uint32 type;\n    Uint32 timestamp;\n    Sint32 which;\n    float data[6];\n} SDL_SensorEvent;\n#endif\n\n#if !SDL_VERSION_ATLEAST(2,0,22)\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_TEXTEDITING_EXT is not supported before SDL 2.0.22\")\n#endif\n\n#define SDL_TEXTEDITING_EXT (0x305)\n#endif\n\n// NOTE: To prevent build from failing when using older SDL2, we create a\n// structure definiton that directly maps to the SDL2 struct definition if\n// using the latest SDL2. Otherwise, we copy the latest definition and paste\n// it here.\n#if SDL_VERSION_ATLEAST(2,0,22)\ntypedef SDL_MouseButtonEvent MouseButtonEvent;\ntypedef SDL_MouseWheelEvent MouseWheelEvent;\ntypedef SDL_TouchFingerEvent TouchFingerEvent;\ntypedef SDL_DropEvent DropEvent;\n#else\ntypedef struct MouseButtonEvent\n{\n    Uint32 type;        // ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP\n    Uint32 timestamp;\n    Uint32 windowID;    // The window with mouse focus, if any\n    Uint32 which;       // The mouse instance id, or SDL_TOUCH_MOUSEID\n    Uint8 button;       // The mouse button index\n    Uint8 state;        // ::SDL_PRESSED or ::SDL_RELEASED\n    Uint8 clicks;       // 1 for single-click, 2 for double-click, etc.\n    Uint8 padding1;\n    Sint32 x;           // X coordinate, relative to window\n    Sint32 y;           // Y coordinate, relative to window\n} MouseButtonEvent;\n\ntypedef struct MouseWheelEvent\n{\n    Uint32 type;        // ::SDL_MOUSEWHEEL\n    Uint32 timestamp;   // In milliseconds, populated using SDL_GetTicks()\n    Uint32 windowID;    // The window with mouse focus, if any\n    Uint32 which;       // The mouse instance id, or SDL_TOUCH_MOUSEID\n    Sint32 x;           // The amount scrolled horizontally, positive to the right and negative to the left\n    Sint32 y;           // The amount scrolled vertically, positive away from the user and negative toward the user\n    Uint32 direction;   // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back\n    float preciseX;     // The amount scrolled horizontally, positive to the right and negative to the left, with float precision (added in 2.0.18)\n    float preciseY;     // The amount scrolled vertically, positive away from the user and negative toward the user, with float precision (added in 2.0.18)\n} MouseWheelEvent;\n\ntypedef struct TouchFingerEvent\n{\n    Uint32 type;           // ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP\n    Uint32 timestamp;      // In milliseconds, populated using SDL_GetTicks()\n    SDL_TouchID touchId;   // The touch device id\n    SDL_FingerID fingerId; //\n    float x;               // Normalized in the range 0...1\n    float y;               // Normalized in the range 0...1\n    float dx;              // Normalized in the range -1...1\n    float dy;              // Normalized in the range -1...1\n    float pressure;        // Normalized in the range 0...1\n    Uint32 windowID;       // The window underneath the finger, if any\n} TouchFingerEvent;\n\ntypedef struct DropEvent\n{\n    Uint32 type;        // ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE\n    Uint32 timestamp;   // In milliseconds, populated using SDL_GetTicks()\n    char *file;         // The file name, which should be freed with SDL_free(), is NULL on begin/complete\n    Uint32 windowID;    // The window that was dropped on, if any\n} DropEvent;\n\n#endif\n\n#if !SDL_VERSION_ATLEAST(2,24,0)\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JOYBATTEYUPDATED is not supported before SDL 2.24.0\")\n#endif\n\n#define SDL_JOYBATTERYUPDATED (1543)\n\n#if !SDL_VERSION_ATLEAST(2,0,4)\ntypedef enum\n{\n    SDL_JOYSTICK_POWER_UNKNOWN = -1,\n    SDL_JOYSTICK_POWER_EMPTY,\n    SDL_JOYSTICK_POWER_LOW,\n    SDL_JOYSTICK_POWER_MEDIUM,\n    SDL_JOYSTICK_POWER_FULL,\n    SDL_JOYSTICK_POWER_WIRED,\n    SDL_JOYSTICK_POWER_MAX\n} SDL_JoystickPowerLevel;\n#endif\n\ntypedef struct SDL_JoyBatteryEvent\n{\n    Uint32 type;\n    Uint32 timestamp;\n    SDL_JoystickID which;\n    SDL_JoystickPowerLevel level;\n} SDL_JoyBatteryEvent;\n\n#endif\n*/\nimport \"C\"\nimport (\n\t\"reflect\"\n\t\"sync\"\n\t\"unsafe\"\n)\n\nvar (\n\teventFilterCache          EventFilter\n\teventWatches              = make(map[EventWatchHandle]*eventFilterCallbackContext)\n\tlastEventWatchHandleMutex sync.Mutex\n\tlastEventWatchHandle      EventWatchHandle\n\tcevent                    C.SDL_Event\n)\n\n// Enumeration of the types of events that can be delivered.\n// (https://wiki.libsdl.org/SDL_EventType)\nconst (\n\tFIRSTEVENT = C.SDL_FIRSTEVENT // do not remove (unused)\n\n\t// Application events\n\tQUIT = C.SDL_QUIT // user-requested quit\n\n\t// Android, iOS and WinRT events\n\tAPP_TERMINATING         = C.SDL_APP_TERMINATING         // OS is terminating the application\n\tAPP_LOWMEMORY           = C.SDL_APP_LOWMEMORY           // OS is low on memory; free some\n\tAPP_WILLENTERBACKGROUND = C.SDL_APP_WILLENTERBACKGROUND // application is entering background\n\tAPP_DIDENTERBACKGROUND  = C.SDL_APP_DIDENTERBACKGROUND  //application entered background\n\tAPP_WILLENTERFOREGROUND = C.SDL_APP_WILLENTERFOREGROUND // application is entering foreground\n\tAPP_DIDENTERFOREGROUND  = C.SDL_APP_DIDENTERFOREGROUND  // application entered foreground\n\n\t// Display events\n\tDISPLAYEVENT = C.SDL_DISPLAYEVENT // Display state change\n\n\t// Window events\n\tWINDOWEVENT = C.SDL_WINDOWEVENT // window state change\n\tSYSWMEVENT  = C.SDL_SYSWMEVENT  // system specific event\n\n\t// Keyboard events\n\tKEYDOWN         = C.SDL_KEYDOWN         // key pressed\n\tKEYUP           = C.SDL_KEYUP           // key released\n\tTEXTEDITING     = C.SDL_TEXTEDITING     // keyboard text editing (composition)\n\tTEXTINPUT       = C.SDL_TEXTINPUT       // keyboard text input\n\tTEXTEDITING_EXT = C.SDL_TEXTEDITING_EXT // keyboard text editing (composition)\n\tKEYMAPCHANGED   = C.SDL_KEYMAPCHANGED   // keymap changed due to a system event such as an input language or keyboard layout change (>= SDL 2.0.4)\n\n\t// Mouse events\n\tMOUSEMOTION     = C.SDL_MOUSEMOTION     // mouse moved\n\tMOUSEBUTTONDOWN = C.SDL_MOUSEBUTTONDOWN // mouse button pressed\n\tMOUSEBUTTONUP   = C.SDL_MOUSEBUTTONUP   // mouse button released\n\tMOUSEWHEEL      = C.SDL_MOUSEWHEEL      // mouse wheel motion\n\n\t// Joystick events\n\tJOYAXISMOTION    = C.SDL_JOYAXISMOTION    // joystick axis motion\n\tJOYBALLMOTION    = C.SDL_JOYBALLMOTION    // joystick trackball motion\n\tJOYHATMOTION     = C.SDL_JOYHATMOTION     // joystick hat position change\n\tJOYBUTTONDOWN    = C.SDL_JOYBUTTONDOWN    // joystick button pressed\n\tJOYBUTTONUP      = C.SDL_JOYBUTTONUP      // joystick button released\n\tJOYDEVICEADDED   = C.SDL_JOYDEVICEADDED   // joystick connected\n\tJOYDEVICEREMOVED = C.SDL_JOYDEVICEREMOVED // joystick disconnected\n\n\t// Game controller events\n\tCONTROLLERAXISMOTION     = C.SDL_CONTROLLERAXISMOTION     // controller axis motion\n\tCONTROLLERBUTTONDOWN     = C.SDL_CONTROLLERBUTTONDOWN     // controller button pressed\n\tCONTROLLERBUTTONUP       = C.SDL_CONTROLLERBUTTONUP       // controller button released\n\tCONTROLLERDEVICEADDED    = C.SDL_CONTROLLERDEVICEADDED    // controller connected\n\tCONTROLLERDEVICEREMOVED  = C.SDL_CONTROLLERDEVICEREMOVED  // controller disconnected\n\tCONTROLLERDEVICEREMAPPED = C.SDL_CONTROLLERDEVICEREMAPPED // controller mapping updated\n\n\t// Touch events\n\tFINGERDOWN   = C.SDL_FINGERDOWN   // user has touched input device\n\tFINGERUP     = C.SDL_FINGERUP     // user stopped touching input device\n\tFINGERMOTION = C.SDL_FINGERMOTION // user is dragging finger on input device\n\n\t// Gesture events\n\tDOLLARGESTURE = C.SDL_DOLLARGESTURE\n\tDOLLARRECORD  = C.SDL_DOLLARRECORD\n\tMULTIGESTURE  = C.SDL_MULTIGESTURE\n\n\t// Clipboard events\n\tCLIPBOARDUPDATE = C.SDL_CLIPBOARDUPDATE // the clipboard changed\n\n\t// Drag and drop events\n\tDROPFILE     = C.SDL_DROPFILE     // the system requests a file open\n\tDROPTEXT     = C.SDL_DROPTEXT     // text/plain drag-and-drop event\n\tDROPBEGIN    = C.SDL_DROPBEGIN    // a new set of drops is beginning (NULL filename)\n\tDROPCOMPLETE = C.SDL_DROPCOMPLETE // current set of drops is now complete (NULL filename)\n\n\t// Audio hotplug events\n\tAUDIODEVICEADDED   = C.SDL_AUDIODEVICEADDED   // a new audio device is available (>= SDL 2.0.4)\n\tAUDIODEVICEREMOVED = C.SDL_AUDIODEVICEREMOVED // an audio device has been removed (>= SDL 2.0.4)\n\n\t// Sensor events\n\tSENSORUPDATE = C.SDL_SENSORUPDATE // a sensor was updated\n\n\t// Render events\n\tRENDER_TARGETS_RESET = C.SDL_RENDER_TARGETS_RESET // the render targets have been reset and their contents need to be updated (>= SDL 2.0.2)\n\tRENDER_DEVICE_RESET  = C.SDL_RENDER_DEVICE_RESET  // the device has been reset and all textures need to be recreated (>= SDL 2.0.4)\n\n\t// These are for your use, and should be allocated with RegisterEvents()\n\tUSEREVENT = C.SDL_USEREVENT // a user-specified event\n\tLASTEVENT = C.SDL_LASTEVENT // (only for bounding internal arrays)\n)\n\n// Actions for PeepEvents().\n// (https://wiki.libsdl.org/SDL_PeepEvents)\nconst (\n\tADDEVENT  = C.SDL_ADDEVENT  // up to numevents events will be added to the back of the event queue\n\tPEEKEVENT = C.SDL_PEEKEVENT // up to numevents events at the front of the event queue, within the specified minimum and maximum type, will be returned and will not be removed from the queue\n\tGETEVENT  = C.SDL_GETEVENT  // up to numevents events at the front of the event queue, within the specified minimum and maximum type, will be returned and will be removed from the queue\n)\n\n// Toggles for different event state functions.\nconst (\n\tQUERY   = C.SDL_QUERY\n\tIGNORE  = C.SDL_IGNORE\n\tDISABLE = C.SDL_DISABLE\n\tENABLE  = C.SDL_ENABLE\n)\n\n// Event is a union of all event structures used in SDL.\n// (https://wiki.libsdl.org/SDL_Event)\ntype Event interface {\n\tGetType() uint32      // GetType returns the event type\n\tGetTimestamp() uint32 // GetTimestamp returns the timestamp of the event\n}\n\n// CEvent is a union of all event structures used in SDL.\n// (https://wiki.libsdl.org/SDL_Event)\ntype CEvent struct {\n\tType uint32\n\t_    [52]byte // padding\n}\n\n// CommonEvent contains common event data.\n// (https://wiki.libsdl.org/SDL_Event)\ntype CommonEvent struct {\n\tType      uint32 // the event type\n\tTimestamp uint32 // timestamp of the event\n}\n\n// GetType returns the event type.\nfunc (e *CommonEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *CommonEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// DisplayEvent contains common event data.\n// (https://wiki.libsdl.org/SDL_Event)\ntype DisplayEvent struct {\n\tType      uint32 // the event type\n\tTimestamp uint32 // timestamp of the event\n\tDisplay   uint32 // the associated display index\n\tEvent     uint8  // TODO: (https://wiki.libsdl.org/SDL_DisplayEventID)\n\t_         uint8  // padding\n\t_         uint8  // padding\n\t_         uint8  // padding\n\tData1     int32  // event dependent data\n}\n\n// GetType returns the event type.\nfunc (e *DisplayEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *DisplayEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// WindowEvent contains window state change event data.\n// (https://wiki.libsdl.org/SDL_WindowEvent)\ntype WindowEvent struct {\n\tType      uint32 // WINDOWEVENT\n\tTimestamp uint32 // timestamp of the event\n\tWindowID  uint32 // the associated window\n\tEvent     uint8  // (https://wiki.libsdl.org/SDL_WindowEventID)\n\t_         uint8  // padding\n\t_         uint8  // padding\n\t_         uint8  // padding\n\tData1     int32  // event dependent data\n\tData2     int32  // event dependent data\n}\ntype cWindowEvent C.SDL_WindowEvent\n\n// GetType returns the event type.\nfunc (e *WindowEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *WindowEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// KeyboardEvent contains keyboard key down event information.\n// (https://wiki.libsdl.org/SDL_KeyboardEvent)\ntype KeyboardEvent struct {\n\tType      uint32 // KEYDOWN, KEYUP\n\tTimestamp uint32 // timestamp of the event\n\tWindowID  uint32 // the window with keyboard focus, if any\n\tState     uint8  // PRESSED, RELEASED\n\tRepeat    uint8  // non-zero if this is a key repeat\n\t_         uint8  // padding\n\t_         uint8  // padding\n\tKeysym    Keysym // Keysym representing the key that was pressed or released\n}\ntype cKeyboardEvent C.SDL_KeyboardEvent\n\n// GetType returns the event type.\nfunc (e *KeyboardEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *KeyboardEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// TextEditingEvent contains keyboard text editing event information.\n// (https://wiki.libsdl.org/SDL_TextEditingEvent)\ntype TextEditingEvent struct {\n\tType      uint32                               // TEXTEDITING\n\tTimestamp uint32                               // timestamp of the event\n\tWindowID  uint32                               // the window with keyboard focus, if any\n\tText      [C.SDL_TEXTINPUTEVENT_TEXT_SIZE]byte // the null-terminated editing text in UTF-8 encoding\n\tStart     int32                                // the location to begin editing from\n\tLength    int32                                // the number of characters to edit from the start point\n}\ntype cTextEditingEvent C.SDL_TextEditingEvent\n\n// GetType returns the event type.\nfunc (e *TextEditingEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetText returns the text as string\nfunc (e *TextEditingEvent) GetText() string {\n\tlength := func(buf []byte) int {\n\t\tfor i := range buf {\n\t\t\tif buf[i] == 0 {\n\t\t\t\treturn i\n\t\t\t}\n\t\t}\n\n\t\treturn 0\n\t}(e.Text[:])\n\n\ttext := e.Text[:length]\n\treturn string(text)\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *TextEditingEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// TextInputEvent contains keyboard text input event information.\n// (https://wiki.libsdl.org/SDL_TextInputEvent)\ntype TextInputEvent struct {\n\tType      uint32                               // TEXTINPUT\n\tTimestamp uint32                               // timestamp of the event\n\tWindowID  uint32                               // the window with keyboard focus, if any\n\tText      [C.SDL_TEXTINPUTEVENT_TEXT_SIZE]byte // the null-terminated input text in UTF-8 encoding\n}\ntype cTextInputEvent C.SDL_TextInputEvent\n\n// GetType returns the event type.\nfunc (e *TextInputEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *TextInputEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// GetText returns the text as string\nfunc (e *TextInputEvent) GetText() string {\n\tlength := func(buf []byte) int {\n\t\tfor i := range buf {\n\t\t\tif buf[i] == 0 {\n\t\t\t\treturn i\n\t\t\t}\n\t\t}\n\n\t\treturn 0\n\t}(e.Text[:])\n\n\ttext := e.Text[:length]\n\treturn string(text)\n}\n\n// MouseMotionEvent contains mouse motion event information.\n// (https://wiki.libsdl.org/SDL_MouseMotionEvent)\ntype MouseMotionEvent struct {\n\tType      uint32 // MOUSEMOTION\n\tTimestamp uint32 // timestamp of the event\n\tWindowID  uint32 // the window with mouse focus, if any\n\tWhich     uint32 // the mouse instance id, or TOUCH_MOUSEID\n\tState     uint32 // BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT, BUTTON_X1, BUTTON_X2\n\tX         int32  // X coordinate, relative to window\n\tY         int32  // Y coordinate, relative to window\n\tXRel      int32  // relative motion in the X direction\n\tYRel      int32  // relative motion in the Y direction\n}\ntype cMouseMotionEvent C.SDL_MouseMotionEvent\n\n// GetType returns the event type.\nfunc (e *MouseMotionEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *MouseMotionEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// MouseButtonEvent contains mouse button event information.\n// (https://wiki.libsdl.org/SDL_MouseButtonEvent)\ntype MouseButtonEvent struct {\n\tType      uint32 // MOUSEBUTTONDOWN, MOUSEBUTTONUP\n\tTimestamp uint32 // timestamp of the event\n\tWindowID  uint32 // the window with mouse focus, if any\n\tWhich     uint32 // the mouse instance id, or TOUCH_MOUSEID\n\tButton    uint8  // BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT, BUTTON_X1, BUTTON_X2\n\tState     uint8  // PRESSED, RELEASED\n\tClicks    uint8  // 1 for single-click, 2 for double-click, etc. (>= SDL 2.0.2)\n\t_         uint8  // padding\n\tX         int32  // X coordinate, relative to window\n\tY         int32  // Y coordinate, relative to window\n}\ntype cMouseButtonEvent C.SDL_MouseButtonEvent\n\n// GetType returns the event type.\nfunc (e *MouseButtonEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *MouseButtonEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// MouseWheelEvent contains mouse wheel event information.\n// (https://wiki.libsdl.org/SDL_MouseWheelEvent)\ntype MouseWheelEvent struct {\n\tType      uint32  // MOUSEWHEEL\n\tTimestamp uint32  // timestamp of the event\n\tWindowID  uint32  // the window with mouse focus, if any\n\tWhich     uint32  // the mouse instance id, or TOUCH_MOUSEID\n\tX         int32   // the amount scrolled horizontally, positive to the right and negative to the left\n\tY         int32   // the amount scrolled vertically, positive away from the user and negative toward the user\n\tDirection uint32  // MOUSEWHEEL_NORMAL, MOUSEWHEEL_FLIPPED (>= SDL 2.0.4)\n\tPreciseX  float32 // The amount scrolled horizontally, positive to the right and negative to the left, with float precision (added in 2.0.18)\n\tPreciseY  float32 // The amount scrolled vertically, positive away from the user and negative toward the user, with float precision (added in 2.0.18)\n}\ntype cMouseWheelEvent C.SDL_MouseWheelEvent\n\n// GetType returns the event type.\nfunc (e *MouseWheelEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *MouseWheelEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// JoyAxisEvent contains joystick axis motion event information.\n// (https://wiki.libsdl.org/SDL_JoyAxisEvent)\ntype JoyAxisEvent struct {\n\tType      uint32     // JOYAXISMOTION\n\tTimestamp uint32     // timestamp of the event\n\tWhich     JoystickID // the instance id of the joystick that reported the event\n\tAxis      uint8      // the index of the axis that changed\n\t_         uint8      // padding\n\t_         uint8      // padding\n\t_         uint8      // padding\n\tValue     int16      // the current position of the axis (range: -32768 to 32767)\n\t_         uint16     // padding\n}\ntype cJoyAxisEvent C.SDL_JoyAxisEvent\n\n// GetType returns the event type.\nfunc (e *JoyAxisEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *JoyAxisEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// JoyBallEvent contains joystick trackball motion event information.\n// (https://wiki.libsdl.org/SDL_JoyBallEvent)\ntype JoyBallEvent struct {\n\tType      uint32     // JOYBALLMOTION\n\tTimestamp uint32     // timestamp of the event\n\tWhich     JoystickID // the instance id of the joystick that reported the event\n\tBall      uint8      // the index of the trackball that changed\n\t_         uint8      // padding\n\t_         uint8      // padding\n\t_         uint8      // padding\n\tXRel      int16      // the relative motion in the X direction\n\tYRel      int16      // the relative motion in the Y direction\n}\ntype cJoyBallEvent C.SDL_JoyBallEvent\n\n// GetType returns the event type.\nfunc (e *JoyBallEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *JoyBallEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// JoyHatEvent contains joystick hat position change event information.\n// (https://wiki.libsdl.org/SDL_JoyHatEvent)\ntype JoyHatEvent struct {\n\tType      uint32     // JOYHATMOTION\n\tTimestamp uint32     // timestamp of the event\n\tWhich     JoystickID // the instance id of the joystick that reported the event\n\tHat       uint8      // the index of the hat that changed\n\tValue     uint8      // HAT_LEFTUP, HAT_UP, HAT_RIGHTUP, HAT_LEFT, HAT_CENTERED, HAT_RIGHT, HAT_LEFTDOWN, HAT_DOWN, HAT_RIGHTDOWN\n\t_         uint8      // padding\n\t_         uint8      // padding\n}\ntype cJoyHatEvent C.SDL_JoyHatEvent\n\n// GetType returns the event type.\nfunc (e *JoyHatEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *JoyHatEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// JoyButtonEvent contains joystick button event information.\n// (https://wiki.libsdl.org/SDL_JoyButtonEvent)\ntype JoyButtonEvent struct {\n\tType      uint32     // JOYBUTTONDOWN, JOYBUTTONUP\n\tTimestamp uint32     // timestamp of the event\n\tWhich     JoystickID // the instance id of the joystick that reported the event\n\tButton    uint8      // the index of the button that changed\n\tState     uint8      // PRESSED, RELEASED\n\t_         uint8      // padding\n\t_         uint8      // padding\n}\ntype cJoyButtonEvent C.SDL_JoyButtonEvent\n\n// GetType returns the event type.\nfunc (e *JoyButtonEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *JoyButtonEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// JoyDeviceAddedEvent contains joystick device event information.\n// (https://wiki.libsdl.org/SDL_JoyDeviceEvent)\ntype JoyDeviceAddedEvent struct {\n\tType      uint32     // JOYDEVICEADDED\n\tTimestamp uint32     // the timestamp of the event\n\tWhich     JoystickID // the joystick device index\n}\n\n// GetType returns the event type.\nfunc (e *JoyDeviceAddedEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *JoyDeviceAddedEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// JoyDeviceRemovedEvent contains joystick device event information.\n// (https://wiki.libsdl.org/SDL_JoyDeviceEvent)\ntype JoyDeviceRemovedEvent struct {\n\tType      uint32     // JOYDEVICEREMOVED\n\tTimestamp uint32     // the timestamp of the event\n\tWhich     JoystickID // the instance id\n}\n\n// GetType returns the event type.\nfunc (e *JoyDeviceRemovedEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *JoyDeviceRemovedEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// ControllerAxisEvent contains game controller axis motion event information.\n// (https://wiki.libsdl.org/SDL_ControllerAxisEvent)\ntype ControllerAxisEvent struct {\n\tType      uint32     // CONTROLLERAXISMOTION\n\tTimestamp uint32     // the timestamp of the event\n\tWhich     JoystickID // the joystick instance id\n\tAxis      uint8      // the controller axis (https://wiki.libsdl.org/SDL_GameControllerAxis)\n\t_         uint8      // padding\n\t_         uint8      // padding\n\t_         uint8      // padding\n\tValue     int16      // the axis value (range: -32768 to 32767)\n\t_         uint16     // padding\n}\ntype cControllerAxisEvent C.SDL_ControllerAxisEvent\n\n// GetType returns the event type.\nfunc (e *ControllerAxisEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *ControllerAxisEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// ControllerButtonEvent contains game controller button event information.\n// (https://wiki.libsdl.org/SDL_ControllerButtonEvent)\ntype ControllerButtonEvent struct {\n\tType      uint32     // CONTROLLERBUTTONDOWN, CONTROLLERBUTTONUP\n\tTimestamp uint32     // the timestamp of the event\n\tWhich     JoystickID // the joystick instance id\n\tButton    uint8      // the controller button (https://wiki.libsdl.org/SDL_GameControllerButton)\n\tState     uint8      // PRESSED, RELEASED\n\t_         uint8      // padding\n\t_         uint8      // padding\n}\ntype cControllerButtonEvent C.SDL_ControllerButtonEvent\n\n// GetType returns the event type.\nfunc (e *ControllerButtonEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *ControllerButtonEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// ControllerDeviceEvent contains controller device event information.\n// (https://wiki.libsdl.org/SDL_ControllerDeviceEvent)\ntype ControllerDeviceEvent struct {\n\tType      uint32     // CONTROLLERDEVICEADDED, CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED\n\tTimestamp uint32     // the timestamp of the event\n\tWhich     JoystickID // the joystick device index for the CONTROLLERDEVICEADDED event or instance id for the CONTROLLERDEVICEREMOVED or CONTROLLERDEVICEREMAPPED event\n}\ntype cControllerDeviceEvent C.SDL_ControllerDeviceEvent\n\n// GetType returns the event type.\nfunc (e *ControllerDeviceEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *ControllerDeviceEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// AudioDeviceEvent contains audio device event information.\n// (https://wiki.libsdl.org/SDL_AudioDeviceEvent)\ntype AudioDeviceEvent struct {\n\tType      uint32 // AUDIODEVICEADDED, AUDIODEVICEREMOVED\n\tTimestamp uint32 // the timestamp of the event\n\tWhich     uint32 // the audio device index for the AUDIODEVICEADDED event (valid until next GetNumAudioDevices() call), AudioDeviceID for the AUDIODEVICEREMOVED event\n\tIsCapture uint8  // zero if an audio output device, non-zero if an audio capture device\n\t_         uint8  // padding\n\t_         uint8  // padding\n\t_         uint8  // padding\n}\ntype cAudioDeviceEvent C.SDL_AudioDeviceEvent\n\n// GetType returns the event type.\nfunc (e *AudioDeviceEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *AudioDeviceEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// TouchFingerEvent contains finger touch event information.\n// (https://wiki.libsdl.org/SDL_TouchFingerEvent)\ntype TouchFingerEvent struct {\n\tType      uint32   // FINGERMOTION, FINGERDOWN, FINGERUP\n\tTimestamp uint32   // timestamp of the event\n\tTouchID   TouchID  // the touch device id\n\tFingerID  FingerID // the finger id\n\tX         float32  // the x-axis location of the touch event, normalized (0...1)\n\tY         float32  // the y-axis location of the touch event, normalized (0...1)\n\tDX        float32  // the distance moved in the x-axis, normalized (-1...1)\n\tDY        float32  // the distance moved in the y-axis, normalized (-1...1)\n\tPressure  float32  // the quantity of pressure applied, normalized (0...1)\n}\ntype cTouchFingerEvent C.SDL_TouchFingerEvent\n\n// GetType returns the event type.\nfunc (e *TouchFingerEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *TouchFingerEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// MultiGestureEvent contains multiple finger gesture event information.\n// (https://wiki.libsdl.org/SDL_MultiGestureEvent)\ntype MultiGestureEvent struct {\n\tType       uint32  // MULTIGESTURE\n\tTimestamp  uint32  // timestamp of the event\n\tTouchID    TouchID // the touch device id\n\tDTheta     float32 // the amount that the fingers rotated during this motion\n\tDDist      float32 // the amount that the fingers pinched during this motion\n\tX          float32 // the normalized center of gesture\n\tY          float32 // the normalized center of gesture\n\tNumFingers uint16  // the number of fingers used in the gesture\n\t_          uint16  // padding\n}\ntype cMultiGestureEvent C.SDL_MultiGestureEvent\n\n// GetType returns the event type.\nfunc (e *MultiGestureEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *MultiGestureEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// DollarGestureEvent contains complex gesture event information.\n// (https://wiki.libsdl.org/SDL_DollarGestureEvent)\ntype DollarGestureEvent struct {\n\tType       uint32    // DOLLARGESTURE, DOLLARRECORD\n\tTimestamp  uint32    // timestamp of the event\n\tTouchID    TouchID   // the touch device id\n\tGestureID  GestureID // the unique id of the closest gesture to the performed stroke\n\tNumFingers uint32    // the number of fingers used to draw the stroke\n\tError      float32   // the difference between the gesture template and the actual performed gesture (lower error is a better match)\n\tX          float32   // the normalized center of gesture\n\tY          float32   // the normalized center of gesture\n}\ntype cDollarGestureEvent C.SDL_DollarGestureEvent\n\n// GetType returns the event type.\nfunc (e *DollarGestureEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *DollarGestureEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// DropEvent contains an event used to request a file open by the system.\n// (https://wiki.libsdl.org/SDL_DropEvent)\ntype DropEvent struct {\n\tType      uint32 // DROPFILE, DROPTEXT, DROPBEGIN, DROPCOMPLETE\n\tTimestamp uint32 // timestamp of the event\n\tFile      string // the file name\n\tWindowID  uint32 // the window that was dropped on, if any\n}\n\ntype tDropEvent struct {\n\tType      uint32\n\tTimestamp uint32\n\tFile      unsafe.Pointer\n\tWindowID  uint32\n}\ntype cDropEvent C.SDL_DropEvent\n\n// GetType returns the event type.\nfunc (e *DropEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *DropEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// SensorEvent contains data from sensors such as accelerometer and gyroscope\n// (https://wiki.libsdl.org/SDL_SensorEvent)\ntype SensorEvent struct {\n\tType      uint32     // SDL_SENSORUPDATE\n\tTimestamp uint32     // In milliseconds, populated using SDL_GetTicks()\n\tWhich     int32      // The instance ID of the sensor\n\tData      [6]float32 // Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData()\n}\ntype cSensorEvent C.SDL_SensorEvent\n\n// GetType returns the event type.\nfunc (e *SensorEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *SensorEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// RenderEvent contains render event information.\n// (https://wiki.libsdl.org/SDL_EventType)\ntype RenderEvent struct {\n\tType      uint32 // the event type\n\tTimestamp uint32 // timestamp of the event\n}\n\n// GetType returns the event type.\nfunc (e *RenderEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *RenderEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// QuitEvent contains the \"quit requested\" event.\n// (https://wiki.libsdl.org/SDL_QuitEvent)\ntype QuitEvent struct {\n\tType      uint32 // QUIT\n\tTimestamp uint32 // timestamp of the event\n}\n\n// GetType returns the event type.\nfunc (e *QuitEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *QuitEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// OSEvent contains OS specific event information.\ntype OSEvent struct {\n\tType      uint32 // the event type\n\tTimestamp uint32 // timestamp of the event\n}\n\n// GetType returns the event type.\nfunc (e *OSEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *OSEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// ClipboardEvent contains clipboard event information.\n// (https://wiki.libsdl.org/SDL_EventType)\ntype ClipboardEvent struct {\n\tType      uint32 // CLIPBOARDUPDATE\n\tTimestamp uint32 // timestamp of the event\n}\n\n// GetType returns the event type.\nfunc (e *ClipboardEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *ClipboardEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// UserEvent contains an application-defined event type.\n// (https://wiki.libsdl.org/SDL_UserEvent)\ntype UserEvent struct {\n\tType      uint32         // value obtained from RegisterEvents()\n\tTimestamp uint32         // timestamp of the event\n\tWindowID  uint32         // the associated window, if any\n\tCode      int32          // user defined event code\n\tData1     unsafe.Pointer // user defined data pointer\n\tData2     unsafe.Pointer // user defined data pointer\n}\ntype cUserEvent C.SDL_UserEvent\n\n// GetType returns the event type.\nfunc (e *UserEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *UserEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// SysWMEvent contains a video driver dependent system event.\n// (https://wiki.libsdl.org/SDL_SysWMEvent)\ntype SysWMEvent struct {\n\tType      uint32    // SYSWMEVENT\n\tTimestamp uint32    // timestamp of the event\n\tMsg       *SysWMmsg // driver dependent data, defined in SDL_syswm.h\n}\ntype cSysWMEvent C.SDL_SysWMEvent\n\n// GetType returns the event type.\nfunc (e *SysWMEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *SysWMEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// EventAction is the action to take in PeepEvents() function.\n// (https://wiki.libsdl.org/SDL_PeepEvents)\ntype EventAction C.SDL_eventaction\n\n// EventFilter is the function to call when an event happens.\n// (https://wiki.libsdl.org/SDL_SetEventFilter)\ntype EventFilter interface {\n\tFilterEvent(e Event, userdata interface{}) bool\n}\n\ntype eventFilterFunc func(Event, interface{}) bool\n\ntype eventFilterCallbackContext struct {\n\tfilter   EventFilter\n\thandle   EventWatchHandle\n\tuserdata interface{}\n}\n\n// EventWatchHandle is an event watch callback added with AddEventWatch().\ntype EventWatchHandle uintptr\n\nfunc (action EventAction) c() C.SDL_eventaction {\n\treturn C.SDL_eventaction(action)\n}\n\n// PumpEvents pumps the event loop, gathering events from the input devices.\n// (https://wiki.libsdl.org/SDL_PumpEvents)\nfunc PumpEvents() {\n\tC.SDL_PumpEvents()\n}\n\n// PeepEvents checks the event queue for messages and optionally return them.\n// (https://wiki.libsdl.org/SDL_PeepEvents)\nfunc PeepEvents(events []Event, action EventAction, minType, maxType uint32) (storedEvents int, err error) {\n\tif events == nil {\n\t\treturn 0, nil\n\t}\n\n\tvar _events []CEvent = make([]CEvent, len(events))\n\n\tif action == ADDEVENT { // the contents of _events matter if they are to be added\n\t\tfor i := 0; i < len(events); i++ {\n\t\t\t_events[i] = *cEvent(events[i])\n\t\t}\n\t}\n\n\t_pevents := (*C.SDL_Event)(unsafe.Pointer(&_events[0]))\n\tstoredEvents = int(C.SDL_PeepEvents(_pevents, C.int(len(events)), action.c(), C.Uint32(minType), C.Uint32(maxType)))\n\n\tif action != ADDEVENT { // put events into slice, events unchanged if action = ADDEVENT\n\t\tfor i := 0; i < storedEvents; i++ {\n\t\t\tevents[i] = goEvent(&_events[i])\n\t\t}\n\t}\n\n\tif storedEvents < 0 {\n\t\terr = GetError()\n\t}\n\n\treturn\n}\n\n// HasEvent checks for the existence of certain event types in the event queue.\n// (https://wiki.libsdl.org/SDL_HasEvent)\nfunc HasEvent(type_ uint32) bool {\n\treturn C.SDL_HasEvent(C.Uint32(type_)) != 0\n}\n\n// HasEvents checks for the existence of a range of event types in the event queue.\n// (https://wiki.libsdl.org/SDL_HasEvents)\nfunc HasEvents(minType, maxType uint32) bool {\n\treturn C.SDL_HasEvents(C.Uint32(minType), C.Uint32(maxType)) != 0\n}\n\n// FlushEvent clears events from the event queue.\n// (https://wiki.libsdl.org/SDL_FlushEvent)\nfunc FlushEvent(type_ uint32) {\n\tC.SDL_FlushEvent(C.Uint32(type_))\n}\n\n// FlushEvents clears events from the event queue.\n// (https://wiki.libsdl.org/SDL_FlushEvents)\nfunc FlushEvents(minType, maxType uint32) {\n\tC.SDL_FlushEvents(C.Uint32(minType), C.Uint32(maxType))\n}\n\n// PollEvent polls for currently pending events.\n// (https://wiki.libsdl.org/SDL_PollEvent)\nfunc PollEvent() Event {\n\tret := C.PollEvent()\n\tif ret == 0 {\n\t\treturn nil\n\t}\n\treturn goEvent((*CEvent)(unsafe.Pointer(&C.event)))\n}\n\nfunc goEvent(cevent *CEvent) Event {\n\tswitch cevent.Type {\n\tcase DISPLAYEVENT:\n\t\treturn (*DisplayEvent)(unsafe.Pointer(cevent))\n\tcase WINDOWEVENT:\n\t\treturn (*WindowEvent)(unsafe.Pointer(cevent))\n\tcase SYSWMEVENT:\n\t\treturn (*SysWMEvent)(unsafe.Pointer(cevent))\n\tcase KEYDOWN, KEYUP:\n\t\treturn (*KeyboardEvent)(unsafe.Pointer(cevent))\n\tcase TEXTEDITING:\n\t\treturn (*TextEditingEvent)(unsafe.Pointer(cevent))\n\tcase TEXTINPUT:\n\t\treturn (*TextInputEvent)(unsafe.Pointer(cevent))\n\tcase MOUSEMOTION:\n\t\treturn (*MouseMotionEvent)(unsafe.Pointer(cevent))\n\tcase MOUSEBUTTONDOWN, MOUSEBUTTONUP:\n\t\treturn (*MouseButtonEvent)(unsafe.Pointer(cevent))\n\tcase MOUSEWHEEL:\n\t\treturn (*MouseWheelEvent)(unsafe.Pointer(cevent))\n\tcase JOYAXISMOTION:\n\t\treturn (*JoyAxisEvent)(unsafe.Pointer(cevent))\n\tcase JOYBALLMOTION:\n\t\treturn (*JoyBallEvent)(unsafe.Pointer(cevent))\n\tcase JOYHATMOTION:\n\t\treturn (*JoyHatEvent)(unsafe.Pointer(cevent))\n\tcase JOYBUTTONDOWN, JOYBUTTONUP:\n\t\treturn (*JoyButtonEvent)(unsafe.Pointer(cevent))\n\tcase JOYDEVICEADDED:\n\t\treturn (*JoyDeviceAddedEvent)(unsafe.Pointer(cevent))\n\tcase JOYDEVICEREMOVED:\n\t\treturn (*JoyDeviceRemovedEvent)(unsafe.Pointer(cevent))\n\tcase CONTROLLERAXISMOTION:\n\t\treturn (*ControllerAxisEvent)(unsafe.Pointer(cevent))\n\tcase CONTROLLERBUTTONDOWN, CONTROLLERBUTTONUP:\n\t\treturn (*ControllerButtonEvent)(unsafe.Pointer(cevent))\n\tcase CONTROLLERDEVICEADDED, CONTROLLERDEVICEREMOVED, CONTROLLERDEVICEREMAPPED:\n\t\treturn (*ControllerDeviceEvent)(unsafe.Pointer(cevent))\n\tcase AUDIODEVICEADDED, AUDIODEVICEREMOVED:\n\t\treturn (*AudioDeviceEvent)(unsafe.Pointer(cevent))\n\tcase FINGERMOTION, FINGERDOWN, FINGERUP:\n\t\treturn (*TouchFingerEvent)(unsafe.Pointer(cevent))\n\tcase MULTIGESTURE:\n\t\treturn (*MultiGestureEvent)(unsafe.Pointer(cevent))\n\tcase DOLLARGESTURE, DOLLARRECORD:\n\t\treturn (*DollarGestureEvent)(unsafe.Pointer(cevent))\n\tcase DROPFILE, DROPTEXT, DROPBEGIN, DROPCOMPLETE:\n\t\te := (*tDropEvent)(unsafe.Pointer(cevent))\n\t\tevent := DropEvent{Type: e.Type, Timestamp: e.Timestamp, File: C.GoString((*C.char)(e.File)), WindowID: e.WindowID}\n\t\tC.SDL_free(e.File)\n\t\treturn &event\n\tcase SENSORUPDATE:\n\t\treturn (*SensorEvent)(unsafe.Pointer(cevent))\n\tcase RENDER_TARGETS_RESET, RENDER_DEVICE_RESET:\n\t\treturn (*RenderEvent)(unsafe.Pointer(cevent))\n\tcase QUIT:\n\t\treturn (*QuitEvent)(unsafe.Pointer(cevent))\n\tcase CLIPBOARDUPDATE:\n\t\treturn (*ClipboardEvent)(unsafe.Pointer(cevent))\n\tdefault:\n\t\tif cevent.Type >= USEREVENT {\n\t\t\t// all events beyond USEREVENT are UserEvents to be registered with RegisterEvents\n\t\t\treturn (*UserEvent)(unsafe.Pointer(cevent))\n\t\t}\n\t\treturn (*CommonEvent)(unsafe.Pointer(cevent))\n\t}\n}\n\nfunc cEvent(event Event) *CEvent {\n\tevv := reflect.ValueOf(event)\n\tp := evv.Elem()\n\treturn (*CEvent)(unsafe.Pointer(p.UnsafeAddr()))\n}\n\n// WaitEventTimeout waits until the specified timeout (in milliseconds) for the next available event.\n// (https://wiki.libsdl.org/SDL_WaitEventTimeout)\nfunc WaitEventTimeout(timeout int) Event {\n\tvar cevent CEvent\n\t_event := (*C.SDL_Event)(unsafe.Pointer(&cevent))\n\tok := int(C.SDL_WaitEventTimeout(_event, C.int(timeout)))\n\tif ok == 0 {\n\t\treturn nil\n\t}\n\treturn goEvent(&cevent)\n}\n\n// WaitEvent waits indefinitely for the next available event.\n// (https://wiki.libsdl.org/SDL_WaitEvent)\nfunc WaitEvent() Event {\n\tvar cevent CEvent\n\t_event := (*C.SDL_Event)(unsafe.Pointer(&cevent))\n\tok := int(C.SDL_WaitEvent(_event))\n\tif ok == 0 {\n\t\treturn nil\n\t}\n\treturn goEvent(&cevent)\n}\n\n// PushEvent adds an event to the event queue.\n// (https://wiki.libsdl.org/SDL_PushEvent)\nfunc PushEvent(event Event) (filtered bool, err error) {\n\t_event := (*C.SDL_Event)(unsafe.Pointer(cEvent(event)))\n\tif ok := int(C.SDL_PushEvent(_event)); ok < 0 {\n\t\tfiltered, err = false, GetError()\n\t} else if ok == 0 {\n\t\tfiltered, err = true, nil\n\t}\n\treturn\n}\n\nfunc (ef eventFilterFunc) FilterEvent(e Event, userdata interface{}) bool {\n\treturn ef(e, userdata)\n}\n\nfunc newEventFilterCallbackContext(filter EventFilter, userdata interface{}) *eventFilterCallbackContext {\n\tlastEventWatchHandleMutex.Lock()\n\tdefer lastEventWatchHandleMutex.Unlock()\n\t// Look for the next available watch handle (this should be immediate\n\t// unless you're creating a LOT of handlers).\n\tfor {\n\t\tif _, ok := eventWatches[lastEventWatchHandle]; !ok {\n\t\t\tbreak\n\t\t}\n\t\tlastEventWatchHandle++\n\t}\n\te := &eventFilterCallbackContext{filter, lastEventWatchHandle, userdata}\n\teventWatches[lastEventWatchHandle] = e\n\tlastEventWatchHandle++\n\treturn e\n}\n\nfunc (e *eventFilterCallbackContext) cptr() unsafe.Pointer {\n\treturn unsafe.Pointer(e.handle)\n}\n\n//export goSetEventFilterCallback\nfunc goSetEventFilterCallback(data unsafe.Pointer, e *C.SDL_Event) C.int {\n\t// No check for eventFilterCache != nil. Why? because it should never be\n\t// nil since the callback is set/unset based on the last filter being nil\n\t// /non-nil. If there is an issue, then it should panic here so we can\n\t// figure out why that is.\n\n\treturn wrapEventFilterCallback(eventFilterCache, e, nil)\n}\n\n//export goEventFilterCallback\nfunc goEventFilterCallback(userdata unsafe.Pointer, e *C.SDL_Event) C.int {\n\t// same sort of reasoning with goSetEventFilterCallback, userdata should\n\t// always be non-nil and represent a valid eventFilterCallbackContext. If\n\t// it doesn't a panic will let us know that there something wrong and the\n\t// problem can be fixed.\n\n\tcontext := eventWatches[EventWatchHandle(userdata)]\n\treturn wrapEventFilterCallback(context.filter, e, context.userdata)\n}\n\nfunc wrapEventFilterCallback(filter EventFilter, e *C.SDL_Event, userdata interface{}) C.int {\n\tgev := goEvent((*CEvent)(unsafe.Pointer(e)))\n\tresult := filter.FilterEvent(gev, userdata)\n\n\tif result {\n\t\treturn C.SDL_TRUE\n\t}\n\treturn C.SDL_FALSE\n}\n\n// SetEventFilter sets up a filter to process all events before they change internal state and are posted to the internal event queue.\n// (https://wiki.libsdl.org/SDL_SetEventFilter)\nfunc SetEventFilter(filter EventFilter, userdata interface{}) {\n\tif eventFilterCache == nil && filter == nil {\n\t\t// nothing to do...\n\t\treturn\n\t}\n\n\tif eventFilterCache == nil && filter != nil {\n\t\t// We had no event filter before and do now; lets set\n\t\t// goSetEventFilterCallback() as the event filter.\n\t\tC.setEventFilter()\n\t} else if eventFilterCache != nil && filter == nil {\n\t\t// We had an event filter before, but no longer do, lets clear the\n\t\t// event filter\n\t\tC.clearEventFilter()\n\t}\n\n\teventFilterCache = filter\n}\n\n// SetEventFilterFunc sets up a function to process all events before they change internal state and are posted to the internal event queue.\n// (https://wiki.libsdl.org/SDL_SetEventFilter)\nfunc SetEventFilterFunc(filterFunc eventFilterFunc, userdata interface{}) {\n\tSetEventFilter(filterFunc, userdata)\n}\n\n// GetEventFilter queries the current event filter.\n// (https://wiki.libsdl.org/SDL_GetEventFilter)\nfunc GetEventFilter() EventFilter {\n\treturn eventFilterCache\n}\n\nfunc isCEventFilterSet() bool {\n\treturn C.SDL_GetEventFilter(nil, nil) == C.SDL_TRUE\n}\n\n// FilterEvents run a specific filter function on the current event queue, removing any events for which the filter returns 0.\n// (https://wiki.libsdl.org/SDL_FilterEvents)\nfunc FilterEvents(filter EventFilter, userdata interface{}) {\n\tcontext := newEventFilterCallbackContext(filter, userdata)\n\tC.filterEvents(context.cptr())\n}\n\n// FilterEventsFunc run a specific function on the current event queue, removing any events for which the filter returns 0.\n// (https://wiki.libsdl.org/SDL_FilterEvents)\nfunc FilterEventsFunc(filter eventFilterFunc, userdata interface{}) {\n\tFilterEvents(filter, userdata)\n}\n\n// AddEventWatch adds a callback to be triggered when an event is added to the event queue.\n// (https://wiki.libsdl.org/SDL_AddEventWatch)\nfunc AddEventWatch(filter EventFilter, userdata interface{}) EventWatchHandle {\n\tcontext := newEventFilterCallbackContext(filter, userdata)\n\tC.addEventWatch(context.cptr())\n\treturn context.handle\n}\n\n// AddEventWatchFunc adds a callback function to be triggered when an event is added to the event queue.\n// (https://wiki.libsdl.org/SDL_AddEventWatch)\nfunc AddEventWatchFunc(filterFunc eventFilterFunc, userdata interface{}) EventWatchHandle {\n\treturn AddEventWatch(filterFunc, userdata)\n}\n\n// DelEventWatch removes an event watch callback added with AddEventWatch().\n// (https://wiki.libsdl.org/SDL_DelEventWatch)\nfunc DelEventWatch(handle EventWatchHandle) {\n\tcontext, ok := eventWatches[handle]\n\tif !ok {\n\t\treturn\n\t}\n\tdelete(eventWatches, context.handle)\n\tC.delEventWatch(context.cptr())\n}\n\n// EventState sets the state of processing events by type.\n// (https://wiki.libsdl.org/SDL_EventState)\nfunc EventState(type_ uint32, state int) uint8 {\n\treturn uint8(C.SDL_EventState(C.Uint32(type_), C.int(state)))\n}\n\n// GetEventState returns the current processing state of the specified event\n// (https://wiki.libsdl.org/SDL_EventState)\nfunc GetEventState(type_ uint32) uint8 {\n\treturn uint8(C.SDL_EventState(C.Uint32(type_), QUERY))\n}\n\n// RegisterEvents allocates a set of user-defined events, and return the beginning event number for that set of events.\n// (https://wiki.libsdl.org/SDL_RegisterEvents)\nfunc RegisterEvents(numEvents int) uint32 {\n\treturn uint32(C.SDL_RegisterEvents(C.int(numEvents)))\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/events.h",
    "content": "#ifndef _GO_SDL_EVENTS_H\n#define _GO_SDL_EVENTS_H\n\n#if defined(_WIN32)\n\t#include <SDL2/SDL_events.h>\n#else\n\t#include <SDL_events.h>\n#endif\n\nextern SDL_Event event;\n\nextern void setEventFilter();\nextern void clearEventFilter();\nextern void filterEvents(void *userdata);\nextern void addEventWatch(void *userdata);\nextern void delEventWatch(void *userdata);\nextern int PollEvent();\n\n#endif\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/filesystem.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,1))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetBasePath is not supported before SDL 2.0.1\")\n#endif\n\nstatic inline char* SDL_GetBasePath()\n{\n\treturn NULL;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetPrefPath is not supported before SDL 2.0.1\")\n#endif\n\nstatic inline char* SDL_GetPrefPath(const char *org, const char *app)\n{\n\treturn NULL;\n}\n#endif\n\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// GetBasePath returns the directory where the application was run from. This is where the application data directory is.\n// (https://wiki.libsdl.org/SDL_GetBasePath)\nfunc GetBasePath() string {\n\t_val := C.SDL_GetBasePath()\n\tdefer C.SDL_free(unsafe.Pointer(_val))\n\treturn C.GoString(_val)\n}\n\n// GetPrefPath returns the \"pref dir\". This is meant to be where the application can write personal files (Preferences and save games, etc.) that are specific to the application. This directory is unique per user and per application.\n// (https://wiki.libsdl.org/SDL_GetPrefPath)\nfunc GetPrefPath(org, app string) string {\n\t_org := C.CString(org)\n\t_app := C.CString(app)\n\tdefer C.free(unsafe.Pointer(_org))\n\tdefer C.free(unsafe.Pointer(_app))\n\t_val := C.SDL_GetPrefPath(_org, _app)\n\tdefer C.SDL_free(unsafe.Pointer(_val))\n\treturn C.GoString(_val)\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/gamecontroller.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,4))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GameControllerFromInstanceID is not supported before SDL 2.0.4\")\n#endif\n\nstatic SDL_GameController* SDL_GameControllerFromInstanceID(SDL_JoystickID joyid)\n{\n\treturn NULL;\n}\n\n#endif\n\n\n#if !(SDL_VERSION_ATLEAST(2,0,6))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GameControllerGetVendor is not supported before SDL 2.0.6\")\n#pragma message(\"SDL_GameControllerGetProduct is not supported before SDL 2.0.6\")\n#pragma message(\"SDL_GameControllerGetProductVersion is not supported before SDL 2.0.6\")\n#pragma message(\"SDL_GameControllerNumMappings is not supported before SDL 2.0.6\")\n#pragma message(\"SDL_GameControllerMappingForIndex is not supported before SDL 2.0.6\")\n#endif\n\nstatic Uint16 SDL_GameControllerGetVendor(SDL_GameController* gamecontroller)\n{\n\treturn 0;\n}\n\n\nstatic Uint16 SDL_GameControllerGetProduct(SDL_GameController* gamecontroller)\n{\n\treturn 0;\n}\n\nstatic Uint16 SDL_GameControllerGetProductVersion(SDL_GameController* gamecontroller)\n{\n\treturn 0;\n}\n\nstatic int SDL_GameControllerNumMappings(void)\n{\n\treturn 0;\n}\n\nstatic char* SDL_GameControllerMappingForIndex(int mapping_index)\n{\n\treturn NULL;\n}\n#endif\n\n\n#if !(SDL_VERSION_ATLEAST(2,0,9))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GameControllerGetPlayerIndex is not supported before SDL 2.0.9\")\n#pragma message(\"SDL_GameControllerRumble is not supported before SDL 2.0.9\")\n#pragma message(\"SDL_GameControllerMappingForDeviceIndex is not supported before SDL 2.0.9\")\n#endif\n\ntypedef enum\n{\n    SDL_SENSOR_INVALID = -1,\n    SDL_SENSOR_UNKNOWN,\n    SDL_SENSOR_ACCEL,\n    SDL_SENSOR_GYRO\n} SDL_SensorType;\n\nstatic int SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller)\n{\n\treturn -1;\n}\n\nstatic int SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms)\n{\n\treturn -1;\n}\n\nstatic char *SDL_GameControllerMappingForDeviceIndex(int joystick_index)\n{\n\treturn NULL;\n}\n\n#endif\n\n\n#if !(SDL_VERSION_ATLEAST(2,0,12))\n\ntypedef enum\n{\n    SDL_CONTROLLER_TYPE_UNKNOWN = 0,\n    SDL_CONTROLLER_TYPE_XBOX360,\n    SDL_CONTROLLER_TYPE_XBOXONE,\n    SDL_CONTROLLER_TYPE_PS3,\n    SDL_CONTROLLER_TYPE_PS4,\n    SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO\n} SDL_GameControllerType;\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GameControllerTypeForIndex is not supported before SDL 2.0.12\")\n#pragma message(\"SDL_GameControllerGetType is not supported before SDL 2.0.12\")\n#pragma message(\"SDL_GameControllerFromPlayerIndex is not supported before SDL 2.0.12\")\n#pragma message(\"SDL_GameControllerSetPlayerIndex is not supported before SDL 2.0.12\")\n#endif\n\nstatic SDL_GameControllerType SDL_GameControllerTypeForIndex(int joystick_index)\n{\n\treturn SDL_CONTROLLER_TYPE_UNKNOWN;\n}\n\nstatic SDL_GameControllerType SDL_GameControllerGetType(SDL_GameController *gamecontroller)\n{\n\treturn SDL_CONTROLLER_TYPE_UNKNOWN;\n}\n\nstatic SDL_GameController * SDL_GameControllerFromPlayerIndex(int player_index)\n{\n\treturn NULL;\n}\n\nstatic void SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index)\n{\n\t// do nothing\n}\n\n#endif\n\n\n#if !(SDL_VERSION_ATLEAST(2,0,14))\n\n#define SDL_CONTROLLER_TYPE_VIRTUAL (6)\n#define SDL_CONTROLLER_TYPE_PS5 (7)\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GameControllerGetSerial is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerHasAxis is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerHasButton is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerGetNumTouchpads is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerGetNumTouchpadFingers is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerGetTouchpadFinger is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerHasSensor is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerSetSensorEnabled is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerIsSensorEnabled is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerGetSensorData is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerRumbleTriggers is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerHasLED is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerSetLED is not supported before SDL 2.0.14\")\n#endif\n\nstatic const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller)\n{\n\treturn NULL;\n}\n\nstatic SDL_bool SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)\n{\n\treturn SDL_FALSE;\n}\n\nstatic SDL_bool SDLCALL SDL_GameControllerHasButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)\n{\n\treturn SDL_FALSE;\n}\n\nstatic int SDLCALL SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller)\n{\n\treturn 0;\n}\n\nstatic int SDL_GameControllerGetNumTouchpadFingers(SDL_GameController *gamecontroller, int touchpad)\n{\n\treturn 0;\n}\n\nstatic int SDL_GameControllerGetTouchpadFinger(SDL_GameController *gamecontroller, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure)\n{\n\treturn -1;\n}\n\nstatic SDL_bool SDL_GameControllerHasSensor(SDL_GameController *gamecontroller, SDL_SensorType type)\n{\n\treturn SDL_FALSE;\n}\n\nstatic int SDL_GameControllerSetSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type, SDL_bool enabled)\n{\n\treturn -1;\n}\n\nstatic SDL_bool SDL_GameControllerIsSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type)\n{\n\treturn SDL_FALSE;\n}\n\nstatic int SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values)\n{\n\treturn -1;\n}\n\nstatic int SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms)\n{\n\treturn -1;\n}\n\nstatic SDL_bool SDL_GameControllerHasLED(SDL_GameController *gamecontroller)\n{\n\treturn SDL_FALSE;\n}\n\nstatic int SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint8 green, Uint8 blue)\n{\n\treturn -1;\n}\n\n#endif\n\n\n#if !(SDL_VERSION_ATLEAST(2,0,16))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GameControllerSendEffect is not supported before SDL 2.0.16\")\n#pragma message(\"SDL_GameControllerGetSensorDataRate is not supported before SDL 2.0.16\")\n#endif\n\nstatic int SDL_GameControllerSendEffect(SDL_GameController *gamecontroller, const void *data, int size)\n{\n\treturn -1;\n}\n\nstatic float SDL_GameControllerGetSensorDataRate(SDL_GameController *gamecontroller, SDL_SensorType type)\n{\n\treturn 0.0f;\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,18))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GameControllerHasRumble is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_GameControllerHasRumbleTriggers is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_GameControllerGetAppleSFSymbolsNameForButton is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_GameControllerGetAppleSFSymbolsNameForAxis is not supported before SDL 2.0.18\")\n#endif\n\nstatic SDL_bool SDL_GameControllerHasRumble(SDL_GameController *gamecontroller)\n{\n\treturn SDL_FALSE;\n}\n\nstatic SDL_bool SDL_GameControllerHasRumbleTriggers(SDL_GameController *gamecontroller)\n{\n\treturn SDL_FALSE;\n}\n\nstatic const char* SDL_GameControllerGetAppleSFSymbolsNameForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)\n{\n\treturn NULL;\n}\n\nstatic const char* SDL_GameControllerGetAppleSFSymbolsNameForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)\n{\n\treturn NULL;\n}\n\n#endif\n*/\nimport \"C\"\nimport (\n\t\"encoding/binary\"\n\t\"unsafe\"\n)\n\n// Types of game controller inputs.\nconst (\n\tCONTROLLER_BINDTYPE_NONE   = C.SDL_CONTROLLER_BINDTYPE_NONE\n\tCONTROLLER_BINDTYPE_BUTTON = C.SDL_CONTROLLER_BINDTYPE_BUTTON\n\tCONTROLLER_BINDTYPE_AXIS   = C.SDL_CONTROLLER_BINDTYPE_AXIS\n\tCONTROLLER_BINDTYPE_HAT    = C.SDL_CONTROLLER_BINDTYPE_HAT\n)\n\n// An enumeration of axes available from a controller.\n// (https://wiki.libsdl.org/SDL_GameControllerAxis)\nconst (\n\tCONTROLLER_AXIS_INVALID      = C.SDL_CONTROLLER_AXIS_INVALID\n\tCONTROLLER_AXIS_LEFTX        = C.SDL_CONTROLLER_AXIS_LEFTX\n\tCONTROLLER_AXIS_LEFTY        = C.SDL_CONTROLLER_AXIS_LEFTY\n\tCONTROLLER_AXIS_RIGHTX       = C.SDL_CONTROLLER_AXIS_RIGHTX\n\tCONTROLLER_AXIS_RIGHTY       = C.SDL_CONTROLLER_AXIS_RIGHTY\n\tCONTROLLER_AXIS_TRIGGERLEFT  = C.SDL_CONTROLLER_AXIS_TRIGGERLEFT\n\tCONTROLLER_AXIS_TRIGGERRIGHT = C.SDL_CONTROLLER_AXIS_TRIGGERRIGHT\n\tCONTROLLER_AXIS_MAX          = C.SDL_CONTROLLER_AXIS_MAX\n)\n\n// An enumeration of buttons available from a controller.\n// (https://wiki.libsdl.org/SDL_GameControllerButton)\nconst (\n\tCONTROLLER_BUTTON_INVALID       = C.SDL_CONTROLLER_BUTTON_INVALID\n\tCONTROLLER_BUTTON_A             = C.SDL_CONTROLLER_BUTTON_A\n\tCONTROLLER_BUTTON_B             = C.SDL_CONTROLLER_BUTTON_B\n\tCONTROLLER_BUTTON_X             = C.SDL_CONTROLLER_BUTTON_X\n\tCONTROLLER_BUTTON_Y             = C.SDL_CONTROLLER_BUTTON_Y\n\tCONTROLLER_BUTTON_BACK          = C.SDL_CONTROLLER_BUTTON_BACK\n\tCONTROLLER_BUTTON_GUIDE         = C.SDL_CONTROLLER_BUTTON_GUIDE\n\tCONTROLLER_BUTTON_START         = C.SDL_CONTROLLER_BUTTON_START\n\tCONTROLLER_BUTTON_LEFTSTICK     = C.SDL_CONTROLLER_BUTTON_LEFTSTICK\n\tCONTROLLER_BUTTON_RIGHTSTICK    = C.SDL_CONTROLLER_BUTTON_RIGHTSTICK\n\tCONTROLLER_BUTTON_LEFTSHOULDER  = C.SDL_CONTROLLER_BUTTON_LEFTSHOULDER\n\tCONTROLLER_BUTTON_RIGHTSHOULDER = C.SDL_CONTROLLER_BUTTON_RIGHTSHOULDER\n\tCONTROLLER_BUTTON_DPAD_UP       = C.SDL_CONTROLLER_BUTTON_DPAD_UP\n\tCONTROLLER_BUTTON_DPAD_DOWN     = C.SDL_CONTROLLER_BUTTON_DPAD_DOWN\n\tCONTROLLER_BUTTON_DPAD_LEFT     = C.SDL_CONTROLLER_BUTTON_DPAD_LEFT\n\tCONTROLLER_BUTTON_DPAD_RIGHT    = C.SDL_CONTROLLER_BUTTON_DPAD_RIGHT\n\tCONTROLLER_BUTTON_MAX           = C.SDL_CONTROLLER_BUTTON_MAX\n)\n\n// GameControllerBindType is a type of game controller input.\ntype GameControllerBindType C.SDL_GameControllerBindType\n\n// GameControllerAxis is an axis on a game controller.\n// (https://wiki.libsdl.org/SDL_GameControllerAxis)\ntype GameControllerAxis C.SDL_GameControllerAxis\n\n// GameControllerButton is a button on a game controller.\n// (https://wiki.libsdl.org/SDL_GameControllerButton)\ntype GameControllerButton C.SDL_GameControllerButton\n\n// GameController used to identify an SDL game controller.\ntype GameController C.SDL_GameController\n\n// GameControllerButtonBind SDL joystick layer binding for controller button/axis mapping.\ntype GameControllerButtonBind C.SDL_GameControllerButtonBind\n\nfunc (ctrl *GameController) cptr() *C.SDL_GameController {\n\treturn (*C.SDL_GameController)(unsafe.Pointer(ctrl))\n}\n\nfunc (axis GameControllerAxis) c() C.SDL_GameControllerAxis {\n\treturn C.SDL_GameControllerAxis(axis)\n}\n\nfunc (btn GameControllerButton) c() C.SDL_GameControllerButton {\n\treturn C.SDL_GameControllerButton(btn)\n}\n\n// GameControllerAddMapping adds support for controllers that SDL is unaware of or to cause an existing controller to have a different binding.\n// (https://wiki.libsdl.org/SDL_GameControllerAddMapping)\nfunc GameControllerAddMapping(mappingString string) int {\n\t_mappingString := C.CString(mappingString)\n\tdefer C.free(unsafe.Pointer(_mappingString))\n\treturn int(C.SDL_GameControllerAddMapping(_mappingString))\n}\n\n// GameControllerNumMappings returns the number of mappings installed.\nfunc GameControllerNumMappings() int {\n\treturn int(C.SDL_GameControllerNumMappings())\n}\n\n// GameControllerMappingForIndex returns the game controller mapping string at a particular index.\nfunc GameControllerMappingForIndex(index int) string {\n\tmappingString := C.SDL_GameControllerMappingForIndex(C.int(index))\n\tdefer C.free(unsafe.Pointer(mappingString))\n\treturn C.GoString(mappingString)\n}\n\n// GameControllerMappingForGUID returns the game controller mapping string for a given GUID.\n// (https://wiki.libsdl.org/SDL_GameControllerMappingForGUID)\nfunc GameControllerMappingForGUID(guid JoystickGUID) string {\n\tmappingString := C.SDL_GameControllerMappingForGUID(guid.c())\n\tdefer C.free(unsafe.Pointer(mappingString))\n\treturn C.GoString(mappingString)\n}\n\n// IsGameController reports whether the given joystick is supported by the game controller interface.\n// (https://wiki.libsdl.org/SDL_IsGameController)\nfunc IsGameController(index int) bool {\n\treturn C.SDL_IsGameController(C.int(index)) == C.SDL_TRUE\n}\n\n// GameControllerNameForIndex returns the implementation dependent name for the game controller.\n// (https://wiki.libsdl.org/SDL_GameControllerNameForIndex)\nfunc GameControllerNameForIndex(index int) string {\n\treturn C.GoString(C.SDL_GameControllerNameForIndex(C.int(index)))\n}\n\n// GameControllerMappingForDeviceIndex returns the game controller mapping string at a particular index.\nfunc GameControllerMappingForDeviceIndex(index int) string {\n\tmappingString := C.SDL_GameControllerMappingForDeviceIndex(C.int(index))\n\tdefer C.free(unsafe.Pointer(mappingString))\n\treturn C.GoString(mappingString)\n}\n\n// GameControllerOpen opens a gamecontroller for use.\n// (https://wiki.libsdl.org/SDL_GameControllerOpen)\nfunc GameControllerOpen(index int) *GameController {\n\treturn (*GameController)(C.SDL_GameControllerOpen(C.int(index)))\n}\n\n// GameControllerFromInstanceID returns the GameController associated with an instance id.\n// (https://wiki.libsdl.org/SDL_GameControllerFromInstanceID)\nfunc GameControllerFromInstanceID(joyid JoystickID) *GameController {\n\treturn (*GameController)(C.SDL_GameControllerFromInstanceID(joyid.c()))\n}\n\n// Name returns the implementation dependent name for an opened game controller.\n// (https://wiki.libsdl.org/SDL_GameControllerName)\nfunc (ctrl *GameController) Name() string {\n\treturn C.GoString(C.SDL_GameControllerName(ctrl.cptr()))\n}\n\n// PlayerIndex the player index of an opened game controller, or -1 if it's not available.\n// TODO: (https://wiki.libsdl.org/SDL_GameControllerGetPlayerIndex)\nfunc (ctrl *GameController) PlayerIndex() int {\n\treturn int(C.SDL_GameControllerGetPlayerIndex(ctrl.cptr()))\n}\n\n// Vendor returns the USB vendor ID of an opened controller, if available, 0 otherwise.\nfunc (ctrl *GameController) Vendor() int {\n\treturn int(C.SDL_GameControllerGetVendor(ctrl.cptr()))\n}\n\n// Product returns the USB product ID of an opened controller, if available, 0 otherwise.\nfunc (ctrl *GameController) Product() int {\n\treturn int(C.SDL_GameControllerGetProduct(ctrl.cptr()))\n}\n\n// ProductVersion returns the product version of an opened controller, if available, 0 otherwise.\nfunc (ctrl *GameController) ProductVersion() int {\n\treturn int(C.SDL_GameControllerGetProductVersion(ctrl.cptr()))\n}\n\n// Attached reports whether a controller has been opened and is currently connected.\n// (https://wiki.libsdl.org/SDL_GameControllerGetAttached)\nfunc (ctrl *GameController) Attached() bool {\n\treturn C.SDL_GameControllerGetAttached(ctrl.cptr()) == C.SDL_TRUE\n}\n\n// Mapping returns the current mapping of a Game Controller.\n// (https://wiki.libsdl.org/SDL_GameControllerMapping)\nfunc (ctrl *GameController) Mapping() string {\n\tmappingString := C.SDL_GameControllerMapping(ctrl.cptr())\n\tdefer C.free(unsafe.Pointer(mappingString))\n\treturn C.GoString(mappingString)\n}\n\n// Joystick returns the Joystick ID from a Game Controller. The game controller builds on the Joystick API, but to be able to use the Joystick's functions with a gamepad, you need to use this first to get the joystick object.\n// (https://wiki.libsdl.org/SDL_GameControllerGetJoystick)\nfunc (ctrl *GameController) Joystick() *Joystick {\n\treturn (*Joystick)(unsafe.Pointer(C.SDL_GameControllerGetJoystick(ctrl.cptr())))\n}\n\n// GameControllerEventState returns the current state of, enable, or disable events dealing with Game Controllers. This will not disable Joystick events, which can also be fired by a controller (see https://wiki.libsdl.org/SDL_JoystickEventState).\n// (https://wiki.libsdl.org/SDL_GameControllerEventState)\nfunc GameControllerEventState(state int) int {\n\treturn int(C.SDL_GameControllerEventState(C.int(state)))\n}\n\n// GameControllerUpdate manually pumps game controller updates if not using the loop.\n// (https://wiki.libsdl.org/SDL_GameControllerUpdate)\nfunc GameControllerUpdate() {\n\tC.SDL_GameControllerUpdate()\n}\n\n// GameControllerGetAxisFromString converts a string into an enum representation for a GameControllerAxis.\n// (https://wiki.libsdl.org/SDL_GameControllerGetAxisFromString)\nfunc GameControllerGetAxisFromString(pchString string) GameControllerAxis {\n\t_pchString := C.CString(pchString)\n\tdefer C.free(unsafe.Pointer(_pchString))\n\treturn GameControllerAxis(C.SDL_GameControllerGetAxisFromString(_pchString))\n}\n\n// GameControllerGetStringForAxis converts from an axis enum to a string.\n// (https://wiki.libsdl.org/SDL_GameControllerGetStringForAxis)\nfunc GameControllerGetStringForAxis(axis GameControllerAxis) string {\n\treturn C.GoString(C.SDL_GameControllerGetStringForAxis(axis.c()))\n}\n\n// BindForAxis returns the SDL joystick layer binding for a controller button mapping.\n// (https://wiki.libsdl.org/SDL_GameControllerGetBindForAxis)\nfunc (ctrl *GameController) BindForAxis(axis GameControllerAxis) GameControllerButtonBind {\n\treturn GameControllerButtonBind(C.SDL_GameControllerGetBindForAxis(ctrl.cptr(), axis.c()))\n}\n\n// Axis returns the current state of an axis control on a game controller.\n// (https://wiki.libsdl.org/SDL_GameControllerGetAxis)\nfunc (ctrl *GameController) Axis(axis GameControllerAxis) int16 {\n\treturn int16(C.SDL_GameControllerGetAxis(ctrl.cptr(), axis.c()))\n}\n\n// GameControllerGetButtonFromString turns a string into a button mapping.\n// (https://wiki.libsdl.org/SDL_GameControllerGetButtonFromString)\nfunc GameControllerGetButtonFromString(pchString string) GameControllerButton {\n\t_pchString := C.CString(pchString)\n\tdefer C.free(unsafe.Pointer(_pchString))\n\treturn GameControllerButton(C.SDL_GameControllerGetButtonFromString(_pchString))\n}\n\n// GameControllerGetStringForButton turns a button enum into a string mapping.\n// (https://wiki.libsdl.org/SDL_GameControllerGetStringForButton)\nfunc GameControllerGetStringForButton(btn GameControllerButton) string {\n\treturn C.GoString(C.SDL_GameControllerGetStringForButton(btn.c()))\n}\n\n// BindForButton returns the SDL joystick layer binding for this controller button mapping.\n// (https://wiki.libsdl.org/SDL_GameControllerGetBindForButton)\nfunc (ctrl *GameController) BindForButton(btn GameControllerButton) GameControllerButtonBind {\n\treturn GameControllerButtonBind(C.SDL_GameControllerGetBindForButton(ctrl.cptr(), btn.c()))\n}\n\n// Rumble triggers a rumble effect\n// Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.\n//\n// lowFrequencyRumble - The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF\n// highFrequencyRumble - The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF\n// durationMS - The duration of the rumble effect, in milliseconds\n//\n// Returns error if rumble isn't supported on this joystick.\n//\n// TODO: (https://wiki.libsdl.org/SDL_GameControllerRumble)\nfunc (ctrl *GameController) Rumble(lowFrequencyRumble, highFrequencyRumble uint16, durationMS uint32) error {\n\treturn errorFromInt(int(C.SDL_GameControllerRumble(ctrl.cptr(), C.Uint16(lowFrequencyRumble), C.Uint16(highFrequencyRumble), C.Uint32(durationMS))))\n}\n\n// Button returns the current state of a button on a game controller.\n// (https://wiki.libsdl.org/SDL_GameControllerGetButton)\nfunc (ctrl *GameController) Button(btn GameControllerButton) byte {\n\treturn byte(C.SDL_GameControllerGetButton(ctrl.cptr(), btn.c()))\n}\n\n// Close closes a game controller previously opened with GameControllerOpen().\n// (https://wiki.libsdl.org/SDL_GameControllerClose)\nfunc (ctrl *GameController) Close() {\n\tC.SDL_GameControllerClose(ctrl.cptr())\n}\n\n// Type returns the type of game controller input for this SDL joystick layer binding.\nfunc (bind *GameControllerButtonBind) Type() int {\n\treturn int(bind.bindType)\n}\n\n// Button returns button mapped for this SDL joystick layer binding.\nfunc (bind *GameControllerButtonBind) Button() int {\n\tval, _ := binary.Varint(bind.value[:4])\n\treturn int(val)\n}\n\n// Axis returns axis mapped for this SDL joystick layer binding.\nfunc (bind *GameControllerButtonBind) Axis() int {\n\tval, _ := binary.Varint(bind.value[:4])\n\treturn int(val)\n}\n\n// Hat returns hat mapped for this SDL joystick layer binding.\nfunc (bind *GameControllerButtonBind) Hat() int {\n\tval, _ := binary.Varint(bind.value[:4])\n\treturn int(val)\n}\n\n// HatMask returns hat mask for this SDL joystick layer binding.\nfunc (bind *GameControllerButtonBind) HatMask() int {\n\tval, _ := binary.Varint(bind.value[4:8])\n\treturn int(val)\n}\n\n// SendEffect sends a controller specific effect packet.\n// (https://wiki.libsdl.org/SDL_GameControllerSendEffect)\nfunc (ctrl *GameController) SendEffect(data []byte) (err error) {\n\t_size := C.int(len(data))\n\treturn errorFromInt(int(C.SDL_GameControllerSendEffect(ctrl.cptr(), unsafe.Pointer(&data[0]), _size)))\n}\n\n// GetSensorDataRate gets the data rate (number of events per second) of a game controller sensor.\n// (https://wiki.libsdl.org/SDL_GameControllerGetSensorDataRate)\nfunc (ctrl *GameController) SensorDataRate(typ SensorType) (rate float32) {\n\treturn float32(C.SDL_GameControllerGetSensorDataRate(ctrl.cptr(), C.SDL_SensorType(typ)))\n}\n\n// HasRumble queries whether a game controller has rumble support.\n// (https://wiki.libsdl.org/SDL_GameControllerHasRumble)\nfunc (ctrl *GameController) HasRumble() bool {\n\treturn C.SDL_GameControllerHasRumble(ctrl.cptr()) == C.SDL_TRUE\n}\n\n// HasRumbleTriggers queries whether a game controller has rumble support on triggers.\n// (https://wiki.libsdl.org/SDL_GameControllerHasRumbleTriggers)\nfunc (ctrl *GameController) HasRumbleTriggers() bool {\n\treturn C.SDL_GameControllerHasRumbleTriggers(ctrl.cptr()) == C.SDL_TRUE\n}\n\n// GetAppleSFSymbolsNameForButton returns the sfSymbolsName for a given button on a game controller on Apple platforms.\n// (https://wiki.libsdl.org/SDL_GameControllerGetAppleSFSymbolsNameForButton)\nfunc (ctrl *GameController) GetAppleSFSymbolsNameForButton(button GameControllerButton) (sfSymbolsName string) {\n\t_button := C.SDL_GameControllerButton(button)\n\t_sfSymbolsName := C.SDL_GameControllerGetAppleSFSymbolsNameForButton(ctrl.cptr(), _button)\n\tsfSymbolsName = C.GoString(_sfSymbolsName)\n\treturn\n}\n\n// GetAppleSFSymbolsNameForAxis returns the sfSymbolsName for a given axis on a game controller on Apple platforms.\n// (https://wiki.libsdl.org/SDL_GameControllerGetAppleSFSymbolsNameForAxis)\nfunc (ctrl *GameController) SDL_GameControllerGetAppleSFSymbolsNameForAxis(axis GameControllerAxis) (sfSymbolsName string) {\n\t_axis := C.SDL_GameControllerAxis(axis)\n\t_sfSymbolsName := C.SDL_GameControllerGetAppleSFSymbolsNameForAxis(ctrl.cptr(), _axis)\n\tsfSymbolsName = C.GoString(_sfSymbolsName)\n\treturn\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/gesture.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\n\n// GestureID is the unique id of the closest gesture to the performed stroke.\ntype GestureID C.SDL_GestureID\n\nfunc (g GestureID) c() C.SDL_GestureID {\n\treturn C.SDL_GestureID(g)\n}\n\n// RecordGesture begins recording a gesture on a specified touch device or all touch devices.\n// (https://wiki.libsdl.org/SDL_RecordGesture)\nfunc RecordGesture(t TouchID) int {\n\treturn int(C.SDL_RecordGesture(t.c()))\n}\n\n// SaveAllDollarTemplates saves all currently loaded Dollar Gesture templates.\n// (https://wiki.libsdl.org/SDL_SaveAllDollarTemplates)\nfunc SaveAllDollarTemplates(src *RWops) int {\n\treturn int(C.SDL_SaveAllDollarTemplates(src.cptr()))\n}\n\n// SaveDollarTemplate saves a currently loaded Dollar Gesture template.\n// (https://wiki.libsdl.org/SDL_SaveDollarTemplate)\nfunc SaveDollarTemplate(g GestureID, src *RWops) int {\n\treturn int(C.SDL_SaveDollarTemplate(g.c(), src.cptr()))\n}\n\n// LoadDollarTemplates loads Dollar Gesture templates from a file.\n// (https://wiki.libsdl.org/SDL_LoadDollarTemplates)\nfunc LoadDollarTemplates(t TouchID, src *RWops) int {\n\treturn int(C.SDL_LoadDollarTemplates(t.c(), src.cptr()))\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/guid.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !SDL_VERSION_ATLEAST(2,24,0)\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GUIDToString is not supported before SDL 2.24.0\")\n#pragma message(\"SDL_GUIDFromString is not supported before SDL 2.24.0\")\n#endif\n\ntypedef struct {\n    Uint8 data[16];\n} SDL_GUID;\n\nstatic inline void SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID)\n{\n\treturn;\n}\n\nstatic inline SDL_GUID SDL_GUIDFromString(const char *pchGUID)\n{\n\tSDL_GUID guid;\n\treturn guid;\n}\n#endif\n*/\nimport \"C\"\nimport (\n\t\"unsafe\"\n)\n\ntype GUID C.SDL_GUID\n\n// ToString returns an ASCII string representation for a given GUID.\nfunc (guid GUID) ToString() (ascii string) {\n\t_cap := C.size_t(33)\n\t_buf := (*C.char)(C.SDL_malloc(_cap))\n\tdefer C.SDL_free(unsafe.Pointer(_buf))\n\tC.SDL_GUIDToString(C.SDL_GUID(guid), _buf, C.int(_cap))\n\treturn C.GoString(_buf)\n}\n\n// GUIDFromString converts a GUID string into a GUID structure.\nfunc GUIDFromString(ascii string) (guid GUID) {\n\t_ascii := C.CString(ascii)\n\treturn GUID(C.SDL_GUIDFromString(_ascii))\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/haptic.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\nimport \"unsafe\"\n\n// Haptic effects.\n// (https://wiki.libsdl.org/SDL_HapticEffect)\nconst (\n\tHAPTIC_CONSTANT     = C.SDL_HAPTIC_CONSTANT     // constant haptic effect\n\tHAPTIC_SINE         = C.SDL_HAPTIC_SINE         // periodic haptic effect that simulates sine waves\n\tHAPTIC_LEFTRIGHT    = C.SDL_HAPTIC_LEFTRIGHT    // haptic effect for direct control over high/low frequency motors\n\tHAPTIC_TRIANGLE     = C.SDL_HAPTIC_TRIANGLE     // periodic haptic effect that simulates triangular waves\n\tHAPTIC_SAWTOOTHUP   = C.SDL_HAPTIC_SAWTOOTHUP   // periodic haptic effect that simulates saw tooth up waves\n\tHAPTIC_SAWTOOTHDOWN = C.SDL_HAPTIC_SAWTOOTHDOWN // periodic haptic effect that simulates saw tooth down waves\n\tHAPTIC_RAMP         = C.SDL_HAPTIC_RAMP         // ramp haptic effect\n\tHAPTIC_SPRING       = C.SDL_HAPTIC_SPRING       // condition haptic effect that simulates a spring.  Effect is based on the axes position\n\tHAPTIC_DAMPER       = C.SDL_HAPTIC_DAMPER       // condition haptic effect that simulates dampening.  Effect is based on the axes velocity\n\tHAPTIC_INERTIA      = C.SDL_HAPTIC_INERTIA      // condition haptic effect that simulates inertia.  Effect is based on the axes acceleration\n\tHAPTIC_FRICTION     = C.SDL_HAPTIC_FRICTION     // condition haptic effect that simulates friction.  Effect is based on the axes movement\n\tHAPTIC_CUSTOM       = C.SDL_HAPTIC_CUSTOM       // user defined custom haptic effect\n\tHAPTIC_GAIN         = C.SDL_HAPTIC_GAIN         // device supports setting the global gain\n\tHAPTIC_AUTOCENTER   = C.SDL_HAPTIC_AUTOCENTER   // device supports setting autocenter\n\tHAPTIC_STATUS       = C.SDL_HAPTIC_STATUS       // device can be queried for effect status\n\tHAPTIC_PAUSE        = C.SDL_HAPTIC_PAUSE        // device can be paused\n\t//HAPTIC_SQUARE = C.SDL_HAPTIC_SQUARE (back in SDL 2.1)\n)\n\n// Direction encodings.\n// (https://wiki.libsdl.org/SDL_HapticDirection)\nconst (\n\tHAPTIC_POLAR     = C.SDL_HAPTIC_POLAR     // uses polar coordinates for the direction\n\tHAPTIC_CARTESIAN = C.SDL_HAPTIC_CARTESIAN // uses cartesian coordinates for the direction\n\tHAPTIC_SPHERICAL = C.SDL_HAPTIC_SPHERICAL // uses spherical coordinates for the direction\n\tHAPTIC_INFINITY  = C.SDL_HAPTIC_INFINITY  // used to play a device an infinite number of times\n)\n\n// Haptic identifies an SDL haptic.\n// (https://wiki.libsdl.org/CategoryForceFeedback)\ntype Haptic C.SDL_Haptic\n\n// HapticDirection contains a haptic direction.\n// (https://wiki.libsdl.org/SDL_HapticDirection)\ntype HapticDirection struct {\n\tType byte     // the type of encoding\n\tDir  [3]int32 // the encoded direction\n}\n\n// HapticConstant contains a template for a constant effect.\n// (https://wiki.libsdl.org/SDL_HapticConstant)\ntype HapticConstant struct {\n\tType         uint16          // HAPTIC_CONSTANT\n\tDirection    HapticDirection // direction of the effect\n\tLength       uint32          // duration of the effect\n\tDelay        uint16          // delay before starting the effect\n\tButton       uint16          // button that triggers the effect\n\tInterval     uint16          // how soon it can be triggered again after button\n\tLevel        int16           // strength of the constant effect\n\tAttackLength uint16          // duration of the attack\n\tAttackLevel  uint16          // level at the start of the attack\n\tFadeLength   uint16          // duration of the fade\n\tFadeLevel    uint16          // level at the end of the fade\n}\n\nfunc (he *HapticConstant) cHapticEffect() *C.SDL_HapticEffect {\n\treturn (*C.SDL_HapticEffect)(unsafe.Pointer(he))\n}\n\n// HapticPeriodic contains a template for a periodic effect.\n// (https://wiki.libsdl.org/SDL_HapticPeriodic)\ntype HapticPeriodic struct {\n\tType         uint16          // HAPTIC_SINE, HAPTIC_LEFTRIGHT, HAPTIC_TRIANGLE, HAPTIC_SAWTOOTHUP, HAPTIC_SAWTOOTHDOWN\n\tDirection    HapticDirection // direction of the effect\n\tLength       uint32          // duration of the effect\n\tDelay        uint16          // delay before starting the effect\n\tButton       uint16          // button that triggers the effect\n\tInterval     uint16          // how soon it can be triggered again after button\n\tPeriod       uint16          // period of the wave\n\tMagnitude    int16           // peak value; if negative, equivalent to 180 degrees extra phase shift\n\tOffset       int16           // mean value of the wave\n\tPhase        uint16          // positive phase shift given by hundredth of a degree\n\tAttackLength uint16          // duration of the attack\n\tAttackLevel  uint16          // level at the start of the attack\n\tFadeLength   uint16          // duration of the fade\n\tFadeLevel    uint16          // level at the end of the fade\n}\n\nfunc (he *HapticPeriodic) cHapticEffect() *C.SDL_HapticEffect {\n\treturn (*C.SDL_HapticEffect)(unsafe.Pointer(he))\n}\n\n// HapticCondition contains a template for a condition effect.\n// (https://wiki.libsdl.org/SDL_HapticCondition)\ntype HapticCondition struct {\n\tType       uint16          // HAPTIC_SPRING, HAPTIC_DAMPER, HAPTIC_INERTIA, HAPTIC_FRICTION\n\tDirection  HapticDirection // direction of the effect - not used at the moment\n\tLength     uint32          // duration of the effect\n\tDelay      uint16          // delay before starting the effect\n\tButton     uint16          // button that triggers the effect\n\tInterval   uint16          // how soon it can be triggered again after button\n\tRightSat   [3]uint16       // level when joystick is to the positive side; max 0xFFFF\n\tLeftSat    [3]uint16       // level when joystick is to the negative side; max 0xFFFF\n\tRightCoeff [3]int16        // how fast to increase the force towards the positive side\n\tLeftCoeff  [3]int16        // how fast to increase the force towards the negative side\n\tDeadband   [3]uint16       // size of the dead zone; max 0xFFFF: whole axis-range when 0-centered\n\tCenter     [3]int16        // position of the dead zone\n}\n\nfunc (he *HapticCondition) cHapticEffect() *C.SDL_HapticEffect {\n\treturn (*C.SDL_HapticEffect)(unsafe.Pointer(he))\n}\n\n// HapticRamp contains a template for a ramp effect.\n// (https://wiki.libsdl.org/SDL_HapticRamp)\ntype HapticRamp struct {\n\tType         uint16          // HAPTIC_RAMP\n\tDirection    HapticDirection // direction of the effect\n\tLength       uint32          // duration of the effect\n\tDelay        uint16          // delay before starting the effect\n\tButton       uint16          // button that triggers the effect\n\tInterval     uint16          // how soon it can be triggered again after button\n\tStart        int16           // beginning strength level\n\tEnd          int16           // ending strength level\n\tAttackLength uint16          // duration of the attack\n\tAttackLevel  uint16          // level at the start of the attack\n\tFadeLength   uint16          // duration of the fade\n\tFadeLevel    uint16          // level at the end of the fade\n}\n\nfunc (he *HapticRamp) cHapticEffect() *C.SDL_HapticEffect {\n\treturn (*C.SDL_HapticEffect)(unsafe.Pointer(he))\n}\n\n// HapticLeftRight contains a template for a left/right effect.\n// (https://wiki.libsdl.org/SDL_HapticLeftRight)\ntype HapticLeftRight struct {\n\tType           uint16 // HAPTIC_LEFTRIGHT\n\tLength         uint32 // duration of the effect\n\tLargeMagnitude uint16 // control of the large controller motor\n\tSmallMagnitude uint16 // control of the small controller motor\n}\n\nfunc (he *HapticLeftRight) cHapticEffect() *C.SDL_HapticEffect {\n\treturn (*C.SDL_HapticEffect)(unsafe.Pointer(he))\n}\n\n// HapticCustom contains a template for a custom effect.\n// (https://wiki.libsdl.org/SDL_HapticCustom)\ntype HapticCustom struct {\n\tType         uint16          // SDL_HAPTIC_CUSTOM\n\tDirection    HapticDirection // direction of the effect\n\tLength       uint32          // duration of the effect\n\tDelay        uint16          // delay before starting the effect\n\tButton       uint16          // button that triggers the effect\n\tInterval     uint16          // how soon it can be triggered again after button\n\tChannels     uint8           // axes to use, minimum of 1\n\tPeriod       uint16          // sample periods\n\tSamples      uint16          // amount of samples\n\tData         *uint16         // should contain channels*samples items\n\tAttackLength uint16          // duration of the attack\n\tAttackLevel  uint16          // level at the start of the attack\n\tFadeLength   uint16          // duration of the fade\n\tFadeLevel    uint16          // level at the end of the fade\n}\n\nfunc (he *HapticCustom) cHapticEffect() *C.SDL_HapticEffect {\n\treturn (*C.SDL_HapticEffect)(unsafe.Pointer(he))\n}\n\n// HapticEffect union that contains the generic template for any haptic effect.\n// (https://wiki.libsdl.org/SDL_HapticEffect)\ntype HapticEffect interface {\n\tcHapticEffect() *C.SDL_HapticEffect\n}\n\nfunc (h *Haptic) cptr() *C.SDL_Haptic {\n\treturn (*C.SDL_Haptic)(unsafe.Pointer(h))\n}\n\n// NumHaptics returns the number of haptic devices attached to the system.\n// (https://wiki.libsdl.org/SDL_NumHaptics)\nfunc NumHaptics() (int, error) {\n\ti := int(C.SDL_NumHaptics())\n\treturn i, errorFromInt(i)\n}\n\n// HapticName returns the implementation dependent name of a haptic device.\n// (https://wiki.libsdl.org/SDL_HapticName)\nfunc HapticName(index int) (string, error) {\n\tname := C.SDL_HapticName(C.int(index))\n\tif name == nil {\n\t\treturn \"\", GetError()\n\t}\n\treturn C.GoString(name), nil\n}\n\n// HapticOpen opens a haptic device for use.\n// (https://wiki.libsdl.org/SDL_HapticOpen)\nfunc HapticOpen(index int) (*Haptic, error) {\n\thaptic := (*Haptic)(unsafe.Pointer(C.SDL_HapticOpen(C.int(index))))\n\tif haptic == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn haptic, nil\n}\n\n// HapticOpened reports whether the haptic device at the designated index has been opened.\n// (https://wiki.libsdl.org/SDL_HapticOpened)\nfunc HapticOpened(index int) (bool, error) {\n\tret := int(C.SDL_HapticOpened(C.int(index)))\n\tif ret == 0 {\n\t\treturn false, GetError()\n\t}\n\treturn ret == 1, nil\n}\n\n// HapticIndex returns the index of a haptic device.\n// (https://wiki.libsdl.org/SDL_HapticIndex)\nfunc HapticIndex(h *Haptic) (int, error) {\n\ti := int(C.SDL_HapticIndex(h.cptr()))\n\treturn i, errorFromInt(i)\n}\n\n// MouseIsHaptic reports whether or not the current mouse has haptic capabilities.\n// (https://wiki.libsdl.org/SDL_MouseIsHaptic)\nfunc MouseIsHaptic() (bool, error) {\n\tret := int(C.SDL_MouseIsHaptic())\n\treturn ret == C.SDL_TRUE, errorFromInt(ret)\n}\n\n// HapticOpenFromMouse open a haptic device from the current mouse.\n// (https://wiki.libsdl.org/SDL_HapticOpenFromMouse)\nfunc HapticOpenFromMouse() (*Haptic, error) {\n\thaptic := (*Haptic)(unsafe.Pointer(C.SDL_HapticOpenFromMouse()))\n\tif haptic == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn haptic, nil\n}\n\n// JoystickIsHaptic reports whether a joystick has haptic features.\n// (https://wiki.libsdl.org/SDL_JoystickIsHaptic)\nfunc JoystickIsHaptic(joy *Joystick) (bool, error) {\n\tret := int(C.SDL_JoystickIsHaptic(joy.cptr()))\n\treturn ret == C.SDL_TRUE, errorFromInt(ret)\n}\n\n// HapticOpenFromJoystick opens a haptic device for use from a joystick device.\n// (https://wiki.libsdl.org/SDL_HapticOpenFromJoystick)\nfunc HapticOpenFromJoystick(joy *Joystick) (*Haptic, error) {\n\thaptic := (*Haptic)(unsafe.Pointer(C.SDL_HapticOpenFromJoystick(joy.cptr())))\n\tif haptic == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn haptic, nil\n}\n\n// Close closes a haptic device previously opened with HapticOpen().\n// (https://wiki.libsdl.org/SDL_HapticClose)\nfunc (h *Haptic) Close() {\n\tC.SDL_HapticClose(h.cptr())\n}\n\n// NumAxes returns the number of haptic axes the device has.\n// (https://wiki.libsdl.org/SDL_HapticNumAxes)\nfunc (h *Haptic) NumAxes() (int, error) {\n\ti := int(C.SDL_HapticNumAxes(h.cptr()))\n\treturn i, errorFromInt(i)\n}\n\n// NumEffects returns the number of effects a haptic device can store.\n// (https://wiki.libsdl.org/SDL_HapticNumEffects)\nfunc (h *Haptic) NumEffects() (int, error) {\n\ti := int(C.SDL_HapticNumEffects(h.cptr()))\n\treturn i, errorFromInt(i)\n}\n\n// NumEffectsPlaying returns the number of effects a haptic device can play at the same time.\n// (https://wiki.libsdl.org/SDL_HapticNumEffectsPlaying)\nfunc (h *Haptic) NumEffectsPlaying() (int, error) {\n\ti := int(C.SDL_HapticNumEffectsPlaying(h.cptr()))\n\treturn i, errorFromInt(i)\n}\n\n// Query returns haptic device's supported features in bitwise manner.\n// (https://wiki.libsdl.org/SDL_HapticQuery)\nfunc (h *Haptic) Query() (uint32, error) {\n\ti := uint32(C.SDL_HapticQuery(h.cptr()))\n\tif i == 0 {\n\t\treturn 0, GetError()\n\t}\n\treturn i, nil\n}\n\n// EffectSupported reports whether an effect is supported by a haptic device.\n// Pass pointer to a Haptic struct (Constant|Periodic|Condition|Ramp|LeftRight|Custom) instead of HapticEffect union.\n// (https://wiki.libsdl.org/SDL_HapticEffectSupported)\nfunc (h *Haptic) EffectSupported(he HapticEffect) (bool, error) {\n\tret := int(C.SDL_HapticEffectSupported(\n\t\th.cptr(),\n\t\the.cHapticEffect()))\n\treturn ret == C.SDL_TRUE, errorFromInt(ret)\n}\n\n// NewEffect creates a new haptic effect on a specified device.\n// Pass pointer to a Haptic struct (Constant|Periodic|Condition|Ramp|LeftRight|Custom) instead of HapticEffect union.\n// (https://wiki.libsdl.org/SDL_HapticNewEffect)\nfunc (h *Haptic) NewEffect(he HapticEffect) (int, error) {\n\tret := int(C.SDL_HapticNewEffect(\n\t\th.cptr(),\n\t\the.cHapticEffect()))\n\treturn ret, errorFromInt(ret)\n}\n\n// UpdateEffect updates the properties of an effect.\n// Pass pointer to a Haptic struct (Constant|Periodic|Condition|Ramp|LeftRight|Custom) instead of HapticEffect union.\n// (https://wiki.libsdl.org/SDL_HapticUpdateEffect)\nfunc (h *Haptic) UpdateEffect(effect int, data HapticEffect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticUpdateEffect(\n\t\t\th.cptr(),\n\t\t\tC.int(effect),\n\t\t\tdata.cHapticEffect())))\n}\n\n// RunEffect runs the haptic effect on its associated haptic device.\n// (https://wiki.libsdl.org/SDL_HapticRunEffect)\nfunc (h *Haptic) RunEffect(effect int, iterations uint32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticRunEffect(\n\t\t\th.cptr(),\n\t\t\tC.int(effect),\n\t\t\tC.Uint32(iterations))))\n}\n\n// StopEffect stops the haptic effect on its associated haptic device.\n// (https://wiki.libsdl.org/SDL_HapticStopEffect)\nfunc (h *Haptic) StopEffect(effect int) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticStopEffect(h.cptr(), C.int(effect))))\n}\n\n// DestroyEffect destroys a haptic effect on the device.\n// (https://wiki.libsdl.org/SDL_HapticDestroyEffect)\nfunc (h *Haptic) DestroyEffect(effect int) {\n\tC.SDL_HapticDestroyEffect(h.cptr(), C.int(effect))\n}\n\n// GetEffectStatus returns the status of the current effect on the specified haptic device.\n// (https://wiki.libsdl.org/SDL_HapticGetEffectStatus)\nfunc (h *Haptic) GetEffectStatus(effect int) (int, error) {\n\ti := int(C.SDL_HapticGetEffectStatus(h.cptr(), C.int(effect)))\n\treturn i, errorFromInt(i)\n\n}\n\n// SetGain sets the global gain of the specified haptic device.\n// (https://wiki.libsdl.org/SDL_HapticSetGain)\nfunc (h *Haptic) SetGain(gain int) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticSetGain(h.cptr(), C.int(gain))))\n}\n\n// SetAutocenter sets the global autocenter of the device.\n// (https://wiki.libsdl.org/SDL_HapticSetAutocenter)\nfunc (h *Haptic) SetAutocenter(autocenter int) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticSetAutocenter(h.cptr(), C.int(autocenter))))\n}\n\n// Pause pauses a haptic device.\n// (https://wiki.libsdl.org/SDL_HapticPause)\nfunc (h *Haptic) Pause() error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticPause(h.cptr())))\n}\n\n// Unpause unpauses a haptic device.\n// (https://wiki.libsdl.org/SDL_HapticUnpause)\nfunc (h *Haptic) Unpause() error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticUnpause(h.cptr())))\n}\n\n// StopAll stops all the currently playing effects on a haptic device.\n// (https://wiki.libsdl.org/SDL_HapticStopAll)\nfunc (h *Haptic) StopAll() error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticStopAll(h.cptr())))\n}\n\n// RumbleSupported reports whether rumble is supported on a haptic device.\n// (https://wiki.libsdl.org/SDL_HapticRumbleSupported)\nfunc (h *Haptic) RumbleSupported() (bool, error) {\n\tret := int(C.SDL_HapticRumbleSupported(h.cptr()))\n\treturn ret == C.SDL_TRUE, errorFromInt(ret)\n}\n\n// RumbleInit initializes the haptic device for simple rumble playback.\n// (https://wiki.libsdl.org/SDL_HapticRumbleInit)\nfunc (h *Haptic) RumbleInit() error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticRumbleInit(h.cptr())))\n}\n\n// RumblePlay runs a simple rumble effect on a haptic device.\n// (https://wiki.libsdl.org/SDL_HapticRumblePlay)\nfunc (h *Haptic) RumblePlay(strength float32, length uint32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticRumblePlay(h.cptr(), C.float(strength), C.Uint32(length))))\n}\n\n// RumbleStop stops the simple rumble on a haptic device.\n// (https://wiki.libsdl.org/SDL_HapticRumbleStop)\nfunc (h *Haptic) RumbleStop() error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticRumbleStop(h.cptr())))\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/helpers.go",
    "content": "package sdl\n\n// Btoi returns 0 or 1 according to the value of b.\nfunc Btoi(b bool) int {\n\tif b == true {\n\t\treturn 1\n\t}\n\n\treturn 0\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/hidapi.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,18))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_hid_init is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_exit is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_device_change_count is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_enumerate is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_free_enumeration is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_open is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_open_path is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_write is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_read_timeout is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_read is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_set_nonblocking is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_send_feature_report is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_get_feature_report is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_close is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_get_manufacturer_string is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_get_product_string is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_get_serial_number_string is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_get_indexed_string is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_ble_scan is not supported before SDL 2.0.18\")\n#endif\n\nstruct SDL_hid_device_;\ntypedef struct SDL_hid_device_ SDL_hid_device; // opaque hidapi structure\n\n// hidapi info structure\n// Information about a connected HID device\ntypedef struct SDL_hid_device_info\n{\n    // Platform-specific device path\n    char *path;\n\n    // Device Vendor ID\n    unsigned short vendor_id;\n\n    // Device Product ID\n    unsigned short product_id;\n\n    // Serial Number\n    wchar_t *serial_number;\n\n    // Device Release Number in binary-coded decimal, also known as Device Version Number\n    unsigned short release_number;\n\n    // Manufacturer String\n    wchar_t *manufacturer_string;\n\n    // Product string\n    wchar_t *product_string;\n\n    // Usage Page for this Device/Interface (Windows/Mac only).\n    unsigned short usage_page;\n\n    // Usage for this Device/Interface (Windows/Mac only).\n    unsigned short usage;\n\n    // The USB interface which this logical device represents.\n    // Valid on both Linux implementations in all cases.\n    // Valid on the Windows implementation only if the device\n    // contains more than one interface.\n    int interface_number;\n\n    // Additional information about the USB interface.\n    // Valid on libusb and Android implementations.\n    int interface_class;\n    int interface_subclass;\n    int interface_protocol;\n\n    // Pointer to the next device\n    struct SDL_hid_device_info *next;\n} SDL_hid_device_info;\n\nstatic int SDL_hid_init(void)\n{\n\treturn -1;\n}\n\nstatic int SDL_hid_exit(void)\n{\n\treturn -1;\n}\n\nstatic Uint32 SDL_hid_device_change_count(void)\n{\n\treturn 0;\n}\n\nstatic SDL_hid_device_info * SDL_hid_enumerate(unsigned short vendor_id, unsigned short product_id)\n{\n\treturn NULL;\n}\n\nstatic void SDL_hid_free_enumeration(SDL_hid_device_info *devs)\n{\n}\n\nstatic SDL_hid_device * SDL_hid_open(unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number)\n{\n\treturn NULL;\n}\n\nstatic SDL_hid_device * SDL_hid_open_path(const char *path, int bExclusive)\n{\n\treturn NULL;\n}\n\nstatic int SDL_hid_write(SDL_hid_device *dev, const unsigned char *data, size_t length)\n{\n\treturn -1;\n}\n\nstatic int SDL_hid_read_timeout(SDL_hid_device *dev, unsigned char *data, size_t length, int milliseconds)\n{\n\treturn -1;\n}\n\nstatic int SDL_hid_read(SDL_hid_device *dev, unsigned char *data, size_t length)\n{\n\treturn -1;\n}\n\nstatic int SDL_hid_set_nonblocking(SDL_hid_device *dev, int nonblock)\n{\n\treturn -1;\n}\n\nstatic int SDL_hid_send_feature_report(SDL_hid_device *dev, const unsigned char *data, size_t length)\n{\n\treturn -1;\n}\n\nstatic int SDL_hid_get_feature_report(SDL_hid_device *dev, unsigned char *data, size_t length)\n{\n\treturn -1;\n}\n\nstatic void SDL_hid_close(SDL_hid_device *dev)\n{\n}\n\nstatic int SDL_hid_get_manufacturer_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen)\n{\n\treturn -1;\n}\n\nstatic int SDL_hid_get_product_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen)\n{\n\treturn -1;\n}\n\nstatic int SDL_hid_get_serial_number_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen)\n{\n\treturn -1;\n}\n\nstatic int SDL_hid_get_indexed_string(SDL_hid_device *dev, int string_index, wchar_t *string, size_t maxlen)\n{\n\treturn -1;\n}\n\nstatic void SDL_hid_ble_scan(SDL_bool active)\n{\n}\n\n#endif\n*/\nimport \"C\"\nimport \"unsafe\"\n\ntype HIDDevice C.SDL_hid_device\n\ntype HIDDeviceInfo struct {\n\tpath               *C.char\n\tVendorID           uint16\n\tProductID          uint16\n\tSerialNumber       *C.wchar_t\n\tReleaseNumber      uint16\n\tManufacturerString *C.wchar_t\n\tProductString      *C.wchar_t\n\tUsagePage          uint16\n\tUsage              uint16\n\tInterfaceNumber    int32\n\tInterfaceClass     int32\n\tInterfaceSubclass  int32\n\tInterfaceProtocol  int32\n\tnext               *HIDDeviceInfo\n}\n\nfunc (info *HIDDeviceInfo) Path() string {\n\treturn C.GoString(info.path)\n}\n\n// HIDInit initializes the HIDAPI library.\n// (https://wiki.libsdl.org/SDL_hid_init)\nfunc HIDInit() (err error) {\n\tret := C.SDL_hid_init()\n\treturn errorFromInt(int(ret))\n}\n\n// HIDExit finalizes the HIDAPI library.\n// (https://wiki.libsdl.org/SDL_hid_exit)\nfunc HIDExit() (err error) {\n\tret := C.SDL_hid_exit()\n\treturn errorFromInt(int(ret))\n}\n\n// HIDDeviceChangeCount checks to see if devices may have been added or removed.\n// (https://wiki.libsdl.org/SDL_hid_device_change_count)\nfunc HIDDeviceChangeCount() (n uint32) {\n\treturn uint32(C.SDL_hid_device_change_count())\n}\n\n// HIDEnumerate enumerates the HID devices.\n// (https://wiki.libsdl.org/SDL_hid_enumerate)\nfunc HIDEnumerate(vendorID, productID uint16) (info *HIDDeviceInfo) {\n\t_vendorID := C.Uint16(vendorID)\n\t_productID := C.Uint16(productID)\n\tinfo = (*HIDDeviceInfo)(unsafe.Pointer(C.SDL_hid_enumerate(_vendorID, _productID)))\n\treturn\n}\n\n// HIDFreeEnumeration frees an enumeration Linked List.\n// (https://wiki.libsdl.org/SDL_hid_free_enumeration)\nfunc HIDFreeEnumeration(info *HIDDeviceInfo) {\n\t_info := (*C.SDL_hid_device_info)(unsafe.Pointer(info))\n\tC.SDL_hid_free_enumeration(_info)\n}\n\n// HIDOpen opens a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number.\n// (https://wiki.libsdl.org/SDL_hid_open)\nfunc HIDOpen(vendorID, productID uint16, _serialNumber *C.wchar_t) (device *HIDDevice) {\n\t_vendorID := C.Uint16(vendorID)\n\t_productID := C.Uint16(productID)\n\t_device := C.SDL_hid_open(_vendorID, _productID, _serialNumber)\n\treturn (*HIDDevice)(_device)\n}\n\n// HIDOpenPath opens a HID device by its path name.\n// (https://wiki.libsdl.org/SDL_hid_open_path)\nfunc HIDOpenPath(path string, exclusive bool) (device *HIDDevice) {\n\t_path := C.CString(path)\n\tdefer C.free(unsafe.Pointer(_path))\n\t_exclusive := C.int(0)\n\tif exclusive {\n\t\t_exclusive = C.int(1)\n\t}\n\t_device := C.SDL_hid_open_path(_path, _exclusive)\n\treturn (*HIDDevice)(_device)\n}\n\n// Write writes an Output report to a HID device.\n// (https://wiki.libsdl.org/SDL_hid_write)\nfunc (device *HIDDevice) Write(data []byte) (n int, err error) {\n\t_length := C.size_t(len(data))\n\t_data := (*C.uchar)(unsafe.Pointer(&data[0]))\n\t_device := (*C.SDL_hid_device)(device)\n\tn = int(C.SDL_hid_write(_device, _data, _length))\n\treturn n, errorFromInt(n)\n}\n\n// ReadTimeout reads an Input report from a HID device with timeout.\n// (https://wiki.libsdl.org/SDL_hid_read_timeout)\nfunc (device *HIDDevice) ReadTimeout(data []byte, milliseconds int) (n int, err error) {\n\t_length := C.size_t(len(data))\n\t_data := (*C.uchar)(unsafe.Pointer(&data[0]))\n\t_device := (*C.SDL_hid_device)(device)\n\t_milliseconds := C.int(milliseconds)\n\tn = int(C.SDL_hid_read_timeout(_device, _data, _length, _milliseconds))\n\treturn n, errorFromInt(n)\n}\n\n// Read an Input report from a HID device.\n// (https://wiki.libsdl.org/SDL_hid_read)\nfunc (device *HIDDevice) Read(data []byte) (n int, err error) {\n\t_length := C.size_t(len(data))\n\t_data := (*C.uchar)(unsafe.Pointer(&data[0]))\n\t_device := (*C.SDL_hid_device)(device)\n\tn = int(C.SDL_hid_read(_device, _data, _length))\n\treturn n, errorFromInt(n)\n}\n\n// SetNonBlocking sets the device handle to be non-blocking.\n// (https://wiki.libsdl.org/SDL_hid_set_nonblocking)\nfunc (device *HIDDevice) SetNonBlocking(nonblock bool) (err error) {\n\t_device := (*C.SDL_hid_device)(device)\n\t_nonblock := C.int(Btoi(nonblock))\n\treturn errorFromInt(int(C.SDL_hid_set_nonblocking(_device, _nonblock)))\n}\n\n// SendFeatureReport sends a Feature report to the device.\n// (https://wiki.libsdl.org/SDL_hid_send_feature_report)\nfunc (device *HIDDevice) SendFeatureReport(data []byte) (n int, err error) {\n\t_length := C.size_t(len(data))\n\t_data := (*C.uchar)(unsafe.Pointer(&data[0]))\n\t_device := (*C.SDL_hid_device)(device)\n\tn = int(C.SDL_hid_send_feature_report(_device, _data, _length))\n\treturn n, errorFromInt(n)\n}\n\n// GetFeatureReport gets a feature report from a HID device.\n// (https://wiki.libsdl.org/SDL_hid_get_feature_report)\nfunc (device *HIDDevice) GetFeatureReport(data []byte) (n int, err error) {\n\t_length := C.size_t(len(data))\n\t_data := (*C.uchar)(unsafe.Pointer(&data[0]))\n\t_device := (*C.SDL_hid_device)(device)\n\tn = int(C.SDL_hid_get_feature_report(_device, _data, _length))\n\treturn n, errorFromInt(n)\n}\n\n// Close closes a HID device.\n// (https://wiki.libsdl.org/SDL_hid_close)\nfunc (device *HIDDevice) Close() {\n\t_device := (*C.SDL_hid_device)(device)\n\tC.SDL_hid_close(_device)\n}\n\n// GetManufacturerString gets The Manufacturer String from a HID device.\n// (https://wiki.libsdl.org/SDL_hid_get_manufacturer_string)\nfunc (device *HIDDevice) GetManufacturerString(_str *C.wchar_t, _maxlen C.size_t) (err error) {\n\t_device := (*C.SDL_hid_device)(device)\n\treturn errorFromInt(int(C.SDL_hid_get_manufacturer_string(_device, _str, _maxlen)))\n}\n\n// GetProductString gets The Product String from a HID device.\n// (https://wiki.libsdl.org/SDL_hid_get_product_string)\nfunc (device *HIDDevice) GetProductString(_str *C.wchar_t, _maxlen C.size_t) (err error) {\n\t_device := (*C.SDL_hid_device)(device)\n\treturn errorFromInt(int(C.SDL_hid_get_product_string(_device, _str, _maxlen)))\n}\n\n// GetSerialNumberString gets The SerialNumber String from a HID device.\n// (https://wiki.libsdl.org/SDL_hid_get_serial_number_string)\nfunc (device *HIDDevice) GetSerialNumberString(_str *C.wchar_t, _maxlen C.size_t) (err error) {\n\t_device := (*C.SDL_hid_device)(device)\n\treturn errorFromInt(int(C.SDL_hid_get_serial_number_string(_device, _str, _maxlen)))\n}\n\n// GetIndexedString gets a string from a HID device, based on its string index.\n// (https://wiki.libsdl.org/SDL_hid_get_indexed_string)\nfunc (device *HIDDevice) GetIndexedString(index int, _str *C.wchar_t, _maxlen C.size_t) (err error) {\n\t_device := (*C.SDL_hid_device)(device)\n\t_index := C.int(index)\n\treturn errorFromInt(int(C.SDL_hid_get_indexed_string(_device, _index, _str, _maxlen)))\n}\n\n// HIDBLEScan starts or stops a BLE scan on iOS and tvOS to pair Steam Controllers.\n// (https://wiki.libsdl.org/SDL_hid_ble_scan)\nfunc (device *HIDDevice) HIDBLEScan(active bool) {\n\t_active := C.SDL_bool(Btoi(active))\n\tC.SDL_hid_ble_scan(_active)\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/hints.c",
    "content": "#include \"_cgo_export.h\"\n\n#include \"sdl_wrapper.h\"\n#include \"hints.h\"\n\nvoid hintCallback(void *userdata, const char *name, const char *oldValue, const char *newValue)\n{\n\tgoHintCallback((char *) name, (char *) oldValue, (char *) newValue);\n}\n\nvoid addHintCallback(const char *name)\n{\n\tSDL_AddHintCallback(name, hintCallback, NULL);\n}\n\nvoid delHintCallback(const char *name)\n{\n\tSDL_DelHintCallback(name, hintCallback, NULL);}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/hints.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n#include \"hints.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,20))\n#define SDL_HINT_RENDER_LINE_METHOD \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,18))\n#define SDL_HINT_APP_NAME \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,16))\n#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT \"\"\n#define SDL_HINT_AUDIO_INCLUDE_MONITORS \"\"\n#define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,14))\n#define SDL_HINT_JOYSTICK_HIDAPI_PS5 \"\"\n#define SDL_HINT_MOUSE_RELATIVE_SCALING \"\"\n#define SDL_HINT_PREFERRED_LOCALES \"\"\n#define SDL_HINT_JOYSTICK_RAWINPUT \"\"\n#define SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT \"\"\n#define SDL_HINT_AUDIO_DEVICE_APP_NAME \"\"\n#define SDL_HINT_AUDIO_DEVICE_STREAM_NAME \"\"\n#define SDL_HINT_LINUX_JOYSTICK_DEADZONES \"\"\n#define SDL_HINT_THREAD_PRIORITY_POLICY \"\"\n#define SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL \"\"\n#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO \"\"\n#define SDL_HINT_EMSCRIPTEN_ASYNCIFY \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,12))\n#define SDL_HINT_DISPLAY_USABLE_BOUNDS \"\"\n#define SDL_HINT_GAMECONTROLLERTYPE \"\"\n#define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS \"\"\n#define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE \"\"\n#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID \"\"\n#define SDL_HINT_VIDEO_X11_FORCE_EGL \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,9))\n#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME \"\"\n#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS \"\"\n#define SDL_HINT_JOYSTICK_HIDAPI_STEAM \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,8))\n#define SDL_HINT_IOS_HIDE_HOME_INDICATOR \"\"\n#define SDL_HINT_RETURN_KEY_HIDES_IME \"\"\n#define SDL_HINT_TV_REMOTE_AS_JOYSTICK \"\"\n#define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR \"\"\n#define SDL_HINT_VIDEO_DOUBLE_BUFFER \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,6))\n#define SDL_HINT_AUDIO_RESAMPLING_MODE \"\"\n#define SDL_HINT_RENDER_LOGICAL_SIZE_MODE \"\"\n#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE \"\"\n#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE \"\"\n#define SDL_HINT_TOUCH_MOUSE_EVENTS \"\"\n#define SDL_HINT_WINDOWS_INTRESOURCE_ICON       \"\"\n#define SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,4))\n#define SDL_HINT_NO_SIGNAL_HANDLERS \"\"\n#define SDL_HINT_THREAD_STACK_SIZE \"\"\n#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN \"\"\n#define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP \"\"\n#define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 \"\"\n#define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING \"\"\n#define SDL_HINT_MAC_BACKGROUND_APP \"\"\n#define SDL_HINT_IME_INTERNAL_EDITING \"\"\n#define SDL_HINT_VIDEO_X11_NET_WM_PING \"\"\n#define SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH \"\"\n#define SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION \"\"\n#define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,3))\n#define SDL_HINT_WINRT_PRIVACY_POLICY_URL \"\"\n#define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL \"\"\n#define SDL_HINT_WINRT_HANDLE_BACK_BUTTON \"\"\n#define SDL_HINT_RENDER_DIRECT3D11_DEBUG \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,2))\n#define SDL_HINT_ACCELEROMETER_AS_JOYSTICK \"\"\n#define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK \"\"\n#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER \"\"\n#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP \"\"\n#define SDL_HINT_VIDEO_WIN_D3DCOMPILER \"\"\n#define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT \"\"\n#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,1))\n#define SDL_HINT_RENDER_DIRECT3D_THREADSAFE \"\"\n#define SDL_HINT_VIDEO_HIGHDPI_DISABLED \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,10))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH has been removed in SDL 2.0.10\")\n#endif\n\n#define SDL_HINT_RENDER_BATCHING \"\"\n#define SDL_HINT_EVENT_LOGGING \"\"\n#define SDL_HINT_GAMECONTROLLERCONFIG_FILE \"\"\n#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE \"\"\n#define SDL_HINT_MOUSE_TOUCH_EVENTS \"\"\n\n#else\n\n#define SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH \"\" // For compatibility\n\n#endif\n\n#if SDL_VERSION_ATLEAST(2,0,16)\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT has been replaced by SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT in SDL 2.0.16\")\n#endif\n\n#define SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT (SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT)\n\n#endif\n\n#if !SDL_VERSION_ATLEAST(2,0,18)\n\n#define SDL_HINT_IME_SHOW_UI \"\"\n#define SDL_HINT_JOYSTICK_DEVICE \"\"\n#define SDL_HINT_LINUX_JOYSTICK_CLASSIC \"\"\n#define SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME \"\"\n#define SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY \"\"\n\n#endif\n\n#if !SDL_VERSION_ATLEAST(2,0,22)\n\n#define SDL_HINT_IME_SUPPORT_EXTENDED_TEXT \"\"\n#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER \"\"\n#define SDL_HINT_MOUSE_AUTO_CAPTURE \"\"\n#define SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL \"\"\n#define SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN \"\"\n#define SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE \"\"\n#define SDL_HINT_JOYSTICK_ROG_CHAKRAM \"\"\n#define SDL_HINT_X11_WINDOW_TYPE \"\"\n#define SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR \"\"\n\n#endif\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// Configuration hints\n// (https://wiki.libsdl.org/CategoryHints)\nconst (\n\tHINT_FRAMEBUFFER_ACCELERATION                 = C.SDL_HINT_FRAMEBUFFER_ACCELERATION                 // specifies how 3D acceleration is used with Window.GetSurface()\n\tHINT_RENDER_DRIVER                            = C.SDL_HINT_RENDER_DRIVER                            // specifies which render driver to use\n\tHINT_RENDER_OPENGL_SHADERS                    = C.SDL_HINT_RENDER_OPENGL_SHADERS                    // specifies whether the OpenGL render driver uses shaders\n\tHINT_RENDER_DIRECT3D_THREADSAFE               = C.SDL_HINT_RENDER_DIRECT3D_THREADSAFE               // specifies whether the Direct3D device is initialized for thread-safe operations\n\tHINT_RENDER_DIRECT3D11_DEBUG                  = C.SDL_HINT_RENDER_DIRECT3D11_DEBUG                  // specifies a variable controlling whether to enable Direct3D 11+'s Debug Layer\n\tHINT_RENDER_SCALE_QUALITY                     = C.SDL_HINT_RENDER_SCALE_QUALITY                     // specifies scaling quality\n\tHINT_RENDER_VSYNC                             = C.SDL_HINT_RENDER_VSYNC                             // specifies whether sync to vertical refresh is enabled or disabled in CreateRenderer() to avoid tearing\n\tHINT_VIDEO_ALLOW_SCREENSAVER                  = C.SDL_HINT_VIDEO_ALLOW_SCREENSAVER                  // specifies whether the screensaver is enabled\n\tHINT_VIDEO_X11_NET_WM_PING                    = C.SDL_HINT_VIDEO_X11_NET_WM_PING                    // specifies whether the X11 _NET_WM_PING protocol should be supported\n\tHINT_VIDEO_X11_XVIDMODE                       = C.SDL_HINT_VIDEO_X11_XVIDMODE                       // specifies whether the X11 VidMode extension should be used\n\tHINT_VIDEO_X11_XINERAMA                       = C.SDL_HINT_VIDEO_X11_XINERAMA                       // specifies whether the X11 Xinerama extension should be used\n\tHINT_VIDEO_X11_XRANDR                         = C.SDL_HINT_VIDEO_X11_XRANDR                         // specifies whether the X11 XRandR extension should be used\n\tHINT_GRAB_KEYBOARD                            = C.SDL_HINT_GRAB_KEYBOARD                            // specifies whether grabbing input grabs the keyboard\n\tHINT_MOUSE_DOUBLE_CLICK_TIME                  = C.SDL_HINT_MOUSE_DOUBLE_CLICK_TIME                  // specifies the double click time, in milliseconds\n\tHINT_MOUSE_DOUBLE_CLICK_RADIUS                = C.SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS                // specifies the double click radius, in pixels.\n\tHINT_MOUSE_RELATIVE_MODE_WARP                 = C.SDL_HINT_MOUSE_RELATIVE_MODE_WARP                 // specifies whether relative mouse mode is implemented using mouse warping\n\tHINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS             = C.SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS             // specifies if a Window is minimized if it loses key focus when in fullscreen mode\n\tHINT_IDLE_TIMER_DISABLED                      = C.SDL_HINT_IDLE_TIMER_DISABLED                      // specifies a variable controlling whether the idle timer is disabled on iOS\n\tHINT_IME_INTERNAL_EDITING                     = C.SDL_HINT_IME_INTERNAL_EDITING                     // specifies whether certain IMEs should handle text editing internally instead of sending TextEditingEvents\n\tHINT_ORIENTATIONS                             = C.SDL_HINT_ORIENTATIONS                             // specifies a variable controlling which orientations are allowed on iOS\n\tHINT_ACCELEROMETER_AS_JOYSTICK                = C.SDL_HINT_ACCELEROMETER_AS_JOYSTICK                // specifies whether the Android / iOS built-in accelerometer should be listed as a joystick device, rather than listing actual joysticks only\n\tHINT_XINPUT_ENABLED                           = C.SDL_HINT_XINPUT_ENABLED                           // specifies if Xinput gamepad devices are detected\n\tHINT_XINPUT_USE_OLD_JOYSTICK_MAPPING          = C.SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING          // specifies that SDL should use the old axis and button mapping for XInput devices\n\tHINT_GAMECONTROLLERCONFIG                     = C.SDL_HINT_GAMECONTROLLERCONFIG                     // specifies extra gamecontroller db entries\n\tHINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS         = C.SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS         // specifies if joystick (and gamecontroller) events are enabled even when the application is in the background\n\tHINT_ALLOW_TOPMOST                            = C.SDL_HINT_ALLOW_TOPMOST                            // specifies if top most bit on an SDL Window can be set\n\tHINT_THREAD_STACK_SIZE                        = C.SDL_HINT_THREAD_STACK_SIZE                        // specifies a variable specifying SDL's threads stack size in bytes or \"0\" for the backend's default size\n\tHINT_TIMER_RESOLUTION                         = C.SDL_HINT_TIMER_RESOLUTION                         // specifies the timer resolution in milliseconds\n\tHINT_VIDEO_HIGHDPI_DISABLED                   = C.SDL_HINT_VIDEO_HIGHDPI_DISABLED                   // specifies if high-DPI windows (\"Retina\" on Mac and iOS) are not allowed\n\tHINT_MAC_BACKGROUND_APP                       = C.SDL_HINT_MAC_BACKGROUND_APP                       // specifies if the SDL app should not be forced to become a foreground process on Mac OS X\n\tHINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK       = C.SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK       // specifies whether ctrl+click should generate a right-click event on Mac\n\tHINT_VIDEO_WIN_D3DCOMPILER                    = C.SDL_HINT_VIDEO_WIN_D3DCOMPILER                    // specifies which shader compiler to preload when using the Chrome ANGLE binaries\n\tHINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT          = C.SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT          // specifies the address of another Window* (as a hex string formatted with \"%p\")\n\tHINT_WINRT_PRIVACY_POLICY_URL                 = C.SDL_HINT_WINRT_PRIVACY_POLICY_URL                 // specifies a URL to a WinRT app's privacy policy\n\tHINT_WINRT_PRIVACY_POLICY_LABEL               = C.SDL_HINT_WINRT_PRIVACY_POLICY_LABEL               // specifies a label text for a WinRT app's privacy policy link\n\tHINT_WINRT_HANDLE_BACK_BUTTON                 = C.SDL_HINT_WINRT_HANDLE_BACK_BUTTON                 // specifies a variable to allow back-button-press events on Windows Phone to be marked as handled\n\tHINT_VIDEO_MAC_FULLSCREEN_SPACES              = C.SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES              // specifies policy for fullscreen Spaces on Mac OS X\n\tHINT_NO_SIGNAL_HANDLERS                       = C.SDL_HINT_NO_SIGNAL_HANDLERS                       // specifies not to catch the SIGINT or SIGTERM signals\n\tHINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN  = C.SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN  // specifies whether the window frame and title bar are interactive when the cursor is hidden\n\tHINT_WINDOWS_ENABLE_MESSAGELOOP               = C.SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP               // specifies whether the windows message loop is processed by SDL\n\tHINT_WINDOWS_NO_CLOSE_ON_ALT_F4               = C.SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4               // specifies that SDL should not to generate WINDOWEVENT_CLOSE events for Alt+F4 on Microsoft Windows\n\tHINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH         = C.SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH         // specifies a variable to control whether mouse and touch events are to be treated together or separately\n\tHINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION  = C.SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION  // specifies the Android APK expansion main file version\n\tHINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION = C.SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION // specifies the Android APK expansion patch file version\n\tHINT_AUDIO_RESAMPLING_MODE                    = C.SDL_HINT_AUDIO_RESAMPLING_MODE                    // specifies a variable controlling speed/quality tradeoff of audio resampling\n\tHINT_RENDER_LOGICAL_SIZE_MODE                 = C.SDL_HINT_RENDER_LOGICAL_SIZE_MODE                 // specifies a variable controlling the scaling policy for SDL_RenderSetLogicalSize\n\tHINT_MOUSE_NORMAL_SPEED_SCALE                 = C.SDL_HINT_MOUSE_NORMAL_SPEED_SCALE                 // specifies a variable setting the speed scale for mouse motion, in floating point, when the mouse is not in relative mode\n\tHINT_MOUSE_RELATIVE_SPEED_SCALE               = C.SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE               // specifies a variable setting the scale for mouse motion, in floating point, when the mouse is in relative mode\n\tHINT_MOUSE_TOUCH_EVENTS                       = C.SDL_HINT_MOUSE_TOUCH_EVENTS                       // specifies a variable to control whether mouse events should generate synthetic touch events\n\tHINT_TOUCH_MOUSE_EVENTS                       = C.SDL_HINT_TOUCH_MOUSE_EVENTS                       // specifies a variable controlling whether touch events should generate synthetic mouse events\n\tHINT_WINDOWS_INTRESOURCE_ICON                 = C.SDL_HINT_WINDOWS_INTRESOURCE_ICON                 // specifies a variable to specify custom icon resource id from RC file on Windows platform\n\tHINT_WINDOWS_INTRESOURCE_ICON_SMALL           = C.SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL           // specifies a variable to specify custom icon resource id from RC file on Windows platform\n\tHINT_IOS_HIDE_HOME_INDICATOR                  = C.SDL_HINT_IOS_HIDE_HOME_INDICATOR                  // specifies a variable controlling whether the home indicator bar on iPhone X should be hidden.\n\tHINT_RETURN_KEY_HIDES_IME                     = C.SDL_HINT_RETURN_KEY_HIDES_IME                     // specifies a variable to control whether the return key on the soft keyboard should hide the soft keyboard on Android and iOS.\n\tHINT_TV_REMOTE_AS_JOYSTICK                    = C.SDL_HINT_TV_REMOTE_AS_JOYSTICK                    // specifies a variable controlling whether the Android / tvOS remotes  should be listed as joystick devices, instead of sending keyboard events.\n\tHINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR       = C.SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR       // specifies a variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint should be used.\n\tHINT_VIDEO_DOUBLE_BUFFER                      = C.SDL_HINT_VIDEO_DOUBLE_BUFFER                      // specifies a variable that tells the video driver that we only want a double buffer.\n\tHINT_RENDER_BATCHING                          = C.SDL_HINT_RENDER_BATCHING                          // specifies a variable controlling whether the 2D render API is compatible or efficient.\n\tHINT_EVENT_LOGGING                            = C.SDL_HINT_EVENT_LOGGING                            // specifies a variable controlling whether SDL logs all events pushed onto its internal queue.\n\tHINT_GAMECONTROLLERCONFIG_FILE                = C.SDL_HINT_GAMECONTROLLERCONFIG_FILE                // specifies a variable that lets you provide a file with extra gamecontroller db entries.\n\tHINT_ANDROID_BLOCK_ON_PAUSE                   = C.SDL_HINT_ANDROID_BLOCK_ON_PAUSE                   // specifies a variable to control whether the event loop will block itself when the app is paused.\n\tHINT_DISPLAY_USABLE_BOUNDS                    = C.SDL_HINT_DISPLAY_USABLE_BOUNDS                    // Override for SDL_GetDisplayUsableBounds().\n\tHINT_GAMECONTROLLERTYPE                       = C.SDL_HINT_GAMECONTROLLERTYPE                       // Overrides the automatic controller type detection.\n\tHINT_GAMECONTROLLER_USE_BUTTON_LABELS         = C.SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS         // If set, game controller face buttons report their values according to their labels instead of their positional layout.\n\tHINT_JOYSTICK_HIDAPI_GAMECUBE                 = C.SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE                 // A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used.\n\tHINT_VIDEO_X11_WINDOW_VISUALID                = C.SDL_HINT_VIDEO_X11_WINDOW_VISUALID                // A variable forcing the visual ID chosen for new X11 windows.\n\tHINT_VIDEO_X11_FORCE_EGL                      = C.SDL_HINT_VIDEO_X11_FORCE_EGL                      // A variable controlling whether X11 should use GLX or EGL by default.\n\tHINT_JOYSTICK_HIDAPI_PS5                      = C.SDL_HINT_JOYSTICK_HIDAPI_PS5                      // A variable controlling whether the HIDAPI driver for PS5 controllers should be used.\n\tHINT_MOUSE_RELATIVE_SCALING                   = C.SDL_HINT_MOUSE_RELATIVE_SCALING                   // A variable controlling whether relative mouse motion is affected by renderer scaling.\n\tHINT_PREFERRED_LOCALES                        = C.SDL_HINT_PREFERRED_LOCALES                        // Override for SDL_GetPreferredLocales().\n\tHINT_JOYSTICK_RAWINPUT                        = C.SDL_HINT_JOYSTICK_RAWINPUT                        // A variable controlling whether the RAWINPUT joystick drivers should be used for better handling XInput-capable devices.\n\tHINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT       = C.SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT       // A variable controlling whether the HIDAPI driver for XBox controllers on Windows should pull correlated data from XInput.\n\tHINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT         = C.SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT         // A variable controlling whether the HIDAPI driver for XBox controllers on Windows should pull correlated data from XInput.\n\tHINT_AUDIO_DEVICE_APP_NAME                    = C.SDL_HINT_AUDIO_DEVICE_APP_NAME                    // Specify an application name for an audio device.\n\tHINT_AUDIO_DEVICE_STREAM_NAME                 = C.SDL_HINT_AUDIO_DEVICE_STREAM_NAME                 // Specify an application name for an audio device.\n\tHINT_LINUX_JOYSTICK_DEADZONES                 = C.SDL_HINT_LINUX_JOYSTICK_DEADZONES                 // A variable controlling whether joysticks on Linux adhere to their HID-defined deadzones or return unfiltered values.\n\tHINT_THREAD_PRIORITY_POLICY                   = C.SDL_HINT_THREAD_PRIORITY_POLICY                   // A string specifying additional information to use with SDL_SetThreadPriority.\n\tHINT_THREAD_FORCE_REALTIME_TIME_CRITICAL      = C.SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL      // Specifies whether SDL_THREAD_PRIORITY_TIME_CRITICAL should be treated as realtime.\n\tHINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO        = C.SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO        // A variable to control whether SDL will pause audio in background (Requires SDL_ANDROID_BLOCK_ON_PAUSE as \"Non blocking\").\n\tHINT_EMSCRIPTEN_ASYNCIFY                      = C.SDL_HINT_EMSCRIPTEN_ASYNCIFY                      // Disable giving back control to the browser automatically when running with asyncify.\n\tHINT_AUDIO_INCLUDE_MONITORS                   = C.SDL_HINT_AUDIO_INCLUDE_MONITORS                   // Control whether PulseAudio recording should include monitor devices\n\tHINT_AUDIO_DEVICE_STREAM_ROLE                 = C.SDL_HINT_AUDIO_DEVICE_STREAM_ROLE                 // Describe the role of your application for audio control panels\n\tHINT_APP_NAME                                 = C.SDL_HINT_APP_NAME                                 // Lets you specify the application name sent to the OS when required\n\tHINT_VIDEO_EGL_ALLOW_TRANSPARENCY             = C.SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY             // A variable controlling whether the EGL window is allowed to be composited as transparent, rather than opaque\n\tHINT_IME_SHOW_UI                              = C.SDL_HINT_IME_SHOW_UI                              // A variable to control whether certain IMEs should show native UI components (such as the Candidate List) instead of suppressing them\n\tHINT_IME_SUPPORT_EXTENDED_TEXT                = C.SDL_HINT_IME_SUPPORT_EXTENDED_TEXT                // A variable to control if extended IME text support is enabled.\n\tHINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME        = C.SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME        // This hint lets you specify the \"activity name\" sent to the OS when SDL_DisableScreenSaver() is used (or the screensaver is automatically disabled)\n\tHINT_LINUX_JOYSTICK_CLASSIC                   = C.SDL_HINT_LINUX_JOYSTICK_CLASSIC                   // A variable controlling whether to use the classic /dev/input/js* joystick interface or the newer /dev/input/event* joystick interface on Linux\n\tHINT_JOYSTICK_DEVICE                          = C.SDL_HINT_JOYSTICK_DEVICE                          // This variable is currently only used by the Linux joystick driver\n\tHINT_JOYSTICK_HIDAPI_STEAM                    = C.SDL_HINT_JOYSTICK_HIDAPI_STEAM                    // A variable controlling whether the HIDAPI driver for Steam Controllers should be used\n\tHINT_RENDER_LINE_METHOD                       = C.SDL_HINT_RENDER_LINE_METHOD                       // A variable controlling how the 2D render API renders lines\n        HINT_MOUSE_RELATIVE_MODE_CENTER               = C.SDL_HINT_MOUSE_RELATIVE_MODE_CENTER               // A variable controlling whether relative mouse mode constrains the mouse to the center of the window\n        HINT_MOUSE_AUTO_CAPTURE                       = C.SDL_HINT_MOUSE_AUTO_CAPTURE                       // A variable controlling whether the mouse is captured while mouse buttons are pressed\n        HINT_VIDEO_FOREIGN_WINDOW_OPENGL              = C.SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL              // When calling SDL_CreateWindowFrom(), make the window compatible with OpenGL\n        HINT_VIDEO_FOREIGN_WINDOW_VULKAN              = C.SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN              // When calling SDL_CreateWindowFrom(), make the window compatible with Vulkan\n\tHINT_QUIT_ON_LAST_WINDOW_CLOSE                = C.SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE                // A variable that decides whether to send SDL_QUIT when closing the final window\n        HINT_JOYSTICK_ROG_CHAKRAM                     = C.SDL_HINT_JOYSTICK_ROG_CHAKRAM                     // A variable controlling whether the ROG Chakram mice should show up as joysticks\n        HINT_X11_WINDOW_TYPE                          = C.SDL_HINT_X11_WINDOW_TYPE                          // A variable that forces X11 windows to create as a custom type\n        HINT_VIDEO_WAYLAND_PREFER_LIBDECOR            = C.SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR            // A variable controlling whether the libdecor Wayland backend is preferred over native decrations\n)\n\n// An enumeration of hint priorities.\n// (https://wiki.libsdl.org/SDL_HintPriority)\nconst (\n\tHINT_DEFAULT  = C.SDL_HINT_DEFAULT  // low priority, used for default values\n\tHINT_NORMAL   = C.SDL_HINT_NORMAL   // medium priority\n\tHINT_OVERRIDE = C.SDL_HINT_OVERRIDE // high priority\n)\n\n// HintCallback is the function to call when the hint value changes.\ntype HintCallback func(data interface{}, name, oldValue, newValue string)\n\n// HintCallbackAndData contains a callback function and userdata.\ntype HintCallbackAndData struct {\n\tcallback HintCallback // the function to call when the hint value changes\n\tdata     interface{}  // data to pass to the callback function\n}\n\nvar hintCallbacks = make(map[string]HintCallbackAndData)\n\n// HintPriority is a hint priority used in SetHintWithPriority().\n// (https://wiki.libsdl.org/SDL_HintPriority)\ntype HintPriority C.SDL_HintPriority\n\nfunc (hp HintPriority) c() C.SDL_HintPriority {\n\treturn C.SDL_HintPriority(hp)\n}\n\n// SetHintWithPriority sets a hint with a specific priority.\n// (https://wiki.libsdl.org/SDL_SetHintWithPriority)\nfunc SetHintWithPriority(name, value string, hp HintPriority) bool {\n\t_name := C.CString(name)\n\t_value := C.CString(value)\n\tdefer C.free(unsafe.Pointer(_name))\n\tdefer C.free(unsafe.Pointer(_value))\n\treturn C.SDL_SetHintWithPriority(_name, _value, hp.c()) > 0\n}\n\n// SetHint sets a hint with normal priority.\n// (https://wiki.libsdl.org/SDL_SetHint)\nfunc SetHint(name, value string) bool {\n\t_name := C.CString(name)\n\t_value := C.CString(value)\n\tdefer C.free(unsafe.Pointer(_name))\n\tdefer C.free(unsafe.Pointer(_value))\n\treturn C.SDL_SetHint(_name, _value) > 0\n}\n\n// GetHint returns the value of a hint.\n// (https://wiki.libsdl.org/SDL_GetHint)\nfunc GetHint(name string) string {\n\t_name := C.CString(name)\n\tdefer C.free(unsafe.Pointer(_name))\n\treturn C.GoString(C.SDL_GetHint(_name))\n}\n\n// ClearHints clears all hints.\n// (https://wiki.libsdl.org/SDL_ClearHints)\nfunc ClearHints() {\n\tC.SDL_ClearHints()\n}\n\n// AddHintCallback adds a function to watch a particular hint.\n// (https://wiki.libsdl.org/SDL_AddHintCallback)\nfunc AddHintCallback(name string, fn HintCallback, data interface{}) {\n\t_name := C.CString(name)\n\thintCallbacks[name] = HintCallbackAndData{\n\t\tcallback: fn,\n\t\tdata:     data,\n\t}\n\tC.addHintCallback(_name)\n}\n\n// DelHintCallback removes a function watching a particular hint.\n// (https://wiki.libsdl.org/SDL_DelHintCallback)\nfunc DelHintCallback(name string) {\n\t_name := C.CString(name)\n\tdelete(hintCallbacks, name)\n\tC.delHintCallback(_name)\n}\n\n//export goHintCallback\nfunc goHintCallback(_name, _oldValue, _newValue *C.char) {\n\tname := C.GoString(_name)\n\toldValue := C.GoString(_oldValue)\n\tnewValue := C.GoString(_newValue)\n\tif cb, ok := hintCallbacks[name]; ok {\n\t\tcb.callback(cb.data, name, oldValue, newValue)\n\t}\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/hints.h",
    "content": "void hintCallback(void *userdata, const char *name, const char *oldValue, const char *newValue);\nvoid addHintCallback(const char *name);\nvoid delHintCallback(const char *name);\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/joystick.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,4))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickPowerLevel is not supported before SDL 2.0.4\")\n#endif\n\ntypedef enum\n{\n    SDL_JOYSTICK_POWER_UNKNOWN = -1,\n    SDL_JOYSTICK_POWER_EMPTY,\n    SDL_JOYSTICK_POWER_LOW,\n    SDL_JOYSTICK_POWER_MEDIUM,\n    SDL_JOYSTICK_POWER_FULL,\n    SDL_JOYSTICK_POWER_WIRED,\n    SDL_JOYSTICK_POWER_MAX\n} SDL_JoystickPowerLevel;\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickCurrentPowerLevel is not supported before SDL 2.0.4\")\n#endif\n\nstatic SDL_JoystickPowerLevel SDL_JoystickCurrentPowerLevel(SDL_Joystick* joystick)\n{\n\treturn SDL_JOYSTICK_POWER_UNKNOWN;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickFromInstanceID is not supported before SDL 2.0.4\")\n#endif\n\nstatic SDL_Joystick* SDL_JoystickFromInstanceID(SDL_JoystickID joyid)\n{\n\treturn NULL;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,6))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickType is not supported before SDL 2.0.6\")\n#endif\n\ntypedef enum\n{\n\tSDL_JOYSTICK_TYPE_UNKNOWN,\n\tSDL_JOYSTICK_TYPE_GAMECONTROLLER,\n\tSDL_JOYSTICK_TYPE_WHEEL,\n\tSDL_JOYSTICK_TYPE_ARCADE_STICK,\n\tSDL_JOYSTICK_TYPE_FLIGHT_STICK,\n\tSDL_JOYSTICK_TYPE_DANCE_PAD,\n\tSDL_JOYSTICK_TYPE_GUITAR,\n\tSDL_JOYSTICK_TYPE_DRUM_KIT,\n\tSDL_JOYSTICK_TYPE_ARCADE_PAD,\n\tSDL_JOYSTICK_TYPE_THROTTLE\n} SDL_JoystickType;\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetDeviceVendor is not supported before SDL 2.0.6\")\n#endif\n\nstatic Uint16 SDL_JoystickGetDeviceVendor(int device_index)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetDeviceProduct is not supported before SDL 2.0.6\")\n#endif\n\nstatic Uint16 SDL_JoystickGetDeviceProduct(int device_index)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetDeviceProductVersion is not supported before SDL 2.0.6\")\n#endif\n\nstatic Uint16 SDL_JoystickGetDeviceProductVersion(int device_index)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetDeviceType is not supported before SDL 2.0.6\")\n#endif\n\nstatic SDL_JoystickType SDL_JoystickGetDeviceType(int device_index)\n{\n\treturn SDL_JOYSTICK_TYPE_UNKNOWN;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetDeviceInstanceID is not supported before SDL 2.0.6\")\n#endif\n\nstatic SDL_JoystickID SDL_JoystickGetDeviceInstanceID(int device_index)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetVendor is not supported before SDL 2.0.6\")\n#endif\n\nstatic Uint16 SDL_JoystickGetVendor(SDL_Joystick* joystick)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetProduct is not supported before SDL 2.0.6\")\n#endif\n\nstatic Uint16 SDL_JoystickGetProduct(SDL_Joystick* joystick)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetProductVersion is not supported before SDL 2.0.6\")\n#endif\n\nstatic Uint16 SDL_JoystickGetProductVersion(SDL_Joystick* joystick)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetType is not supported before SDL 2.0.6\")\n#endif\n\nstatic SDL_JoystickType SDL_JoystickGetType(SDL_Joystick* joystick)\n{\n\treturn SDL_JOYSTICK_TYPE_UNKNOWN;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetAxisInitialState is not supported before SDL 2.0.6\")\n#endif\n\nstatic SDL_bool SDL_JoystickGetAxisInitialState(SDL_Joystick* joystick, int axis, Sint16* state)\n{\n\treturn SDL_FALSE;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,7))\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_LockJoysticks is not supported before SDL 2.0.7\")\n#endif\n\nstatic void SDL_LockJoysticks()\n{\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_UnlockJoysticks is not supported before SDL 2.0.7\")\n#endif\n\nstatic void SDL_UnlockJoysticks()\n{\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,9))\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetDevicePlayerIndex is not supported before SDL 2.0.9\")\n#endif\n\nstatic int SDL_JoystickGetDevicePlayerIndex(int device_index)\n{\n\treturn 0;\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetPlayerIndex is not supported before SDL 2.0.9\")\n#endif\n\nstatic int SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick)\n{\n\treturn 0;\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickRumble is not supported before SDL 2.0.9\")\n#endif\n\nstatic int SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms)\n{\n\treturn -1;\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,18))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickHasRumble is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_JoystickHasRumbleTriggers is not supported before SDL 2.0.18\")\n#endif\n\nstatic SDL_bool SDL_JoystickHasRumble(SDL_Joystick *joystick)\n{\n\treturn SDL_FALSE;\n}\n\nstatic SDL_bool SDL_JoystickHasRumbleTriggers(SDL_Joystick *joystick)\n{\n\treturn SDL_FALSE;\n}\n\n#endif\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// Hat positions.\n// (https://wiki.libsdl.org/SDL_JoystickGetHat)\nconst (\n\tHAT_CENTERED  = C.SDL_HAT_CENTERED\n\tHAT_UP        = C.SDL_HAT_UP\n\tHAT_RIGHT     = C.SDL_HAT_RIGHT\n\tHAT_DOWN      = C.SDL_HAT_DOWN\n\tHAT_LEFT      = C.SDL_HAT_LEFT\n\tHAT_RIGHTUP   = C.SDL_HAT_RIGHTUP\n\tHAT_RIGHTDOWN = C.SDL_HAT_RIGHTDOWN\n\tHAT_LEFTUP    = C.SDL_HAT_LEFTUP\n\tHAT_LEFTDOWN  = C.SDL_HAT_LEFTDOWN\n)\n\n// Types of a joystick.\nconst (\n\tJOYSTICK_TYPE_UNKNOWN        = C.SDL_JOYSTICK_TYPE_UNKNOWN\n\tJOYSTICK_TYPE_GAMECONTROLLER = C.SDL_JOYSTICK_TYPE_GAMECONTROLLER\n\tJOYSTICK_TYPE_WHEEL          = C.SDL_JOYSTICK_TYPE_WHEEL\n\tJOYSTICK_TYPE_ARCADE_STICK   = C.SDL_JOYSTICK_TYPE_ARCADE_STICK\n\tJOYSTICK_TYPE_FLIGHT_STICK   = C.SDL_JOYSTICK_TYPE_FLIGHT_STICK\n\tJOYSTICK_TYPE_DANCE_PAD      = C.SDL_JOYSTICK_TYPE_DANCE_PAD\n\tJOYSTICK_TYPE_GUITAR         = C.SDL_JOYSTICK_TYPE_GUITAR\n\tJOYSTICK_TYPE_DRUM_KIT       = C.SDL_JOYSTICK_TYPE_DRUM_KIT\n\tJOYSTICK_TYPE_ARCADE_PAD     = C.SDL_JOYSTICK_TYPE_ARCADE_PAD\n\tJOYSTICK_TYPE_THROTTLE       = C.SDL_JOYSTICK_TYPE_THROTTLE\n)\n\n// An enumeration of battery levels of a joystick.\n// (https://wiki.libsdl.org/SDL_JoystickPowerLevel)\nconst (\n\tJOYSTICK_POWER_UNKNOWN = C.SDL_JOYSTICK_POWER_UNKNOWN\n\tJOYSTICK_POWER_EMPTY   = C.SDL_JOYSTICK_POWER_EMPTY\n\tJOYSTICK_POWER_LOW     = C.SDL_JOYSTICK_POWER_LOW\n\tJOYSTICK_POWER_MEDIUM  = C.SDL_JOYSTICK_POWER_MEDIUM\n\tJOYSTICK_POWER_FULL    = C.SDL_JOYSTICK_POWER_FULL\n\tJOYSTICK_POWER_WIRED   = C.SDL_JOYSTICK_POWER_WIRED\n\tJOYSTICK_POWER_MAX     = C.SDL_JOYSTICK_POWER_MAX\n)\n\n// Joystick is an SDL joystick.\ntype Joystick C.SDL_Joystick\n\n// JoystickGUID is a stable unique id for a joystick device.\ntype JoystickGUID C.SDL_JoystickGUID\n\n// JoystickID is joystick's instance id.\ntype JoystickID C.SDL_JoystickID\n\n// JoystickType is a type of a joystick.\ntype JoystickType C.SDL_JoystickType\n\n// JoystickPowerLevel is a battery level of a joystick.\ntype JoystickPowerLevel C.SDL_JoystickPowerLevel\n\nfunc (joy *Joystick) cptr() *C.SDL_Joystick {\n\treturn (*C.SDL_Joystick)(unsafe.Pointer(joy))\n}\n\nfunc (guid JoystickGUID) c() C.SDL_JoystickGUID {\n\treturn C.SDL_JoystickGUID(guid)\n}\n\nfunc (joyid JoystickID) c() C.SDL_JoystickID {\n\treturn C.SDL_JoystickID(joyid)\n}\n\n// NumJoysticks returns the number of joysticks attached to the system.\n// (https://wiki.libsdl.org/SDL_NumJoysticks)\nfunc NumJoysticks() int {\n\treturn (int)(C.SDL_NumJoysticks())\n}\n\n// JoystickNameForIndex returns the implementation dependent name of a joystick.\n// (https://wiki.libsdl.org/SDL_JoystickNameForIndex)\nfunc JoystickNameForIndex(index int) string {\n\treturn (C.GoString)(C.SDL_JoystickNameForIndex(C.int(index)))\n}\n\n// JoystickGetDevicePlayerIndex returns the player index of a joystick, or -1 if it's not available\n// TODO: (https://wiki.libsdl.org/SDL_JoystickGetDevicePlayerIndex)\nfunc JoystickGetDevicePlayerIndex(index int) int {\n\treturn int(C.SDL_JoystickGetDevicePlayerIndex(C.int(index)))\n}\n\n// JoystickGetDeviceGUID returns the implementation dependent GUID for the joystick at a given device index.\n// (https://wiki.libsdl.org/SDL_JoystickGetDeviceGUID)\nfunc JoystickGetDeviceGUID(index int) JoystickGUID {\n\treturn (JoystickGUID)(C.SDL_JoystickGetDeviceGUID(C.int(index)))\n}\n\n// JoystickGetDeviceVendor returns the USB vendor ID of a joystick, if available, 0 otherwise.\nfunc JoystickGetDeviceVendor(index int) int {\n\treturn int(C.SDL_JoystickGetDeviceVendor(C.int(index)))\n}\n\n// JoystickGetDeviceProduct returns the USB product ID of a joystick, if available, 0 otherwise.\nfunc JoystickGetDeviceProduct(index int) int {\n\treturn int(C.SDL_JoystickGetDeviceProduct(C.int(index)))\n}\n\n// JoystickGetDeviceProductVersion returns the product version of a joystick, if available, 0 otherwise.\nfunc JoystickGetDeviceProductVersion(index int) int {\n\treturn int(C.SDL_JoystickGetDeviceProductVersion(C.int(index)))\n}\n\n// JoystickGetDeviceType returns the type of a joystick.\nfunc JoystickGetDeviceType(index int) JoystickType {\n\treturn JoystickType(C.SDL_JoystickGetDeviceType(C.int(index)))\n}\n\n// JoystickGetDeviceInstanceID returns the instance ID of a joystick.\nfunc JoystickGetDeviceInstanceID(index int) JoystickID {\n\treturn JoystickID(C.SDL_JoystickGetDeviceInstanceID(C.int(index)))\n}\n\n// JoystickGetGUIDString returns an ASCII string representation for a given JoystickGUID.\n// (https://wiki.libsdl.org/SDL_JoystickGetGUIDString)\nfunc JoystickGetGUIDString(guid JoystickGUID) string {\n\t_pszGUID := make([]rune, 1024)\n\tpszGUID := C.CString(string(_pszGUID[:]))\n\tdefer C.free(unsafe.Pointer(pszGUID))\n\tC.SDL_JoystickGetGUIDString(guid.c(), pszGUID, C.int(unsafe.Sizeof(_pszGUID)))\n\treturn C.GoString(pszGUID)\n}\n\n// JoystickGetGUIDFromString converts a GUID string into a JoystickGUID structure.\n// (https://wiki.libsdl.org/SDL_JoystickGetGUIDFromString)\nfunc JoystickGetGUIDFromString(pchGUID string) JoystickGUID {\n\t_pchGUID := C.CString(pchGUID)\n\tdefer C.free(unsafe.Pointer(_pchGUID))\n\treturn (JoystickGUID)(C.SDL_JoystickGetGUIDFromString(_pchGUID))\n}\n\n// JoystickUpdate updates the current state of the open joysticks.\n// (https://wiki.libsdl.org/SDL_JoystickUpdate)\nfunc JoystickUpdate() {\n\tC.SDL_JoystickUpdate()\n}\n\n// JoystickEventState enables or disables joystick event polling.\n// (https://wiki.libsdl.org/SDL_JoystickEventState)\nfunc JoystickEventState(state int) int {\n\treturn (int)(C.SDL_JoystickEventState(C.int(state)))\n}\n\n// JoystickOpen opens a joystick for use.\n// (https://wiki.libsdl.org/SDL_JoystickOpen)\nfunc JoystickOpen(index int) *Joystick {\n\treturn (*Joystick)(C.SDL_JoystickOpen(C.int(index)))\n}\n\n// JoystickFromInstanceID returns the Joystick associated with an instance id.\n// (https://wiki.libsdl.org/SDL_JoystickFromInstanceID)\nfunc JoystickFromInstanceID(joyid JoystickID) *Joystick {\n\treturn (*Joystick)(C.SDL_JoystickFromInstanceID(joyid.c()))\n}\n\n// LockJoysticks locks joysticks for multi-threaded access to the joystick API\n// TODO: (https://wiki.libsdl.org/SDL_LockJoysticks)\nfunc LockJoysticks() {\n\tC.SDL_LockJoysticks()\n}\n\n// UnlockJoysticks unlocks joysticks for multi-threaded access to the joystick API\n// TODO: (https://wiki.libsdl.org/SDL_UnlockJoysticks)\nfunc UnlockJoysticks() {\n\tC.SDL_UnlockJoysticks()\n}\n\n// Name returns the implementation dependent name of a joystick.\n// (https://wiki.libsdl.org/SDL_JoystickName)\nfunc (joy *Joystick) Name() string {\n\treturn (C.GoString)(C.SDL_JoystickName(joy.cptr()))\n}\n\n// PlayerIndex returns the player index of an opened joystick, or -1 if it's not available.\n// (https://wiki.libsdl.org/SDL_JoystickGetPlayerIndex)\nfunc (joy *Joystick) PlayerIndex() int {\n\treturn int(C.SDL_JoystickGetPlayerIndex(joy.cptr()))\n}\n\n// GUID returns the implementation-dependent GUID for the joystick.\n// (https://wiki.libsdl.org/SDL_JoystickGetGUID)\nfunc (joy *Joystick) GUID() JoystickGUID {\n\treturn (JoystickGUID)(C.SDL_JoystickGetGUID(joy.cptr()))\n}\n\n// Vendor returns the USB vendor ID of an opened joystick, if available, 0 otherwise.\nfunc (joy *Joystick) Vendor() int {\n\treturn int(C.SDL_JoystickGetVendor(joy.cptr()))\n}\n\n// Product returns the USB product ID of an opened joystick, if available, 0 otherwise.\nfunc (joy *Joystick) Product() int {\n\treturn int(C.SDL_JoystickGetProduct(joy.cptr()))\n}\n\n// ProductVersion returns the product version of an opened joystick, if available, 0 otherwise.\nfunc (joy *Joystick) ProductVersion() int {\n\treturn int(C.SDL_JoystickGetProductVersion(joy.cptr()))\n}\n\n// Type returns the the type of an opened joystick.\nfunc (joy *Joystick) Type() JoystickType {\n\treturn JoystickType(C.SDL_JoystickGetType(joy.cptr()))\n}\n\n// Attached returns the status of a specified joystick.\n// (https://wiki.libsdl.org/SDL_JoystickGetAttached)\nfunc (joy *Joystick) Attached() bool {\n\treturn C.SDL_JoystickGetAttached(joy.cptr()) == C.SDL_TRUE\n}\n\n// InstanceID returns the instance ID of an opened joystick.\n// (https://wiki.libsdl.org/SDL_JoystickInstanceID)\nfunc (joy *Joystick) InstanceID() JoystickID {\n\treturn (JoystickID)(C.SDL_JoystickInstanceID(joy.cptr()))\n}\n\n// NumAxes returns the number of general axis controls on a joystick.\n// (https://wiki.libsdl.org/SDL_JoystickNumAxes)\nfunc (joy *Joystick) NumAxes() int {\n\treturn (int)(C.SDL_JoystickNumAxes(joy.cptr()))\n}\n\n// NumBalls returns the number of trackballs on a joystick.\n// (https://wiki.libsdl.org/SDL_JoystickNumBalls)\nfunc (joy *Joystick) NumBalls() int {\n\treturn (int)(C.SDL_JoystickNumBalls(joy.cptr()))\n}\n\n// NumHats returns the number of POV hats on a joystick.\n// (https://wiki.libsdl.org/SDL_JoystickNumHats)\nfunc (joy *Joystick) NumHats() int {\n\treturn (int)(C.SDL_JoystickNumHats(joy.cptr()))\n}\n\n// NumButtons returns the number of buttons on a joystick.\n// (https://wiki.libsdl.org/SDL_JoystickNumButtons)\nfunc (joy *Joystick) NumButtons() int {\n\treturn (int)(C.SDL_JoystickNumButtons(joy.cptr()))\n}\n\n// Axis returns the current state of an axis control on a joystick.\n// (https://wiki.libsdl.org/SDL_JoystickGetAxis)\nfunc (joy *Joystick) Axis(axis int) int16 {\n\treturn (int16)(C.SDL_JoystickGetAxis(joy.cptr(), C.int(axis)))\n}\n\n// AxisInitialState returns the initial state of an axis control on a joystick, ok is true if this axis has any initial value.\nfunc (joy *Joystick) AxisInitialState(axis int) (state int16, ok bool) {\n\tok = C.SDL_JoystickGetAxisInitialState(joy.cptr(), C.int(axis), (*C.Sint16)(&state)) == C.SDL_TRUE\n\treturn\n}\n\n// Hat returns the current state of a POV hat on a joystick.\n// (https://wiki.libsdl.org/SDL_JoystickGetHat)\nfunc (joy *Joystick) Hat(hat int) byte {\n\treturn (byte)(C.SDL_JoystickGetHat(joy.cptr(), C.int(hat)))\n}\n\n// Ball returns the ball axis change since the last poll.\n// (https://wiki.libsdl.org/SDL_JoystickGetBall)\nfunc (joy *Joystick) Ball(ball int, dx, dy *int32) int {\n\t_dx := (*C.int)(unsafe.Pointer(dx))\n\t_dy := (*C.int)(unsafe.Pointer(dy))\n\treturn (int)(C.SDL_JoystickGetBall(joy.cptr(), C.int(ball), _dx, _dy))\n}\n\n// Button the current state of a button on a joystick.\n// (https://wiki.libsdl.org/SDL_JoystickGetButton)\nfunc (joy *Joystick) Button(button int) byte {\n\treturn (byte)(C.SDL_JoystickGetButton(joy.cptr(), C.int(button)))\n}\n\n// Rumble triggers a rumble effect\n// Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.\n//\n// lowFrequencyRumble - The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF\n// highFrequencyRumble - The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF\n// durationMS - The duration of the rumble effect, in milliseconds\n//\n// Returns error if rumble isn't supported on this joystick.\n//\n// TODO: (https://wiki.libsdl.org/SDL_JoystickRumble)\nfunc (joy *Joystick) Rumble(lowFrequencyRumble, highFrequencyRumble uint16, durationMS uint32) error {\n\treturn errorFromInt(int(C.SDL_JoystickRumble(joy.cptr(), C.Uint16(lowFrequencyRumble), C.Uint16(highFrequencyRumble), C.Uint32(durationMS))))\n}\n\n// Close closes a joystick previously opened with JoystickOpen().\n// (https://wiki.libsdl.org/SDL_JoystickClose)\nfunc (joy *Joystick) Close() {\n\tC.SDL_JoystickClose(joy.cptr())\n}\n\n// CurrentPowerLevel returns the battery level of a joystick as JoystickPowerLevel.\n// (https://wiki.libsdl.org/SDL_JoystickCurrentPowerLevel)\nfunc (joy *Joystick) CurrentPowerLevel() JoystickPowerLevel {\n\treturn JoystickPowerLevel(C.SDL_JoystickCurrentPowerLevel(joy.cptr()))\n}\n\n// HasRumble queries whether a game controller has rumble support.\n// (https://wiki.libsdl.org/SDL_JoystickHasRumble)\nfunc (ctrl *Joystick) HasRumble() bool {\n\treturn C.SDL_JoystickHasRumble(ctrl.cptr()) == C.SDL_TRUE\n}\n\n// HasRumbleTriggers queries whether a game controller has rumble support on triggers.\n// (https://wiki.libsdl.org/SDL_JoystickHasRumbleTriggers)\nfunc (ctrl *Joystick) HasRumbleTriggers() bool {\n\treturn C.SDL_JoystickHasRumbleTriggers(ctrl.cptr()) == C.SDL_TRUE\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/keyboard.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,22))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_IsTextInputShown is not supported before SDL 2.0.22\")\n#pragma message(\"SDL_ClearComposition is not supported before SDL 2.0.22\")\n#endif\n\nstatic inline SDL_bool SDL_IsTextInputShown(void)\n{\n\treturn SDL_FALSE;\n}\n\nstatic inline void SDL_ClearComposition(void)\n{\n}\n\n#endif\n*/\nimport \"C\"\nimport (\n\t\"reflect\"\n\t\"unsafe\"\n)\n\n// Keysym contains key information used in key events.\n// (https://wiki.libsdl.org/SDL_Keysym)\ntype Keysym struct {\n\tScancode Scancode // SDL physical key code\n\tSym      Keycode  // SDL virtual key code\n\tMod      uint16   // current key modifiers\n\tunused   uint32   // unused\n}\n\n// GetKeyboardFocus returns the window which currently has keyboard focus.\n// (https://wiki.libsdl.org/SDL_GetKeyboardFocus)\nfunc GetKeyboardFocus() *Window {\n\treturn (*Window)(unsafe.Pointer(C.SDL_GetKeyboardFocus()))\n}\n\n// GetKeyboardState returns a snapshot of the current state of the keyboard.\n// (https://wiki.libsdl.org/SDL_GetKeyboardState)\nfunc GetKeyboardState() []uint8 {\n\tvar numkeys C.int\n\tstart := C.SDL_GetKeyboardState(&numkeys)\n\tsh := reflect.SliceHeader{}\n\tsh.Len = int(numkeys)\n\tsh.Cap = int(numkeys)\n\tsh.Data = uintptr(unsafe.Pointer(start))\n\treturn *(*[]uint8)(unsafe.Pointer(&sh))\n}\n\n// GetModState returns the current key modifier state for the keyboard.\n// (https://wiki.libsdl.org/SDL_GetModState)\nfunc GetModState() Keymod {\n\treturn (Keymod)(C.SDL_GetModState())\n}\n\n// SetModState sets the current key modifier state for the keyboard.\n// (https://wiki.libsdl.org/SDL_SetModState)\nfunc SetModState(mod Keymod) {\n\tC.SDL_SetModState(mod.c())\n}\n\n// GetKeyFromScancode returns the key code corresponding to the given scancode according to the current keyboard layout.\n// (https://wiki.libsdl.org/SDL_GetKeyFromScancode)\nfunc GetKeyFromScancode(code Scancode) Keycode {\n\treturn (Keycode)(C.SDL_GetKeyFromScancode(code.c()))\n}\n\n// GetScancodeFromKey returns the scancode corresponding to the given key code according to the current keyboard layout.\n// (https://wiki.libsdl.org/SDL_GetScancodeFromKey)\nfunc GetScancodeFromKey(code Keycode) Scancode {\n\treturn (Scancode)(C.SDL_GetScancodeFromKey(code.c()))\n}\n\n// GetScancodeName returns a human-readable name for a scancode\n// (https://wiki.libsdl.org/SDL_GetScancodeName)\nfunc GetScancodeName(code Scancode) string {\n\treturn (C.GoString)(C.SDL_GetScancodeName(code.c()))\n}\n\n// GetScancodeFromName returns a scancode from a human-readable name.\n// (https://wiki.libsdl.org/SDL_GetScancodeFromName)\nfunc GetScancodeFromName(name string) Scancode {\n\t_name := C.CString(name)\n\tdefer C.free(unsafe.Pointer(_name))\n\treturn (Scancode)(C.SDL_GetScancodeFromName(_name))\n}\n\n// GetKeyName returns a human-readable name for a key.\n// (https://wiki.libsdl.org/SDL_GetKeyName)\nfunc GetKeyName(code Keycode) string {\n\treturn (C.GoString)(C.SDL_GetKeyName(code.c()))\n}\n\n// GetKeyFromName returns a key code from a human-readable name.\n// (https://wiki.libsdl.org/SDL_GetKeyFromName)\nfunc GetKeyFromName(name string) Keycode {\n\t_name := C.CString(name)\n\tdefer C.free(unsafe.Pointer(_name))\n\treturn (Keycode)(C.SDL_GetKeyFromName(_name))\n}\n\n// StartTextInput starts accepting Unicode text input events.\n// (https://wiki.libsdl.org/SDL_StartTextInput)\nfunc StartTextInput() {\n\tC.SDL_StartTextInput()\n}\n\n// IsTextInputActive checks whether or not Unicode text input events are enabled.\n// (https://wiki.libsdl.org/SDL_IsTextInputActive)\nfunc IsTextInputActive() bool {\n\treturn C.SDL_IsTextInputActive() > 0\n}\n\n// StopTextInput stops receiving any text input events.\n// (https://wiki.libsdl.org/SDL_StopTextInput)\nfunc StopTextInput() {\n\tC.SDL_StopTextInput()\n}\n\n// SetTextInputRect sets the rectangle used to type Unicode text inputs.\n// (https://wiki.libsdl.org/SDL_SetTextInputRect)\nfunc SetTextInputRect(rect *Rect) {\n\tC.SDL_SetTextInputRect(rect.cptr())\n}\n\n// HasScreenKeyboardSupport reports whether the platform has some screen keyboard support.\n// (https://wiki.libsdl.org/SDL_HasScreenKeyboardSupport)\nfunc HasScreenKeyboardSupport() bool {\n\treturn C.SDL_HasScreenKeyboardSupport() > 0\n}\n\n// IsScreenKeyboardShown reports whether the screen keyboard is shown for given window.\n// (https://wiki.libsdl.org/SDL_IsScreenKeyboardShown)\nfunc IsScreenKeyboardShown(window *Window) bool {\n\treturn C.SDL_IsScreenKeyboardShown(window.cptr()) > 0\n}\n\n// IsTextInputShown returns if an IME Composite or Candidate window is currently shown.\n// (https://wiki.libsdl.org/SDL_IsTextInputShown)\nfunc IsTextInputShown() bool {\n\treturn C.SDL_IsTextInputShown() > 0\n}\n\n// ClearComposition dismisses the composition window/IME without disabling the subsystem.\n// (https://wiki.libsdl.org/SDL_ClearComposition)\nfunc ClearComposition() {\n\tC.SDL_ClearComposition()\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/keycode.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\n\nconst K_SCANCODE_MASK = 1 << 30\n\n// The SDL virtual key representation.\n// (https://wiki.libsdl.org/SDL_Keycode)\n// (https://wiki.libsdl.org/SDLKeycodeLookup)\nconst (\n\tK_UNKNOWN = C.SDLK_UNKNOWN // \"\" (no name, empty string)\n\n\tK_RETURN     = C.SDLK_RETURN     // \"Return\" (the Enter key (main keyboard))\n\tK_ESCAPE     = C.SDLK_ESCAPE     // \"Escape\" (the Esc key)\n\tK_BACKSPACE  = C.SDLK_BACKSPACE  // \"Backspace\"\n\tK_TAB        = C.SDLK_TAB        // \"Tab\" (the Tab key)\n\tK_SPACE      = C.SDLK_SPACE      // \"Space\" (the Space Bar key(s))\n\tK_EXCLAIM    = C.SDLK_EXCLAIM    // \"!\"\n\tK_QUOTEDBL   = C.SDLK_QUOTEDBL   // \"\"\"\n\tK_HASH       = C.SDLK_HASH       // \"#\"\n\tK_PERCENT    = C.SDLK_PERCENT    // \"%\"\n\tK_DOLLAR     = C.SDLK_DOLLAR     // \"$\"\n\tK_AMPERSAND  = C.SDLK_AMPERSAND  // \"&\"\n\tK_QUOTE      = C.SDLK_QUOTE      // \"'\"\n\tK_LEFTPAREN  = C.SDLK_LEFTPAREN  // \"(\"\n\tK_RIGHTPAREN = C.SDLK_RIGHTPAREN // \")\"\n\tK_ASTERISK   = C.SDLK_ASTERISK   // \"*\"\n\tK_PLUS       = C.SDLK_PLUS       // \"+\"\n\tK_COMMA      = C.SDLK_COMMA      // \",\"\n\tK_MINUS      = C.SDLK_MINUS      // \"-\"\n\tK_PERIOD     = C.SDLK_PERIOD     // \".\"\n\tK_SLASH      = C.SDLK_SLASH      // \"/\"\n\tK_0          = C.SDLK_0          // \"0\"\n\tK_1          = C.SDLK_1          // \"1\"\n\tK_2          = C.SDLK_2          // \"2\"\n\tK_3          = C.SDLK_3          // \"3\"\n\tK_4          = C.SDLK_4          // \"4\"\n\tK_5          = C.SDLK_5          // \"5\"\n\tK_6          = C.SDLK_6          // \"6\"\n\tK_7          = C.SDLK_7          // \"7\"\n\tK_8          = C.SDLK_8          // \"8\"\n\tK_9          = C.SDLK_9          // \"9\"\n\tK_COLON      = C.SDLK_COLON      // \":\"\n\tK_SEMICOLON  = C.SDLK_SEMICOLON  // \";\"\n\tK_LESS       = C.SDLK_LESS       // \"<\"\n\tK_EQUALS     = C.SDLK_EQUALS     // \"=\"\n\tK_GREATER    = C.SDLK_GREATER    // \">\"\n\tK_QUESTION   = C.SDLK_QUESTION   // \"?\"\n\tK_AT         = C.SDLK_AT         // \"@\"\n\t/*\n\t   Skip uppercase letters\n\t*/\n\tK_LEFTBRACKET  = C.SDLK_LEFTBRACKET  // \"[\"\n\tK_BACKSLASH    = C.SDLK_BACKSLASH    // \"\\\"\n\tK_RIGHTBRACKET = C.SDLK_RIGHTBRACKET // \"]\"\n\tK_CARET        = C.SDLK_CARET        // \"^\"\n\tK_UNDERSCORE   = C.SDLK_UNDERSCORE   // \"_\"\n\tK_BACKQUOTE    = C.SDLK_BACKQUOTE    // \"`\"\n\tK_a            = C.SDLK_a            // \"A\"\n\tK_b            = C.SDLK_b            // \"B\"\n\tK_c            = C.SDLK_c            // \"C\"\n\tK_d            = C.SDLK_d            // \"D\"\n\tK_e            = C.SDLK_e            // \"E\"\n\tK_f            = C.SDLK_f            // \"F\"\n\tK_g            = C.SDLK_g            // \"G\"\n\tK_h            = C.SDLK_h            // \"H\"\n\tK_i            = C.SDLK_i            // \"I\"\n\tK_j            = C.SDLK_j            // \"J\"\n\tK_k            = C.SDLK_k            // \"K\"\n\tK_l            = C.SDLK_l            // \"L\"\n\tK_m            = C.SDLK_m            // \"M\"\n\tK_n            = C.SDLK_n            // \"N\"\n\tK_o            = C.SDLK_o            // \"O\"\n\tK_p            = C.SDLK_p            // \"P\"\n\tK_q            = C.SDLK_q            // \"Q\"\n\tK_r            = C.SDLK_r            // \"R\"\n\tK_s            = C.SDLK_s            // \"S\"\n\tK_t            = C.SDLK_t            // \"T\"\n\tK_u            = C.SDLK_u            // \"U\"\n\tK_v            = C.SDLK_v            // \"V\"\n\tK_w            = C.SDLK_w            // \"W\"\n\tK_x            = C.SDLK_x            // \"X\"\n\tK_y            = C.SDLK_y            // \"Y\"\n\tK_z            = C.SDLK_z            // \"Z\"\n\n\tK_CAPSLOCK = C.SDLK_CAPSLOCK // \"CapsLock\"\n\n\tK_F1  = C.SDLK_F1  // \"F1\"\n\tK_F2  = C.SDLK_F2  // \"F2\"\n\tK_F3  = C.SDLK_F3  // \"F3\"\n\tK_F4  = C.SDLK_F4  // \"F4\"\n\tK_F5  = C.SDLK_F5  // \"F5\"\n\tK_F6  = C.SDLK_F6  // \"F6\"\n\tK_F7  = C.SDLK_F7  // \"F7\"\n\tK_F8  = C.SDLK_F8  // \"F8\"\n\tK_F9  = C.SDLK_F9  // \"F9\"\n\tK_F10 = C.SDLK_F10 // \"F10\"\n\tK_F11 = C.SDLK_F11 // \"F11\"\n\tK_F12 = C.SDLK_F12 // \"F12\"\n\n\tK_PRINTSCREEN = C.SDLK_PRINTSCREEN // \"PrintScreen\"\n\tK_SCROLLLOCK  = C.SDLK_SCROLLLOCK  // \"ScrollLock\"\n\tK_PAUSE       = C.SDLK_PAUSE       // \"Pause\" (the Pause / Break key)\n\tK_INSERT      = C.SDLK_INSERT      // \"Insert\" (insert on PC, help on some Mac keyboards (but does send code 73, not 117))\n\tK_HOME        = C.SDLK_HOME        // \"Home\"\n\tK_PAGEUP      = C.SDLK_PAGEUP      // \"PageUp\"\n\tK_DELETE      = C.SDLK_DELETE      // \"Delete\"\n\tK_END         = C.SDLK_END         // \"End\"\n\tK_PAGEDOWN    = C.SDLK_PAGEDOWN    // \"PageDown\"\n\tK_RIGHT       = C.SDLK_RIGHT       // \"Right\" (the Right arrow key (navigation keypad))\n\tK_LEFT        = C.SDLK_LEFT        // \"Left\" (the Left arrow key (navigation keypad))\n\tK_DOWN        = C.SDLK_DOWN        // \"Down\" (the Down arrow key (navigation keypad))\n\tK_UP          = C.SDLK_UP          // \"Up\" (the Up arrow key (navigation keypad))\n\n\tK_NUMLOCKCLEAR = C.SDLK_NUMLOCKCLEAR // \"Numlock\" (the Num Lock key (PC) / the Clear key (Mac))\n\tK_KP_DIVIDE    = C.SDLK_KP_DIVIDE    // \"Keypad /\" (the / key (numeric keypad))\n\tK_KP_MULTIPLY  = C.SDLK_KP_MULTIPLY  // \"Keypad *\" (the * key (numeric keypad))\n\tK_KP_MINUS     = C.SDLK_KP_MINUS     // \"Keypad -\" (the - key (numeric keypad))\n\tK_KP_PLUS      = C.SDLK_KP_PLUS      // \"Keypad +\" (the + key (numeric keypad))\n\tK_KP_ENTER     = C.SDLK_KP_ENTER     // \"Keypad Enter\" (the Enter key (numeric keypad))\n\tK_KP_1         = C.SDLK_KP_1         // \"Keypad 1\" (the 1 key (numeric keypad))\n\tK_KP_2         = C.SDLK_KP_2         // \"Keypad 2\" (the 2 key (numeric keypad))\n\tK_KP_3         = C.SDLK_KP_3         // \"Keypad 3\" (the 3 key (numeric keypad))\n\tK_KP_4         = C.SDLK_KP_4         // \"Keypad 4\" (the 4 key (numeric keypad))\n\tK_KP_5         = C.SDLK_KP_5         // \"Keypad 5\" (the 5 key (numeric keypad))\n\tK_KP_6         = C.SDLK_KP_6         // \"Keypad 6\" (the 6 key (numeric keypad))\n\tK_KP_7         = C.SDLK_KP_7         // \"Keypad 7\" (the 7 key (numeric keypad))\n\tK_KP_8         = C.SDLK_KP_8         // \"Keypad 8\" (the 8 key (numeric keypad))\n\tK_KP_9         = C.SDLK_KP_9         // \"Keypad 9\" (the 9 key (numeric keypad))\n\tK_KP_0         = C.SDLK_KP_0         // \"Keypad 0\" (the 0 key (numeric keypad))\n\tK_KP_PERIOD    = C.SDLK_KP_PERIOD    // \"Keypad .\" (the . key (numeric keypad))\n\n\tK_APPLICATION    = C.SDLK_APPLICATION    // \"Application\" (the Application / Compose / Context Menu (Windows) key)\n\tK_POWER          = C.SDLK_POWER          // \"Power\" (The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key.)\n\tK_KP_EQUALS      = C.SDLK_KP_EQUALS      // \"Keypad =\" (the = key (numeric keypad))\n\tK_F13            = C.SDLK_F13            // \"F13\"\n\tK_F14            = C.SDLK_F14            // \"F14\"\n\tK_F15            = C.SDLK_F15            // \"F15\"\n\tK_F16            = C.SDLK_F16            // \"F16\"\n\tK_F17            = C.SDLK_F17            // \"F17\"\n\tK_F18            = C.SDLK_F18            // \"F18\"\n\tK_F19            = C.SDLK_F19            // \"F19\"\n\tK_F20            = C.SDLK_F20            // \"F20\"\n\tK_F21            = C.SDLK_F21            // \"F21\"\n\tK_F22            = C.SDLK_F22            // \"F22\"\n\tK_F23            = C.SDLK_F23            // \"F23\"\n\tK_F24            = C.SDLK_F24            // \"F24\"\n\tK_EXECUTE        = C.SDLK_EXECUTE        // \"Execute\"\n\tK_HELP           = C.SDLK_HELP           // \"Help\"\n\tK_MENU           = C.SDLK_MENU           // \"Menu\"\n\tK_SELECT         = C.SDLK_SELECT         // \"Select\"\n\tK_STOP           = C.SDLK_STOP           // \"Stop\"\n\tK_AGAIN          = C.SDLK_AGAIN          // \"Again\" (the Again key (Redo))\n\tK_UNDO           = C.SDLK_UNDO           // \"Undo\"\n\tK_CUT            = C.SDLK_CUT            // \"Cut\"\n\tK_COPY           = C.SDLK_COPY           // \"Copy\"\n\tK_PASTE          = C.SDLK_PASTE          // \"Paste\"\n\tK_FIND           = C.SDLK_FIND           // \"Find\"\n\tK_MUTE           = C.SDLK_MUTE           // \"Mute\"\n\tK_VOLUMEUP       = C.SDLK_VOLUMEUP       // \"VolumeUp\"\n\tK_VOLUMEDOWN     = C.SDLK_VOLUMEDOWN     // \"VolumeDown\"\n\tK_KP_COMMA       = C.SDLK_KP_COMMA       // \"Keypad ,\" (the Comma key (numeric keypad))\n\tK_KP_EQUALSAS400 = C.SDLK_KP_EQUALSAS400 // \"Keypad = (AS400)\" (the Equals AS400 key (numeric keypad))\n\n\tK_ALTERASE   = C.SDLK_ALTERASE   // \"AltErase\" (Erase-Eaze)\n\tK_SYSREQ     = C.SDLK_SYSREQ     // \"SysReq\" (the SysReq key)\n\tK_CANCEL     = C.SDLK_CANCEL     // \"Cancel\"\n\tK_CLEAR      = C.SDLK_CLEAR      // \"Clear\"\n\tK_PRIOR      = C.SDLK_PRIOR      // \"Prior\"\n\tK_RETURN2    = C.SDLK_RETURN2    // \"Return\"\n\tK_SEPARATOR  = C.SDLK_SEPARATOR  // \"Separator\"\n\tK_OUT        = C.SDLK_OUT        // \"Out\"\n\tK_OPER       = C.SDLK_OPER       // \"Oper\"\n\tK_CLEARAGAIN = C.SDLK_CLEARAGAIN // \"Clear / Again\"\n\tK_CRSEL      = C.SDLK_CRSEL      // \"CrSel\"\n\tK_EXSEL      = C.SDLK_EXSEL      // \"ExSel\"\n\n\tK_KP_00              = C.SDLK_KP_00              // \"Keypad 00\" (the 00 key (numeric keypad))\n\tK_KP_000             = C.SDLK_KP_000             // \"Keypad 000\" (the 000 key (numeric keypad))\n\tK_THOUSANDSSEPARATOR = C.SDLK_THOUSANDSSEPARATOR // \"ThousandsSeparator\" (the Thousands Separator key)\n\tK_DECIMALSEPARATOR   = C.SDLK_DECIMALSEPARATOR   // \"DecimalSeparator\" (the Decimal Separator key)\n\tK_CURRENCYUNIT       = C.SDLK_CURRENCYUNIT       // \"CurrencyUnit\" (the Currency Unit key)\n\tK_CURRENCYSUBUNIT    = C.SDLK_CURRENCYSUBUNIT    // \"CurrencySubUnit\" (the Currency Subunit key)\n\tK_KP_LEFTPAREN       = C.SDLK_KP_LEFTPAREN       // \"Keypad (\" (the Left Parenthesis key (numeric keypad))\n\tK_KP_RIGHTPAREN      = C.SDLK_KP_RIGHTPAREN      // \"Keypad )\" (the Right Parenthesis key (numeric keypad))\n\tK_KP_LEFTBRACE       = C.SDLK_KP_LEFTBRACE       // \"Keypad {\" (the Left Brace key (numeric keypad))\n\tK_KP_RIGHTBRACE      = C.SDLK_KP_RIGHTBRACE      // \"Keypad }\" (the Right Brace key (numeric keypad))\n\tK_KP_TAB             = C.SDLK_KP_TAB             // \"Keypad Tab\" (the Tab key (numeric keypad))\n\tK_KP_BACKSPACE       = C.SDLK_KP_BACKSPACE       // \"Keypad Backspace\" (the Backspace key (numeric keypad))\n\tK_KP_A               = C.SDLK_KP_A               // \"Keypad A\" (the A key (numeric keypad))\n\tK_KP_B               = C.SDLK_KP_B               // \"Keypad B\" (the B key (numeric keypad))\n\tK_KP_C               = C.SDLK_KP_C               // \"Keypad C\" (the C key (numeric keypad))\n\tK_KP_D               = C.SDLK_KP_D               // \"Keypad D\" (the D key (numeric keypad))\n\tK_KP_E               = C.SDLK_KP_E               // \"Keypad E\" (the E key (numeric keypad))\n\tK_KP_F               = C.SDLK_KP_F               // \"Keypad F\" (the F key (numeric keypad))\n\tK_KP_XOR             = C.SDLK_KP_XOR             // \"Keypad XOR\" (the XOR key (numeric keypad))\n\tK_KP_POWER           = C.SDLK_KP_POWER           // \"Keypad ^\" (the Power key (numeric keypad))\n\tK_KP_PERCENT         = C.SDLK_KP_PERCENT         // \"Keypad %\" (the Percent key (numeric keypad))\n\tK_KP_LESS            = C.SDLK_KP_LESS            // \"Keypad <\" (the Less key (numeric keypad))\n\tK_KP_GREATER         = C.SDLK_KP_GREATER         // \"Keypad >\" (the Greater key (numeric keypad))\n\tK_KP_AMPERSAND       = C.SDLK_KP_AMPERSAND       // \"Keypad &\" (the & key (numeric keypad))\n\tK_KP_DBLAMPERSAND    = C.SDLK_KP_DBLAMPERSAND    // \"Keypad &&\" (the && key (numeric keypad))\n\tK_KP_VERTICALBAR     = C.SDLK_KP_VERTICALBAR     // \"Keypad |\" (the | key (numeric keypad))\n\tK_KP_DBLVERTICALBAR  = C.SDLK_KP_DBLVERTICALBAR  // \"Keypad ||\" (the || key (numeric keypad))\n\tK_KP_COLON           = C.SDLK_KP_COLON           // \"Keypad :\" (the : key (numeric keypad))\n\tK_KP_HASH            = C.SDLK_KP_HASH            // \"Keypad #\" (the # key (numeric keypad))\n\tK_KP_SPACE           = C.SDLK_KP_SPACE           // \"Keypad Space\" (the Space key (numeric keypad))\n\tK_KP_AT              = C.SDLK_KP_AT              // \"Keypad @\" (the @ key (numeric keypad))\n\tK_KP_EXCLAM          = C.SDLK_KP_EXCLAM          // \"Keypad !\" (the ! key (numeric keypad))\n\tK_KP_MEMSTORE        = C.SDLK_KP_MEMSTORE        // \"Keypad MemStore\" (the Mem Store key (numeric keypad))\n\tK_KP_MEMRECALL       = C.SDLK_KP_MEMRECALL       // \"Keypad MemRecall\" (the Mem Recall key (numeric keypad))\n\tK_KP_MEMCLEAR        = C.SDLK_KP_MEMCLEAR        // \"Keypad MemClear\" (the Mem Clear key (numeric keypad))\n\tK_KP_MEMADD          = C.SDLK_KP_MEMADD          // \"Keypad MemAdd\" (the Mem Add key (numeric keypad))\n\tK_KP_MEMSUBTRACT     = C.SDLK_KP_MEMSUBTRACT     // \"Keypad MemSubtract\" (the Mem Subtract key (numeric keypad))\n\tK_KP_MEMMULTIPLY     = C.SDLK_KP_MEMMULTIPLY     // \"Keypad MemMultiply\" (the Mem Multiply key (numeric keypad))\n\tK_KP_MEMDIVIDE       = C.SDLK_KP_MEMDIVIDE       // \"Keypad MemDivide\" (the Mem Divide key (numeric keypad))\n\tK_KP_PLUSMINUS       = C.SDLK_KP_PLUSMINUS       // \"Keypad +/-\" (the +/- key (numeric keypad))\n\tK_KP_CLEAR           = C.SDLK_KP_CLEAR           // \"Keypad Clear\" (the Clear key (numeric keypad))\n\tK_KP_CLEARENTRY      = C.SDLK_KP_CLEARENTRY      // \"Keypad ClearEntry\" (the Clear Entry key (numeric keypad))\n\tK_KP_BINARY          = C.SDLK_KP_BINARY          // \"Keypad Binary\" (the Binary key (numeric keypad))\n\tK_KP_OCTAL           = C.SDLK_KP_OCTAL           // \"Keypad Octal\" (the Octal key (numeric keypad))\n\tK_KP_DECIMAL         = C.SDLK_KP_DECIMAL         // \"Keypad Decimal\" (the Decimal key (numeric keypad))\n\tK_KP_HEXADECIMAL     = C.SDLK_KP_HEXADECIMAL     // \"Keypad Hexadecimal\" (the Hexadecimal key (numeric keypad))\n\n\tK_LCTRL  = C.SDLK_LCTRL  // \"Left Ctrl\"\n\tK_LSHIFT = C.SDLK_LSHIFT // \"Left Shift\"\n\tK_LALT   = C.SDLK_LALT   // \"Left Alt\" (alt, option)\n\tK_LGUI   = C.SDLK_LGUI   // \"Left GUI\" (windows, command (apple), meta)\n\tK_RCTRL  = C.SDLK_RCTRL  // \"Right Ctrl\"\n\tK_RSHIFT = C.SDLK_RSHIFT // \"Right Shift\"\n\tK_RALT   = C.SDLK_RALT   // \"Right Alt\" (alt, option)\n\tK_RGUI   = C.SDLK_RGUI   // \"Right GUI\" (windows, command (apple), meta)\n\n\tK_MODE = C.SDLK_MODE // \"ModeSwitch\" (I'm not sure if this is really not covered by any of the above, but since there's a special KMOD_MODE for it I'm adding it here)\n\n\tK_AUDIONEXT    = C.SDLK_AUDIONEXT    // \"AudioNext\" (the Next Track media key)\n\tK_AUDIOPREV    = C.SDLK_AUDIOPREV    // \"AudioPrev\" (the Previous Track media key)\n\tK_AUDIOSTOP    = C.SDLK_AUDIOSTOP    // \"AudioStop\" (the Stop media key)\n\tK_AUDIOPLAY    = C.SDLK_AUDIOPLAY    // \"AudioPlay\" (the Play media key)\n\tK_AUDIOMUTE    = C.SDLK_AUDIOMUTE    // \"AudioMute\" (the Mute volume key)\n\tK_MEDIASELECT  = C.SDLK_MEDIASELECT  // \"MediaSelect\" (the Media Select key)\n\tK_WWW          = C.SDLK_WWW          // \"WWW\" (the WWW/World Wide Web key)\n\tK_MAIL         = C.SDLK_MAIL         // \"Mail\" (the Mail/eMail key)\n\tK_CALCULATOR   = C.SDLK_CALCULATOR   // \"Calculator\" (the Calculator key)\n\tK_COMPUTER     = C.SDLK_COMPUTER     // \"Computer\" (the My Computer key)\n\tK_AC_SEARCH    = C.SDLK_AC_SEARCH    // \"AC Search\" (the Search key (application control keypad))\n\tK_AC_HOME      = C.SDLK_AC_HOME      // \"AC Home\" (the Home key (application control keypad))\n\tK_AC_BACK      = C.SDLK_AC_BACK      // \"AC Back\" (the Back key (application control keypad))\n\tK_AC_FORWARD   = C.SDLK_AC_FORWARD   // \"AC Forward\" (the Forward key (application control keypad))\n\tK_AC_STOP      = C.SDLK_AC_STOP      // \"AC Stop\" (the Stop key (application control keypad))\n\tK_AC_REFRESH   = C.SDLK_AC_REFRESH   // \"AC Refresh\" (the Refresh key (application control keypad))\n\tK_AC_BOOKMARKS = C.SDLK_AC_BOOKMARKS // \"AC Bookmarks\" (the Bookmarks key (application control keypad))\n\n\tK_BRIGHTNESSDOWN = C.SDLK_BRIGHTNESSDOWN // \"BrightnessDown\" (the Brightness Down key)\n\tK_BRIGHTNESSUP   = C.SDLK_BRIGHTNESSUP   // \"BrightnessUp\" (the Brightness Up key)\n\tK_DISPLAYSWITCH  = C.SDLK_DISPLAYSWITCH  // \"DisplaySwitch\" (display mirroring/dual display switch, video mode switch)\n\tK_KBDILLUMTOGGLE = C.SDLK_KBDILLUMTOGGLE // \"KBDIllumToggle\" (the Keyboard Illumination Toggle key)\n\tK_KBDILLUMDOWN   = C.SDLK_KBDILLUMDOWN   // \"KBDIllumDown\" (the Keyboard Illumination Down key)\n\tK_KBDILLUMUP     = C.SDLK_KBDILLUMUP     // \"KBDIllumUp\" (the Keyboard Illumination Up key)\n\tK_EJECT          = C.SDLK_EJECT          // \"Eject\" (the Eject key)\n\tK_SLEEP          = C.SDLK_SLEEP          // \"Sleep\" (the Sleep key)\n)\n\n// An enumeration of key modifier masks.\n// (https://wiki.libsdl.org/SDL_Keymod)\nconst (\n\tKMOD_NONE     = C.KMOD_NONE     // 0 (no modifier is applicable)\n\tKMOD_LSHIFT   = C.KMOD_LSHIFT   // the left Shift key is down\n\tKMOD_RSHIFT   = C.KMOD_RSHIFT   // the right Shift key is down\n\tKMOD_LCTRL    = C.KMOD_LCTRL    // the left Ctrl (Control) key is down\n\tKMOD_RCTRL    = C.KMOD_RCTRL    // the right Ctrl (Control) key is down\n\tKMOD_LALT     = C.KMOD_LALT     // the left Alt key is down\n\tKMOD_RALT     = C.KMOD_RALT     // the right Alt key is down\n\tKMOD_LGUI     = C.KMOD_LGUI     // the left GUI key (often the Windows key) is down\n\tKMOD_RGUI     = C.KMOD_RGUI     // the right GUI key (often the Windows key) is down\n\tKMOD_NUM      = C.KMOD_NUM      // the Num Lock key (may be located on an extended keypad) is down\n\tKMOD_CAPS     = C.KMOD_CAPS     // the Caps Lock key is down\n\tKMOD_MODE     = C.KMOD_MODE     // the AltGr key is down\n\tKMOD_CTRL     = C.KMOD_CTRL     // (KMOD_LCTRL|KMOD_RCTRL)\n\tKMOD_SHIFT    = C.KMOD_SHIFT    // (KMOD_LSHIFT|KMOD_RSHIFT)\n\tKMOD_ALT      = C.KMOD_ALT      // (KMOD_LALT|KMOD_RALT)\n\tKMOD_GUI      = C.KMOD_GUI      // (KMOD_LGUI|KMOD_RGUI)\n\tKMOD_RESERVED = C.KMOD_RESERVED // reserved for future use\n)\n\n// Keycode is the SDL virtual key representation.\n// (https://wiki.libsdl.org/SDL_Keycode)\ntype Keycode C.SDL_Keycode\n\n// Keymod is a key modifier masks.\n// (https://wiki.libsdl.org/SDL_Keymod)\ntype Keymod C.SDL_Keymod\n\nfunc (code Keycode) c() C.SDL_Keycode {\n\treturn C.SDL_Keycode(code)\n}\n\nfunc (mod Keymod) c() C.SDL_Keymod {\n\treturn C.SDL_Keymod(mod)\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/loadso.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\nimport \"unsafe\"\n\n// SharedObject is a pointer to the object handle.\ntype SharedObject uintptr\n\n// LoadObject dynamically loads a shared object and returns a pointer to the object handle.\n// (https://wiki.libsdl.org/SDL_LoadObject)\nfunc LoadObject(sofile string) SharedObject {\n\t_sofile := C.CString(sofile)\n\tdefer C.free(unsafe.Pointer(_sofile))\n\treturn (SharedObject)(C.SDL_LoadObject(_sofile))\n}\n\n// LoadFunction returns a pointer to the named function from the shared object.\n// (https://wiki.libsdl.org/SDL_LoadFunction)\nfunc (handle SharedObject) LoadFunction(name string) unsafe.Pointer {\n\t_name := C.CString(name)\n\tdefer C.free(unsafe.Pointer(_name))\n\treturn (unsafe.Pointer)(C.SDL_LoadFunction((unsafe.Pointer)(handle), _name))\n}\n\n// Unload unloads a shared object from memory.\n// (https://wiki.libsdl.org/SDL_UnloadObject)\nfunc (handle SharedObject) Unload() {\n\tC.SDL_UnloadObject((unsafe.Pointer)(handle))\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/log.c",
    "content": "#include \"_cgo_export.h\"\n\nvoid LogSetOutputFunction(void *data)\n{\n    SDL_LogSetOutputFunction((SDL_LogOutputFunction)logOutputFunction, data);\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/log.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n#include \"log.h\"\n\nstatic inline void _SDL_Log(const char *fmt)\n{\n    SDL_Log(\"%s\", fmt);\n}\n\nstatic inline void _SDL_LogVerbose(int category, const char *fmt)\n{\n    SDL_LogVerbose(category, \"%s\", fmt);\n}\n\nstatic inline void _SDL_LogDebug(int category, const char *fmt)\n{\n    SDL_LogDebug(category, \"%s\", fmt);\n}\n\nstatic inline void _SDL_LogInfo(int category, const char *fmt)\n{\n    SDL_LogInfo(category, \"%s\", fmt);\n}\n\nstatic inline void _SDL_LogWarn(int category, const char *fmt)\n{\n    SDL_LogWarn(category, \"%s\", fmt);\n}\n\nstatic inline void _SDL_LogError(int category, const char *fmt)\n{\n    SDL_LogError(category, \"%s\", fmt);\n}\n\nstatic inline void _SDL_LogCritical(int category, const char *fmt)\n{\n    SDL_LogCritical(category, \"%s\", fmt);\n}\n\nstatic inline void _SDL_LogMessage(int category, SDL_LogPriority priority, const char *fmt)\n{\n    SDL_LogCritical(category, \"%s\", fmt);\n}\n*/\nimport \"C\"\nimport \"fmt\"\nimport \"unsafe\"\n\n// An enumeration of the predefined log categories.\n// (https://wiki.libsdl.org/SDL_LOG_CATEGORY)\nconst (\n\tLOG_CATEGORY_APPLICATION = iota // application log\n\tLOG_CATEGORY_ERROR              // error log\n\tLOG_CATEGORY_ASSERT             // assert log\n\tLOG_CATEGORY_SYSTEM             // system log\n\tLOG_CATEGORY_AUDIO              // audio log\n\tLOG_CATEGORY_VIDEO              // video log\n\tLOG_CATEGORY_RENDER             // render log\n\tLOG_CATEGORY_INPUT              // input log\n\tLOG_CATEGORY_TEST               // test log\n\tLOG_CATEGORY_RESERVED1          // reserved for future SDL library use\n\tLOG_CATEGORY_RESERVED2          // reserved for future SDL library use\n\tLOG_CATEGORY_RESERVED3          // reserved for future SDL library use\n\tLOG_CATEGORY_RESERVED4          // reserved for future SDL library use\n\tLOG_CATEGORY_RESERVED5          // reserved for future SDL library use\n\tLOG_CATEGORY_RESERVED6          // reserved for future SDL library use\n\tLOG_CATEGORY_RESERVED7          // reserved for future SDL library use\n\tLOG_CATEGORY_RESERVED8          // reserved for future SDL library use\n\tLOG_CATEGORY_RESERVED9          // reserved for future SDL library use\n\tLOG_CATEGORY_RESERVED10         // reserved for future SDL library use\n\tLOG_CATEGORY_CUSTOM             // reserved for application use\n)\n\n// An enumeration of the predefined log priorities.\n// (https://wiki.libsdl.org/SDL_LogPriority)\nconst (\n\tLOG_PRIORITY_VERBOSE  = iota + 1 // verbose\n\tLOG_PRIORITY_DEBUG               // debug\n\tLOG_PRIORITY_INFO                // info\n\tLOG_PRIORITY_WARN                // warn\n\tLOG_PRIORITY_ERROR               // error\n\tLOG_PRIORITY_CRITICAL            // critical\n\tNUM_LOG_PRIORITIES               // (internal use)\n)\n\n// LogPriority is a predefined log priority.\n// (https://wiki.libsdl.org/SDL_LogPriority)\ntype LogPriority C.SDL_LogPriority\n\nfunc (p LogPriority) c() C.SDL_LogPriority {\n\treturn C.SDL_LogPriority(p)\n}\n\n// LogSetAllPriority sets the priority of all log categories.\n// (https://wiki.libsdl.org/SDL_LogSetAllPriority)\nfunc LogSetAllPriority(p LogPriority) {\n\tC.SDL_LogSetAllPriority(p.c())\n}\n\n// LogSetPriority sets the priority of a particular log category.\n// (https://wiki.libsdl.org/SDL_LogSetPriority)\nfunc LogSetPriority(category int, p LogPriority) {\n\tC.SDL_LogSetPriority(C.int(category), p.c())\n}\n\n// LogGetPriority returns the priority of a particular log category.\n// (https://wiki.libsdl.org/SDL_LogGetPriority)\nfunc LogGetPriority(category int) LogPriority {\n\treturn LogPriority(C.SDL_LogGetPriority(C.int(category)))\n}\n\n// LogResetPriorities resets all priorities to default.\n// (https://wiki.libsdl.org/SDL_LogResetPriorities)\nfunc LogResetPriorities() {\n\tC.SDL_LogResetPriorities()\n}\n\n// Log logs a message with LOG_CATEGORY_APPLICATION and LOG_PRIORITY_INFO.\n// (https://wiki.libsdl.org/SDL_Log)\nfunc Log(str string, args ...interface{}) {\n\tstr = fmt.Sprintf(str, args...)\n\n\tcstr := C.CString(str)\n\tdefer C.free(unsafe.Pointer(cstr))\n\n\tC._SDL_Log(cstr)\n}\n\n// LogVerbose logs a message with LOG_PRIORITY_VERBOSE.\n// (https://wiki.libsdl.org/SDL_LogVerbose)\nfunc LogVerbose(category int, str string, args ...interface{}) {\n\tstr = fmt.Sprintf(str, args...)\n\n\tcstr := C.CString(str)\n\tdefer C.free(unsafe.Pointer(cstr))\n\n\tC._SDL_LogVerbose(C.int(category), cstr)\n}\n\n// LogDebug logs a message with LOG_PRIORITY_DEBUG.\n// (https://wiki.libsdl.org/SDL_LogDebug)\nfunc LogDebug(category int, str string, args ...interface{}) {\n\tstr = fmt.Sprintf(str, args...)\n\n\tcstr := C.CString(str)\n\tdefer C.free(unsafe.Pointer(cstr))\n\n\tC._SDL_LogDebug(C.int(category), cstr)\n}\n\n// LogInfo logs a message with LOG_PRIORITY_INFO.\n// (https://wiki.libsdl.org/SDL_LogInfo)\nfunc LogInfo(category int, str string, args ...interface{}) {\n\tstr = fmt.Sprintf(str, args...)\n\n\tcstr := C.CString(str)\n\tdefer C.free(unsafe.Pointer(cstr))\n\n\tC._SDL_LogInfo(C.int(category), cstr)\n}\n\n// LogWarn logs a message with LOG_PRIORITY_WARN.\n// (https://wiki.libsdl.org/SDL_LogWarn)\nfunc LogWarn(category int, str string, args ...interface{}) {\n\tstr = fmt.Sprintf(str, args...)\n\n\tcstr := C.CString(str)\n\tdefer C.free(unsafe.Pointer(cstr))\n\n\tC._SDL_LogWarn(C.int(category), cstr)\n}\n\n// LogError logs a message with LOG_PRIORITY_ERROR.\n// (https://wiki.libsdl.org/SDL_LogError)\nfunc LogError(category int, str string, args ...interface{}) {\n\tstr = fmt.Sprintf(str, args...)\n\n\tcstr := C.CString(str)\n\tdefer C.free(unsafe.Pointer(cstr))\n\n\tC._SDL_LogError(C.int(category), cstr)\n}\n\n// LogCritical logs a message with LOG_PRIORITY_CRITICAL.\n// (https://wiki.libsdl.org/SDL_LogCritical)\nfunc LogCritical(category int, str string, args ...interface{}) {\n\tstr = fmt.Sprintf(str, args...)\n\n\tcstr := C.CString(str)\n\tdefer C.free(unsafe.Pointer(cstr))\n\n\tC._SDL_LogCritical(C.int(category), cstr)\n}\n\n// LogMessage logs a message with the specified category and priority.\n// (https://wiki.libsdl.org/SDL_LogMessage)\nfunc LogMessage(category int, pri LogPriority, str string, args ...interface{}) {\n\tstr = fmt.Sprintf(str, args...)\n\n\tcstr := C.CString(str)\n\tdefer C.free(unsafe.Pointer(cstr))\n\n\tC._SDL_LogMessage(C.int(category), C.SDL_LogPriority(pri), cstr)\n}\n\n// LogOutputFunction is the function to call instead of the default\ntype LogOutputFunction func(data interface{}, category int, pri LogPriority, message string)\n\ntype logOutputFunctionCtx struct {\n\tf LogOutputFunction\n\td interface{}\n}\n\n// Yissakhar Z. Beck (DeedleFake)'s implementation\n//\n//export logOutputFunction\nfunc logOutputFunction(data unsafe.Pointer, category C.int, pri C.SDL_LogPriority, message *C.char) {\n\tctx := (*logOutputFunctionCtx)(data)\n\n\tctx.f(ctx.d, int(category), LogPriority(pri), C.GoString(message))\n}\n\nvar (\n\tlogOutputFunctionCache LogOutputFunction\n\tlogOutputDataCache     interface{}\n)\n\n// LogGetOutputFunction returns the current log output function.\n// (https://wiki.libsdl.org/SDL_LogGetOutputFunction)\nfunc LogGetOutputFunction() (LogOutputFunction, interface{}) {\n\treturn logOutputFunctionCache, logOutputDataCache\n}\n\n// LogSetOutputFunction replaces the default log output function with one of your own.\n// (https://wiki.libsdl.org/SDL_LogSetOutputFunction)\nfunc LogSetOutputFunction(f LogOutputFunction, data interface{}) {\n\tctx := &logOutputFunctionCtx{\n\t\tf: f,\n\t\td: data,\n\t}\n\n\tC.LogSetOutputFunction(unsafe.Pointer(ctx))\n\n\tlogOutputFunctionCache = f\n\tlogOutputDataCache = data\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/log.h",
    "content": "void LogSetOutputFunction(void *data);\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/mouse.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if defined(__WIN32)\n#include <SDL2/SDL_syswm.h>\n#else\n#include <SDL_syswm.h>\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,4))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_CaptureMouse is not supported before SDL 2.0.4\")\n#endif\n\nstatic int SDL_CaptureMouse(SDL_bool enabled)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_MOUSEWHEEL_NORMAL is not supported before SDL 2.0.4\")\n#endif\n\n#define SDL_MOUSEWHEEL_NORMAL (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_MOUSEWHEEL_FLIPPED is not supported before SDL 2.0.4\")\n#endif\n\n#define SDL_MOUSEWHEEL_FLIPPED (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WarpMouseGlobal is not supported before SDL 2.0.4\")\n#endif\n\nstatic int SDL_WarpMouseGlobal(int x, int y)\n{\n\treturn -1;\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetGlobalMouseState is not supported before SDL 2.0.4\")\n#endif\n\nstatic Uint32 SDL_GetGlobalMouseState(int *x, int *y)\n{\n\treturn 0;\n}\n\n#endif\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// Cursor types for CreateSystemCursor()\nconst (\n\tSYSTEM_CURSOR_ARROW     = C.SDL_SYSTEM_CURSOR_ARROW     // arrow\n\tSYSTEM_CURSOR_IBEAM     = C.SDL_SYSTEM_CURSOR_IBEAM     // i-beam\n\tSYSTEM_CURSOR_WAIT      = C.SDL_SYSTEM_CURSOR_WAIT      // wait\n\tSYSTEM_CURSOR_CROSSHAIR = C.SDL_SYSTEM_CURSOR_CROSSHAIR // crosshair\n\tSYSTEM_CURSOR_WAITARROW = C.SDL_SYSTEM_CURSOR_WAITARROW // small wait cursor (or wait if not available)\n\tSYSTEM_CURSOR_SIZENWSE  = C.SDL_SYSTEM_CURSOR_SIZENWSE  // double arrow pointing northwest and southeast\n\tSYSTEM_CURSOR_SIZENESW  = C.SDL_SYSTEM_CURSOR_SIZENESW  // double arrow pointing northeast and southwest\n\tSYSTEM_CURSOR_SIZEWE    = C.SDL_SYSTEM_CURSOR_SIZEWE    // double arrow pointing west and east\n\tSYSTEM_CURSOR_SIZENS    = C.SDL_SYSTEM_CURSOR_SIZENS    // double arrow pointing north and south\n\tSYSTEM_CURSOR_SIZEALL   = C.SDL_SYSTEM_CURSOR_SIZEALL   // four pointed arrow pointing north, south, east, and west\n\tSYSTEM_CURSOR_NO        = C.SDL_SYSTEM_CURSOR_NO        // slashed circle or crossbones\n\tSYSTEM_CURSOR_HAND      = C.SDL_SYSTEM_CURSOR_HAND      // hand\n\tNUM_SYSTEM_CURSORS      = C.SDL_NUM_SYSTEM_CURSORS      // (only for bounding internal arrays)\n)\n\n// Scroll direction types for the Scroll event\nconst (\n\tMOUSEWHEEL_NORMAL  = C.SDL_MOUSEWHEEL_NORMAL  // the scroll direction is normal\n\tMOUSEWHEEL_FLIPPED = C.SDL_MOUSEWHEEL_FLIPPED // the scroll direction is flipped / natural\n)\n\n// Used as a mask when testing buttons in buttonstate.\nconst (\n\tBUTTON_LEFT   = C.SDL_BUTTON_LEFT   // left mouse button\n\tBUTTON_MIDDLE = C.SDL_BUTTON_MIDDLE // middle mouse button\n\tBUTTON_RIGHT  = C.SDL_BUTTON_RIGHT  // right mouse button\n\tBUTTON_X1     = C.SDL_BUTTON_X1     // x1 mouse button\n\tBUTTON_X2     = C.SDL_BUTTON_X2     // x2 mouse button\n)\n\n// Cursor is a custom cursor created by CreateCursor() or CreateColorCursor().\ntype Cursor C.SDL_Cursor\n\n// SystemCursor is a system cursor created by CreateSystemCursor().\ntype SystemCursor C.SDL_SystemCursor\n\nfunc (c *Cursor) cptr() *C.SDL_Cursor {\n\treturn (*C.SDL_Cursor)(unsafe.Pointer(c))\n}\n\nfunc (c SystemCursor) c() C.SDL_SystemCursor {\n\treturn C.SDL_SystemCursor(c)\n}\n\n// GetMouseFocus returns the window which currently has mouse focus.\n// (https://wiki.libsdl.org/SDL_GetMouseFocus)\nfunc GetMouseFocus() *Window {\n\treturn (*Window)(unsafe.Pointer(C.SDL_GetMouseFocus()))\n}\n\n// GetGlobalMouseState returns the current state of the mouse.\n// (https://wiki.libsdl.org/SDL_GetGlobalMouseState)\nfunc GetGlobalMouseState() (x, y int32, state uint32) {\n\tvar _x, _y C.int\n\t_state := uint32(C.SDL_GetGlobalMouseState(&_x, &_y))\n\treturn int32(_x), int32(_y), _state\n}\n\n// GetMouseState returns the current state of the mouse.\n// (https://wiki.libsdl.org/SDL_GetMouseState)\nfunc GetMouseState() (x, y int32, state uint32) {\n\tvar _x, _y C.int\n\t_state := uint32(C.SDL_GetMouseState(&_x, &_y))\n\treturn int32(_x), int32(_y), _state\n}\n\n// GetRelativeMouseState returns the relative state of the mouse.\n// (https://wiki.libsdl.org/SDL_GetRelativeMouseState)\nfunc GetRelativeMouseState() (x, y int32, state uint32) {\n\tvar _x, _y C.int\n\t_state := uint32(C.SDL_GetRelativeMouseState(&_x, &_y))\n\treturn int32(_x), int32(_y), _state\n}\n\n// WarpMouseInWindow moves the mouse to the given position within the window.\n// (https://wiki.libsdl.org/SDL_WarpMouseInWindow)\nfunc (window *Window) WarpMouseInWindow(x, y int32) {\n\tC.SDL_WarpMouseInWindow(window.cptr(), C.int(x), C.int(y))\n}\n\n// SetRelativeMouseMode sets relative mouse mode.\n// (https://wiki.libsdl.org/SDL_SetRelativeMouseMode)\nfunc SetRelativeMouseMode(enabled bool) int {\n\treturn int(C.SDL_SetRelativeMouseMode(C.SDL_bool(Btoi(enabled))))\n}\n\n// GetRelativeMouseMode reports where relative mouse mode is enabled.\n// (https://wiki.libsdl.org/SDL_GetRelativeMouseMode)\nfunc GetRelativeMouseMode() bool {\n\treturn C.SDL_GetRelativeMouseMode() > 0\n}\n\n// CreateCursor creates a cursor using the specified bitmap data and mask (in MSB format).\n// (https://wiki.libsdl.org/SDL_CreateCursor)\nfunc CreateCursor(data, mask *uint8, w, h, hotX, hotY int32) *Cursor {\n\t_data := (*C.Uint8)(unsafe.Pointer(data))\n\t_mask := (*C.Uint8)(unsafe.Pointer(mask))\n\treturn (*Cursor)(C.SDL_CreateCursor(_data, _mask, C.int(w), C.int(h), C.int(hotX), C.int(hotY)))\n}\n\n// CreateColorCursor creates a color cursor.\n// (https://wiki.libsdl.org/SDL_CreateColorCursor)\nfunc CreateColorCursor(surface *Surface, hotX, hotY int32) *Cursor {\n\treturn (*Cursor)(C.SDL_CreateColorCursor(surface.cptr(), C.int(hotX), C.int(hotY)))\n}\n\n// CreateSystemCursor creates a system cursor.\n// (https://wiki.libsdl.org/SDL_CreateSystemCursor)\nfunc CreateSystemCursor(id SystemCursor) *Cursor {\n\treturn (*Cursor)(C.SDL_CreateSystemCursor(id.c()))\n}\n\n// SetCursor sets the active cursor.\n// (https://wiki.libsdl.org/SDL_SetCursor)\nfunc SetCursor(cursor *Cursor) {\n\tC.SDL_SetCursor(cursor.cptr())\n}\n\n// GetCursor returns the active cursor.\n// (https://wiki.libsdl.org/SDL_GetCursor)\nfunc GetCursor() *Cursor {\n\treturn (*Cursor)(C.SDL_GetCursor())\n}\n\n// GetDefaultCursor returns the default cursor.\n// (https://wiki.libsdl.org/SDL_GetDefaultCursor)\nfunc GetDefaultCursor() *Cursor {\n\treturn (*Cursor)(C.SDL_GetDefaultCursor())\n}\n\n// FreeCursor frees a cursor created with CreateCursor(), CreateColorCursor() or CreateSystemCursor().\n// (https://wiki.libsdl.org/SDL_FreeCursor)\nfunc FreeCursor(cursor *Cursor) {\n\tC.SDL_FreeCursor(cursor.cptr())\n}\n\n// ShowCursor toggles whether or not the cursor is shown.\n// (https://wiki.libsdl.org/SDL_ShowCursor)\nfunc ShowCursor(toggle int) (int, error) {\n\ti := int(C.SDL_ShowCursor(C.int(toggle)))\n\treturn i, errorFromInt(i)\n}\n\n// CaptureMouse captures the mouse and tracks input outside an SDL window.\n// (https://wiki.libsdl.org/SDL_CaptureMouse)\nfunc CaptureMouse(toggle bool) error {\n\tvar ierr C.int\n\tif toggle {\n\t\tierr = C.SDL_CaptureMouse(C.SDL_TRUE)\n\t} else {\n\t\tierr = C.SDL_CaptureMouse(C.SDL_FALSE)\n\t}\n\tif ierr != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Button is used as a mask when testing buttons in buttonstate.\nfunc Button(flag uint32) uint32 {\n\treturn 1 << (flag - 1)\n}\n\n// ButtonLMask is used as a mask when testing buttons in buttonstate.\nfunc ButtonLMask() uint32 {\n\treturn Button(BUTTON_LEFT)\n}\n\n// ButtonMMask is used as a mask when testing buttons in buttonstate.\nfunc ButtonMMask() uint32 {\n\treturn Button(BUTTON_MIDDLE)\n}\n\n// ButtonRMask is used as a mask when testing buttons in buttonstate.\nfunc ButtonRMask() uint32 {\n\treturn Button(BUTTON_RIGHT)\n}\n\n// ButtonX1Mask is used as a mask when testing buttons in buttonstate.\nfunc ButtonX1Mask() uint32 {\n\treturn Button(BUTTON_X1)\n}\n\n// ButtonX2Mask is used as a mask when testing buttons in buttonstate.\nfunc ButtonX2Mask() uint32 {\n\treturn Button(BUTTON_X2)\n}\n\n// WarpMouseGlobal moves the mouse to the given position in global screen space.\n// (https://wiki.libsdl.org/SDL_WarpMouseGlobal)\nfunc WarpMouseGlobal(x, y int32) error {\n\ti := int(C.SDL_WarpMouseGlobal(C.int(x), C.int(y)))\n\treturn errorFromInt(i)\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/mutex.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\nimport \"unsafe\"\n\n// ThreadID is the thread identifier for a thread.\ntype ThreadID uint64\n\n// Mutex is the SDL mutex structure.\ntype Mutex struct {\n\tRecursive int\n\tOwner     ThreadID\n\tSem       *Sem\n}\n\n// Sem is the SDL semaphore structure.\ntype Sem struct {\n\tCount        uint32\n\tWaitersCount uint32\n\tCountLock    *Mutex\n\tCountNonzero *Cond\n}\n\n// Cond is the SDL condition variable structure.\ntype Cond struct {\n\tLock     *Mutex\n\tWaiting  int\n\tSignals  int\n\tWaitSem  *Sem\n\tWaitDone *Sem\n}\n\nfunc (m *Mutex) cptr() *C.SDL_mutex {\n\treturn (*C.SDL_mutex)(unsafe.Pointer(m))\n}\n\nfunc (s *Sem) cptr() *C.SDL_sem {\n\treturn (*C.SDL_sem)(unsafe.Pointer(s))\n}\n\nfunc (c *Cond) cptr() *C.SDL_cond {\n\treturn (*C.SDL_cond)(unsafe.Pointer(c))\n}\n\n// CreateMutex creates a new mutex.\n// (https://wiki.libsdl.org/SDL_CreateMutex)\nfunc CreateMutex() (*Mutex, error) {\n\tmutex := C.SDL_CreateMutex()\n\tif mutex == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Mutex)(unsafe.Pointer(mutex)), nil\n}\n\n// Lock locks a mutex created with CreateMutex().\n// (https://wiki.libsdl.org/SDL_LockMutex)\nfunc (mutex *Mutex) Lock() error {\n\tret := int(C.SDL_LockMutex(mutex.cptr()))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// TryLock tries to lock a mutex without blocking.\n// (https://wiki.libsdl.org/SDL_TryLockMutex)\nfunc (mutex *Mutex) TryLock() error {\n\tret := int(C.SDL_TryLockMutex(mutex.cptr()))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Unlock unlocks a mutex created with CreateMutex().\n// (https://wiki.libsdl.org/SDL_UnlockMutex)\nfunc (mutex *Mutex) Unlock() error {\n\tret := int(C.SDL_UnlockMutex(mutex.cptr()))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Destroy destroys a mutex created with CreateMutex().\n// (https://wiki.libsdl.org/SDL_DestroyMutex)\nfunc (mutex *Mutex) Destroy() {\n\tC.SDL_DestroyMutex(mutex.cptr())\n}\n\n// CreateSemaphore creates a semaphore.\n// (https://wiki.libsdl.org/SDL_CreateSemaphore)\nfunc CreateSemaphore(initialValue uint32) (*Sem, error) {\n\tsem := C.SDL_CreateSemaphore(C.Uint32(initialValue))\n\tif sem == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Sem)(unsafe.Pointer(sem)), nil\n}\n\n// Destroy destroys a semaphore.\n// (https://wiki.libsdl.org/SDL_DestroySemaphore)\nfunc (sem *Sem) Destroy() {\n\tC.SDL_DestroySemaphore(sem.cptr())\n}\n\n// Wait waits until a semaphore has a positive value and then decrements it.\n// (https://wiki.libsdl.org/SDL_SemWait)\nfunc (sem *Sem) Wait() error {\n\tret := int(C.SDL_SemWait(sem.cptr()))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// TryWait sees if a semaphore has a positive value and decrement it if it does.\n// (https://wiki.libsdl.org/SDL_SemTryWait)\nfunc (sem *Sem) TryWait() error {\n\tret := int(C.SDL_SemTryWait(sem.cptr()))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// WaitTimeout waits until a semaphore has a positive value and then decrements it.\n// (https://wiki.libsdl.org/SDL_SemWaitTimeout)\nfunc (sem *Sem) WaitTimeout(ms uint32) error {\n\tret := int(C.SDL_SemWaitTimeout(sem.cptr(), C.Uint32(ms)))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Post atomically increments a semaphore's value and wake waiting threads.\n// (https://wiki.libsdl.org/SDL_SemPost)\nfunc (sem *Sem) Post() error {\n\tret := int(C.SDL_SemPost(sem.cptr()))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Value returns the current value of a semaphore.\n// (https://wiki.libsdl.org/SDL_SemValue)\nfunc (sem *Sem) Value() uint32 {\n\treturn uint32(C.SDL_SemValue(sem.cptr()))\n}\n\n// CreateCond (https://wiki.libsdl.org/SDL_CreateCond)\nfunc CreateCond() *Cond {\n\treturn (*Cond)(unsafe.Pointer(C.SDL_CreateCond()))\n}\n\n// Destroy creates a condition variable.\n// (https://wiki.libsdl.org/SDL_DestroyCond)\nfunc (cond *Cond) Destroy() {\n\tC.SDL_DestroyCond(cond.cptr())\n}\n\n// Signal restarts one of the threads that are waiting on the condition variable.\n// (https://wiki.libsdl.org/SDL_CondSignal)\nfunc (cond *Cond) Signal() error {\n\tret := int(C.SDL_CondSignal(cond.cptr()))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Broadcast restarts all threads that are waiting on the condition variable.\n// (https://wiki.libsdl.org/SDL_CondBroadcast)\nfunc (cond *Cond) Broadcast() error {\n\tret := int(C.SDL_CondBroadcast(cond.cptr()))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Wait waits until a condition variable is signaled.\n// (https://wiki.libsdl.org/SDL_CondWait)\nfunc (cond *Cond) Wait(mutex *Mutex) error {\n\tret := int(C.SDL_CondWait(cond.cptr(), mutex.cptr()))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// WaitTimeout waits until a condition variable is signaled or a specified amount of time has passed.\n// (https://wiki.libsdl.org/SDL_CondWaitTimeout)\nfunc (cond *Cond) WaitTimeout(mutex *Mutex, ms uint32) error {\n\tret := int(C.SDL_CondWaitTimeout(cond.cptr(), mutex.cptr(), C.Uint32(ms)))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/pixels.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\n//\n// #if !(SDL_VERSION_ATLEAST(2,0,5))\n//\n// enum\n// {\n// #if SDL_BYTEORDER == SDL_BIG_ENDIAN\n//     SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_RGBA8888,\n//     SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888,\n//     SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888,\n//     SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888\n// #else\n//     SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888,\n//     SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888,\n//     SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888,\n//     SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888\n// #endif\n// };\n//\n// #endif\n//\n// int bytesPerPixel(Uint32 format) {\n//   return SDL_BYTESPERPIXEL(format);\n// }\n//\n// int bitsPerPixel(Uint32 format) {\n//   return SDL_BITSPERPIXEL(format);\n// }\nimport \"C\"\nimport (\n\t\"image/color\"\n\t\"unsafe\"\n)\n\n// PixelFormat contains pixel format information.\n// (https://wiki.libsdl.org/SDL_PixelFormat)\ntype PixelFormat struct {\n\tFormat        uint32       // one of the PIXELFORMAT values (https://wiki.libsdl.org/SDL_PixelFormatEnum)\n\tPalette       *Palette     // palette structure associated with this pixel format, or nil if the format doesn't have a palette (https://wiki.libsdl.org/SDL_Palette)\n\tBitsPerPixel  uint8        // the number of significant bits in a pixel value, eg: 8, 15, 16, 24, 32\n\tBytesPerPixel uint8        // the number of bytes required to hold a pixel value, eg: 1, 2, 3, 4\n\t_             [2]uint8     // padding\n\tRmask         uint32       // a mask representing the location of the red component of the pixel\n\tGmask         uint32       // a mask representing the location of the green component of the pixel\n\tBmask         uint32       // a mask representing the location of the blue component of the pixel\n\tAmask         uint32       // a mask representing the location of the alpha component of the pixel or 0 if the pixel format doesn't have any alpha information\n\trLoss         uint8        // (internal use)\n\tgLoss         uint8        // (internal use)\n\tbLoss         uint8        // (internal use)\n\taLoss         uint8        // (internal use)\n\trShift        uint8        // (internal use)\n\tgShift        uint8        // (internal use)\n\tbShift        uint8        // (internal use)\n\taShift        uint8        // (internal use)\n\trefCount      int32        // (internal use)\n\tnext          *PixelFormat // (internal use)\n}\ntype cPixelFormat C.SDL_PixelFormat\n\n// Palette contains palette information.\n// (https://wiki.libsdl.org/SDL_Palette)\ntype Palette struct {\n\tNcolors  int32  // the number of colors in the palette\n\tColors   *Color // an array of Color structures representing the palette (https://wiki.libsdl.org/SDL_Color)\n\tversion  uint32 // incrementally tracks changes to the palette (internal use)\n\trefCount int32  // reference count (internal use)\n}\ntype cPalette C.SDL_Palette\n\n// Color represents a color. This implements image/color.Color interface.\n// (https://wiki.libsdl.org/SDL_Color)\ntype Color color.NRGBA\n\n// Uint32 return uint32 representation of RGBA color.\nfunc (c Color) Uint32() uint32 {\n\tvar v uint32\n\tv |= uint32(c.R) << 24\n\tv |= uint32(c.G) << 16\n\tv |= uint32(c.B) << 8\n\tv |= uint32(c.A)\n\treturn v\n}\n\n// Pixel types.\nconst (\n\tPIXELTYPE_UNKNOWN  = C.SDL_PIXELTYPE_UNKNOWN\n\tPIXELTYPE_INDEX1   = C.SDL_PIXELTYPE_INDEX1\n\tPIXELTYPE_INDEX4   = C.SDL_PIXELTYPE_INDEX4\n\tPIXELTYPE_INDEX8   = C.SDL_PIXELTYPE_INDEX8\n\tPIXELTYPE_PACKED8  = C.SDL_PIXELTYPE_PACKED8\n\tPIXELTYPE_PACKED16 = C.SDL_PIXELTYPE_PACKED16\n\tPIXELTYPE_PACKED32 = C.SDL_PIXELTYPE_PACKED32\n\tPIXELTYPE_ARRAYU8  = C.SDL_PIXELTYPE_ARRAYU8\n\tPIXELTYPE_ARRAYU16 = C.SDL_PIXELTYPE_ARRAYU16\n\tPIXELTYPE_ARRAYU32 = C.SDL_PIXELTYPE_ARRAYU32\n\tPIXELTYPE_ARRAYF16 = C.SDL_PIXELTYPE_ARRAYF16\n\tPIXELTYPE_ARRAYF32 = C.SDL_PIXELTYPE_ARRAYF32\n)\n\n// Bitmap pixel order high bit -> low bit.\nconst (\n\tBITMAPORDER_NONE = C.SDL_BITMAPORDER_NONE\n\tBITMAPORDER_4321 = C.SDL_BITMAPORDER_4321\n\tBITMAPORDER_1234 = C.SDL_BITMAPORDER_1234\n)\n\n// Packed component order high bit -> low bit.\nconst (\n\tPACKEDORDER_NONE = C.SDL_PACKEDORDER_NONE\n\tPACKEDORDER_XRGB = C.SDL_PACKEDORDER_XRGB\n\tPACKEDORDER_RGBX = C.SDL_PACKEDORDER_RGBX\n\tPACKEDORDER_ARGB = C.SDL_PACKEDORDER_ARGB\n\tPACKEDORDER_RGBA = C.SDL_PACKEDORDER_RGBA\n\tPACKEDORDER_XBGR = C.SDL_PACKEDORDER_XBGR\n\tPACKEDORDER_BGRX = C.SDL_PACKEDORDER_BGRX\n\tPACKEDORDER_ABGR = C.SDL_PACKEDORDER_ABGR\n\tPACKEDORDER_BGRA = C.SDL_PACKEDORDER_BGRA\n)\n\n// Array component order low byte -> high byte.\nconst (\n\tARRAYORDER_NONE = C.SDL_ARRAYORDER_NONE\n\tARRAYORDER_RGB  = C.SDL_ARRAYORDER_RGB\n\tARRAYORDER_RGBA = C.SDL_ARRAYORDER_RGBA\n\tARRAYORDER_ARGB = C.SDL_ARRAYORDER_ARGB\n\tARRAYORDER_BGR  = C.SDL_ARRAYORDER_BGR\n\tARRAYORDER_BGRA = C.SDL_ARRAYORDER_BGRA\n\tARRAYORDER_ABGR = C.SDL_ARRAYORDER_ABGR\n)\n\n// Packed component layout.\nconst (\n\tPACKEDLAYOUT_NONE    = C.SDL_PACKEDLAYOUT_NONE\n\tPACKEDLAYOUT_332     = C.SDL_PACKEDLAYOUT_332\n\tPACKEDLAYOUT_4444    = C.SDL_PACKEDLAYOUT_4444\n\tPACKEDLAYOUT_1555    = C.SDL_PACKEDLAYOUT_1555\n\tPACKEDLAYOUT_5551    = C.SDL_PACKEDLAYOUT_5551\n\tPACKEDLAYOUT_565     = C.SDL_PACKEDLAYOUT_565\n\tPACKEDLAYOUT_8888    = C.SDL_PACKEDLAYOUT_8888\n\tPACKEDLAYOUT_2101010 = C.SDL_PACKEDLAYOUT_2101010\n\tPACKEDLAYOUT_1010102 = C.SDL_PACKEDLAYOUT_1010102\n)\n\n// Pixel format values.\nconst (\n\tPIXELFORMAT_UNKNOWN     = C.SDL_PIXELFORMAT_UNKNOWN\n\tPIXELFORMAT_INDEX1LSB   = C.SDL_PIXELFORMAT_INDEX1LSB\n\tPIXELFORMAT_INDEX1MSB   = C.SDL_PIXELFORMAT_INDEX1MSB\n\tPIXELFORMAT_INDEX4LSB   = C.SDL_PIXELFORMAT_INDEX4LSB\n\tPIXELFORMAT_INDEX4MSB   = C.SDL_PIXELFORMAT_INDEX4MSB\n\tPIXELFORMAT_INDEX8      = C.SDL_PIXELFORMAT_INDEX8\n\tPIXELFORMAT_RGB332      = C.SDL_PIXELFORMAT_RGB332\n\tPIXELFORMAT_RGB444      = C.SDL_PIXELFORMAT_RGB444\n\tPIXELFORMAT_RGB555      = C.SDL_PIXELFORMAT_RGB555\n\tPIXELFORMAT_BGR555      = C.SDL_PIXELFORMAT_BGR555\n\tPIXELFORMAT_ARGB4444    = C.SDL_PIXELFORMAT_ARGB4444\n\tPIXELFORMAT_RGBA4444    = C.SDL_PIXELFORMAT_RGBA4444\n\tPIXELFORMAT_ABGR4444    = C.SDL_PIXELFORMAT_ABGR4444\n\tPIXELFORMAT_BGRA4444    = C.SDL_PIXELFORMAT_BGRA4444\n\tPIXELFORMAT_ARGB1555    = C.SDL_PIXELFORMAT_ARGB1555\n\tPIXELFORMAT_RGBA5551    = C.SDL_PIXELFORMAT_RGBA5551\n\tPIXELFORMAT_ABGR1555    = C.SDL_PIXELFORMAT_ABGR1555\n\tPIXELFORMAT_BGRA5551    = C.SDL_PIXELFORMAT_BGRA5551\n\tPIXELFORMAT_RGB565      = C.SDL_PIXELFORMAT_RGB565\n\tPIXELFORMAT_BGR565      = C.SDL_PIXELFORMAT_BGR565\n\tPIXELFORMAT_RGB24       = C.SDL_PIXELFORMAT_RGB24\n\tPIXELFORMAT_BGR24       = C.SDL_PIXELFORMAT_BGR24\n\tPIXELFORMAT_RGB888      = C.SDL_PIXELFORMAT_RGB888\n\tPIXELFORMAT_RGBX8888    = C.SDL_PIXELFORMAT_RGBX8888\n\tPIXELFORMAT_BGR888      = C.SDL_PIXELFORMAT_BGR888\n\tPIXELFORMAT_BGRX8888    = C.SDL_PIXELFORMAT_BGRX8888\n\tPIXELFORMAT_ARGB8888    = C.SDL_PIXELFORMAT_ARGB8888\n\tPIXELFORMAT_RGBA8888    = C.SDL_PIXELFORMAT_RGBA8888\n\tPIXELFORMAT_ABGR8888    = C.SDL_PIXELFORMAT_ABGR8888\n\tPIXELFORMAT_BGRA8888    = C.SDL_PIXELFORMAT_BGRA8888\n\tPIXELFORMAT_ARGB2101010 = C.SDL_PIXELFORMAT_ARGB2101010\n\tPIXELFORMAT_YV12        = C.SDL_PIXELFORMAT_YV12\n\tPIXELFORMAT_IYUV        = C.SDL_PIXELFORMAT_IYUV\n\tPIXELFORMAT_YUY2        = C.SDL_PIXELFORMAT_YUY2\n\tPIXELFORMAT_UYVY        = C.SDL_PIXELFORMAT_UYVY\n\tPIXELFORMAT_YVYU        = C.SDL_PIXELFORMAT_YVYU\n)\n\n// Pixel format variables.\nvar (\n\tPIXELFORMAT_RGBA32 = C.SDL_PIXELFORMAT_RGBA32\n\tPIXELFORMAT_ARGB32 = C.SDL_PIXELFORMAT_ARGB32\n\tPIXELFORMAT_BGRA32 = C.SDL_PIXELFORMAT_BGRA32\n\tPIXELFORMAT_ABGR32 = C.SDL_PIXELFORMAT_ABGR32\n)\n\n// These define alpha as the opacity of a surface.\nconst (\n\tALPHA_OPAQUE      = C.SDL_ALPHA_OPAQUE\n\tALPHA_TRANSPARENT = C.SDL_ALPHA_TRANSPARENT\n)\n\nfunc (format *PixelFormat) cptr() *C.SDL_PixelFormat {\n\treturn (*C.SDL_PixelFormat)(unsafe.Pointer(format))\n}\n\nfunc (palette *Palette) cptr() *C.SDL_Palette {\n\treturn (*C.SDL_Palette)(unsafe.Pointer(palette))\n}\n\n/*\n * the following code is modified version of the code from bitbucket.org/dooots/go-sdl2\n */\n\n// GetPixelFormatName returns the human readable name of a pixel format.\n// (https://wiki.libsdl.org/SDL_GetPixelFormatName)\nfunc GetPixelFormatName(format uint) string {\n\treturn C.GoString(C.SDL_GetPixelFormatName(C.Uint32(format)))\n}\n\n// PixelFormatEnumToMasks converts one of the enumerated pixel formats to a bpp value and RGBA masks.\n// (https://wiki.libsdl.org/SDL_PixelFormatEnumToMasks)\nfunc PixelFormatEnumToMasks(format uint) (bpp int, rmask, gmask, bmask, amask uint32, err error) {\n\tresult := C.SDL_PixelFormatEnumToMasks(C.Uint32(format), (*C.int)(unsafe.Pointer(&bpp)),\n\t\t(*C.Uint32)(&rmask), (*C.Uint32)(&gmask), (*C.Uint32)(&bmask),\n\t\t(*C.Uint32)(&amask))\n\tif result == C.SDL_FALSE {\n\t\terr = GetError()\n\t}\n\treturn\n}\n\n// MasksToPixelFormatEnum converts a bpp value and RGBA masks to an enumerated pixel format.\n// (https://wiki.libsdl.org/SDL_MasksToPixelFormatEnum)\nfunc MasksToPixelFormatEnum(bpp int, rmask, gmask, bmask, amask uint32) uint {\n\treturn uint(C.SDL_MasksToPixelFormatEnum(C.int(bpp), C.Uint32(rmask), C.Uint32(gmask),\n\t\tC.Uint32(bmask), C.Uint32(amask)))\n}\n\n// AllocFormat creates a PixelFormat structure corresponding to a pixel format.\n// (https://wiki.libsdl.org/SDL_AllocFormat)\nfunc AllocFormat(format uint) (*PixelFormat, error) {\n\tr := (*PixelFormat)(unsafe.Pointer(C.SDL_AllocFormat(C.Uint32(format))))\n\tif r == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn r, nil\n}\n\n// Free frees the PixelFormat structure allocated by AllocFormat().\n// (https://wiki.libsdl.org/SDL_FreeFormat)\nfunc (format *PixelFormat) Free() {\n\tC.SDL_FreeFormat((*C.SDL_PixelFormat)(unsafe.Pointer(format)))\n}\n\n// AllocPalette creates a palette structure with the specified number of color entries.\n// (https://wiki.libsdl.org/SDL_AllocPalette)\nfunc AllocPalette(ncolors int) (*Palette, error) {\n\tr := (*Palette)(unsafe.Pointer(C.SDL_AllocPalette(C.int(ncolors))))\n\tif r == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn r, nil\n}\n\n// SetPalette sets the palette for the pixel format structure.\n// (https://wiki.libsdl.org/SDL_SetPixelFormatPalette)\nfunc (format *PixelFormat) SetPalette(palette *Palette) error {\n\tr := C.SDL_SetPixelFormatPalette((*C.SDL_PixelFormat)(unsafe.Pointer(format)),\n\t\t(*C.SDL_Palette)(unsafe.Pointer(palette)))\n\tif r != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// SetColors sets a range of colors in the palette.\n// (https://wiki.libsdl.org/SDL_SetPaletteColors)\nfunc (palette *Palette) SetColors(colors []Color) error {\n\tif colors == nil {\n\t\treturn nil\n\t}\n\tvar ptr *C.SDL_Color\n\tif len(colors) > 0 {\n\t\tptr = (*C.SDL_Color)(unsafe.Pointer(&colors[0]))\n\t}\n\n\tr := C.SDL_SetPaletteColors((*C.SDL_Palette)(unsafe.Pointer(palette)),\n\t\tptr, 0, C.int(len(colors)))\n\tif r != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Free frees the palette created with AllocPalette().\n// (https://wiki.libsdl.org/SDL_FreePalette)\nfunc (palette *Palette) Free() {\n\tC.SDL_FreePalette((*C.SDL_Palette)(unsafe.Pointer(palette)))\n}\n\n// MapRGB maps an RGB triple to an opaque pixel value for a given pixel format.\n// (https://wiki.libsdl.org/SDL_MapRGB)\nfunc MapRGB(format *PixelFormat, r, g, b uint8) uint32 {\n\treturn uint32(C.SDL_MapRGB((*C.SDL_PixelFormat)(unsafe.Pointer(format)),\n\t\tC.Uint8(r), C.Uint8(g), C.Uint8(b)))\n}\n\n// MapRGBA maps an RGBA quadruple to a pixel value for a given pixel format.\n// (https://wiki.libsdl.org/SDL_MapRGBA)\nfunc MapRGBA(format *PixelFormat, r, g, b, a uint8) uint32 {\n\treturn uint32(C.SDL_MapRGBA((*C.SDL_PixelFormat)(unsafe.Pointer(format)),\n\t\tC.Uint8(r), C.Uint8(g), C.Uint8(b), C.Uint8(a)))\n}\n\n// GetRGB returns RGB values from a pixel in the specified format.\n// (https://wiki.libsdl.org/SDL_GetRGB)\nfunc GetRGB(pixel uint32, format *PixelFormat) (r, g, b uint8) {\n\tC.SDL_GetRGB(C.Uint32(pixel), (*C.SDL_PixelFormat)(unsafe.Pointer(format)),\n\t\t(*C.Uint8)(&r), (*C.Uint8)(&g), (*C.Uint8)(&b))\n\treturn\n}\n\n// GetRGBA returns RGBA values from a pixel in the specified format.\n// (https://wiki.libsdl.org/SDL_GetRGBA)\nfunc GetRGBA(pixel uint32, format *PixelFormat) (r, g, b, a uint8) {\n\tC.SDL_GetRGBA(C.Uint32(pixel), (*C.SDL_PixelFormat)(unsafe.Pointer(format)),\n\t\t(*C.Uint8)(&r), (*C.Uint8)(&g), (*C.Uint8)(&b), (*C.Uint8)(&a))\n\treturn\n}\n\n// CalculateGammaRamp calculates a 256 entry gamma ramp for a gamma value.\n// (https://wiki.libsdl.org/SDL_CalculateGammaRamp)\nfunc CalculateGammaRamp(gamma float32, ramp *[256]uint16) {\n\tC.SDL_CalculateGammaRamp(C.float(gamma), (*C.Uint16)(unsafe.Pointer(&ramp[0])))\n}\n\n// BytesPerPixel returns the number of bytes per pixel for the given format\nfunc BytesPerPixel(format uint32) int {\n\treturn int(C.bytesPerPixel(C.Uint32(format)))\n}\n\n// BitsPerPixel returns the number of bits per pixel for the given format\nfunc BitsPerPixel(format uint32) int {\n\treturn int(C.bitsPerPixel(C.Uint32(format)))\n}\n\nvar (\n\tRGB444Model   color.Model = color.ModelFunc(rgb444Model)\n\tRGB332Model   color.Model = color.ModelFunc(rgb332Model)\n\tRGB565Model   color.Model = color.ModelFunc(rgb565Model)\n\tRGB555Model   color.Model = color.ModelFunc(rgb555Model)\n\tBGR565Model   color.Model = color.ModelFunc(bgr565Model)\n\tBGR555Model   color.Model = color.ModelFunc(bgr555Model)\n\tARGB4444Model color.Model = color.ModelFunc(argb4444Model)\n\tABGR4444Model color.Model = color.ModelFunc(abgr4444Model)\n\tRGBA4444Model color.Model = color.ModelFunc(rgba4444Model)\n\tBGRA4444Model color.Model = color.ModelFunc(bgra4444Model)\n\tARGB1555Model color.Model = color.ModelFunc(argb1555Model)\n\tRGBA5551Model color.Model = color.ModelFunc(rgba5551Model)\n\tABGR1555Model color.Model = color.ModelFunc(abgr1555Model)\n\tBGRA5551Model color.Model = color.ModelFunc(bgra5551Model)\n\tRGBA8888Model color.Model = color.ModelFunc(rgba8888Model)\n\tBGRA8888Model color.Model = color.ModelFunc(bgra8888Model)\n)\n\ntype RGB444 struct {\n\tR, G, B byte\n}\n\nfunc (c RGB444) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale4to8bit(c.R),\n\t\tG: upscale4to8bit(c.G),\n\t\tB: upscale4to8bit(c.B),\n\t\tA: 0xFF,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc rgb444Model(c color.Color) color.Color {\n\tif _, ok := c.(RGB444); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn RGB444{\n\t\tR: downscale8to4bit(nrgba.R),\n\t\tG: downscale8to4bit(nrgba.G),\n\t\tB: downscale8to4bit(nrgba.B),\n\t}\n}\n\ntype RGB332 struct {\n\tR, G, B byte\n}\n\nfunc (c RGB332) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale3to8bit(c.R),\n\t\tG: upscale3to8bit(c.G),\n\t\tB: upscale2to8bit(c.B),\n\t\tA: 0xFF,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc rgb332Model(c color.Color) color.Color {\n\tif _, ok := c.(RGB332); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn RGB332{\n\t\tR: downscale8to3bit(nrgba.R),\n\t\tG: downscale8to3bit(nrgba.G),\n\t\tB: downscale8to2bit(nrgba.B),\n\t}\n}\n\ntype RGB565 struct {\n\tR, G, B byte\n}\n\nfunc (c RGB565) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale5to8bit(c.R),\n\t\tG: upscale6to8bit(c.G),\n\t\tB: upscale5to8bit(c.B),\n\t\tA: 0xFF,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc rgb565Model(c color.Color) color.Color {\n\tif _, ok := c.(RGB565); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn RGB565{\n\t\tR: downscale8to5bit(nrgba.R),\n\t\tG: downscale8to6bit(nrgba.G),\n\t\tB: downscale8to5bit(nrgba.B),\n\t}\n}\n\ntype RGB555 struct {\n\tR, G, B byte\n}\n\nfunc (c RGB555) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale5to8bit(c.R),\n\t\tG: upscale5to8bit(c.G),\n\t\tB: upscale5to8bit(c.B),\n\t\tA: 0xFF,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc rgb555Model(c color.Color) color.Color {\n\tif _, ok := c.(RGB555); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn RGB555{\n\t\tR: downscale8to5bit(nrgba.R),\n\t\tG: downscale8to5bit(nrgba.G),\n\t\tB: downscale8to5bit(nrgba.B),\n\t}\n}\n\ntype BGR565 struct {\n\tB, G, R byte\n}\n\nfunc (c BGR565) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale5to8bit(c.R),\n\t\tG: upscale6to8bit(c.G),\n\t\tB: upscale5to8bit(c.B),\n\t\tA: 0xFF,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc bgr565Model(c color.Color) color.Color {\n\tif _, ok := c.(BGR565); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn BGR565{\n\t\tB: downscale8to5bit(nrgba.B),\n\t\tG: downscale8to6bit(nrgba.G),\n\t\tR: downscale8to5bit(nrgba.R),\n\t}\n}\n\ntype BGR555 struct {\n\tB, G, R byte\n}\n\nfunc (c BGR555) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale5to8bit(c.R),\n\t\tG: upscale5to8bit(c.G),\n\t\tB: upscale5to8bit(c.B),\n\t\tA: 0xFF,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc bgr555Model(c color.Color) color.Color {\n\tif _, ok := c.(BGR555); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn BGR555{\n\t\tB: downscale8to5bit(nrgba.B),\n\t\tG: downscale8to5bit(nrgba.G),\n\t\tR: downscale8to5bit(nrgba.R),\n\t}\n}\n\ntype RGB888 struct {\n\tR, G, B byte\n}\n\nfunc (c RGB888) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: c.R,\n\t\tG: c.G,\n\t\tB: c.B,\n\t\tA: 0xFF,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc rgb888Model(c color.Color) color.Color {\n\tif _, ok := c.(RGB888); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn RGB888{\n\t\tR: nrgba.R,\n\t\tG: nrgba.G,\n\t\tB: nrgba.B,\n\t}\n}\n\ntype BGR888 struct {\n\tB, G, R byte\n}\n\nfunc (c BGR888) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: c.R,\n\t\tG: c.G,\n\t\tB: c.B,\n\t\tA: 0xFF,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc bgr888Model(c color.Color) color.Color {\n\tif _, ok := c.(BGR888); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn BGR888{\n\t\tB: nrgba.B,\n\t\tG: nrgba.G,\n\t\tR: nrgba.R,\n\t}\n}\n\ntype ARGB4444 struct {\n\tA, R, G, B byte\n}\n\nfunc (c ARGB4444) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale4to8bit(c.R),\n\t\tG: upscale4to8bit(c.G),\n\t\tB: upscale4to8bit(c.B),\n\t\tA: upscale4to8bit(c.A),\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc argb4444Model(c color.Color) color.Color {\n\tif _, ok := c.(ARGB4444); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn ARGB4444{\n\t\tA: downscale8to4bit(nrgba.A),\n\t\tR: downscale8to4bit(nrgba.R),\n\t\tG: downscale8to4bit(nrgba.G),\n\t\tB: downscale8to4bit(nrgba.B),\n\t}\n}\n\ntype ABGR4444 struct {\n\tA, B, G, R byte\n}\n\nfunc (c ABGR4444) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale4to8bit(c.R),\n\t\tG: upscale4to8bit(c.G),\n\t\tB: upscale4to8bit(c.B),\n\t\tA: upscale4to8bit(c.A),\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc abgr4444Model(c color.Color) color.Color {\n\tif _, ok := c.(ABGR4444); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn ABGR4444{\n\t\tA: downscale8to4bit(nrgba.A),\n\t\tB: downscale8to4bit(nrgba.B),\n\t\tG: downscale8to4bit(nrgba.G),\n\t\tR: downscale8to4bit(nrgba.R),\n\t}\n}\n\ntype RGBA4444 struct {\n\tR, G, B, A byte\n}\n\nfunc (c RGBA4444) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale4to8bit(c.R),\n\t\tG: upscale4to8bit(c.G),\n\t\tB: upscale4to8bit(c.B),\n\t\tA: upscale4to8bit(c.A),\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc rgba4444Model(c color.Color) color.Color {\n\tif _, ok := c.(RGBA4444); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn RGBA4444{\n\t\tR: downscale8to4bit(nrgba.R),\n\t\tG: downscale8to4bit(nrgba.G),\n\t\tB: downscale8to4bit(nrgba.B),\n\t\tA: downscale8to4bit(nrgba.A),\n\t}\n}\n\ntype BGRA4444 struct {\n\tB, G, R, A byte\n}\n\nfunc (c BGRA4444) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale4to8bit(c.R),\n\t\tG: upscale4to8bit(c.G),\n\t\tB: upscale4to8bit(c.B),\n\t\tA: upscale4to8bit(c.A),\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc bgra4444Model(c color.Color) color.Color {\n\tif _, ok := c.(BGRA4444); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn BGRA4444{\n\t\tB: downscale8to4bit(nrgba.B),\n\t\tG: downscale8to4bit(nrgba.G),\n\t\tR: downscale8to4bit(nrgba.R),\n\t\tA: downscale8to4bit(nrgba.A),\n\t}\n}\n\ntype ARGB1555 struct {\n\tA, R, G, B byte\n}\n\nfunc (c ARGB1555) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale5to8bit(c.R),\n\t\tG: upscale5to8bit(c.G),\n\t\tB: upscale5to8bit(c.B),\n\t\tA: upscale1to8bit(c.A),\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc argb1555Model(c color.Color) color.Color {\n\tif _, ok := c.(ARGB1555); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn ARGB1555{\n\t\tA: downscale8to1bit(nrgba.A),\n\t\tR: downscale8to5bit(nrgba.R),\n\t\tG: downscale8to5bit(nrgba.G),\n\t\tB: downscale8to5bit(nrgba.B),\n\t}\n}\n\ntype RGBA5551 struct {\n\tR, G, B, A byte\n}\n\nfunc (c RGBA5551) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale5to8bit(c.R),\n\t\tG: upscale5to8bit(c.G),\n\t\tB: upscale5to8bit(c.B),\n\t\tA: upscale1to8bit(c.A),\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc rgba5551Model(c color.Color) color.Color {\n\tif _, ok := c.(RGBA5551); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn RGBA5551{\n\t\tR: downscale8to5bit(nrgba.R),\n\t\tG: downscale8to5bit(nrgba.G),\n\t\tB: downscale8to5bit(nrgba.B),\n\t\tA: downscale8to1bit(nrgba.A),\n\t}\n}\n\ntype ABGR1555 struct {\n\tA, R, G, B byte\n}\n\nfunc (c ABGR1555) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale5to8bit(c.R),\n\t\tG: upscale5to8bit(c.G),\n\t\tB: upscale5to8bit(c.B),\n\t\tA: upscale1to8bit(c.A),\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc abgr1555Model(c color.Color) color.Color {\n\tif _, ok := c.(ABGR1555); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn ABGR1555{\n\t\tA: downscale8to1bit(nrgba.A),\n\t\tR: downscale8to5bit(nrgba.R),\n\t\tG: downscale8to5bit(nrgba.G),\n\t\tB: downscale8to5bit(nrgba.B),\n\t}\n}\n\ntype BGRA5551 struct {\n\tB, G, R, A byte\n}\n\nfunc (c BGRA5551) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale5to8bit(c.R),\n\t\tG: upscale5to8bit(c.G),\n\t\tB: upscale5to8bit(c.B),\n\t\tA: upscale1to8bit(c.A),\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc bgra5551Model(c color.Color) color.Color {\n\tif _, ok := c.(BGRA5551); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn BGRA5551{\n\t\tB: downscale8to5bit(nrgba.B),\n\t\tG: downscale8to5bit(nrgba.G),\n\t\tR: downscale8to5bit(nrgba.R),\n\t\tA: downscale8to1bit(nrgba.A),\n\t}\n}\n\ntype RGBA8888 struct {\n\tR, G, B, A byte\n}\n\nfunc (c RGBA8888) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: c.R,\n\t\tG: c.G,\n\t\tB: c.B,\n\t\tA: c.A,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc rgba8888Model(c color.Color) color.Color {\n\tif _, ok := c.(RGBA8888); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn RGBA8888{\n\t\tR: nrgba.R,\n\t\tG: nrgba.G,\n\t\tB: nrgba.B,\n\t\tA: nrgba.A,\n\t}\n}\n\ntype BGRA8888 struct {\n\tB, G, R, A byte\n}\n\nfunc (c BGRA8888) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: c.R,\n\t\tG: c.G,\n\t\tB: c.B,\n\t\tA: c.A,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc bgra8888Model(c color.Color) color.Color {\n\tif _, ok := c.(BGRA8888); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn BGRA8888{\n\t\tB: nrgba.B,\n\t\tG: nrgba.G,\n\t\tR: nrgba.R,\n\t\tA: nrgba.A,\n\t}\n}\n\ntype ARGB8888 struct {\n\tA, R, G, B byte\n}\n\nfunc (c ARGB8888) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: c.R,\n\t\tG: c.G,\n\t\tB: c.B,\n\t\tA: c.A,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc argb8888Model(c color.Color) color.Color {\n\tif _, ok := c.(ARGB8888); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn ARGB8888{\n\t\tA: nrgba.A,\n\t\tR: nrgba.R,\n\t\tG: nrgba.G,\n\t\tB: nrgba.B,\n\t}\n}\n\ntype ABGR8888 struct {\n\tA, B, G, R byte\n}\n\nfunc (c ABGR8888) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: c.R,\n\t\tG: c.G,\n\t\tB: c.B,\n\t\tA: c.A,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc abgr8888Model(c color.Color) color.Color {\n\tif _, ok := c.(ABGR8888); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn ABGR8888{\n\t\tA: nrgba.A,\n\t\tB: nrgba.B,\n\t\tG: nrgba.G,\n\t\tR: nrgba.R,\n\t}\n}\n\nfunc downscale8to1bit(alpha byte) byte {\n\tif alpha == 0 {\n\t\treturn 0\n\t}\n\treturn 1\n}\n\nfunc downscale8to2bit(in byte) byte {\n\treturn in >> 6\n}\n\nfunc downscale8to3bit(in byte) byte {\n\treturn in >> 5\n}\n\nfunc downscale8to4bit(in byte) byte {\n\treturn in >> 4\n}\n\nfunc downscale8to5bit(in byte) byte {\n\treturn in >> 3\n}\n\nfunc downscale8to6bit(in byte) byte {\n\treturn in >> 2\n}\n\nfunc upscale1to8bit(alphaBit byte) byte {\n\tif alphaBit == 0 {\n\t\treturn 0\n\t}\n\treturn 0xFF\n}\n\nfunc upscale2to8bit(in byte) byte {\n\treturn in<<6 | in<<4 | in<<2 | in\n}\n\nfunc upscale3to8bit(in byte) byte {\n\treturn in<<5 | in<<2 | (in>>1)&0b11\n}\n\nfunc upscale4to8bit(in byte) byte {\n\treturn in<<4 | in\n}\n\nfunc upscale5to8bit(in byte) byte {\n\treturn in<<3 | (in>>2)&0b111\n}\n\nfunc upscale6to8bit(in byte) byte {\n\treturn in<<2 | (in>>4)&0b11\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/power.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\n\n// An enumeration of the basic state of the system's power supply.\n// (https://wiki.libsdl.org/SDL_PowerState)\nconst (\n\tPOWERSTATE_UNKNOWN    = C.SDL_POWERSTATE_UNKNOWN    // cannot determine power status\n\tPOWERSTATE_ON_BATTERY = C.SDL_POWERSTATE_ON_BATTERY // not plugged in, running on the battery\n\tPOWERSTATE_NO_BATTERY = C.SDL_POWERSTATE_NO_BATTERY // plugged in, no battery available\n\tPOWERSTATE_CHARGING   = C.SDL_POWERSTATE_CHARGING   // plugged in, charging battery\n\tPOWERSTATE_CHARGED    = C.SDL_POWERSTATE_CHARGED    // plugged in, battery charged\n)\n\n// PowerState is the basic state for the system's power supply.\n// (https://wiki.libsdl.org/SDL_PowerState)\ntype PowerState C.SDL_PowerState\n\n// GetPowerInfo returns the current power supply details.\n// (https://wiki.libsdl.org/SDL_GetPowerInfo)\nfunc GetPowerInfo() (int, int, int) {\n\t_secs := C.int(0)\n\t_percent := C.int(0)\n\t_state := C.SDL_GetPowerInfo(&_secs, &_percent)\n\treturn (int)(_state), (int)(_secs), (int)(_percent)\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/rect.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\nimport (\n\t\"math\"\n\t\"unsafe\"\n)\n\n// Point defines a two dimensional point.\n// (https://wiki.libsdl.org/SDL_Point)\ntype Point struct {\n\tX int32 // the x coordinate of the point\n\tY int32 // the y coordinate of the point\n}\n\n// Rect contains the definition of a rectangle, with the origin at the upper left.\n// (https://wiki.libsdl.org/SDL_Rect)\ntype Rect struct {\n\tX int32 // the x location of the rectangle's upper left corner\n\tY int32 // the y location of the rectangle's upper left corner\n\tW int32 // the width of the rectangle\n\tH int32 // the height of the rectangle\n}\n\n// FPoint defines a two dimensional point.\n// TODO: (https://wiki.libsdl.org/SDL_FPoint)\ntype FPoint struct {\n\tX float32 // the x coordinate of the point\n\tY float32 // the y coordinate of the point\n}\n\n// FRect contains the definition of a rectangle, with the origin at the upper left.\n// TODO: (https://wiki.libsdl.org/SDL_FRect)\ntype FRect struct {\n\tX float32 // the x location of the rectangle's upper left corner\n\tY float32 // the y location of the rectangle's upper left corner\n\tW float32 // the width of the rectangle\n\tH float32 // the height of the rectangle\n}\n\nfunc (p *Point) cptr() *C.SDL_Point {\n\treturn (*C.SDL_Point)(unsafe.Pointer(p))\n}\n\nfunc (a *Rect) cptr() *C.SDL_Rect {\n\treturn (*C.SDL_Rect)(unsafe.Pointer(a))\n}\n\nfunc (p *FPoint) cptr() *C.SDL_FPoint {\n\treturn (*C.SDL_FPoint)(unsafe.Pointer(p))\n}\n\nfunc (a *FRect) cptr() *C.SDL_FRect {\n\treturn (*C.SDL_FRect)(unsafe.Pointer(a))\n}\n\n// InRect reports whether the point resides inside a rectangle.\n// (https://wiki.libsdl.org/SDL_PointInRect)\nfunc (p *Point) InRect(r *Rect) bool {\n\tif (p.X >= r.X) && (p.X < (r.X + r.W)) &&\n\t\t(p.Y >= r.Y) && (p.Y < (r.Y + r.H)) {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// InRect reports whether the point resides inside a rectangle.\n// (https://wiki.libsdl.org/SDL_PointInRect)\nfunc (p *FPoint) InRect(r *FRect) bool {\n\tif (p.X >= r.X) && (p.X < (r.X + r.W)) &&\n\t\t(p.Y >= r.Y) && (p.Y < (r.Y + r.H)) {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Empty reports whether a rectangle has no area.\n// (https://wiki.libsdl.org/SDL_RectEmpty)\nfunc (a *Rect) Empty() bool {\n\treturn a == nil || a.W <= 0 || a.H <= 0\n}\n\n// Equals reports whether two rectangles are equal.\n// (https://wiki.libsdl.org/SDL_RectEquals)\nfunc (a *Rect) Equals(b *Rect) bool {\n\tif (a != nil) && (b != nil) &&\n\t\t(a.X == b.X) && (a.Y == b.Y) &&\n\t\t(a.W == b.W) && (a.H == b.H) {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// HasIntersection reports whether two rectangles intersect.\n// (https://wiki.libsdl.org/SDL_HasIntersection)\nfunc (a *Rect) HasIntersection(b *Rect) bool {\n\tif a == nil || b == nil {\n\t\treturn false\n\t}\n\n\t// Special case for empty rects\n\tif a.Empty() || b.Empty() {\n\t\treturn false\n\t}\n\n\tif a.X >= b.X+b.W || a.X+a.W <= b.X || a.Y >= b.Y+b.H || a.Y+a.H <= b.Y {\n\t\treturn false\n\t}\n\n\treturn true\n}\n\n// Intersect calculates the intersection of two rectangles.\n// (https://wiki.libsdl.org/SDL_IntersectRect)\nfunc (a *Rect) Intersect(b *Rect) (Rect, bool) {\n\tvar result Rect\n\n\tif a == nil || b == nil {\n\t\treturn result, false\n\t}\n\n\t// Special case for empty rects\n\tif a.Empty() || b.Empty() {\n\t\tresult.W = 0\n\t\tresult.H = 0\n\t\treturn result, false\n\t}\n\n\taMin := a.X\n\taMax := aMin + a.W\n\tbMin := b.X\n\tbMax := bMin + b.W\n\tif bMin > aMin {\n\t\taMin = bMin\n\t}\n\tresult.X = aMin\n\tif bMax < aMax {\n\t\taMax = bMax\n\t}\n\tresult.W = aMax - aMin\n\n\taMin = a.Y\n\taMax = aMin + a.H\n\tbMin = b.Y\n\tbMax = bMin + b.H\n\tif bMin > aMin {\n\t\taMin = bMin\n\t}\n\tresult.Y = aMin\n\tif bMax < aMax {\n\t\taMax = bMax\n\t}\n\tresult.H = aMax - aMin\n\n\treturn result, !result.Empty()\n}\n\n// Union calculates the union of two rectangles.\n// (https://wiki.libsdl.org/SDL_UnionRect)\nfunc (a *Rect) Union(b *Rect) Rect {\n\tvar result Rect\n\n\tif a == nil || b == nil {\n\t\treturn result\n\t}\n\n\t// Special case for empty rects\n\tif a.Empty() {\n\t\treturn *b\n\t} else if b.Empty() {\n\t\treturn *a\n\t} else if a.Empty() && b.Empty() {\n\t\treturn result\n\t}\n\n\taMin := a.X\n\taMax := aMin + a.W\n\tbMin := b.X\n\tbMax := bMin + b.W\n\tif bMin < aMin {\n\t\taMin = bMin\n\t}\n\tresult.X = aMin\n\tif bMax > aMax {\n\t\taMax = bMax\n\t}\n\tresult.W = aMax - aMin\n\n\taMin = a.Y\n\taMax = aMin + a.H\n\tbMin = b.Y\n\tbMax = bMin + b.H\n\tif bMin < aMin {\n\t\taMin = bMin\n\t}\n\tresult.Y = aMin\n\tif bMax > aMax {\n\t\taMax = bMax\n\t}\n\tresult.H = aMax - aMin\n\n\treturn result\n}\n\n// Empty reports whether a rectangle has no area.\n// (https://wiki.libsdl.org/SDL_RectEmpty)\nfunc (a *FRect) Empty() bool {\n\treturn a == nil || a.W <= 0 || a.H <= 0\n}\n\n// Equals reports whether two rectangles are equal.\n// (https://wiki.libsdl.org/SDL_RectEquals)\nfunc (a *FRect) Equals(b *FRect) bool {\n\tif (a != nil) && (b != nil) &&\n\t\t(a.X == b.X) && (a.Y == b.Y) &&\n\t\t(a.W == b.W) && (a.H == b.H) {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// EqualsEpsilon returns true if the two rectangles are equal, within some given epsilon.\n// (https://wiki.libsdl.org/SDL_FRectEqualsEpsilon)\nfunc (a *FRect) EqualsEpsilon(b *FRect, epsilon float32) bool {\n\tif (a != nil) && (b != nil) && (a == b ||\n\t\t(float32(math.Abs(float64(a.X-b.X))) <= epsilon) &&\n\t\t\t(float32(math.Abs(float64(a.Y-b.Y))) <= epsilon) &&\n\t\t\t(float32(math.Abs(float64(a.W-b.W))) <= epsilon) &&\n\t\t\t(float32(math.Abs(float64(a.H-b.H))) <= epsilon)) {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// HasIntersection reports whether two rectangles intersect.\n// (https://wiki.libsdl.org/SDL_HasIntersection)\nfunc (a *FRect) HasIntersection(b *FRect) bool {\n\tif a == nil || b == nil {\n\t\treturn false\n\t}\n\n\t// Special case for empty rects\n\tif a.Empty() || b.Empty() {\n\t\treturn false\n\t}\n\n\tif a.X >= b.X+b.W || a.X+a.W <= b.X || a.Y >= b.Y+b.H || a.Y+a.H <= b.Y {\n\t\treturn false\n\t}\n\n\treturn true\n}\n\n// Intersect calculates the intersection of two rectangles.\n// (https://wiki.libsdl.org/SDL_IntersectRect)\nfunc (a *FRect) Intersect(b *FRect) (FRect, bool) {\n\tvar result FRect\n\n\tif a == nil || b == nil {\n\t\treturn result, false\n\t}\n\n\t// Special case for empty rects\n\tif a.Empty() || b.Empty() {\n\t\tresult.W = 0\n\t\tresult.H = 0\n\t\treturn result, false\n\t}\n\n\taMin := a.X\n\taMax := aMin + a.W\n\tbMin := b.X\n\tbMax := bMin + b.W\n\tif bMin > aMin {\n\t\taMin = bMin\n\t}\n\tresult.X = aMin\n\tif bMax < aMax {\n\t\taMax = bMax\n\t}\n\tresult.W = aMax - aMin\n\n\taMin = a.Y\n\taMax = aMin + a.H\n\tbMin = b.Y\n\tbMax = bMin + b.H\n\tif bMin > aMin {\n\t\taMin = bMin\n\t}\n\tresult.Y = aMin\n\tif bMax < aMax {\n\t\taMax = bMax\n\t}\n\tresult.H = aMax - aMin\n\n\treturn result, !result.Empty()\n}\n\n// Union calculates the union of two rectangles.\n// (https://wiki.libsdl.org/SDL_UnionRect)\nfunc (a *FRect) Union(b *FRect) FRect {\n\tvar result FRect\n\n\tif a == nil || b == nil {\n\t\treturn result\n\t}\n\n\t// Special case for empty rects\n\tif a.Empty() {\n\t\treturn *b\n\t} else if b.Empty() {\n\t\treturn *a\n\t} else if a.Empty() && b.Empty() {\n\t\treturn result\n\t}\n\n\taMin := a.X\n\taMax := aMin + a.W\n\tbMin := b.X\n\tbMax := bMin + b.W\n\tif bMin < aMin {\n\t\taMin = bMin\n\t}\n\tresult.X = aMin\n\tif bMax > aMax {\n\t\taMax = bMax\n\t}\n\tresult.W = aMax - aMin\n\n\taMin = a.Y\n\taMax = aMin + a.H\n\tbMin = b.Y\n\tbMax = bMin + b.H\n\tif bMin < aMin {\n\t\taMin = bMin\n\t}\n\tresult.Y = aMin\n\tif bMax > aMax {\n\t\taMax = bMax\n\t}\n\tresult.H = aMax - aMin\n\n\treturn result\n}\n\n// EnclosePoints calculates a minimal rectangle that encloses a set of points.\n// (https://wiki.libsdl.org/SDL_EnclosePoints)\nfunc EnclosePoints(points []Point, clip *Rect) (Rect, bool) {\n\tvar result Rect\n\n\tif len(points) == 0 {\n\t\treturn result, false\n\t}\n\n\tvar minX, minY, maxX, maxY int32\n\tif clip != nil {\n\t\tadded := false\n\t\tclipMinX := clip.X\n\t\tclipMinY := clip.Y\n\t\tclipMaxX := clip.X + clip.W - 1\n\t\tclipMaxY := clip.Y + clip.H - 1\n\n\t\t// If the clip has no size, we're done\n\t\tif clip.Empty() {\n\t\t\treturn result, false\n\t\t}\n\n\t\tfor _, val := range points {\n\t\t\t// Check if the point is inside the clip rect\n\t\t\tif val.X < clipMinX || val.X > clipMaxX || val.Y < clipMinY || val.Y > clipMaxY {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif !added {\n\t\t\t\t// If it's the first point\n\t\t\t\tminX = val.X\n\t\t\t\tmaxX = val.X\n\t\t\t\tminY = val.Y\n\t\t\t\tmaxY = val.Y\n\t\t\t\tadded = true\n\t\t\t}\n\n\t\t\t// Find mins and maxes\n\t\t\tif val.X < minX {\n\t\t\t\tminX = val.X\n\t\t\t} else if val.X > maxX {\n\t\t\t\tmaxX = val.X\n\t\t\t}\n\t\t\tif val.Y < minY {\n\t\t\t\tminY = val.Y\n\t\t\t} else if val.Y > maxY {\n\t\t\t\tmaxY = val.Y\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor i, val := range points {\n\t\t\tif i == 0 {\n\t\t\t\t// Populate the first point\n\t\t\t\tminX = val.X\n\t\t\t\tmaxX = val.X\n\t\t\t\tminY = val.Y\n\t\t\t\tmaxY = val.Y\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Find mins and maxes\n\t\t\tif val.X < minX {\n\t\t\t\tminX = val.X\n\t\t\t} else if val.X > maxX {\n\t\t\t\tmaxX = val.X\n\t\t\t}\n\t\t\tif val.Y < minY {\n\t\t\t\tminY = val.Y\n\t\t\t} else if val.Y > maxY {\n\t\t\t\tmaxY = val.Y\n\t\t\t}\n\t\t}\n\t}\n\n\tresult.X = minX\n\tresult.Y = minY\n\tresult.W = (maxX - minX) + 1\n\tresult.H = (maxY - minY) + 1\n\n\treturn result, true\n}\n\n// EncloseFPoints calculates a minimal rectangle that encloses a set of points with float precision.\n// (https://wiki.libsdl.org/SDL_EncloseFPoints)\nfunc EncloseFPoints(points []FPoint, clip *FRect) (result FRect, enclosed bool) {\n\tif len(points) == 0 {\n\t\treturn result, false\n\t}\n\n\tvar minX, minY, maxX, maxY float32\n\tif clip != nil {\n\t\tadded := false\n\t\tclipMinX := clip.X\n\t\tclipMinY := clip.Y\n\t\tclipMaxX := clip.X + clip.W - 1\n\t\tclipMaxY := clip.Y + clip.H - 1\n\n\t\t// If the clip has no size, we're done\n\t\tif clip.Empty() {\n\t\t\treturn result, false\n\t\t}\n\n\t\tfor _, val := range points {\n\t\t\t// Check if the point is inside the clip rect\n\t\t\tif val.X < clipMinX || val.X > clipMaxX || val.Y < clipMinY || val.Y > clipMaxY {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif !added {\n\t\t\t\t// If it's the first point\n\t\t\t\tminX = val.X\n\t\t\t\tmaxX = val.X\n\t\t\t\tminY = val.Y\n\t\t\t\tmaxY = val.Y\n\t\t\t\tadded = true\n\t\t\t}\n\n\t\t\t// Find mins and maxes\n\t\t\tif val.X < minX {\n\t\t\t\tminX = val.X\n\t\t\t} else if val.X > maxX {\n\t\t\t\tmaxX = val.X\n\t\t\t}\n\t\t\tif val.Y < minY {\n\t\t\t\tminY = val.Y\n\t\t\t} else if val.Y > maxY {\n\t\t\t\tmaxY = val.Y\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor i, val := range points {\n\t\t\tif i == 0 {\n\t\t\t\t// Populate the first point\n\t\t\t\tminX = val.X\n\t\t\t\tmaxX = val.X\n\t\t\t\tminY = val.Y\n\t\t\t\tmaxY = val.Y\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Find mins and maxes\n\t\t\tif val.X < minX {\n\t\t\t\tminX = val.X\n\t\t\t} else if val.X > maxX {\n\t\t\t\tmaxX = val.X\n\t\t\t}\n\t\t\tif val.Y < minY {\n\t\t\t\tminY = val.Y\n\t\t\t} else if val.Y > maxY {\n\t\t\t\tmaxY = val.Y\n\t\t\t}\n\t\t}\n\t}\n\n\tresult.X = minX\n\tresult.Y = minY\n\tresult.W = (maxX - minX) + 1\n\tresult.H = (maxY - minY) + 1\n\n\treturn result, true\n}\n\nconst (\n\tcodeBottom = 1\n\tcodeTop    = 2\n\tcodeLeft   = 4\n\tcodeRight  = 8\n)\n\nfunc computeOutCode(rect *Rect, x, y int32) int {\n\tcode := 0\n\tif y < rect.Y {\n\t\tcode |= codeTop\n\t} else if y >= rect.Y+rect.H {\n\t\tcode |= codeBottom\n\t}\n\tif x < rect.X {\n\t\tcode |= codeLeft\n\t} else if x >= rect.X+rect.W {\n\t\tcode |= codeRight\n\t}\n\n\treturn code\n}\n\nfunc computeFOutCode(rect *FRect, x, y float32) int {\n\tcode := 0\n\tif y < rect.Y {\n\t\tcode |= codeTop\n\t} else if y >= rect.Y+rect.H {\n\t\tcode |= codeBottom\n\t}\n\tif x < rect.X {\n\t\tcode |= codeLeft\n\t} else if x >= rect.X+rect.W {\n\t\tcode |= codeRight\n\t}\n\n\treturn code\n}\n\n// IntersectLine calculates the intersection of a rectangle and a line segment.\n// (https://wiki.libsdl.org/SDL_IntersectRectAndLine)\nfunc (a *Rect) IntersectLine(X1, Y1, X2, Y2 *int32) bool {\n\tif a.Empty() {\n\t\treturn false\n\t}\n\n\tx1 := *X1\n\ty1 := *Y1\n\tx2 := *X2\n\ty2 := *Y2\n\trectX1 := a.X\n\trectY1 := a.Y\n\trectX2 := a.X + a.W - 1\n\trectY2 := a.Y + a.H - 1\n\n\t// Check if the line is entirely inside the rect\n\tif x1 >= rectX1 && x1 <= rectX2 && x2 >= rectX1 && x2 <= rectX2 &&\n\t\ty1 >= rectY1 && y1 <= rectY2 && y2 >= rectY1 && y2 <= rectY2 {\n\t\treturn true\n\t}\n\n\t// Check if the line is entirely outside the rect\n\tif (x1 < rectX1 && x2 < rectX1) || (x1 > rectX2 && x2 > rectX2) ||\n\t\t(y1 < rectY1 && y2 < rectY1) || (y1 > rectY2 && y2 > rectY2) {\n\t\treturn false\n\t}\n\n\t// Check if the line is horizontal\n\tif y1 == y2 {\n\t\tif x1 < rectX1 {\n\t\t\t*X1 = rectX1\n\t\t} else if x1 > rectX2 {\n\t\t\t*X1 = rectX2\n\t\t}\n\t\tif x2 < rectX1 {\n\t\t\t*X2 = rectX1\n\t\t} else if x2 > rectX2 {\n\t\t\t*X2 = rectX2\n\t\t}\n\n\t\treturn true\n\t}\n\n\t// Check if the line is vertical\n\tif x1 == x2 {\n\t\tif y1 < rectY1 {\n\t\t\t*Y1 = rectY1\n\t\t} else if y1 > rectY2 {\n\t\t\t*Y1 = rectY2\n\t\t}\n\t\tif y2 < rectY1 {\n\t\t\t*Y2 = rectY1\n\t\t} else if y2 > rectY2 {\n\t\t\t*Y2 = rectY2\n\t\t}\n\n\t\treturn true\n\t}\n\n\t// Use Cohen-Sutherland algorithm when all shortcuts fail\n\toutCode1 := computeOutCode(a, x1, y1)\n\toutCode2 := computeOutCode(a, x2, y2)\n\tfor outCode1 != 0 || outCode2 != 0 {\n\t\tif outCode1&outCode2 != 0 {\n\t\t\treturn false\n\t\t}\n\n\t\tif outCode1 != 0 {\n\t\t\tvar x, y int32\n\t\t\tif outCode1&codeTop != 0 {\n\t\t\t\ty = rectY1\n\t\t\t\tx = x1 + ((x2-x1)*(y-y1))/(y2-y1)\n\t\t\t} else if outCode1&codeBottom != 0 {\n\t\t\t\ty = rectY2\n\t\t\t\tx = x1 + ((x2-x1)*(y-y1))/(y2-y1)\n\t\t\t} else if outCode1&codeLeft != 0 {\n\t\t\t\tx = rectX1\n\t\t\t\ty = y1 + ((y2-y1)*(x-x1))/(x2-x1)\n\t\t\t} else if outCode1&codeRight != 0 {\n\t\t\t\tx = rectX2\n\t\t\t\ty = y1 + ((y2-y1)*(x-x1))/(x2-x1)\n\t\t\t}\n\n\t\t\tx1 = x\n\t\t\ty1 = y\n\t\t\toutCode1 = computeOutCode(a, x, y)\n\t\t} else {\n\t\t\tvar x, y int32\n\t\t\tif outCode2&codeTop != 0 {\n\t\t\t\ty = rectY1\n\t\t\t\tx = x1 + ((x2-x1)*(y-y1))/(y2-y1)\n\t\t\t} else if outCode2&codeBottom != 0 {\n\t\t\t\ty = rectY2\n\t\t\t\tx = x1 + ((x2-x1)*(y-y1))/(y2-y1)\n\t\t\t} else if outCode2&codeLeft != 0 {\n\t\t\t\tx = rectX1\n\t\t\t\ty = y1 + ((y2-y1)*(x-x1))/(x2-x1)\n\t\t\t} else if outCode2&codeRight != 0 {\n\t\t\t\tx = rectX2\n\t\t\t\ty = y1 + ((y2-y1)*(x-x1))/(x2-x1)\n\t\t\t}\n\n\t\t\tx2 = x\n\t\t\ty2 = y\n\t\t\toutCode2 = computeOutCode(a, x, y)\n\t\t}\n\t}\n\n\t*X1 = x1\n\t*Y1 = y1\n\t*X2 = x2\n\t*Y2 = y2\n\n\treturn true\n}\n\n// IntersectLine calculates the intersection of a rectangle and a line segment.\n// (https://wiki.libsdl.org/SDL_IntersectFRectAndLine)\nfunc (a *FRect) IntersectLine(X1, Y1, X2, Y2 *float32) bool {\n\tif a.Empty() {\n\t\treturn false\n\t}\n\n\tx1 := *X1\n\ty1 := *Y1\n\tx2 := *X2\n\ty2 := *Y2\n\trectX1 := a.X\n\trectY1 := a.Y\n\trectX2 := a.X + a.W - 1\n\trectY2 := a.Y + a.H - 1\n\n\t// Check if the line is entirely inside the rect\n\tif x1 >= rectX1 && x1 <= rectX2 && x2 >= rectX1 && x2 <= rectX2 &&\n\t\ty1 >= rectY1 && y1 <= rectY2 && y2 >= rectY1 && y2 <= rectY2 {\n\t\treturn true\n\t}\n\n\t// Check if the line is entirely outside the rect\n\tif (x1 < rectX1 && x2 < rectX1) || (x1 > rectX2 && x2 > rectX2) ||\n\t\t(y1 < rectY1 && y2 < rectY1) || (y1 > rectY2 && y2 > rectY2) {\n\t\treturn false\n\t}\n\n\t// Check if the line is horizontal\n\tif y1 == y2 {\n\t\tif x1 < rectX1 {\n\t\t\t*X1 = rectX1\n\t\t} else if x1 > rectX2 {\n\t\t\t*X1 = rectX2\n\t\t}\n\t\tif x2 < rectX1 {\n\t\t\t*X2 = rectX1\n\t\t} else if x2 > rectX2 {\n\t\t\t*X2 = rectX2\n\t\t}\n\n\t\treturn true\n\t}\n\n\t// Check if the line is vertical\n\tif x1 == x2 {\n\t\tif y1 < rectY1 {\n\t\t\t*Y1 = rectY1\n\t\t} else if y1 > rectY2 {\n\t\t\t*Y1 = rectY2\n\t\t}\n\t\tif y2 < rectY1 {\n\t\t\t*Y2 = rectY1\n\t\t} else if y2 > rectY2 {\n\t\t\t*Y2 = rectY2\n\t\t}\n\n\t\treturn true\n\t}\n\n\t// Use Cohen-Sutherland algorithm when all shortcuts fail\n\toutCode1 := computeFOutCode(a, x1, y1)\n\toutCode2 := computeFOutCode(a, x2, y2)\n\tfor outCode1 != 0 || outCode2 != 0 {\n\t\tif outCode1&outCode2 != 0 {\n\t\t\treturn false\n\t\t}\n\n\t\tif outCode1 != 0 {\n\t\t\tvar x, y float32\n\t\t\tif outCode1&codeTop != 0 {\n\t\t\t\ty = rectY1\n\t\t\t\tx = x1 + ((x2-x1)*(y-y1))/(y2-y1)\n\t\t\t} else if outCode1&codeBottom != 0 {\n\t\t\t\ty = rectY2\n\t\t\t\tx = x1 + ((x2-x1)*(y-y1))/(y2-y1)\n\t\t\t} else if outCode1&codeLeft != 0 {\n\t\t\t\tx = rectX1\n\t\t\t\ty = y1 + ((y2-y1)*(x-x1))/(x2-x1)\n\t\t\t} else if outCode1&codeRight != 0 {\n\t\t\t\tx = rectX2\n\t\t\t\ty = y1 + ((y2-y1)*(x-x1))/(x2-x1)\n\t\t\t}\n\n\t\t\tx1 = x\n\t\t\ty1 = y\n\t\t\toutCode1 = computeFOutCode(a, x, y)\n\t\t} else {\n\t\t\tvar x, y float32\n\t\t\tif outCode2&codeTop != 0 {\n\t\t\t\ty = rectY1\n\t\t\t\tx = x1 + ((x2-x1)*(y-y1))/(y2-y1)\n\t\t\t} else if outCode2&codeBottom != 0 {\n\t\t\t\ty = rectY2\n\t\t\t\tx = x1 + ((x2-x1)*(y-y1))/(y2-y1)\n\t\t\t} else if outCode2&codeLeft != 0 {\n\t\t\t\tx = rectX1\n\t\t\t\ty = y1 + ((y2-y1)*(x-x1))/(x2-x1)\n\t\t\t} else if outCode2&codeRight != 0 {\n\t\t\t\tx = rectX2\n\t\t\t\ty = y1 + ((y2-y1)*(x-x1))/(x2-x1)\n\t\t\t}\n\n\t\t\tx2 = x\n\t\t\ty2 = y\n\t\t\toutCode2 = computeFOutCode(a, x, y)\n\t\t}\n\t}\n\n\t*X1 = x1\n\t*Y1 = y1\n\t*X2 = x2\n\t*Y2 = y2\n\n\treturn true\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/render.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,1))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_UpdateYUVTexture is not supported before SDL 2.0.1\")\n#endif\n\nstatic inline int SDL_UpdateYUVTexture(SDL_Texture* texture, const SDL_Rect* rect, const Uint8* Yplane, int Ypitch, const Uint8* Uplane, int Upitch, const Uint8* Vplane, int Vpitch)\n{\n\treturn -1;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,4))\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderIsClipEnabled is not supported before SDL 2.0.4\")\n#endif\nstatic inline SDL_bool SDLCALL SDL_RenderIsClipEnabled(SDL_Renderer * renderer)\n{\n\treturn SDL_FALSE;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,5))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderSetIntegerScale is not supported before SDL 2.0.5\")\n#endif\n\nstatic inline int SDL_RenderSetIntegerScale(SDL_Renderer* renderer, SDL_bool enable)\n{\n\tSDL_Unsupported();\n\treturn -1;\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderGetIntegerScale is not supported before SDL 2.0.5\")\n#endif\n\nstatic inline SDL_bool SDL_RenderGetIntegerScale(SDL_Renderer* renderer)\n{\n\tSDL_Unsupported();\n\treturn -1;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,8))\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderGetMetalLayer is not supported before SDL 2.0.8\")\n#endif\n\nstatic inline void * SDL_RenderGetMetalLayer(SDL_Renderer *renderer)\n{\n\treturn NULL;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderGetMetalCommandEncoder is not supported before SDL 2.0.8\")\n#endif\n\nstatic inline void * SDL_RenderGetMetalCommandEncoder(SDL_Renderer *renderer)\n{\n\treturn NULL;\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,10))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderDrawPointF is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderDrawPointF(SDL_Renderer * renderer, float x, float y)\n{\n\treturn SDL_RenderDrawPoint(renderer, (int) x, (int) y);\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderDrawPointsF is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderDrawPointsF(SDL_Renderer * renderer, const SDL_FPoint * points, int count)\n{\n\treturn SDL_RenderDrawPoints(renderer, (const SDL_Point *) points, count);\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderDrawLineF is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderDrawLineF(SDL_Renderer * renderer, float x1, float y1, float x2, float y2)\n{\n\treturn SDL_RenderDrawLine(renderer, (int) x1, (int) y1, (int) x2, (int) y2);\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderDrawLinesF is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderDrawLinesF(SDL_Renderer * renderer, const SDL_FPoint * points, int count)\n{\n\treturn SDL_RenderDrawLines(renderer, (const SDL_Point *) points, count);\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderDrawRectF is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderDrawRectF(SDL_Renderer * renderer, const SDL_FRect * rect)\n{\n\treturn SDL_RenderDrawRect(renderer, (const SDL_Rect *) rect);\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderDrawRectsF is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderDrawRectsF(SDL_Renderer * renderer, const SDL_FRect *rects, int count)\n{\n\treturn SDL_RenderDrawRects(renderer, (const SDL_Rect *) rects, count);\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderFillRectF is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderFillRectF(SDL_Renderer * renderer, const SDL_FRect * rect)\n{\n\treturn SDL_RenderFillRect(renderer, (const SDL_Rect *) rect);\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderFillRectsF is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderFillRectsF(SDL_Renderer * renderer, const SDL_FRect * rects, int count)\n{\n\treturn SDL_RenderFillRects(renderer, (const SDL_Rect *) rects, count);\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderCopyF is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderCopyF(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * srcrect, const SDL_FRect * dstrect)\n{\n\treturn SDL_RenderCopy(renderer, texture, srcrect, (const SDL_Rect *) dstrect);\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderCopyExF is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderCopyExF(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * srcrect, const SDL_FRect * dstrect, const double angle, const SDL_FPoint * center, const SDL_RendererFlip flip)\n{\n\treturn SDL_RenderCopyEx(renderer, texture, srcrect, (const SDL_Rect *) dstrect, angle, (const SDL_Point *) center, flip);\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderFlush is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderFlush(SDL_Renderer * renderer)\n{\n\treturn 0;\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,12))\n\ntypedef enum\n{\n    SDL_ScaleModeNearest,\n    SDL_ScaleModeLinear,\n    SDL_ScaleModeBest\n} SDL_ScaleMode;\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SetTextureScaleMode is not supported before SDL 2.0.12\")\n#pragma message(\"SDL_GetTextureScaleMode is not supported before SDL 2.0.12\")\n#pragma message(\"SDL_LockTextureToSurface is not supported before SDL 2.0.12\")\n#endif\n\nstatic int SDL_SetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode scaleMode)\n{\n\treturn -1;\n}\n\nstatic int SDLCALL SDL_GetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode *scaleMode)\n{\n\treturn -1;\n}\n\nstatic int SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, SDL_Surface **surface)\n{\n\treturn -1;\n}\n#endif\n\n\n#if !(SDL_VERSION_ATLEAST(2,0,16))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_UpdateNVTexture is not supported before SDL 2.0.16\")\n#endif\n\nstatic int SDL_UpdateNVTexture(SDL_Texture * texture, const SDL_Rect * rect, const Uint8 *Yplane, int Ypitch, const Uint8 *UVplane, int UVpitch)\n{\n\treturn -1;\n}\n\n#endif\n\n\n#if !(SDL_VERSION_ATLEAST(2,0,18))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderGeometry is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_RenderGeometryRaw is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_SetTextureUserData is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_GetTextureUserData is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_RenderWindowToLogical is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_RenderLogicalToWindow is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_RenderSetVSync is not supported before SDL 2.0.18\")\n#endif\n\n// Vertex structure\ntypedef struct SDL_Vertex\n{\n    SDL_FPoint position;  // Vertex position, in SDL_Renderer coordinates\n    SDL_Color  color;     // Vertex color\n    SDL_FPoint tex_coord; // Normalized texture coordinates, if needed\n} SDL_Vertex;\n\nstatic int SDL_RenderGeometry(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Vertex *vertices, int num_vertices, const int *indices, int num_indices)\n{\n\treturn -1;\n}\n\nstatic int SDL_RenderGeometryRaw(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, int num_vertices, const void *indices, int num_indices, int size_indices)\n{\n\treturn -1;\n}\n\nstatic int SDL_SetTextureUserData(SDL_Texture * texture, void *userdata)\n{\n\treturn -1;\n}\n\nstatic void * SDLCALL SDL_GetTextureUserData(SDL_Texture * texture)\n{\n\treturn NULL;\n}\n\nstatic void SDL_RenderWindowToLogical(SDL_Renderer * renderer, int windowX, int windowY, float *logicalX, float *logicalY)\n{\n}\n\nstatic void SDL_RenderLogicalToWindow(SDL_Renderer * renderer, float logicalX, float logicalY, int *windowX, int *windowY)\n{\n}\n\nstatic int SDL_RenderSetVSync(SDL_Renderer* renderer, int vsync)\n{\n\treturn -1;\n}\n\n#endif\n\n#if SDL_COMPILEDVERSION == SDL_VERSIONNUM(2,0,18)\nstatic inline int RenderGeometryRaw(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, int num_vertices, const void *indices, int num_indices, int size_indices)\n{\n\treturn SDL_RenderGeometryRaw(renderer, texture, xy, xy_stride, (int*) color, color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices);\n}\n#else\nstatic inline int RenderGeometryRaw(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, int num_vertices, const void *indices, int num_indices, int size_indices)\n{\n\treturn SDL_RenderGeometryRaw(renderer, texture, xy, xy_stride, color, color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices);\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,22))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderGetWindow is not supported before SDL 2.0.22\")\n#endif\n\nstatic inline SDL_Window * SDLCALL SDL_RenderGetWindow(SDL_Renderer *renderer)\n{\n\treturn NULL;\n}\n\n#endif\n\n// WORKAROUND: This prevents audio from seemingly going corrupt when drawing outside the screen bounding box?\n// It does that by allocating SDL_Rect in the C context instead of Go context.\nstatic inline int RenderCopy(SDL_Renderer *renderer, SDL_Texture *texture, SDL_Rect *src, int dst_x, int dst_y, int dst_w, int dst_h)\n{\n\tSDL_Rect dst = {dst_x, dst_y, dst_w, dst_h};\n\treturn SDL_RenderCopy(renderer, texture, src, &dst);\n}\n*/\nimport \"C\"\nimport (\n\t\"reflect\"\n\t\"unsafe\"\n)\n\n// An enumeration of flags used when creating a rendering context.\n// (https://wiki.libsdl.org/SDL_RendererFlags)\nconst (\n\tRENDERER_SOFTWARE      = C.SDL_RENDERER_SOFTWARE      // the renderer is a software fallback\n\tRENDERER_ACCELERATED   = C.SDL_RENDERER_ACCELERATED   // the renderer uses hardware acceleration\n\tRENDERER_PRESENTVSYNC  = C.SDL_RENDERER_PRESENTVSYNC  // present is synchronized with the refresh rate\n\tRENDERER_TARGETTEXTURE = C.SDL_RENDERER_TARGETTEXTURE // the renderer supports rendering to texture\n)\n\ntype ScaleMode C.SDL_ScaleMode\n\n// The scaling mode for a texture.\nconst (\n\tScaleModeNearest ScaleMode = C.SDL_ScaleModeNearest // nearest pixel sampling\n\tScaleModeLinear            = C.SDL_ScaleModeLinear  // linear filtering\n\tScaleModeBest              = C.SDL_ScaleModeBest    // anisotropic filtering\n)\n\n// An enumeration of texture access patterns..\n// (https://wiki.libsdl.org/SDL_TextureAccess)\nconst (\n\tTEXTUREACCESS_STATIC    = C.SDL_TEXTUREACCESS_STATIC    // changes rarely, not lockable\n\tTEXTUREACCESS_STREAMING = C.SDL_TEXTUREACCESS_STREAMING // changes frequently, lockable\n\tTEXTUREACCESS_TARGET    = C.SDL_TEXTUREACCESS_TARGET    // can be used as a render target\n)\n\n// An enumeration of the texture channel modulation used in Renderer.Copy().\n// (https://wiki.libsdl.org/SDL_TextureModulate)\nconst (\n\tTEXTUREMODULATE_NONE  = C.SDL_TEXTUREMODULATE_NONE  // no modulation\n\tTEXTUREMODULATE_COLOR = C.SDL_TEXTUREMODULATE_COLOR // srcC = srcC * color\n\tTEXTUREMODULATE_ALPHA = C.SDL_TEXTUREMODULATE_ALPHA // srcA = srcA * alpha\n)\n\n// An enumeration of flags that can be used in the flip parameter for Renderer.CopyEx().\n// (https://wiki.libsdl.org/SDL_RendererFlip)\nconst (\n\tFLIP_NONE       RendererFlip = C.SDL_FLIP_NONE       // do not flip\n\tFLIP_HORIZONTAL              = C.SDL_FLIP_HORIZONTAL // flip horizontally\n\tFLIP_VERTICAL                = C.SDL_FLIP_VERTICAL   // flip vertically\n)\n\n// RendererInfo contains information on the capabilities of a render driver or the current render context.\n// (https://wiki.libsdl.org/SDL_RendererInfo)\ntype RendererInfo struct {\n\tName string // the name of the renderer\n\tRendererInfoData\n}\n\ntype cRendererInfo struct {\n\tName *C.char\n\tRendererInfoData\n}\n\n// RendererInfoData contains information on the capabilities of a render driver or the current render context.\n// (https://wiki.libsdl.org/SDL_RendererInfo)\ntype RendererInfoData struct {\n\tFlags             uint32    // a mask of supported renderer flags\n\tNumTextureFormats uint32    // the number of available texture formats\n\tTextureFormats    [16]int32 // the available texture formats\n\tMaxTextureWidth   int32     // the maximum texture width\n\tMaxTextureHeight  int32     // the maximum texture height\n}\n\nfunc (info *RendererInfo) cptr() *C.SDL_RendererInfo {\n\treturn (*C.SDL_RendererInfo)(unsafe.Pointer(info))\n}\n\nfunc (info *cRendererInfo) cptr() *C.SDL_RendererInfo {\n\treturn (*C.SDL_RendererInfo)(unsafe.Pointer(info))\n}\n\n// RendererFlip is an enumeration of flags that can be used in the flip parameter for Renderer.CopyEx().\n// (https://wiki.libsdl.org/SDL_RendererFlip)\ntype RendererFlip uint32\ntype cRendererFlip C.SDL_RendererFlip\n\n// Vertex structure\ntype Vertex struct {\n\tPosition FPoint // Vertex position, in SDL_Renderer coordinates\n\tColor    Color  // Vertex color\n\tTexCoord FPoint // Normalized texture coordinates, if needed\n}\n\nfunc (flip RendererFlip) c() C.SDL_RendererFlip {\n\treturn C.SDL_RendererFlip(flip)\n}\n\n// GetNumRenderDrivers returns the number of 2D rendering drivers available for the current display.\n// (https://wiki.libsdl.org/SDL_GetNumRenderDrivers)\nfunc GetNumRenderDrivers() (int, error) {\n\ti := int(C.SDL_GetNumRenderDrivers())\n\treturn i, errorFromInt(i)\n}\n\n// GetRenderDriverInfo returns information about a specific 2D rendering driver for the current display.\n// (https://wiki.libsdl.org/SDL_GetRenderDriverInfo)\nfunc GetRenderDriverInfo(index int, info *RendererInfo) (int, error) {\n\tvar cinfo cRendererInfo\n\tret := int(C.SDL_GetRenderDriverInfo(C.int(index), cinfo.cptr()))\n\tif ret < 0 {\n\t\treturn ret, GetError()\n\t}\n\tinfo.RendererInfoData = cinfo.RendererInfoData\n\t// No need to free, it's done by DestroyRenderer\n\tinfo.Name = C.GoString(cinfo.Name)\n\treturn ret, nil\n}\n\n// CreateWindowAndRenderer returns a new window and default renderer.\n// (https://wiki.libsdl.org/SDL_CreateWindowAndRenderer)\nfunc CreateWindowAndRenderer(w, h int32, flags uint32) (*Window, *Renderer, error) {\n\tvar window *C.SDL_Window\n\tvar renderer *C.SDL_Renderer\n\tret := C.SDL_CreateWindowAndRenderer(\n\t\tC.int(w),\n\t\tC.int(h),\n\t\tC.Uint32(flags),\n\t\t&window,\n\t\t&renderer)\n\tif ret == -1 {\n\t\treturn nil, nil, GetError()\n\t}\n\treturn (*Window)(unsafe.Pointer(window)), (*Renderer)(unsafe.Pointer(renderer)), nil\n}\n\n// CreateRenderer returns a new 2D rendering context for a window.\n// (https://wiki.libsdl.org/SDL_CreateRenderer)\nfunc CreateRenderer(window *Window, index int, flags uint32) (*Renderer, error) {\n\trenderer := C.SDL_CreateRenderer(window.cptr(), C.int(index), C.Uint32(flags))\n\tif renderer == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Renderer)(unsafe.Pointer(renderer)), nil\n}\n\n// CreateSoftwareRenderer returns a new 2D software rendering context for a surface.\n// (https://wiki.libsdl.org/SDL_CreateSoftwareRenderer)\nfunc CreateSoftwareRenderer(surface *Surface) (*Renderer, error) {\n\trenderer := C.SDL_CreateSoftwareRenderer(surface.cptr())\n\tif renderer == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Renderer)(unsafe.Pointer(renderer)), nil\n}\n\n// GetRenderer returns the renderer associated with a window.\n// (https://wiki.libsdl.org/SDL_GetRenderer)\nfunc (window *Window) GetRenderer() (*Renderer, error) {\n\trenderer := C.SDL_GetRenderer(window.cptr())\n\tif renderer == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Renderer)(unsafe.Pointer(renderer)), nil\n}\n\n// GetInfo returns information about a rendering context.\n// (https://wiki.libsdl.org/SDL_GetRendererInfo)\nfunc (renderer *Renderer) GetInfo() (RendererInfo, error) {\n\tvar cinfo cRendererInfo\n\tvar info RendererInfo\n\tret := int(C.SDL_GetRendererInfo(renderer.cptr(), cinfo.cptr()))\n\tif ret < 0 {\n\t\treturn info, GetError()\n\t}\n\tinfo.RendererInfoData = cinfo.RendererInfoData\n\t// No need to free, it's done by DestroyRenderer\n\tinfo.Name = C.GoString(cinfo.Name)\n\treturn info, nil\n}\n\n// GetOutputSize returns the output size in pixels of a rendering context.\n// (https://wiki.libsdl.org/SDL_GetRendererOutputSize)\nfunc (renderer *Renderer) GetOutputSize() (w, h int32, err error) {\n\tret := C.SDL_GetRendererOutputSize(\n\t\trenderer.cptr(),\n\t\t(*C.int)(unsafe.Pointer(&w)),\n\t\t(*C.int)(unsafe.Pointer(&h)))\n\terr = errorFromInt(int(ret))\n\treturn\n}\n\n// CreateTexture returns a new texture for a rendering context.\n// (https://wiki.libsdl.org/SDL_CreateTexture)\nfunc (renderer *Renderer) CreateTexture(format uint32, access int, w, h int32) (*Texture, error) {\n\ttexture := C.SDL_CreateTexture(\n\t\trenderer.cptr(),\n\t\tC.Uint32(format),\n\t\tC.int(access),\n\t\tC.int(w),\n\t\tC.int(h))\n\tif texture == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Texture)(unsafe.Pointer(texture)), nil\n}\n\n// CreateTextureFromSurface returns a new texture from an existing surface.\n// (https://wiki.libsdl.org/SDL_CreateTextureFromSurface)\nfunc (renderer *Renderer) CreateTextureFromSurface(surface *Surface) (*Texture, error) {\n\ttexture := C.SDL_CreateTextureFromSurface(renderer.cptr(), surface.cptr())\n\tif texture == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Texture)(unsafe.Pointer(texture)), nil\n}\n\n// Query returns the attributes of a texture.\n// (https://wiki.libsdl.org/SDL_QueryTexture)\nfunc (texture *Texture) Query() (format uint32, access int, width int32, height int32, err error) {\n\tvar _format C.Uint32\n\tvar _access C.int\n\tvar _width C.int\n\tvar _height C.int\n\n\tret := int(C.SDL_QueryTexture(texture.cptr(), &_format, &_access, &_width, &_height))\n\n\tformat = uint32(_format)\n\taccess = int(_access)\n\twidth = int32(_width)\n\theight = int32(_height)\n\terr = errorFromInt(ret)\n\n\treturn\n}\n\n// SetColorMod sets an additional color value multiplied into render copy operations.\n// (https://wiki.libsdl.org/SDL_SetTextureColorMod)\nfunc (texture *Texture) SetColorMod(r uint8, g uint8, b uint8) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetTextureColorMod(\n\t\t\ttexture.cptr(),\n\t\t\tC.Uint8(r),\n\t\t\tC.Uint8(g),\n\t\t\tC.Uint8(b))))\n}\n\n// SetAlphaMod sets an additional alpha value multiplied into render copy operations.\n// (https://wiki.libsdl.org/SDL_SetTextureAlphaMod)\nfunc (texture *Texture) SetAlphaMod(alpha uint8) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetTextureAlphaMod(texture.cptr(), C.Uint8(alpha))))\n}\n\n// GetAlphaMod returns the additional alpha value multiplied into render copy operations.\n// (https://wiki.libsdl.org/SDL_GetTextureAlphaMod)\nfunc (texture *Texture) GetAlphaMod() (alpha uint8, err error) {\n\tret := C.SDL_GetTextureAlphaMod(texture.cptr(), (*C.Uint8)(unsafe.Pointer(&alpha)))\n\treturn alpha, errorFromInt(int(ret))\n}\n\n// SetBlendMode sets the blend mode for a texture, used by Renderer.Copy().\n// (https://wiki.libsdl.org/SDL_SetTextureBlendMode)\nfunc (texture *Texture) SetBlendMode(bm BlendMode) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetTextureBlendMode(texture.cptr(), bm.c())))\n}\n\n// GetBlendMode returns the blend mode used for texture copy operations.\n// (https://wiki.libsdl.org/SDL_GetTextureBlendMode)\nfunc (texture *Texture) GetBlendMode() (bm BlendMode, err error) {\n\tret := C.SDL_GetTextureBlendMode(texture.cptr(), bm.cptr())\n\treturn bm, errorFromInt(int(ret))\n}\n\n// Update updates the given texture rectangle with new pixel data.\n// (https://wiki.libsdl.org/SDL_UpdateTexture)\nfunc (texture *Texture) Update(rect *Rect, pixels unsafe.Pointer, pitch int) error {\n\tif pixels == nil {\n\t\treturn nil\n\t}\n\treturn errorFromInt(int(\n\t\tC.SDL_UpdateTexture(\n\t\t\ttexture.cptr(),\n\t\t\trect.cptr(),\n\t\t\tpixels,\n\t\t\tC.int(pitch))))\n}\n\n// UpdateRGBA updates the given texture rectangle with new uint32 pixel data.\n// (https://wiki.libsdl.org/SDL_UpdateTexture)\nfunc (texture *Texture) UpdateRGBA(rect *Rect, pixels []uint32, pitch int) error {\n\tif pixels == nil {\n\t\treturn nil\n\t}\n\treturn errorFromInt(int(\n\t\tC.SDL_UpdateTexture(\n\t\t\ttexture.cptr(),\n\t\t\trect.cptr(),\n\t\t\tunsafe.Pointer(&pixels[0]),\n\t\t\tC.int(4*pitch)))) // 4 bytes in one uint32\n}\n\n// UpdateYUV updates a rectangle within a planar YV12 or IYUV texture with new pixel data.\n// (https://wiki.libsdl.org/SDL_UpdateYUVTexture)\nfunc (texture *Texture) UpdateYUV(rect *Rect, yPlane []byte, yPitch int, uPlane []byte, uPitch int, vPlane []byte, vPitch int) error {\n\tvar yPlanePtr, uPlanePtr, vPlanePtr *byte\n\tif yPlane != nil {\n\t\tyPlanePtr = &yPlane[0]\n\t}\n\tif uPlane != nil {\n\t\tuPlanePtr = &uPlane[0]\n\t}\n\tif vPlane != nil {\n\t\tvPlanePtr = &vPlane[0]\n\t}\n\treturn errorFromInt(int(\n\t\tC.SDL_UpdateYUVTexture(\n\t\t\ttexture.cptr(),\n\t\t\trect.cptr(),\n\t\t\t(*C.Uint8)(unsafe.Pointer(yPlanePtr)),\n\t\t\tC.int(yPitch),\n\t\t\t(*C.Uint8)(unsafe.Pointer(uPlanePtr)),\n\t\t\tC.int(uPitch),\n\t\t\t(*C.Uint8)(unsafe.Pointer(vPlanePtr)),\n\t\t\tC.int(vPitch))))\n}\n\n// Lock locks a portion of the texture for write-only pixel access.\n// (https://wiki.libsdl.org/SDL_LockTexture)\nfunc (texture *Texture) Lock(rect *Rect) ([]byte, int, error) {\n\tvar _pitch C.int\n\tvar _pixels unsafe.Pointer\n\tvar b []byte\n\tvar length int\n\n\tret := C.SDL_LockTexture(texture.cptr(), rect.cptr(), &_pixels, &_pitch)\n\tif ret < 0 {\n\t\treturn b, int(_pitch), GetError()\n\t}\n\n\t_, _, w, h, err := texture.Query()\n\tif err != nil {\n\t\treturn b, int(_pitch), GetError()\n\t}\n\n\tpitch := int32(_pitch)\n\tif rect != nil {\n\t\tbytesPerPixel := pitch / w\n\t\tlength = int(bytesPerPixel * (w*rect.H - rect.X - (w - rect.X - rect.W)))\n\t} else {\n\t\tlength = int(pitch * h)\n\t}\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&b))\n\tsliceHeader.Cap = int(length)\n\tsliceHeader.Len = int(length)\n\tsliceHeader.Data = uintptr(_pixels)\n\n\treturn b, int(pitch), nil\n}\n\n// Unlock unlocks a texture, uploading the changes to video memory, if needed.\n// (https://wiki.libsdl.org/SDL_UnlockTexture)\nfunc (texture *Texture) Unlock() {\n\tC.SDL_UnlockTexture(texture.cptr())\n}\n\n// RenderTargetSupported reports whether a window supports the use of render targets.\n// (https://wiki.libsdl.org/SDL_RenderTargetSupported)\nfunc (renderer *Renderer) RenderTargetSupported() bool {\n\treturn C.SDL_RenderTargetSupported(renderer.cptr()) != 0\n}\n\n// SetRenderTarget sets a texture as the current rendering target.\n// (https://wiki.libsdl.org/SDL_SetRenderTarget)\nfunc (renderer *Renderer) SetRenderTarget(texture *Texture) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetRenderTarget(renderer.cptr(), texture.cptr())))\n\n}\n\n// GetRenderTarget returns the current render target.\n// (https://wiki.libsdl.org/SDL_GetRenderTarget)\nfunc (renderer *Renderer) GetRenderTarget() *Texture {\n\treturn (*Texture)(unsafe.Pointer(C.SDL_GetRenderTarget(renderer.cptr())))\n}\n\n// SetLogicalSize sets a device independent resolution for rendering.\n// (https://wiki.libsdl.org/SDL_RenderSetLogicalSize)\nfunc (renderer *Renderer) SetLogicalSize(w, h int32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderSetLogicalSize(renderer.cptr(), C.int(w), C.int(h))))\n}\n\n// GetLogicalSize returns device independent resolution for rendering.\n// (https://wiki.libsdl.org/SDL_RenderGetLogicalSize)\nfunc (renderer *Renderer) GetLogicalSize() (w, h int32) {\n\tC.SDL_RenderGetLogicalSize(\n\t\trenderer.cptr(),\n\t\t(*C.int)(unsafe.Pointer(&w)),\n\t\t(*C.int)(unsafe.Pointer(&h)))\n\treturn\n}\n\n// SetViewport sets the drawing area for rendering on the current target.\n// (https://wiki.libsdl.org/SDL_RenderSetViewport)\nfunc (renderer *Renderer) SetViewport(rect *Rect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderSetViewport(renderer.cptr(), rect.cptr())))\n}\n\n// GetViewport returns the drawing area for the current target.\n// (https://wiki.libsdl.org/SDL_RenderGetViewport)\nfunc (renderer *Renderer) GetViewport() (rect Rect) {\n\tC.SDL_RenderGetViewport(renderer.cptr(), rect.cptr())\n\treturn\n}\n\n// IsClipEnabled returns whether clipping is enabled on the given renderer.\n// (https://wiki.libsdl.org/SDL_RenderIsClipEnabled)\nfunc (renderer *Renderer) IsClipEnabled() bool {\n\treturn C.SDL_RenderIsClipEnabled(renderer.cptr()) == C.SDL_TRUE\n}\n\n// SetClipRect sets the clip rectangle for rendering on the specified target.\n// (https://wiki.libsdl.org/SDL_RenderSetClipRect)\nfunc (renderer *Renderer) SetClipRect(rect *Rect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderSetClipRect(renderer.cptr(), rect.cptr())))\n}\n\n// GetClipRect returns the clip rectangle for the current target.\n// (https://wiki.libsdl.org/SDL_RenderGetClipRect)\nfunc (renderer *Renderer) GetClipRect() (rect Rect) {\n\tC.SDL_RenderGetClipRect(renderer.cptr(), rect.cptr())\n\treturn\n}\n\n// SetScale sets the drawing scale for rendering on the current target.\n// (https://wiki.libsdl.org/SDL_RenderSetScale)\nfunc (renderer *Renderer) SetScale(scaleX, scaleY float32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderSetScale(\n\t\t\trenderer.cptr(),\n\t\t\tC.float(scaleX),\n\t\t\tC.float(scaleY))))\n}\n\n// GetScale returns the drawing scale for the current target.\n// (https://wiki.libsdl.org/SDL_RenderGetScale)\nfunc (renderer *Renderer) GetScale() (scaleX, scaleY float32) {\n\tC.SDL_RenderGetScale(\n\t\trenderer.cptr(),\n\t\t(*C.float)(unsafe.Pointer(&scaleX)),\n\t\t(*C.float)(unsafe.Pointer(&scaleY)))\n\treturn\n}\n\n// SetIntegerScale sets whether to force integer scales for\n// resolution-independent rendering.\n//\n// This function restricts the logical viewport to integer values - that is,\n// when a resolution is between two multiples of a logical size, the viewport\n// size is rounded down to the lower multiple.\n//\n// (https://wiki.libsdl.org/SDL_RenderSetIntegerScale)\nfunc (renderer *Renderer) SetIntegerScale(v bool) error {\n\tvar cv C.SDL_bool = C.SDL_FALSE\n\tif v {\n\t\tcv = C.SDL_TRUE\n\t}\n\n\treturn errorFromInt(int(C.SDL_RenderSetIntegerScale(renderer.cptr(), cv)))\n}\n\n// GetIntegerScale reports whether integer scales are forced for\n// resolution-independent rendering.\n//\n// (https://wiki.libsdl.org/SDL_RenderGetIntegerScale)\nfunc (renderer *Renderer) GetIntegerScale() (bool, error) {\n\tClearError()\n\tif C.SDL_RenderGetIntegerScale(renderer.cptr()) == C.SDL_TRUE {\n\t\treturn true, nil\n\t}\n\treturn false, GetError()\n}\n\n// SetDrawColor sets the color used for drawing operations (Rect, Line and Clear).\n// (https://wiki.libsdl.org/SDL_SetRenderDrawColor)\nfunc (renderer *Renderer) SetDrawColor(r, g, b, a uint8) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetRenderDrawColor(\n\t\t\trenderer.cptr(),\n\t\t\tC.Uint8(r),\n\t\t\tC.Uint8(g),\n\t\t\tC.Uint8(b),\n\t\t\tC.Uint8(a))))\n}\n\n// SetDrawColorArray is a custom variant of SetDrawColor.\nfunc (renderer *Renderer) SetDrawColorArray(bs ...uint8) error {\n\t_bs := []C.Uint8{0, 0, 0, 255}\n\tfor i := 0; i < len(_bs) && i < len(bs); i++ {\n\t\t_bs[i] = C.Uint8(bs[i])\n\t}\n\treturn errorFromInt(int(\n\t\tC.SDL_SetRenderDrawColor(\n\t\t\trenderer.cptr(),\n\t\t\t_bs[0],\n\t\t\t_bs[1],\n\t\t\t_bs[2],\n\t\t\t_bs[3])))\n}\n\n// GetDrawColor returns the color used for drawing operations (Rect, Line and Clear).\n// (https://wiki.libsdl.org/SDL_GetRenderDrawColor)\nfunc (renderer *Renderer) GetDrawColor() (r, g, b, a uint8, err error) {\n\tret := C.SDL_GetRenderDrawColor(\n\t\trenderer.cptr(),\n\t\t(*C.Uint8)(unsafe.Pointer(&r)),\n\t\t(*C.Uint8)(unsafe.Pointer(&g)),\n\t\t(*C.Uint8)(unsafe.Pointer(&b)),\n\t\t(*C.Uint8)(unsafe.Pointer(&a)))\n\treturn r, g, b, a, errorFromInt(int(ret))\n}\n\n// SetDrawBlendMode sets the blend mode used for drawing operations (Fill and Line).\n// (https://wiki.libsdl.org/SDL_SetRenderDrawBlendMode)\nfunc (renderer *Renderer) SetDrawBlendMode(bm BlendMode) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetRenderDrawBlendMode(renderer.cptr(), bm.c())))\n}\n\n// GetDrawBlendMode returns the blend mode used for drawing operations.\n// (https://wiki.libsdl.org/SDL_GetRenderDrawBlendMode)\nfunc (renderer *Renderer) GetDrawBlendMode(bm *BlendMode) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_GetRenderDrawBlendMode(renderer.cptr(), bm.cptr())))\n}\n\n// Clear clears the current rendering target with the drawing color.\n// (https://wiki.libsdl.org/SDL_RenderClear)\nfunc (renderer *Renderer) Clear() error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderClear(renderer.cptr())))\n}\n\n// DrawPoint draws a point on the current rendering target.\n// (https://wiki.libsdl.org/SDL_RenderDrawPoint)\nfunc (renderer *Renderer) DrawPoint(x, y int32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawPoint(renderer.cptr(), C.int(x), C.int(y))))\n}\n\n// DrawPoints draws multiple points on the current rendering target.\n// (https://wiki.libsdl.org/SDL_RenderDrawPoints)\nfunc (renderer *Renderer) DrawPoints(points []Point) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawPoints(\n\t\t\trenderer.cptr(),\n\t\t\tpoints[0].cptr(),\n\t\t\tC.int(len(points)))))\n}\n\n// DrawLine draws a line on the current rendering target.\n// (https://wiki.libsdl.org/SDL_RenderDrawLine)\nfunc (renderer *Renderer) DrawLine(x1, y1, x2, y2 int32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawLine(\n\t\t\trenderer.cptr(),\n\t\t\tC.int(x1),\n\t\t\tC.int(y1),\n\t\t\tC.int(x2),\n\t\t\tC.int(y2))))\n}\n\n// DrawLines draws a series of connected lines on the current rendering target.\n// (https://wiki.libsdl.org/SDL_RenderDrawLines)\nfunc (renderer *Renderer) DrawLines(points []Point) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawLines(\n\t\t\trenderer.cptr(),\n\t\t\tpoints[0].cptr(),\n\t\t\tC.int(len(points)))))\n}\n\n// DrawRect draws a rectangle on the current rendering target.\n// (https://wiki.libsdl.org/SDL_RenderDrawRect)\nfunc (renderer *Renderer) DrawRect(rect *Rect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawRect(renderer.cptr(), rect.cptr())))\n}\n\n// DrawRects draws some number of rectangles on the current rendering target.\n// (https://wiki.libsdl.org/SDL_RenderDrawRects)\nfunc (renderer *Renderer) DrawRects(rects []Rect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawRects(\n\t\t\trenderer.cptr(),\n\t\t\trects[0].cptr(),\n\t\t\tC.int(len(rects)))))\n}\n\n// FillRect fills a rectangle on the current rendering target with the drawing color.\n// (https://wiki.libsdl.org/SDL_RenderFillRect)\nfunc (renderer *Renderer) FillRect(rect *Rect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderFillRect(renderer.cptr(), rect.cptr())))\n}\n\n// FillRects fills some number of rectangles on the current rendering target with the drawing color.\n// (https://wiki.libsdl.org/SDL_RenderFillRects)\nfunc (renderer *Renderer) FillRects(rects []Rect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderFillRects(\n\t\t\trenderer.cptr(),\n\t\t\trects[0].cptr(),\n\t\t\tC.int(len(rects)))))\n}\n\n// Copy copies a portion of the texture to the current rendering target.\n// (https://wiki.libsdl.org/SDL_RenderCopy)\nfunc (renderer *Renderer) Copy(texture *Texture, src, dst *Rect) error {\n\tif dst == nil {\n\t\treturn errorFromInt(int(\n\t\t\tC.SDL_RenderCopy(\n\t\t\t\trenderer.cptr(),\n\t\t\t\ttexture.cptr(),\n\t\t\t\tsrc.cptr(),\n\t\t\t\tdst.cptr())))\n\t}\n\treturn errorFromInt(int(\n\t\tC.RenderCopy(\n\t\t\trenderer.cptr(),\n\t\t\ttexture.cptr(),\n\t\t\tsrc.cptr(),\n\t\t\tC.int(dst.X), C.int(dst.Y), C.int(dst.W), C.int(dst.H))))\n}\n\n// CopyEx copies a portion of the texture to the current rendering target, optionally rotating it by angle around the given center and also flipping it top-bottom and/or left-right.\n// (https://wiki.libsdl.org/SDL_RenderCopyEx)\nfunc (renderer *Renderer) CopyEx(texture *Texture, src, dst *Rect, angle float64, center *Point, flip RendererFlip) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderCopyEx(\n\t\t\trenderer.cptr(),\n\t\t\ttexture.cptr(),\n\t\t\tsrc.cptr(),\n\t\t\tdst.cptr(),\n\t\t\tC.double(angle),\n\t\t\tcenter.cptr(),\n\t\t\tflip.c())))\n}\n\n// DrawPointF draws a point on the current rendering target.\n// TODO: (https://wiki.libsdl.org/SDL_RenderDrawPointF)\nfunc (renderer *Renderer) DrawPointF(x, y float32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawPointF(renderer.cptr(), C.float(x), C.float(y))))\n}\n\n// DrawPointsF draws multiple points on the current rendering target.\n// TODO: (https://wiki.libsdl.org/SDL_RenderDrawPointsF)\nfunc (renderer *Renderer) DrawPointsF(points []FPoint) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawPointsF(\n\t\t\trenderer.cptr(),\n\t\t\tpoints[0].cptr(),\n\t\t\tC.int(len(points)))))\n}\n\n// DrawLineF draws a line on the current rendering target.\n// TODO: (https://wiki.libsdl.org/SDL_RenderDrawLineF)\nfunc (renderer *Renderer) DrawLineF(x1, y1, x2, y2 float32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawLineF(\n\t\t\trenderer.cptr(),\n\t\t\tC.float(x1),\n\t\t\tC.float(y1),\n\t\t\tC.float(x2),\n\t\t\tC.float(y2))))\n}\n\n// DrawLinesF draws a series of connected lines on the current rendering target.\n// TODO: (https://wiki.libsdl.org/SDL_RenderDrawLinesF)\nfunc (renderer *Renderer) DrawLinesF(points []FPoint) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawLinesF(\n\t\t\trenderer.cptr(),\n\t\t\tpoints[0].cptr(),\n\t\t\tC.int(len(points)))))\n}\n\n// DrawRectF draws a rectangle on the current rendering target.\n// TODO: (https://wiki.libsdl.org/SDL_RenderDrawRectF)\nfunc (renderer *Renderer) DrawRectF(rect *FRect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawRectF(renderer.cptr(), rect.cptr())))\n}\n\n// DrawRectsF draws some number of rectangles on the current rendering target.\n// TODO: (https://wiki.libsdl.org/SDL_RenderDrawRectsF)\nfunc (renderer *Renderer) DrawRectsF(rects []FRect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawRectsF(\n\t\t\trenderer.cptr(),\n\t\t\trects[0].cptr(),\n\t\t\tC.int(len(rects)))))\n}\n\n// FillRectF fills a rectangle on the current rendering target with the drawing color.\n// TODO: (https://wiki.libsdl.org/SDL_RenderFillRectF)\nfunc (renderer *Renderer) FillRectF(rect *FRect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderFillRectF(renderer.cptr(), rect.cptr())))\n}\n\n// FillRectsF fills some number of rectangles on the current rendering target with the drawing color.\n// TODO: (https://wiki.libsdl.org/SDL_RenderFillRectsF)\nfunc (renderer *Renderer) FillRectsF(rects []FRect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderFillRectsF(\n\t\t\trenderer.cptr(),\n\t\t\trects[0].cptr(),\n\t\t\tC.int(len(rects)))))\n}\n\n// CopyF copies a portion of the texture to the current rendering target.\n// TODO: (https://wiki.libsdl.org/SDL_RenderCopyF)\nfunc (renderer *Renderer) CopyF(texture *Texture, src *Rect, dst *FRect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderCopyF(\n\t\t\trenderer.cptr(),\n\t\t\ttexture.cptr(),\n\t\t\tsrc.cptr(),\n\t\t\tdst.cptr())))\n}\n\n// CopyExF copies a portion of the texture to the current rendering target, optionally rotating it by angle around the given center and also flipping it top-bottom and/or left-right.\n// TODO: (https://wiki.libsdl.org/SDL_RenderCopyExF)\nfunc (renderer *Renderer) CopyExF(texture *Texture, src *Rect, dst *FRect, angle float64, center *FPoint, flip RendererFlip) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderCopyExF(\n\t\t\trenderer.cptr(),\n\t\t\ttexture.cptr(),\n\t\t\tsrc.cptr(),\n\t\t\tdst.cptr(),\n\t\t\tC.double(angle),\n\t\t\tcenter.cptr(),\n\t\t\tflip.c())))\n}\n\n// ReadPixels reads pixels from the current rendering target.\n// (https://wiki.libsdl.org/SDL_RenderReadPixels)\nfunc (renderer *Renderer) ReadPixels(rect *Rect, format uint32, pixels unsafe.Pointer, pitch int) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderReadPixels(\n\t\t\trenderer.cptr(),\n\t\t\trect.cptr(),\n\t\t\tC.Uint32(format),\n\t\t\tpixels,\n\t\t\tC.int(pitch))))\n}\n\n// Present updates the screen with any rendering performed since the previous call.\n// (https://wiki.libsdl.org/SDL_RenderPresent)\nfunc (renderer *Renderer) Present() {\n\tC.SDL_RenderPresent(renderer.cptr())\n}\n\n// Destroy destroys the specified texture.\n// (https://wiki.libsdl.org/SDL_DestroyTexture)\nfunc (texture *Texture) Destroy() error {\n\tlastErr := GetError()\n\tClearError()\n\tC.SDL_DestroyTexture(texture.cptr())\n\terr := GetError()\n\tif err != nil {\n\t\treturn err\n\t}\n\tSetError(lastErr)\n\treturn nil\n}\n\n// Destroy destroys the rendering context for a window and free associated textures.\n// (https://wiki.libsdl.org/SDL_DestroyRenderer)\nfunc (renderer *Renderer) Destroy() error {\n\tlastErr := GetError()\n\tClearError()\n\tC.SDL_DestroyRenderer(renderer.cptr())\n\terr := GetError()\n\tif err != nil {\n\t\treturn err\n\t}\n\tSetError(lastErr)\n\treturn nil\n}\n\n// Flush forces the rendering context to flush any pending commands to the underlying rendering API.\n// TODO: (https://wiki.libsdl.org/SDL_RenderFlush)\nfunc (renderer *Renderer) Flush() error {\n\treturn errorFromInt(int(C.SDL_RenderFlush(renderer.cptr())))\n}\n\n// GLBind binds an OpenGL/ES/ES2 texture to the current context for use with OpenGL instructions when rendering OpenGL primitives directly.\n// (https://wiki.libsdl.org/SDL_GL_BindTexture)\nfunc (texture *Texture) GLBind(texw, texh *float32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_GL_BindTexture(\n\t\t\ttexture.cptr(),\n\t\t\t(*C.float)(unsafe.Pointer(texw)),\n\t\t\t(*C.float)(unsafe.Pointer(texh)))))\n}\n\n// GLUnbind unbinds an OpenGL/ES/ES2 texture from the current context.\n// (https://wiki.libsdl.org/SDL_GL_UnbindTexture)\nfunc (texture *Texture) GLUnbind() error {\n\treturn errorFromInt(int(\n\t\tC.SDL_GL_UnbindTexture(texture.cptr())))\n}\n\n// GetMetalLayer gets the CAMetalLayer associated with the given Metal renderer\n// (https://wiki.libsdl.org/SDL_RenderGetMetalLayer)\nfunc (renderer *Renderer) GetMetalLayer() (layer unsafe.Pointer, err error) {\n\tlayer = C.SDL_RenderGetMetalLayer(renderer.cptr())\n\tif layer == nil {\n\t\terr = GetError()\n\t}\n\treturn\n}\n\n// GetMetalCommandEncoder gets the Metal command encoder for the current frame\n// (https://wiki.libsdl.org/SDL_RenderGetMetalCommandEncoder)\nfunc (renderer *Renderer) GetMetalCommandEncoder() (encoder unsafe.Pointer, err error) {\n\tencoder = C.SDL_RenderGetMetalCommandEncoder(renderer.cptr())\n\tif encoder == nil {\n\t\terr = GetError()\n\t}\n\treturn\n}\n\n// UpdateNV updates a rectangle within a planar NV12 or NV21 texture with new pixels.\n// (https://wiki.libsdl.org/SDL_UpdateNVTexture)\nfunc (texture *Texture) UpdateNV(rect *Rect, yPlane []byte, yPitch int, uvPlane []byte, uvPitch int) error {\n\tvar yPlanePtr, uvPlanePtr *byte\n\tif yPlane != nil {\n\t\tyPlanePtr = &yPlane[0]\n\t}\n\tif uvPlane != nil {\n\t\tuvPlanePtr = &uvPlane[0]\n\t}\n\treturn errorFromInt(int(\n\t\tC.SDL_UpdateNVTexture(\n\t\t\ttexture.cptr(),\n\t\t\trect.cptr(),\n\t\t\t(*C.Uint8)(unsafe.Pointer(yPlanePtr)),\n\t\t\tC.int(yPitch),\n\t\t\t(*C.Uint8)(unsafe.Pointer(uvPlanePtr)),\n\t\t\tC.int(uvPitch))))\n}\n\n// RenderGeometry renders a list of triangles, optionally using a texture and\n// indices into the vertex array Color and alpha modulation is done per vertex\n// (SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are ignored).\n// (https://wiki.libsdl.org/SDL_RenderGeometry)\nfunc (renderer *Renderer) RenderGeometry(texture *Texture, vertices []Vertex, indices []int32) (err error) {\n\t_texture := texture.cptr()\n\t_vertices := (*C.SDL_Vertex)(unsafe.Pointer(&vertices[0]))\n\t_num_vertices := C.int(len(vertices))\n\tvar _indices *C.int\n\t_num_indices := C.int(0)\n\tif indices != nil {\n\t\t_indices = (*C.int)(unsafe.Pointer(&indices[0]))\n\t\t_num_indices = C.int(len(indices))\n\t}\n\terr = errorFromInt(int(C.SDL_RenderGeometry(renderer.cptr(), _texture, _vertices, _num_vertices, _indices, _num_indices)))\n\treturn\n}\n\n// RenderGeomtryRaw renders a list of triangles, optionally using a texture and\n// indices into the vertex arrays Color and alpha modulation is done per vertex\n// (SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are ignored).\n// (https://wiki.libsdl.org/SDL_RenderGeometryRaw)\nfunc (renderer *Renderer) RenderGeometryRaw(texture *Texture, xy *float32, xy_stride int, color *Color, color_stride int, uv *float32, uv_stride int, num_vertices int, indices unsafe.Pointer, num_indices int, size_indices int) (err error) {\n\t_texture := texture.cptr()\n\t_xy := (*C.float)(xy)\n\t_xy_stride := C.int(xy_stride)\n\t_color := (*C.SDL_Color)(unsafe.Pointer(color))\n\t_color_stride := C.int(color_stride)\n\t_uv := (*C.float)(uv)\n\t_uv_stride := C.int(uv_stride)\n\t_num_vertices := C.int(num_vertices)\n\t_num_indices := C.int(num_indices)\n\t_size_indices := C.int(size_indices)\n\t_indices := indices\n\n\terr = errorFromInt(int(C.RenderGeometryRaw(renderer.cptr(), _texture, _xy, _xy_stride, _color, _color_stride, _uv, _uv_stride, _num_vertices, _indices, _num_indices, _size_indices)))\n\treturn\n}\n\n// SetTextureUserData associates a user-specified pointer with a texture.\n// (https://wiki.libsdl.org/SDL_SetTextureUserData)\nfunc (texture *Texture) SetTextureUserData(userdata unsafe.Pointer) (err error) {\n\terr = errorFromInt(int(C.SDL_SetTextureUserData(texture.cptr(), userdata)))\n\treturn\n}\n\n// GetTextureUserData gets the user-specified pointer associated with a texture.\n// (https://wiki.libsdl.org/SDL_GetTextureUserData)\nfunc (texture *Texture) GetTextureUserData() (userdata unsafe.Pointer) {\n\tuserdata = C.SDL_GetTextureUserData(texture.cptr())\n\treturn\n}\n\n// RenderWindowToLogical gets logical coordinates of point in renderer when given real coordinates of\n// point in window.\n//\n// Logical coordinates will differ from real coordinates when render is scaled\n// and logical renderer size set\n//\n// (https://wiki.libsdl.org/SDL_RenderWindowToLogical)\nfunc (renderer *Renderer) RenderWindowToLogical(windowX, windowY int) (logicalX, logicalY float32) {\n\t_windowX := C.int(windowX)\n\t_windowY := C.int(windowY)\n\t_logicalX := C.float(0)\n\t_logicalY := C.float(0)\n\tC.SDL_RenderWindowToLogical(renderer.cptr(), _windowX, _windowY, &_logicalX, &_logicalY)\n\tlogicalX = float32(_logicalX)\n\tlogicalY = float32(_logicalY)\n\treturn\n}\n\n// RenderLogicalToWindow gets real coordinates of point in window when given logical coordinates of point in renderer.\n// Logical coordinates will differ from real coordinates when render is scaled and logical renderer size set.\n// (https://wiki.libsdl.org/SDL_RenderLogicalToWindow)\nfunc (renderer *Renderer) RenderLogicalToWindow(logicalX, logicalY float32) (windowX, windowY int) {\n\t_logicalX := C.float(logicalX)\n\t_logicalY := C.float(logicalY)\n\t_windowX := C.int(0)\n\t_windowY := C.int(0)\n\tC.SDL_RenderLogicalToWindow(renderer.cptr(), _logicalX, _logicalY, &_windowX, &_windowY)\n\twindowX = int(_windowX)\n\twindowY = int(_windowY)\n\treturn\n}\n\n// RenderSetVSync toggles VSync of the given renderer.\n// (https://wiki.libsdl.org/SDL_RenderSetVSync)\nfunc (renderer *Renderer) RenderSetVSync(vsync bool) (err error) {\n\t_vsync := C.int(Btoi(vsync))\n\terr = errorFromInt(int(C.SDL_RenderSetVSync(renderer.cptr(), _vsync)))\n\treturn\n}\n\n// GetWindow gets the window associated with a renderer.\n// (https://wiki.libsdl.org/SDL_RenderGetWindow)\nfunc (renderer *Renderer) GetWindow() (window *Window, err error) {\n\twindow = (*Window)(unsafe.Pointer(C.SDL_RenderGetWindow(renderer.cptr())))\n\treturn\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/rwops.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\nstatic Sint64 RWsize(SDL_RWops *ctx)\n{\n\treturn ctx->size(ctx);\n}\n\nstatic Sint64 RWseek(SDL_RWops *ctx, Sint64 offset, int whence)\n{\n\treturn ctx->seek(ctx, offset, whence);\n}\n\nstatic size_t RWread(SDL_RWops *ctx, void *ptr, size_t size, size_t maxnum)\n{\n\treturn ctx->read(ctx, ptr, size, maxnum);\n}\n\nstatic size_t RWwrite(SDL_RWops *ctx, void *ptr, size_t size, size_t num)\n{\n\treturn ctx->write(ctx, ptr, size, num);\n}\n\nstatic int RWclose(SDL_RWops *ctx)\n{\n\treturn ctx->close(ctx);\n}\n\n#if !(SDL_VERSION_ATLEAST(2,0,6))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_LoadFile_RW is not supported before SDL 2.0.6\")\n#endif\n\nstatic void * SDL_LoadFile_RW(SDL_RWops * src, size_t *datasize, int freesrc)\n{\n\treturn 0;\n}\n#endif\n*/\nimport \"C\"\nimport (\n\t\"reflect\"\n\t\"unsafe\"\n)\n\n// RWops types\nconst (\n\tRWOPS_UNKNOWN   = 0 // unknown stream type\n\tRWOPS_WINFILE   = 1 // win32 file\n\tRWOPS_STDFILE   = 2 // stdio file\n\tRWOPS_JNIFILE   = 3 // android asset\n\tRWOPS_MEMORY    = 4 // memory stream\n\tRWOPS_MEMORY_RO = 5 // read-only memory stream\n)\n\n// RWops seek from\nconst (\n\tRW_SEEK_SET = C.RW_SEEK_SET // seek from the beginning of data\n\tRW_SEEK_CUR = C.RW_SEEK_CUR // seek relative to current read point\n\tRW_SEEK_END = C.RW_SEEK_END // seek relative to the end of data\n)\n\n// RWops provides an abstract interface to stream I/O. Applications can generally ignore the specifics of this structure's internals and treat them as opaque pointers. The details are important to lower-level code that might need to implement one of these, however.\n// (https://wiki.libsdl.org/SDL_RWops)\ntype RWops C.SDL_RWops\n\nfunc (rwops *RWops) cptr() *C.SDL_RWops {\n\treturn (*C.SDL_RWops)(rwops)\n}\n\n// RWFromFile creates a new RWops structure for reading from and/or writing to a named file.\n// (https://wiki.libsdl.org/SDL_RWFromFile)\nfunc RWFromFile(file, mode string) *RWops {\n\t_file := C.CString(file)\n\t_mode := C.CString(mode)\n\tdefer C.free(unsafe.Pointer(_file))\n\tdefer C.free(unsafe.Pointer(_mode))\n\treturn (*RWops)(unsafe.Pointer(C.SDL_RWFromFile(_file, _mode)))\n}\n\n// RWFromMem prepares a read-write memory buffer for use with RWops.\n// (https://wiki.libsdl.org/SDL_RWFromMem)\nfunc RWFromMem(mem []byte) (*RWops, error) {\n\tif mem == nil {\n\t\treturn nil, ErrInvalidParameters\n\t}\n\n\theader := (*reflect.SliceHeader)(unsafe.Pointer(&mem))\n\t_mem := unsafe.Pointer(header.Data)\n\n\trwops := (*RWops)(unsafe.Pointer(C.SDL_RWFromMem(_mem, C.int(len(mem)))))\n\tif rwops == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn rwops, nil\n}\n\n// AllocRW allocates an empty, unpopulated RWops structure.\n// (https://wiki.libsdl.org/SDL_AllocRW)\nfunc AllocRW() *RWops {\n\treturn (*RWops)(unsafe.Pointer(C.SDL_AllocRW()))\n}\n\n// Free frees the RWops structure allocated by AllocRW().\n// (https://wiki.libsdl.org/SDL_FreeRW)\nfunc (rwops *RWops) Free() error {\n\tif rwops == nil {\n\t\treturn ErrInvalidParameters\n\t}\n\n\tC.SDL_FreeRW(rwops.cptr())\n\treturn nil\n}\n\n// Size returns the size of the data stream in the RWops.\n// (https://wiki.libsdl.org/SDL_RWsize)\nfunc (rwops *RWops) Size() (int64, error) {\n\tn := int64(C.RWsize(rwops.cptr()))\n\tif n < 0 {\n\t\treturn n, GetError()\n\t}\n\treturn n, nil\n}\n\n// Seek seeks within the RWops data stream.\n// (https://wiki.libsdl.org/SDL_RWseek)\nfunc (rwops *RWops) Seek(offset int64, whence int) (int64, error) {\n\tif rwops == nil {\n\t\treturn -1, ErrInvalidParameters\n\t}\n\n\tret := int64(C.RWseek(rwops.cptr(), C.Sint64(offset), C.int(whence)))\n\tif ret < 0 {\n\t\treturn ret, GetError()\n\t}\n\treturn ret, nil\n}\n\n// Read reads from a data source.\n// (https://wiki.libsdl.org/SDL_RWread)\nfunc (rwops *RWops) Read(buf []byte) (n int, err error) {\n\treturn rwops.Read2(buf, 1, uint(len(buf)))\n}\n\n// Read2 reads from a data source (native).\n// (https://wiki.libsdl.org/SDL_RWread)\nfunc (rwops *RWops) Read2(buf []byte, size, maxnum uint) (n int, err error) {\n\tif rwops == nil || buf == nil {\n\t\treturn 0, ErrInvalidParameters\n\t}\n\n\theader := (*reflect.SliceHeader)(unsafe.Pointer(&buf))\n\t_data := unsafe.Pointer(header.Data)\n\n\tn = int(C.RWread(rwops.cptr(), _data, C.size_t(size), C.size_t(maxnum)))\n\tif n == 0 {\n\t\terr = GetError()\n\t}\n\treturn\n}\n\n// Tell returns the current read/write offset in the RWops data stream.\n// (https://wiki.libsdl.org/SDL_RWtell)\nfunc (rwops *RWops) Tell() (int64, error) {\n\tif rwops == nil {\n\t\treturn 0, ErrInvalidParameters\n\t}\n\n\tret := int64(C.RWseek(rwops.cptr(), 0, C.int(RW_SEEK_CUR)))\n\tif ret < 0 {\n\t\treturn ret, GetError()\n\t}\n\treturn ret, nil\n}\n\n// Write writes to the RWops data stream.\n// (https://wiki.libsdl.org/SDL_RWwrite)\nfunc (rwops *RWops) Write(buf []byte) (n int, err error) {\n\treturn rwops.Write2(buf, 1, uint(len(buf)))\n}\n\n// Write2 writes to the RWops data stream (native).\n// (https://wiki.libsdl.org/SDL_RWwrite)\nfunc (rwops *RWops) Write2(buf []byte, size, num uint) (n int, err error) {\n\tif rwops == nil || buf == nil {\n\t\treturn 0, ErrInvalidParameters\n\t}\n\n\theader := (*reflect.SliceHeader)(unsafe.Pointer(&buf))\n\t_data := unsafe.Pointer(header.Data)\n\n\tn = int(C.RWwrite(rwops.cptr(), _data, C.size_t(size), C.size_t(num)))\n\tif n < int(num) {\n\t\terr = GetError()\n\t}\n\treturn\n}\n\n// Close closes and frees the allocated RWops structure.\n// (https://wiki.libsdl.org/SDL_RWclose)\nfunc (rwops *RWops) Close() error {\n\tif rwops != nil && C.RWclose(rwops.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// ReadU8 reads a byte from the RWops.\n// (https://wiki.libsdl.org/SDL_ReadU8)\nfunc (rwops *RWops) ReadU8() uint8 {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint8(C.SDL_ReadU8(rwops.cptr()))\n}\n\n// ReadLE16 reads 16 bits of little-endian data from the RWops and returns in native format.\n// (https://wiki.libsdl.org/SDL_ReadLE16)\nfunc (rwops *RWops) ReadLE16() uint16 {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint16(C.SDL_ReadLE16(rwops.cptr()))\n}\n\n// ReadBE16 read 16 bits of big-endian data from the RWops and returns in native format.\n// (https://wiki.libsdl.org/SDL_ReadBE16)\nfunc (rwops *RWops) ReadBE16() uint16 {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint16(C.SDL_ReadBE16(rwops.cptr()))\n}\n\n// ReadLE32 reads 32 bits of little-endian data from the RWops and returns in native format.\n// (https://wiki.libsdl.org/SDL_ReadLE32)\nfunc (rwops *RWops) ReadLE32() uint32 {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint32(C.SDL_ReadLE32(rwops.cptr()))\n}\n\n// ReadBE32 reads 32 bits of big-endian data from the RWops and returns in native format.\n// (https://wiki.libsdl.org/SDL_ReadBE32)\nfunc (rwops *RWops) ReadBE32() uint32 {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint32(C.SDL_ReadBE32(rwops.cptr()))\n}\n\n// ReadLE64 reads 64 bits of little-endian data from the RWops and returns in native format.\n// (https://wiki.libsdl.org/SDL_ReadLE64)\nfunc (rwops *RWops) ReadLE64() uint64 {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint64(C.SDL_ReadLE64(rwops.cptr()))\n}\n\n// ReadBE64 reads 64 bits of big-endian data from the RWops and returns in native format.\n// (https://wiki.libsdl.org/SDL_ReadBE64)\nfunc (rwops *RWops) ReadBE64() uint64 {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint64(C.SDL_ReadBE64(rwops.cptr()))\n}\n\n// LoadFile_RW loads all the data from an SDL data stream.\n// (https://wiki.libsdl.org/SDL_LoadFile_RW)\nfunc (src *RWops) LoadFileRW(freesrc bool) (data []byte, size int) {\n\tvar _size C.size_t\n\tvar _freesrc C.int = 0\n\n\tif freesrc {\n\t\t_freesrc = 1\n\t}\n\n\t_data := C.SDL_LoadFile_RW(src.cptr(), &_size, _freesrc)\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&data))\n\tsliceHeader.Cap = int(_size)\n\tsliceHeader.Len = int(_size)\n\tsliceHeader.Data = uintptr(_data)\n\tsize = int(_size)\n\treturn\n}\n\n// LoadFile loads an entire file\n// (https://wiki.libsdl.org/SDL_LoadFile)\nfunc LoadFile(file string) (data []byte, size int) {\n\treturn RWFromFile(file, \"rb\").LoadFileRW(true)\n}\n\n// WriteU8 writes a byte to the RWops.\n// (https://wiki.libsdl.org/SDL_WriteU8)\nfunc (rwops *RWops) WriteU8(value uint8) uint {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint(C.SDL_WriteU8(rwops.cptr(), C.Uint8(value)))\n}\n\n// WriteLE16 writes 16 bits in native format to the RWops as little-endian data.\n// (https://wiki.libsdl.org/SDL_WriteLE16)\nfunc (rwops *RWops) WriteLE16(value uint16) uint {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint(C.SDL_WriteLE16(rwops.cptr(), C.Uint16(value)))\n}\n\n// WriteBE16 writes 16 bits in native format to the RWops as big-endian data.\n// (https://wiki.libsdl.org/SDL_WriteBE16)\nfunc (rwops *RWops) WriteBE16(value uint16) uint {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint(C.SDL_WriteBE16(rwops.cptr(), C.Uint16(value)))\n}\n\n// WriteLE32 writes 32 bits in native format to the RWops as little-endian data.\n// (https://wiki.libsdl.org/SDL_WriteLE32)\nfunc (rwops *RWops) WriteLE32(value uint32) uint {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint(C.SDL_WriteLE32(rwops.cptr(), C.Uint32(value)))\n}\n\n// WriteBE32 writes 32 bits in native format to the RWops as big-endian data.\n// (https://wiki.libsdl.org/SDL_WriteBE32)\nfunc (rwops *RWops) WriteBE32(value uint32) uint {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint(C.SDL_WriteBE32(rwops.cptr(), C.Uint32(value)))\n}\n\n// WriteLE64 writes 64 bits in native format to the RWops as little-endian data.\n// (https://wiki.libsdl.org/SDL_WriteLE64)\nfunc (rwops *RWops) WriteLE64(value uint64) uint {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint(C.SDL_WriteLE64(rwops.cptr(), C.Uint64(value)))\n}\n\n// WriteBE64 writes 64 bits in native format to the RWops as big-endian data.\n// (https://wiki.libsdl.org/SDL_WriteBE64)\nfunc (rwops *RWops) WriteBE64(value uint64) uint {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint(C.SDL_WriteBE64(rwops.cptr(), C.Uint64(value)))\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/scancode.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\n\n// The SDL keyboard scancode representation.\n// (https://wiki.libsdl.org/SDL_Scancode)\n// (https://wiki.libsdl.org/SDLScancodeLookup)\nconst (\n\tSCANCODE_UNKNOWN = 0 // \"\" (no name, empty string)\n\n\tSCANCODE_A = C.SDL_SCANCODE_A // \"A\"\n\tSCANCODE_B = C.SDL_SCANCODE_B // \"B\"\n\tSCANCODE_C = C.SDL_SCANCODE_C // \"C\"\n\tSCANCODE_D = C.SDL_SCANCODE_D // \"D\"\n\tSCANCODE_E = C.SDL_SCANCODE_E // \"E\"\n\tSCANCODE_F = C.SDL_SCANCODE_F // \"F\"\n\tSCANCODE_G = C.SDL_SCANCODE_G // \"G\"\n\tSCANCODE_H = C.SDL_SCANCODE_H // \"H\"\n\tSCANCODE_I = C.SDL_SCANCODE_I // \"I\"\n\tSCANCODE_J = C.SDL_SCANCODE_J // \"J\"\n\tSCANCODE_K = C.SDL_SCANCODE_K // \"K\"\n\tSCANCODE_L = C.SDL_SCANCODE_L // \"L\"\n\tSCANCODE_M = C.SDL_SCANCODE_M // \"M\"\n\tSCANCODE_N = C.SDL_SCANCODE_N // \"N\"\n\tSCANCODE_O = C.SDL_SCANCODE_O // \"O\"\n\tSCANCODE_P = C.SDL_SCANCODE_P // \"P\"\n\tSCANCODE_Q = C.SDL_SCANCODE_Q // \"Q\"\n\tSCANCODE_R = C.SDL_SCANCODE_R // \"R\"\n\tSCANCODE_S = C.SDL_SCANCODE_S // \"S\"\n\tSCANCODE_T = C.SDL_SCANCODE_T // \"T\"\n\tSCANCODE_U = C.SDL_SCANCODE_U // \"U\"\n\tSCANCODE_V = C.SDL_SCANCODE_V // \"V\"\n\tSCANCODE_W = C.SDL_SCANCODE_W // \"W\"\n\tSCANCODE_X = C.SDL_SCANCODE_X // \"X\"\n\tSCANCODE_Y = C.SDL_SCANCODE_Y // \"Y\"\n\tSCANCODE_Z = C.SDL_SCANCODE_Z // \"Z\"\n\n\tSCANCODE_1 = C.SDL_SCANCODE_1 // \"1\"\n\tSCANCODE_2 = C.SDL_SCANCODE_2 // \"2\"\n\tSCANCODE_3 = C.SDL_SCANCODE_3 // \"3\"\n\tSCANCODE_4 = C.SDL_SCANCODE_4 // \"4\"\n\tSCANCODE_5 = C.SDL_SCANCODE_5 // \"5\"\n\tSCANCODE_6 = C.SDL_SCANCODE_6 // \"6\"\n\tSCANCODE_7 = C.SDL_SCANCODE_7 // \"7\"\n\tSCANCODE_8 = C.SDL_SCANCODE_8 // \"8\"\n\tSCANCODE_9 = C.SDL_SCANCODE_9 // \"9\"\n\tSCANCODE_0 = C.SDL_SCANCODE_0 // \"0\"\n\n\tSCANCODE_RETURN    = C.SDL_SCANCODE_RETURN    // \"Return\"\n\tSCANCODE_ESCAPE    = C.SDL_SCANCODE_ESCAPE    // \"Escape\" (the Esc key)\n\tSCANCODE_BACKSPACE = C.SDL_SCANCODE_BACKSPACE // \"Backspace\"\n\tSCANCODE_TAB       = C.SDL_SCANCODE_TAB       // \"Tab\" (the Tab key)\n\tSCANCODE_SPACE     = C.SDL_SCANCODE_SPACE     // \"Space\" (the Space Bar key(s))\n\n\tSCANCODE_MINUS        = C.SDL_SCANCODE_MINUS        // \"-\"\n\tSCANCODE_EQUALS       = C.SDL_SCANCODE_EQUALS       // \"=\"\n\tSCANCODE_LEFTBRACKET  = C.SDL_SCANCODE_LEFTBRACKET  // \"[\"\n\tSCANCODE_RIGHTBRACKET = C.SDL_SCANCODE_RIGHTBRACKET // \"]\"\n\tSCANCODE_BACKSLASH    = C.SDL_SCANCODE_BACKSLASH    // \"\\\"\n\tSCANCODE_NONUSHASH    = C.SDL_SCANCODE_NONUSHASH    // \"#\" (ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards.)\n\tSCANCODE_SEMICOLON    = C.SDL_SCANCODE_SEMICOLON    // \";\"\n\tSCANCODE_APOSTROPHE   = C.SDL_SCANCODE_APOSTROPHE   // \"'\"\n\tSCANCODE_GRAVE        = C.SDL_SCANCODE_GRAVE        // \"`\"\n\tSCANCODE_COMMA        = C.SDL_SCANCODE_COMMA        // \",\"\n\tSCANCODE_PERIOD       = C.SDL_SCANCODE_PERIOD       // \".\"\n\tSCANCODE_SLASH        = C.SDL_SCANCODE_SLASH        // \"/\"\n\tSCANCODE_CAPSLOCK     = C.SDL_SCANCODE_CAPSLOCK     // \"CapsLock\"\n\tSCANCODE_F1           = C.SDL_SCANCODE_F1           // \"F1\"\n\tSCANCODE_F2           = C.SDL_SCANCODE_F2           // \"F2\"\n\tSCANCODE_F3           = C.SDL_SCANCODE_F3           // \"F3\"\n\tSCANCODE_F4           = C.SDL_SCANCODE_F4           // \"F4\"\n\tSCANCODE_F5           = C.SDL_SCANCODE_F5           // \"F5\"\n\tSCANCODE_F6           = C.SDL_SCANCODE_F6           // \"F6\"\n\tSCANCODE_F7           = C.SDL_SCANCODE_F7           // \"F7\"\n\tSCANCODE_F8           = C.SDL_SCANCODE_F8           // \"F8\"\n\tSCANCODE_F9           = C.SDL_SCANCODE_F9           // \"F9\"\n\tSCANCODE_F10          = C.SDL_SCANCODE_F10          // \"F10\"\n\tSCANCODE_F11          = C.SDL_SCANCODE_F11          // \"F11\"\n\tSCANCODE_F12          = C.SDL_SCANCODE_F12          // \"F12\"\n\tSCANCODE_PRINTSCREEN  = C.SDL_SCANCODE_PRINTSCREEN  // \"PrintScreen\"\n\tSCANCODE_SCROLLLOCK   = C.SDL_SCANCODE_SCROLLLOCK   // \"ScrollLock\"\n\tSCANCODE_PAUSE        = C.SDL_SCANCODE_PAUSE        // \"Pause\" (the Pause / Break key)\n\tSCANCODE_INSERT       = C.SDL_SCANCODE_INSERT       // \"Insert\" (insert on PC, help on some Mac keyboards (but does send code 73, not 117))\n\tSCANCODE_HOME         = C.SDL_SCANCODE_HOME         // \"Home\"\n\tSCANCODE_PAGEUP       = C.SDL_SCANCODE_PAGEUP       // \"PageUp\"\n\tSCANCODE_DELETE       = C.SDL_SCANCODE_DELETE       // \"Delete\"\n\tSCANCODE_END          = C.SDL_SCANCODE_END          // \"End\"\n\tSCANCODE_PAGEDOWN     = C.SDL_SCANCODE_PAGEDOWN     // \"PageDown\"\n\tSCANCODE_RIGHT        = C.SDL_SCANCODE_RIGHT        // \"Right\" (the Right arrow key (navigation keypad))\n\tSCANCODE_LEFT         = C.SDL_SCANCODE_LEFT         // \"Left\" (the Left arrow key (navigation keypad))\n\tSCANCODE_DOWN         = C.SDL_SCANCODE_DOWN         // \"Down\" (the Down arrow key (navigation keypad))\n\tSCANCODE_UP           = C.SDL_SCANCODE_UP           // \"Up\" (the Up arrow key (navigation keypad))\n\n\tSCANCODE_NUMLOCKCLEAR = C.SDL_SCANCODE_NUMLOCKCLEAR // \"Numlock\" (the Num Lock key (PC) / the Clear key (Mac))\n\tSCANCODE_KP_DIVIDE    = C.SDL_SCANCODE_KP_DIVIDE    // \"Keypad /\" (the / key (numeric keypad))\n\tSCANCODE_KP_MULTIPLY  = C.SDL_SCANCODE_KP_MULTIPLY  // \"Keypad *\" (the * key (numeric keypad))\n\tSCANCODE_KP_MINUS     = C.SDL_SCANCODE_KP_MINUS     // \"Keypad -\" (the - key (numeric keypad))\n\tSCANCODE_KP_PLUS      = C.SDL_SCANCODE_KP_PLUS      // \"Keypad +\" (the + key (numeric keypad))\n\tSCANCODE_KP_ENTER     = C.SDL_SCANCODE_KP_ENTER     // \"Keypad Enter\" (the Enter key (numeric keypad))\n\tSCANCODE_KP_1         = C.SDL_SCANCODE_KP_1         // \"Keypad 1\" (the 1 key (numeric keypad))\n\tSCANCODE_KP_2         = C.SDL_SCANCODE_KP_2         // \"Keypad 2\" (the 2 key (numeric keypad))\n\tSCANCODE_KP_3         = C.SDL_SCANCODE_KP_3         // \"Keypad 3\" (the 3 key (numeric keypad))\n\tSCANCODE_KP_4         = C.SDL_SCANCODE_KP_4         // \"Keypad 4\" (the 4 key (numeric keypad))\n\tSCANCODE_KP_5         = C.SDL_SCANCODE_KP_5         // \"Keypad 5\" (the 5 key (numeric keypad))\n\tSCANCODE_KP_6         = C.SDL_SCANCODE_KP_6         // \"Keypad 6\" (the 6 key (numeric keypad))\n\tSCANCODE_KP_7         = C.SDL_SCANCODE_KP_7         // \"Keypad 7\" (the 7 key (numeric keypad))\n\tSCANCODE_KP_8         = C.SDL_SCANCODE_KP_8         // \"Keypad 8\" (the 8 key (numeric keypad))\n\tSCANCODE_KP_9         = C.SDL_SCANCODE_KP_9         // \"Keypad 9\" (the 9 key (numeric keypad))\n\tSCANCODE_KP_0         = C.SDL_SCANCODE_KP_0         // \"Keypad 0\" (the 0 key (numeric keypad))\n\tSCANCODE_KP_PERIOD    = C.SDL_SCANCODE_KP_PERIOD    // \"Keypad .\" (the . key (numeric keypad))\n\n\tSCANCODE_NONUSBACKSLASH = C.SDL_SCANCODE_NONUSBACKSLASH // \"\" (no name, empty string; This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout.)\n\tSCANCODE_APPLICATION    = C.SDL_SCANCODE_APPLICATION    // \"Application\" (the Application / Compose / Context Menu (Windows) key)\n\tSCANCODE_POWER          = C.SDL_SCANCODE_POWER          // \"Power\" (The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key.)\n\tSCANCODE_KP_EQUALS      = C.SDL_SCANCODE_KP_EQUALS      // \"Keypad =\" (the = key (numeric keypad))\n\tSCANCODE_F13            = C.SDL_SCANCODE_F13            // \"F13\"\n\tSCANCODE_F14            = C.SDL_SCANCODE_F14            // \"F14\"\n\tSCANCODE_F15            = C.SDL_SCANCODE_F15            // \"F15\"\n\tSCANCODE_F16            = C.SDL_SCANCODE_F16            // \"F16\"\n\tSCANCODE_F17            = C.SDL_SCANCODE_F17            // \"F17\"\n\tSCANCODE_F18            = C.SDL_SCANCODE_F18            // \"F18\"\n\tSCANCODE_F19            = C.SDL_SCANCODE_F19            // \"F19\"\n\tSCANCODE_F20            = C.SDL_SCANCODE_F20            // \"F20\"\n\tSCANCODE_F21            = C.SDL_SCANCODE_F21            // \"F21\"\n\tSCANCODE_F22            = C.SDL_SCANCODE_F22            // \"F22\"\n\tSCANCODE_F23            = C.SDL_SCANCODE_F23            // \"F23\"\n\tSCANCODE_F24            = C.SDL_SCANCODE_F24            // \"F24\"\n\tSCANCODE_EXECUTE        = C.SDL_SCANCODE_EXECUTE        // \"Execute\"\n\tSCANCODE_HELP           = C.SDL_SCANCODE_HELP           // \"Help\"\n\tSCANCODE_MENU           = C.SDL_SCANCODE_MENU           // \"Menu\"\n\tSCANCODE_SELECT         = C.SDL_SCANCODE_SELECT         // \"Select\"\n\tSCANCODE_STOP           = C.SDL_SCANCODE_STOP           // \"Stop\"\n\tSCANCODE_AGAIN          = C.SDL_SCANCODE_AGAIN          // \"Again\" (the Again key (Redo))\n\tSCANCODE_UNDO           = C.SDL_SCANCODE_UNDO           // \"Undo\"\n\tSCANCODE_CUT            = C.SDL_SCANCODE_CUT            // \"Cut\"\n\tSCANCODE_COPY           = C.SDL_SCANCODE_COPY           // \"Copy\"\n\tSCANCODE_PASTE          = C.SDL_SCANCODE_PASTE          // \"Paste\"\n\tSCANCODE_FIND           = C.SDL_SCANCODE_FIND           // \"Find\"\n\tSCANCODE_MUTE           = C.SDL_SCANCODE_MUTE           // \"Mute\"\n\tSCANCODE_VOLUMEUP       = C.SDL_SCANCODE_VOLUMEUP       // \"VolumeUp\"\n\tSCANCODE_VOLUMEDOWN     = C.SDL_SCANCODE_VOLUMEDOWN     // \"VolumeDown\"\n\tSCANCODE_KP_COMMA       = C.SDL_SCANCODE_KP_COMMA       // \"Keypad ,\" (the Comma key (numeric keypad))\n\tSCANCODE_KP_EQUALSAS400 = C.SDL_SCANCODE_KP_EQUALSAS400 // \"Keypad = (AS400)\" (the Equals AS400 key (numeric keypad))\n\n\tSCANCODE_INTERNATIONAL1 = C.SDL_SCANCODE_INTERNATIONAL1 // \"\" (no name, empty string; used on Asian keyboards, see footnotes in USB doc)\n\tSCANCODE_INTERNATIONAL2 = C.SDL_SCANCODE_INTERNATIONAL2 // \"\" (no name, empty string)\n\tSCANCODE_INTERNATIONAL3 = C.SDL_SCANCODE_INTERNATIONAL3 // \"\" (no name, empty string; Yen)\n\tSCANCODE_INTERNATIONAL4 = C.SDL_SCANCODE_INTERNATIONAL4 // \"\" (no name, empty string)\n\tSCANCODE_INTERNATIONAL5 = C.SDL_SCANCODE_INTERNATIONAL5 // \"\" (no name, empty string)\n\tSCANCODE_INTERNATIONAL6 = C.SDL_SCANCODE_INTERNATIONAL6 // \"\" (no name, empty string)\n\tSCANCODE_INTERNATIONAL7 = C.SDL_SCANCODE_INTERNATIONAL7 // \"\" (no name, empty string)\n\tSCANCODE_INTERNATIONAL8 = C.SDL_SCANCODE_INTERNATIONAL8 // \"\" (no name, empty string)\n\tSCANCODE_INTERNATIONAL9 = C.SDL_SCANCODE_INTERNATIONAL9 // \"\" (no name, empty string)\n\tSCANCODE_LANG1          = C.SDL_SCANCODE_LANG1          // \"\" (no name, empty string; Hangul/English toggle)\n\tSCANCODE_LANG2          = C.SDL_SCANCODE_LANG2          // \"\" (no name, empty string; Hanja conversion)\n\tSCANCODE_LANG3          = C.SDL_SCANCODE_LANG3          // \"\" (no name, empty string; Katakana)\n\tSCANCODE_LANG4          = C.SDL_SCANCODE_LANG4          // \"\" (no name, empty string; Hiragana)\n\tSCANCODE_LANG5          = C.SDL_SCANCODE_LANG5          // \"\" (no name, empty string; Zenkaku/Hankaku)\n\tSCANCODE_LANG6          = C.SDL_SCANCODE_LANG6          // \"\" (no name, empty string; reserved)\n\tSCANCODE_LANG7          = C.SDL_SCANCODE_LANG7          // \"\" (no name, empty string; reserved)\n\tSCANCODE_LANG8          = C.SDL_SCANCODE_LANG8          // \"\" (no name, empty string; reserved)\n\tSCANCODE_LANG9          = C.SDL_SCANCODE_LANG9          // \"\" (no name, empty string; reserved)\n\n\tSCANCODE_ALTERASE   = C.SDL_SCANCODE_ALTERASE   // \"AltErase\" (Erase-Eaze)\n\tSCANCODE_SYSREQ     = C.SDL_SCANCODE_SYSREQ     // \"SysReq\" (the SysReq key)\n\tSCANCODE_CANCEL     = C.SDL_SCANCODE_CANCEL     // \"Cancel\"\n\tSCANCODE_CLEAR      = C.SDL_SCANCODE_CLEAR      // \"Clear\"\n\tSCANCODE_PRIOR      = C.SDL_SCANCODE_PRIOR      // \"Prior\"\n\tSCANCODE_RETURN2    = C.SDL_SCANCODE_RETURN2    // \"Return\"\n\tSCANCODE_SEPARATOR  = C.SDL_SCANCODE_SEPARATOR  // \"Separator\"\n\tSCANCODE_OUT        = C.SDL_SCANCODE_OUT        // \"Out\"\n\tSCANCODE_OPER       = C.SDL_SCANCODE_OPER       // \"Oper\"\n\tSCANCODE_CLEARAGAIN = C.SDL_SCANCODE_CLEARAGAIN // \"Clear / Again\"\n\tSCANCODE_CRSEL      = C.SDL_SCANCODE_CRSEL      // \"CrSel\"\n\tSCANCODE_EXSEL      = C.SDL_SCANCODE_EXSEL      // \"ExSel\"\n\n\tSCANCODE_KP_00              = C.SDL_SCANCODE_KP_00              // \"Keypad 00\" (the 00 key (numeric keypad))\n\tSCANCODE_KP_000             = C.SDL_SCANCODE_KP_000             // \"Keypad 000\" (the 000 key (numeric keypad))\n\tSCANCODE_THOUSANDSSEPARATOR = C.SDL_SCANCODE_THOUSANDSSEPARATOR // \"ThousandsSeparator\" (the Thousands Separator key)\n\tSCANCODE_DECIMALSEPARATOR   = C.SDL_SCANCODE_DECIMALSEPARATOR   // \"DecimalSeparator\" (the Decimal Separator key)\n\tSCANCODE_CURRENCYUNIT       = C.SDL_SCANCODE_CURRENCYUNIT       // \"CurrencyUnit\" (the Currency Unit key)\n\tSCANCODE_CURRENCYSUBUNIT    = C.SDL_SCANCODE_CURRENCYSUBUNIT    // \"CurrencySubUnit\" (the Currency Subunit key)\n\tSCANCODE_KP_LEFTPAREN       = C.SDL_SCANCODE_KP_LEFTPAREN       // \"Keypad (\" (the Left Parenthesis key (numeric keypad))\n\tSCANCODE_KP_RIGHTPAREN      = C.SDL_SCANCODE_KP_RIGHTPAREN      // \"Keypad )\" (the Right Parenthesis key (numeric keypad))\n\tSCANCODE_KP_LEFTBRACE       = C.SDL_SCANCODE_KP_LEFTBRACE       // \"Keypad {\" (the Left Brace key (numeric keypad))\n\tSCANCODE_KP_RIGHTBRACE      = C.SDL_SCANCODE_KP_RIGHTBRACE      // \"Keypad }\" (the Right Brace key (numeric keypad))\n\tSCANCODE_KP_TAB             = C.SDL_SCANCODE_KP_TAB             // \"Keypad Tab\" (the Tab key (numeric keypad))\n\tSCANCODE_KP_BACKSPACE       = C.SDL_SCANCODE_KP_BACKSPACE       // \"Keypad Backspace\" (the Backspace key (numeric keypad))\n\tSCANCODE_KP_A               = C.SDL_SCANCODE_KP_A               // \"Keypad A\" (the A key (numeric keypad))\n\tSCANCODE_KP_B               = C.SDL_SCANCODE_KP_B               // \"Keypad B\" (the B key (numeric keypad))\n\tSCANCODE_KP_C               = C.SDL_SCANCODE_KP_C               // \"Keypad C\" (the C key (numeric keypad))\n\tSCANCODE_KP_D               = C.SDL_SCANCODE_KP_D               // \"Keypad D\" (the D key (numeric keypad))\n\tSCANCODE_KP_E               = C.SDL_SCANCODE_KP_E               // \"Keypad E\" (the E key (numeric keypad))\n\tSCANCODE_KP_F               = C.SDL_SCANCODE_KP_F               // \"Keypad F\" (the F key (numeric keypad))\n\tSCANCODE_KP_XOR             = C.SDL_SCANCODE_KP_XOR             // \"Keypad XOR\" (the XOR key (numeric keypad))\n\tSCANCODE_KP_POWER           = C.SDL_SCANCODE_KP_POWER           // \"Keypad ^\" (the Power key (numeric keypad))\n\tSCANCODE_KP_PERCENT         = C.SDL_SCANCODE_KP_PERCENT         // \"Keypad %\" (the Percent key (numeric keypad))\n\tSCANCODE_KP_LESS            = C.SDL_SCANCODE_KP_LESS            // \"Keypad <\" (the Less key (numeric keypad))\n\tSCANCODE_KP_GREATER         = C.SDL_SCANCODE_KP_GREATER         // \"Keypad >\" (the Greater key (numeric keypad))\n\tSCANCODE_KP_AMPERSAND       = C.SDL_SCANCODE_KP_AMPERSAND       // \"Keypad &\" (the & key (numeric keypad))\n\tSCANCODE_KP_DBLAMPERSAND    = C.SDL_SCANCODE_KP_DBLAMPERSAND    // \"Keypad &&\" (the && key (numeric keypad))\n\tSCANCODE_KP_VERTICALBAR     = C.SDL_SCANCODE_KP_VERTICALBAR     // \"Keypad |\" (the | key (numeric keypad))\n\tSCANCODE_KP_DBLVERTICALBAR  = C.SDL_SCANCODE_KP_DBLVERTICALBAR  // \"Keypad ||\" (the || key (numeric keypad))\n\tSCANCODE_KP_COLON           = C.SDL_SCANCODE_KP_COLON           // \"Keypad :\" (the : key (numeric keypad))\n\tSCANCODE_KP_HASH            = C.SDL_SCANCODE_KP_HASH            // \"Keypad #\" (the # key (numeric keypad))\n\tSCANCODE_KP_SPACE           = C.SDL_SCANCODE_KP_SPACE           // \"Keypad Space\" (the Space key (numeric keypad))\n\tSCANCODE_KP_AT              = C.SDL_SCANCODE_KP_AT              // \"Keypad @\" (the @ key (numeric keypad))\n\tSCANCODE_KP_EXCLAM          = C.SDL_SCANCODE_KP_EXCLAM          // \"Keypad !\" (the ! key (numeric keypad))\n\tSCANCODE_KP_MEMSTORE        = C.SDL_SCANCODE_KP_MEMSTORE        // \"Keypad MemStore\" (the Mem Store key (numeric keypad))\n\tSCANCODE_KP_MEMRECALL       = C.SDL_SCANCODE_KP_MEMRECALL       // \"Keypad MemRecall\" (the Mem Recall key (numeric keypad))\n\tSCANCODE_KP_MEMCLEAR        = C.SDL_SCANCODE_KP_MEMCLEAR        // \"Keypad MemClear\" (the Mem Clear key (numeric keypad))\n\tSCANCODE_KP_MEMADD          = C.SDL_SCANCODE_KP_MEMADD          // \"Keypad MemAdd\" (the Mem Add key (numeric keypad))\n\tSCANCODE_KP_MEMSUBTRACT     = C.SDL_SCANCODE_KP_MEMSUBTRACT     // \"Keypad MemSubtract\" (the Mem Subtract key (numeric keypad))\n\tSCANCODE_KP_MEMMULTIPLY     = C.SDL_SCANCODE_KP_MEMMULTIPLY     // \"Keypad MemMultiply\" (the Mem Multiply key (numeric keypad))\n\tSCANCODE_KP_MEMDIVIDE       = C.SDL_SCANCODE_KP_MEMDIVIDE       // \"Keypad MemDivide\" (the Mem Divide key (numeric keypad))\n\tSCANCODE_KP_PLUSMINUS       = C.SDL_SCANCODE_KP_PLUSMINUS       // \"Keypad +/-\" (the +/- key (numeric keypad))\n\tSCANCODE_KP_CLEAR           = C.SDL_SCANCODE_KP_CLEAR           // \"Keypad Clear\" (the Clear key (numeric keypad))\n\tSCANCODE_KP_CLEARENTRY      = C.SDL_SCANCODE_KP_CLEARENTRY      // \"Keypad ClearEntry\" (the Clear Entry key (numeric keypad))\n\tSCANCODE_KP_BINARY          = C.SDL_SCANCODE_KP_BINARY          // \"Keypad Binary\" (the Binary key (numeric keypad))\n\tSCANCODE_KP_OCTAL           = C.SDL_SCANCODE_KP_OCTAL           // \"Keypad Octal\" (the Octal key (numeric keypad))\n\tSCANCODE_KP_DECIMAL         = C.SDL_SCANCODE_KP_DECIMAL         // \"Keypad Decimal\" (the Decimal key (numeric keypad))\n\tSCANCODE_KP_HEXADECIMAL     = C.SDL_SCANCODE_KP_HEXADECIMAL     // \"Keypad Hexadecimal\" (the Hexadecimal key (numeric keypad))\n\n\tSCANCODE_LCTRL          = C.SDL_SCANCODE_LCTRL          // \"Left Ctrl\"\n\tSCANCODE_LSHIFT         = C.SDL_SCANCODE_LSHIFT         // \"Left Shift\"\n\tSCANCODE_LALT           = C.SDL_SCANCODE_LALT           // \"Left Alt\" (alt, option)\n\tSCANCODE_LGUI           = C.SDL_SCANCODE_LGUI           // \"Left GUI\" (windows, command (apple), meta)\n\tSCANCODE_RCTRL          = C.SDL_SCANCODE_RCTRL          // \"Right Ctrl\"\n\tSCANCODE_RSHIFT         = C.SDL_SCANCODE_RSHIFT         // \"Right Shift\"\n\tSCANCODE_RALT           = C.SDL_SCANCODE_RALT           // \"Right Alt\" (alt gr, option)\n\tSCANCODE_RGUI           = C.SDL_SCANCODE_RGUI           // \"Right GUI\" (windows, command (apple), meta)\n\tSCANCODE_MODE           = C.SDL_SCANCODE_MODE           // \"ModeSwitch\" (I'm not sure if this is really not covered by any of the above, but since there's a special KMOD_MODE for it I'm adding it here)\n\tSCANCODE_AUDIONEXT      = C.SDL_SCANCODE_AUDIONEXT      // \"AudioNext\" (the Next Track media key)\n\tSCANCODE_AUDIOPREV      = C.SDL_SCANCODE_AUDIOPREV      // \"AudioPrev\" (the Previous Track media key)\n\tSCANCODE_AUDIOSTOP      = C.SDL_SCANCODE_AUDIOSTOP      // \"AudioStop\" (the Stop media key)\n\tSCANCODE_AUDIOPLAY      = C.SDL_SCANCODE_AUDIOPLAY      // \"AudioPlay\" (the Play media key)\n\tSCANCODE_AUDIOMUTE      = C.SDL_SCANCODE_AUDIOMUTE      // \"AudioMute\" (the Mute volume key)\n\tSCANCODE_MEDIASELECT    = C.SDL_SCANCODE_MEDIASELECT    // \"MediaSelect\" (the Media Select key)\n\tSCANCODE_WWW            = C.SDL_SCANCODE_WWW            // \"WWW\" (the WWW/World Wide Web key)\n\tSCANCODE_MAIL           = C.SDL_SCANCODE_MAIL           // \"Mail\" (the Mail/eMail key)\n\tSCANCODE_CALCULATOR     = C.SDL_SCANCODE_CALCULATOR     // \"Calculator\" (the Calculator key)\n\tSCANCODE_COMPUTER       = C.SDL_SCANCODE_COMPUTER       // \"Computer\" (the My Computer key)\n\tSCANCODE_AC_SEARCH      = C.SDL_SCANCODE_AC_SEARCH      // \"AC Search\" (the Search key (application control keypad))\n\tSCANCODE_AC_HOME        = C.SDL_SCANCODE_AC_HOME        // \"AC Home\" (the Home key (application control keypad))\n\tSCANCODE_AC_BACK        = C.SDL_SCANCODE_AC_BACK        // \"AC Back\" (the Back key (application control keypad))\n\tSCANCODE_AC_FORWARD     = C.SDL_SCANCODE_AC_FORWARD     // \"AC Forward\" (the Forward key (application control keypad))\n\tSCANCODE_AC_STOP        = C.SDL_SCANCODE_AC_STOP        // \"AC Stop\" (the Stop key (application control keypad))\n\tSCANCODE_AC_REFRESH     = C.SDL_SCANCODE_AC_REFRESH     // \"AC Refresh\" (the Refresh key (application control keypad))\n\tSCANCODE_AC_BOOKMARKS   = C.SDL_SCANCODE_AC_BOOKMARKS   // \"AC Bookmarks\" (the Bookmarks key (application control keypad))\n\tSCANCODE_BRIGHTNESSDOWN = C.SDL_SCANCODE_BRIGHTNESSDOWN // \"BrightnessDown\" (the Brightness Down key)\n\tSCANCODE_BRIGHTNESSUP   = C.SDL_SCANCODE_BRIGHTNESSUP   // \"BrightnessUp\" (the Brightness Up key)\n\tSCANCODE_DISPLAYSWITCH  = C.SDL_SCANCODE_DISPLAYSWITCH  // \"DisplaySwitch\" (display mirroring/dual display switch, video mode switch)\n\tSCANCODE_KBDILLUMTOGGLE = C.SDL_SCANCODE_KBDILLUMTOGGLE // \"KBDIllumToggle\" (the Keyboard Illumination Toggle key)\n\tSCANCODE_KBDILLUMDOWN   = C.SDL_SCANCODE_KBDILLUMDOWN   // \"KBDIllumDown\" (the Keyboard Illumination Down key)\n\tSCANCODE_KBDILLUMUP     = C.SDL_SCANCODE_KBDILLUMUP     // \"KBDIllumUp\" (the Keyboard Illumination Up key)\n\tSCANCODE_EJECT          = C.SDL_SCANCODE_EJECT          // \"Eject\" (the Eject key)\n\tSCANCODE_SLEEP          = C.SDL_SCANCODE_SLEEP          // \"Sleep\" (the Sleep key)\n\tSCANCODE_APP1           = C.SDL_SCANCODE_APP1\n\tSCANCODE_APP2           = C.SDL_SCANCODE_APP2\n\tNUM_SCANCODES           = C.SDL_NUM_SCANCODES\n)\n\n// Scancode is an SDL keyboard scancode representation.\n// (https://wiki.libsdl.org/SDL_Scancode)\ntype Scancode uint32\n\nfunc (code Scancode) c() C.SDL_Scancode {\n\treturn C.SDL_Scancode(code)\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/sdl.go",
    "content": "// Package sdl is SDL2 wrapped for Go users. It enables interoperability between Go and the SDL2 library which is written in C. That means the original SDL2 installation is required for this to work. SDL2 is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.\npackage sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,9))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_INIT_SENSOR is not supported before SDL 2.0.9\")\n#endif\n\n#define SDL_INIT_SENSOR (0x00008000u)\n#endif\n*/\nimport \"C\"\n\nimport (\n\t\"runtime\"\n)\n\n// These are the flags which may be passed to SDL_Init().\n// (https://wiki.libsdl.org/SDL_Init)\nconst (\n\tINIT_TIMER          = C.SDL_INIT_TIMER          // timer subsystem\n\tINIT_AUDIO          = C.SDL_INIT_AUDIO          // audio subsystem\n\tINIT_VIDEO          = C.SDL_INIT_VIDEO          // video subsystem; automatically initializes the events subsystem\n\tINIT_JOYSTICK       = C.SDL_INIT_JOYSTICK       // joystick subsystem; automatically initializes the events subsystem\n\tINIT_HAPTIC         = C.SDL_INIT_HAPTIC         // haptic (force feedback) subsystem\n\tINIT_GAMECONTROLLER = C.SDL_INIT_GAMECONTROLLER // controller subsystem; automatically initializes the joystick subsystem\n\tINIT_EVENTS         = C.SDL_INIT_EVENTS         // events subsystem\n\tINIT_NOPARACHUTE    = C.SDL_INIT_NOPARACHUTE    // compatibility; this flag is ignored\n\tINIT_SENSOR         = C.SDL_INIT_SENSOR         // sensor subsystem\n\tINIT_EVERYTHING     = C.SDL_INIT_EVERYTHING     // all of the above subsystems\n)\n\nconst (\n\tRELEASED = 0\n\tPRESSED  = 1\n)\n\n// Calls a function in the main thread. It is only properly initialized inside\n// sdl.Main(..). As a default, it panics. It is used by sdl.Do(..) below.\nvar callInMain = func(f func()) {\n\tpanic(\"sdl.Main(main func()) must be called before sdl.Do(f func())\")\n}\n\nfunc init() {\n\t// Make sure the main goroutine is bound to the main thread.\n\truntime.LockOSThread()\n}\n\n// Main entry point. Run this function at the beginning of main(), and pass your\n// own main body to it as a function. E.g.:\n//\n// \tfunc main() {\n// \t\tsdl.Main(func() {\n// \t\t\t// Your code here....\n// \t\t\t// [....]\n//\n// \t\t\t// Calls to SDL can be made by any goroutine, but always guarded by sdl.Do()\n// \t\t\tsdl.Do(func() {\n// \t\t\t\tsdl.Init(0)\n// \t\t\t})\n// \t\t})\n// \t}\n//\n// Avoid calling functions like os.Exit(..) within your passed-in function since\n// they don't respect deferred calls. Instead, do this:\n//\n// \tfunc main() {\n// \t\tvar exitcode int\n// \t\tsdl.Main(func() {\n// \t\t\texitcode = run()) // assuming run has signature func() int\n// \t\t})\n// \t\tos.Exit(exitcode)\n// \t}\nfunc Main(main func()) {\n\t// Queue of functions that are thread-sensitive\n\tcallQueue := make(chan func())\n\n\t// Properly initialize callInMain for use by sdl.Do(..)\n\tcallInMain = func(f func()) {\n\t\tdone := make(chan bool, 1)\n\t\tcallQueue <- func() {\n\t\t\tf()\n\t\t\tdone <- true\n\t\t}\n\t\t<-done\n\t}\n\n\tgo func() {\n\t\tmain()\n\t\t// fmt.Println(\"END\") // to check if os.Exit(..) is called by main() above\n\t\tclose(callQueue)\n\t}()\n\n\tfor f := range callQueue {\n\t\tf()\n\t}\n}\n\n// Do the specified function in the main thread.\n// For this function to work, you must have correctly used sdl.Main(..) in your\n// main() function. Calling this function before/without sdl.Main(..) will cause\n// a panic.\nfunc Do(f func()) {\n\tcallInMain(f)\n}\n\n// Init initialize the SDL library. This must be called before using most other SDL functions.\n// (https://wiki.libsdl.org/SDL_Init)\nfunc Init(flags uint32) error {\n\tif C.SDL_Init(C.Uint32(flags)) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Quit cleans up all initialized subsystems. You should call it upon all exit conditions.\n// (https://wiki.libsdl.org/SDL_Quit)\nfunc Quit() {\n\tC.SDL_Quit()\n\n\teventFilterCache = nil\n\tfor k := range eventWatches {\n\t\tdelete(eventWatches, k)\n\t}\n}\n\n// InitSubSystem initializes specific SDL subsystems.\n// (https://wiki.libsdl.org/SDL_InitSubSystem)\nfunc InitSubSystem(flags uint32) error {\n\tif C.SDL_InitSubSystem(C.Uint32(flags)) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// QuitSubSystem shuts down specific SDL subsystems.\n// (https://wiki.libsdl.org/SDL_QuitSubSystem)\nfunc QuitSubSystem(flags uint32) {\n\tC.SDL_QuitSubSystem(C.Uint32(flags))\n}\n\n// WasInit returns a mask of the specified subsystems which have previously been initialized.\n// (https://wiki.libsdl.org/SDL_WasInit)\nfunc WasInit(flags uint32) uint32 {\n\treturn uint32(C.SDL_WasInit(C.Uint32(flags)))\n}\n\n// GetPlatform returns the name of the platform.\n// (https://wiki.libsdl.org/SDL_GetPlatform)\nfunc GetPlatform() string {\n\treturn string(C.GoString(C.SDL_GetPlatform()))\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/sdl_cgo.go",
    "content": "// +build !static\n\npackage sdl\n\n//#cgo windows LDFLAGS: -lSDL2\n//#cgo linux freebsd darwin openbsd pkg-config: sdl2\nimport \"C\"\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/sdl_cgo_static.go",
    "content": "// +build static\n\npackage sdl\n\n//#cgo CFLAGS: -I${SRCDIR}/../_libs/include -I${SRCDIR}/../_libs/include/SDL2\n//#cgo LDFLAGS: -L${SRCDIR}/../_libs\n//#cgo linux,386 LDFLAGS: -lSDL2_linux_386 -lm -ldl -lasound -lm -ldl -lpthread -lX11 -lXext -lXcursor -lXinerama -lXi -lXrandr -lXss -lXxf86vm -lpthread -lrt\n//#cgo linux,amd64 LDFLAGS: -lSDL2_linux_amd64 -lm -ldl -lasound -lm -ldl -lpthread -lX11 -lXext -lXcursor -lXinerama -lXi -lXrandr -lXss -lXxf86vm -lpthread -lrt\n//#cgo windows,386 LDFLAGS: -lSDL2_windows_386 -lSDL2main_windows_386 -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid -static-libgcc\n//#cgo windows,amd64 LDFLAGS: -lSDL2_windows_amd64 -lSDL2main_windows_amd64 -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -lsetupapi -static-libgcc\n//#cgo darwin,amd64 LDFLAGS: -lSDL2_darwin_amd64 -lm -liconv -Wl,-framework,OpenGL -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,ForceFeedback -lobjc -Wl,-framework,CoreVideo -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,IOKit -Wl,-framework,Metal\n//#cgo darwin,arm64 LDFLAGS: -lSDL2_darwin_arm64 -lm -liconv -Wl,-framework,OpenGL -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,ForceFeedback -lobjc -Wl,-framework,CoreVideo -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,IOKit -Wl,-framework,Metal\n//#cgo android,arm LDFLAGS: -lSDL2_android_arm -lm -ldl -llog -landroid -lGLESv2 -lGLESv1_CM\n//#cgo linux,arm,!android LDFLAGS: -L/opt/vc/lib -L/opt/vc/lib64 -lSDL2_linux_arm -lm -ldl -liconv -lbcm_host -lvcos -lvchiq_arm -pthread\nimport \"C\"\nimport (\n       _ \"github.com/veandco/go-sdl2/_libs\"\n       _ \"github.com/veandco/go-sdl2/_libs\"\n)\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/sdl_wrapper.h",
    "content": "#if defined(_WIN32)\n\t#include <SDL2/SDL.h>\n\t#include <stdlib.h>\n#else\n\t#include <SDL.h>\n#endif\n\n#if !defined(SDL_2_0_10)\n#define SDL_2_0_10\n\n#if !(SDL_VERSION_ATLEAST(2,0,10))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_FPoint is not supported before SDL 2.0.10\")\n#endif\n\ntypedef struct SDL_FPoint\n{\n    float x;\n    float y;\n} SDL_FPoint;\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_FRect is not supported before SDL 2.0.10\")\n#endif\n\ntypedef struct SDL_FRect\n{\n    float x;\n    float y;\n    float w;\n    float h;\n} SDL_FRect;\n\n\n#endif\n\n#endif\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/sensor.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,9))\ntypedef struct _SDL_Sensor SDL_Sensor;\n\ntypedef Sint32 SDL_SensorID;\n\ntypedef enum\n{\n    SDL_SENSOR_INVALID = -1,\n    SDL_SENSOR_UNKNOWN,\n    SDL_SENSOR_ACCEL,\n    SDL_SENSOR_GYRO\n} SDL_SensorType;\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_NumSensors is not supported before SDL 2.0.9\")\n#endif\n\nstatic inline int SDL_NumSensors()\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorGetDeviceName is not supported before SDL 2.0.9\")\n#endif\n\nstatic const char * SDL_SensorGetDeviceName(int device_index)\n{\n\treturn NULL;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorGetDeviceType is not supported before SDL 2.0.9\")\n#endif\n\nstatic SDL_SensorType SDL_SensorGetDeviceType(int device_index)\n{\n\treturn SDL_SENSOR_INVALID;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorGetDeviceNonPortableType is not supported before SDL 2.0.9\")\n#endif\n\nstatic int SDL_SensorGetDeviceNonPortableType(int device_index)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorGetDeviceInstanceID is not supported before SDL 2.0.9\")\n#endif\n\nstatic SDL_SensorID SDL_SensorGetDeviceInstanceID(int device_index)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorOpen is not supported before SDL 2.0.9\")\n#endif\n\nstatic SDL_Sensor * SDL_SensorOpen(int device_index)\n{\n\treturn NULL;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorFromInstanceID is not supported before SDL 2.0.9\")\n#endif\n\nstatic SDL_Sensor * SDL_SensorFromInstanceID(SDL_SensorID instance_id)\n{\n\treturn NULL;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorGetName is not supported before SDL 2.0.9\")\n#endif\n\nstatic const char * SDL_SensorGetName(SDL_Sensor *sensor)\n{\n\treturn NULL;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorGetType is not supported before SDL 2.0.9\")\n#endif\n\nstatic SDL_SensorType SDL_SensorGetType(SDL_Sensor *sensor)\n{\n\treturn SDL_SENSOR_INVALID;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorGetNonPortableType is not supported before SDL 2.0.9\")\n#endif\n\nstatic int SDL_SensorGetNonPortableType(SDL_Sensor *sensor)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorGetInstanceID is not supported before SDL 2.0.9\")\n#endif\n\nstatic SDL_SensorID SDL_SensorGetInstanceID(SDL_Sensor *sensor)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorGetData is not supported before SDL 2.0.9\")\n#endif\n\nstatic int SDL_SensorGetData(SDL_Sensor *sensor, float *data, int num_values)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorClose is not supported before SDL 2.0.9\")\n#endif\n\nstatic void SDL_SensorClose(SDL_Sensor *sensor)\n{\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorUpdate is not supported before SDL 2.0.9\")\n#endif\n\nstatic void SDL_SensorUpdate()\n{\n}\n#endif\n*/\nimport \"C\"\nimport \"unsafe\"\n\nconst (\n\tSTANDARD_GRAVITY = 9.80665\n)\n\n// The different sensors defined by SDL\n//\n// Additional sensors may be available, using platform dependent semantics.\n//\n// Here are the additional Android sensors:\n// https://developer.android.com/reference/android/hardware/SensorEvent.html#values\nconst (\n\tSENSOR_INVALID SensorType = C.SDL_SENSOR_INVALID // Returned for an invalid sensor\n\tSENSOR_UNKNOWN SensorType = C.SDL_SENSOR_UNKNOWN // Unknown sensor type\n\tSENSOR_ACCEL   SensorType = C.SDL_SENSOR_ACCEL   // Accelerometer\n\tSENSOR_GYRO    SensorType = C.SDL_SENSOR_GYRO    // Gyroscope\n)\n\ntype Sensor C.SDL_Sensor\ntype SensorID int32\ntype SensorType int\n\n// NumSensors counts the number of sensors attached to the system right now\n// (https://wiki.libsdl.org/SDL_NumSensors)\nfunc NumSensors() int {\n\treturn int(C.SDL_NumSensors())\n}\n\n// SensorGetDeviceName gets the implementation dependent name of a sensor.\n//\n// This can be called before any sensors are opened.\n//\n// Returns the sensor name, or empty string if deviceIndex is out of range.\n// (https://wiki.libsdl.org/SDL_SensorGetDeviceName)\nfunc SensorGetDeviceName(deviceIndex int) (name string) {\n\tname = C.GoString(C.SDL_SensorGetDeviceName(C.int(deviceIndex)))\n\treturn\n}\n\n//  SensorGetDeviceType gets the type of a sensor.\n//\n//  This can be called before any sensors are opened.\n//\n//  Returns the sensor type, or SDL_SENSOR_INVALID if deviceIndex is out of range.\n// (https://wiki.libsdl.org/SDL_SensorGetDeviceType)\nfunc SensorGetDeviceType(deviceIndex int) (typ SensorType) {\n\ttyp = SensorType(C.SDL_SensorGetDeviceType(C.int(deviceIndex)))\n\treturn\n}\n\n// SensorGetDeviceNonPortableType gets the platform dependent type of a sensor.\n//\n// This can be called before any sensors are opened.\n//\n// Returns the sensor platform dependent type, or -1 if deviceIndex is out of range.\n// (https://wiki.libsdl.org/SDL_SensorGetDeviceNonPortableType)\nfunc SensorGetDeviceNonPortableType(deviceIndex int) (typ int) {\n\ttyp = int(C.SDL_SensorGetDeviceNonPortableType(C.int(deviceIndex)))\n\treturn\n}\n\n// SensorGetDeviceInstanceID gets the instance ID of a sensor.\n//\n// This can be called before any sensors are opened.\n//\n// Returns the sensor instance ID, or -1 if deviceIndex is out of range.\n// (https://wiki.libsdl.org/SDL_SensorGetDeviceInstanceID)\nfunc SensorGetDeviceInstanceID(deviceIndex int) (id SensorID) {\n\tid = SensorID(C.SDL_SensorGetDeviceInstanceID(C.int(deviceIndex)))\n\treturn\n}\n\n// SensorOpen opens a sensor for use.\n//\n// The index passed as an argument refers to the N'th sensor on the system.\n//\n// Returns a sensor identifier, or nil if an error occurred.\n// (https://wiki.libsdl.org/SDL_SensorOpen)\nfunc SensorOpen(deviceIndex int) (sensor *Sensor) {\n\tsensor = (*Sensor)(unsafe.Pointer(C.SDL_SensorOpen(C.int(deviceIndex))))\n\treturn\n}\n\n// SensorFromInstanceID returns the Sensor associated with an instance id.\n// (https://wiki.libsdl.org/SDL_SensorFromInstanceID)\nfunc SensorFromInstanceID(id SensorID) (sensor *Sensor) {\n\tsensor = (*Sensor)(unsafe.Pointer(C.SDL_SensorFromInstanceID(C.SDL_SensorID(id))))\n\treturn\n}\n\n// GetName gets the implementation dependent name of a sensor.\n//\n// Returns the sensor name, or empty string if the sensor is nil.\n// (https://wiki.libsdl.org/SDL_SensorGetName)\nfunc (sensor *Sensor) GetName() (name string) {\n\tname = C.GoString(C.SDL_SensorGetName((*C.SDL_Sensor)(sensor)))\n\treturn\n}\n\n// GetType gets the type of a sensor.\n//\n// This can be called before any sensors are opened.\n//\n// Returns the sensor type, or SENSOR_INVALID if the sensor is nil.\n// (https://wiki.libsdl.org/SDL_SensorGetType)\nfunc (sensor *Sensor) GetType() (typ SensorType) {\n\ttyp = SensorType(C.SDL_SensorGetType((*C.SDL_Sensor)(sensor)))\n\treturn\n}\n\n// GetNonPortableType gets the platform dependent type of a sensor.\n//\n// This can be called before any sensors are opened.\n//\n// Returns the sensor platform dependent type, or -1 if the sensor is nil.\n// (https://wiki.libsdl.org/SDL_SensorGetNonPortableType)\nfunc (sensor *Sensor) GetNonPortableType() (typ int) {\n\ttyp = int(C.SDL_SensorGetNonPortableType((*C.SDL_Sensor)(sensor)))\n\treturn\n}\n\n// GetInstanceID gets the instance ID of a sensor.\n//\n// This can be called before any sensors are opened.\n//\n// Returns the sensor instance ID, or -1 if the sensor is nil.\n// (https://wiki.libsdl.org/SDL_SensorGetInstanceID)\nfunc (sensor *Sensor) GetInstanceID() (id SensorID) {\n\tid = SensorID(C.SDL_SensorGetInstanceID((*C.SDL_Sensor)(sensor)))\n\treturn\n}\n\n// GetData gets the current state of an opened sensor.\n//\n// The number of values and interpretation of the data is sensor dependent.\n// (https://wiki.libsdl.org/SDL_SensorGetData)\nfunc (sensor *Sensor) GetData(data []float32) (err error) {\n\tif data == nil {\n\t\treturn nil\n\t}\n\t_data := (*C.float)(unsafe.Pointer(&data[0]))\n\t_numValues := C.int(len(data))\n\terr = errorFromInt(int(C.SDL_SensorGetData((*C.SDL_Sensor)(sensor), _data, _numValues)))\n\treturn\n}\n\n// Close closes a sensor previously opened with SensorOpen()\n// (https://wiki.libsdl.org/SDL_SensorClose)\nfunc (sensor *Sensor) Close() {\n\tC.SDL_SensorClose((*C.SDL_Sensor)(sensor))\n}\n\n// SensorUpdate updates the current state of the open sensors.\n//\n// This is called automatically by the event loop if sensor events are enabled.\n//\n// This needs to be called from the thread that initialized the sensor subsystem.\n// (https://wiki.libsdl.org/SDL_SensorUpdate)\nfunc SensorUpdate() {\n\tC.SDL_SensorUpdate()\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/shape.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n// until SDL 2.0.6 SDL_shape.h was not included in SDL.h\n#if !(SDL_VERSION_ATLEAST(2,0,6))\n#if defined(_WIN32)\n\t#include <SDL2/SDL_shape.h>\n#else\n\t#include <SDL_shape.h>\n#endif\n#endif\n*/\nimport \"C\"\nimport \"unsafe\"\n\nconst (\n\tNONSHAPEABLE_WINDOW    = C.SDL_NONSHAPEABLE_WINDOW\n\tINVALID_SHAPE_ARGUMENT = C.SDL_INVALID_SHAPE_ARGUMENT\n\tWINDOW_LACKS_SHAPE     = C.SDL_WINDOW_LACKS_SHAPE\n)\n\ntype WindowShapeModeKind C.WindowShapeMode\n\nconst (\n\tShapeModeDefaultKind              WindowShapeModeKind = C.ShapeModeDefault              // the default mode, a binarized alpha cutoff of 1\n\tShapeModeBinarizeAlphaKind        WindowShapeModeKind = C.ShapeModeBinarizeAlpha        // a binarized alpha cutoff with a given integer value\n\tShapeModeReverseBinarizeAlphaKind WindowShapeModeKind = C.ShapeModeReverseBinarizeAlpha // a binarized alpha cutoff with a given integer value, but with the opposite comparison\n\tShapeModeColorKeyKind             WindowShapeModeKind = C.ShapeModeColorKey             // a color key is applied\n)\n\nfunc SHAPEMODEALPHA(mode WindowShapeModeKind) bool {\n\treturn (mode == ShapeModeDefaultKind ||\n\t\tmode == ShapeModeBinarizeAlphaKind ||\n\t\tmode == ShapeModeReverseBinarizeAlphaKind)\n}\n\n// A union containing parameters for shaped windows\n// uint8 or Color\ntype cWindowShapeParams C.SDL_WindowShapeParams\n\ntype cWindowShapeMode struct {\n\tmode       WindowShapeModeKind\n\tparameters cWindowShapeParams\n}\n\ntype WindowShapeMode interface {\n\tMode() WindowShapeModeKind\n\tcWSM() cWindowShapeMode\n}\n\ntype ShapeModeDefault struct{}\n\nfunc (smd ShapeModeDefault) Mode() WindowShapeModeKind {\n\treturn ShapeModeDefaultKind\n}\n\nfunc (smd ShapeModeDefault) cWSM() cWindowShapeMode {\n\treturn cWindowShapeMode{\n\t\tmode:       ShapeModeDefaultKind,\n\t\tparameters: [4]uint8{1, 0, 0, 0},\n\t}\n}\n\ntype ShapeModeBinarizeAlpha struct {\n\tCutoff uint8\n}\n\nfunc (smba ShapeModeBinarizeAlpha) Mode() WindowShapeModeKind {\n\treturn ShapeModeBinarizeAlphaKind\n}\n\nfunc (smba ShapeModeBinarizeAlpha) cWSM() cWindowShapeMode {\n\treturn cWindowShapeMode{\n\t\tmode:       ShapeModeBinarizeAlphaKind,\n\t\tparameters: [4]uint8{smba.Cutoff, 0, 0, 0},\n\t}\n}\n\ntype ShapeModeReverseBinarizeAlpha struct {\n\tCutoff uint8\n}\n\nfunc (smba ShapeModeReverseBinarizeAlpha) Mode() WindowShapeModeKind {\n\treturn ShapeModeReverseBinarizeAlphaKind\n}\n\nfunc (smba ShapeModeReverseBinarizeAlpha) cWSM() cWindowShapeMode {\n\treturn cWindowShapeMode{\n\t\tmode:       ShapeModeReverseBinarizeAlphaKind,\n\t\tparameters: [4]uint8{smba.Cutoff, 0, 0, 0},\n\t}\n}\n\ntype ShapeModeColorKey struct {\n\tColor Color\n}\n\nfunc (smck ShapeModeColorKey) Mode() WindowShapeModeKind {\n\treturn ShapeModeColorKeyKind\n}\n\nfunc (smck ShapeModeColorKey) cWSM() cWindowShapeMode {\n\treturn cWindowShapeMode{\n\t\tmode:       ShapeModeReverseBinarizeAlphaKind,\n\t\tparameters: [4]uint8{smck.Color.R, smck.Color.G, smck.Color.B, smck.Color.A},\n\t}\n}\n\nfunc (cwsm cWindowShapeMode) goWSM() WindowShapeMode {\n\tswitch cwsm.mode {\n\tcase ShapeModeDefaultKind:\n\t\treturn ShapeModeDefault{}\n\n\tcase ShapeModeBinarizeAlphaKind:\n\t\treturn ShapeModeBinarizeAlpha{\n\t\t\tCutoff: ([4]uint8)(cwsm.parameters)[0],\n\t\t}\n\n\tcase ShapeModeReverseBinarizeAlphaKind:\n\t\treturn ShapeModeReverseBinarizeAlpha{\n\t\t\tCutoff: ([4]uint8)(cwsm.parameters)[0],\n\t\t}\n\n\tcase ShapeModeColorKeyKind:\n\t\treturn ShapeModeColorKey{\n\t\t\tColor: Color{\n\t\t\t\tR: ([4]uint8)(cwsm.parameters)[0],\n\t\t\t\tG: ([4]uint8)(cwsm.parameters)[1],\n\t\t\t\tB: ([4]uint8)(cwsm.parameters)[2],\n\t\t\t\tA: ([4]uint8)(cwsm.parameters)[3],\n\t\t\t},\n\t\t}\n\n\tdefault:\n\t\tpanic(\"Unknown WindowShapeModeKind\")\n\n\t}\n}\n\nfunc (wsm *cWindowShapeMode) cptr() *C.SDL_WindowShapeMode {\n\treturn (*C.SDL_WindowShapeMode)(unsafe.Pointer(wsm))\n}\n\n// CreateShapedWindow creates a window that can be shaped with the specified position, dimensions, and flags\n// (https://wiki.libsdl.org/SDL_CreateShapedWindow)\nfunc CreateShapedWindow(title string, x, y, w, h uint32, flags uint32) (*Window, error) {\n\tvar _window = C.SDL_CreateShapedWindow(C.CString(title), C.uint(x), C.uint(y), C.uint(w), C.uint(h), C.Uint32(flags))\n\tif _window == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Window)(unsafe.Pointer(_window)), nil\n}\n\n// IsShapedWindow returns whether the given window is a shaped window.\n// (https://wiki.libsdl.org/SDL_IsShapedWindow)\nfunc (window *Window) IsShaped() bool {\n\treturn (C.SDL_IsShapedWindow(window.cptr()) & 1) == 1\n}\n\n// SetShape sets the shape and parameters of a shaped window\n// (https://wiki.libsdl.org/SDL_SetWindowShape)\nfunc (window *Window) SetShape(shape *Surface, shape_mode WindowShapeMode) int32 {\n\tif shape_mode == nil {\n\t\tpanic(\"shape_mode can not be nil\")\n\t}\n\tvar _cWSM cWindowShapeMode = shape_mode.cWSM()\n\n\treturn (int32)(C.SDL_SetWindowShape(window.cptr(), shape.cptr(), _cWSM.cptr()))\n}\n\n// GetShapeMode gets the shape parameters of a shaped window\n// (https://wiki.libsdl.org/SDL_GetShapedWindowMode)\nfunc (window *Window) GetShapeMode() (WindowShapeMode, int32) {\n\tvar _cWSM cWindowShapeMode\n\tvar _resInt32 = (int32)(C.SDL_GetShapedWindowMode(window.cptr(), _cWSM.cptr()))\n\tif _resInt32 != 0 {\n\t\treturn nil, _resInt32\n\t}\n\treturn _cWSM.goWSM(), _resInt32\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/surface.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,9))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_HasColorKey is not supported before SDL 2.0.9\")\n#endif\n\nstatic SDL_bool SDL_HasColorKey(SDL_Surface * surface)\n{\n\treturn SDL_FALSE;\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,8))\ntypedef enum {\n\tSDL_YUV_CONVERSION_JPEG,\n\tSDL_YUV_CONVERSION_BT601,\n\tSDL_YUV_CONVERSION_BT709,\n\tSDL_YUV_CONVERSION_AUTOMATIC\n} SDL_YUV_CONVERSION_MODE;\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SetYUVConversionMode is not supported before SDL 2.0.8\")\n#endif\n\nvoid SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode)\n{\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetYUVConversionMode is not supported before SDL 2.0.8\")\n#endif\n\nSDL_YUV_CONVERSION_MODE SDL_GetYUVConversionMode(void)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetYUVConversionModeForResolution is not supported before SDL 2.0.8\")\n#endif\n\nSDL_YUV_CONVERSION_MODE SDL_GetYUVConversionModeForResolution(int width, int height)\n{\n\treturn -1;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,6))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_DuplicateSurface is not supported before SDL 2.0.6\")\n#endif\n\nstatic inline SDL_Surface* SDL_DuplicateSurface(SDL_Surface *surface)\n{\n\treturn NULL;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,5))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_CreateRGBSurfaceWithFormat is not supported before SDL 2.0.5\")\n#endif\n\nstatic inline SDL_Surface* SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth, Uint32 format)\n{\n\treturn NULL;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_CreateRGBSurfaceWithFormatFrom is not supported before SDL 2.0.5\")\n#endif\n\nstatic inline SDL_Surface* SDL_CreateRGBSurfaceWithFormatFrom(void* pixels, int width, int height, int depth, int pitch, Uint32 format)\n{\n\treturn NULL;\n}\n#endif\n\n\n#if !(SDL_VERSION_ATLEAST(2,0,16))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SoftStretchLinear is not supported before SDL 2.0.16\")\n#endif\n\nstatic int SDL_SoftStretchLinear(SDL_Surface * src, const SDL_Rect * srcrect, SDL_Surface * dst, const SDL_Rect * dstrect)\n{\n\treturn -1;\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,18))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_PremultiplyAlpha is not supported before SDL 2.0.18\")\n#endif\n\nstatic int SDL_PremultiplyAlpha(int width, int height, Uint32 src_format, const void * src, int src_pitch, Uint32 dst_format, void * dst, int dst_pitch)\n{\n\treturn -1;\n}\n\n#endif\n*/\nimport \"C\"\nimport (\n\t\"image\"\n\t\"image/color\"\n\t\"reflect\"\n\t\"unsafe\"\n)\n\n// Surface flags (internal use)\nconst (\n\tSWSURFACE = C.SDL_SWSURFACE // just here for compatibility\n\tPREALLOC  = C.SDL_PREALLOC  // surface uses preallocated memory\n\tRLEACCEL  = C.SDL_RLEACCEL  // surface is RLE encoded\n\tDONTFREE  = C.SDL_DONTFREE  // surface is referenced internally\n)\n\ntype YUV_CONVERSION_MODE C.SDL_YUV_CONVERSION_MODE\n\n// YUV Conversion Modes\nconst (\n\tYUV_CONVERSION_JPEG      YUV_CONVERSION_MODE = C.SDL_YUV_CONVERSION_JPEG      // Full range JPEG\n\tYUV_CONVERSION_BT601                         = C.SDL_YUV_CONVERSION_BT601     // BT.601 (the default)\n\tYUV_CONVERSION_BT709                         = C.SDL_YUV_CONVERSION_BT709     // BT.709\n\tYUV_CONVERSION_AUTOMATIC                     = C.SDL_YUV_CONVERSION_AUTOMATIC // BT.601 for SD content, BT.709 for HD content\n)\n\n// Surface contains a collection of pixels used in software blitting.\n// (https://wiki.libsdl.org/SDL_Surface)\ntype Surface struct {\n\tflags    uint32         // (internal use)\n\tFormat   *PixelFormat   // the format of the pixels stored in the surface (read-only) (https://wiki.libsdl.org/SDL_PixelFormat)\n\tW        int32          // the width in pixels (read-only)\n\tH        int32          // the height in pixels (read-only)\n\tPitch    int32          // the length of a row of pixels in bytes (read-only)\n\tpixels   unsafe.Pointer // the pointer to the actual pixel data; use Pixels() for access\n\tUserData unsafe.Pointer // an arbitrary pointer you can set\n\tlocked   int32          // used for surfaces that require locking (internal use)\n\tlockData unsafe.Pointer // used for surfaces that require locking (internal use)\n\tClipRect Rect           // a Rect structure used to clip blits to the surface which can be set by SetClipRect() (read-only)\n\t_        unsafe.Pointer // map; info for fast blit mapping to other surfaces (internal use)\n\tRefCount int32          // reference count that can be incremented by the application\n}\ntype cSurface C.SDL_Surface\n\nfunc (surface *Surface) cptr() *C.SDL_Surface {\n\treturn (*C.SDL_Surface)(unsafe.Pointer(surface))\n}\n\n// MustLock reports whether the surface must be locked for access.\n// (https://wiki.libsdl.org/SDL_MUSTLOCK)\nfunc (surface *Surface) MustLock() bool {\n\treturn (surface.flags & RLEACCEL) != 0\n}\n\n// CreateRGBSurface allocates a new RGB surface.\n// (https://wiki.libsdl.org/SDL_CreateRGBSurface)\nfunc CreateRGBSurface(flags uint32, width, height, depth int32, Rmask, Gmask, Bmask, Amask uint32) (*Surface, error) {\n\tsurface := (*Surface)(unsafe.Pointer(C.SDL_CreateRGBSurface(\n\t\tC.Uint32(flags),\n\t\tC.int(width),\n\t\tC.int(height),\n\t\tC.int(depth),\n\t\tC.Uint32(Rmask),\n\t\tC.Uint32(Gmask),\n\t\tC.Uint32(Bmask),\n\t\tC.Uint32(Amask))))\n\tif surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn surface, nil\n}\n\n// CreateRGBSurfaceFrom allocate a new RGB surface with existing pixel data.\n// (https://wiki.libsdl.org/SDL_CreateRGBSurfaceFrom)\nfunc CreateRGBSurfaceFrom(pixels unsafe.Pointer, width, height int32, depth, pitch int, Rmask, Gmask, Bmask, Amask uint32) (*Surface, error) {\n\tsurface := (*Surface)(unsafe.Pointer(C.SDL_CreateRGBSurfaceFrom(\n\t\tpixels,\n\t\tC.int(width),\n\t\tC.int(height),\n\t\tC.int(depth),\n\t\tC.int(pitch),\n\t\tC.Uint32(Rmask),\n\t\tC.Uint32(Gmask),\n\t\tC.Uint32(Bmask),\n\t\tC.Uint32(Amask))))\n\tif surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn surface, nil\n}\n\n// CreateRGBSurfaceWithFormat allocates an RGB surface.\n// (https://wiki.libsdl.org/SDL_CreateRGBSurfaceWithFormat)\nfunc CreateRGBSurfaceWithFormat(flags uint32, width, height, depth int32, format uint32) (*Surface, error) {\n\tsurface := (*Surface)(unsafe.Pointer(C.SDL_CreateRGBSurfaceWithFormat(\n\t\tC.Uint32(flags),\n\t\tC.int(width),\n\t\tC.int(height),\n\t\tC.int(depth),\n\t\tC.Uint32(format))))\n\tif surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn surface, nil\n}\n\n// CreateRGBSurfaceWithFormatFrom allocates an RGB surface from provided pixel data.\n// (https://wiki.libsdl.org/SDL_CreateRGBSurfaceWithFormatFrom)\nfunc CreateRGBSurfaceWithFormatFrom(pixels unsafe.Pointer, width, height, depth, pitch int32, format uint32) (*Surface, error) {\n\tsurface := (*Surface)(unsafe.Pointer(C.SDL_CreateRGBSurfaceWithFormatFrom(\n\t\tpixels,\n\t\tC.int(width),\n\t\tC.int(height),\n\t\tC.int(depth),\n\t\tC.int(pitch),\n\t\tC.Uint32(format))))\n\tif surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn surface, nil\n}\n\n// SetYUVConversionMode sets the YUV conversion mode\n// TODO: (https://wiki.libsdl.org/SDL_SetYUVConversionMode)\nfunc SetYUVConversionMode(mode YUV_CONVERSION_MODE) {\n\t_mode := C.SDL_YUV_CONVERSION_MODE(mode)\n\tC.SDL_SetYUVConversionMode(_mode)\n}\n\n// GetYUVConversionMode gets the YUV conversion mode\n// TODO: (https://wiki.libsdl.org/SDL_GetYUVConversionMode)\nfunc GetYUVConversionMode() YUV_CONVERSION_MODE {\n\treturn YUV_CONVERSION_MODE(C.SDL_GetYUVConversionMode())\n}\n\n// GetYUVConversionModeForResolution gets the YUV conversion mode\n// TODO: (https://wiki.libsdl.org/SDL_GetYUVConversionModeForResolution)\nfunc GetYUVConversionModeForResolution(width, height int) YUV_CONVERSION_MODE {\n\t_width := C.int(width)\n\t_height := C.int(height)\n\treturn YUV_CONVERSION_MODE(C.SDL_GetYUVConversionModeForResolution(_width, _height))\n}\n\n// Free frees the RGB surface.\n// (https://wiki.libsdl.org/SDL_FreeSurface)\nfunc (surface *Surface) Free() {\n\tC.SDL_FreeSurface(surface.cptr())\n}\n\n// SetPalette sets the palette used by the surface.\n// (https://wiki.libsdl.org/SDL_SetSurfacePalette)\nfunc (surface *Surface) SetPalette(palette *Palette) error {\n\tif C.SDL_SetSurfacePalette(surface.cptr(), palette.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Lock sets up the surface for directly accessing the pixels.\n// (https://wiki.libsdl.org/SDL_LockSurface)\nfunc (surface *Surface) Lock() error {\n\tif C.SDL_LockSurface(surface.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Unlock releases the surface after directly accessing the pixels.\n// (https://wiki.libsdl.org/SDL_UnlockSurface)\nfunc (surface *Surface) Unlock() {\n\tC.SDL_UnlockSurface(surface.cptr())\n}\n\n// LoadBMPRW loads a BMP image from a seekable SDL data stream (memory or file).\n// (https://wiki.libsdl.org/SDL_LoadBMP_RW)\nfunc LoadBMPRW(src *RWops, freeSrc bool) (*Surface, error) {\n\tsurface := (*Surface)(unsafe.Pointer(C.SDL_LoadBMP_RW(src.cptr(), C.int(Btoi(freeSrc)))))\n\tif surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn surface, nil\n}\n\n// LoadBMP loads a surface from a BMP file.\n// (https://wiki.libsdl.org/SDL_LoadBMP)\nfunc LoadBMP(file string) (*Surface, error) {\n\treturn LoadBMPRW(RWFromFile(file, \"rb\"), true)\n}\n\n// SaveBMPRW save the surface to a seekable SDL data stream (memory or file) in BMP format.\n// (https://wiki.libsdl.org/SDL_SaveBMP_RW)\nfunc (surface *Surface) SaveBMPRW(dst *RWops, freeDst bool) error {\n\tif C.SDL_SaveBMP_RW(surface.cptr(), dst.cptr(), C.int(Btoi(freeDst))) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// SaveBMP saves the surface to a BMP file.\n// (https://wiki.libsdl.org/SDL_SaveBMP)\nfunc (surface *Surface) SaveBMP(file string) error {\n\treturn surface.SaveBMPRW(RWFromFile(file, \"wb\"), true)\n}\n\n// SetRLE sets the RLE acceleration hint for the surface.\n// (https://wiki.libsdl.org/SDL_SetSurfaceRLE)\nfunc (surface *Surface) SetRLE(flag bool) error {\n\tif C.SDL_SetSurfaceRLE(surface.cptr(), C.int(Btoi(flag))) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// SetColorKey sets the color key (transparent pixel) in the surface.\n// (https://wiki.libsdl.org/SDL_SetColorKey)\nfunc (surface *Surface) SetColorKey(flag bool, key uint32) error {\n\tif C.SDL_SetColorKey(surface.cptr(), C.int(Btoi(flag)), C.Uint32(key)) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// HasColorKey returns the color key (transparent pixel) for the surface.\n// TODO: (https://wiki.libsdl.org/SDL_HasColorKey)\nfunc (surface *Surface) HasColorKey() bool {\n\treturn C.SDL_HasColorKey(surface.cptr()) == C.SDL_TRUE\n}\n\n// GetColorKey returns the color key (transparent pixel) for the surface.\n// (https://wiki.libsdl.org/SDL_GetColorKey)\nfunc (surface *Surface) GetColorKey() (key uint32, err error) {\n\t_key := (*C.Uint32)(unsafe.Pointer(&key))\n\tif C.SDL_GetColorKey(surface.cptr(), _key) != 0 {\n\t\treturn key, GetError()\n\t}\n\treturn key, nil\n}\n\n// SetColorMod sets an additional color value multiplied into blit operations.\n// (https://wiki.libsdl.org/SDL_SetSurfaceColorMod)\nfunc (surface *Surface) SetColorMod(r, g, b uint8) error {\n\tif C.SDL_SetSurfaceColorMod(surface.cptr(), C.Uint8(r), C.Uint8(g), C.Uint8(b)) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// GetColorMod returns the additional color value multiplied into blit operations.\n// (https://wiki.libsdl.org/SDL_GetSurfaceColorMod)\nfunc (surface *Surface) GetColorMod() (r, g, b uint8, err error) {\n\t_r := (*C.Uint8)(unsafe.Pointer(&r))\n\t_g := (*C.Uint8)(unsafe.Pointer(&g))\n\t_b := (*C.Uint8)(unsafe.Pointer(&b))\n\tif C.SDL_GetSurfaceColorMod(surface.cptr(), _r, _g, _b) != 0 {\n\t\treturn r, g, b, GetError()\n\t}\n\treturn r, g, b, nil\n}\n\n// SetAlphaMod sets an additional alpha value used in blit operations.\n// (https://wiki.libsdl.org/SDL_SetSurfaceAlphaMod)\nfunc (surface *Surface) SetAlphaMod(alpha uint8) error {\n\tif C.SDL_SetSurfaceAlphaMod(surface.cptr(), C.Uint8(alpha)) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// GetAlphaMod returns the additional alpha value used in blit operations.\n// (https://wiki.libsdl.org/SDL_GetSurfaceAlphaMod)\nfunc (surface *Surface) GetAlphaMod() (alpha uint8, err error) {\n\t_alpha := (*C.Uint8)(unsafe.Pointer(&alpha))\n\tif C.SDL_GetSurfaceAlphaMod(surface.cptr(), _alpha) != 0 {\n\t\treturn alpha, GetError()\n\t}\n\treturn alpha, nil\n}\n\n// SetBlendMode sets the blend mode used for blit operations.\n// (https://wiki.libsdl.org/SDL_SetSurfaceBlendMode)\nfunc (surface *Surface) SetBlendMode(bm BlendMode) error {\n\tif C.SDL_SetSurfaceBlendMode(surface.cptr(), bm.c()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// GetBlendMode returns the blend mode used for blit operations.\n// (https://wiki.libsdl.org/SDL_GetSurfaceBlendMode)\nfunc (surface *Surface) GetBlendMode() (bm BlendMode, err error) {\n\tif C.SDL_GetSurfaceBlendMode(surface.cptr(), bm.cptr()) != 0 {\n\t\treturn bm, GetError()\n\t}\n\treturn bm, nil\n}\n\n// SetClipRect sets the clipping rectangle for the surface\n// (https://wiki.libsdl.org/SDL_SetClipRect)\nfunc (surface *Surface) SetClipRect(rect *Rect) bool {\n\treturn C.SDL_SetClipRect(surface.cptr(), rect.cptr()) > 0\n}\n\n// GetClipRect returns the clipping rectangle for a surface.\n// (https://wiki.libsdl.org/SDL_GetClipRect)\nfunc (surface *Surface) GetClipRect(rect *Rect) {\n\tC.SDL_GetClipRect(surface.cptr(), rect.cptr())\n}\n\n// Convert copies the existing surface into a new one that is optimized for blitting to a surface of a specified pixel format.\n// (https://wiki.libsdl.org/SDL_ConvertSurface)\nfunc (surface *Surface) Convert(fmt *PixelFormat, flags uint32) (*Surface, error) {\n\t_surface := (*Surface)(unsafe.Pointer(C.SDL_ConvertSurface(surface.cptr(), fmt.cptr(), C.Uint32(flags))))\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn _surface, nil\n}\n\n// ConvertFormat copies the existing surface to a new surface of the specified format.\n// (https://wiki.libsdl.org/SDL_ConvertSurfaceFormat)\nfunc (surface *Surface) ConvertFormat(pixelFormat uint32, flags uint32) (*Surface, error) {\n\t_surface := (*Surface)(unsafe.Pointer(C.SDL_ConvertSurfaceFormat(surface.cptr(), C.Uint32(pixelFormat), C.Uint32(flags))))\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn _surface, nil\n}\n\n// ConvertPixels copies a block of pixels of one format to another format.\n// (https://wiki.libsdl.org/SDL_ConvertPixels)\nfunc ConvertPixels(width, height int32, srcFormat uint32, src unsafe.Pointer, srcPitch int,\n\tdstFormat uint32, dst unsafe.Pointer, dstPitch int) error {\n\tif C.SDL_ConvertPixels(C.int(width), C.int(height), C.Uint32(srcFormat), src, C.int(srcPitch), C.Uint32(dstFormat), dst, C.int(dstPitch)) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// FillRect performs a fast fill of a rectangle with a specific color.\n// (https://wiki.libsdl.org/SDL_FillRect)\nfunc (surface *Surface) FillRect(rect *Rect, color uint32) error {\n\tif C.SDL_FillRect(surface.cptr(), rect.cptr(), C.Uint32(color)) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// FillRects performs a fast fill of a set of rectangles with a specific color.\n// (https://wiki.libsdl.org/SDL_FillRects)\nfunc (surface *Surface) FillRects(rects []Rect, color uint32) error {\n\tif C.SDL_FillRects(surface.cptr(), rects[0].cptr(), C.int(len(rects)), C.Uint32(color)) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Blit performs a fast surface copy to a destination surface.\n// (https://wiki.libsdl.org/SDL_BlitSurface)\nfunc (surface *Surface) Blit(srcRect *Rect, dst *Surface, dstRect *Rect) error {\n\tif C.SDL_BlitSurface(surface.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// BlitScaled performs a scaled surface copy to a destination surface.\n// (https://wiki.libsdl.org/SDL_BlitScaled)\nfunc (surface *Surface) BlitScaled(srcRect *Rect, dst *Surface, dstRect *Rect) error {\n\tif C.SDL_BlitScaled(surface.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// UpperBlit has been replaced by Blit().\n// (https://wiki.libsdl.org/SDL_UpperBlit)\nfunc (surface *Surface) UpperBlit(srcRect *Rect, dst *Surface, dstRect *Rect) error {\n\tif C.SDL_UpperBlit(surface.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// LowerBlit performs low-level surface blitting only.\n// (https://wiki.libsdl.org/SDL_LowerBlit)\nfunc (surface *Surface) LowerBlit(srcRect *Rect, dst *Surface, dstRect *Rect) error {\n\tif C.SDL_LowerBlit(surface.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// SoftStretch has been replaced by BlitScaled().\n// (https://wiki.libsdl.org/SDL_SoftStretch)\nfunc (surface *Surface) SoftStretch(srcRect *Rect, dst *Surface, dstRect *Rect) error {\n\tif C.SDL_SoftStretch(surface.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// UpperBlitScaled has been replaced by BlitScaled().\n// (https://wiki.libsdl.org/SDL_UpperBlitScaled)\nfunc (surface *Surface) UpperBlitScaled(srcRect *Rect, dst *Surface, dstRect *Rect) error {\n\tif C.SDL_UpperBlitScaled(surface.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// LowerBlitScaled performs low-level surface scaled blitting only.\n// (https://wiki.libsdl.org/SDL_LowerBlitScaled)\nfunc (surface *Surface) LowerBlitScaled(srcRect *Rect, dst *Surface, dstRect *Rect) error {\n\tif C.SDL_LowerBlitScaled(surface.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// PixelNum returns the number of pixels stored in the surface.\nfunc (surface *Surface) PixelNum() int {\n\treturn int(surface.W * surface.H)\n}\n\n// BytesPerPixel return the number of significant bits in a pixel values of the surface.\nfunc (surface *Surface) BytesPerPixel() int {\n\treturn int(surface.Format.BytesPerPixel)\n}\n\n// Pixels returns the actual pixel data of the surface.\nfunc (surface *Surface) Pixels() []byte {\n\tvar b []byte\n\tlength := int(surface.H) * int(surface.Pitch)\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&b))\n\tsliceHeader.Cap = int(length)\n\tsliceHeader.Len = int(length)\n\tsliceHeader.Data = uintptr(surface.pixels)\n\treturn b\n}\n\n// Data returns the pointer to the actual pixel data of the surface.\nfunc (surface *Surface) Data() unsafe.Pointer {\n\treturn surface.pixels\n}\n\n// Duplicate creates a new surface identical to the existing surface\nfunc (surface *Surface) Duplicate() (newSurface *Surface, err error) {\n\t_newSurface := C.SDL_DuplicateSurface(surface.cptr())\n\tif _newSurface == nil {\n\t\terr = GetError()\n\t\treturn\n\t}\n\n\tnewSurface = (*Surface)(unsafe.Pointer(_newSurface))\n\treturn\n}\n\n// ColorModel returns the color model used by this Surface.\nfunc (surface *Surface) ColorModel() color.Model {\n\tswitch surface.Format.Format {\n\tcase PIXELFORMAT_ARGB8888, PIXELFORMAT_ABGR8888:\n\t\treturn color.RGBAModel\n\tcase PIXELFORMAT_RGB888:\n\t\treturn color.RGBAModel\n\tcase PIXELFORMAT_RGB444:\n\t\treturn RGB444Model\n\tcase PIXELFORMAT_RGB332:\n\t\treturn RGB332Model\n\tcase PIXELFORMAT_RGB555:\n\t\treturn RGB555Model\n\tcase PIXELFORMAT_RGB565:\n\t\treturn RGB565Model\n\tcase PIXELFORMAT_BGR555:\n\t\treturn BGR555Model\n\tcase PIXELFORMAT_BGR565:\n\t\treturn BGR565Model\n\tcase PIXELFORMAT_ARGB4444:\n\t\treturn ARGB4444Model\n\tcase PIXELFORMAT_ABGR4444:\n\t\treturn ABGR4444Model\n\tcase PIXELFORMAT_RGBA4444:\n\t\treturn RGBA4444Model\n\tcase PIXELFORMAT_BGRA4444:\n\t\treturn BGRA4444Model\n\tcase PIXELFORMAT_ARGB1555:\n\t\treturn ARGB1555Model\n\tcase PIXELFORMAT_RGBA5551:\n\t\treturn RGBA5551Model\n\tcase PIXELFORMAT_ABGR1555:\n\t\treturn ABGR1555Model\n\tcase PIXELFORMAT_BGRA5551:\n\t\treturn BGRA5551Model\n\tcase PIXELFORMAT_RGBA8888:\n\t\treturn RGBA8888Model\n\tcase PIXELFORMAT_BGRA8888:\n\t\treturn BGRA8888Model\n\tdefault:\n\t\tpanic(\"Not implemented yet\")\n\t}\n}\n\n// Bounds return the bounds of this surface. Currently, it always starts at\n// (0,0), but this is not guaranteed in the future so don't rely on it.\nfunc (surface *Surface) Bounds() image.Rectangle {\n\treturn image.Rect(0, 0, int(surface.W), int(surface.H))\n}\n\n// At returns the pixel color at (x, y)\nfunc (surface *Surface) At(x, y int) color.Color {\n\tpix := surface.Pixels()\n\ti := int32(y)*surface.Pitch + int32(x)*int32(surface.Format.BytesPerPixel)\n\tr, g, b, a := GetRGBA(*((*uint32)(unsafe.Pointer(&pix[i]))), surface.Format)\n\treturn color.NRGBA{R: r, G: g, B: b, A: a}\n}\n\n// Set the color of the pixel at (x, y) using this surface's color format to\n// convert c to the appropriate byte sequence. This method is required for the\n// draw.Image interface. The surface may require locking before calling Set.\nfunc (surface *Surface) Set(x, y int, c color.Color) {\n\t// All sdl2 colors are a subset of NRGBA so it is safe precision-wise to\n\t// convert to NRGBA and use the color components from there.\n\tnrgbaColor := color.NRGBAModel.Convert(c).(color.NRGBA)\n\tcolR, colG, colB, colA := nrgbaColor.R, nrgbaColor.G, nrgbaColor.B, nrgbaColor.A\n\n\tpix := surface.Pixels()\n\ti := int32(y)*surface.Pitch + int32(x)*int32(surface.Format.BytesPerPixel)\n\tswitch surface.Format.Format {\n\tcase PIXELFORMAT_ARGB8888:\n\t\tpix[i+3] = colA\n\t\tpix[i+2] = colR\n\t\tpix[i+1] = colG\n\t\tpix[i+0] = colB\n\tcase PIXELFORMAT_ABGR8888:\n\t\tpix[i+3] = colA\n\t\tpix[i+2] = colB\n\t\tpix[i+1] = colG\n\t\tpix[i+0] = colR\n\tcase PIXELFORMAT_RGB24, PIXELFORMAT_RGB888:\n\t\tpix[i+2] = colR\n\t\tpix[i+1] = colG\n\t\tpix[i+0] = colB\n\tcase PIXELFORMAT_BGR24, PIXELFORMAT_BGR888:\n\t\tpix[i+2] = colB\n\t\tpix[i+1] = colG\n\t\tpix[i+0] = colR\n\tcase PIXELFORMAT_RGB444:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 4 & 0x0F\n\t\tg := uint32(colG) >> 4 & 0x0F\n\t\tb := uint32(colB) >> 4 & 0x0F\n\t\t*buf = r<<8 | g<<4 | b\n\tcase PIXELFORMAT_RGB332:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 5 & 0x0F\n\t\tg := uint32(colG) >> 5 & 0x0F\n\t\tb := uint32(colB) >> 6 & 0x0F\n\t\t*buf = r<<5 | g<<2 | b\n\tcase PIXELFORMAT_RGB565:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 3 & 0xFF\n\t\tg := uint32(colG) >> 2 & 0xFF\n\t\tb := uint32(colB) >> 3 & 0xFF\n\t\t*buf = r<<11 | g<<5 | b\n\tcase PIXELFORMAT_RGB555:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 3 & 0xFF\n\t\tg := uint32(colG) >> 3 & 0xFF\n\t\tb := uint32(colB) >> 3 & 0xFF\n\t\t*buf = r<<10 | g<<5 | b\n\tcase PIXELFORMAT_BGR565:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 3 & 0xFF\n\t\tg := uint32(colG) >> 2 & 0xFF\n\t\tb := uint32(colB) >> 3 & 0xFF\n\t\t*buf = b<<11 | g<<5 | r\n\tcase PIXELFORMAT_BGR555:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 3 & 0xFF\n\t\tg := uint32(colG) >> 3 & 0xFF\n\t\tb := uint32(colB) >> 3 & 0xFF\n\t\t*buf = b<<10 | g<<5 | r\n\tcase PIXELFORMAT_ARGB4444:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\ta := uint32(colA) >> 4 & 0x0F\n\t\tr := uint32(colR) >> 4 & 0x0F\n\t\tg := uint32(colG) >> 4 & 0x0F\n\t\tb := uint32(colB) >> 4 & 0x0F\n\t\t*buf = a<<12 | r<<8 | g<<4 | b\n\tcase PIXELFORMAT_ABGR4444:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\ta := uint32(colA) >> 4 & 0x0F\n\t\tr := uint32(colR) >> 4 & 0x0F\n\t\tg := uint32(colG) >> 4 & 0x0F\n\t\tb := uint32(colB) >> 4 & 0x0F\n\t\t*buf = a<<12 | b<<8 | g<<4 | r\n\tcase PIXELFORMAT_RGBA4444:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 4 & 0x0F\n\t\tg := uint32(colG) >> 4 & 0x0F\n\t\tb := uint32(colB) >> 4 & 0x0F\n\t\ta := uint32(colA) >> 4 & 0x0F\n\t\t*buf = r<<12 | g<<8 | b<<4 | a\n\tcase PIXELFORMAT_BGRA4444:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 4 & 0x0F\n\t\tg := uint32(colG) >> 4 & 0x0F\n\t\tb := uint32(colB) >> 4 & 0x0F\n\t\ta := uint32(colA) >> 4 & 0x0F\n\t\t*buf = b<<12 | g<<8 | r<<4 | a\n\tcase PIXELFORMAT_ARGB1555:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 3 & 0xFF\n\t\tg := uint32(colG) >> 3 & 0xFF\n\t\tb := uint32(colB) >> 3 & 0xFF\n\t\ta := uint32(0)\n\t\tif colA > 0 {\n\t\t\ta = 1\n\t\t}\n\t\t*buf = a<<15 | r<<10 | g<<5 | b\n\tcase PIXELFORMAT_RGBA5551:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 3 & 0xFF\n\t\tg := uint32(colG) >> 3 & 0xFF\n\t\tb := uint32(colB) >> 3 & 0xFF\n\t\ta := uint32(0)\n\t\tif colA > 0 {\n\t\t\ta = 1\n\t\t}\n\t\t*buf = r<<11 | g<<6 | b<<1 | a\n\tcase PIXELFORMAT_ABGR1555:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 3 & 0xFF\n\t\tg := uint32(colG) >> 3 & 0xFF\n\t\tb := uint32(colB) >> 3 & 0xFF\n\t\ta := uint32(0)\n\t\tif colA > 0 {\n\t\t\ta = 1\n\t\t}\n\t\t*buf = a<<15 | b<<10 | g<<5 | r\n\tcase PIXELFORMAT_BGRA5551:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 3 & 0xFF\n\t\tg := uint32(colG) >> 3 & 0xFF\n\t\tb := uint32(colB) >> 3 & 0xFF\n\t\ta := uint32(0)\n\t\tif colA > 0 {\n\t\t\ta = 1\n\t\t}\n\t\t*buf = b<<11 | g<<6 | r<<1 | a\n\tcase PIXELFORMAT_RGBA8888:\n\t\tpix[i+3] = colR\n\t\tpix[i+2] = colG\n\t\tpix[i+1] = colB\n\t\tpix[i+0] = colA\n\tcase PIXELFORMAT_BGRA8888:\n\t\tpix[i+3] = colB\n\t\tpix[i+2] = colG\n\t\tpix[i+1] = colR\n\t\tpix[i+0] = colA\n\tdefault:\n\t\tpanic(\"Unknown pixel format!\")\n\t}\n}\n\n// SoftStretchLinear performs bilinear scaling between two surfaces of the same format, 32BPP.\n// (https://wiki.libsdl.org/SDL_SoftStretchLinear)\nfunc (surface *Surface) SoftStretchLinear(srcRect *Rect, dst *Surface, dstRect *Rect) (err error) {\n\treturn errorFromInt(int(C.SDL_SoftStretchLinear(surface.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr())))\n}\n\n// PremultiplyAlpha premultiplies the alpha on a block of pixels.\n//\n// This is safe to use with src == dst, but not for other overlapping areas.\n//\n// This function is currently only implemented for SDL_PIXELFORMAT_ARGB8888.\n//\n// (https://wiki.libsdl.org/SDL_PremultiplyAlpha)\nfunc PremultiplyAlpha(width, height int, srcFormat uint32, src []byte, srcPitch int, dstFormat uint32, dst []byte, dstPitch int) (err error) {\n\t_width := C.int(width)\n\t_height := C.int(height)\n\t_srcFormat := C.Uint32(srcFormat)\n\t_src := unsafe.Pointer(&src[0])\n\t_srcPitch := C.int(srcPitch)\n\t_dstFormat := C.Uint32(dstFormat)\n\t_dst := unsafe.Pointer(&dst[0])\n\t_dstPitch := C.int(dstPitch)\n\terr = errorFromInt(int(C.SDL_PremultiplyAlpha(_width, _height, _srcFormat, _src, _srcPitch, _dstFormat, _dst, _dstPitch)))\n\treturn\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/sysrender.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\nimport \"unsafe\"\n\n// Texture contains an efficient, driver-specific representation of pixel data.\n// (https://wiki.libsdl.org/SDL_Texture)\ntype Texture C.SDL_Texture\n\n// Renderer contains a rendering state.\n// (https://wiki.libsdl.org/SDL_Renderer)\ntype Renderer C.SDL_Renderer\n\nfunc (t *Texture) cptr() *C.SDL_Texture {\n\treturn (*C.SDL_Texture)(unsafe.Pointer(t))\n}\n\nfunc (r *Renderer) cptr() *C.SDL_Renderer {\n\treturn (*C.SDL_Renderer)(unsafe.Pointer(r))\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/system.c",
    "content": "#include \"_cgo_export.h\"\n#include \"system.h\"\n\n#if defined(_WIN32)\nvoid SetWindowsMessageHook()\n{\n\tSDL_SetWindowsMessageHook((SDL_WindowsMessageHook) goWindowsMessageHook, NULL);\n}\n#endif\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/system.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,9))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_IsTablet is not supported before SDL 2.0.9\")\n#endif\n\nstatic inline SDL_bool SDL_IsTablet()\n{\n\treturn SDL_FALSE;\n}\n\n#endif\n*/\nimport \"C\"\n\n// IsTablet returns true if the current device is a tablet\n// TODO: (https://wiki.libsdl.org/SDL_IsTablet)\nfunc IsTablet() bool {\n\treturn C.SDL_IsTablet() == C.SDL_TRUE\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/system.h",
    "content": "#ifndef _GO_SDL_SYSTEM_H\n#define _GO_SDL_SYSTEM_H\n\n#if defined(_WIN32)\n\textern void SetWindowsMessageHook();\n#endif\n\n#endif\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/system_android.go",
    "content": "// +build go1.4\n\npackage sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,8))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_IsAndroidTV is not supported before SDL 2.0.8\")\n#endif\n\nstatic int SDL_IsAndroidTV(void)\n{\n\treturn -1;\n}\n\n#endif\n\n\n#if !(SDL_VERSION_ATLEAST(2,0,16))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_AndroidShowToast is not supported before SDL 2.0.16\")\n#endif\n\nstatic int SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset)\n{\n\treturn -1;\n}\n\n#endif\n\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// External storage states. See the official Android developer guide for more information.\n// (http://developer.android.com/guide/topics/data/data-storage.html)\nconst (\n\tANDROID_EXTERNAL_STORAGE_READ  = C.SDL_ANDROID_EXTERNAL_STORAGE_READ\n\tANDROID_EXTERNAL_STORAGE_WRITE = C.SDL_ANDROID_EXTERNAL_STORAGE_WRITE\n)\n\n// AndroidGetInternalStoragePath returns the path used for internal storage for this application.\n// (https://wiki.libsdl.org/SDL_AndroidGetInternalStoragePath)\nfunc AndroidGetInternalStoragePath() string {\n\treturn C.GoString(C.SDL_AndroidGetInternalStoragePath())\n}\n\n// AndroidGetExternalStoragePath returns the path used for external storage for this application.\n// (https://wiki.libsdl.org/SDL_AndroidGetExternalStoragePath)\nfunc AndroidGetExternalStoragePath() string {\n\treturn C.GoString(C.SDL_AndroidGetExternalStoragePath())\n}\n\n// AndroidGetExternalStorageState returns the current state of external storage.\n// (https://wiki.libsdl.org/SDL_AndroidGetExternalStorageState)\nfunc AndroidGetExternalStorageState() int {\n\treturn int(C.SDL_AndroidGetExternalStorageState())\n}\n\n// AndroidGetJNIEnv returns the Java native interface object (JNIEnv) of the current thread on Android builds.\n// (https://wiki.libsdl.org/SDL_AndroidGetJNIEnv)\nfunc AndroidGetJNIEnv() unsafe.Pointer {\n\treturn unsafe.Pointer(C.SDL_AndroidGetJNIEnv())\n}\n\n// AndroidGetActivity returns the Java instance of the activity class in an Android application.\n// (https://wiki.libsdl.org/SDL_AndroidGetActivity)\nfunc AndroidGetActivity() unsafe.Pointer {\n\treturn unsafe.Pointer(C.SDL_AndroidGetActivity())\n}\n\n// IsAndroidTV returns true if the application is running on Android TV\n// (https://wiki.libsdl.org/SDL_IsAndroidTV)\nfunc IsAndroidTV() bool {\n\treturn C.SDL_IsAndroidTV() >= 0\n}\n\n// AndroidShowToast shows an Android toast notification.\n// (https://wiki.libsdl.org/SDL_AndroidShowToast)\nfunc AndroidShowToast(message string, duration, gravity, xoffset, yoffset int) (err error) {\n\t_message := C.CString(message)\n\tdefer C.free(unsafe.Pointer(_message))\n\treturn errorFromInt(int(C.SDL_AndroidShowToast(_message, C.int(duration), C.int(gravity), C.int(xoffset), C.int(yoffset))))\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/system_linux.go",
    "content": "// +build !android\n\npackage sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,9))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_LinuxSetThreadPriority is not supported before SDL 2.0.9\")\n#endif\n\nstatic int SDL_LinuxSetThreadPriority(Sint64 threadID, int priority)\n{\n\treturn -1;\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,18))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_LinuxSetThreadPriorityAndPolicy is not supported before SDL 2.0.18\")\n#endif\n\nstatic int SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy)\n{\n\treturn -1;\n}\n\n#endif\n*/\nimport \"C\"\n\n// LinuxSetThreadPriority sets the UNIX nice value for a thread.\n//\n// This uses setpriority() if possible, and RealtimeKit if available.\n//\n// (https://wiki.libsdl.org/SDL_LinuxSetThreadPriority)\nfunc LinuxSetThreadPriority(threadID int64, priority int) (err error) {\n\t_threadID := C.Sint64(threadID)\n\t_priority := C.int(priority)\n\treturn errorFromInt(int(C.SDL_LinuxSetThreadPriority(_threadID, _priority)))\n}\n\n// LinuxSetThreadPriority sets the priority (not nice level) and scheduling policy for a thread.\n//\n// This uses setpriority() if possible, and RealtimeKit if available.\n//\n// (https://wiki.libsdl.org/SDL_LinuxSetThreadPriorityAndPolicy)\nfunc LinuxSetThreadPriorityAndPolicy(threadID int64, sdlPriority, schedPolicy int) (err error) {\n\t_threadID := C.Sint64(threadID)\n\t_sdlPriority := C.int(sdlPriority)\n\t_schedPolicy := C.int(schedPolicy)\n\treturn errorFromInt(int(C.SDL_LinuxSetThreadPriorityAndPolicy(_threadID, _sdlPriority, _schedPolicy)))\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/system_windows.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n#include \"system.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,16))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderGetD3D11Device is not supported before SDL 2.0.16\")\n#endif\n\ntypedef struct ID3D11Device ID3D11Device;\n\nstatic ID3D11Device* SDL_RenderGetD3D11Device(SDL_Renderer * renderer)\n{\n\treturn NULL;\n}\n\n#endif\n*/\nimport \"C\"\nimport (\n\t\"unsafe\"\n)\n\ntype WindowsMessageHook func(userdata interface{}, hWnd unsafe.Pointer, message uint32, wParam uint64, lParam int64)\nvar windowsMessageHook WindowsMessageHook\n\ntype ID3D11Device C.ID3D11Device;\n\n// SetWindowsMessageHook sets a callback for every Windows message, run before TranslateMessage().\n// (https://wiki.libsdl.org/SDL_SetWindowsMessageHook)\nfunc SetWindowsMessageHook(callback WindowsMessageHook, userdata interface{}) {\n\twindowsMessageHook = callback\n\tC.SetWindowsMessageHook()\n}\n\n//export goWindowsMessageHook\nfunc goWindowsMessageHook(userdata interface{}, hWnd unsafe.Pointer, message uint32, wParam uint64, lParam int64) {\n\tif windowsMessageHook == nil {\n\t\treturn\n\t}\n\twindowsMessageHook(userdata, hWnd, message, wParam, lParam)\n}\n\n// SDL_RenderGetD3D11Device gets the D3D11 device associated with a renderer.\n// (https://wiki.libsdl.org/SDL_RenderGetD3D11Device)\nfunc (renderer *Renderer) GetD3D11Device() (device *ID3D11Device, err error) {\n\tdevice = (*ID3D11Device)(C.SDL_RenderGetD3D11Device(renderer.cptr()))\n\tif device == nil {\n\t\terr = GetError()\n\t}\n\treturn\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/syswm.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if defined(__WIN32)\n#include <SDL2/SDL_syswm.h>\n#else\n#include <SDL_syswm.h>\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,2))\n#define SDL_SYSWM_WAYLAND SDL_SYSWM_UNKNOWN\n#define SDL_SYSWM_MIR SDL_SYSWM_UNKNOWN\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,3))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SYSWM_WINRT is not supported before SDL 2.0.3\")\n#endif\n\n#define SDL_SYSWM_WINRT (0)\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,4))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SYSWM_ANDROID is not supported before SDL 2.0.4\")\n#endif\n\n#define SDL_SYSWM_ANDROID (0)\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,5))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SYSWM_VIVANTE is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_SYSWM_VIVANTE (0)\n#endif\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// Various supported windowing subsystems.\nconst (\n\tSYSWM_UNKNOWN  = C.SDL_SYSWM_UNKNOWN\n\tSYSWM_WINDOWS  = C.SDL_SYSWM_WINDOWS  // Microsoft Windows\n\tSYSWM_X11      = C.SDL_SYSWM_X11      // X Window System\n\tSYSWM_DIRECTFB = C.SDL_SYSWM_DIRECTFB // DirectFB\n\tSYSWM_COCOA    = C.SDL_SYSWM_COCOA    // Apple Mac OS X\n\tSYSWM_UIKIT    = C.SDL_SYSWM_UIKIT    // Apple iOS\n\tSYSWM_WAYLAND  = C.SDL_SYSWM_WAYLAND  // Wayland (>= SDL 2.0.2)\n\tSYSWM_MIR      = C.SDL_SYSWM_MIR      // Mir (>= SDL 2.0.2)\n\tSYSWM_WINRT    = C.SDL_SYSWM_WINRT    // WinRT (>= SDL 2.0.3)\n\tSYSWM_ANDROID  = C.SDL_SYSWM_ANDROID  // Android (>= SDL 2.0.4)\n\tSYSWM_VIVANTE  = C.SDL_SYSWM_VIVANTE  // Vivante (>= SDL 2.0.5)\n)\n\n// SysWMInfo contains system-dependent information about a window.\n// (https://wiki.libsdl.org/SDL_SysWMinfo)\ntype SysWMInfo struct {\n\tVersion   Version  // a Version structure that contains the current SDL version\n\tSubsystem uint32   // the windowing system type\n\tdummy     [24]byte // unused (to help compilers when no specific system is available)\n}\n\n// WindowsInfo contains Microsoft Windows window information.\ntype WindowsInfo struct {\n\tWindow unsafe.Pointer // the window handle\n\tDeviceContext unsafe.Pointer // the device context handle\n\tInstance unsafe.Pointer // the instance handle\n}\n\n// X11Info contains X Window System window information.\ntype X11Info struct {\n\tDisplay unsafe.Pointer // the X11 display\n\tWindow  uint           // the X11 window\n}\n\n// DFBInfo contains DirectFB window information.\ntype DFBInfo struct {\n\tDfb     unsafe.Pointer // the DirectFB main interface\n\tWindow  unsafe.Pointer // the DirectFB window handle\n\tSurface unsafe.Pointer // the DirectFB client surface\n}\n\n// CocoaInfo contains Apple Mac OS X window information.\ntype CocoaInfo struct {\n\tWindow unsafe.Pointer // the Cocoa window\n}\n\n// UIKitInfo contains Apple iOS window information.\ntype UIKitInfo struct {\n\tWindow unsafe.Pointer // the UIKit window\n}\n\n// SysWMmsg contains system-dependent window manager messages.\n// (https://wiki.libsdl.org/SDL_SysWMmsg)\ntype SysWMmsg struct {\n\tVersion   Version  // a Version structure that contains the current SDL version\n\tSubsystem uint32   // the windowing system type\n\tdata      [24]byte // internal data\n}\n\nfunc (info *SysWMInfo) cptr() *C.SDL_SysWMinfo {\n\treturn (*C.SDL_SysWMinfo)(unsafe.Pointer(info))\n}\n\n// GetWMInfo returns driver specific information about a window.\n// (https://wiki.libsdl.org/SDL_GetWindowWMInfo)\nfunc (window *Window) GetWMInfo() (*SysWMInfo, error) {\n\tvar info SysWMInfo\n\tVERSION(&info.Version)\n\tif C.SDL_GetWindowWMInfo(window.cptr(), info.cptr()) == 0 {\n\t\treturn nil, GetError()\n\t}\n\treturn &info, nil\n}\n\n// GetWindowsInfo returns Microsoft Windows window information.\nfunc (info *SysWMInfo) GetWindowsInfo() *WindowsInfo {\n\treturn (*WindowsInfo)(unsafe.Pointer(&info.dummy[0]))\n}\n\n// GetX11Info returns X Window System window information.\nfunc (info *SysWMInfo) GetX11Info() *X11Info {\n\treturn (*X11Info)(unsafe.Pointer(&info.dummy[0]))\n}\n\n// GetDFBInfo returns DirectFB window information.\nfunc (info *SysWMInfo) GetDFBInfo() *DFBInfo {\n\treturn (*DFBInfo)(unsafe.Pointer(&info.dummy[0]))\n}\n\n// GetCocoaInfo returns Apple Mac OS X window information.\nfunc (info *SysWMInfo) GetCocoaInfo() *CocoaInfo {\n\treturn (*CocoaInfo)(unsafe.Pointer(&info.dummy[0]))\n}\n\n// GetUIKitInfo returns Apple iOS window information.\nfunc (info *SysWMInfo) GetUIKitInfo() *UIKitInfo {\n\treturn (*UIKitInfo)(unsafe.Pointer(&info.dummy[0]))\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/syswm_cocoa.go",
    "content": "// +build cocoa OR darwin\n\npackage sdl\n\nimport \"C\"\nimport \"unsafe\"\n\n// CocoaMsg contains Apple Mac OS X window information.\ntype CocoaMsg struct {\n\tdummy C.int\n}\n\n// Cocoa() returns Apple Mac OS X message.\nfunc (msg *SysWMmsg) Cocoa() *CocoaMsg {\n\treturn (*CocoaMsg)(unsafe.Pointer(&msg.data[0]))\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/syswm_dfb.go",
    "content": "// +build dfb\n\npackage sdl\n\nimport \"C\"\nimport \"unsafe\"\n\n// DFBMsg contains DirectFB window information.\ntype DFBMsg struct {\n\tEvent C.DFBEvent\n}\n\n// DFB() returns DirectFB message.\nfunc (msg *SysWMmsg) DFB() *DFBMsg {\n\treturn (*DFBMsg)(unsafe.Pointer(&msg.data[0]))\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/syswm_uikit.go",
    "content": "// +build uikit\n\npackage sdl\n\nimport \"C\"\nimport \"unsafe\"\n\n// UIKitMsg contains Apple iOS window information.\ntype UIKitMsg struct {\n\tdummy C.int\n}\n\n// UIKit() returns Apple iOS message.\nfunc (msg *SysWMmsg) UIKit() *UIKitMsg {\n\treturn (*UIKitMsg)(unsafe.Pointer(&msg.data[0]))\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/syswm_vivante.go",
    "content": "// +build vivante\n\npackage sdl\n\nimport \"C\"\nimport \"unsafe\"\n\n// VivanteKitMsg contains Vivante window information.\ntype VivanteKitMsg struct {\n\tdummy C.int\n}\n\n// Vivante() returns Vivante message.\nfunc (msg *SysWMmsg) Vivante() *VivanteMsg {\n\treturn (*VivanteMsg)(unsafe.Pointer(&msg.data[0]))\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/syswm_windows.go",
    "content": "// +build windows\n\npackage sdl\n\n/*\n#include <windef.h>\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// WindowsMsg contains Microsoft Windows window information.\ntype WindowsMsg struct {\n\tHwnd   C.HWND\n\tMsg    C.UINT\n\tWParam C.WPARAM\n\tLParam C.LPARAM\n}\n\n// Windows() returns Microsoft Windows message.\nfunc (msg *SysWMmsg) Windows() *WindowsMsg {\n\treturn (*WindowsMsg)(unsafe.Pointer(&msg.data[0]))\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/syswm_x11.go",
    "content": "// +build x11\n\npackage sdl\n\n/*\n#include <X11/Xlib.h>\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// X11Msg contains X Window System window information.\ntype X11Msg struct {\n\tEvent C.XEvent\n}\n\n// X11() returns X Window System message.\nfunc (msg *SysWMmsg) X11() *X11Msg {\n\treturn (*X11Msg)(unsafe.Pointer(&msg.data[0]))\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/thread.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\n\n// CurrentThreadID gets the thread identifier for the current thread.\n// (https://wiki.libsdl.org/SDL_ThreadID)\nfunc CurrentThreadID() uint {\n\treturn uint(C.SDL_ThreadID())\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/timer.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,18))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetTicks64 is not supported before SDL 2.0.18\")\n#endif\n\nstatic inline Uint64 SDLCALL SDL_GetTicks64(void)\n{\n\treturn 0;\n}\n#endif\n*/\nimport \"C\"\n\n// GetTicks returns the number of milliseconds since the SDL library initialization.\n//\n// Deprecated: This function is not recommended as of SDL 2.0.18; use GetTicks64()\n// instead, where the value doesn't wrap every ~49 days. There are places in\n// SDL where we provide a 32-bit timestamp that can not change without\n// breaking binary compatibility, though, so this function isn't officially\n// deprecated.\n//\n// (https://wiki.libsdl.org/SDL_GetTicks)\nfunc GetTicks() uint32 {\n\treturn uint32(C.SDL_GetTicks())\n}\n\n// GetTicks64 returns the number of milliseconds since the SDL library initialization.\n// (https://wiki.libsdl.org/SDL_GetTicks64)\nfunc GetTicks64() uint64 {\n\treturn uint64(C.SDL_GetTicks64())\n}\n\n// GetPerformanceCounter returns the current value of the high resolution counter.\n// (https://wiki.libsdl.org/SDL_GetPerformanceCounter)\nfunc GetPerformanceCounter() uint64 {\n\treturn uint64(C.SDL_GetPerformanceCounter())\n}\n\n// GetPerformanceFrequency returns the count per second of the high resolution counter.\n// (https://wiki.libsdl.org/SDL_GetPerformanceFrequency)\nfunc GetPerformanceFrequency() uint64 {\n\treturn uint64(C.SDL_GetPerformanceFrequency())\n}\n\n// Delay waits a specified number of milliseconds before returning.\n// (https://wiki.libsdl.org/SDL_Delay)\nfunc Delay(ms uint32) {\n\tC.SDL_Delay(C.Uint32(ms))\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/touch.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,10))\n\ntypedef enum\n{\n    SDL_TOUCH_DEVICE_INVALID = -1,\n    SDL_TOUCH_DEVICE_DIRECT,            // touch screen with window-relative coordinates\n    SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, // trackpad with absolute device coordinates\n    SDL_TOUCH_DEVICE_INDIRECT_RELATIVE  // trackpad with screen cursor-relative coordinates\n} SDL_TouchDeviceType;\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetTouchDeviceType is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline SDL_TouchDeviceType SDL_GetTouchDeviceType(SDL_TouchID touchID)\n{\n\treturn SDL_TOUCH_DEVICE_INVALID;\n}\n\n#endif\n\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// TOUCH_MOUSEID is the device ID for mouse events simulated with touch input\nconst TOUCH_MOUSEID = C.SDL_TOUCH_MOUSEID\n\n// TouchID is the ID of a touch device.\ntype TouchID C.SDL_TouchID\n\n// FingerID is a finger id.\ntype FingerID C.SDL_FingerID\n\n// TouchDeviceType is a touch device type.\ntype TouchDeviceType C.SDL_TouchDeviceType\n\nconst (\n\tTOUCH_DEVICE_INVALID           TouchDeviceType = C.SDL_TOUCH_DEVICE_INVALID\n\tTOUCH_DEVICE_DIRECT                            = C.SDL_TOUCH_DEVICE_DIRECT            // touch screen with window-relative coordinates\n\tTOUCH_DEVICE_INDIRECT_ABSOLUTE                 = C.SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE // trackpad with absolute device coordinates\n\tTOUCH_DEVICE_INDIRECT_RELATIVE                 = C.SDL_TOUCH_DEVICE_INDIRECT_RELATIVE // trackpad with screen cursor-relative coordinates\n)\n\n// Finger contains touch information.\ntype Finger struct {\n\tID       FingerID // the finger id\n\tX        float32  // the x-axis location of the touch event, normalized (0...1)\n\tY        float32  // the y-axis location of the touch event, normalized (0...1)\n\tPressure float32  // the quantity of pressure applied, normalized (0...1)\n}\n\nfunc (t TouchID) c() C.SDL_TouchID {\n\treturn C.SDL_TouchID(t)\n}\n\n// GetNumTouchDevices returns the number of registered touch devices.\n// (https://wiki.libsdl.org/SDL_GetNumTouchDevices)\nfunc GetNumTouchDevices() int {\n\treturn int(C.SDL_GetNumTouchDevices())\n}\n\n// GetTouchDevice returns the touch ID with the given index.\n// (https://wiki.libsdl.org/SDL_GetTouchDevice)\nfunc GetTouchDevice(index int) TouchID {\n\treturn TouchID(C.SDL_GetTouchDevice(C.int(index)))\n}\n\n// GetTouchDeviceType returns the type of the given touch device.\n// TODO: (https://wiki.libsdl.org/SDL_GetTouchDeviceType)\nfunc GetTouchDeviceType(id TouchID) TouchDeviceType {\n\treturn TouchDeviceType(C.SDL_GetTouchDeviceType(C.SDL_TouchID(id)))\n}\n\n// GetNumTouchFingers returns the number of active fingers for a given touch device.\n// (https://wiki.libsdl.org/SDL_GetNumTouchFingers)\nfunc GetNumTouchFingers(t TouchID) int {\n\treturn int(C.SDL_GetNumTouchFingers(t.c()))\n}\n\n// GetTouchFinger returns the finger object for specified touch device ID and finger index.\n// (https://wiki.libsdl.org/SDL_GetTouchFinger)\nfunc GetTouchFinger(t TouchID, index int) *Finger {\n\treturn (*Finger)(unsafe.Pointer(C.SDL_GetTouchFinger(t.c(), C.int(index))))\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/version.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if SDL_VERSION_ATLEAST(2,0,16)\n\nstatic inline int GetRevisionNumber(void)\n{\n\treturn 0;\n}\n\n#else\n\nstatic inline int GetRevisionNumber(void)\n{\n\treturn SDL_GetRevisionNumber();\n}\n\n#endif\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// The version of SDL in use.\nconst (\n\tMAJOR_VERSION = C.SDL_MAJOR_VERSION // major version\n\tMINOR_VERSION = C.SDL_MINOR_VERSION // minor version\n\tPATCHLEVEL    = C.SDL_PATCHLEVEL    // update version (patchlevel)\n)\n\n// Version contains information about the version of SDL in use.\n// (https://wiki.libsdl.org/SDL_version)\ntype Version struct {\n\tMajor uint8 // major version\n\tMinor uint8 // minor version\n\tPatch uint8 // update version (patchlevel)\n}\ntype cVersion C.SDL_version\n\nfunc (v *Version) cptr() *C.SDL_version {\n\treturn (*C.SDL_version)(unsafe.Pointer(v))\n}\n\n// VERSION fills the selected struct with the version of SDL in use.\n// (https://wiki.libsdl.org/SDL_VERSION)\nfunc VERSION(v *Version) {\n\tv.Major = MAJOR_VERSION\n\tv.Minor = MINOR_VERSION\n\tv.Patch = PATCHLEVEL\n}\n\n// VERSIONNUM converts separate version components into a single numeric value.\n// (https://wiki.libsdl.org/SDL_VERSIONNUM)\nfunc VERSIONNUM(x, y, z int) int {\n\treturn (x*1000 + y*100 + z)\n}\n\n// COMPILEDVERSION returns the SDL version number that you compiled against.\n// (https://wiki.libsdl.org/SDL_COMPILEDVERSION)\nfunc COMPILEDVERSION() int {\n\treturn VERSIONNUM(MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL)\n}\n\n// VERSION_ATLEAST reports whether the SDL version compiled against is at least as new as the specified version.\n// (https://wiki.libsdl.org/SDL_VERSION_ATLEAST)\nfunc VERSION_ATLEAST(x, y, z int) bool {\n\treturn COMPILEDVERSION() >= VERSIONNUM(x, y, z)\n}\n\n// GetVersion returns the version of SDL that is linked against your program.\n// (https://wiki.libsdl.org/SDL_GetVersion)\nfunc GetVersion(v *Version) {\n\tC.SDL_GetVersion(v.cptr())\n}\n\n// GetRevision returns the code revision of SDL that is linked against your program.\n// (https://wiki.libsdl.org/SDL_GetRevision)\nfunc GetRevision() string {\n\treturn (string)(C.GoString(C.SDL_GetRevision()))\n}\n\n// Deprecated: GetRevisionNumber is deprecated in SDL2 2.0.16 and will return 0. Users should use GetRevision instead.\nfunc GetRevisionNumber() int {\n\treturn (int)(C.GetRevisionNumber())\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/video.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\nstatic inline Sint32 ShowMessageBox(SDL_MessageBoxData data)\n{\n\tSint32 buttonid;\n\tSDL_ShowMessageBox(&data, &buttonid);\n\treturn buttonid;\n}\n\n#if !(SDL_VERSION_ATLEAST(2,0,1))\nstatic void SDL_GL_GetDrawableSize(SDL_Window *window, int *w, int *h)\n{\n\t*w = 0;\n\t*h = 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WINDOW_ALLOW_HIGHDPI is not supported before SDL 2.0.1\")\n#endif\n\n#define SDL_WINDOW_ALLOW_HIGHDPI (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GL_FRAMEBUFFER_SRGB_CAPABLE is not supported before SDL 2.0.1\")\n#endif\n\n#define SDL_GL_FRAMEBUFFER_SRGB_CAPABLE (0)\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,4))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WINDOW_MOUSE_CAPTURE is not supported before SDL 2.0.4\")\n#endif\n\n#define SDL_WINDOW_MOUSE_CAPTURE (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GL_CONTEXT_RELEASE_BEHAVIOR is not supported before SDL 2.0.4\")\n#endif\n\n#define SDL_GL_CONTEXT_RELEASE_BEHAVIOR (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetDisplayDPI is not supported before SDL 2.0.4\")\n#endif\n\nstatic int SDL_GetDisplayDPI(int displayIndex, float* ddpi, float* hdpi, float* vdpi)\n{\n\treturn -1;\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,5))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SetWindowResizable is not supported before SDL 2.0.5\")\n#endif\n\nstatic void SDL_SetWindowResizable(SDL_Window *window, SDL_bool resizable)\n{\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SetWindowOpacity is not supported before SDL 2.0.5\")\n#endif\n\nstatic int SDL_SetWindowOpacity(SDL_Window *window, float opacity)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetWindowOpacity is not supported before SDL 2.0.5\")\n#endif\n\nstatic int SDL_GetWindowOpacity(SDL_Window *window, float *opacity)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetDisplayUsableBounds is not supported before SDL 2.0.5\")\n#endif\n\nstatic int SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect* rect)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WINDOW_ALWAYS_ON_TOP is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_WINDOW_ALWAYS_ON_TOP (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WINDOW_SKIP_TASKBAR is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_WINDOW_SKIP_TASKBAR (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WINDOW_UTILITY is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_WINDOW_UTILITY (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WINDOW_TOOLTIP is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_WINDOW_TOOLTIP (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WINDOW_POPUP_MENU is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_WINDOW_POPUP_MENU (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WINDOWEVENT_TAKE_FOCUS is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_WINDOWEVENT_TAKE_FOCUS (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WINDOWEVENT_HIT_TEST is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_WINDOWEVENT_HIT_TEST (0)\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,6))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WINDOW_VULKAN is not supported before SDL 2.0.6\")\n#endif\n\n#define SDL_WINDOW_VULKAN (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GL_CONTEXT_RESET_NOTIFICATION is not supported before SDL 2.0.6\")\n#endif\n\n#define SDL_GL_CONTEXT_RESET_NOTIFICATION (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GL_CONTEXT_NO_ERROR is not supported before SDL 2.0.6\")\n#endif\n\n#define SDL_GL_CONTEXT_NO_ERROR (0)\n#endif\n\n\n#if !(SDL_VERSION_ATLEAST(2,0,16))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_FlashWindow is not supported before SDL 2.0.16\")\n#pragma message(\"SDL_SetWindowAlwaysOnTop is not supported before SDL 2.0.16\")\n#pragma message(\"SDL_SetWindowKeyboardGrab is not supported before SDL 2.0.16\")\n#endif\n\ntypedef enum\n{\n    SDL_FLASH_CANCEL,                   // Cancel any window flash state\n    SDL_FLASH_BRIEFLY,                  // Flash the window briefly to get attention\n    SDL_FLASH_UNTIL_FOCUSED,            // Flash the window until it gets focus\n} SDL_FlashOperation;\n\nstatic int SDL_FlashWindow(SDL_Window * window, SDL_FlashOperation operation)\n{\n\treturn -1;\n}\n\nstatic void SDL_SetWindowAlwaysOnTop(SDL_Window * window, SDL_bool on_top)\n{\n\treturn;\n}\n\nstatic void SDL_SetWindowKeyboardGrab(SDL_Window * window, SDL_bool grabbed)\n{\n\treturn;\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,18))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetWindowICCProfile is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_SetWindowMouseRect is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_GetWindowMouseRect is not supported before SDL 2.0.18\")\n#endif\n\n#define SDL_WINDOWEVENT_ICCPROF_CHANGED (17) // The ICC profile of the window's display has changed.\n#define SDL_WINDOWEVENT_DISPLAY_CHANGED (18) // Window has been moved to display data1.\n\nstatic void* SDLCALL SDL_GetWindowICCProfile(SDL_Window * window, size_t* size)\n{\n\treturn NULL;\n}\n\nstatic int SDL_SetWindowMouseRect(SDL_Window * window, const SDL_Rect * rect)\n{\n\treturn -1;\n}\n\nstatic const SDL_Rect * SDLCALL SDL_GetWindowMouseRect(SDL_Window * window)\n{\n\treturn NULL;\n}\n\n#endif\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// An enumeration of window states.\n// (https://wiki.libsdl.org/SDL_WindowFlags)\nconst (\n\tWINDOW_FULLSCREEN         = C.SDL_WINDOW_FULLSCREEN         // fullscreen window\n\tWINDOW_OPENGL             = C.SDL_WINDOW_OPENGL             // window usable with OpenGL context\n\tWINDOW_SHOWN              = C.SDL_WINDOW_SHOWN              // window is visible\n\tWINDOW_HIDDEN             = C.SDL_WINDOW_HIDDEN             // window is not visible\n\tWINDOW_BORDERLESS         = C.SDL_WINDOW_BORDERLESS         // no window decoration\n\tWINDOW_RESIZABLE          = C.SDL_WINDOW_RESIZABLE          // window can be resized\n\tWINDOW_MINIMIZED          = C.SDL_WINDOW_MINIMIZED          // window is minimized\n\tWINDOW_MAXIMIZED          = C.SDL_WINDOW_MAXIMIZED          // window is maximized\n\tWINDOW_INPUT_GRABBED      = C.SDL_WINDOW_INPUT_GRABBED      // window has grabbed input focus\n\tWINDOW_INPUT_FOCUS        = C.SDL_WINDOW_INPUT_FOCUS        // window has input focus\n\tWINDOW_MOUSE_FOCUS        = C.SDL_WINDOW_MOUSE_FOCUS        // window has mouse focus\n\tWINDOW_FULLSCREEN_DESKTOP = C.SDL_WINDOW_FULLSCREEN_DESKTOP // fullscreen window at the current desktop resolution\n\tWINDOW_FOREIGN            = C.SDL_WINDOW_FOREIGN            // window not created by SDL\n\tWINDOW_ALLOW_HIGHDPI      = C.SDL_WINDOW_ALLOW_HIGHDPI      // window should be created in high-DPI mode if supported (>= SDL 2.0.1)\n\tWINDOW_MOUSE_CAPTURE      = C.SDL_WINDOW_MOUSE_CAPTURE      // window has mouse captured (unrelated to INPUT_GRABBED, >= SDL 2.0.4)\n\tWINDOW_ALWAYS_ON_TOP      = C.SDL_WINDOW_ALWAYS_ON_TOP      // window should always be above others (X11 only, >= SDL 2.0.5)\n\tWINDOW_SKIP_TASKBAR       = C.SDL_WINDOW_SKIP_TASKBAR       // window should not be added to the taskbar (X11 only, >= SDL 2.0.5)\n\tWINDOW_UTILITY            = C.SDL_WINDOW_UTILITY            // window should be treated as a utility window (X11 only, >= SDL 2.0.5)\n\tWINDOW_TOOLTIP            = C.SDL_WINDOW_TOOLTIP            // window should be treated as a tooltip (X11 only, >= SDL 2.0.5)\n\tWINDOW_POPUP_MENU         = C.SDL_WINDOW_POPUP_MENU         // window should be treated as a popup menu (X11 only, >= SDL 2.0.5)\n\tWINDOW_VULKAN             = C.SDL_WINDOW_VULKAN             // window usable for Vulkan surface (>= SDL 2.0.6)\n)\n\n// An enumeration of window events.\n// (https://wiki.libsdl.org/SDL_WindowEventID)\nconst (\n\tWINDOWEVENT_NONE            = C.SDL_WINDOWEVENT_NONE            // (never used)\n\tWINDOWEVENT_SHOWN           = C.SDL_WINDOWEVENT_SHOWN           // window has been shown\n\tWINDOWEVENT_HIDDEN          = C.SDL_WINDOWEVENT_HIDDEN          // window has been hidden\n\tWINDOWEVENT_EXPOSED         = C.SDL_WINDOWEVENT_EXPOSED         // window has been exposed and should be redrawn\n\tWINDOWEVENT_MOVED           = C.SDL_WINDOWEVENT_MOVED           // window has been moved to data1, data2\n\tWINDOWEVENT_RESIZED         = C.SDL_WINDOWEVENT_RESIZED         // window has been resized to data1xdata2; this event is always preceded by WINDOWEVENT_SIZE_CHANGED\n\tWINDOWEVENT_SIZE_CHANGED    = C.SDL_WINDOWEVENT_SIZE_CHANGED    // window size has changed, either as a result of an API call or through the system or user changing the window size; this event is followed by WINDOWEVENT_RESIZED if the size was changed by an external event, i.e. the user or the window manager\n\tWINDOWEVENT_MINIMIZED       = C.SDL_WINDOWEVENT_MINIMIZED       // window has been minimized\n\tWINDOWEVENT_MAXIMIZED       = C.SDL_WINDOWEVENT_MAXIMIZED       // window has been maximized\n\tWINDOWEVENT_RESTORED        = C.SDL_WINDOWEVENT_RESTORED        // window has been restored to normal size and position\n\tWINDOWEVENT_ENTER           = C.SDL_WINDOWEVENT_ENTER           // window has gained mouse focus\n\tWINDOWEVENT_LEAVE           = C.SDL_WINDOWEVENT_LEAVE           // window has lost mouse focus\n\tWINDOWEVENT_FOCUS_GAINED    = C.SDL_WINDOWEVENT_FOCUS_GAINED    // window has gained keyboard focus\n\tWINDOWEVENT_FOCUS_LOST      = C.SDL_WINDOWEVENT_FOCUS_LOST      // window has lost keyboard focus\n\tWINDOWEVENT_CLOSE           = C.SDL_WINDOWEVENT_CLOSE           // the window manager requests that the window be closed\n\tWINDOWEVENT_TAKE_FOCUS      = C.SDL_WINDOWEVENT_TAKE_FOCUS      // window is being offered a focus (should SDL_SetWindowInputFocus() on itself or a subwindow, or ignore) (>= SDL 2.0.5)\n\tWINDOWEVENT_HIT_TEST        = C.SDL_WINDOWEVENT_HIT_TEST        // window had a hit test that wasn't SDL_HITTEST_NORMAL (>= SDL 2.0.5)\n\tWINDOWEVENT_ICCPROF_CHANGED = C.SDL_WINDOWEVENT_ICCPROF_CHANGED // the ICC profile of the window's display has changed\n\tWINDOWEVENT_DISPLAY_CHANGED = C.SDL_WINDOWEVENT_DISPLAY_CHANGED // window has been moved to display data1\n)\n\n// Window position flags.\n// (https://wiki.libsdl.org/SDL_CreateWindow)\nconst (\n\tWINDOWPOS_UNDEFINED_MASK = C.SDL_WINDOWPOS_UNDEFINED_MASK // used to indicate that you don't care what the window position is\n\tWINDOWPOS_UNDEFINED      = C.SDL_WINDOWPOS_UNDEFINED      // used to indicate that you don't care what the window position is\n\tWINDOWPOS_CENTERED_MASK  = C.SDL_WINDOWPOS_CENTERED_MASK  // used to indicate that the window position should be centered\n\tWINDOWPOS_CENTERED       = C.SDL_WINDOWPOS_CENTERED       // used to indicate that the window position should be centered\n)\n\n// An enumeration of message box flags (e.g. if supported message box will display warning icon).\n// (https://wiki.libsdl.org/SDL_MessageBoxFlags)\nconst (\n\tMESSAGEBOX_ERROR       = C.SDL_MESSAGEBOX_ERROR       // error dialog\n\tMESSAGEBOX_WARNING     = C.SDL_MESSAGEBOX_WARNING     // warning dialog\n\tMESSAGEBOX_INFORMATION = C.SDL_MESSAGEBOX_INFORMATION // informational dialog\n)\n\n// Flags for MessageBoxButtonData.\nconst (\n\tMESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = C.SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT // marks the default button when return is hit\n\tMESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = C.SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT // marks the default button when escape is hit\n)\n\n// OpenGL configuration attributes.\n// (https://wiki.libsdl.org/SDL_GL_SetAttribute)\nconst (\n\tGL_RED_SIZE                   = C.SDL_GL_RED_SIZE                   // the minimum number of bits for the red channel of the color buffer; defaults to 3\n\tGL_GREEN_SIZE                 = C.SDL_GL_GREEN_SIZE                 // the minimum number of bits for the green channel of the color buffer; defaults to 3\n\tGL_BLUE_SIZE                  = C.SDL_GL_BLUE_SIZE                  // the minimum number of bits for the blue channel of the color buffer; defaults to 2\n\tGL_ALPHA_SIZE                 = C.SDL_GL_ALPHA_SIZE                 // the minimum number of bits for the alpha channel of the color buffer; defaults to 0\n\tGL_BUFFER_SIZE                = C.SDL_GL_BUFFER_SIZE                // the minimum number of bits for frame buffer size; defaults to 0\n\tGL_DOUBLEBUFFER               = C.SDL_GL_DOUBLEBUFFER               // whether the output is single or double buffered; defaults to double buffering on\n\tGL_DEPTH_SIZE                 = C.SDL_GL_DEPTH_SIZE                 // the minimum number of bits in the depth buffer; defaults to 16\n\tGL_STENCIL_SIZE               = C.SDL_GL_STENCIL_SIZE               // the minimum number of bits in the stencil buffer; defaults to 0\n\tGL_ACCUM_RED_SIZE             = C.SDL_GL_ACCUM_RED_SIZE             // the minimum number of bits for the red channel of the accumulation buffer; defaults to 0\n\tGL_ACCUM_GREEN_SIZE           = C.SDL_GL_ACCUM_GREEN_SIZE           // the minimum number of bits for the green channel of the accumulation buffer; defaults to 0\n\tGL_ACCUM_BLUE_SIZE            = C.SDL_GL_ACCUM_BLUE_SIZE            // the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0\n\tGL_ACCUM_ALPHA_SIZE           = C.SDL_GL_ALPHA_SIZE                 // the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0\n\tGL_STEREO                     = C.SDL_GL_STEREO                     // whether the output is stereo 3D; defaults to off\n\tGL_MULTISAMPLEBUFFERS         = C.SDL_GL_MULTISAMPLEBUFFERS         // the number of buffers used for multisample anti-aliasing; defaults to 0; see Remarks for details\n\tGL_MULTISAMPLESAMPLES         = C.SDL_GL_MULTISAMPLESAMPLES         // the number of samples used around the current pixel used for multisample anti-aliasing; defaults to 0; see Remarks for details\n\tGL_ACCELERATED_VISUAL         = C.SDL_GL_ACCELERATED_VISUAL         // set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either\n\tGL_RETAINED_BACKING           = C.SDL_GL_RETAINED_BACKING           // not used (deprecated)\n\tGL_CONTEXT_MAJOR_VERSION      = C.SDL_GL_CONTEXT_MAJOR_VERSION      // OpenGL context major version\n\tGL_CONTEXT_MINOR_VERSION      = C.SDL_GL_CONTEXT_MINOR_VERSION      // OpenGL context minor version\n\tGL_CONTEXT_EGL                = C.SDL_GL_CONTEXT_EGL                // not used (deprecated)\n\tGL_CONTEXT_FLAGS              = C.SDL_GL_CONTEXT_FLAGS              // some combination of 0 or more of elements of the GLcontextFlag enumeration; defaults to 0 (https://wiki.libsdl.org/SDL_GLcontextFlag)\n\tGL_CONTEXT_PROFILE_MASK       = C.SDL_GL_CONTEXT_PROFILE_MASK       // type of GL context (Core, Compatibility, ES); default value depends on platform (https://wiki.libsdl.org/SDL_GLprofile)\n\tGL_SHARE_WITH_CURRENT_CONTEXT = C.SDL_GL_SHARE_WITH_CURRENT_CONTEXT // OpenGL context sharing; defaults to 0\n\tGL_FRAMEBUFFER_SRGB_CAPABLE   = C.SDL_GL_FRAMEBUFFER_SRGB_CAPABLE   // requests sRGB capable visual; defaults to 0 (>= SDL 2.0.1)\n\tGL_CONTEXT_RELEASE_BEHAVIOR   = C.SDL_GL_CONTEXT_RELEASE_BEHAVIOR   // sets context the release behavior; defaults to 1 (>= SDL 2.0.4)\n\tGL_CONTEXT_RESET_NOTIFICATION = C.SDL_GL_CONTEXT_RESET_NOTIFICATION // (>= SDL 2.0.6)\n\tGL_CONTEXT_NO_ERROR           = C.SDL_GL_CONTEXT_NO_ERROR           // (>= SDL 2.0.6)\n)\n\n// An enumeration of OpenGL profiles.\n// (https://wiki.libsdl.org/SDL_GLprofile)\nconst (\n\tGL_CONTEXT_PROFILE_CORE          = C.SDL_GL_CONTEXT_PROFILE_CORE          // OpenGL core profile - deprecated functions are disabled\n\tGL_CONTEXT_PROFILE_COMPATIBILITY = C.SDL_GL_CONTEXT_PROFILE_COMPATIBILITY // OpenGL compatibility profile - deprecated functions are allowed\n\tGL_CONTEXT_PROFILE_ES            = C.SDL_GL_CONTEXT_PROFILE_ES            // OpenGL ES profile - only a subset of the base OpenGL functionality is available\n)\n\n// An enumeration of OpenGL context configuration flags.\n// (https://wiki.libsdl.org/SDL_GLcontextFlag)\nconst (\n\tGL_CONTEXT_DEBUG_FLAG              = C.SDL_GL_CONTEXT_DEBUG_FLAG              // intended to put the GL into a \"debug\" mode which might offer better developer insights, possibly at a loss of performance\n\tGL_CONTEXT_FORWARD_COMPATIBLE_FLAG = C.SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG // intended to put the GL into a \"forward compatible\" mode, which means that no deprecated functionality will be supported, possibly at a gain in performance, and only applies to GL 3.0 and later contexts\n\tGL_CONTEXT_ROBUST_ACCESS_FLAG      = C.SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG      // intended to require a GL context that supports the GL_ARB_robustness extension--a mode that offers a few APIs that are safer than the usual defaults (think snprintf() vs sprintf())\n\tGL_CONTEXT_RESET_ISOLATION_FLAG    = C.SDL_GL_CONTEXT_RESET_ISOLATION_FLAG    // intended to require the GL to make promises about what to do in the face of driver or hardware failure\n)\n\n//\n// Window flash operation\n//\nconst (\n\tFLASH_CANCEL        FlashOperation = C.SDL_FLASH_CANCEL        // Cancel any window flash state\n\tFLASH_BRIEFLY                      = C.SDL_FLASH_BRIEFLY       // Flash the window briefly to get attention\n\tFLASH_UNTIL_FOCUSED                = C.SDL_FLASH_UNTIL_FOCUSED // Flash the window until it gets focus\n)\n\ntype FlashOperation C.SDL_FlashOperation\n\n// DisplayMode contains the description of a display mode.\n// (https://wiki.libsdl.org/SDL_DisplayMode)\ntype DisplayMode struct {\n\tFormat      uint32         // one of the PixelFormatEnum values (https://wiki.libsdl.org/SDL_PixelFormatEnum)\n\tW           int32          // width, in screen coordinates\n\tH           int32          // height, in screen coordinates\n\tRefreshRate int32          // refresh rate (in Hz), or 0 for unspecified\n\tDriverData  unsafe.Pointer // driver-specific data, initialize to 0\n}\ntype cDisplayMode C.SDL_DisplayMode\n\n// Window is a type used to identify a window.\ntype Window C.SDL_Window\n\n// GLContext is an opaque handle to an OpenGL context.\ntype GLContext C.SDL_GLContext\n\n// GLattr is an OpenGL configuration attribute.\n//(https://wiki.libsdl.org/SDL_GLattr)\ntype GLattr C.SDL_GLattr\n\n// MessageBoxColor contains RGB value used in an MessageBoxColorScheme.\n// (https://wiki.libsdl.org/SDL_MessageBoxColor)\ntype MessageBoxColor struct {\n\tR uint8 // the red component in the range 0-255\n\tG uint8 // the green component in the range 0-255\n\tB uint8 // the blue component in the range 0-255\n}\ntype cMessageBoxColor C.SDL_MessageBoxColor\n\n// MessageBoxColorScheme contains a set of colors to use for message box dialogs.\n// (https://wiki.libsdl.org/SDL_MessageBoxColorScheme)\ntype MessageBoxColorScheme struct {\n\tColors [5]MessageBoxColor // background, text, button border, button background, button selected\n}\ntype cMessageBoxColorScheme C.SDL_MessageBoxColorScheme\n\n// MessageBoxButtonData contains individual button data for a message box.\n// (https://wiki.libsdl.org/SDL_MessageBoxButtonData)\ntype MessageBoxButtonData struct {\n\tFlags    uint32 // MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT\n\tButtonID int32  // user defined button id (value returned via ShowMessageBox())\n\tText     string // the UTF-8 button text\n}\n\n// MessageBoxData contains title, text, window and other data for a message box.\n// (https://wiki.libsdl.org/SDL_MessageBoxData)\ntype MessageBoxData struct {\n\tFlags       uint32  // MESSAGEBOX_ERROR, MESSAGEBOX_WARNING, MESSAGEBOX_INFORMATION\n\tWindow      *Window // parent window or nil\n\tTitle       string\n\tMessage     string\n\tButtons     []MessageBoxButtonData\n\tColorScheme *MessageBoxColorScheme // nil to use system settings\n}\n\nfunc (window *Window) cptr() *C.SDL_Window {\n\treturn (*C.SDL_Window)(unsafe.Pointer(window))\n}\n\nfunc (dm *DisplayMode) cptr() *C.SDL_DisplayMode {\n\treturn (*C.SDL_DisplayMode)(unsafe.Pointer(dm))\n}\n\nfunc (mc *MessageBoxColor) cptr() *C.SDL_MessageBoxColor {\n\treturn (*C.SDL_MessageBoxColor)(unsafe.Pointer(mc))\n}\n\nfunc (mcs *MessageBoxColorScheme) cptr() *C.SDL_MessageBoxColorScheme {\n\treturn (*C.SDL_MessageBoxColorScheme)(unsafe.Pointer(mcs))\n}\n\nfunc (mbd *MessageBoxButtonData) cptr() *C.SDL_MessageBoxButtonData {\n\treturn (*C.SDL_MessageBoxButtonData)(unsafe.Pointer(mbd))\n}\n\nfunc (md *MessageBoxData) cptr() *C.SDL_MessageBoxData {\n\treturn (*C.SDL_MessageBoxData)(unsafe.Pointer(md))\n}\n\nfunc (attr GLattr) c() C.SDL_GLattr {\n\treturn C.SDL_GLattr(attr)\n}\n\n// GetDisplayName returns the name of a display in UTF-8 encoding.\n// (https://wiki.libsdl.org/SDL_GetDisplayName)\nfunc GetDisplayName(displayIndex int) (string, error) {\n\tname := C.SDL_GetDisplayName(C.int(displayIndex))\n\tif name == nil {\n\t\treturn \"\", GetError()\n\t}\n\treturn C.GoString(name), nil\n}\n\n// GetNumVideoDisplays returns the number of available video displays.\n// (https://wiki.libsdl.org/SDL_GetNumVideoDisplays)\nfunc GetNumVideoDisplays() (int, error) {\n\tn := int(C.SDL_GetNumVideoDisplays())\n\treturn n, errorFromInt(n)\n}\n\n// GetNumVideoDrivers returns the number of video drivers compiled into SDL.\n// (https://wiki.libsdl.org/SDL_GetNumVideoDrivers)\nfunc GetNumVideoDrivers() (int, error) {\n\tn := int(C.SDL_GetNumVideoDrivers())\n\treturn n, errorFromInt(n)\n}\n\n// GetVideoDriver returns the name of a built in video driver.\n// (https://wiki.libsdl.org/SDL_GetVideoDriver)\nfunc GetVideoDriver(index int) string {\n\treturn string(C.GoString(C.SDL_GetVideoDriver(C.int(index))))\n}\n\n// VideoInit initializes the video subsystem, optionally specifying a video driver.\n// (https://wiki.libsdl.org/SDL_VideoInit)\nfunc VideoInit(driverName string) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_VideoInit(C.CString(driverName))))\n}\n\n// VideoQuit shuts down the video subsystem, if initialized with VideoInit().\n// (https://wiki.libsdl.org/SDL_VideoQuit)\nfunc VideoQuit() {\n\tC.SDL_VideoQuit()\n}\n\n// GetCurrentVideoDriver returns the name of the currently initialized video driver.\n// (https://wiki.libsdl.org/SDL_GetCurrentVideoDriver)\nfunc GetCurrentVideoDriver() (string, error) {\n\tname := C.SDL_GetCurrentVideoDriver()\n\tif name == nil {\n\t\treturn \"\", GetError()\n\t}\n\treturn C.GoString(name), nil\n}\n\n// GetNumDisplayModes returns the number of available display modes.\n// (https://wiki.libsdl.org/SDL_GetNumDisplayModes)\nfunc GetNumDisplayModes(displayIndex int) (int, error) {\n\tn := int(C.SDL_GetNumDisplayModes(C.int(displayIndex)))\n\treturn n, errorFromInt(n)\n}\n\n// GetDisplayBounds returns the desktop area represented by a display, with the primary display located at 0,0.\n// (https://wiki.libsdl.org/SDL_GetDisplayBounds)\nfunc GetDisplayBounds(displayIndex int) (rect Rect, err error) {\n\terr = errorFromInt(int(\n\t\tC.SDL_GetDisplayBounds(C.int(displayIndex), (&rect).cptr())))\n\treturn\n}\n\n// GetDisplayUsableBounds returns the usable desktop area represented by a display, with the primary display located at 0,0.\n// (https://wiki.libsdl.org/SDL_GetDisplayUsableBounds)\nfunc GetDisplayUsableBounds(displayIndex int) (rect Rect, err error) {\n\terr = errorFromInt(int(\n\t\tC.SDL_GetDisplayUsableBounds(C.int(displayIndex), rect.cptr())))\n\treturn\n}\n\n// GetDisplayMode returns information about a specific display mode.\n// (https://wiki.libsdl.org/SDL_GetDisplayMode)\nfunc GetDisplayMode(displayIndex int, modeIndex int) (mode DisplayMode, err error) {\n\terr = errorFromInt(int(\n\t\tC.SDL_GetDisplayMode(C.int(displayIndex), C.int(modeIndex), (&mode).cptr())))\n\treturn\n}\n\n// GetDesktopDisplayMode returns information about the desktop display mode.\n// (https://wiki.libsdl.org/SDL_GetDesktopDisplayMode)\nfunc GetDesktopDisplayMode(displayIndex int) (mode DisplayMode, err error) {\n\terr = errorFromInt(int(\n\t\tC.SDL_GetDesktopDisplayMode(C.int(displayIndex), (&mode).cptr())))\n\treturn\n}\n\n// GetCurrentDisplayMode returns information about the current display mode.\n// (https://wiki.libsdl.org/SDL_GetCurrentDisplayMode)\nfunc GetCurrentDisplayMode(displayIndex int) (mode DisplayMode, err error) {\n\terr = errorFromInt(int(\n\t\tC.SDL_GetCurrentDisplayMode(C.int(displayIndex), (&mode).cptr())))\n\treturn\n}\n\n// GetClosestDisplayMode returns the closest match to the requested display mode.\n// (https://wiki.libsdl.org/SDL_GetClosestDisplayMode)\nfunc GetClosestDisplayMode(displayIndex int, mode *DisplayMode, closest *DisplayMode) (*DisplayMode, error) {\n\tm := (*DisplayMode)(unsafe.Pointer((C.SDL_GetClosestDisplayMode(C.int(displayIndex), mode.cptr(), closest.cptr()))))\n\tif m == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn m, nil\n}\n\n// GetDisplayDPI returns the dots/pixels-per-inch for a display.\n// (https://wiki.libsdl.org/SDL_GetDisplayDPI)\nfunc GetDisplayDPI(displayIndex int) (ddpi, hdpi, vdpi float32, err error) {\n\terr = errorFromInt(int(\n\t\tC.SDL_GetDisplayDPI(C.int(displayIndex), (*C.float)(unsafe.Pointer(&ddpi)), (*C.float)(unsafe.Pointer(&hdpi)), (*C.float)(unsafe.Pointer(&vdpi)))))\n\treturn\n}\n\n// GetDisplayIndex returns the index of the display associated with the window.\n// (https://wiki.libsdl.org/SDL_GetWindowDisplayIndex)\nfunc (window *Window) GetDisplayIndex() (int, error) {\n\ti := int(C.SDL_GetWindowDisplayIndex(window.cptr()))\n\treturn i, errorFromInt(i)\n}\n\n// SetDisplayMode sets the display mode to use when the window is visible at fullscreen.\n// (https://wiki.libsdl.org/SDL_SetWindowDisplayMode)\nfunc (window *Window) SetDisplayMode(mode *DisplayMode) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetWindowDisplayMode(window.cptr(), mode.cptr())))\n}\n\n// GetDisplayMode fills in information about the display mode to use when the window is visible at fullscreen.\n// (https://wiki.libsdl.org/SDL_GetWindowDisplayMode)\nfunc (window *Window) GetDisplayMode() (mode DisplayMode, err error) {\n\terr = errorFromInt(int(\n\t\tC.SDL_GetWindowDisplayMode(window.cptr(), (&mode).cptr())))\n\treturn\n}\n\n// GetPixelFormat returns the pixel format associated with the window.\n// (https://wiki.libsdl.org/SDL_GetWindowPixelFormat)\nfunc (window *Window) GetPixelFormat() (uint32, error) {\n\tf := (uint32)(C.SDL_GetWindowPixelFormat(window.cptr()))\n\tif f == PIXELFORMAT_UNKNOWN {\n\t\treturn f, GetError()\n\t}\n\treturn f, nil\n}\n\n// CreateWindow creates a window with the specified position, dimensions, and flags.\n// (https://wiki.libsdl.org/SDL_CreateWindow)\nfunc CreateWindow(title string, x, y, w, h int32, flags uint32) (*Window, error) {\n\tvar _window = C.SDL_CreateWindow(C.CString(title), C.int(x), C.int(y), C.int(w), C.int(h), C.Uint32(flags))\n\tif _window == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Window)(unsafe.Pointer(_window)), nil\n}\n\n// CreateWindowFrom creates an SDL window from an existing native window.\n// (https://wiki.libsdl.org/SDL_CreateWindowFrom)\nfunc CreateWindowFrom(data unsafe.Pointer) (*Window, error) {\n\t_window := C.SDL_CreateWindowFrom(data)\n\tif _window == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Window)(unsafe.Pointer(_window)), nil\n}\n\n// Destroy destroys the window.\n// (https://wiki.libsdl.org/SDL_DestroyWindow)\nfunc (window *Window) Destroy() error {\n\tlastErr := GetError()\n\tClearError()\n\tC.SDL_DestroyWindow(window.cptr())\n\terr := GetError()\n\tif err != nil {\n\t\treturn err\n\t}\n\tSetError(lastErr)\n\treturn nil\n}\n\n// GetID returns the numeric ID of the window, for logging purposes.\n//  (https://wiki.libsdl.org/SDL_GetWindowID)\nfunc (window *Window) GetID() (uint32, error) {\n\tid := uint32(C.SDL_GetWindowID(window.cptr()))\n\tif id == 0 {\n\t\treturn 0, GetError()\n\t}\n\treturn id, nil\n}\n\n// GetWindowFromID returns a window from a stored ID.\n// (https://wiki.libsdl.org/SDL_GetWindowFromID)\nfunc GetWindowFromID(id uint32) (*Window, error) {\n\t_window := C.SDL_GetWindowFromID(C.Uint32(id))\n\tif _window == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Window)(unsafe.Pointer((_window))), nil\n}\n\n// GetFlags returns the window flags.\n// (https://wiki.libsdl.org/SDL_GetWindowFlags)\nfunc (window *Window) GetFlags() uint32 {\n\treturn (uint32)(C.SDL_GetWindowFlags(window.cptr()))\n}\n\n// SetTitle sets the title of the window.\n// (https://wiki.libsdl.org/SDL_SetWindowTitle)\nfunc (window *Window) SetTitle(title string) {\n\tC.SDL_SetWindowTitle(window.cptr(), C.CString(title))\n}\n\n// GetTitle returns the title of the window.\n// (https://wiki.libsdl.org/SDL_GetWindowTitle)\nfunc (window *Window) GetTitle() string {\n\treturn C.GoString(C.SDL_GetWindowTitle(window.cptr()))\n}\n\n// SetIcon sets the icon for the window.\n// (https://wiki.libsdl.org/SDL_SetWindowIcon)\nfunc (window *Window) SetIcon(icon *Surface) {\n\tC.SDL_SetWindowIcon(window.cptr(), icon.cptr())\n}\n\n// SetData associates an arbitrary named pointer with the window.\n// (https://wiki.libsdl.org/SDL_SetWindowData)\nfunc (window *Window) SetData(name string, userdata unsafe.Pointer) unsafe.Pointer {\n\treturn unsafe.Pointer(C.SDL_SetWindowData(window.cptr(), C.CString(name), userdata))\n}\n\n// GetData returns the data pointer associated with the window.\n// (https://wiki.libsdl.org/SDL_GetWindowData)\nfunc (window *Window) GetData(name string) unsafe.Pointer {\n\treturn unsafe.Pointer(C.SDL_GetWindowData(window.cptr(), C.CString(name)))\n}\n\n// SetPosition sets the position of the window.\n// (https://wiki.libsdl.org/SDL_SetWindowPosition)\nfunc (window *Window) SetPosition(x, y int32) {\n\tC.SDL_SetWindowPosition(window.cptr(), C.int(x), C.int(y))\n}\n\n// GetPosition returns the position of the window.\n// (https://wiki.libsdl.org/SDL_GetWindowPosition)\nfunc (window *Window) GetPosition() (x, y int32) {\n\tvar _x, _y C.int\n\tC.SDL_GetWindowPosition(window.cptr(), &_x, &_y)\n\treturn int32(_x), int32(_y)\n}\n\n// SetResizable sets the user-resizable state of the window.\n// (https://wiki.libsdl.org/SDL_SetWindowResizable)\nfunc (window *Window) SetResizable(resizable bool) {\n\tC.SDL_SetWindowResizable(window.cptr(), C.SDL_bool(Btoi(resizable)))\n}\n\n// SetSize sets the size of the window's client area.\n// (https://wiki.libsdl.org/SDL_SetWindowSize)\nfunc (window *Window) SetSize(w, h int32) {\n\tC.SDL_SetWindowSize(window.cptr(), C.int(w), C.int(h))\n}\n\n// GetSize returns the size of the window's client area.\n// (https://wiki.libsdl.org/SDL_GetWindowSize)\nfunc (window *Window) GetSize() (w, h int32) {\n\tvar _w, _h C.int\n\tC.SDL_GetWindowSize(window.cptr(), &_w, &_h)\n\treturn int32(_w), int32(_h)\n}\n\n// SetMinimumSize sets the minimum size of the window's client area.\n// (https://wiki.libsdl.org/SDL_SetWindowMinimumSize)\nfunc (window *Window) SetMinimumSize(minW, minH int32) {\n\tC.SDL_SetWindowMinimumSize(window.cptr(), C.int(minW), C.int(minH))\n}\n\n// GetMinimumSize returns the minimum size of the window's client area.\n// (https://wiki.libsdl.org/SDL_GetWindowMinimumSize)\nfunc (window *Window) GetMinimumSize() (w, h int32) {\n\tvar _w, _h C.int\n\tC.SDL_GetWindowMinimumSize(window.cptr(), &_w, &_h)\n\treturn int32(_w), int32(_h)\n}\n\n// SetMaximumSize sets the maximum size of the window's client area.\n// (https://wiki.libsdl.org/SDL_SetWindowMaximumSize)\nfunc (window *Window) SetMaximumSize(maxW, maxH int32) {\n\tC.SDL_SetWindowMaximumSize(window.cptr(), C.int(maxW), C.int(maxH))\n}\n\n// GetMaximumSize returns the maximum size of the window's client area.\n// (https://wiki.libsdl.org/SDL_GetWindowMaximumSize)\nfunc (window *Window) GetMaximumSize() (w, h int32) {\n\tvar _w, _h C.int\n\tC.SDL_GetWindowMaximumSize(window.cptr(), &_w, &_h)\n\treturn int32(_w), int32(_h)\n}\n\n// SetBordered sets the border state of the window.\n// (https://wiki.libsdl.org/SDL_SetWindowBordered)\nfunc (window *Window) SetBordered(bordered bool) {\n\tC.SDL_SetWindowBordered(window.cptr(), C.SDL_bool(Btoi(bordered)))\n}\n\n// Show shows the window.\n// (https://wiki.libsdl.org/SDL_ShowWindow)\nfunc (window *Window) Show() {\n\tC.SDL_ShowWindow(window.cptr())\n}\n\n// Hide hides the window.\n// (https://wiki.libsdl.org/SDL_HideWindow)\nfunc (window *Window) Hide() {\n\tC.SDL_HideWindow(window.cptr())\n}\n\n// Raise raises the window above other windows and set the input focus.\n// (https://wiki.libsdl.org/SDL_RaiseWindow)\nfunc (window *Window) Raise() {\n\tC.SDL_RaiseWindow(window.cptr())\n}\n\n// Maximize makes the window as large as possible.\n// (https://wiki.libsdl.org/SDL_MaximizeWindow)\nfunc (window *Window) Maximize() {\n\tC.SDL_MaximizeWindow(window.cptr())\n}\n\n// Minimize minimizes the window to an iconic representation.\n// (https://wiki.libsdl.org/SDL_MinimizeWindow)\nfunc (window *Window) Minimize() {\n\tC.SDL_MinimizeWindow(window.cptr())\n}\n\n// Restore restores the size and position of a minimized or maximized window.\n// (https://wiki.libsdl.org/SDL_RestoreWindow)\nfunc (window *Window) Restore() {\n\tC.SDL_RestoreWindow(window.cptr())\n}\n\n// SetFullscreen sets the window's fullscreen state.\n// (https://wiki.libsdl.org/SDL_SetWindowFullscreen)\nfunc (window *Window) SetFullscreen(flags uint32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetWindowFullscreen(window.cptr(), C.Uint32(flags))))\n}\n\n// GetSurface returns the SDL surface associated with the window.\n// (https://wiki.libsdl.org/SDL_GetWindowSurface)\nfunc (window *Window) GetSurface() (*Surface, error) {\n\tsurface := (*Surface)(unsafe.Pointer(C.SDL_GetWindowSurface(window.cptr())))\n\tif surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn surface, nil\n}\n\n// UpdateSurface copies the window surface to the screen.\n// (https://wiki.libsdl.org/SDL_UpdateWindowSurface)\nfunc (window *Window) UpdateSurface() error {\n\treturn errorFromInt(int(\n\t\tC.SDL_UpdateWindowSurface(window.cptr())))\n}\n\n// UpdateSurfaceRects copies areas of the window surface to the screen.\n// (https://wiki.libsdl.org/SDL_UpdateWindowSurfaceRects)\nfunc (window *Window) UpdateSurfaceRects(rects []Rect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_UpdateWindowSurfaceRects(window.cptr(), rects[0].cptr(), C.int(len(rects)))))\n}\n\n// SetGrab sets the window's input grab mode.\n// (https://wiki.libsdl.org/SDL_SetWindowGrab)\nfunc (window *Window) SetGrab(grabbed bool) {\n\tC.SDL_SetWindowGrab(window.cptr(), C.SDL_bool((Btoi(grabbed))))\n}\n\n// GetGrab returns the window's input grab mode.\n// (https://wiki.libsdl.org/SDL_GetWindowGrab)\nfunc (window *Window) GetGrab() bool {\n\treturn C.SDL_GetWindowGrab(window.cptr()) != 0\n}\n\n// SetBrightness sets the brightness (gamma multiplier) for the display that owns the given window.\n// (https://wiki.libsdl.org/SDL_SetWindowBrightness)\nfunc (window *Window) SetBrightness(brightness float32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetWindowBrightness(window.cptr(), C.float(brightness))))\n}\n\n// GetBrightness returns the brightness (gamma multiplier) for the display that owns the given window.\n// (https://wiki.libsdl.org/SDL_GetWindowBrightness)\nfunc (window *Window) GetBrightness() float32 {\n\treturn float32(C.SDL_GetWindowBrightness(window.cptr()))\n}\n\n// SetGammaRamp sets the gamma ramp for the display that owns the given window.\n// (https://wiki.libsdl.org/SDL_SetWindowGammaRamp)\nfunc (window *Window) SetGammaRamp(red, green, blue *[256]uint16) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetWindowGammaRamp(\n\t\t\twindow.cptr(),\n\t\t\t(*C.Uint16)(unsafe.Pointer(red)),\n\t\t\t(*C.Uint16)(unsafe.Pointer(green)),\n\t\t\t(*C.Uint16)(unsafe.Pointer(blue)))))\n}\n\n// GetGammaRamp returns the gamma ramp for the display that owns a given window.\n// (https://wiki.libsdl.org/SDL_GetWindowGammaRamp)\nfunc (window *Window) GetGammaRamp() (red, green, blue *[256]uint16, err error) {\n\tcode := int(C.SDL_GetWindowGammaRamp(\n\t\twindow.cptr(),\n\t\t(*C.Uint16)(unsafe.Pointer(red)),\n\t\t(*C.Uint16)(unsafe.Pointer(green)),\n\t\t(*C.Uint16)(unsafe.Pointer(blue))))\n\treturn red, green, blue, errorFromInt(code)\n}\n\n// SetWindowOpacity sets the opacity of the window.\n// (https://wiki.libsdl.org/SDL_SetWindowOpacity)\nfunc (window *Window) SetWindowOpacity(opacity float32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetWindowOpacity(window.cptr(), C.float(opacity))))\n}\n\n// GetWindowOpacity returns the opacity of the window.\n// (https://wiki.libsdl.org/SDL_GetWindowOpacity)\nfunc (window *Window) GetWindowOpacity() (opacity float32, err error) {\n\treturn opacity, errorFromInt(int(\n\t\tC.SDL_GetWindowOpacity(window.cptr(), (*C.float)(unsafe.Pointer(&opacity)))))\n}\n\n// ShowSimpleMessageBox displays a simple modal message box.\n// (https://wiki.libsdl.org/SDL_ShowSimpleMessageBox)\nfunc ShowSimpleMessageBox(flags uint32, title, message string, window *Window) error {\n\t_title := C.CString(title)\n\tdefer C.free(unsafe.Pointer(_title))\n\t_message := C.CString(message)\n\tdefer C.free(unsafe.Pointer(_message))\n\treturn errorFromInt(int(\n\t\tC.SDL_ShowSimpleMessageBox(C.Uint32(flags), _title, _message, window.cptr())))\n}\n\n// ShowMessageBox creates a modal message box.\n// (https://wiki.libsdl.org/SDL_ShowMessageBox)\nfunc ShowMessageBox(data *MessageBoxData) (buttonid int32, err error) {\n\t_title := C.CString(data.Title)\n\tdefer C.free(unsafe.Pointer(_title))\n\t_message := C.CString(data.Message)\n\tdefer C.free(unsafe.Pointer(_message))\n\n\tvar cbuttons []C.SDL_MessageBoxButtonData\n\tvar cbtntexts []*C.char\n\tdefer func(texts []*C.char) {\n\t\tfor _, t := range texts {\n\t\t\tC.free(unsafe.Pointer(t))\n\t\t}\n\t}(cbtntexts)\n\n\tfor _, btn := range data.Buttons {\n\t\tctext := C.CString(btn.Text)\n\t\tcbtn := C.SDL_MessageBoxButtonData{\n\t\t\tflags:    C.Uint32(btn.Flags),\n\t\t\tbuttonid: C.int(btn.ButtonID),\n\t\t\ttext:     ctext,\n\t\t}\n\n\t\tcbuttons = append(cbuttons, cbtn)\n\t\tcbtntexts = append(cbtntexts, ctext)\n\t}\n\n\tvar buttonPtr *C.SDL_MessageBoxButtonData\n\tif len(cbuttons) > 0 {\n\t\tbuttonPtr = &cbuttons[0]\n\t}\n\tcdata := C.SDL_MessageBoxData{\n\t\tflags:       C.Uint32(data.Flags),\n\t\twindow:      data.Window.cptr(),\n\t\ttitle:       _title,\n\t\tmessage:     _message,\n\t\tnumbuttons:  C.int(len(data.Buttons)),\n\t\tbuttons:     buttonPtr,\n\t\tcolorScheme: data.ColorScheme.cptr(),\n\t}\n\n\tbuttonid = int32(C.ShowMessageBox(cdata))\n\treturn buttonid, errorFromInt(int(buttonid))\n}\n\n// IsScreenSaverEnabled reports whether the screensaver is currently enabled.\n// (https://wiki.libsdl.org/SDL_IsScreenSaverEnabled)\nfunc IsScreenSaverEnabled() bool {\n\treturn C.SDL_IsScreenSaverEnabled() != 0\n}\n\n// EnableScreenSaver allows the screen to be blanked by a screen saver.\n// (https://wiki.libsdl.org/SDL_EnableScreenSaver)\nfunc EnableScreenSaver() {\n\tC.SDL_EnableScreenSaver()\n}\n\n// DisableScreenSaver prevents the screen from being blanked by a screen saver.\n// (https://wiki.libsdl.org/SDL_DisableScreenSaver)\nfunc DisableScreenSaver() {\n\tC.SDL_DisableScreenSaver()\n}\n\n// GLLoadLibrary dynamically loads an OpenGL library.\n// (https://wiki.libsdl.org/SDL_GL_LoadLibrary)\nfunc GLLoadLibrary(path string) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_GL_LoadLibrary(C.CString(path))))\n}\n\n// GLGetProcAddress returns an OpenGL function by name.\n// (https://wiki.libsdl.org/SDL_GL_GetProcAddress)\nfunc GLGetProcAddress(proc string) unsafe.Pointer {\n\treturn unsafe.Pointer(C.SDL_GL_GetProcAddress(C.CString(proc)))\n}\n\n// GLUnloadLibrary unloads the OpenGL library previously loaded by GLLoadLibrary().\n// (https://wiki.libsdl.org/SDL_GL_UnloadLibrary)\nfunc GLUnloadLibrary() {\n\tC.SDL_GL_UnloadLibrary()\n}\n\n// GLExtensionSupported reports whether an OpenGL extension is supported for the current context.\n// (https://wiki.libsdl.org/SDL_GL_ExtensionSupported)\nfunc GLExtensionSupported(extension string) bool {\n\treturn C.SDL_GL_ExtensionSupported(C.CString(extension)) != 0\n}\n\n// GLSetAttribute sets an OpenGL window attribute before window creation.\n// (https://wiki.libsdl.org/SDL_GL_SetAttribute)\nfunc GLSetAttribute(attr GLattr, value int) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_GL_SetAttribute(attr.c(), C.int(value))))\n}\n\n// GLGetAttribute returns the actual value for an attribute from the current context.\n// (https://wiki.libsdl.org/SDL_GL_GetAttribute)\nfunc GLGetAttribute(attr GLattr) (int, error) {\n\tvar _value C.int\n\tif C.SDL_GL_GetAttribute(attr.c(), &_value) != 0 {\n\t\treturn int(_value), GetError()\n\t}\n\treturn int(_value), nil\n}\n\n// GLCreateContext creates an OpenGL context for use with an OpenGL window, and make it current.\n// (https://wiki.libsdl.org/SDL_GL_CreateContext)\nfunc (window *Window) GLCreateContext() (GLContext, error) {\n\tc := GLContext(C.SDL_GL_CreateContext(window.cptr()))\n\tif c == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn c, nil\n}\n\n// GLMakeCurrent sets up an OpenGL context for rendering into an OpenGL window.\n// (https://wiki.libsdl.org/SDL_GL_MakeCurrent)\nfunc (window *Window) GLMakeCurrent(glcontext GLContext) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_GL_MakeCurrent(window.cptr(), C.SDL_GLContext(glcontext))))\n}\n\n// GLSetSwapInterval sets the swap interval for the current OpenGL context.\n// (https://wiki.libsdl.org/SDL_GL_SetSwapInterval)\nfunc GLSetSwapInterval(interval int) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_GL_SetSwapInterval(C.int(interval))))\n}\n\n// GLGetSwapInterval returns the swap interval for the current OpenGL context.\n// (https://wiki.libsdl.org/SDL_GL_GetSwapInterval)\nfunc GLGetSwapInterval() (int, error) {\n\ti := int(C.SDL_GL_GetSwapInterval())\n\t// -1 means adaptive vsync, not an error\n\t// 0 means vsync off\n\t// 1 means vsync on\n\tif i == -1 || i == 0 || i == 1 {\n\t\treturn i, nil\n\t}\n\t// any other value should be an error\n\treturn i, errorFromInt(i)\n}\n\n// GLGetDrawableSize returns the size of a window's underlying drawable in pixels (for use with glViewport).\n// (https://wiki.libsdl.org/SDL_GL_GetDrawableSize)\nfunc (window *Window) GLGetDrawableSize() (w, h int32) {\n\tvar _w, _h C.int\n\tC.SDL_GL_GetDrawableSize(window.cptr(), &_w, &_h)\n\treturn int32(_w), int32(_h)\n}\n\n// GLSwap updates a window with OpenGL rendering.\n// (https://wiki.libsdl.org/SDL_GL_SwapWindow)\nfunc (window *Window) GLSwap() {\n\tC.SDL_GL_SwapWindow(window.cptr())\n}\n\n// GLDeleteContext deletes an OpenGL context.\n// (https://wiki.libsdl.org/SDL_GL_DeleteContext)\nfunc GLDeleteContext(context GLContext) {\n\tC.SDL_GL_DeleteContext(C.SDL_GLContext(context))\n}\n\n// Flash requests the window to demand attention from the user.\n// (https://wiki.libsdl.org/SDL_FlashWindow)\nfunc (window *Window) Flash(operation FlashOperation) (err error) {\n\treturn errorFromInt(int(C.SDL_FlashWindow(window.cptr(), C.SDL_FlashOperation(operation))))\n}\n\n// SetAlwaysOnTop sets the window to always be above the others.\n// (https://wiki.libsdl.org/SDL_SetWindowAlwaysOnTop)\nfunc (window *Window) SetAlwaysOnTop(onTop bool) {\n\tC.SDL_SetWindowAlwaysOnTop(window.cptr(), C.SDL_bool(Btoi(onTop)))\n}\n\n// SetKeyboardGrab sets a window's keyboard grab mode.\n// (https://wiki.libsdl.org/SDL_GetWindowKeyboardGrab)\nfunc (window *Window) SetKeyboardGrab(grabbed bool) {\n\tC.SDL_SetWindowKeyboardGrab(window.cptr(), C.SDL_bool(Btoi(grabbed)))\n}\n\n// GetICCProfile gets the raw ICC profile data for the screen the window is currently on.\n//\n// Data returned should be freed with SDL_free.\n//\n// (https://wiki.libsdl.org/SDL_GetWindowICCProfile)\nfunc (window *Window) GetICCProfile() (iccProfile unsafe.Pointer, size uintptr, err error) {\n\t_size := (*C.size_t)(unsafe.Pointer(&size))\n\ticcProfile = C.SDL_GetWindowICCProfile(window.cptr(), _size)\n\tif iccProfile == nil {\n\t\terr = GetError()\n\t}\n\treturn\n}\n\n// SetMouseRect confines the cursor to the specified area of a window.\n//\n// Note that this does NOT grab the cursor, it only defines the area a cursor\n// is restricted to when the window has mouse focus.\n//\n// (https://wiki.libsdl.org/SDL_SetWindowMouseRect)\nfunc (window *Window) SetMouseRect(rect Rect) (err error) {\n\t_rect := (*C.SDL_Rect)(unsafe.Pointer(&rect))\n\terr = errorFromInt(int(C.SDL_SetWindowMouseRect(window.cptr(), _rect)))\n\treturn\n}\n\n// GetMouseRect gets the mouse confinement rectangle of a window.\n// (https://wiki.libsdl.org/SDL_GetWindowMouseRect)\nfunc (window *Window) GetMouseRect() (rect Rect) {\n\t_rect := C.SDL_GetWindowMouseRect(window.cptr())\n\trect = *((*Rect)(unsafe.Pointer(_rect)))\n\treturn\n}\n"
  },
  {
    "path": "gccgo/vendor/github.com/veandco/go-sdl2/sdl/vulkan.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if (SDL_VERSION_ATLEAST(2,0,6))\n#if defined(_WIN32)\n\t#include <SDL2/SDL_vulkan.h>\n#else\n\t#include <SDL_vulkan.h>\n#endif\n#else //!SDL_VERSION_ATLEAST(2,0,6)\n\n#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object;\n#if defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)\n#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object;\n#else\n#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object;\n#endif\n\nVK_DEFINE_HANDLE(VkInstance)\nVK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR)\ntypedef VkInstance SDL_vulkanInstance;\ntypedef VkSurfaceKHR SDL_vulkanSurface;\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_Vulkan_LoadLibrary is not supported before SDL 2.0.6\")\n#endif\n\nstatic int SDL_Vulkan_LoadLibrary(const char *path)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_Vulkan_GetVkGetInstanceProcAddr is not supported before SDL 2.0.6\")\n#endif\n\nstatic void* SDL_Vulkan_GetVkGetInstanceProcAddr(void)\n{\n\treturn NULL;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_Vulkan_UnloadLibrary is not supported before SDL 2.0.6\")\n#endif\n\nstatic void SDL_Vulkan_UnloadLibrary(void) {}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_Vulkan_GetInstanceExtensions is not supported before SDL 2.0.6\")\n#endif\n\nstatic int SDL_Vulkan_GetInstanceExtensions(SDL_Window *window, unsigned int *pCount, const char **pNames)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_Vulkan_CreateSurface is not supported before SDL 2.0.6\")\n#endif\n\nstatic int SDL_Vulkan_CreateSurface(SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_Vulkan_GetDrawableSize is not supported before SDL 2.0.6\")\n#endif\n\nstatic void SDL_Vulkan_GetDrawableSize(SDL_Window *window, int *w, int *h) {\n\t*w = 0;\n\t*h = 0;\n}\n\n#endif\n*/\nimport \"C\"\nimport (\n\t\"errors\"\n\t\"reflect\"\n\t\"unsafe\"\n)\n\n// VulkanLoadLibrary dynamically loads a Vulkan loader library.\n// (https://wiki.libsdl.org/SDL_Vulkan_LoadLibrary)\nfunc VulkanLoadLibrary(path string) error {\n\tvar ret C.int\n\tif path == \"\" {\n\t\tret = C.SDL_Vulkan_LoadLibrary(nil)\n\t} else {\n\t\tcpath := C.CString(path)\n\t\tdefer C.free(unsafe.Pointer(cpath))\n\t\tret = C.SDL_Vulkan_LoadLibrary(cpath)\n\t}\n\tif int(ret) == -1 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// VulkanGetVkGetInstanceProcAddr gets the address of the vkGetInstanceProcAddr function.\n// (https://wiki.libsdl.org/SDL_Vulkan_GetVkInstanceProcAddr)\nfunc VulkanGetVkGetInstanceProcAddr() unsafe.Pointer {\n\treturn C.SDL_Vulkan_GetVkGetInstanceProcAddr()\n}\n\n// VulkanUnloadLibrary unloads the Vulkan loader library previously loaded by VulkanLoadLibrary().\n// (https://wiki.libsdl.org/SDL_Vulkan_UnloadLibrary)\nfunc VulkanUnloadLibrary() {\n\tC.SDL_Vulkan_UnloadLibrary()\n}\n\n// VulkanGetInstanceExtensions gets the names of the Vulkan instance extensions needed to create a surface with VulkanCreateSurface().\n// (https://wiki.libsdl.org/SDL_Vulkan_GetInstanceExtensions)\nfunc (window *Window) VulkanGetInstanceExtensions() []string {\n\tvar count C.uint\n\tC.SDL_Vulkan_GetInstanceExtensions(window.cptr(), &count, nil)\n\tif count == 0 {\n\t\treturn nil\n\t}\n\n\tstrptrs := make([]*C.char, uint(count))\n\tC.SDL_Vulkan_GetInstanceExtensions(window.cptr(), &count, &strptrs[0])\n\textensions := make([]string, uint(count))\n\tfor i := range strptrs {\n\t\textensions[i] = C.GoString(strptrs[i])\n\t}\n\treturn extensions\n}\n\n// VulkanCreateSurface creates a Vulkan rendering surface for a window.\n// (https://wiki.libsdl.org/SDL_Vulkan_CreateSurface)\nfunc (window *Window) VulkanCreateSurface(instance interface{}) (surface unsafe.Pointer, err error) {\n\tif instance == nil {\n\t\treturn nil, errors.New(\"vulkan: instance is nil\")\n\t}\n\tval := reflect.ValueOf(instance)\n\tif val.Kind() != reflect.Ptr {\n\t\treturn nil, errors.New(\"vulkan: instance is not a VkInstance (expected kind Ptr, got \" + val.Kind().String() + \")\")\n\t}\n\tvar vulkanSurface C.VkSurfaceKHR\n\tif C.SDL_Vulkan_CreateSurface(window.cptr(),\n\t\t(C.VkInstance)(unsafe.Pointer(val.Pointer())),\n\t\t(*C.VkSurfaceKHR)(unsafe.Pointer(&vulkanSurface))) == C.SDL_FALSE {\n\n\t\treturn nil, GetError()\n\t}\n\treturn unsafe.Pointer(&vulkanSurface), nil\n}\n\n// VulkanGetDrawableSize gets the size of a window's underlying drawable in pixels (for use with setting viewport, scissor & etc).\n// (https://wiki.libsdl.org/SDL_Vulkan_GetDrawableSize)\nfunc (window *Window) VulkanGetDrawableSize() (w, h int32) {\n\tvar _w, _h C.int\n\tC.SDL_Vulkan_GetDrawableSize(window.cptr(), &_w, &_h)\n\treturn int32(_w), int32(_h)\n}\n"
  },
  {
    "path": "gccgo/vendor/modules.txt",
    "content": "# github.com/veandco/go-sdl2 v0.4.36\n## explicit; go 1.15\ngithub.com/veandco/go-sdl2/_libs\ngithub.com/veandco/go-sdl2/img\ngithub.com/veandco/go-sdl2/sdl\n"
  },
  {
    "path": "go/Makefile",
    "content": ".PHONY: all msg clean fullclean\n\nall: msg go\n\nmsg:\n\t@echo '--- Go ---'\n\ngo: main.go\n\tgo build -mod=vendor -v\n\nrun: msg go\n\ttime ./go\n\ngorun: main.go\n\tgo run main.go\n\nclean:\n\tgo clean\n\nfullclean: clean\n"
  },
  {
    "path": "go/README.md",
    "content": "SDL2 and Go\n===========\n\nRequirements\n------------\n\n* The SDL2 library and headers.\n* The latest version of Go.\n* The sdl2 package: `go get github.com/veandco/go-sdl2/sdl`\n\nAn alternative way of fetching the needed dependencies is: `go get -d -t -v`\n\nFor OS X, remember to install the Development Libraries (place the SDL2 framework in `/Library/Frameworks`)\n\nBuilding\n--------\n\n    go build\n \nRunning\n-------\n\n    ./go\n\n"
  },
  {
    "path": "go/go.mod",
    "content": "module github.com/xyproto/sdl2-examples/go\n\ngo 1.18\n\nrequire github.com/veandco/go-sdl2 v0.4.36\n"
  },
  {
    "path": "go/go.sum",
    "content": "github.com/veandco/go-sdl2 v0.4.36 h1:Ltydev536rRQodmIrTWFZ3dRp5A+/6t5CYvbi4Kvia0=\ngithub.com/veandco/go-sdl2 v0.4.36/go.mod h1:OROqMhHD43nT4/i9crJukyVecjPNYYuCofep6SNiAjY=\n"
  },
  {
    "path": "go/main.go",
    "content": "package main\n\nimport (\n\t\"log\"\n\t\"path/filepath\"\n\n\t\"github.com/veandco/go-sdl2/img\"\n\t\"github.com/veandco/go-sdl2/sdl\"\n)\n\nfunc main() {\n\t// Initialize\n\tif err := sdl.Init(sdl.INIT_EVERYTHING); err != nil {\n\t\tlog.Fatalln(\"Init Error:\", err)\n\t}\n\t// Make sure to quit when the function returns\n\tdefer sdl.Quit()\n\n\t// Create the window\n\twin, err := sdl.CreateWindow(\"Hello World!\", 100, 100, 620, 387, sdl.WINDOW_SHOWN)\n\tif err != nil {\n\t\tlog.Fatalln(\"CreateWindow Error:\", err)\n\t}\n\tdefer win.Destroy()\n\n\t// Create a renderer\n\tren, err := sdl.CreateRenderer(win, -1, sdl.RENDERER_ACCELERATED|sdl.RENDERER_PRESENTVSYNC)\n\tif err != nil {\n\t\tlog.Fatalln(\"CreateRenderer Error:\", err)\n\t}\n\tdefer ren.Destroy()\n\n\t// Load the image as a texture\n\ttex, err := img.LoadTexture(ren, filepath.Join(\"..\", \"img\", \"grumpy-cat.png\"))\n\tif err != nil {\n\t\tlog.Fatalln(\"LoadTexture Error:\", err)\n\t}\n\tdefer tex.Destroy()\n\n\tfor i := 0; i < 20; i++ {\n\t\t// Clear the renderer and display the image/texture\n\t\tren.Clear()\n\t\tren.Copy(tex, nil, nil)\n\t\tren.Present()\n\n\t\t// Wait 100 ms\n\t\tsdl.Delay(100)\n\t}\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/CONTRIBUTORS.md",
    "content": "Contributors\n============\nHere's the list of contributors with their respective Github URLs.\n* [Jacky Boen](https://github.com/jackyb)\n* [HardWareGuy](https://github.com/HardWareGuy)\n* [akovaski](https://github.com/akovaski)\n* [Jeromy Johnson](https://github.com/whyrusleeping)\n* [Cai Lei](https://github.com/ccll)\n* [Arne Döring](https://github.com/krux02)\n* [Marcus von Appen](https://github.com/marcusva)\n* [Tom Murray](https://github.com/TomMurray)\n* [Ian Davis](https://github.com/iand)\n* [hschendel](https://github.com/hschendel)\n* [Ingo Oeser](https://github.com/nightlyone)\n* [nlordell](https://github.com/nlordell)\n* [Ben Davies](https://github.com/JalfResi)\n* [Bastien Dejean](https://github.com/baskerville)\n* [Pirmin Tapken](https://github.com/PirminTapken)\n* [Robert Lillack](https://github.com/roblillack)\n* [Marcell Jusztin](https://github.com/morcmarc)\n* [Stan Schwertly](https://github.com/Stantheman)\n* [Michael Vetter](https://github.com/jubalh)\n* [Tom Fogal](https://github.com/tfogal)\n* [Philipp Meinen](https://github.com/PhiCode)\n* [Thomas McGrew](https://github.com/mcgrew)\n* [Geoff Catlin](https://github.com/gcatlin)\n* [Schobers](https://github.com/Schobers)\n* [Jan Tuitman](https://github.com/jantuitman)\n* [Nick Powell](https://github.com/THUNDERGROOVE)\n* [Steven R. Wiley](https://github.com/srwiley)\n* [Franco Lazzarino](https://github.com/flazz)\n* [Jason Alan Palmer](https://github.com/jalan)\n* [Seuk Won Kang](https://github.com/kasworld)\n* [Brandon Mulcahy](https://github.com/jangler)\n* [Tim Anema](https://github.com/tanema)\n* [Tyler Compton](https://github.com/velovix)\n* [Nicolas Hess](https://github.com/n0dev)\n* [Stephen Noonan](https://github.com/tycho)\n* [Guilherme Freitas Nemeth](https://github.com/glhrmfrts)\n* [Charney Kaye](https://github.com/charneykaye)\n* [Lars Scheme](https://github.com/gonutz)\n* [Emil Laine](https://github.com/emlai)\n* [Sergey Parshukov](https://github.com/jBugman)\n* [Casey DeLorme](https://github.com/cdelorme)\n* [Andreas T. Jonsson](https://github.com/andreas-jonsson)\n* [Milan Nikolic](https://github.com/gen2brain)\n* [Mike Gerow](https://github.com/gerow)\n* [Lilis Iskandar](https://github.com/veeableful)\n* [tfriedel6](https://github.com/tfriedel6)\n* [Eric Bronner](https://github.com/MoonWatcher582)\n* [Julien Castelain](https://github.com/julien)\n* [Robert Wallis](https://github.com/robert-wallis)\n* [Chae-Young Song](https://github.com/chaeyoungsong)\n* [Robert Wallis](https://github.com/robert-wallis)\n* [Lennart Buhl](https://github.com/r41d)\n* [Giovanni Bajo](https://github.com/rasky)\n* [Laurent Vaucher](https://github.com/slowfrog)\n* [Mike](https://github.com/barbeque)\n* [Tomas Virgl](https://github.com/tvi)\n* [Aye Aye Maung](https://github.com/ZeroXLR)\n* [Anton Malashin](https://github.com/malashin)\n* [John Perkins](https://github.com/mpath)\n* [jclc](https://github.com/jclc)\n* [flga](https://github.com/flga)\n\n_if anyone is missing, let me know!.. or you can add yourself in :)_\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/LICENSE",
    "content": "Copyright (c) 2013, Go-SDL2 Authors\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n\t* Redistributions of source code must retain the above copyright notice,\nthis list of conditions and the following disclaimer.\n\t* Redistributions in binary form must reproduce the above copyright\nnotice, this list of conditions and the following disclaimer in the\ndocumentation and/or other materials provided with the distribution.\n\t* Neither the name of Go-SDL2 nor the names of its contributors may be\nused to endorse or promote products derived from this software without specific\nprior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/_libs/dummy.go",
    "content": "package dummy\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/img/sdl_image.go",
    "content": "// Package img is a simple library to load images of various formats as SDL surfaces.\npackage img\n\n//#include <stdlib.h>\n//#include \"sdl_image_wrapper.h\"\nimport \"C\"\nimport \"unsafe\"\nimport \"errors\"\nimport \"github.com/veandco/go-sdl2/sdl\"\n\n// Flags which may be passed to img.Init() to load support of image formats, can be bitwise OR'd together.\nconst (\n\tINIT_JPG  = 0x00000001 // JPG\n\tINIT_PNG  = 0x00000002 // PNG\n\tINIT_TIF  = 0x00000004 // TIF\n\tINIT_WEBP = 0x00000008 // WebP\n)\n\n// LinkedVersion returns the version of the dynamically linked SDL_image library.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_7.html)\nfunc LinkedVersion() *sdl.Version {\n\treturn (*sdl.Version)(unsafe.Pointer(C.IMG_Linked_Version()))\n}\n\n// Init loads dynamic libraries and prepares them for use. Flags should be one or more flags from IMG_InitFlags OR'd together. It returns the flags successfully initialized, or 0 on failure.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_8.html)\nfunc Init(flags int) error {\n\t_flags := (C.int)(flags)\n\tret := int(C.IMG_Init(_flags))\n\tif ret == 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Quit unloads libraries loaded with img.Init().\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_9.html)\nfunc Quit() {\n\tC.IMG_Quit()\n}\n\n// GetError returns the last error that occurred, or an empty string if there hasn't been an error message set since the last call to sdl.ClearError().\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_45.html)\nfunc GetError() error {\n\te := C.IMG_GetError()\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn errors.New(C.GoString(e))\n}\n\n// LoadTypedRW loads an image from an SDL data source. The 'type' may be one of: \"BMP\", \"GIF\", \"PNG\", etc. If the image format supports a transparent pixel, SDL will set the colorkey for the surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_13.html)\nfunc LoadTypedRW(src *sdl.RWops, freesrc bool, type_ string) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_freesrc := (C.int)(sdl.Btoi(freesrc))\n\t_type := C.CString(type_)\n\tdefer C.free(unsafe.Pointer(_type))\n\t_surface := C.IMG_LoadTyped_RW(_src, _freesrc, _type)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// Load loads a file for use as an image in a new surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_11.html)\nfunc Load(file string) (*sdl.Surface, error) {\n\t_file := C.CString(file)\n\tdefer C.free(unsafe.Pointer(_file))\n\t_surface := C.IMG_Load(_file)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadRW loads an image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_12.html)\nfunc LoadRW(src *sdl.RWops, freesrc bool) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_freesrc := (C.int)(sdl.Btoi(freesrc))\n\t_surface := C.IMG_Load_RW(_src, _freesrc)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadTexture loads an image directly into a render texture.\nfunc LoadTexture(renderer *sdl.Renderer, file string) (*sdl.Texture, error) {\n\t_renderer := (*C.SDL_Renderer)(unsafe.Pointer(renderer))\n\t_file := C.CString(file)\n\tdefer C.free(unsafe.Pointer(_file))\n\t_surface := C.IMG_LoadTexture(_renderer, _file)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Texture)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadTextureRW loads an image from an SDL data source directly into a render texture.\nfunc LoadTextureRW(renderer *sdl.Renderer, src *sdl.RWops, freesrc bool) (*sdl.Texture, error) {\n\t_renderer := (*C.SDL_Renderer)(unsafe.Pointer(renderer))\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_freesrc := (C.int)(sdl.Btoi(freesrc))\n\t_surface := C.IMG_LoadTexture_RW(_renderer, _src, _freesrc)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Texture)(unsafe.Pointer(_surface)), nil\n}\n\n// IsICO reports whether ICO format is supported and image data is readable as an ICO.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_31.html)\nfunc IsICO(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isICO(_src)) > 0\n}\n\n// IsCUR reports whether CUR format is supported and image data is readable as a CUR.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_30.html)\nfunc IsCUR(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isCUR(_src)) > 0\n}\n\n// IsBMP reports whether BMP format is supported and image data is readable as a BMP.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_32.html)\nfunc IsBMP(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isBMP(_src)) > 0\n}\n\n// IsGIF reports whether GIF format is supported and image data is readable as a GIF.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_37.html)\nfunc IsGIF(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isGIF(_src)) > 0\n}\n\n// IsJPG reports whether JPG format is supported and image data is readable as a JPG.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_38.html)\nfunc IsJPG(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isJPG(_src)) > 0\n}\n\n// IsLBM reports whether LBM format is supported and image data is readable as an LBM.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_41.html)\nfunc IsLBM(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isLBM(_src)) > 0\n}\n\n// IsPCX reports whether PCX format is supported and image data is readable as a PCX.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_36.html)\nfunc IsPCX(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isPCX(_src)) > 0\n}\n\n// IsPNG reports whether PNG format is supported and image data is readable as a PNG.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_40.html)\nfunc IsPNG(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isPNG(_src)) > 0\n}\n\n// IsPNM reports whether PNM format is supported and image data is readable as a PNM.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_33.html)\nfunc IsPNM(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isPNM(_src)) > 0\n}\n\n// IsTIF reports whether TIF format is supported and image data is readable as a TIF.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_39.html)\nfunc IsTIF(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isTIF(_src)) > 0\n}\n\n// IsXCF reports whether XCF format is supported and image data is readable as an XCF.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_35.html)\nfunc IsXCF(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isXCF(_src)) > 0\n}\n\n// IsXPM reports whether XPM format is supported and image data is readable as an XPM.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_34.html)\nfunc IsXPM(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isXPM(_src)) > 0\n}\n\n// IsXV reports whether XV format is supported and image data is readable as an XV thumbnail.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_42.html)\nfunc IsXV(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isXV(_src)) > 0\n}\n\n// IsWEBP reports whether WEBP format is supported and image data is readable as a WEBP.\nfunc IsWEBP(src *sdl.RWops) bool {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\treturn int(C.IMG_isWEBP(_src)) > 0\n}\n\n// LoadICORW loads an ICO image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_15.html)\nfunc LoadICORW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadICO_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadCURRW loads a CUR image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_14.html)\nfunc LoadCURRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadCUR_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadBMPRW loads a BMP image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_16.html)\nfunc LoadBMPRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadBMP_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadGIFRW loads a GIF image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_21.html)\nfunc LoadGIFRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadGIF_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadJPGRW loads a JPG image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_22.html)\nfunc LoadJPGRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadJPG_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadLBMRW loads an LBM image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_26.html)\nfunc LoadLBMRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadLBM_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadPCXRW loads a PCX image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_20.html)\nfunc LoadPCXRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadPCX_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadPNGRW loads a PNG image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_24.html)\nfunc LoadPNGRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadPNG_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadPNMRW loads a PNM image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_17.html)\nfunc LoadPNMRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadPNM_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadTGARW loads a TGA image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_25.html)\nfunc LoadTGARW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadTGA_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadTIFRW loads a TIF image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_23.html)\nfunc LoadTIFRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadTIF_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadXCFRW loads an XCF image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_19.html)\nfunc LoadXCFRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadXCF_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadXPMRW loads an XPM image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_18.html)\nfunc LoadXPMRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadXPM_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadXVRW loads an XV thumbnail image from an SDL data source for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_27.html)\nfunc LoadXVRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadXV_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// LoadWEBPRW loads a WEBP image from an SDL data source for use as a surface.\nfunc LoadWEBPRW(src *sdl.RWops) (*sdl.Surface, error) {\n\t_src := (*C.SDL_RWops)(unsafe.Pointer(src))\n\t_surface := C.IMG_LoadWEBP_RW(_src)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// ReadXPMFromArray loads an XPM image from xpm data for use as a surface.\n// (http://www.libsdl.org/projects/SDL_image/docs/SDL_image_28.html)\nfunc ReadXPMFromArray(xpm string) (*sdl.Surface, error) {\n\t_xpm := C.CString(xpm)\n\tdefer C.free(unsafe.Pointer(_xpm))\n\t_surface := C.IMG_ReadXPMFromArray(&_xpm)\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*sdl.Surface)(unsafe.Pointer(_surface)), nil\n}\n\n// SavePNG saves a surface as PNG file.\nfunc SavePNG(surface *sdl.Surface, file string) error {\n\t_surface := (*C.SDL_Surface)(unsafe.Pointer(surface))\n\t_file := C.CString(file)\n\tdefer C.free(unsafe.Pointer(_file))\n\t_ret := C.IMG_SavePNG(_surface, _file)\n\tif _ret < 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// SavePNGRW saves a surface to an SDL data source.\nfunc SavePNGRW(surface *sdl.Surface, dst *sdl.RWops, freedst int) error {\n\t_surface := (*C.SDL_Surface)(unsafe.Pointer(surface))\n\t_dst := (*C.SDL_RWops)(unsafe.Pointer(dst))\n\t_freedst := (C.int)(freedst)\n\t_ret := C.IMG_SavePNG_RW(_surface, _dst, _freedst)\n\tif _ret < 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/img/sdl_image_cgo.go",
    "content": "// +build !static\n\npackage img\n\n//#cgo linux freebsd darwin pkg-config: sdl2\n//#cgo linux freebsd darwin LDFLAGS: -lSDL2_image\n//#cgo windows LDFLAGS: -lSDL2 -lSDL2_image\nimport \"C\"\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/img/sdl_image_cgo_static.go",
    "content": "// +build static\n\npackage img\n\n//#cgo CFLAGS: -I${SRCDIR}/../_libs/include -I${SRCDIR}/../_libs/include/SDL2\n//#cgo LDFLAGS: -L${SRCDIR}/../_libs\n//#cgo linux,386 LDFLAGS: -lSDL2_image_linux_386 -Wl,--no-undefined -lpng_linux_386 -ljpeg_linux_386 -lSDL2_linux_386 -lm -ldl -lz -lasound -lm -ldl -lpthread -lX11 -lXext -lXcursor -lXinerama -lXi -lXrandr -lXss -lXxf86vm -lpthread -lrt\n//#cgo linux,amd64 LDFLAGS: -lSDL2_image_linux_amd64 -Wl,--no-undefined -lpng_linux_amd64 -ljpeg_linux_amd64 -lSDL2_linux_amd64 -lm -ldl -lz -lasound -lm -ldl -lpthread -lX11 -lXext -lXcursor -lXinerama -lXi -lXrandr -lXss -lXxf86vm -lpthread -lrt\n//#cgo windows,386 LDFLAGS: -lSDL2_image_windows_386 -Wl,--no-undefined -lpng_windows_386 -ljpeg_windows_386 -lz_windows_386 -lSDL2_windows_386 -lSDL2main_windows_386 -Wl,--no-undefined -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -lsetupapi -static-libgcc\n//#cgo windows,amd64 LDFLAGS: -lSDL2_image_windows_amd64 -Wl,--no-undefined -lpng_windows_amd64 -ljpeg_windows_amd64 -lz_windows_amd64 -lSDL2_windows_amd64 -lSDL2main_windows_amd64 -Wl,--no-undefined -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -lsetupapi -static-libgcc\n//#cgo darwin,amd64 LDFLAGS: -lSDL2_image_darwin_amd64 -lSDL2_darwin_amd64 -lpng_darwin_amd64 -ljpeg_darwin_amd64 -lm -lz -liconv -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,ForceFeedback -lobjc -Wl,-framework,CoreVideo -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,IOKit -Wl,-framework,Metal\n//#cgo darwin,arm64 LDFLAGS: -lSDL2_image_darwin_arm64 -lSDL2_darwin_arm64 -lpng_darwin_arm64 -ljpeg_darwin_arm64 -lm -lz -liconv -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,ForceFeedback -lobjc -Wl,-framework,CoreVideo -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,IOKit -Wl,-framework,Metal\n//#cgo android,arm LDFLAGS: -lSDL2_image_android_arm -Wl,--no-undefined -lpng_android_arm -ljpeg_android_arm -lSDL2_android_arm -lm -ldl -lz -llog -landroid -lGLESv2 -lGLESv1_CM\n//#cgo linux,arm,!android LDFLAGS: -L/opt/vc/lib -L/opt/vc/lib64 -lSDL2_image_linux_arm -Wl,--no-undefined -lpng_linux_arm -ljpeg_linux_arm -lSDL2_linux_arm -lm -ldl -lz -liconv -lbcm_host -lvcos -lvchiq_arm -pthread\nimport \"C\"\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/img/sdl_image_wrapper.h",
    "content": "#if defined(__WIN32)\n\t#include <SDL2/SDL_image.h>\n\t#include <stdlib.h>\n#else\n\t#include <SDL_image.h>\n#endif\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/TODO.md",
    "content": "## 2.0.16\n\n[x] SDL_FlashWindow() to get a user’s attention\n[x] SDL_GetAudioDeviceSpec() to get the preferred audio format of a device\n[x] SDL_SetWindowAlwaysOnTop() to dynamically change the SDL_WINDOW_ALWAYS_ON_TOP flag for a window\n[x] SDL_SetWindowKeyboardGrab() to support grabbing the keyboard independently of the mouse\n[x] SDL_SoftStretchLinear() to do bilinear scaling between 32-bit software surfaces\n[x] SDL_UpdateNVTexture() to update streaming NV12/21 textures\n[x] SDL_GameControllerSendEffect() and SDL_JoystickSendEffect() to allow sending custom trigger effects to the DualSense controller\n[x] SDL_GameControllerGetSensorDataRate() to get the sensor data rate for PlayStation and Nintendo Switch controllers\n\n### Windows\n\n[?] SDL_SetWindowsMessageHook() to set a function that is called for all Windows messages\n[?] SDL_RenderGetD3D11Device() to get the D3D11 device used by the SDL renderer\n\n### Linux\n\n[x] SDL_HINT_AUDIO_INCLUDE_MONITORS to control whether PulseAudio recording should include monitor devices\n[x] SDL_HINT_AUDIO_DEVICE_STREAM_ROLE to describe the role of your application for audio control panels\n\n### Android:\n\n[?] SDL_AndroidShowToast() to show a lightweight notification\n\n## 2.0.14\n\n[x] SDL_GameControllerGetSerial()\n[x] SDL_GameControllerHasAxis()\n[x] SDL_GameControllerHasButton()\n[x] SDL_GameControllerGetNumTouchpads()\n[x] SDL_GameControllerGetNumTouchpadFingers()\n[x] SDL_GameControllerGetTouchpadFinger()\n[x] SDL_GameControllerHasSensor()\n[x] SDL_GameControllerSetSensorEnabled()\n[x] SDL_GameControllerIsSensorEnabled()\n[x] SDL_GameControllerGetSensorData\n[x] SDL_GameControllerRumbleTriggers()\n[x] SDL_GameControllerHasLED()\n[x] SDL_GameControllerSetLED()\n[x] SDL_JoystickGetSerial()\n[x] SDL_JoystickRumbleTriggers()\n[x] SDL_JoystickHasLED()\n[x] SDL_JoystickSetLED()\n[x] SDL_JoystickAttachVirtual()\n[x] SDL_JoystickDetachVirtual()\n[x] SDL_JoystickIsVirtual()\n[x] SDL_JoystickSetVirtualAxis()\n[x] SDL_JoystickSetVirtualButton()\n[x] SDL_JoystickSetVirtualHat()\n[x] SDL_LockSensors()\n[x] SDL_UnlockSensors()\n[x] SDL_HAPTIC_STEERING_AXIS\n[x] SDL_GetPreferredLocales()\n[x] SDL_OpenURL()\n[x] SDL_HasSurfaceRLE()\n[x] SDL_SIMDRealloc()\n[x] SDL_GetErrorMsg()\n[x] SDL_Metal_GetLayer()\n[x] SDL_Metal_GetDrawableSize()\n[x] SDL_HINT_JOYSTICK_HIDAPI_PS5\n[x] SDL_HINT_MOUSE_RELATIVE_SCALING\n[x] SDL_HINT_PREFERRED_LOCALES\n[x] SDL_HINT_JOYSTICK_RAWINPUT\n[x] SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT\n[x] SDL_HINT_AUDIO_DEVICE_APP_NAME\n[x] SDL_HINT_AUDIO_DEVICE_STREAM_NAME\n[x] SDL_HINT_LINUX_JOYSTICK_DEADZONES\n[x] SDL_HINT_THREAD_PRIORITY_POLICY\n[x] SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL\n[x] SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO\n[x] SDL_HINT_EMSCRIPTEN_ASYNCIFY\n[x] SDL_PIXELFORMAT_XRGB4444\n[x] SDL_PIXELFORMAT_XBGR4444\n[x] SDL_PIXELFORMAT_XRGB1555\n[x] SDL_PIXELFORMAT_XBGR1555\n[x] SDL_PIXELFORMAT_XRGB8888\n[x] SDL_PIXELFORMAT_XBGR8888\n[x] SDL_WINDOW_METAL\n[x] SDL_AndroidRequestPermission()\n\n## 2.0.12\n\n[x] SDL_GameControllerTypeForIndex\n[x] SDL_GameControllerGetType\n[x] SDL_GameControllerFromPlayerIndex\n[x] SDL_GameControllerSetPlayerIndex\n[x] SDL_JoystickFromPlayerIndex\n[x] SDL_JoystickSetPlayerIndex\n[x] SDL_GetTextureScaleMode\n[x] SDL_SetTextureScaleMode\n[x] SDL_LockTextureToSurface\n[x] SDL_BLENDMODE_MUL\n[x] SDL_TouchFingerEvent update\n[x] SDL_HasARMSIMD\n[x] SDL_HINT_DISPLAY_USABLE_BOUNDS\n[x] SDL_HINT_GAMECONTROLLERTYPE\n[x] SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS\n[x] SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE\n[x] SDL_HINT_VIDEO_X11_WINDOW_VISUALID\n[x] SDL_HINT_VIDEO_X11_FORCE_EGL\n[x] SDL_Metal_CreateView\n[x] SDL_Metal_DestroyView\n[x] SDL_GetAndroidSDKVersion\n\n## 2.0.10\n\n[x] SDL_SIMDGetAlignment\n[x] SDL_SIMDAlloc\n[x] SDL_SIMDFree\n[x] SDL_RenderDrawPointF\n[x] SDL_RenderDrawPointsF\n[x] SDL_RenderDrawLineF\n[x] SDL_RenderDrawLinesF\n[x] SDL_RenderDrawRectF\n[x] SDL_RenderDrawRectsF\n[x] SDL_RenderFillRectF\n[x] SDL_RenderFillRectsF\n[x] SDL_RenderCopyF\n[x] SDL_RenderCopyExF\n[x] SDL_GetTouchDeviceType\n[x] SDL_RenderFlush\n[x] SDL_HINT_RENDER_BATCHING\n[x] SDL_HINT_EVENT_LOGGING\n[x] SDL_HINT_GAMECONTROLLERCONFIG_FILE\n[x] SDL_HINT_MOUSE_TOUCH_EVENTS\n\n## 2.0.9\n\n[x] SDL_SENSORUPDATE\n[x] SDL_DISPLAYEVENT\n[x] SDL_JoystickGetDevicePlayerIndex\n[x] SDL_JoystickGetPlayerIndex\n[x] SDL_GameControllerGetPlayerIndex\n[x] SDL_GameControllerRumble\n[x] SDL_JoystickRumble\n[x] SDL_GameControllerMappingForDeviceIndex\n[x] SDL_HINT_MOUSE_DOUBLE_CLICK_TIME\n[x] SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS\n[x] SDL_HasColorKey\n[x] SDL_HasAVX512F\n[x] SDL_IsTablet\n[?] SDL_THREAD_PRIORITY_TIME_CRITICAL\n\n## 2.0.8\n\n### Hints\n\n[x] SDL_HINT_IOS_HIDE_HOME_INDICATOR\n[x] SDL_HINT_RETURN_KEY_HIDES_IME\n[x] SDL_HINT_TV_REMOTE_AS_JOYSTICK\n[x] SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR\n[x] SDL_HINT_VIDEO_DOUBLE_BUFFER\n\n### Surface\n\n[x] SDL_SetYUVConversionMode()\n[x] SDL_GetYUVConversionMode()\n\n### Android\n\n[x] SDL_IsAndroidTV()\n\n### Mac OS X / iOS / tvOS\n\n[x] SDL_RenderGetMetalLayer()\n[x] SDL_RenderGetMetalCommandEncoder()\n\n### Windows UWP\n\n[ ] SDL_WinRTGetDeviceFamily()\n\n## 2.0.7\n\n### General\n\nAudio\n\n- [x] SDL_NewAudioStream()\n- [x] SDL_AudioStreamPut()\n- [x] SDL_AudioStreamGet()\n- [x] SDL_AudioStreamAvailable()\n- [x] SDL_AudioStreamFlush()\n- [x] SDL_AudioStreamClear()\n- [x] SDL_FreeAudioStream()\n\nJoystick\n\n- [x] SDL_LockJoysticks()\n- [x] SDL_UnlockJoysticks()\n\nStdinc\n\n- [ ] SDL_GetMemoryFunctions()\n- [ ] SDL_SetMemoryFunctions()\n- [ ] SDL_GetNumAllocations()\n\n## 2.0.6\n\n### General\n\nBlend Mode\n\n- [x] SDL_ComposeCustomBlendMode()\n\nCPU Info\n\n- [x] SDL_HasNEON()\n\nGame Controller\n\n- [x] SDL_GameControllerGetVendor()\n- [x] SDL_GameControllerGetProduct()\n- [x] SDL_GameControllerGetProductVersion()\n- [x] SDL_GameControllerNumMappings()\n- [x] SDL_GameControllerMappingForIndex()\n\nHints\n\n- [x] SDL_HINT_AUDIO_RESAMPLING_MODE\n- [x] SDL_HINT_RENDER_LOGICAL_SIZE_MODE\n- [x] SDL_HINT_MOUSE_NORMAL_SPEED_SCALE\n- [x] SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE\n- [x] SDL_HINT_TOUCH_MOUSE_EVENTS\n\nJoystick\n\n- [x] SDL_JoystickGetDeviceVendor()\n- [x] SDL_JoystickGetDeviceProduct()\n- [x] SDL_JoystickGetDeviceProductVersion()\n- [x] SDL_JoystickGetDeviceType()\n- [x] SDL_JoystickGetDeviceInstanceID()\n- [x] SDL_JoystickGetVendor()\n- [x] SDL_JoystickGetProduct()\n- [x] SDL_JoystickGetProductVersion()\n- [x] SDL_JoystickGetType()\n- [x] SDL_JoystickGetAxisInitialState()\n\nRW Ops\n\n- [x] SDL_LoadFile()\n- [x] SDL_LoadFile_RW()\n\nSurface\n\n- [x] SDL_DuplicateSurface()\n\nVulkan\n\n- [x] SDL_Vulkan_LoadLibrary()\n- [x] SDL_Vulkan_GetVkGetInstanceProcAddr()\n- [x] SDL_Vulkan_GetInstanceExtensions()\n- [x] SDL_Vulkan_CreateSurface()\n- [x] SDL_Vulkan_GetDrawableSize()\n- [x] SDL_Vulkan_UnloadLibrary()\n\n### Windows\n\nHints\n\n- [x] SDL_HINT_WINDOWS_INTRESOURCE_ICON\n- [x] SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL\n\n## Miscellaneous\n\n- [ ] Add ability to set window title bar color on runtime\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/audio.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,4))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_QueueAudio is not supported before SDL 2.0.4\")\n#endif\n\nstatic int SDL_QueueAudio(SDL_AudioDeviceID dev, const void *data, Uint32 len)\n{\n\treturn -1;\n}\nstatic Uint32 SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev_id)\n{\n\treturn 0;\n}\nstatic void SDL_ClearQueuedAudio(SDL_AudioDeviceID dev)\n{\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,5))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_DequeueAudio is not supported before SDL 2.0.5\")\n#endif\n\nstatic int SDL_DequeueAudio(SDL_AudioDeviceID dev, const void *data, Uint32 len)\n{\n\treturn -1;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,7))\n\nstruct _SDL_AudioStream;\ntypedef struct _SDL_AudioStream SDL_AudioStream;\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_NewAudioStream is not supported before SDL 2.0.7\")\n#endif\n\nstatic SDL_AudioStream * SDL_NewAudioStream(const SDL_AudioFormat src_format, const Uint8 src_channels, const int src_rate, const SDL_AudioFormat dst_format, const Uint8 dst_channels, const int dst_rate)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_AudioStreamPut is not supported before SDL 2.0.7\")\n#endif\n\nstatic int SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_AudioStreamGet is not supported before SDL 2.0.7\")\n#endif\n\nstatic int SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_AudioStreamAvailable is not supported before SDL 2.0.7\")\n#endif\n\nstatic int SDL_AudioStreamAvailable(SDL_AudioStream *stream)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_AudioStreamFlush is not supported before SDL 2.0.7\")\n#endif\n\nstatic int SDL_AudioStreamFlush(SDL_AudioStream *stream)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_AudioStreamClear is not supported before SDL 2.0.7\")\n#endif\n\nstatic int SDL_AudioStreamClear(SDL_AudioStream *stream)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_FreeAudioStream is not supported before SDL 2.0.7\")\n#endif\n\nstatic void SDL_FreeAudioStream(SDL_AudioStream *stream)\n{\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,16))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetAudioDeviceSpec is not supported before SDL 2.0.16\")\n#endif\n\nstatic int SDL_GetAudioDeviceSpec(int index, int iscapture, SDL_AudioSpec *spec)\n{\n\treturn -1;\n}\n\n\n#endif\n*/\nimport \"C\"\nimport (\n\t\"reflect\"\n\t\"unsafe\"\n)\n\n// Audio format masks.\n// (https://wiki.libsdl.org/SDL_AudioFormat)\nconst (\n\tAUDIO_MASK_BITSIZE  = C.SDL_AUDIO_MASK_BITSIZE  // (0xFF)\n\tAUDIO_MASK_DATATYPE = C.SDL_AUDIO_MASK_DATATYPE // (1<<8)\n\tAUDIO_MASK_ENDIAN   = C.SDL_AUDIO_MASK_ENDIAN   // (1<<12)\n\tAUDIO_MASK_SIGNED   = C.SDL_AUDIO_MASK_SIGNED   // (1<<15)\n)\n\n// Audio format values.\n// (https://wiki.libsdl.org/SDL_AudioFormat)\nconst (\n\tAUDIO_S8 = C.AUDIO_S8 // signed 8-bit samples\n\tAUDIO_U8 = C.AUDIO_U8 // unsigned 8-bit samples\n\n\tAUDIO_S16LSB = C.AUDIO_S16LSB // signed 16-bit samples in little-endian byte order\n\tAUDIO_S16MSB = C.AUDIO_S16MSB // signed 16-bit samples in big-endian byte order\n\tAUDIO_S16SYS = C.AUDIO_S16SYS // signed 16-bit samples in native byte order\n\tAUDIO_S16    = C.AUDIO_S16    // AUDIO_S16LSB\n\tAUDIO_U16LSB = C.AUDIO_U16LSB // unsigned 16-bit samples in little-endian byte order\n\tAUDIO_U16MSB = C.AUDIO_U16MSB // unsigned 16-bit samples in big-endian byte order\n\tAUDIO_U16SYS = C.AUDIO_U16SYS // unsigned 16-bit samples in native byte order\n\tAUDIO_U16    = C.AUDIO_U16    // AUDIO_U16LSB\n\n\tAUDIO_S32LSB = C.AUDIO_S32LSB // 32-bit integer samples in little-endian byte order\n\tAUDIO_S32MSB = C.AUDIO_S32MSB // 32-bit integer samples in big-endian byte order\n\tAUDIO_S32SYS = C.AUDIO_S32SYS // 32-bit integer samples in native byte order\n\tAUDIO_S32    = C.AUDIO_S32    // AUDIO_S32LSB\n\n\tAUDIO_F32LSB = C.AUDIO_F32LSB // 32-bit floating point samples in little-endian byte order\n\tAUDIO_F32MSB = C.AUDIO_F32MSB // 32-bit floating point samples in big-endian byte order\n\tAUDIO_F32SYS = C.AUDIO_F32SYS // 32-bit floating point samples in native byte order\n\tAUDIO_F32    = C.AUDIO_F32    // AUDIO_F32LSB\n)\n\n// AllowedChanges flags specify how SDL should behave when a device cannot offer a specific feature. If the application requests a feature that the hardware doesn't offer, SDL will always try to get the closest equivalent. Used in OpenAudioDevice().\n// (https://wiki.libsdl.org/SDL_OpenAudioDevice)\nconst (\n\tAUDIO_ALLOW_FREQUENCY_CHANGE = C.SDL_AUDIO_ALLOW_FREQUENCY_CHANGE\n\tAUDIO_ALLOW_FORMAT_CHANGE    = C.SDL_AUDIO_ALLOW_FORMAT_CHANGE\n\tAUDIO_ALLOW_CHANNELS_CHANGE  = C.SDL_AUDIO_ALLOW_CHANNELS_CHANGE\n\tAUDIO_ALLOW_ANY_CHANGE       = C.SDL_AUDIO_ALLOW_ANY_CHANGE\n)\n\n// An enumeration of audio device states used in GetAudioDeviceStatus() and GetAudioStatus().\n// (https://wiki.libsdl.org/SDL_AudioStatus)\nconst (\n\tAUDIO_STOPPED AudioStatus = C.SDL_AUDIO_STOPPED // audio device is stopped\n\tAUDIO_PLAYING             = C.SDL_AUDIO_PLAYING // audio device is playing\n\tAUDIO_PAUSED              = C.SDL_AUDIO_PAUSED  // audio device is paused\n)\n\n// MIX_MAXVOLUME is the full audio volume value used in MixAudioFormat() and AudioFormat().\n// (https://wiki.libsdl.org/SDL_MixAudioFormat)\nconst MIX_MAXVOLUME = C.SDL_MIX_MAXVOLUME // full audio volume\n\n// AudioFormat is an enumeration of audio formats.\n// (https://wiki.libsdl.org/SDL_AudioFormat)\ntype AudioFormat uint16\n\n// AudioCallback is a function to call when the audio device needs more data.`\n// (https://wiki.libsdl.org/SDL_AudioSpec)\ntype AudioCallback C.SDL_AudioCallback\n\n// AudioFilter is the filter list used in AudioCVT() (internal use)\n// (https://wiki.libsdl.org/SDL_AudioCVT)\ntype AudioFilter C.SDL_AudioFilter\n\n// AudioDeviceID is ID of an audio device previously opened with OpenAudioDevice().\n// (https://wiki.libsdl.org/SDL_OpenAudioDevice)\ntype AudioDeviceID uint32\n\n// AudioStatus is an enumeration of audio device states.\n// (https://wiki.libsdl.org/SDL_AudioStatus)\ntype AudioStatus uint32\ntype cAudioStatus C.SDL_AudioStatus\n\n// AudioSpec contains the audio output format. It also contains a callback that is called when the audio device needs more data.\n// (https://wiki.libsdl.org/SDL_AudioSpec)\ntype AudioSpec struct {\n\tFreq     int32          // DSP frequency (samples per second)\n\tFormat   AudioFormat    // audio data format\n\tChannels uint8          // number of separate sound channels\n\tSilence  uint8          // audio buffer silence value (calculated)\n\tSamples  uint16         // audio buffer size in samples (power of 2)\n\t_        uint16         // padding\n\tSize     uint32         // audio buffer size in bytes (calculated)\n\tCallback AudioCallback  // the function to call when the audio device needs more data\n\tUserData unsafe.Pointer // a pointer that is passed to callback (otherwise ignored by SDL)\n}\ntype cAudioSpec C.SDL_AudioSpec\n\n// AudioCVT contains audio data conversion information.\n// (https://wiki.libsdl.org/SDL_AudioCVT)\ntype AudioCVT struct {\n\tNeeded      int32           // set to 1 if conversion possible\n\tSrcFormat   AudioFormat     // source audio format\n\tDstFormat   AudioFormat     // target audio format\n\tRateIncr    float64         // rate conversion increment\n\tBuf         unsafe.Pointer  // the buffer to hold entire audio data. Use AudioCVT.BufAsSlice() for access via a Go slice\n\tLen         int32           // length of original audio buffer\n\tLenCVT      int32           // length of converted audio buffer\n\tLenMult     int32           // buf must be len*len_mult big\n\tLenRatio    float64         // given len, final size is len*len_ratio\n\tfilters     [10]AudioFilter // filter list (internal use)\n\tfilterIndex int32           // current audio conversion function (internal use)\n}\ntype cAudioCVT C.SDL_AudioCVT\n\n// AudioStream is a new audio conversion interface.\n// (https://wiki.libsdl.org/SDL_AudioStream)\ntype AudioStream C.SDL_AudioStream\n\nfunc (fmt AudioFormat) c() C.SDL_AudioFormat {\n\treturn C.SDL_AudioFormat(fmt)\n}\n\nfunc (id AudioDeviceID) c() C.SDL_AudioDeviceID {\n\treturn C.SDL_AudioDeviceID(id)\n}\n\nfunc (as *AudioSpec) cptr() *C.SDL_AudioSpec {\n\treturn (*C.SDL_AudioSpec)(unsafe.Pointer(as))\n}\n\nfunc (cvt *AudioCVT) cptr() *C.SDL_AudioCVT {\n\treturn (*C.SDL_AudioCVT)(unsafe.Pointer(cvt))\n}\n\nfunc (stream *AudioStream) cptr() *C.SDL_AudioStream {\n\treturn (*C.SDL_AudioStream)(unsafe.Pointer(stream))\n}\n\n// BitSize returns audio formats bit size.\n// (https://wiki.libsdl.org/SDL_AudioFormat)\nfunc (fmt AudioFormat) BitSize() uint8 {\n\treturn uint8(fmt & AUDIO_MASK_BITSIZE)\n}\n\n// IsFloat reports whether audio format is float.\n// (https://wiki.libsdl.org/SDL_AudioFormat)\nfunc (fmt AudioFormat) IsFloat() bool {\n\treturn (fmt & AUDIO_MASK_DATATYPE) > 0\n}\n\n// IsBigEndian reports whether audio format is big-endian.\n// (https://wiki.libsdl.org/SDL_AudioFormat)\nfunc (fmt AudioFormat) IsBigEndian() bool {\n\treturn (fmt & AUDIO_MASK_ENDIAN) > 0\n}\n\n// IsSigned reports whether audio format is signed.\n// (https://wiki.libsdl.org/SDL_AudioFormat)\nfunc (fmt AudioFormat) IsSigned() bool {\n\treturn (fmt & AUDIO_MASK_SIGNED) > 0\n}\n\n// IsInt reports whether audio format is integer.\n// (https://wiki.libsdl.org/SDL_AudioFormat)\nfunc (fmt AudioFormat) IsInt() bool {\n\treturn !fmt.IsFloat()\n}\n\n// IsLittleEndian reports whether audio format is little-endian.\n// (https://wiki.libsdl.org/SDL_AudioFormat)\nfunc (fmt AudioFormat) IsLittleEndian() bool {\n\treturn !fmt.IsBigEndian()\n}\n\n// IsUnsigned reports whether audio format is unsigned.\n// (https://wiki.libsdl.org/SDL_AudioFormat)\nfunc (fmt AudioFormat) IsUnsigned() bool {\n\treturn !fmt.IsSigned()\n}\n\n// AllocBuf allocates the requested memory for AudioCVT buffer.\nfunc (cvt *AudioCVT) AllocBuf(size uintptr) {\n\tcvt.Buf = C.malloc(C.size_t(size))\n}\n\n// FreeBuf deallocates the memory previously allocated from AudioCVT buffer.\nfunc (cvt *AudioCVT) FreeBuf() {\n\tC.free(cvt.Buf)\n}\n\n// BufAsSlice returns AudioCVT.buf as byte slice.\n// NOTE: Must be used after ConvertAudio() because it uses LenCVT as slice length.\nfunc (cvt AudioCVT) BufAsSlice() []byte {\n\tvar b []byte\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&b))\n\tsliceHeader.Len = int(cvt.LenCVT)\n\tsliceHeader.Cap = int(cvt.Len * cvt.LenMult)\n\tsliceHeader.Data = uintptr(unsafe.Pointer(cvt.Buf))\n\treturn b\n}\n\n// GetNumAudioDrivers returns the number of built-in audio drivers.\n// (https://wiki.libsdl.org/SDL_GetNumAudioDrivers)\nfunc GetNumAudioDrivers() int {\n\treturn int(C.SDL_GetNumAudioDrivers())\n}\n\n// GetAudioDriver returns the name of a built in audio driver.\n// (https://wiki.libsdl.org/SDL_GetAudioDriver)\nfunc GetAudioDriver(index int) string {\n\treturn string(C.GoString(C.SDL_GetAudioDriver(C.int(index))))\n}\n\n// AudioInit initializes a particular audio driver.\n// (https://wiki.libsdl.org/SDL_AudioInit)\nfunc AudioInit(driverName string) error {\n\t_driverName := C.CString(driverName)\n\tdefer C.free(unsafe.Pointer(_driverName))\n\tif C.SDL_AudioInit(_driverName) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// AudioQuit shuts down audio if you initialized it with AudioInit().\n// (https://wiki.libsdl.org/SDL_AudioQuit)\nfunc AudioQuit() {\n\tC.SDL_AudioQuit()\n}\n\n// GetCurrentAudioDriver returns the name of the current audio driver.\n// (https://wiki.libsdl.org/SDL_GetCurrentAudioDriver)\nfunc GetCurrentAudioDriver() string {\n\treturn string(C.GoString(C.SDL_GetCurrentAudioDriver()))\n}\n\n// OpenAudio opens the audio device. New programs might want to use OpenAudioDevice() instead.\n// (https://wiki.libsdl.org/SDL_OpenAudio)\nfunc OpenAudio(desired, obtained *AudioSpec) error {\n\tif C.SDL_OpenAudio(desired.cptr(), obtained.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// GetNumAudioDevices returns the number of built-in audio devices.\n// (https://wiki.libsdl.org/SDL_GetNumAudioDevices)\nfunc GetNumAudioDevices(isCapture bool) int {\n\treturn int(C.SDL_GetNumAudioDevices(C.int(Btoi(isCapture))))\n}\n\n// GetAudioDeviceName returns the name of a specific audio device.\n// (https://wiki.libsdl.org/SDL_GetAudioDeviceName)\nfunc GetAudioDeviceName(index int, isCapture bool) string {\n\treturn string(C.GoString(C.SDL_GetAudioDeviceName(C.int(index), C.int(Btoi(isCapture)))))\n}\n\n// OpenAudioDevice opens a specific audio device.\n// (https://wiki.libsdl.org/SDL_OpenAudioDevice)\nfunc OpenAudioDevice(device string, isCapture bool, desired, obtained *AudioSpec, allowedChanges int) (AudioDeviceID, error) {\n\t_device := C.CString(device)\n\tif device == \"\" {\n\t\t_device = nil\n\t}\n\tdefer C.free(unsafe.Pointer(_device))\n\tif id := AudioDeviceID(C.SDL_OpenAudioDevice(_device, C.int(Btoi(isCapture)), desired.cptr(), obtained.cptr(), C.int(allowedChanges))); id > 0 {\n\t\treturn id, nil\n\t}\n\treturn 0, GetError()\n}\n\n// GetAudioStatus returns the current audio state of the audio device. New programs might want to use GetAudioDeviceStatus() instead.\n// (https://wiki.libsdl.org/SDL_GetAudioStatus)\nfunc GetAudioStatus() AudioStatus {\n\treturn (AudioStatus)(C.SDL_GetAudioStatus())\n}\n\n// GetAudioDeviceStatus returns the current audio state of an audio device.\n// (https://wiki.libsdl.org/SDL_GetAudioDeviceStatus)\nfunc GetAudioDeviceStatus(dev AudioDeviceID) AudioStatus {\n\treturn (AudioStatus)(C.SDL_GetAudioDeviceStatus(dev.c()))\n}\n\n// PauseAudio pauses and unpauses the audio device. New programs might want to use SDL_PauseAudioDevice() instead.\n// (https://wiki.libsdl.org/SDL_PauseAudio)\nfunc PauseAudio(pauseOn bool) {\n\tC.SDL_PauseAudio(C.int(Btoi(pauseOn)))\n}\n\n// PauseAudioDevice pauses and unpauses audio playback on a specified device.\n// (https://wiki.libsdl.org/SDL_PauseAudioDevice)\nfunc PauseAudioDevice(dev AudioDeviceID, pauseOn bool) {\n\tC.SDL_PauseAudioDevice(dev.c(), C.int(Btoi(pauseOn)))\n}\n\n// LoadWAVRW loads a WAVE from the data source, automatically freeing that source if freeSrc is true.\n// (https://wiki.libsdl.org/SDL_LoadWAV_RW)\nfunc LoadWAVRW(src *RWops, freeSrc bool) ([]byte, *AudioSpec) {\n\tvar _audioBuf *C.Uint8\n\tvar _audioLen C.Uint32\n\taudioSpec := (*AudioSpec)(unsafe.Pointer(C.SDL_LoadWAV_RW(src.cptr(), C.int(Btoi(freeSrc)), (&AudioSpec{}).cptr(), &_audioBuf, &_audioLen)))\n\n\tvar b []byte\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&b))\n\tsliceHeader.Len = (int)(_audioLen)\n\tsliceHeader.Cap = (int)(_audioLen)\n\tsliceHeader.Data = uintptr(unsafe.Pointer(_audioBuf))\n\treturn b, audioSpec\n}\n\n// LoadWAV loads a WAVE from a file.\n// (https://wiki.libsdl.org/SDL_LoadWAV)\nfunc LoadWAV(file string) ([]byte, *AudioSpec) {\n\t_file := C.CString(file)\n\t_rb := C.CString(\"rb\")\n\tdefer C.free(unsafe.Pointer(_file))\n\tdefer C.free(unsafe.Pointer(_rb))\n\n\tvar _audioBuf *C.Uint8\n\tvar _audioLen C.Uint32\n\taudioSpec := (*AudioSpec)(unsafe.Pointer(C.SDL_LoadWAV_RW(C.SDL_RWFromFile(_file, _rb), 1, (&AudioSpec{}).cptr(), &_audioBuf, &_audioLen)))\n\n\tvar b []byte\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&b))\n\tsliceHeader.Len = (int)(_audioLen)\n\tsliceHeader.Cap = (int)(_audioLen)\n\tsliceHeader.Data = uintptr(unsafe.Pointer(_audioBuf))\n\treturn b, audioSpec\n}\n\n// FreeWAV frees data previously allocated with LoadWAV() or LoadWAVRW().\n// (https://wiki.libsdl.org/SDL_FreeWAV)\nfunc FreeWAV(audioBuf []uint8) {\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&audioBuf))\n\t_audioBuf := (*C.Uint8)(unsafe.Pointer(sliceHeader.Data))\n\tC.SDL_FreeWAV(_audioBuf)\n}\n\n// BuildAudioCVT initializes an AudioCVT structure for conversion.\n// (https://wiki.libsdl.org/SDL_BuildAudioCVT)\nfunc BuildAudioCVT(cvt *AudioCVT, srcFormat AudioFormat, srcChannels uint8, srcRate int, dstFormat AudioFormat, dstChannels uint8, dstRate int) (converted bool, err error) {\n\tswitch int(C.SDL_BuildAudioCVT(cvt.cptr(), srcFormat.c(), C.Uint8(srcChannels), C.int(srcRate), dstFormat.c(), C.Uint8(dstChannels), C.int(dstRate))) {\n\tcase 1:\n\t\treturn true, nil\n\tcase 0:\n\t\treturn false, nil\n\t}\n\treturn false, GetError()\n}\n\n// ConvertAudio converts audio data to a desired audio format.\n// (https://wiki.libsdl.org/SDL_ConvertAudio)\nfunc ConvertAudio(cvt *AudioCVT) error {\n\t_cvt := (*C.SDL_AudioCVT)(unsafe.Pointer(cvt))\n\tif C.SDL_ConvertAudio(_cvt) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// QueueAudio queues more audio on non-callback devices.\n// (https://wiki.libsdl.org/SDL_QueueAudio)\nfunc QueueAudio(dev AudioDeviceID, data []byte) error {\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&data))\n\t_data := unsafe.Pointer(sliceHeader.Data)\n\t_len := (C.Uint32)(sliceHeader.Len)\n\tif C.SDL_QueueAudio(dev.c(), _data, _len) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// DequeueAudio dequeues more audio on non-callback devices. Returns the number of bytes dequeued, which could be less than requested\n// (https://wiki.libsdl.org/SDL_DequeueAudio)\nfunc DequeueAudio(dev AudioDeviceID, data []byte) (n int, err error) {\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&data))\n\t_data := unsafe.Pointer(sliceHeader.Data)\n\t_len := (C.Uint32)(sliceHeader.Len)\n\tif dequeued := int(C.SDL_DequeueAudio(dev.c(), _data, _len)); dequeued > 0 {\n\t\treturn dequeued, nil\n\t}\n\treturn 0, GetError()\n}\n\n// GetQueuedAudioSize returns the number of bytes of still-queued audio.\n// (https://wiki.libsdl.org/SDL_GetQueuedAudioSize)\nfunc GetQueuedAudioSize(dev AudioDeviceID) uint32 {\n\treturn uint32(C.SDL_GetQueuedAudioSize(dev.c()))\n}\n\n// ClearQueuedAudio drops any queued audio data waiting to be sent to the hardware.\n// (https://wiki.libsdl.org/SDL_ClearQueuedAudio)\nfunc ClearQueuedAudio(dev AudioDeviceID) {\n\tC.SDL_ClearQueuedAudio(dev.c())\n}\n\n// MixAudio mixes audio data. New programs might want to use MixAudioFormat() instead.\n// (https://wiki.libsdl.org/SDL_MixAudio)\nfunc MixAudio(dst, src *uint8, len uint32, volume int) {\n\t_dst := (*C.Uint8)(unsafe.Pointer(dst))\n\t_src := (*C.Uint8)(unsafe.Pointer(src))\n\tC.SDL_MixAudio(_dst, _src, C.Uint32(len), C.int(volume))\n}\n\n// MixAudioFormat mixes audio data in a specified format.\n// (https://wiki.libsdl.org/SDL_MixAudioFormat)\nfunc MixAudioFormat(dst, src *uint8, format AudioFormat, len uint32, volume int) {\n\t_dst := (*C.Uint8)(unsafe.Pointer(dst))\n\t_src := (*C.Uint8)(unsafe.Pointer(src))\n\tC.SDL_MixAudioFormat(_dst, _src, format.c(), C.Uint32(len), C.int(volume))\n}\n\n// LockAudio locks the audio device. New programs might want to use LockAudioDevice() instead.\n// (https://wiki.libsdl.org/SDL_LockAudio)\nfunc LockAudio() {\n\tC.SDL_LockAudio()\n}\n\n// LockAudioDevice locks out the audio callback function for a specified device.\n// (https://wiki.libsdl.org/SDL_LockAudioDevice)\nfunc LockAudioDevice(dev AudioDeviceID) {\n\tC.SDL_LockAudioDevice(dev.c())\n}\n\n// UnlockAudio unlocks the audio device. New programs might want to use UnlockAudioDevice() instead.\n// (https://wiki.libsdl.org/SDL_UnlockAudio)\nfunc UnlockAudio() {\n\tC.SDL_UnlockAudio()\n}\n\n// UnlockAudioDevice unlocks the audio callback function for a specified device.\n// (https://wiki.libsdl.org/SDL_UnlockAudioDevice)\nfunc UnlockAudioDevice(dev AudioDeviceID) {\n\tC.SDL_UnlockAudioDevice(dev.c())\n}\n\n// CloseAudio closes the audio device. New programs might want to use CloseAudioDevice() instead.\n// (https://wiki.libsdl.org/SDL_CloseAudio)\nfunc CloseAudio() {\n\tC.SDL_CloseAudio()\n}\n\n// CloseAudioDevice shuts down audio processing and closes the audio device.\n// (https://wiki.libsdl.org/SDL_CloseAudioDevice)\nfunc CloseAudioDevice(dev AudioDeviceID) {\n\tC.SDL_CloseAudioDevice(dev.c())\n}\n\n// NewAudioStream creates a new audio stream\n// TODO: (https://wiki.libsdl.org/SDL_NewAudioStream)\nfunc NewAudioStream(srcFormat AudioFormat, srcChannels uint8, srcRate int, dstFormat AudioFormat, dstChannels uint8, dstRate int) (stream *AudioStream, err error) {\n\t_srcFormat := C.SDL_AudioFormat(srcFormat)\n\t_srcChannels := C.Uint8(srcChannels)\n\t_srcRate := C.int(srcRate)\n\t_dstFormat := C.SDL_AudioFormat(dstFormat)\n\t_dstChannels := C.Uint8(dstChannels)\n\t_dstRate := C.int(dstRate)\n\n\tstream = (*AudioStream)(C.SDL_NewAudioStream(_srcFormat, _srcChannels, _srcRate, _dstFormat, _dstChannels, _dstRate))\n\tif stream == nil {\n\t\terr = GetError()\n\t}\n\treturn\n}\n\n// Put adds data to be converted/resampled to the stream\n// TODO: (https://wiki.libsdl.org/SDL_AudioStreamPut)\nfunc (stream *AudioStream) Put(buf []byte) (err error) {\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&buf))\n\t_buf := unsafe.Pointer(sliceHeader.Data)\n\t_len := C.int(len(buf))\n\tret := int(C.SDL_AudioStreamPut(stream.cptr(), _buf, _len))\n\terr = errorFromInt(ret)\n\treturn\n}\n\n// Get gets converted/resampled data from the stream. Returns the number of bytes read from the stream.\n// (https://wiki.libsdl.org/SDL_AudioStreamGet)\nfunc (stream *AudioStream) Get(buf []byte) (n int, err error) {\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&buf))\n\t_buf := unsafe.Pointer(sliceHeader.Data)\n\t_len := C.int(len(buf))\n\tif ret := int(C.SDL_AudioStreamGet(stream.cptr(), _buf, _len)); ret < 0 {\n\t\treturn 0, errorFromInt(ret)\n\t} else {\n\t\treturn ret, nil\n\t}\n}\n\n// Available gets the number of converted/resampled bytes available\n// TODO: (https://wiki.libsdl.org/SDL_AudioStreamAvailable)\nfunc (stream *AudioStream) Available() (err error) {\n\tret := int(C.SDL_AudioStreamAvailable(stream.cptr()))\n\terr = errorFromInt(ret)\n\treturn\n}\n\n// Flush tells the stream that you're done sending data, and anything being buffered\n// should be converted/resampled and made available immediately.\n// TODO: (https://wiki.libsdl.org/SDL_AudioStreamFlush)\nfunc (stream *AudioStream) Flush() (err error) {\n\tret := int(C.SDL_AudioStreamFlush(stream.cptr()))\n\terr = errorFromInt(ret)\n\treturn\n}\n\n// Clear clears any pending data in the stream without converting it\n// TODO: (https://wiki.libsdl.org/SDL_AudioStreamClear)\nfunc (stream *AudioStream) Clear() {\n\tC.SDL_AudioStreamClear(stream.cptr())\n}\n\n// Free frees the audio stream\n// TODO: (https://wiki.libsdl.org/SDL_AudoiStreamFree)\nfunc (stream *AudioStream) Free() {\n\tC.SDL_FreeAudioStream(stream.cptr())\n}\n\n// GetAudioDeviceSpec returns the preferred audio format of a specific audio device.\n// (https://wiki.libsdl.org/SDL_GetAudioDeviceSpec)\nfunc GetAudioDeviceSpec(index int, isCapture bool) (spec *AudioSpec, err error) {\n\tspec = &AudioSpec{}\n\terr = errorFromInt(int(C.SDL_GetAudioDeviceSpec(C.int(index), C.int(Btoi(isCapture)), spec.cptr())))\n\treturn\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/blendmode.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,6))\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_BLENDMODE_INVALID is not supported before SDL 2.0.6\")\n#endif\n\n#define SDL_BLENDMODE_INVALID (0x7FFFFFFF)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_BlendOperation is not supported before SDL 2.0.6\")\n#endif\n\ntypedef enum\n{\n    SDL_BLENDOPERATION_ADD              = 0x1,\n    SDL_BLENDOPERATION_SUBTRACT         = 0x2,\n    SDL_BLENDOPERATION_REV_SUBTRACT     = 0x3,\n    SDL_BLENDOPERATION_MINIMUM          = 0x4,\n    SDL_BLENDOPERATION_MAXIMUM          = 0x5\n} SDL_BlendOperation;\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_BlendFactor is not supported before SDL 2.0.6\")\n#endif\n\ntypedef enum\n{\n    SDL_BLENDFACTOR_ZERO                = 0x1,\n    SDL_BLENDFACTOR_ONE                 = 0x2,\n    SDL_BLENDFACTOR_SRC_COLOR           = 0x3,\n    SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4,\n    SDL_BLENDFACTOR_SRC_ALPHA           = 0x5,\n    SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6,\n    SDL_BLENDFACTOR_DST_COLOR           = 0x7,\n    SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8,\n    SDL_BLENDFACTOR_DST_ALPHA           = 0x9,\n    SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA\n\n} SDL_BlendFactor;\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_ComposeCustomBlendMode is not supported before SDL 2.0.6\")\n#endif\n\nSDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor, SDL_BlendOperation colorOperation, SDL_BlendFactor srcAlphaFactor, SDL_BlendFactor dstAlphaFactor, SDL_BlendOperation alphaOperation)\n{\n\treturn SDL_BLENDMODE_NONE;\n}\n#endif\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// BlendMode is an enumeration of blend modes used in Render.Copy() and drawing operations.\n// (https://wiki.libsdl.org/SDL_BlendMode)\ntype BlendMode uint32\n\nconst (\n\tBLENDMODE_NONE    = C.SDL_BLENDMODE_NONE  // no blending\n\tBLENDMODE_BLEND   = C.SDL_BLENDMODE_BLEND // alpha blending\n\tBLENDMODE_ADD     = C.SDL_BLENDMODE_ADD   // additive blending\n\tBLENDMODE_MOD     = C.SDL_BLENDMODE_MOD   // color modulate\n\tBLENDMODE_INVALID = C.SDL_BLENDMODE_INVALID\n)\n\nfunc (bm BlendMode) c() C.SDL_BlendMode {\n\treturn C.SDL_BlendMode(C.Uint32(bm))\n}\n\nfunc (bm *BlendMode) cptr() *C.SDL_BlendMode {\n\treturn (*C.SDL_BlendMode)(unsafe.Pointer(bm))\n}\n\n// BlendOperation is an enumeration of blend operations used when creating a custom blend mode with ComposeCustomBlendMode().\n// (https://wiki.libsdl.org/SDL_BlendOperation)\ntype BlendOperation C.SDL_BlendOperation\n\nconst (\n\tBLENDOPERATION_ADD          = C.SDL_BLENDOPERATION_ADD\n\tBLENDOPERATION_SUBTRACT     = C.SDL_BLENDOPERATION_SUBTRACT\n\tBLENDOPERATION_REV_SUBTRACT = C.SDL_BLENDOPERATION_REV_SUBTRACT\n\tBLENDOPERATION_MINIMUM      = C.SDL_BLENDOPERATION_MINIMUM\n\tBLENDOPERATION_MAXIMUM      = C.SDL_BLENDOPERATION_MAXIMUM\n)\n\n// BlendFactor is an enumeration of blend factors used when creating a custom blend mode with ComposeCustomBlendMode().\n// (https://wiki.libsdl.org/SDL_BlendFactor)\ntype BlendFactor C.SDL_BlendFactor\n\nconst (\n\tBLENDFACTOR_ZERO                = C.SDL_BLENDFACTOR_ZERO                // 0, 0, 0, 0\n\tBLENDFACTOR_ONE                 = C.SDL_BLENDFACTOR_ONE                 // 1, 1, 1, 1\n\tBLENDFACTOR_SRC_COLOR           = C.SDL_BLENDFACTOR_SRC_COLOR           // srcR, srcG, srcB, srcA\n\tBLENDFACTOR_ONE_MINUS_SRC_COLOR = C.SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR // 1-srcR, 1-srcG, 1-srcB, 1-srcA\n\tBLENDFACTOR_SRC_ALPHA           = C.SDL_BLENDFACTOR_SRC_ALPHA           // srcA, srcA, srcA, srcA\n\tBLENDFACTOR_ONE_MINUS_SRC_ALPHA = C.SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA // 1-srcA, 1-srcA, 1-srcA, 1-srcA\n\tBLENDFACTOR_DST_COLOR           = C.SDL_BLENDFACTOR_DST_COLOR           // dstR, dstG, dstB, dstA\n\tBLENDFACTOR_ONE_MINUS_DST_COLOR = C.SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR // 1-dstR, 1-dstG, 1-dstB, 1-dstA\n\tBLENDFACTOR_DST_ALPHA           = C.SDL_BLENDFACTOR_DST_ALPHA           // dstA, dstA, dstA, dstA\n\tBLENDFACTOR_ONE_MINUS_DST_ALPHA = C.SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA // 1-dstA, 1-dstA, 1-dstA, 1-dstA\n)\n\n// ComposeCustomBlendMode creates a custom blend mode, which may or may not be supported by a given renderer\n// The result of the blend mode operation will be:\n//     dstRGB = dstRGB * dstColorFactor colorOperation srcRGB * srcColorFactor\n// and\n//     dstA = dstA * dstAlphaFactor alphaOperation srcA * srcAlphaFactor\n// (https://wiki.libsdl.org/SDL_ComposeCustomBlendMode)\nfunc ComposeCustomBlendMode(srcColorFactor, dstColorFactor BlendFactor, colorOperation BlendOperation, srcAlphaFactor, dstAlphaFactor BlendFactor, alphaOperation BlendOperation) BlendMode {\n\t_srcColorFactor := C.SDL_BlendFactor(srcColorFactor)\n\t_dstColorFactor := C.SDL_BlendFactor(dstColorFactor)\n\t_colorOperation := C.SDL_BlendOperation(colorOperation)\n\t_srcAlphaFactor := C.SDL_BlendFactor(srcAlphaFactor)\n\t_dstAlphaFactor := C.SDL_BlendFactor(dstAlphaFactor)\n\t_alphaOperation := C.SDL_BlendOperation(alphaOperation)\n\treturn BlendMode(C.SDL_ComposeCustomBlendMode(_srcColorFactor, _dstColorFactor, _colorOperation, _srcAlphaFactor, _dstAlphaFactor, _alphaOperation))\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/clipboard.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\nimport \"unsafe\"\n\n// SetClipboardText puts UTF-8 text into the clipboard.\n// (https://wiki.libsdl.org/SDL_SetClipboardText)\nfunc SetClipboardText(text string) error {\n\t_text := C.CString(text)\n\tdefer C.free(unsafe.Pointer(_text))\n\tif C.SDL_SetClipboardText(_text) < 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// GetClipboardText returns UTF-8 text from the clipboard.\n// (https://wiki.libsdl.org/SDL_GetClipboardText)\nfunc GetClipboardText() (string, error) {\n\ttext := C.SDL_GetClipboardText()\n\tif text == nil {\n\t\treturn \"\", GetError()\n\t}\n\tdefer C.SDL_free(unsafe.Pointer(text))\n\t_text := C.GoString(text)\n\treturn _text, nil\n}\n\n// HasClipboardText reports whether the clipboard exists and contains a text string that is non-empty.\n// (https://wiki.libsdl.org/SDL_HasClipboardText)\nfunc HasClipboardText() bool {\n\treturn C.SDL_HasClipboardText() > 0\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/cpuinfo.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,9))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_HasAVX512F is not supported before SDL 2.0.9\")\n#endif\n\nstatic inline SDL_bool SDL_HasAVX512F()\n{\n\treturn SDL_FALSE;\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,1))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetSystemRAM is not supported before SDL 2.0.1\")\n#endif\n\nstatic inline int SDL_GetSystemRAM()\n{\n\treturn -1;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,2))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_HasAVX is not supported before SDL 2.0.2\")\n#endif\n\nstatic inline SDL_bool SDL_HasAVX()\n{\n\treturn SDL_FALSE;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,4))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_HasAVX2 is not supported before SDL 2.0.4\")\n#endif\n\nstatic inline SDL_bool SDL_HasAVX2()\n{\n\treturn SDL_FALSE;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,6))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_HasNEON is not supported before SDL 2.0.4\")\n#endif\n\nstatic inline SDL_bool SDL_HasNEON()\n{\n\treturn SDL_FALSE;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,10))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SIMDGetAlignment is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline size_t SDL_SIMDGetAlignment(void)\n{\n\treturn 0;\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SIMDAlloc is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline void * SDL_SIMDAlloc(const size_t len)\n{\n\treturn NULL;\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SIMDFree is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline void SDL_SIMDFree(void *ptr)\n{\n}\n\n#endif\n\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// CACHELINE_SIZE is a cacheline size used for padding.\nconst CACHELINE_SIZE = C.SDL_CACHELINE_SIZE\n\n// GetCPUCount returns the number of CPU cores available.\n// (https://wiki.libsdl.org/SDL_GetCPUCount)\nfunc GetCPUCount() int {\n\treturn int(C.SDL_GetCPUCount())\n}\n\n// GetCPUCacheLineSize returns the L1 cache line size of the CPU.\n// (https://wiki.libsdl.org/SDL_GetCPUCacheLineSize)\nfunc GetCPUCacheLineSize() int {\n\treturn int(C.SDL_GetCPUCacheLineSize())\n}\n\n// HasRDTSC reports whether the CPU has the RDTSC instruction.\n// (https://wiki.libsdl.org/SDL_HasRDTSC)\nfunc HasRDTSC() bool {\n\treturn C.SDL_HasRDTSC() > 0\n}\n\n// HasAltiVec reports whether the CPU has AltiVec features.\n// (https://wiki.libsdl.org/SDL_HasAltiVec)\nfunc HasAltiVec() bool {\n\treturn C.SDL_HasAltiVec() > 0\n}\n\n// HasMMX reports whether the CPU has MMX features.\n// (https://wiki.libsdl.org/SDL_HasMMX)\nfunc HasMMX() bool {\n\treturn C.SDL_HasMMX() > 0\n}\n\n// Has3DNow reports whether the CPU has 3DNow! features.\n// (https://wiki.libsdl.org/SDL_Has3DNow)\nfunc Has3DNow() bool {\n\treturn C.SDL_Has3DNow() > 0\n}\n\n// HasSSE reports whether the CPU has SSE features.\n// (https://wiki.libsdl.org/SDL_HasSSE)\nfunc HasSSE() bool {\n\treturn C.SDL_HasSSE() > 0\n}\n\n// HasSSE2 reports whether the CPU has SSE2 features.\n// (https://wiki.libsdl.org/SDL_HasSSE2)\nfunc HasSSE2() bool {\n\treturn C.SDL_HasSSE2() > 0\n}\n\n// HasSSE3 reports whether the CPU has SSE3 features.\n// (https://wiki.libsdl.org/SDL_HasSSE3)\nfunc HasSSE3() bool {\n\treturn C.SDL_HasSSE3() > 0\n}\n\n// HasSSE41 reports whether the CPU has SSE4.1 features.\n// (https://wiki.libsdl.org/SDL_HasSSE41)\nfunc HasSSE41() bool {\n\treturn C.SDL_HasSSE41() > 0\n}\n\n// HasSSE42 reports whether the CPU has SSE4.2 features.\n// (https://wiki.libsdl.org/SDL_HasSSE42)\nfunc HasSSE42() bool {\n\treturn C.SDL_HasSSE42() > 0\n}\n\n// GetSystemRAM returns the amount of RAM configured in the system.\n// (https://wiki.libsdl.org/SDL_GetSystemRAM)\nfunc GetSystemRAM() int {\n\treturn int(C.SDL_GetSystemRAM())\n}\n\n// HasAVX reports whether the CPU has AVX features.\n// (https://wiki.libsdl.org/SDL_HasAVX)\nfunc HasAVX() bool {\n\treturn C.SDL_HasAVX() > 0\n}\n\n// HasAVX512F reports whether the CPU has AVX-512F (foundation) features.\n// TODO: (https://wiki.libsdl.org/SDL_HasAVX512F)\nfunc HasAVX512F() bool {\n\treturn C.SDL_HasAVX512F() > 0\n}\n\n// HasAVX2 reports whether the CPU has AVX2 features.\n// (https://wiki.libsdl.org/SDL_HasAVX2)\nfunc HasAVX2() bool {\n\treturn C.SDL_HasAVX2() > 0\n}\n\n// HasNEON reports whether the CPU has NEON features.\n// (https://wiki.libsdl.org/SDL_HasNEON)\nfunc HasNEON() bool {\n\treturn C.SDL_HasNEON() > 0\n}\n\n// SIMDGetAlignment reports the alignment this system needs for SIMD allocations.\n// TODO: (https://wiki.libsdl.org/SDL_SIMDGetAlignment)\nfunc SIMDGetAlignment() int {\n\treturn int(C.SDL_SIMDGetAlignment())\n}\n\n// SIMDAlloc allocates memory in a SIMD-friendly way.\n// TODO: (https://wiki.libsdl.org/SDL_SIMDAlloc)\nfunc SIMDAlloc(_len int) unsafe.Pointer {\n\treturn C.SDL_SIMDAlloc(C.size_t(_len))\n}\n\n// SIMDFree deallocates memory obtained from SDL_SIMDAlloc.\n// TODO: (https://wiki.libsdl.org/SDL_SIMDFree)\nfunc SIMDFree(p unsafe.Pointer) {\n\tC.SDL_SIMDFree(p)\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/endian.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\n\n// Endian-specific values.\n// (https://wiki.libsdl.org/CategoryEndian)\nconst (\n\tBYTEORDER  = C.SDL_BYTEORDER  // macro that corresponds to the byte order used by the processor type it was compiled for\n\tLIL_ENDIAN = C.SDL_LIL_ENDIAN // byte order is 1234, where the least significant byte is stored first\n\tBIG_ENDIAN = C.SDL_BIG_ENDIAN // byte order is 4321, where the most significant byte is stored first\n)\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/error.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\nvoid GoSetError(const char *fmt) {\n  SDL_SetError(\"%s\", fmt);\n}\n\n*/\n// #include \"sdl_wrapper.h\"\nimport \"C\"\nimport \"errors\"\n\nvar emptyCString *C.char = C.CString(\"\")\nvar ErrInvalidParameters = errors.New(\"Invalid Parameters\")\n\n// SDL error codes with their corresponding predefined strings.\nconst (\n\tENOMEM      ErrorCode = C.SDL_ENOMEM      // out of memory\n\tEFREAD                = C.SDL_EFREAD      // error reading from datastream\n\tEFWRITE               = C.SDL_EFWRITE     // error writing to datastream\n\tEFSEEK                = C.SDL_EFSEEK      // error seeking in datastream\n\tUNSUPPORTED           = C.SDL_UNSUPPORTED // that operation is not supported\n\tLASTERROR             = C.SDL_LASTERROR   // the highest numbered predefined error\n)\n\n// ErrorCode is an error code used in SDL error messages.\ntype ErrorCode uint32\ntype cErrorCode C.SDL_errorcode\n\nfunc (ec ErrorCode) c() C.SDL_errorcode {\n\treturn C.SDL_errorcode(ec)\n}\n\n// GetError returns the last error that occurred, or an empty string if there hasn't been an error message set since the last call to ClearError().\n// (https://wiki.libsdl.org/SDL_GetError)\nfunc GetError() error {\n\tif err := C.SDL_GetError(); err != nil {\n\t\tgostr := C.GoString(err)\n\t\t// SDL_GetError returns \"an empty string if there hasn't been an error message\"\n\t\tif len(gostr) > 0 {\n\t\t\treturn errors.New(gostr)\n\t\t}\n\t}\n\treturn nil\n}\n\n// SetError set the SDL error message.\n// (https://wiki.libsdl.org/SDL_SetError)\nfunc SetError(err error) {\n\tif err != nil {\n\t\tC.GoSetError(C.CString(err.Error()))\n\t\treturn\n\t}\n\tC.GoSetError(emptyCString)\n}\n\n// ClearError clears any previous error message.\n// (https://wiki.libsdl.org/SDL_ClearError)\nfunc ClearError() {\n\tC.SDL_ClearError()\n}\n\n// Error sets the SDL error message to the specified error code.\nfunc Error(code ErrorCode) {\n\tC.SDL_Error(code.c())\n}\n\n// OutOfMemory sets SDL error message to ENOMEM (out of memory).\nfunc OutOfMemory() {\n\tError(ENOMEM)\n}\n\n// Unsupported sets SDL error message to UNSUPPORTED (that operation is not supported).\nfunc Unsupported() {\n\tError(UNSUPPORTED)\n}\n\n// errorFromInt returns GetError() if passed negative value, otherwise it returns nil.\nfunc errorFromInt(code int) (err error) {\n\tif code < 0 {\n\t\terr = GetError()\n\t\tif err == nil {\n\t\t\terr = errors.New(\"Unknown error (probably using old version of SDL2 and the function called is not supported?)\")\n\t\t}\n\t}\n\treturn\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/events.c",
    "content": "#include \"_cgo_export.h\"\n#include \"events.h\"\n\nSDL_Event event;\n\nvoid setEventFilter()\n{\n\tSDL_SetEventFilter((SDL_EventFilter)goSetEventFilterCallback, NULL);\n}\n\nvoid clearEventFilter()\n{\n\tSDL_SetEventFilter(NULL, NULL);\n}\n\nvoid filterEvents(void *userdata)\n{\n\tSDL_FilterEvents((SDL_EventFilter)goEventFilterCallback, userdata);\n}\n\nvoid addEventWatch(void *userdata)\n{\n\tSDL_AddEventWatch((SDL_EventFilter)goEventFilterCallback, userdata);\n}\n\nvoid delEventWatch(void *userdata)\n{\n\tSDL_DelEventWatch((SDL_EventFilter)goEventFilterCallback, userdata);\n}\n\nint PollEvent()\n{\n\treturn SDL_PollEvent(&event);\n}"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/events.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n#include \"events.h\"\n\n#if !SDL_VERSION_ATLEAST(2,0,9)\n#define SDL_DISPLAYEVENT (0x150)\n#endif\n\n#if !SDL_VERSION_ATLEAST(2,0,2)\n#define SDL_RENDER_TARGETS_RESET (0x2000)\n#endif\n\n#if !SDL_VERSION_ATLEAST(2,0,4)\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_KEYMAPCHANGED is not supported before SDL 2.0.4\")\n#endif\n\n#define SDL_KEYMAPCHANGED (0x304)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_AUDIODEVICEADDED is not supported before SDL 2.0.4\")\n#endif\n\n#define SDL_AUDIODEVICEADDED (0x1100)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_AUDIODEVICEREMOVED is not supported before SDL 2.0.4\")\n#endif\n\n#define SDL_AUDIODEVICEREMOVED (0x1101)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RENDER_DEVICE_RESET is not supported before SDL 2.0.4\")\n#endif\n\n#define SDL_RENDER_DEVICE_RESET (0x2001)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_AudioDeviceEvent is not supported before SDL 2.0.4\")\n#endif\n\ntypedef struct SDL_AudioDeviceEvent\n{\n    Uint32 type;\n    Uint32 timestamp;\n    Uint32 which;\n    Uint8  iscapture;\n    Uint8  padding1;\n    Uint8  padding2;\n    Uint8  padding3;\n} SDL_AudioDeviceEvent;\n#endif\n\n#if !SDL_VERSION_ATLEAST(2,0,5)\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_DROPTEXT is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_DROPTEXT (0x1001)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_DROPBEGIN is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_DROPBEGIN (0x1002)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_DROPCOMPLETE is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_DROPCOMPLETE (0x1003)\n#endif\n\n#if !SDL_VERSION_ATLEAST(2,0,9)\n#define SDL_SENSORUPDATE (0x1200)\n\ntypedef struct SDL_SensorEvent {\n    Uint32 type;\n    Uint32 timestamp;\n    Sint32 which;\n    float data[6];\n} SDL_SensorEvent;\n#endif\n\n#if !SDL_VERSION_ATLEAST(2,0,22)\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_TEXTEDITING_EXT is not supported before SDL 2.0.22\")\n#endif\n\n#define SDL_TEXTEDITING_EXT (0x305)\n#endif\n\n// NOTE: To prevent build from failing when using older SDL2, we create a\n// structure definiton that directly maps to the SDL2 struct definition if\n// using the latest SDL2. Otherwise, we copy the latest definition and paste\n// it here.\n#if SDL_VERSION_ATLEAST(2,0,22)\ntypedef SDL_MouseButtonEvent MouseButtonEvent;\ntypedef SDL_MouseWheelEvent MouseWheelEvent;\ntypedef SDL_TouchFingerEvent TouchFingerEvent;\ntypedef SDL_DropEvent DropEvent;\n#else\ntypedef struct MouseButtonEvent\n{\n    Uint32 type;        // ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP\n    Uint32 timestamp;\n    Uint32 windowID;    // The window with mouse focus, if any\n    Uint32 which;       // The mouse instance id, or SDL_TOUCH_MOUSEID\n    Uint8 button;       // The mouse button index\n    Uint8 state;        // ::SDL_PRESSED or ::SDL_RELEASED\n    Uint8 clicks;       // 1 for single-click, 2 for double-click, etc.\n    Uint8 padding1;\n    Sint32 x;           // X coordinate, relative to window\n    Sint32 y;           // Y coordinate, relative to window\n} MouseButtonEvent;\n\ntypedef struct MouseWheelEvent\n{\n    Uint32 type;        // ::SDL_MOUSEWHEEL\n    Uint32 timestamp;   // In milliseconds, populated using SDL_GetTicks()\n    Uint32 windowID;    // The window with mouse focus, if any\n    Uint32 which;       // The mouse instance id, or SDL_TOUCH_MOUSEID\n    Sint32 x;           // The amount scrolled horizontally, positive to the right and negative to the left\n    Sint32 y;           // The amount scrolled vertically, positive away from the user and negative toward the user\n    Uint32 direction;   // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back\n    float preciseX;     // The amount scrolled horizontally, positive to the right and negative to the left, with float precision (added in 2.0.18)\n    float preciseY;     // The amount scrolled vertically, positive away from the user and negative toward the user, with float precision (added in 2.0.18)\n} MouseWheelEvent;\n\ntypedef struct TouchFingerEvent\n{\n    Uint32 type;           // ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP\n    Uint32 timestamp;      // In milliseconds, populated using SDL_GetTicks()\n    SDL_TouchID touchId;   // The touch device id\n    SDL_FingerID fingerId; //\n    float x;               // Normalized in the range 0...1\n    float y;               // Normalized in the range 0...1\n    float dx;              // Normalized in the range -1...1\n    float dy;              // Normalized in the range -1...1\n    float pressure;        // Normalized in the range 0...1\n    Uint32 windowID;       // The window underneath the finger, if any\n} TouchFingerEvent;\n\ntypedef struct DropEvent\n{\n    Uint32 type;        // ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE\n    Uint32 timestamp;   // In milliseconds, populated using SDL_GetTicks()\n    char *file;         // The file name, which should be freed with SDL_free(), is NULL on begin/complete\n    Uint32 windowID;    // The window that was dropped on, if any\n} DropEvent;\n\n#endif\n\n#if !SDL_VERSION_ATLEAST(2,24,0)\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JOYBATTEYUPDATED is not supported before SDL 2.24.0\")\n#endif\n\n#define SDL_JOYBATTERYUPDATED (1543)\n\n#if !SDL_VERSION_ATLEAST(2,0,4)\ntypedef enum\n{\n    SDL_JOYSTICK_POWER_UNKNOWN = -1,\n    SDL_JOYSTICK_POWER_EMPTY,\n    SDL_JOYSTICK_POWER_LOW,\n    SDL_JOYSTICK_POWER_MEDIUM,\n    SDL_JOYSTICK_POWER_FULL,\n    SDL_JOYSTICK_POWER_WIRED,\n    SDL_JOYSTICK_POWER_MAX\n} SDL_JoystickPowerLevel;\n#endif\n\ntypedef struct SDL_JoyBatteryEvent\n{\n    Uint32 type;\n    Uint32 timestamp;\n    SDL_JoystickID which;\n    SDL_JoystickPowerLevel level;\n} SDL_JoyBatteryEvent;\n\n#endif\n*/\nimport \"C\"\nimport (\n\t\"reflect\"\n\t\"sync\"\n\t\"unsafe\"\n)\n\nvar (\n\teventFilterCache          EventFilter\n\teventWatches              = make(map[EventWatchHandle]*eventFilterCallbackContext)\n\tlastEventWatchHandleMutex sync.Mutex\n\tlastEventWatchHandle      EventWatchHandle\n\tcevent                    C.SDL_Event\n)\n\n// Enumeration of the types of events that can be delivered.\n// (https://wiki.libsdl.org/SDL_EventType)\nconst (\n\tFIRSTEVENT = C.SDL_FIRSTEVENT // do not remove (unused)\n\n\t// Application events\n\tQUIT = C.SDL_QUIT // user-requested quit\n\n\t// Android, iOS and WinRT events\n\tAPP_TERMINATING         = C.SDL_APP_TERMINATING         // OS is terminating the application\n\tAPP_LOWMEMORY           = C.SDL_APP_LOWMEMORY           // OS is low on memory; free some\n\tAPP_WILLENTERBACKGROUND = C.SDL_APP_WILLENTERBACKGROUND // application is entering background\n\tAPP_DIDENTERBACKGROUND  = C.SDL_APP_DIDENTERBACKGROUND  //application entered background\n\tAPP_WILLENTERFOREGROUND = C.SDL_APP_WILLENTERFOREGROUND // application is entering foreground\n\tAPP_DIDENTERFOREGROUND  = C.SDL_APP_DIDENTERFOREGROUND  // application entered foreground\n\n\t// Display events\n\tDISPLAYEVENT = C.SDL_DISPLAYEVENT // Display state change\n\n\t// Window events\n\tWINDOWEVENT = C.SDL_WINDOWEVENT // window state change\n\tSYSWMEVENT  = C.SDL_SYSWMEVENT  // system specific event\n\n\t// Keyboard events\n\tKEYDOWN         = C.SDL_KEYDOWN         // key pressed\n\tKEYUP           = C.SDL_KEYUP           // key released\n\tTEXTEDITING     = C.SDL_TEXTEDITING     // keyboard text editing (composition)\n\tTEXTINPUT       = C.SDL_TEXTINPUT       // keyboard text input\n\tTEXTEDITING_EXT = C.SDL_TEXTEDITING_EXT // keyboard text editing (composition)\n\tKEYMAPCHANGED   = C.SDL_KEYMAPCHANGED   // keymap changed due to a system event such as an input language or keyboard layout change (>= SDL 2.0.4)\n\n\t// Mouse events\n\tMOUSEMOTION     = C.SDL_MOUSEMOTION     // mouse moved\n\tMOUSEBUTTONDOWN = C.SDL_MOUSEBUTTONDOWN // mouse button pressed\n\tMOUSEBUTTONUP   = C.SDL_MOUSEBUTTONUP   // mouse button released\n\tMOUSEWHEEL      = C.SDL_MOUSEWHEEL      // mouse wheel motion\n\n\t// Joystick events\n\tJOYAXISMOTION    = C.SDL_JOYAXISMOTION    // joystick axis motion\n\tJOYBALLMOTION    = C.SDL_JOYBALLMOTION    // joystick trackball motion\n\tJOYHATMOTION     = C.SDL_JOYHATMOTION     // joystick hat position change\n\tJOYBUTTONDOWN    = C.SDL_JOYBUTTONDOWN    // joystick button pressed\n\tJOYBUTTONUP      = C.SDL_JOYBUTTONUP      // joystick button released\n\tJOYDEVICEADDED   = C.SDL_JOYDEVICEADDED   // joystick connected\n\tJOYDEVICEREMOVED = C.SDL_JOYDEVICEREMOVED // joystick disconnected\n\n\t// Game controller events\n\tCONTROLLERAXISMOTION     = C.SDL_CONTROLLERAXISMOTION     // controller axis motion\n\tCONTROLLERBUTTONDOWN     = C.SDL_CONTROLLERBUTTONDOWN     // controller button pressed\n\tCONTROLLERBUTTONUP       = C.SDL_CONTROLLERBUTTONUP       // controller button released\n\tCONTROLLERDEVICEADDED    = C.SDL_CONTROLLERDEVICEADDED    // controller connected\n\tCONTROLLERDEVICEREMOVED  = C.SDL_CONTROLLERDEVICEREMOVED  // controller disconnected\n\tCONTROLLERDEVICEREMAPPED = C.SDL_CONTROLLERDEVICEREMAPPED // controller mapping updated\n\n\t// Touch events\n\tFINGERDOWN   = C.SDL_FINGERDOWN   // user has touched input device\n\tFINGERUP     = C.SDL_FINGERUP     // user stopped touching input device\n\tFINGERMOTION = C.SDL_FINGERMOTION // user is dragging finger on input device\n\n\t// Gesture events\n\tDOLLARGESTURE = C.SDL_DOLLARGESTURE\n\tDOLLARRECORD  = C.SDL_DOLLARRECORD\n\tMULTIGESTURE  = C.SDL_MULTIGESTURE\n\n\t// Clipboard events\n\tCLIPBOARDUPDATE = C.SDL_CLIPBOARDUPDATE // the clipboard changed\n\n\t// Drag and drop events\n\tDROPFILE     = C.SDL_DROPFILE     // the system requests a file open\n\tDROPTEXT     = C.SDL_DROPTEXT     // text/plain drag-and-drop event\n\tDROPBEGIN    = C.SDL_DROPBEGIN    // a new set of drops is beginning (NULL filename)\n\tDROPCOMPLETE = C.SDL_DROPCOMPLETE // current set of drops is now complete (NULL filename)\n\n\t// Audio hotplug events\n\tAUDIODEVICEADDED   = C.SDL_AUDIODEVICEADDED   // a new audio device is available (>= SDL 2.0.4)\n\tAUDIODEVICEREMOVED = C.SDL_AUDIODEVICEREMOVED // an audio device has been removed (>= SDL 2.0.4)\n\n\t// Sensor events\n\tSENSORUPDATE = C.SDL_SENSORUPDATE // a sensor was updated\n\n\t// Render events\n\tRENDER_TARGETS_RESET = C.SDL_RENDER_TARGETS_RESET // the render targets have been reset and their contents need to be updated (>= SDL 2.0.2)\n\tRENDER_DEVICE_RESET  = C.SDL_RENDER_DEVICE_RESET  // the device has been reset and all textures need to be recreated (>= SDL 2.0.4)\n\n\t// These are for your use, and should be allocated with RegisterEvents()\n\tUSEREVENT = C.SDL_USEREVENT // a user-specified event\n\tLASTEVENT = C.SDL_LASTEVENT // (only for bounding internal arrays)\n)\n\n// Actions for PeepEvents().\n// (https://wiki.libsdl.org/SDL_PeepEvents)\nconst (\n\tADDEVENT  = C.SDL_ADDEVENT  // up to numevents events will be added to the back of the event queue\n\tPEEKEVENT = C.SDL_PEEKEVENT // up to numevents events at the front of the event queue, within the specified minimum and maximum type, will be returned and will not be removed from the queue\n\tGETEVENT  = C.SDL_GETEVENT  // up to numevents events at the front of the event queue, within the specified minimum and maximum type, will be returned and will be removed from the queue\n)\n\n// Toggles for different event state functions.\nconst (\n\tQUERY   = C.SDL_QUERY\n\tIGNORE  = C.SDL_IGNORE\n\tDISABLE = C.SDL_DISABLE\n\tENABLE  = C.SDL_ENABLE\n)\n\n// Event is a union of all event structures used in SDL.\n// (https://wiki.libsdl.org/SDL_Event)\ntype Event interface {\n\tGetType() uint32      // GetType returns the event type\n\tGetTimestamp() uint32 // GetTimestamp returns the timestamp of the event\n}\n\n// CEvent is a union of all event structures used in SDL.\n// (https://wiki.libsdl.org/SDL_Event)\ntype CEvent struct {\n\tType uint32\n\t_    [52]byte // padding\n}\n\n// CommonEvent contains common event data.\n// (https://wiki.libsdl.org/SDL_Event)\ntype CommonEvent struct {\n\tType      uint32 // the event type\n\tTimestamp uint32 // timestamp of the event\n}\n\n// GetType returns the event type.\nfunc (e *CommonEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *CommonEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// DisplayEvent contains common event data.\n// (https://wiki.libsdl.org/SDL_Event)\ntype DisplayEvent struct {\n\tType      uint32 // the event type\n\tTimestamp uint32 // timestamp of the event\n\tDisplay   uint32 // the associated display index\n\tEvent     uint8  // TODO: (https://wiki.libsdl.org/SDL_DisplayEventID)\n\t_         uint8  // padding\n\t_         uint8  // padding\n\t_         uint8  // padding\n\tData1     int32  // event dependent data\n}\n\n// GetType returns the event type.\nfunc (e *DisplayEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *DisplayEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// WindowEvent contains window state change event data.\n// (https://wiki.libsdl.org/SDL_WindowEvent)\ntype WindowEvent struct {\n\tType      uint32 // WINDOWEVENT\n\tTimestamp uint32 // timestamp of the event\n\tWindowID  uint32 // the associated window\n\tEvent     uint8  // (https://wiki.libsdl.org/SDL_WindowEventID)\n\t_         uint8  // padding\n\t_         uint8  // padding\n\t_         uint8  // padding\n\tData1     int32  // event dependent data\n\tData2     int32  // event dependent data\n}\ntype cWindowEvent C.SDL_WindowEvent\n\n// GetType returns the event type.\nfunc (e *WindowEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *WindowEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// KeyboardEvent contains keyboard key down event information.\n// (https://wiki.libsdl.org/SDL_KeyboardEvent)\ntype KeyboardEvent struct {\n\tType      uint32 // KEYDOWN, KEYUP\n\tTimestamp uint32 // timestamp of the event\n\tWindowID  uint32 // the window with keyboard focus, if any\n\tState     uint8  // PRESSED, RELEASED\n\tRepeat    uint8  // non-zero if this is a key repeat\n\t_         uint8  // padding\n\t_         uint8  // padding\n\tKeysym    Keysym // Keysym representing the key that was pressed or released\n}\ntype cKeyboardEvent C.SDL_KeyboardEvent\n\n// GetType returns the event type.\nfunc (e *KeyboardEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *KeyboardEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// TextEditingEvent contains keyboard text editing event information.\n// (https://wiki.libsdl.org/SDL_TextEditingEvent)\ntype TextEditingEvent struct {\n\tType      uint32                               // TEXTEDITING\n\tTimestamp uint32                               // timestamp of the event\n\tWindowID  uint32                               // the window with keyboard focus, if any\n\tText      [C.SDL_TEXTINPUTEVENT_TEXT_SIZE]byte // the null-terminated editing text in UTF-8 encoding\n\tStart     int32                                // the location to begin editing from\n\tLength    int32                                // the number of characters to edit from the start point\n}\ntype cTextEditingEvent C.SDL_TextEditingEvent\n\n// GetType returns the event type.\nfunc (e *TextEditingEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetText returns the text as string\nfunc (e *TextEditingEvent) GetText() string {\n\tlength := func(buf []byte) int {\n\t\tfor i := range buf {\n\t\t\tif buf[i] == 0 {\n\t\t\t\treturn i\n\t\t\t}\n\t\t}\n\n\t\treturn 0\n\t}(e.Text[:])\n\n\ttext := e.Text[:length]\n\treturn string(text)\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *TextEditingEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// TextInputEvent contains keyboard text input event information.\n// (https://wiki.libsdl.org/SDL_TextInputEvent)\ntype TextInputEvent struct {\n\tType      uint32                               // TEXTINPUT\n\tTimestamp uint32                               // timestamp of the event\n\tWindowID  uint32                               // the window with keyboard focus, if any\n\tText      [C.SDL_TEXTINPUTEVENT_TEXT_SIZE]byte // the null-terminated input text in UTF-8 encoding\n}\ntype cTextInputEvent C.SDL_TextInputEvent\n\n// GetType returns the event type.\nfunc (e *TextInputEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *TextInputEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// GetText returns the text as string\nfunc (e *TextInputEvent) GetText() string {\n\tlength := func(buf []byte) int {\n\t\tfor i := range buf {\n\t\t\tif buf[i] == 0 {\n\t\t\t\treturn i\n\t\t\t}\n\t\t}\n\n\t\treturn 0\n\t}(e.Text[:])\n\n\ttext := e.Text[:length]\n\treturn string(text)\n}\n\n// MouseMotionEvent contains mouse motion event information.\n// (https://wiki.libsdl.org/SDL_MouseMotionEvent)\ntype MouseMotionEvent struct {\n\tType      uint32 // MOUSEMOTION\n\tTimestamp uint32 // timestamp of the event\n\tWindowID  uint32 // the window with mouse focus, if any\n\tWhich     uint32 // the mouse instance id, or TOUCH_MOUSEID\n\tState     uint32 // BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT, BUTTON_X1, BUTTON_X2\n\tX         int32  // X coordinate, relative to window\n\tY         int32  // Y coordinate, relative to window\n\tXRel      int32  // relative motion in the X direction\n\tYRel      int32  // relative motion in the Y direction\n}\ntype cMouseMotionEvent C.SDL_MouseMotionEvent\n\n// GetType returns the event type.\nfunc (e *MouseMotionEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *MouseMotionEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// MouseButtonEvent contains mouse button event information.\n// (https://wiki.libsdl.org/SDL_MouseButtonEvent)\ntype MouseButtonEvent struct {\n\tType      uint32 // MOUSEBUTTONDOWN, MOUSEBUTTONUP\n\tTimestamp uint32 // timestamp of the event\n\tWindowID  uint32 // the window with mouse focus, if any\n\tWhich     uint32 // the mouse instance id, or TOUCH_MOUSEID\n\tButton    uint8  // BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT, BUTTON_X1, BUTTON_X2\n\tState     uint8  // PRESSED, RELEASED\n\tClicks    uint8  // 1 for single-click, 2 for double-click, etc. (>= SDL 2.0.2)\n\t_         uint8  // padding\n\tX         int32  // X coordinate, relative to window\n\tY         int32  // Y coordinate, relative to window\n}\ntype cMouseButtonEvent C.SDL_MouseButtonEvent\n\n// GetType returns the event type.\nfunc (e *MouseButtonEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *MouseButtonEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// MouseWheelEvent contains mouse wheel event information.\n// (https://wiki.libsdl.org/SDL_MouseWheelEvent)\ntype MouseWheelEvent struct {\n\tType      uint32  // MOUSEWHEEL\n\tTimestamp uint32  // timestamp of the event\n\tWindowID  uint32  // the window with mouse focus, if any\n\tWhich     uint32  // the mouse instance id, or TOUCH_MOUSEID\n\tX         int32   // the amount scrolled horizontally, positive to the right and negative to the left\n\tY         int32   // the amount scrolled vertically, positive away from the user and negative toward the user\n\tDirection uint32  // MOUSEWHEEL_NORMAL, MOUSEWHEEL_FLIPPED (>= SDL 2.0.4)\n\tPreciseX  float32 // The amount scrolled horizontally, positive to the right and negative to the left, with float precision (added in 2.0.18)\n\tPreciseY  float32 // The amount scrolled vertically, positive away from the user and negative toward the user, with float precision (added in 2.0.18)\n}\ntype cMouseWheelEvent C.SDL_MouseWheelEvent\n\n// GetType returns the event type.\nfunc (e *MouseWheelEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *MouseWheelEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// JoyAxisEvent contains joystick axis motion event information.\n// (https://wiki.libsdl.org/SDL_JoyAxisEvent)\ntype JoyAxisEvent struct {\n\tType      uint32     // JOYAXISMOTION\n\tTimestamp uint32     // timestamp of the event\n\tWhich     JoystickID // the instance id of the joystick that reported the event\n\tAxis      uint8      // the index of the axis that changed\n\t_         uint8      // padding\n\t_         uint8      // padding\n\t_         uint8      // padding\n\tValue     int16      // the current position of the axis (range: -32768 to 32767)\n\t_         uint16     // padding\n}\ntype cJoyAxisEvent C.SDL_JoyAxisEvent\n\n// GetType returns the event type.\nfunc (e *JoyAxisEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *JoyAxisEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// JoyBallEvent contains joystick trackball motion event information.\n// (https://wiki.libsdl.org/SDL_JoyBallEvent)\ntype JoyBallEvent struct {\n\tType      uint32     // JOYBALLMOTION\n\tTimestamp uint32     // timestamp of the event\n\tWhich     JoystickID // the instance id of the joystick that reported the event\n\tBall      uint8      // the index of the trackball that changed\n\t_         uint8      // padding\n\t_         uint8      // padding\n\t_         uint8      // padding\n\tXRel      int16      // the relative motion in the X direction\n\tYRel      int16      // the relative motion in the Y direction\n}\ntype cJoyBallEvent C.SDL_JoyBallEvent\n\n// GetType returns the event type.\nfunc (e *JoyBallEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *JoyBallEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// JoyHatEvent contains joystick hat position change event information.\n// (https://wiki.libsdl.org/SDL_JoyHatEvent)\ntype JoyHatEvent struct {\n\tType      uint32     // JOYHATMOTION\n\tTimestamp uint32     // timestamp of the event\n\tWhich     JoystickID // the instance id of the joystick that reported the event\n\tHat       uint8      // the index of the hat that changed\n\tValue     uint8      // HAT_LEFTUP, HAT_UP, HAT_RIGHTUP, HAT_LEFT, HAT_CENTERED, HAT_RIGHT, HAT_LEFTDOWN, HAT_DOWN, HAT_RIGHTDOWN\n\t_         uint8      // padding\n\t_         uint8      // padding\n}\ntype cJoyHatEvent C.SDL_JoyHatEvent\n\n// GetType returns the event type.\nfunc (e *JoyHatEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *JoyHatEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// JoyButtonEvent contains joystick button event information.\n// (https://wiki.libsdl.org/SDL_JoyButtonEvent)\ntype JoyButtonEvent struct {\n\tType      uint32     // JOYBUTTONDOWN, JOYBUTTONUP\n\tTimestamp uint32     // timestamp of the event\n\tWhich     JoystickID // the instance id of the joystick that reported the event\n\tButton    uint8      // the index of the button that changed\n\tState     uint8      // PRESSED, RELEASED\n\t_         uint8      // padding\n\t_         uint8      // padding\n}\ntype cJoyButtonEvent C.SDL_JoyButtonEvent\n\n// GetType returns the event type.\nfunc (e *JoyButtonEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *JoyButtonEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// JoyDeviceAddedEvent contains joystick device event information.\n// (https://wiki.libsdl.org/SDL_JoyDeviceEvent)\ntype JoyDeviceAddedEvent struct {\n\tType      uint32     // JOYDEVICEADDED\n\tTimestamp uint32     // the timestamp of the event\n\tWhich     JoystickID // the joystick device index\n}\n\n// GetType returns the event type.\nfunc (e *JoyDeviceAddedEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *JoyDeviceAddedEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// JoyDeviceRemovedEvent contains joystick device event information.\n// (https://wiki.libsdl.org/SDL_JoyDeviceEvent)\ntype JoyDeviceRemovedEvent struct {\n\tType      uint32     // JOYDEVICEREMOVED\n\tTimestamp uint32     // the timestamp of the event\n\tWhich     JoystickID // the instance id\n}\n\n// GetType returns the event type.\nfunc (e *JoyDeviceRemovedEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *JoyDeviceRemovedEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// ControllerAxisEvent contains game controller axis motion event information.\n// (https://wiki.libsdl.org/SDL_ControllerAxisEvent)\ntype ControllerAxisEvent struct {\n\tType      uint32     // CONTROLLERAXISMOTION\n\tTimestamp uint32     // the timestamp of the event\n\tWhich     JoystickID // the joystick instance id\n\tAxis      uint8      // the controller axis (https://wiki.libsdl.org/SDL_GameControllerAxis)\n\t_         uint8      // padding\n\t_         uint8      // padding\n\t_         uint8      // padding\n\tValue     int16      // the axis value (range: -32768 to 32767)\n\t_         uint16     // padding\n}\ntype cControllerAxisEvent C.SDL_ControllerAxisEvent\n\n// GetType returns the event type.\nfunc (e *ControllerAxisEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *ControllerAxisEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// ControllerButtonEvent contains game controller button event information.\n// (https://wiki.libsdl.org/SDL_ControllerButtonEvent)\ntype ControllerButtonEvent struct {\n\tType      uint32     // CONTROLLERBUTTONDOWN, CONTROLLERBUTTONUP\n\tTimestamp uint32     // the timestamp of the event\n\tWhich     JoystickID // the joystick instance id\n\tButton    uint8      // the controller button (https://wiki.libsdl.org/SDL_GameControllerButton)\n\tState     uint8      // PRESSED, RELEASED\n\t_         uint8      // padding\n\t_         uint8      // padding\n}\ntype cControllerButtonEvent C.SDL_ControllerButtonEvent\n\n// GetType returns the event type.\nfunc (e *ControllerButtonEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *ControllerButtonEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// ControllerDeviceEvent contains controller device event information.\n// (https://wiki.libsdl.org/SDL_ControllerDeviceEvent)\ntype ControllerDeviceEvent struct {\n\tType      uint32     // CONTROLLERDEVICEADDED, CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED\n\tTimestamp uint32     // the timestamp of the event\n\tWhich     JoystickID // the joystick device index for the CONTROLLERDEVICEADDED event or instance id for the CONTROLLERDEVICEREMOVED or CONTROLLERDEVICEREMAPPED event\n}\ntype cControllerDeviceEvent C.SDL_ControllerDeviceEvent\n\n// GetType returns the event type.\nfunc (e *ControllerDeviceEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *ControllerDeviceEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// AudioDeviceEvent contains audio device event information.\n// (https://wiki.libsdl.org/SDL_AudioDeviceEvent)\ntype AudioDeviceEvent struct {\n\tType      uint32 // AUDIODEVICEADDED, AUDIODEVICEREMOVED\n\tTimestamp uint32 // the timestamp of the event\n\tWhich     uint32 // the audio device index for the AUDIODEVICEADDED event (valid until next GetNumAudioDevices() call), AudioDeviceID for the AUDIODEVICEREMOVED event\n\tIsCapture uint8  // zero if an audio output device, non-zero if an audio capture device\n\t_         uint8  // padding\n\t_         uint8  // padding\n\t_         uint8  // padding\n}\ntype cAudioDeviceEvent C.SDL_AudioDeviceEvent\n\n// GetType returns the event type.\nfunc (e *AudioDeviceEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *AudioDeviceEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// TouchFingerEvent contains finger touch event information.\n// (https://wiki.libsdl.org/SDL_TouchFingerEvent)\ntype TouchFingerEvent struct {\n\tType      uint32   // FINGERMOTION, FINGERDOWN, FINGERUP\n\tTimestamp uint32   // timestamp of the event\n\tTouchID   TouchID  // the touch device id\n\tFingerID  FingerID // the finger id\n\tX         float32  // the x-axis location of the touch event, normalized (0...1)\n\tY         float32  // the y-axis location of the touch event, normalized (0...1)\n\tDX        float32  // the distance moved in the x-axis, normalized (-1...1)\n\tDY        float32  // the distance moved in the y-axis, normalized (-1...1)\n\tPressure  float32  // the quantity of pressure applied, normalized (0...1)\n}\ntype cTouchFingerEvent C.SDL_TouchFingerEvent\n\n// GetType returns the event type.\nfunc (e *TouchFingerEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *TouchFingerEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// MultiGestureEvent contains multiple finger gesture event information.\n// (https://wiki.libsdl.org/SDL_MultiGestureEvent)\ntype MultiGestureEvent struct {\n\tType       uint32  // MULTIGESTURE\n\tTimestamp  uint32  // timestamp of the event\n\tTouchID    TouchID // the touch device id\n\tDTheta     float32 // the amount that the fingers rotated during this motion\n\tDDist      float32 // the amount that the fingers pinched during this motion\n\tX          float32 // the normalized center of gesture\n\tY          float32 // the normalized center of gesture\n\tNumFingers uint16  // the number of fingers used in the gesture\n\t_          uint16  // padding\n}\ntype cMultiGestureEvent C.SDL_MultiGestureEvent\n\n// GetType returns the event type.\nfunc (e *MultiGestureEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *MultiGestureEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// DollarGestureEvent contains complex gesture event information.\n// (https://wiki.libsdl.org/SDL_DollarGestureEvent)\ntype DollarGestureEvent struct {\n\tType       uint32    // DOLLARGESTURE, DOLLARRECORD\n\tTimestamp  uint32    // timestamp of the event\n\tTouchID    TouchID   // the touch device id\n\tGestureID  GestureID // the unique id of the closest gesture to the performed stroke\n\tNumFingers uint32    // the number of fingers used to draw the stroke\n\tError      float32   // the difference between the gesture template and the actual performed gesture (lower error is a better match)\n\tX          float32   // the normalized center of gesture\n\tY          float32   // the normalized center of gesture\n}\ntype cDollarGestureEvent C.SDL_DollarGestureEvent\n\n// GetType returns the event type.\nfunc (e *DollarGestureEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *DollarGestureEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// DropEvent contains an event used to request a file open by the system.\n// (https://wiki.libsdl.org/SDL_DropEvent)\ntype DropEvent struct {\n\tType      uint32 // DROPFILE, DROPTEXT, DROPBEGIN, DROPCOMPLETE\n\tTimestamp uint32 // timestamp of the event\n\tFile      string // the file name\n\tWindowID  uint32 // the window that was dropped on, if any\n}\n\ntype tDropEvent struct {\n\tType      uint32\n\tTimestamp uint32\n\tFile      unsafe.Pointer\n\tWindowID  uint32\n}\ntype cDropEvent C.SDL_DropEvent\n\n// GetType returns the event type.\nfunc (e *DropEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *DropEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// SensorEvent contains data from sensors such as accelerometer and gyroscope\n// (https://wiki.libsdl.org/SDL_SensorEvent)\ntype SensorEvent struct {\n\tType      uint32     // SDL_SENSORUPDATE\n\tTimestamp uint32     // In milliseconds, populated using SDL_GetTicks()\n\tWhich     int32      // The instance ID of the sensor\n\tData      [6]float32 // Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData()\n}\ntype cSensorEvent C.SDL_SensorEvent\n\n// GetType returns the event type.\nfunc (e *SensorEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *SensorEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// RenderEvent contains render event information.\n// (https://wiki.libsdl.org/SDL_EventType)\ntype RenderEvent struct {\n\tType      uint32 // the event type\n\tTimestamp uint32 // timestamp of the event\n}\n\n// GetType returns the event type.\nfunc (e *RenderEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *RenderEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// QuitEvent contains the \"quit requested\" event.\n// (https://wiki.libsdl.org/SDL_QuitEvent)\ntype QuitEvent struct {\n\tType      uint32 // QUIT\n\tTimestamp uint32 // timestamp of the event\n}\n\n// GetType returns the event type.\nfunc (e *QuitEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *QuitEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// OSEvent contains OS specific event information.\ntype OSEvent struct {\n\tType      uint32 // the event type\n\tTimestamp uint32 // timestamp of the event\n}\n\n// GetType returns the event type.\nfunc (e *OSEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *OSEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// ClipboardEvent contains clipboard event information.\n// (https://wiki.libsdl.org/SDL_EventType)\ntype ClipboardEvent struct {\n\tType      uint32 // CLIPBOARDUPDATE\n\tTimestamp uint32 // timestamp of the event\n}\n\n// GetType returns the event type.\nfunc (e *ClipboardEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *ClipboardEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// UserEvent contains an application-defined event type.\n// (https://wiki.libsdl.org/SDL_UserEvent)\ntype UserEvent struct {\n\tType      uint32         // value obtained from RegisterEvents()\n\tTimestamp uint32         // timestamp of the event\n\tWindowID  uint32         // the associated window, if any\n\tCode      int32          // user defined event code\n\tData1     unsafe.Pointer // user defined data pointer\n\tData2     unsafe.Pointer // user defined data pointer\n}\ntype cUserEvent C.SDL_UserEvent\n\n// GetType returns the event type.\nfunc (e *UserEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *UserEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// SysWMEvent contains a video driver dependent system event.\n// (https://wiki.libsdl.org/SDL_SysWMEvent)\ntype SysWMEvent struct {\n\tType      uint32    // SYSWMEVENT\n\tTimestamp uint32    // timestamp of the event\n\tMsg       *SysWMmsg // driver dependent data, defined in SDL_syswm.h\n}\ntype cSysWMEvent C.SDL_SysWMEvent\n\n// GetType returns the event type.\nfunc (e *SysWMEvent) GetType() uint32 {\n\treturn e.Type\n}\n\n// GetTimestamp returns the timestamp of the event.\nfunc (e *SysWMEvent) GetTimestamp() uint32 {\n\treturn e.Timestamp\n}\n\n// EventAction is the action to take in PeepEvents() function.\n// (https://wiki.libsdl.org/SDL_PeepEvents)\ntype EventAction C.SDL_eventaction\n\n// EventFilter is the function to call when an event happens.\n// (https://wiki.libsdl.org/SDL_SetEventFilter)\ntype EventFilter interface {\n\tFilterEvent(e Event, userdata interface{}) bool\n}\n\ntype eventFilterFunc func(Event, interface{}) bool\n\ntype eventFilterCallbackContext struct {\n\tfilter   EventFilter\n\thandle   EventWatchHandle\n\tuserdata interface{}\n}\n\n// EventWatchHandle is an event watch callback added with AddEventWatch().\ntype EventWatchHandle uintptr\n\nfunc (action EventAction) c() C.SDL_eventaction {\n\treturn C.SDL_eventaction(action)\n}\n\n// PumpEvents pumps the event loop, gathering events from the input devices.\n// (https://wiki.libsdl.org/SDL_PumpEvents)\nfunc PumpEvents() {\n\tC.SDL_PumpEvents()\n}\n\n// PeepEvents checks the event queue for messages and optionally return them.\n// (https://wiki.libsdl.org/SDL_PeepEvents)\nfunc PeepEvents(events []Event, action EventAction, minType, maxType uint32) (storedEvents int, err error) {\n\tif events == nil {\n\t\treturn 0, nil\n\t}\n\n\tvar _events []CEvent = make([]CEvent, len(events))\n\n\tif action == ADDEVENT { // the contents of _events matter if they are to be added\n\t\tfor i := 0; i < len(events); i++ {\n\t\t\t_events[i] = *cEvent(events[i])\n\t\t}\n\t}\n\n\t_pevents := (*C.SDL_Event)(unsafe.Pointer(&_events[0]))\n\tstoredEvents = int(C.SDL_PeepEvents(_pevents, C.int(len(events)), action.c(), C.Uint32(minType), C.Uint32(maxType)))\n\n\tif action != ADDEVENT { // put events into slice, events unchanged if action = ADDEVENT\n\t\tfor i := 0; i < storedEvents; i++ {\n\t\t\tevents[i] = goEvent(&_events[i])\n\t\t}\n\t}\n\n\tif storedEvents < 0 {\n\t\terr = GetError()\n\t}\n\n\treturn\n}\n\n// HasEvent checks for the existence of certain event types in the event queue.\n// (https://wiki.libsdl.org/SDL_HasEvent)\nfunc HasEvent(type_ uint32) bool {\n\treturn C.SDL_HasEvent(C.Uint32(type_)) != 0\n}\n\n// HasEvents checks for the existence of a range of event types in the event queue.\n// (https://wiki.libsdl.org/SDL_HasEvents)\nfunc HasEvents(minType, maxType uint32) bool {\n\treturn C.SDL_HasEvents(C.Uint32(minType), C.Uint32(maxType)) != 0\n}\n\n// FlushEvent clears events from the event queue.\n// (https://wiki.libsdl.org/SDL_FlushEvent)\nfunc FlushEvent(type_ uint32) {\n\tC.SDL_FlushEvent(C.Uint32(type_))\n}\n\n// FlushEvents clears events from the event queue.\n// (https://wiki.libsdl.org/SDL_FlushEvents)\nfunc FlushEvents(minType, maxType uint32) {\n\tC.SDL_FlushEvents(C.Uint32(minType), C.Uint32(maxType))\n}\n\n// PollEvent polls for currently pending events.\n// (https://wiki.libsdl.org/SDL_PollEvent)\nfunc PollEvent() Event {\n\tret := C.PollEvent()\n\tif ret == 0 {\n\t\treturn nil\n\t}\n\treturn goEvent((*CEvent)(unsafe.Pointer(&C.event)))\n}\n\nfunc goEvent(cevent *CEvent) Event {\n\tswitch cevent.Type {\n\tcase DISPLAYEVENT:\n\t\treturn (*DisplayEvent)(unsafe.Pointer(cevent))\n\tcase WINDOWEVENT:\n\t\treturn (*WindowEvent)(unsafe.Pointer(cevent))\n\tcase SYSWMEVENT:\n\t\treturn (*SysWMEvent)(unsafe.Pointer(cevent))\n\tcase KEYDOWN, KEYUP:\n\t\treturn (*KeyboardEvent)(unsafe.Pointer(cevent))\n\tcase TEXTEDITING:\n\t\treturn (*TextEditingEvent)(unsafe.Pointer(cevent))\n\tcase TEXTINPUT:\n\t\treturn (*TextInputEvent)(unsafe.Pointer(cevent))\n\tcase MOUSEMOTION:\n\t\treturn (*MouseMotionEvent)(unsafe.Pointer(cevent))\n\tcase MOUSEBUTTONDOWN, MOUSEBUTTONUP:\n\t\treturn (*MouseButtonEvent)(unsafe.Pointer(cevent))\n\tcase MOUSEWHEEL:\n\t\treturn (*MouseWheelEvent)(unsafe.Pointer(cevent))\n\tcase JOYAXISMOTION:\n\t\treturn (*JoyAxisEvent)(unsafe.Pointer(cevent))\n\tcase JOYBALLMOTION:\n\t\treturn (*JoyBallEvent)(unsafe.Pointer(cevent))\n\tcase JOYHATMOTION:\n\t\treturn (*JoyHatEvent)(unsafe.Pointer(cevent))\n\tcase JOYBUTTONDOWN, JOYBUTTONUP:\n\t\treturn (*JoyButtonEvent)(unsafe.Pointer(cevent))\n\tcase JOYDEVICEADDED:\n\t\treturn (*JoyDeviceAddedEvent)(unsafe.Pointer(cevent))\n\tcase JOYDEVICEREMOVED:\n\t\treturn (*JoyDeviceRemovedEvent)(unsafe.Pointer(cevent))\n\tcase CONTROLLERAXISMOTION:\n\t\treturn (*ControllerAxisEvent)(unsafe.Pointer(cevent))\n\tcase CONTROLLERBUTTONDOWN, CONTROLLERBUTTONUP:\n\t\treturn (*ControllerButtonEvent)(unsafe.Pointer(cevent))\n\tcase CONTROLLERDEVICEADDED, CONTROLLERDEVICEREMOVED, CONTROLLERDEVICEREMAPPED:\n\t\treturn (*ControllerDeviceEvent)(unsafe.Pointer(cevent))\n\tcase AUDIODEVICEADDED, AUDIODEVICEREMOVED:\n\t\treturn (*AudioDeviceEvent)(unsafe.Pointer(cevent))\n\tcase FINGERMOTION, FINGERDOWN, FINGERUP:\n\t\treturn (*TouchFingerEvent)(unsafe.Pointer(cevent))\n\tcase MULTIGESTURE:\n\t\treturn (*MultiGestureEvent)(unsafe.Pointer(cevent))\n\tcase DOLLARGESTURE, DOLLARRECORD:\n\t\treturn (*DollarGestureEvent)(unsafe.Pointer(cevent))\n\tcase DROPFILE, DROPTEXT, DROPBEGIN, DROPCOMPLETE:\n\t\te := (*tDropEvent)(unsafe.Pointer(cevent))\n\t\tevent := DropEvent{Type: e.Type, Timestamp: e.Timestamp, File: C.GoString((*C.char)(e.File)), WindowID: e.WindowID}\n\t\tC.SDL_free(e.File)\n\t\treturn &event\n\tcase SENSORUPDATE:\n\t\treturn (*SensorEvent)(unsafe.Pointer(cevent))\n\tcase RENDER_TARGETS_RESET, RENDER_DEVICE_RESET:\n\t\treturn (*RenderEvent)(unsafe.Pointer(cevent))\n\tcase QUIT:\n\t\treturn (*QuitEvent)(unsafe.Pointer(cevent))\n\tcase CLIPBOARDUPDATE:\n\t\treturn (*ClipboardEvent)(unsafe.Pointer(cevent))\n\tdefault:\n\t\tif cevent.Type >= USEREVENT {\n\t\t\t// all events beyond USEREVENT are UserEvents to be registered with RegisterEvents\n\t\t\treturn (*UserEvent)(unsafe.Pointer(cevent))\n\t\t}\n\t\treturn (*CommonEvent)(unsafe.Pointer(cevent))\n\t}\n}\n\nfunc cEvent(event Event) *CEvent {\n\tevv := reflect.ValueOf(event)\n\tp := evv.Elem()\n\treturn (*CEvent)(unsafe.Pointer(p.UnsafeAddr()))\n}\n\n// WaitEventTimeout waits until the specified timeout (in milliseconds) for the next available event.\n// (https://wiki.libsdl.org/SDL_WaitEventTimeout)\nfunc WaitEventTimeout(timeout int) Event {\n\tvar cevent CEvent\n\t_event := (*C.SDL_Event)(unsafe.Pointer(&cevent))\n\tok := int(C.SDL_WaitEventTimeout(_event, C.int(timeout)))\n\tif ok == 0 {\n\t\treturn nil\n\t}\n\treturn goEvent(&cevent)\n}\n\n// WaitEvent waits indefinitely for the next available event.\n// (https://wiki.libsdl.org/SDL_WaitEvent)\nfunc WaitEvent() Event {\n\tvar cevent CEvent\n\t_event := (*C.SDL_Event)(unsafe.Pointer(&cevent))\n\tok := int(C.SDL_WaitEvent(_event))\n\tif ok == 0 {\n\t\treturn nil\n\t}\n\treturn goEvent(&cevent)\n}\n\n// PushEvent adds an event to the event queue.\n// (https://wiki.libsdl.org/SDL_PushEvent)\nfunc PushEvent(event Event) (filtered bool, err error) {\n\t_event := (*C.SDL_Event)(unsafe.Pointer(cEvent(event)))\n\tif ok := int(C.SDL_PushEvent(_event)); ok < 0 {\n\t\tfiltered, err = false, GetError()\n\t} else if ok == 0 {\n\t\tfiltered, err = true, nil\n\t}\n\treturn\n}\n\nfunc (ef eventFilterFunc) FilterEvent(e Event, userdata interface{}) bool {\n\treturn ef(e, userdata)\n}\n\nfunc newEventFilterCallbackContext(filter EventFilter, userdata interface{}) *eventFilterCallbackContext {\n\tlastEventWatchHandleMutex.Lock()\n\tdefer lastEventWatchHandleMutex.Unlock()\n\t// Look for the next available watch handle (this should be immediate\n\t// unless you're creating a LOT of handlers).\n\tfor {\n\t\tif _, ok := eventWatches[lastEventWatchHandle]; !ok {\n\t\t\tbreak\n\t\t}\n\t\tlastEventWatchHandle++\n\t}\n\te := &eventFilterCallbackContext{filter, lastEventWatchHandle, userdata}\n\teventWatches[lastEventWatchHandle] = e\n\tlastEventWatchHandle++\n\treturn e\n}\n\nfunc (e *eventFilterCallbackContext) cptr() unsafe.Pointer {\n\treturn unsafe.Pointer(e.handle)\n}\n\n//export goSetEventFilterCallback\nfunc goSetEventFilterCallback(data unsafe.Pointer, e *C.SDL_Event) C.int {\n\t// No check for eventFilterCache != nil. Why? because it should never be\n\t// nil since the callback is set/unset based on the last filter being nil\n\t// /non-nil. If there is an issue, then it should panic here so we can\n\t// figure out why that is.\n\n\treturn wrapEventFilterCallback(eventFilterCache, e, nil)\n}\n\n//export goEventFilterCallback\nfunc goEventFilterCallback(userdata unsafe.Pointer, e *C.SDL_Event) C.int {\n\t// same sort of reasoning with goSetEventFilterCallback, userdata should\n\t// always be non-nil and represent a valid eventFilterCallbackContext. If\n\t// it doesn't a panic will let us know that there something wrong and the\n\t// problem can be fixed.\n\n\tcontext := eventWatches[EventWatchHandle(userdata)]\n\treturn wrapEventFilterCallback(context.filter, e, context.userdata)\n}\n\nfunc wrapEventFilterCallback(filter EventFilter, e *C.SDL_Event, userdata interface{}) C.int {\n\tgev := goEvent((*CEvent)(unsafe.Pointer(e)))\n\tresult := filter.FilterEvent(gev, userdata)\n\n\tif result {\n\t\treturn C.SDL_TRUE\n\t}\n\treturn C.SDL_FALSE\n}\n\n// SetEventFilter sets up a filter to process all events before they change internal state and are posted to the internal event queue.\n// (https://wiki.libsdl.org/SDL_SetEventFilter)\nfunc SetEventFilter(filter EventFilter, userdata interface{}) {\n\tif eventFilterCache == nil && filter == nil {\n\t\t// nothing to do...\n\t\treturn\n\t}\n\n\tif eventFilterCache == nil && filter != nil {\n\t\t// We had no event filter before and do now; lets set\n\t\t// goSetEventFilterCallback() as the event filter.\n\t\tC.setEventFilter()\n\t} else if eventFilterCache != nil && filter == nil {\n\t\t// We had an event filter before, but no longer do, lets clear the\n\t\t// event filter\n\t\tC.clearEventFilter()\n\t}\n\n\teventFilterCache = filter\n}\n\n// SetEventFilterFunc sets up a function to process all events before they change internal state and are posted to the internal event queue.\n// (https://wiki.libsdl.org/SDL_SetEventFilter)\nfunc SetEventFilterFunc(filterFunc eventFilterFunc, userdata interface{}) {\n\tSetEventFilter(filterFunc, userdata)\n}\n\n// GetEventFilter queries the current event filter.\n// (https://wiki.libsdl.org/SDL_GetEventFilter)\nfunc GetEventFilter() EventFilter {\n\treturn eventFilterCache\n}\n\nfunc isCEventFilterSet() bool {\n\treturn C.SDL_GetEventFilter(nil, nil) == C.SDL_TRUE\n}\n\n// FilterEvents run a specific filter function on the current event queue, removing any events for which the filter returns 0.\n// (https://wiki.libsdl.org/SDL_FilterEvents)\nfunc FilterEvents(filter EventFilter, userdata interface{}) {\n\tcontext := newEventFilterCallbackContext(filter, userdata)\n\tC.filterEvents(context.cptr())\n}\n\n// FilterEventsFunc run a specific function on the current event queue, removing any events for which the filter returns 0.\n// (https://wiki.libsdl.org/SDL_FilterEvents)\nfunc FilterEventsFunc(filter eventFilterFunc, userdata interface{}) {\n\tFilterEvents(filter, userdata)\n}\n\n// AddEventWatch adds a callback to be triggered when an event is added to the event queue.\n// (https://wiki.libsdl.org/SDL_AddEventWatch)\nfunc AddEventWatch(filter EventFilter, userdata interface{}) EventWatchHandle {\n\tcontext := newEventFilterCallbackContext(filter, userdata)\n\tC.addEventWatch(context.cptr())\n\treturn context.handle\n}\n\n// AddEventWatchFunc adds a callback function to be triggered when an event is added to the event queue.\n// (https://wiki.libsdl.org/SDL_AddEventWatch)\nfunc AddEventWatchFunc(filterFunc eventFilterFunc, userdata interface{}) EventWatchHandle {\n\treturn AddEventWatch(filterFunc, userdata)\n}\n\n// DelEventWatch removes an event watch callback added with AddEventWatch().\n// (https://wiki.libsdl.org/SDL_DelEventWatch)\nfunc DelEventWatch(handle EventWatchHandle) {\n\tcontext, ok := eventWatches[handle]\n\tif !ok {\n\t\treturn\n\t}\n\tdelete(eventWatches, context.handle)\n\tC.delEventWatch(context.cptr())\n}\n\n// EventState sets the state of processing events by type.\n// (https://wiki.libsdl.org/SDL_EventState)\nfunc EventState(type_ uint32, state int) uint8 {\n\treturn uint8(C.SDL_EventState(C.Uint32(type_), C.int(state)))\n}\n\n// GetEventState returns the current processing state of the specified event\n// (https://wiki.libsdl.org/SDL_EventState)\nfunc GetEventState(type_ uint32) uint8 {\n\treturn uint8(C.SDL_EventState(C.Uint32(type_), QUERY))\n}\n\n// RegisterEvents allocates a set of user-defined events, and return the beginning event number for that set of events.\n// (https://wiki.libsdl.org/SDL_RegisterEvents)\nfunc RegisterEvents(numEvents int) uint32 {\n\treturn uint32(C.SDL_RegisterEvents(C.int(numEvents)))\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/events.h",
    "content": "#ifndef _GO_SDL_EVENTS_H\n#define _GO_SDL_EVENTS_H\n\n#if defined(_WIN32)\n\t#include <SDL2/SDL_events.h>\n#else\n\t#include <SDL_events.h>\n#endif\n\nextern SDL_Event event;\n\nextern void setEventFilter();\nextern void clearEventFilter();\nextern void filterEvents(void *userdata);\nextern void addEventWatch(void *userdata);\nextern void delEventWatch(void *userdata);\nextern int PollEvent();\n\n#endif\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/filesystem.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,1))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetBasePath is not supported before SDL 2.0.1\")\n#endif\n\nstatic inline char* SDL_GetBasePath()\n{\n\treturn NULL;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetPrefPath is not supported before SDL 2.0.1\")\n#endif\n\nstatic inline char* SDL_GetPrefPath(const char *org, const char *app)\n{\n\treturn NULL;\n}\n#endif\n\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// GetBasePath returns the directory where the application was run from. This is where the application data directory is.\n// (https://wiki.libsdl.org/SDL_GetBasePath)\nfunc GetBasePath() string {\n\t_val := C.SDL_GetBasePath()\n\tdefer C.SDL_free(unsafe.Pointer(_val))\n\treturn C.GoString(_val)\n}\n\n// GetPrefPath returns the \"pref dir\". This is meant to be where the application can write personal files (Preferences and save games, etc.) that are specific to the application. This directory is unique per user and per application.\n// (https://wiki.libsdl.org/SDL_GetPrefPath)\nfunc GetPrefPath(org, app string) string {\n\t_org := C.CString(org)\n\t_app := C.CString(app)\n\tdefer C.free(unsafe.Pointer(_org))\n\tdefer C.free(unsafe.Pointer(_app))\n\t_val := C.SDL_GetPrefPath(_org, _app)\n\tdefer C.SDL_free(unsafe.Pointer(_val))\n\treturn C.GoString(_val)\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/gamecontroller.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,4))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GameControllerFromInstanceID is not supported before SDL 2.0.4\")\n#endif\n\nstatic SDL_GameController* SDL_GameControllerFromInstanceID(SDL_JoystickID joyid)\n{\n\treturn NULL;\n}\n\n#endif\n\n\n#if !(SDL_VERSION_ATLEAST(2,0,6))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GameControllerGetVendor is not supported before SDL 2.0.6\")\n#pragma message(\"SDL_GameControllerGetProduct is not supported before SDL 2.0.6\")\n#pragma message(\"SDL_GameControllerGetProductVersion is not supported before SDL 2.0.6\")\n#pragma message(\"SDL_GameControllerNumMappings is not supported before SDL 2.0.6\")\n#pragma message(\"SDL_GameControllerMappingForIndex is not supported before SDL 2.0.6\")\n#endif\n\nstatic Uint16 SDL_GameControllerGetVendor(SDL_GameController* gamecontroller)\n{\n\treturn 0;\n}\n\n\nstatic Uint16 SDL_GameControllerGetProduct(SDL_GameController* gamecontroller)\n{\n\treturn 0;\n}\n\nstatic Uint16 SDL_GameControllerGetProductVersion(SDL_GameController* gamecontroller)\n{\n\treturn 0;\n}\n\nstatic int SDL_GameControllerNumMappings(void)\n{\n\treturn 0;\n}\n\nstatic char* SDL_GameControllerMappingForIndex(int mapping_index)\n{\n\treturn NULL;\n}\n#endif\n\n\n#if !(SDL_VERSION_ATLEAST(2,0,9))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GameControllerGetPlayerIndex is not supported before SDL 2.0.9\")\n#pragma message(\"SDL_GameControllerRumble is not supported before SDL 2.0.9\")\n#pragma message(\"SDL_GameControllerMappingForDeviceIndex is not supported before SDL 2.0.9\")\n#endif\n\ntypedef enum\n{\n    SDL_SENSOR_INVALID = -1,\n    SDL_SENSOR_UNKNOWN,\n    SDL_SENSOR_ACCEL,\n    SDL_SENSOR_GYRO\n} SDL_SensorType;\n\nstatic int SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller)\n{\n\treturn -1;\n}\n\nstatic int SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms)\n{\n\treturn -1;\n}\n\nstatic char *SDL_GameControllerMappingForDeviceIndex(int joystick_index)\n{\n\treturn NULL;\n}\n\n#endif\n\n\n#if !(SDL_VERSION_ATLEAST(2,0,12))\n\ntypedef enum\n{\n    SDL_CONTROLLER_TYPE_UNKNOWN = 0,\n    SDL_CONTROLLER_TYPE_XBOX360,\n    SDL_CONTROLLER_TYPE_XBOXONE,\n    SDL_CONTROLLER_TYPE_PS3,\n    SDL_CONTROLLER_TYPE_PS4,\n    SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO\n} SDL_GameControllerType;\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GameControllerTypeForIndex is not supported before SDL 2.0.12\")\n#pragma message(\"SDL_GameControllerGetType is not supported before SDL 2.0.12\")\n#pragma message(\"SDL_GameControllerFromPlayerIndex is not supported before SDL 2.0.12\")\n#pragma message(\"SDL_GameControllerSetPlayerIndex is not supported before SDL 2.0.12\")\n#endif\n\nstatic SDL_GameControllerType SDL_GameControllerTypeForIndex(int joystick_index)\n{\n\treturn SDL_CONTROLLER_TYPE_UNKNOWN;\n}\n\nstatic SDL_GameControllerType SDL_GameControllerGetType(SDL_GameController *gamecontroller)\n{\n\treturn SDL_CONTROLLER_TYPE_UNKNOWN;\n}\n\nstatic SDL_GameController * SDL_GameControllerFromPlayerIndex(int player_index)\n{\n\treturn NULL;\n}\n\nstatic void SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index)\n{\n\t// do nothing\n}\n\n#endif\n\n\n#if !(SDL_VERSION_ATLEAST(2,0,14))\n\n#define SDL_CONTROLLER_TYPE_VIRTUAL (6)\n#define SDL_CONTROLLER_TYPE_PS5 (7)\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GameControllerGetSerial is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerHasAxis is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerHasButton is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerGetNumTouchpads is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerGetNumTouchpadFingers is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerGetTouchpadFinger is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerHasSensor is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerSetSensorEnabled is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerIsSensorEnabled is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerGetSensorData is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerRumbleTriggers is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerHasLED is not supported before SDL 2.0.14\")\n#pragma message(\"SDL_GameControllerSetLED is not supported before SDL 2.0.14\")\n#endif\n\nstatic const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller)\n{\n\treturn NULL;\n}\n\nstatic SDL_bool SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)\n{\n\treturn SDL_FALSE;\n}\n\nstatic SDL_bool SDLCALL SDL_GameControllerHasButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)\n{\n\treturn SDL_FALSE;\n}\n\nstatic int SDLCALL SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller)\n{\n\treturn 0;\n}\n\nstatic int SDL_GameControllerGetNumTouchpadFingers(SDL_GameController *gamecontroller, int touchpad)\n{\n\treturn 0;\n}\n\nstatic int SDL_GameControllerGetTouchpadFinger(SDL_GameController *gamecontroller, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure)\n{\n\treturn -1;\n}\n\nstatic SDL_bool SDL_GameControllerHasSensor(SDL_GameController *gamecontroller, SDL_SensorType type)\n{\n\treturn SDL_FALSE;\n}\n\nstatic int SDL_GameControllerSetSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type, SDL_bool enabled)\n{\n\treturn -1;\n}\n\nstatic SDL_bool SDL_GameControllerIsSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type)\n{\n\treturn SDL_FALSE;\n}\n\nstatic int SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values)\n{\n\treturn -1;\n}\n\nstatic int SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms)\n{\n\treturn -1;\n}\n\nstatic SDL_bool SDL_GameControllerHasLED(SDL_GameController *gamecontroller)\n{\n\treturn SDL_FALSE;\n}\n\nstatic int SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint8 green, Uint8 blue)\n{\n\treturn -1;\n}\n\n#endif\n\n\n#if !(SDL_VERSION_ATLEAST(2,0,16))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GameControllerSendEffect is not supported before SDL 2.0.16\")\n#pragma message(\"SDL_GameControllerGetSensorDataRate is not supported before SDL 2.0.16\")\n#endif\n\nstatic int SDL_GameControllerSendEffect(SDL_GameController *gamecontroller, const void *data, int size)\n{\n\treturn -1;\n}\n\nstatic float SDL_GameControllerGetSensorDataRate(SDL_GameController *gamecontroller, SDL_SensorType type)\n{\n\treturn 0.0f;\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,18))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GameControllerHasRumble is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_GameControllerHasRumbleTriggers is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_GameControllerGetAppleSFSymbolsNameForButton is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_GameControllerGetAppleSFSymbolsNameForAxis is not supported before SDL 2.0.18\")\n#endif\n\nstatic SDL_bool SDL_GameControllerHasRumble(SDL_GameController *gamecontroller)\n{\n\treturn SDL_FALSE;\n}\n\nstatic SDL_bool SDL_GameControllerHasRumbleTriggers(SDL_GameController *gamecontroller)\n{\n\treturn SDL_FALSE;\n}\n\nstatic const char* SDL_GameControllerGetAppleSFSymbolsNameForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)\n{\n\treturn NULL;\n}\n\nstatic const char* SDL_GameControllerGetAppleSFSymbolsNameForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)\n{\n\treturn NULL;\n}\n\n#endif\n*/\nimport \"C\"\nimport (\n\t\"encoding/binary\"\n\t\"unsafe\"\n)\n\n// Types of game controller inputs.\nconst (\n\tCONTROLLER_BINDTYPE_NONE   = C.SDL_CONTROLLER_BINDTYPE_NONE\n\tCONTROLLER_BINDTYPE_BUTTON = C.SDL_CONTROLLER_BINDTYPE_BUTTON\n\tCONTROLLER_BINDTYPE_AXIS   = C.SDL_CONTROLLER_BINDTYPE_AXIS\n\tCONTROLLER_BINDTYPE_HAT    = C.SDL_CONTROLLER_BINDTYPE_HAT\n)\n\n// An enumeration of axes available from a controller.\n// (https://wiki.libsdl.org/SDL_GameControllerAxis)\nconst (\n\tCONTROLLER_AXIS_INVALID      = C.SDL_CONTROLLER_AXIS_INVALID\n\tCONTROLLER_AXIS_LEFTX        = C.SDL_CONTROLLER_AXIS_LEFTX\n\tCONTROLLER_AXIS_LEFTY        = C.SDL_CONTROLLER_AXIS_LEFTY\n\tCONTROLLER_AXIS_RIGHTX       = C.SDL_CONTROLLER_AXIS_RIGHTX\n\tCONTROLLER_AXIS_RIGHTY       = C.SDL_CONTROLLER_AXIS_RIGHTY\n\tCONTROLLER_AXIS_TRIGGERLEFT  = C.SDL_CONTROLLER_AXIS_TRIGGERLEFT\n\tCONTROLLER_AXIS_TRIGGERRIGHT = C.SDL_CONTROLLER_AXIS_TRIGGERRIGHT\n\tCONTROLLER_AXIS_MAX          = C.SDL_CONTROLLER_AXIS_MAX\n)\n\n// An enumeration of buttons available from a controller.\n// (https://wiki.libsdl.org/SDL_GameControllerButton)\nconst (\n\tCONTROLLER_BUTTON_INVALID       = C.SDL_CONTROLLER_BUTTON_INVALID\n\tCONTROLLER_BUTTON_A             = C.SDL_CONTROLLER_BUTTON_A\n\tCONTROLLER_BUTTON_B             = C.SDL_CONTROLLER_BUTTON_B\n\tCONTROLLER_BUTTON_X             = C.SDL_CONTROLLER_BUTTON_X\n\tCONTROLLER_BUTTON_Y             = C.SDL_CONTROLLER_BUTTON_Y\n\tCONTROLLER_BUTTON_BACK          = C.SDL_CONTROLLER_BUTTON_BACK\n\tCONTROLLER_BUTTON_GUIDE         = C.SDL_CONTROLLER_BUTTON_GUIDE\n\tCONTROLLER_BUTTON_START         = C.SDL_CONTROLLER_BUTTON_START\n\tCONTROLLER_BUTTON_LEFTSTICK     = C.SDL_CONTROLLER_BUTTON_LEFTSTICK\n\tCONTROLLER_BUTTON_RIGHTSTICK    = C.SDL_CONTROLLER_BUTTON_RIGHTSTICK\n\tCONTROLLER_BUTTON_LEFTSHOULDER  = C.SDL_CONTROLLER_BUTTON_LEFTSHOULDER\n\tCONTROLLER_BUTTON_RIGHTSHOULDER = C.SDL_CONTROLLER_BUTTON_RIGHTSHOULDER\n\tCONTROLLER_BUTTON_DPAD_UP       = C.SDL_CONTROLLER_BUTTON_DPAD_UP\n\tCONTROLLER_BUTTON_DPAD_DOWN     = C.SDL_CONTROLLER_BUTTON_DPAD_DOWN\n\tCONTROLLER_BUTTON_DPAD_LEFT     = C.SDL_CONTROLLER_BUTTON_DPAD_LEFT\n\tCONTROLLER_BUTTON_DPAD_RIGHT    = C.SDL_CONTROLLER_BUTTON_DPAD_RIGHT\n\tCONTROLLER_BUTTON_MAX           = C.SDL_CONTROLLER_BUTTON_MAX\n)\n\n// GameControllerBindType is a type of game controller input.\ntype GameControllerBindType C.SDL_GameControllerBindType\n\n// GameControllerAxis is an axis on a game controller.\n// (https://wiki.libsdl.org/SDL_GameControllerAxis)\ntype GameControllerAxis C.SDL_GameControllerAxis\n\n// GameControllerButton is a button on a game controller.\n// (https://wiki.libsdl.org/SDL_GameControllerButton)\ntype GameControllerButton C.SDL_GameControllerButton\n\n// GameController used to identify an SDL game controller.\ntype GameController C.SDL_GameController\n\n// GameControllerButtonBind SDL joystick layer binding for controller button/axis mapping.\ntype GameControllerButtonBind C.SDL_GameControllerButtonBind\n\nfunc (ctrl *GameController) cptr() *C.SDL_GameController {\n\treturn (*C.SDL_GameController)(unsafe.Pointer(ctrl))\n}\n\nfunc (axis GameControllerAxis) c() C.SDL_GameControllerAxis {\n\treturn C.SDL_GameControllerAxis(axis)\n}\n\nfunc (btn GameControllerButton) c() C.SDL_GameControllerButton {\n\treturn C.SDL_GameControllerButton(btn)\n}\n\n// GameControllerAddMapping adds support for controllers that SDL is unaware of or to cause an existing controller to have a different binding.\n// (https://wiki.libsdl.org/SDL_GameControllerAddMapping)\nfunc GameControllerAddMapping(mappingString string) int {\n\t_mappingString := C.CString(mappingString)\n\tdefer C.free(unsafe.Pointer(_mappingString))\n\treturn int(C.SDL_GameControllerAddMapping(_mappingString))\n}\n\n// GameControllerNumMappings returns the number of mappings installed.\nfunc GameControllerNumMappings() int {\n\treturn int(C.SDL_GameControllerNumMappings())\n}\n\n// GameControllerMappingForIndex returns the game controller mapping string at a particular index.\nfunc GameControllerMappingForIndex(index int) string {\n\tmappingString := C.SDL_GameControllerMappingForIndex(C.int(index))\n\tdefer C.free(unsafe.Pointer(mappingString))\n\treturn C.GoString(mappingString)\n}\n\n// GameControllerMappingForGUID returns the game controller mapping string for a given GUID.\n// (https://wiki.libsdl.org/SDL_GameControllerMappingForGUID)\nfunc GameControllerMappingForGUID(guid JoystickGUID) string {\n\tmappingString := C.SDL_GameControllerMappingForGUID(guid.c())\n\tdefer C.free(unsafe.Pointer(mappingString))\n\treturn C.GoString(mappingString)\n}\n\n// IsGameController reports whether the given joystick is supported by the game controller interface.\n// (https://wiki.libsdl.org/SDL_IsGameController)\nfunc IsGameController(index int) bool {\n\treturn C.SDL_IsGameController(C.int(index)) == C.SDL_TRUE\n}\n\n// GameControllerNameForIndex returns the implementation dependent name for the game controller.\n// (https://wiki.libsdl.org/SDL_GameControllerNameForIndex)\nfunc GameControllerNameForIndex(index int) string {\n\treturn C.GoString(C.SDL_GameControllerNameForIndex(C.int(index)))\n}\n\n// GameControllerMappingForDeviceIndex returns the game controller mapping string at a particular index.\nfunc GameControllerMappingForDeviceIndex(index int) string {\n\tmappingString := C.SDL_GameControllerMappingForDeviceIndex(C.int(index))\n\tdefer C.free(unsafe.Pointer(mappingString))\n\treturn C.GoString(mappingString)\n}\n\n// GameControllerOpen opens a gamecontroller for use.\n// (https://wiki.libsdl.org/SDL_GameControllerOpen)\nfunc GameControllerOpen(index int) *GameController {\n\treturn (*GameController)(C.SDL_GameControllerOpen(C.int(index)))\n}\n\n// GameControllerFromInstanceID returns the GameController associated with an instance id.\n// (https://wiki.libsdl.org/SDL_GameControllerFromInstanceID)\nfunc GameControllerFromInstanceID(joyid JoystickID) *GameController {\n\treturn (*GameController)(C.SDL_GameControllerFromInstanceID(joyid.c()))\n}\n\n// Name returns the implementation dependent name for an opened game controller.\n// (https://wiki.libsdl.org/SDL_GameControllerName)\nfunc (ctrl *GameController) Name() string {\n\treturn C.GoString(C.SDL_GameControllerName(ctrl.cptr()))\n}\n\n// PlayerIndex the player index of an opened game controller, or -1 if it's not available.\n// TODO: (https://wiki.libsdl.org/SDL_GameControllerGetPlayerIndex)\nfunc (ctrl *GameController) PlayerIndex() int {\n\treturn int(C.SDL_GameControllerGetPlayerIndex(ctrl.cptr()))\n}\n\n// Vendor returns the USB vendor ID of an opened controller, if available, 0 otherwise.\nfunc (ctrl *GameController) Vendor() int {\n\treturn int(C.SDL_GameControllerGetVendor(ctrl.cptr()))\n}\n\n// Product returns the USB product ID of an opened controller, if available, 0 otherwise.\nfunc (ctrl *GameController) Product() int {\n\treturn int(C.SDL_GameControllerGetProduct(ctrl.cptr()))\n}\n\n// ProductVersion returns the product version of an opened controller, if available, 0 otherwise.\nfunc (ctrl *GameController) ProductVersion() int {\n\treturn int(C.SDL_GameControllerGetProductVersion(ctrl.cptr()))\n}\n\n// Attached reports whether a controller has been opened and is currently connected.\n// (https://wiki.libsdl.org/SDL_GameControllerGetAttached)\nfunc (ctrl *GameController) Attached() bool {\n\treturn C.SDL_GameControllerGetAttached(ctrl.cptr()) == C.SDL_TRUE\n}\n\n// Mapping returns the current mapping of a Game Controller.\n// (https://wiki.libsdl.org/SDL_GameControllerMapping)\nfunc (ctrl *GameController) Mapping() string {\n\tmappingString := C.SDL_GameControllerMapping(ctrl.cptr())\n\tdefer C.free(unsafe.Pointer(mappingString))\n\treturn C.GoString(mappingString)\n}\n\n// Joystick returns the Joystick ID from a Game Controller. The game controller builds on the Joystick API, but to be able to use the Joystick's functions with a gamepad, you need to use this first to get the joystick object.\n// (https://wiki.libsdl.org/SDL_GameControllerGetJoystick)\nfunc (ctrl *GameController) Joystick() *Joystick {\n\treturn (*Joystick)(unsafe.Pointer(C.SDL_GameControllerGetJoystick(ctrl.cptr())))\n}\n\n// GameControllerEventState returns the current state of, enable, or disable events dealing with Game Controllers. This will not disable Joystick events, which can also be fired by a controller (see https://wiki.libsdl.org/SDL_JoystickEventState).\n// (https://wiki.libsdl.org/SDL_GameControllerEventState)\nfunc GameControllerEventState(state int) int {\n\treturn int(C.SDL_GameControllerEventState(C.int(state)))\n}\n\n// GameControllerUpdate manually pumps game controller updates if not using the loop.\n// (https://wiki.libsdl.org/SDL_GameControllerUpdate)\nfunc GameControllerUpdate() {\n\tC.SDL_GameControllerUpdate()\n}\n\n// GameControllerGetAxisFromString converts a string into an enum representation for a GameControllerAxis.\n// (https://wiki.libsdl.org/SDL_GameControllerGetAxisFromString)\nfunc GameControllerGetAxisFromString(pchString string) GameControllerAxis {\n\t_pchString := C.CString(pchString)\n\tdefer C.free(unsafe.Pointer(_pchString))\n\treturn GameControllerAxis(C.SDL_GameControllerGetAxisFromString(_pchString))\n}\n\n// GameControllerGetStringForAxis converts from an axis enum to a string.\n// (https://wiki.libsdl.org/SDL_GameControllerGetStringForAxis)\nfunc GameControllerGetStringForAxis(axis GameControllerAxis) string {\n\treturn C.GoString(C.SDL_GameControllerGetStringForAxis(axis.c()))\n}\n\n// BindForAxis returns the SDL joystick layer binding for a controller button mapping.\n// (https://wiki.libsdl.org/SDL_GameControllerGetBindForAxis)\nfunc (ctrl *GameController) BindForAxis(axis GameControllerAxis) GameControllerButtonBind {\n\treturn GameControllerButtonBind(C.SDL_GameControllerGetBindForAxis(ctrl.cptr(), axis.c()))\n}\n\n// Axis returns the current state of an axis control on a game controller.\n// (https://wiki.libsdl.org/SDL_GameControllerGetAxis)\nfunc (ctrl *GameController) Axis(axis GameControllerAxis) int16 {\n\treturn int16(C.SDL_GameControllerGetAxis(ctrl.cptr(), axis.c()))\n}\n\n// GameControllerGetButtonFromString turns a string into a button mapping.\n// (https://wiki.libsdl.org/SDL_GameControllerGetButtonFromString)\nfunc GameControllerGetButtonFromString(pchString string) GameControllerButton {\n\t_pchString := C.CString(pchString)\n\tdefer C.free(unsafe.Pointer(_pchString))\n\treturn GameControllerButton(C.SDL_GameControllerGetButtonFromString(_pchString))\n}\n\n// GameControllerGetStringForButton turns a button enum into a string mapping.\n// (https://wiki.libsdl.org/SDL_GameControllerGetStringForButton)\nfunc GameControllerGetStringForButton(btn GameControllerButton) string {\n\treturn C.GoString(C.SDL_GameControllerGetStringForButton(btn.c()))\n}\n\n// BindForButton returns the SDL joystick layer binding for this controller button mapping.\n// (https://wiki.libsdl.org/SDL_GameControllerGetBindForButton)\nfunc (ctrl *GameController) BindForButton(btn GameControllerButton) GameControllerButtonBind {\n\treturn GameControllerButtonBind(C.SDL_GameControllerGetBindForButton(ctrl.cptr(), btn.c()))\n}\n\n// Rumble triggers a rumble effect\n// Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.\n//\n// lowFrequencyRumble - The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF\n// highFrequencyRumble - The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF\n// durationMS - The duration of the rumble effect, in milliseconds\n//\n// Returns error if rumble isn't supported on this joystick.\n//\n// TODO: (https://wiki.libsdl.org/SDL_GameControllerRumble)\nfunc (ctrl *GameController) Rumble(lowFrequencyRumble, highFrequencyRumble uint16, durationMS uint32) error {\n\treturn errorFromInt(int(C.SDL_GameControllerRumble(ctrl.cptr(), C.Uint16(lowFrequencyRumble), C.Uint16(highFrequencyRumble), C.Uint32(durationMS))))\n}\n\n// Button returns the current state of a button on a game controller.\n// (https://wiki.libsdl.org/SDL_GameControllerGetButton)\nfunc (ctrl *GameController) Button(btn GameControllerButton) byte {\n\treturn byte(C.SDL_GameControllerGetButton(ctrl.cptr(), btn.c()))\n}\n\n// Close closes a game controller previously opened with GameControllerOpen().\n// (https://wiki.libsdl.org/SDL_GameControllerClose)\nfunc (ctrl *GameController) Close() {\n\tC.SDL_GameControllerClose(ctrl.cptr())\n}\n\n// Type returns the type of game controller input for this SDL joystick layer binding.\nfunc (bind *GameControllerButtonBind) Type() int {\n\treturn int(bind.bindType)\n}\n\n// Button returns button mapped for this SDL joystick layer binding.\nfunc (bind *GameControllerButtonBind) Button() int {\n\tval, _ := binary.Varint(bind.value[:4])\n\treturn int(val)\n}\n\n// Axis returns axis mapped for this SDL joystick layer binding.\nfunc (bind *GameControllerButtonBind) Axis() int {\n\tval, _ := binary.Varint(bind.value[:4])\n\treturn int(val)\n}\n\n// Hat returns hat mapped for this SDL joystick layer binding.\nfunc (bind *GameControllerButtonBind) Hat() int {\n\tval, _ := binary.Varint(bind.value[:4])\n\treturn int(val)\n}\n\n// HatMask returns hat mask for this SDL joystick layer binding.\nfunc (bind *GameControllerButtonBind) HatMask() int {\n\tval, _ := binary.Varint(bind.value[4:8])\n\treturn int(val)\n}\n\n// SendEffect sends a controller specific effect packet.\n// (https://wiki.libsdl.org/SDL_GameControllerSendEffect)\nfunc (ctrl *GameController) SendEffect(data []byte) (err error) {\n\t_size := C.int(len(data))\n\treturn errorFromInt(int(C.SDL_GameControllerSendEffect(ctrl.cptr(), unsafe.Pointer(&data[0]), _size)))\n}\n\n// GetSensorDataRate gets the data rate (number of events per second) of a game controller sensor.\n// (https://wiki.libsdl.org/SDL_GameControllerGetSensorDataRate)\nfunc (ctrl *GameController) SensorDataRate(typ SensorType) (rate float32) {\n\treturn float32(C.SDL_GameControllerGetSensorDataRate(ctrl.cptr(), C.SDL_SensorType(typ)))\n}\n\n// HasRumble queries whether a game controller has rumble support.\n// (https://wiki.libsdl.org/SDL_GameControllerHasRumble)\nfunc (ctrl *GameController) HasRumble() bool {\n\treturn C.SDL_GameControllerHasRumble(ctrl.cptr()) == C.SDL_TRUE\n}\n\n// HasRumbleTriggers queries whether a game controller has rumble support on triggers.\n// (https://wiki.libsdl.org/SDL_GameControllerHasRumbleTriggers)\nfunc (ctrl *GameController) HasRumbleTriggers() bool {\n\treturn C.SDL_GameControllerHasRumbleTriggers(ctrl.cptr()) == C.SDL_TRUE\n}\n\n// GetAppleSFSymbolsNameForButton returns the sfSymbolsName for a given button on a game controller on Apple platforms.\n// (https://wiki.libsdl.org/SDL_GameControllerGetAppleSFSymbolsNameForButton)\nfunc (ctrl *GameController) GetAppleSFSymbolsNameForButton(button GameControllerButton) (sfSymbolsName string) {\n\t_button := C.SDL_GameControllerButton(button)\n\t_sfSymbolsName := C.SDL_GameControllerGetAppleSFSymbolsNameForButton(ctrl.cptr(), _button)\n\tsfSymbolsName = C.GoString(_sfSymbolsName)\n\treturn\n}\n\n// GetAppleSFSymbolsNameForAxis returns the sfSymbolsName for a given axis on a game controller on Apple platforms.\n// (https://wiki.libsdl.org/SDL_GameControllerGetAppleSFSymbolsNameForAxis)\nfunc (ctrl *GameController) SDL_GameControllerGetAppleSFSymbolsNameForAxis(axis GameControllerAxis) (sfSymbolsName string) {\n\t_axis := C.SDL_GameControllerAxis(axis)\n\t_sfSymbolsName := C.SDL_GameControllerGetAppleSFSymbolsNameForAxis(ctrl.cptr(), _axis)\n\tsfSymbolsName = C.GoString(_sfSymbolsName)\n\treturn\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/gesture.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\n\n// GestureID is the unique id of the closest gesture to the performed stroke.\ntype GestureID C.SDL_GestureID\n\nfunc (g GestureID) c() C.SDL_GestureID {\n\treturn C.SDL_GestureID(g)\n}\n\n// RecordGesture begins recording a gesture on a specified touch device or all touch devices.\n// (https://wiki.libsdl.org/SDL_RecordGesture)\nfunc RecordGesture(t TouchID) int {\n\treturn int(C.SDL_RecordGesture(t.c()))\n}\n\n// SaveAllDollarTemplates saves all currently loaded Dollar Gesture templates.\n// (https://wiki.libsdl.org/SDL_SaveAllDollarTemplates)\nfunc SaveAllDollarTemplates(src *RWops) int {\n\treturn int(C.SDL_SaveAllDollarTemplates(src.cptr()))\n}\n\n// SaveDollarTemplate saves a currently loaded Dollar Gesture template.\n// (https://wiki.libsdl.org/SDL_SaveDollarTemplate)\nfunc SaveDollarTemplate(g GestureID, src *RWops) int {\n\treturn int(C.SDL_SaveDollarTemplate(g.c(), src.cptr()))\n}\n\n// LoadDollarTemplates loads Dollar Gesture templates from a file.\n// (https://wiki.libsdl.org/SDL_LoadDollarTemplates)\nfunc LoadDollarTemplates(t TouchID, src *RWops) int {\n\treturn int(C.SDL_LoadDollarTemplates(t.c(), src.cptr()))\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/guid.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !SDL_VERSION_ATLEAST(2,24,0)\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GUIDToString is not supported before SDL 2.24.0\")\n#pragma message(\"SDL_GUIDFromString is not supported before SDL 2.24.0\")\n#endif\n\ntypedef struct {\n    Uint8 data[16];\n} SDL_GUID;\n\nstatic inline void SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID)\n{\n\treturn;\n}\n\nstatic inline SDL_GUID SDL_GUIDFromString(const char *pchGUID)\n{\n\tSDL_GUID guid;\n\treturn guid;\n}\n#endif\n*/\nimport \"C\"\nimport (\n\t\"unsafe\"\n)\n\ntype GUID C.SDL_GUID\n\n// ToString returns an ASCII string representation for a given GUID.\nfunc (guid GUID) ToString() (ascii string) {\n\t_cap := C.size_t(33)\n\t_buf := (*C.char)(C.SDL_malloc(_cap))\n\tdefer C.SDL_free(unsafe.Pointer(_buf))\n\tC.SDL_GUIDToString(C.SDL_GUID(guid), _buf, C.int(_cap))\n\treturn C.GoString(_buf)\n}\n\n// GUIDFromString converts a GUID string into a GUID structure.\nfunc GUIDFromString(ascii string) (guid GUID) {\n\t_ascii := C.CString(ascii)\n\treturn GUID(C.SDL_GUIDFromString(_ascii))\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/haptic.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\nimport \"unsafe\"\n\n// Haptic effects.\n// (https://wiki.libsdl.org/SDL_HapticEffect)\nconst (\n\tHAPTIC_CONSTANT     = C.SDL_HAPTIC_CONSTANT     // constant haptic effect\n\tHAPTIC_SINE         = C.SDL_HAPTIC_SINE         // periodic haptic effect that simulates sine waves\n\tHAPTIC_LEFTRIGHT    = C.SDL_HAPTIC_LEFTRIGHT    // haptic effect for direct control over high/low frequency motors\n\tHAPTIC_TRIANGLE     = C.SDL_HAPTIC_TRIANGLE     // periodic haptic effect that simulates triangular waves\n\tHAPTIC_SAWTOOTHUP   = C.SDL_HAPTIC_SAWTOOTHUP   // periodic haptic effect that simulates saw tooth up waves\n\tHAPTIC_SAWTOOTHDOWN = C.SDL_HAPTIC_SAWTOOTHDOWN // periodic haptic effect that simulates saw tooth down waves\n\tHAPTIC_RAMP         = C.SDL_HAPTIC_RAMP         // ramp haptic effect\n\tHAPTIC_SPRING       = C.SDL_HAPTIC_SPRING       // condition haptic effect that simulates a spring.  Effect is based on the axes position\n\tHAPTIC_DAMPER       = C.SDL_HAPTIC_DAMPER       // condition haptic effect that simulates dampening.  Effect is based on the axes velocity\n\tHAPTIC_INERTIA      = C.SDL_HAPTIC_INERTIA      // condition haptic effect that simulates inertia.  Effect is based on the axes acceleration\n\tHAPTIC_FRICTION     = C.SDL_HAPTIC_FRICTION     // condition haptic effect that simulates friction.  Effect is based on the axes movement\n\tHAPTIC_CUSTOM       = C.SDL_HAPTIC_CUSTOM       // user defined custom haptic effect\n\tHAPTIC_GAIN         = C.SDL_HAPTIC_GAIN         // device supports setting the global gain\n\tHAPTIC_AUTOCENTER   = C.SDL_HAPTIC_AUTOCENTER   // device supports setting autocenter\n\tHAPTIC_STATUS       = C.SDL_HAPTIC_STATUS       // device can be queried for effect status\n\tHAPTIC_PAUSE        = C.SDL_HAPTIC_PAUSE        // device can be paused\n\t//HAPTIC_SQUARE = C.SDL_HAPTIC_SQUARE (back in SDL 2.1)\n)\n\n// Direction encodings.\n// (https://wiki.libsdl.org/SDL_HapticDirection)\nconst (\n\tHAPTIC_POLAR     = C.SDL_HAPTIC_POLAR     // uses polar coordinates for the direction\n\tHAPTIC_CARTESIAN = C.SDL_HAPTIC_CARTESIAN // uses cartesian coordinates for the direction\n\tHAPTIC_SPHERICAL = C.SDL_HAPTIC_SPHERICAL // uses spherical coordinates for the direction\n\tHAPTIC_INFINITY  = C.SDL_HAPTIC_INFINITY  // used to play a device an infinite number of times\n)\n\n// Haptic identifies an SDL haptic.\n// (https://wiki.libsdl.org/CategoryForceFeedback)\ntype Haptic C.SDL_Haptic\n\n// HapticDirection contains a haptic direction.\n// (https://wiki.libsdl.org/SDL_HapticDirection)\ntype HapticDirection struct {\n\tType byte     // the type of encoding\n\tDir  [3]int32 // the encoded direction\n}\n\n// HapticConstant contains a template for a constant effect.\n// (https://wiki.libsdl.org/SDL_HapticConstant)\ntype HapticConstant struct {\n\tType         uint16          // HAPTIC_CONSTANT\n\tDirection    HapticDirection // direction of the effect\n\tLength       uint32          // duration of the effect\n\tDelay        uint16          // delay before starting the effect\n\tButton       uint16          // button that triggers the effect\n\tInterval     uint16          // how soon it can be triggered again after button\n\tLevel        int16           // strength of the constant effect\n\tAttackLength uint16          // duration of the attack\n\tAttackLevel  uint16          // level at the start of the attack\n\tFadeLength   uint16          // duration of the fade\n\tFadeLevel    uint16          // level at the end of the fade\n}\n\nfunc (he *HapticConstant) cHapticEffect() *C.SDL_HapticEffect {\n\treturn (*C.SDL_HapticEffect)(unsafe.Pointer(he))\n}\n\n// HapticPeriodic contains a template for a periodic effect.\n// (https://wiki.libsdl.org/SDL_HapticPeriodic)\ntype HapticPeriodic struct {\n\tType         uint16          // HAPTIC_SINE, HAPTIC_LEFTRIGHT, HAPTIC_TRIANGLE, HAPTIC_SAWTOOTHUP, HAPTIC_SAWTOOTHDOWN\n\tDirection    HapticDirection // direction of the effect\n\tLength       uint32          // duration of the effect\n\tDelay        uint16          // delay before starting the effect\n\tButton       uint16          // button that triggers the effect\n\tInterval     uint16          // how soon it can be triggered again after button\n\tPeriod       uint16          // period of the wave\n\tMagnitude    int16           // peak value; if negative, equivalent to 180 degrees extra phase shift\n\tOffset       int16           // mean value of the wave\n\tPhase        uint16          // positive phase shift given by hundredth of a degree\n\tAttackLength uint16          // duration of the attack\n\tAttackLevel  uint16          // level at the start of the attack\n\tFadeLength   uint16          // duration of the fade\n\tFadeLevel    uint16          // level at the end of the fade\n}\n\nfunc (he *HapticPeriodic) cHapticEffect() *C.SDL_HapticEffect {\n\treturn (*C.SDL_HapticEffect)(unsafe.Pointer(he))\n}\n\n// HapticCondition contains a template for a condition effect.\n// (https://wiki.libsdl.org/SDL_HapticCondition)\ntype HapticCondition struct {\n\tType       uint16          // HAPTIC_SPRING, HAPTIC_DAMPER, HAPTIC_INERTIA, HAPTIC_FRICTION\n\tDirection  HapticDirection // direction of the effect - not used at the moment\n\tLength     uint32          // duration of the effect\n\tDelay      uint16          // delay before starting the effect\n\tButton     uint16          // button that triggers the effect\n\tInterval   uint16          // how soon it can be triggered again after button\n\tRightSat   [3]uint16       // level when joystick is to the positive side; max 0xFFFF\n\tLeftSat    [3]uint16       // level when joystick is to the negative side; max 0xFFFF\n\tRightCoeff [3]int16        // how fast to increase the force towards the positive side\n\tLeftCoeff  [3]int16        // how fast to increase the force towards the negative side\n\tDeadband   [3]uint16       // size of the dead zone; max 0xFFFF: whole axis-range when 0-centered\n\tCenter     [3]int16        // position of the dead zone\n}\n\nfunc (he *HapticCondition) cHapticEffect() *C.SDL_HapticEffect {\n\treturn (*C.SDL_HapticEffect)(unsafe.Pointer(he))\n}\n\n// HapticRamp contains a template for a ramp effect.\n// (https://wiki.libsdl.org/SDL_HapticRamp)\ntype HapticRamp struct {\n\tType         uint16          // HAPTIC_RAMP\n\tDirection    HapticDirection // direction of the effect\n\tLength       uint32          // duration of the effect\n\tDelay        uint16          // delay before starting the effect\n\tButton       uint16          // button that triggers the effect\n\tInterval     uint16          // how soon it can be triggered again after button\n\tStart        int16           // beginning strength level\n\tEnd          int16           // ending strength level\n\tAttackLength uint16          // duration of the attack\n\tAttackLevel  uint16          // level at the start of the attack\n\tFadeLength   uint16          // duration of the fade\n\tFadeLevel    uint16          // level at the end of the fade\n}\n\nfunc (he *HapticRamp) cHapticEffect() *C.SDL_HapticEffect {\n\treturn (*C.SDL_HapticEffect)(unsafe.Pointer(he))\n}\n\n// HapticLeftRight contains a template for a left/right effect.\n// (https://wiki.libsdl.org/SDL_HapticLeftRight)\ntype HapticLeftRight struct {\n\tType           uint16 // HAPTIC_LEFTRIGHT\n\tLength         uint32 // duration of the effect\n\tLargeMagnitude uint16 // control of the large controller motor\n\tSmallMagnitude uint16 // control of the small controller motor\n}\n\nfunc (he *HapticLeftRight) cHapticEffect() *C.SDL_HapticEffect {\n\treturn (*C.SDL_HapticEffect)(unsafe.Pointer(he))\n}\n\n// HapticCustom contains a template for a custom effect.\n// (https://wiki.libsdl.org/SDL_HapticCustom)\ntype HapticCustom struct {\n\tType         uint16          // SDL_HAPTIC_CUSTOM\n\tDirection    HapticDirection // direction of the effect\n\tLength       uint32          // duration of the effect\n\tDelay        uint16          // delay before starting the effect\n\tButton       uint16          // button that triggers the effect\n\tInterval     uint16          // how soon it can be triggered again after button\n\tChannels     uint8           // axes to use, minimum of 1\n\tPeriod       uint16          // sample periods\n\tSamples      uint16          // amount of samples\n\tData         *uint16         // should contain channels*samples items\n\tAttackLength uint16          // duration of the attack\n\tAttackLevel  uint16          // level at the start of the attack\n\tFadeLength   uint16          // duration of the fade\n\tFadeLevel    uint16          // level at the end of the fade\n}\n\nfunc (he *HapticCustom) cHapticEffect() *C.SDL_HapticEffect {\n\treturn (*C.SDL_HapticEffect)(unsafe.Pointer(he))\n}\n\n// HapticEffect union that contains the generic template for any haptic effect.\n// (https://wiki.libsdl.org/SDL_HapticEffect)\ntype HapticEffect interface {\n\tcHapticEffect() *C.SDL_HapticEffect\n}\n\nfunc (h *Haptic) cptr() *C.SDL_Haptic {\n\treturn (*C.SDL_Haptic)(unsafe.Pointer(h))\n}\n\n// NumHaptics returns the number of haptic devices attached to the system.\n// (https://wiki.libsdl.org/SDL_NumHaptics)\nfunc NumHaptics() (int, error) {\n\ti := int(C.SDL_NumHaptics())\n\treturn i, errorFromInt(i)\n}\n\n// HapticName returns the implementation dependent name of a haptic device.\n// (https://wiki.libsdl.org/SDL_HapticName)\nfunc HapticName(index int) (string, error) {\n\tname := C.SDL_HapticName(C.int(index))\n\tif name == nil {\n\t\treturn \"\", GetError()\n\t}\n\treturn C.GoString(name), nil\n}\n\n// HapticOpen opens a haptic device for use.\n// (https://wiki.libsdl.org/SDL_HapticOpen)\nfunc HapticOpen(index int) (*Haptic, error) {\n\thaptic := (*Haptic)(unsafe.Pointer(C.SDL_HapticOpen(C.int(index))))\n\tif haptic == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn haptic, nil\n}\n\n// HapticOpened reports whether the haptic device at the designated index has been opened.\n// (https://wiki.libsdl.org/SDL_HapticOpened)\nfunc HapticOpened(index int) (bool, error) {\n\tret := int(C.SDL_HapticOpened(C.int(index)))\n\tif ret == 0 {\n\t\treturn false, GetError()\n\t}\n\treturn ret == 1, nil\n}\n\n// HapticIndex returns the index of a haptic device.\n// (https://wiki.libsdl.org/SDL_HapticIndex)\nfunc HapticIndex(h *Haptic) (int, error) {\n\ti := int(C.SDL_HapticIndex(h.cptr()))\n\treturn i, errorFromInt(i)\n}\n\n// MouseIsHaptic reports whether or not the current mouse has haptic capabilities.\n// (https://wiki.libsdl.org/SDL_MouseIsHaptic)\nfunc MouseIsHaptic() (bool, error) {\n\tret := int(C.SDL_MouseIsHaptic())\n\treturn ret == C.SDL_TRUE, errorFromInt(ret)\n}\n\n// HapticOpenFromMouse open a haptic device from the current mouse.\n// (https://wiki.libsdl.org/SDL_HapticOpenFromMouse)\nfunc HapticOpenFromMouse() (*Haptic, error) {\n\thaptic := (*Haptic)(unsafe.Pointer(C.SDL_HapticOpenFromMouse()))\n\tif haptic == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn haptic, nil\n}\n\n// JoystickIsHaptic reports whether a joystick has haptic features.\n// (https://wiki.libsdl.org/SDL_JoystickIsHaptic)\nfunc JoystickIsHaptic(joy *Joystick) (bool, error) {\n\tret := int(C.SDL_JoystickIsHaptic(joy.cptr()))\n\treturn ret == C.SDL_TRUE, errorFromInt(ret)\n}\n\n// HapticOpenFromJoystick opens a haptic device for use from a joystick device.\n// (https://wiki.libsdl.org/SDL_HapticOpenFromJoystick)\nfunc HapticOpenFromJoystick(joy *Joystick) (*Haptic, error) {\n\thaptic := (*Haptic)(unsafe.Pointer(C.SDL_HapticOpenFromJoystick(joy.cptr())))\n\tif haptic == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn haptic, nil\n}\n\n// Close closes a haptic device previously opened with HapticOpen().\n// (https://wiki.libsdl.org/SDL_HapticClose)\nfunc (h *Haptic) Close() {\n\tC.SDL_HapticClose(h.cptr())\n}\n\n// NumAxes returns the number of haptic axes the device has.\n// (https://wiki.libsdl.org/SDL_HapticNumAxes)\nfunc (h *Haptic) NumAxes() (int, error) {\n\ti := int(C.SDL_HapticNumAxes(h.cptr()))\n\treturn i, errorFromInt(i)\n}\n\n// NumEffects returns the number of effects a haptic device can store.\n// (https://wiki.libsdl.org/SDL_HapticNumEffects)\nfunc (h *Haptic) NumEffects() (int, error) {\n\ti := int(C.SDL_HapticNumEffects(h.cptr()))\n\treturn i, errorFromInt(i)\n}\n\n// NumEffectsPlaying returns the number of effects a haptic device can play at the same time.\n// (https://wiki.libsdl.org/SDL_HapticNumEffectsPlaying)\nfunc (h *Haptic) NumEffectsPlaying() (int, error) {\n\ti := int(C.SDL_HapticNumEffectsPlaying(h.cptr()))\n\treturn i, errorFromInt(i)\n}\n\n// Query returns haptic device's supported features in bitwise manner.\n// (https://wiki.libsdl.org/SDL_HapticQuery)\nfunc (h *Haptic) Query() (uint32, error) {\n\ti := uint32(C.SDL_HapticQuery(h.cptr()))\n\tif i == 0 {\n\t\treturn 0, GetError()\n\t}\n\treturn i, nil\n}\n\n// EffectSupported reports whether an effect is supported by a haptic device.\n// Pass pointer to a Haptic struct (Constant|Periodic|Condition|Ramp|LeftRight|Custom) instead of HapticEffect union.\n// (https://wiki.libsdl.org/SDL_HapticEffectSupported)\nfunc (h *Haptic) EffectSupported(he HapticEffect) (bool, error) {\n\tret := int(C.SDL_HapticEffectSupported(\n\t\th.cptr(),\n\t\the.cHapticEffect()))\n\treturn ret == C.SDL_TRUE, errorFromInt(ret)\n}\n\n// NewEffect creates a new haptic effect on a specified device.\n// Pass pointer to a Haptic struct (Constant|Periodic|Condition|Ramp|LeftRight|Custom) instead of HapticEffect union.\n// (https://wiki.libsdl.org/SDL_HapticNewEffect)\nfunc (h *Haptic) NewEffect(he HapticEffect) (int, error) {\n\tret := int(C.SDL_HapticNewEffect(\n\t\th.cptr(),\n\t\the.cHapticEffect()))\n\treturn ret, errorFromInt(ret)\n}\n\n// UpdateEffect updates the properties of an effect.\n// Pass pointer to a Haptic struct (Constant|Periodic|Condition|Ramp|LeftRight|Custom) instead of HapticEffect union.\n// (https://wiki.libsdl.org/SDL_HapticUpdateEffect)\nfunc (h *Haptic) UpdateEffect(effect int, data HapticEffect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticUpdateEffect(\n\t\t\th.cptr(),\n\t\t\tC.int(effect),\n\t\t\tdata.cHapticEffect())))\n}\n\n// RunEffect runs the haptic effect on its associated haptic device.\n// (https://wiki.libsdl.org/SDL_HapticRunEffect)\nfunc (h *Haptic) RunEffect(effect int, iterations uint32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticRunEffect(\n\t\t\th.cptr(),\n\t\t\tC.int(effect),\n\t\t\tC.Uint32(iterations))))\n}\n\n// StopEffect stops the haptic effect on its associated haptic device.\n// (https://wiki.libsdl.org/SDL_HapticStopEffect)\nfunc (h *Haptic) StopEffect(effect int) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticStopEffect(h.cptr(), C.int(effect))))\n}\n\n// DestroyEffect destroys a haptic effect on the device.\n// (https://wiki.libsdl.org/SDL_HapticDestroyEffect)\nfunc (h *Haptic) DestroyEffect(effect int) {\n\tC.SDL_HapticDestroyEffect(h.cptr(), C.int(effect))\n}\n\n// GetEffectStatus returns the status of the current effect on the specified haptic device.\n// (https://wiki.libsdl.org/SDL_HapticGetEffectStatus)\nfunc (h *Haptic) GetEffectStatus(effect int) (int, error) {\n\ti := int(C.SDL_HapticGetEffectStatus(h.cptr(), C.int(effect)))\n\treturn i, errorFromInt(i)\n\n}\n\n// SetGain sets the global gain of the specified haptic device.\n// (https://wiki.libsdl.org/SDL_HapticSetGain)\nfunc (h *Haptic) SetGain(gain int) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticSetGain(h.cptr(), C.int(gain))))\n}\n\n// SetAutocenter sets the global autocenter of the device.\n// (https://wiki.libsdl.org/SDL_HapticSetAutocenter)\nfunc (h *Haptic) SetAutocenter(autocenter int) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticSetAutocenter(h.cptr(), C.int(autocenter))))\n}\n\n// Pause pauses a haptic device.\n// (https://wiki.libsdl.org/SDL_HapticPause)\nfunc (h *Haptic) Pause() error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticPause(h.cptr())))\n}\n\n// Unpause unpauses a haptic device.\n// (https://wiki.libsdl.org/SDL_HapticUnpause)\nfunc (h *Haptic) Unpause() error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticUnpause(h.cptr())))\n}\n\n// StopAll stops all the currently playing effects on a haptic device.\n// (https://wiki.libsdl.org/SDL_HapticStopAll)\nfunc (h *Haptic) StopAll() error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticStopAll(h.cptr())))\n}\n\n// RumbleSupported reports whether rumble is supported on a haptic device.\n// (https://wiki.libsdl.org/SDL_HapticRumbleSupported)\nfunc (h *Haptic) RumbleSupported() (bool, error) {\n\tret := int(C.SDL_HapticRumbleSupported(h.cptr()))\n\treturn ret == C.SDL_TRUE, errorFromInt(ret)\n}\n\n// RumbleInit initializes the haptic device for simple rumble playback.\n// (https://wiki.libsdl.org/SDL_HapticRumbleInit)\nfunc (h *Haptic) RumbleInit() error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticRumbleInit(h.cptr())))\n}\n\n// RumblePlay runs a simple rumble effect on a haptic device.\n// (https://wiki.libsdl.org/SDL_HapticRumblePlay)\nfunc (h *Haptic) RumblePlay(strength float32, length uint32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticRumblePlay(h.cptr(), C.float(strength), C.Uint32(length))))\n}\n\n// RumbleStop stops the simple rumble on a haptic device.\n// (https://wiki.libsdl.org/SDL_HapticRumbleStop)\nfunc (h *Haptic) RumbleStop() error {\n\treturn errorFromInt(int(\n\t\tC.SDL_HapticRumbleStop(h.cptr())))\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/helpers.go",
    "content": "package sdl\n\n// Btoi returns 0 or 1 according to the value of b.\nfunc Btoi(b bool) int {\n\tif b == true {\n\t\treturn 1\n\t}\n\n\treturn 0\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/hidapi.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,18))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_hid_init is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_exit is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_device_change_count is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_enumerate is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_free_enumeration is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_open is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_open_path is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_write is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_read_timeout is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_read is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_set_nonblocking is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_send_feature_report is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_get_feature_report is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_close is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_get_manufacturer_string is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_get_product_string is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_get_serial_number_string is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_get_indexed_string is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_hid_ble_scan is not supported before SDL 2.0.18\")\n#endif\n\nstruct SDL_hid_device_;\ntypedef struct SDL_hid_device_ SDL_hid_device; // opaque hidapi structure\n\n// hidapi info structure\n// Information about a connected HID device\ntypedef struct SDL_hid_device_info\n{\n    // Platform-specific device path\n    char *path;\n\n    // Device Vendor ID\n    unsigned short vendor_id;\n\n    // Device Product ID\n    unsigned short product_id;\n\n    // Serial Number\n    wchar_t *serial_number;\n\n    // Device Release Number in binary-coded decimal, also known as Device Version Number\n    unsigned short release_number;\n\n    // Manufacturer String\n    wchar_t *manufacturer_string;\n\n    // Product string\n    wchar_t *product_string;\n\n    // Usage Page for this Device/Interface (Windows/Mac only).\n    unsigned short usage_page;\n\n    // Usage for this Device/Interface (Windows/Mac only).\n    unsigned short usage;\n\n    // The USB interface which this logical device represents.\n    // Valid on both Linux implementations in all cases.\n    // Valid on the Windows implementation only if the device\n    // contains more than one interface.\n    int interface_number;\n\n    // Additional information about the USB interface.\n    // Valid on libusb and Android implementations.\n    int interface_class;\n    int interface_subclass;\n    int interface_protocol;\n\n    // Pointer to the next device\n    struct SDL_hid_device_info *next;\n} SDL_hid_device_info;\n\nstatic int SDL_hid_init(void)\n{\n\treturn -1;\n}\n\nstatic int SDL_hid_exit(void)\n{\n\treturn -1;\n}\n\nstatic Uint32 SDL_hid_device_change_count(void)\n{\n\treturn 0;\n}\n\nstatic SDL_hid_device_info * SDL_hid_enumerate(unsigned short vendor_id, unsigned short product_id)\n{\n\treturn NULL;\n}\n\nstatic void SDL_hid_free_enumeration(SDL_hid_device_info *devs)\n{\n}\n\nstatic SDL_hid_device * SDL_hid_open(unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number)\n{\n\treturn NULL;\n}\n\nstatic SDL_hid_device * SDL_hid_open_path(const char *path, int bExclusive)\n{\n\treturn NULL;\n}\n\nstatic int SDL_hid_write(SDL_hid_device *dev, const unsigned char *data, size_t length)\n{\n\treturn -1;\n}\n\nstatic int SDL_hid_read_timeout(SDL_hid_device *dev, unsigned char *data, size_t length, int milliseconds)\n{\n\treturn -1;\n}\n\nstatic int SDL_hid_read(SDL_hid_device *dev, unsigned char *data, size_t length)\n{\n\treturn -1;\n}\n\nstatic int SDL_hid_set_nonblocking(SDL_hid_device *dev, int nonblock)\n{\n\treturn -1;\n}\n\nstatic int SDL_hid_send_feature_report(SDL_hid_device *dev, const unsigned char *data, size_t length)\n{\n\treturn -1;\n}\n\nstatic int SDL_hid_get_feature_report(SDL_hid_device *dev, unsigned char *data, size_t length)\n{\n\treturn -1;\n}\n\nstatic void SDL_hid_close(SDL_hid_device *dev)\n{\n}\n\nstatic int SDL_hid_get_manufacturer_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen)\n{\n\treturn -1;\n}\n\nstatic int SDL_hid_get_product_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen)\n{\n\treturn -1;\n}\n\nstatic int SDL_hid_get_serial_number_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen)\n{\n\treturn -1;\n}\n\nstatic int SDL_hid_get_indexed_string(SDL_hid_device *dev, int string_index, wchar_t *string, size_t maxlen)\n{\n\treturn -1;\n}\n\nstatic void SDL_hid_ble_scan(SDL_bool active)\n{\n}\n\n#endif\n*/\nimport \"C\"\nimport \"unsafe\"\n\ntype HIDDevice C.SDL_hid_device\n\ntype HIDDeviceInfo struct {\n\tpath               *C.char\n\tVendorID           uint16\n\tProductID          uint16\n\tSerialNumber       *C.wchar_t\n\tReleaseNumber      uint16\n\tManufacturerString *C.wchar_t\n\tProductString      *C.wchar_t\n\tUsagePage          uint16\n\tUsage              uint16\n\tInterfaceNumber    int32\n\tInterfaceClass     int32\n\tInterfaceSubclass  int32\n\tInterfaceProtocol  int32\n\tnext               *HIDDeviceInfo\n}\n\nfunc (info *HIDDeviceInfo) Path() string {\n\treturn C.GoString(info.path)\n}\n\n// HIDInit initializes the HIDAPI library.\n// (https://wiki.libsdl.org/SDL_hid_init)\nfunc HIDInit() (err error) {\n\tret := C.SDL_hid_init()\n\treturn errorFromInt(int(ret))\n}\n\n// HIDExit finalizes the HIDAPI library.\n// (https://wiki.libsdl.org/SDL_hid_exit)\nfunc HIDExit() (err error) {\n\tret := C.SDL_hid_exit()\n\treturn errorFromInt(int(ret))\n}\n\n// HIDDeviceChangeCount checks to see if devices may have been added or removed.\n// (https://wiki.libsdl.org/SDL_hid_device_change_count)\nfunc HIDDeviceChangeCount() (n uint32) {\n\treturn uint32(C.SDL_hid_device_change_count())\n}\n\n// HIDEnumerate enumerates the HID devices.\n// (https://wiki.libsdl.org/SDL_hid_enumerate)\nfunc HIDEnumerate(vendorID, productID uint16) (info *HIDDeviceInfo) {\n\t_vendorID := C.Uint16(vendorID)\n\t_productID := C.Uint16(productID)\n\tinfo = (*HIDDeviceInfo)(unsafe.Pointer(C.SDL_hid_enumerate(_vendorID, _productID)))\n\treturn\n}\n\n// HIDFreeEnumeration frees an enumeration Linked List.\n// (https://wiki.libsdl.org/SDL_hid_free_enumeration)\nfunc HIDFreeEnumeration(info *HIDDeviceInfo) {\n\t_info := (*C.SDL_hid_device_info)(unsafe.Pointer(info))\n\tC.SDL_hid_free_enumeration(_info)\n}\n\n// HIDOpen opens a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number.\n// (https://wiki.libsdl.org/SDL_hid_open)\nfunc HIDOpen(vendorID, productID uint16, _serialNumber *C.wchar_t) (device *HIDDevice) {\n\t_vendorID := C.Uint16(vendorID)\n\t_productID := C.Uint16(productID)\n\t_device := C.SDL_hid_open(_vendorID, _productID, _serialNumber)\n\treturn (*HIDDevice)(_device)\n}\n\n// HIDOpenPath opens a HID device by its path name.\n// (https://wiki.libsdl.org/SDL_hid_open_path)\nfunc HIDOpenPath(path string, exclusive bool) (device *HIDDevice) {\n\t_path := C.CString(path)\n\tdefer C.free(unsafe.Pointer(_path))\n\t_exclusive := C.int(0)\n\tif exclusive {\n\t\t_exclusive = C.int(1)\n\t}\n\t_device := C.SDL_hid_open_path(_path, _exclusive)\n\treturn (*HIDDevice)(_device)\n}\n\n// Write writes an Output report to a HID device.\n// (https://wiki.libsdl.org/SDL_hid_write)\nfunc (device *HIDDevice) Write(data []byte) (n int, err error) {\n\t_length := C.size_t(len(data))\n\t_data := (*C.uchar)(unsafe.Pointer(&data[0]))\n\t_device := (*C.SDL_hid_device)(device)\n\tn = int(C.SDL_hid_write(_device, _data, _length))\n\treturn n, errorFromInt(n)\n}\n\n// ReadTimeout reads an Input report from a HID device with timeout.\n// (https://wiki.libsdl.org/SDL_hid_read_timeout)\nfunc (device *HIDDevice) ReadTimeout(data []byte, milliseconds int) (n int, err error) {\n\t_length := C.size_t(len(data))\n\t_data := (*C.uchar)(unsafe.Pointer(&data[0]))\n\t_device := (*C.SDL_hid_device)(device)\n\t_milliseconds := C.int(milliseconds)\n\tn = int(C.SDL_hid_read_timeout(_device, _data, _length, _milliseconds))\n\treturn n, errorFromInt(n)\n}\n\n// Read an Input report from a HID device.\n// (https://wiki.libsdl.org/SDL_hid_read)\nfunc (device *HIDDevice) Read(data []byte) (n int, err error) {\n\t_length := C.size_t(len(data))\n\t_data := (*C.uchar)(unsafe.Pointer(&data[0]))\n\t_device := (*C.SDL_hid_device)(device)\n\tn = int(C.SDL_hid_read(_device, _data, _length))\n\treturn n, errorFromInt(n)\n}\n\n// SetNonBlocking sets the device handle to be non-blocking.\n// (https://wiki.libsdl.org/SDL_hid_set_nonblocking)\nfunc (device *HIDDevice) SetNonBlocking(nonblock bool) (err error) {\n\t_device := (*C.SDL_hid_device)(device)\n\t_nonblock := C.int(Btoi(nonblock))\n\treturn errorFromInt(int(C.SDL_hid_set_nonblocking(_device, _nonblock)))\n}\n\n// SendFeatureReport sends a Feature report to the device.\n// (https://wiki.libsdl.org/SDL_hid_send_feature_report)\nfunc (device *HIDDevice) SendFeatureReport(data []byte) (n int, err error) {\n\t_length := C.size_t(len(data))\n\t_data := (*C.uchar)(unsafe.Pointer(&data[0]))\n\t_device := (*C.SDL_hid_device)(device)\n\tn = int(C.SDL_hid_send_feature_report(_device, _data, _length))\n\treturn n, errorFromInt(n)\n}\n\n// GetFeatureReport gets a feature report from a HID device.\n// (https://wiki.libsdl.org/SDL_hid_get_feature_report)\nfunc (device *HIDDevice) GetFeatureReport(data []byte) (n int, err error) {\n\t_length := C.size_t(len(data))\n\t_data := (*C.uchar)(unsafe.Pointer(&data[0]))\n\t_device := (*C.SDL_hid_device)(device)\n\tn = int(C.SDL_hid_get_feature_report(_device, _data, _length))\n\treturn n, errorFromInt(n)\n}\n\n// Close closes a HID device.\n// (https://wiki.libsdl.org/SDL_hid_close)\nfunc (device *HIDDevice) Close() {\n\t_device := (*C.SDL_hid_device)(device)\n\tC.SDL_hid_close(_device)\n}\n\n// GetManufacturerString gets The Manufacturer String from a HID device.\n// (https://wiki.libsdl.org/SDL_hid_get_manufacturer_string)\nfunc (device *HIDDevice) GetManufacturerString(_str *C.wchar_t, _maxlen C.size_t) (err error) {\n\t_device := (*C.SDL_hid_device)(device)\n\treturn errorFromInt(int(C.SDL_hid_get_manufacturer_string(_device, _str, _maxlen)))\n}\n\n// GetProductString gets The Product String from a HID device.\n// (https://wiki.libsdl.org/SDL_hid_get_product_string)\nfunc (device *HIDDevice) GetProductString(_str *C.wchar_t, _maxlen C.size_t) (err error) {\n\t_device := (*C.SDL_hid_device)(device)\n\treturn errorFromInt(int(C.SDL_hid_get_product_string(_device, _str, _maxlen)))\n}\n\n// GetSerialNumberString gets The SerialNumber String from a HID device.\n// (https://wiki.libsdl.org/SDL_hid_get_serial_number_string)\nfunc (device *HIDDevice) GetSerialNumberString(_str *C.wchar_t, _maxlen C.size_t) (err error) {\n\t_device := (*C.SDL_hid_device)(device)\n\treturn errorFromInt(int(C.SDL_hid_get_serial_number_string(_device, _str, _maxlen)))\n}\n\n// GetIndexedString gets a string from a HID device, based on its string index.\n// (https://wiki.libsdl.org/SDL_hid_get_indexed_string)\nfunc (device *HIDDevice) GetIndexedString(index int, _str *C.wchar_t, _maxlen C.size_t) (err error) {\n\t_device := (*C.SDL_hid_device)(device)\n\t_index := C.int(index)\n\treturn errorFromInt(int(C.SDL_hid_get_indexed_string(_device, _index, _str, _maxlen)))\n}\n\n// HIDBLEScan starts or stops a BLE scan on iOS and tvOS to pair Steam Controllers.\n// (https://wiki.libsdl.org/SDL_hid_ble_scan)\nfunc (device *HIDDevice) HIDBLEScan(active bool) {\n\t_active := C.SDL_bool(Btoi(active))\n\tC.SDL_hid_ble_scan(_active)\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/hints.c",
    "content": "#include \"_cgo_export.h\"\n\n#include \"sdl_wrapper.h\"\n#include \"hints.h\"\n\nvoid hintCallback(void *userdata, const char *name, const char *oldValue, const char *newValue)\n{\n\tgoHintCallback((char *) name, (char *) oldValue, (char *) newValue);\n}\n\nvoid addHintCallback(const char *name)\n{\n\tSDL_AddHintCallback(name, hintCallback, NULL);\n}\n\nvoid delHintCallback(const char *name)\n{\n\tSDL_DelHintCallback(name, hintCallback, NULL);}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/hints.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n#include \"hints.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,20))\n#define SDL_HINT_RENDER_LINE_METHOD \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,18))\n#define SDL_HINT_APP_NAME \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,16))\n#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT \"\"\n#define SDL_HINT_AUDIO_INCLUDE_MONITORS \"\"\n#define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,14))\n#define SDL_HINT_JOYSTICK_HIDAPI_PS5 \"\"\n#define SDL_HINT_MOUSE_RELATIVE_SCALING \"\"\n#define SDL_HINT_PREFERRED_LOCALES \"\"\n#define SDL_HINT_JOYSTICK_RAWINPUT \"\"\n#define SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT \"\"\n#define SDL_HINT_AUDIO_DEVICE_APP_NAME \"\"\n#define SDL_HINT_AUDIO_DEVICE_STREAM_NAME \"\"\n#define SDL_HINT_LINUX_JOYSTICK_DEADZONES \"\"\n#define SDL_HINT_THREAD_PRIORITY_POLICY \"\"\n#define SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL \"\"\n#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO \"\"\n#define SDL_HINT_EMSCRIPTEN_ASYNCIFY \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,12))\n#define SDL_HINT_DISPLAY_USABLE_BOUNDS \"\"\n#define SDL_HINT_GAMECONTROLLERTYPE \"\"\n#define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS \"\"\n#define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE \"\"\n#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID \"\"\n#define SDL_HINT_VIDEO_X11_FORCE_EGL \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,9))\n#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME \"\"\n#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS \"\"\n#define SDL_HINT_JOYSTICK_HIDAPI_STEAM \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,8))\n#define SDL_HINT_IOS_HIDE_HOME_INDICATOR \"\"\n#define SDL_HINT_RETURN_KEY_HIDES_IME \"\"\n#define SDL_HINT_TV_REMOTE_AS_JOYSTICK \"\"\n#define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR \"\"\n#define SDL_HINT_VIDEO_DOUBLE_BUFFER \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,6))\n#define SDL_HINT_AUDIO_RESAMPLING_MODE \"\"\n#define SDL_HINT_RENDER_LOGICAL_SIZE_MODE \"\"\n#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE \"\"\n#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE \"\"\n#define SDL_HINT_TOUCH_MOUSE_EVENTS \"\"\n#define SDL_HINT_WINDOWS_INTRESOURCE_ICON       \"\"\n#define SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,4))\n#define SDL_HINT_NO_SIGNAL_HANDLERS \"\"\n#define SDL_HINT_THREAD_STACK_SIZE \"\"\n#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN \"\"\n#define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP \"\"\n#define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 \"\"\n#define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING \"\"\n#define SDL_HINT_MAC_BACKGROUND_APP \"\"\n#define SDL_HINT_IME_INTERNAL_EDITING \"\"\n#define SDL_HINT_VIDEO_X11_NET_WM_PING \"\"\n#define SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH \"\"\n#define SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION \"\"\n#define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,3))\n#define SDL_HINT_WINRT_PRIVACY_POLICY_URL \"\"\n#define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL \"\"\n#define SDL_HINT_WINRT_HANDLE_BACK_BUTTON \"\"\n#define SDL_HINT_RENDER_DIRECT3D11_DEBUG \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,2))\n#define SDL_HINT_ACCELEROMETER_AS_JOYSTICK \"\"\n#define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK \"\"\n#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER \"\"\n#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP \"\"\n#define SDL_HINT_VIDEO_WIN_D3DCOMPILER \"\"\n#define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT \"\"\n#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,1))\n#define SDL_HINT_RENDER_DIRECT3D_THREADSAFE \"\"\n#define SDL_HINT_VIDEO_HIGHDPI_DISABLED \"\"\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,10))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH has been removed in SDL 2.0.10\")\n#endif\n\n#define SDL_HINT_RENDER_BATCHING \"\"\n#define SDL_HINT_EVENT_LOGGING \"\"\n#define SDL_HINT_GAMECONTROLLERCONFIG_FILE \"\"\n#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE \"\"\n#define SDL_HINT_MOUSE_TOUCH_EVENTS \"\"\n\n#else\n\n#define SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH \"\" // For compatibility\n\n#endif\n\n#if SDL_VERSION_ATLEAST(2,0,16)\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT has been replaced by SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT in SDL 2.0.16\")\n#endif\n\n#define SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT (SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT)\n\n#endif\n\n#if !SDL_VERSION_ATLEAST(2,0,18)\n\n#define SDL_HINT_IME_SHOW_UI \"\"\n#define SDL_HINT_JOYSTICK_DEVICE \"\"\n#define SDL_HINT_LINUX_JOYSTICK_CLASSIC \"\"\n#define SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME \"\"\n#define SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY \"\"\n\n#endif\n\n#if !SDL_VERSION_ATLEAST(2,0,22)\n\n#define SDL_HINT_IME_SUPPORT_EXTENDED_TEXT \"\"\n#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER \"\"\n#define SDL_HINT_MOUSE_AUTO_CAPTURE \"\"\n#define SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL \"\"\n#define SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN \"\"\n#define SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE \"\"\n#define SDL_HINT_JOYSTICK_ROG_CHAKRAM \"\"\n#define SDL_HINT_X11_WINDOW_TYPE \"\"\n#define SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR \"\"\n\n#endif\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// Configuration hints\n// (https://wiki.libsdl.org/CategoryHints)\nconst (\n\tHINT_FRAMEBUFFER_ACCELERATION                 = C.SDL_HINT_FRAMEBUFFER_ACCELERATION                 // specifies how 3D acceleration is used with Window.GetSurface()\n\tHINT_RENDER_DRIVER                            = C.SDL_HINT_RENDER_DRIVER                            // specifies which render driver to use\n\tHINT_RENDER_OPENGL_SHADERS                    = C.SDL_HINT_RENDER_OPENGL_SHADERS                    // specifies whether the OpenGL render driver uses shaders\n\tHINT_RENDER_DIRECT3D_THREADSAFE               = C.SDL_HINT_RENDER_DIRECT3D_THREADSAFE               // specifies whether the Direct3D device is initialized for thread-safe operations\n\tHINT_RENDER_DIRECT3D11_DEBUG                  = C.SDL_HINT_RENDER_DIRECT3D11_DEBUG                  // specifies a variable controlling whether to enable Direct3D 11+'s Debug Layer\n\tHINT_RENDER_SCALE_QUALITY                     = C.SDL_HINT_RENDER_SCALE_QUALITY                     // specifies scaling quality\n\tHINT_RENDER_VSYNC                             = C.SDL_HINT_RENDER_VSYNC                             // specifies whether sync to vertical refresh is enabled or disabled in CreateRenderer() to avoid tearing\n\tHINT_VIDEO_ALLOW_SCREENSAVER                  = C.SDL_HINT_VIDEO_ALLOW_SCREENSAVER                  // specifies whether the screensaver is enabled\n\tHINT_VIDEO_X11_NET_WM_PING                    = C.SDL_HINT_VIDEO_X11_NET_WM_PING                    // specifies whether the X11 _NET_WM_PING protocol should be supported\n\tHINT_VIDEO_X11_XVIDMODE                       = C.SDL_HINT_VIDEO_X11_XVIDMODE                       // specifies whether the X11 VidMode extension should be used\n\tHINT_VIDEO_X11_XINERAMA                       = C.SDL_HINT_VIDEO_X11_XINERAMA                       // specifies whether the X11 Xinerama extension should be used\n\tHINT_VIDEO_X11_XRANDR                         = C.SDL_HINT_VIDEO_X11_XRANDR                         // specifies whether the X11 XRandR extension should be used\n\tHINT_GRAB_KEYBOARD                            = C.SDL_HINT_GRAB_KEYBOARD                            // specifies whether grabbing input grabs the keyboard\n\tHINT_MOUSE_DOUBLE_CLICK_TIME                  = C.SDL_HINT_MOUSE_DOUBLE_CLICK_TIME                  // specifies the double click time, in milliseconds\n\tHINT_MOUSE_DOUBLE_CLICK_RADIUS                = C.SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS                // specifies the double click radius, in pixels.\n\tHINT_MOUSE_RELATIVE_MODE_WARP                 = C.SDL_HINT_MOUSE_RELATIVE_MODE_WARP                 // specifies whether relative mouse mode is implemented using mouse warping\n\tHINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS             = C.SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS             // specifies if a Window is minimized if it loses key focus when in fullscreen mode\n\tHINT_IDLE_TIMER_DISABLED                      = C.SDL_HINT_IDLE_TIMER_DISABLED                      // specifies a variable controlling whether the idle timer is disabled on iOS\n\tHINT_IME_INTERNAL_EDITING                     = C.SDL_HINT_IME_INTERNAL_EDITING                     // specifies whether certain IMEs should handle text editing internally instead of sending TextEditingEvents\n\tHINT_ORIENTATIONS                             = C.SDL_HINT_ORIENTATIONS                             // specifies a variable controlling which orientations are allowed on iOS\n\tHINT_ACCELEROMETER_AS_JOYSTICK                = C.SDL_HINT_ACCELEROMETER_AS_JOYSTICK                // specifies whether the Android / iOS built-in accelerometer should be listed as a joystick device, rather than listing actual joysticks only\n\tHINT_XINPUT_ENABLED                           = C.SDL_HINT_XINPUT_ENABLED                           // specifies if Xinput gamepad devices are detected\n\tHINT_XINPUT_USE_OLD_JOYSTICK_MAPPING          = C.SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING          // specifies that SDL should use the old axis and button mapping for XInput devices\n\tHINT_GAMECONTROLLERCONFIG                     = C.SDL_HINT_GAMECONTROLLERCONFIG                     // specifies extra gamecontroller db entries\n\tHINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS         = C.SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS         // specifies if joystick (and gamecontroller) events are enabled even when the application is in the background\n\tHINT_ALLOW_TOPMOST                            = C.SDL_HINT_ALLOW_TOPMOST                            // specifies if top most bit on an SDL Window can be set\n\tHINT_THREAD_STACK_SIZE                        = C.SDL_HINT_THREAD_STACK_SIZE                        // specifies a variable specifying SDL's threads stack size in bytes or \"0\" for the backend's default size\n\tHINT_TIMER_RESOLUTION                         = C.SDL_HINT_TIMER_RESOLUTION                         // specifies the timer resolution in milliseconds\n\tHINT_VIDEO_HIGHDPI_DISABLED                   = C.SDL_HINT_VIDEO_HIGHDPI_DISABLED                   // specifies if high-DPI windows (\"Retina\" on Mac and iOS) are not allowed\n\tHINT_MAC_BACKGROUND_APP                       = C.SDL_HINT_MAC_BACKGROUND_APP                       // specifies if the SDL app should not be forced to become a foreground process on Mac OS X\n\tHINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK       = C.SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK       // specifies whether ctrl+click should generate a right-click event on Mac\n\tHINT_VIDEO_WIN_D3DCOMPILER                    = C.SDL_HINT_VIDEO_WIN_D3DCOMPILER                    // specifies which shader compiler to preload when using the Chrome ANGLE binaries\n\tHINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT          = C.SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT          // specifies the address of another Window* (as a hex string formatted with \"%p\")\n\tHINT_WINRT_PRIVACY_POLICY_URL                 = C.SDL_HINT_WINRT_PRIVACY_POLICY_URL                 // specifies a URL to a WinRT app's privacy policy\n\tHINT_WINRT_PRIVACY_POLICY_LABEL               = C.SDL_HINT_WINRT_PRIVACY_POLICY_LABEL               // specifies a label text for a WinRT app's privacy policy link\n\tHINT_WINRT_HANDLE_BACK_BUTTON                 = C.SDL_HINT_WINRT_HANDLE_BACK_BUTTON                 // specifies a variable to allow back-button-press events on Windows Phone to be marked as handled\n\tHINT_VIDEO_MAC_FULLSCREEN_SPACES              = C.SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES              // specifies policy for fullscreen Spaces on Mac OS X\n\tHINT_NO_SIGNAL_HANDLERS                       = C.SDL_HINT_NO_SIGNAL_HANDLERS                       // specifies not to catch the SIGINT or SIGTERM signals\n\tHINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN  = C.SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN  // specifies whether the window frame and title bar are interactive when the cursor is hidden\n\tHINT_WINDOWS_ENABLE_MESSAGELOOP               = C.SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP               // specifies whether the windows message loop is processed by SDL\n\tHINT_WINDOWS_NO_CLOSE_ON_ALT_F4               = C.SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4               // specifies that SDL should not to generate WINDOWEVENT_CLOSE events for Alt+F4 on Microsoft Windows\n\tHINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH         = C.SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH         // specifies a variable to control whether mouse and touch events are to be treated together or separately\n\tHINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION  = C.SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION  // specifies the Android APK expansion main file version\n\tHINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION = C.SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION // specifies the Android APK expansion patch file version\n\tHINT_AUDIO_RESAMPLING_MODE                    = C.SDL_HINT_AUDIO_RESAMPLING_MODE                    // specifies a variable controlling speed/quality tradeoff of audio resampling\n\tHINT_RENDER_LOGICAL_SIZE_MODE                 = C.SDL_HINT_RENDER_LOGICAL_SIZE_MODE                 // specifies a variable controlling the scaling policy for SDL_RenderSetLogicalSize\n\tHINT_MOUSE_NORMAL_SPEED_SCALE                 = C.SDL_HINT_MOUSE_NORMAL_SPEED_SCALE                 // specifies a variable setting the speed scale for mouse motion, in floating point, when the mouse is not in relative mode\n\tHINT_MOUSE_RELATIVE_SPEED_SCALE               = C.SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE               // specifies a variable setting the scale for mouse motion, in floating point, when the mouse is in relative mode\n\tHINT_MOUSE_TOUCH_EVENTS                       = C.SDL_HINT_MOUSE_TOUCH_EVENTS                       // specifies a variable to control whether mouse events should generate synthetic touch events\n\tHINT_TOUCH_MOUSE_EVENTS                       = C.SDL_HINT_TOUCH_MOUSE_EVENTS                       // specifies a variable controlling whether touch events should generate synthetic mouse events\n\tHINT_WINDOWS_INTRESOURCE_ICON                 = C.SDL_HINT_WINDOWS_INTRESOURCE_ICON                 // specifies a variable to specify custom icon resource id from RC file on Windows platform\n\tHINT_WINDOWS_INTRESOURCE_ICON_SMALL           = C.SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL           // specifies a variable to specify custom icon resource id from RC file on Windows platform\n\tHINT_IOS_HIDE_HOME_INDICATOR                  = C.SDL_HINT_IOS_HIDE_HOME_INDICATOR                  // specifies a variable controlling whether the home indicator bar on iPhone X should be hidden.\n\tHINT_RETURN_KEY_HIDES_IME                     = C.SDL_HINT_RETURN_KEY_HIDES_IME                     // specifies a variable to control whether the return key on the soft keyboard should hide the soft keyboard on Android and iOS.\n\tHINT_TV_REMOTE_AS_JOYSTICK                    = C.SDL_HINT_TV_REMOTE_AS_JOYSTICK                    // specifies a variable controlling whether the Android / tvOS remotes  should be listed as joystick devices, instead of sending keyboard events.\n\tHINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR       = C.SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR       // specifies a variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint should be used.\n\tHINT_VIDEO_DOUBLE_BUFFER                      = C.SDL_HINT_VIDEO_DOUBLE_BUFFER                      // specifies a variable that tells the video driver that we only want a double buffer.\n\tHINT_RENDER_BATCHING                          = C.SDL_HINT_RENDER_BATCHING                          // specifies a variable controlling whether the 2D render API is compatible or efficient.\n\tHINT_EVENT_LOGGING                            = C.SDL_HINT_EVENT_LOGGING                            // specifies a variable controlling whether SDL logs all events pushed onto its internal queue.\n\tHINT_GAMECONTROLLERCONFIG_FILE                = C.SDL_HINT_GAMECONTROLLERCONFIG_FILE                // specifies a variable that lets you provide a file with extra gamecontroller db entries.\n\tHINT_ANDROID_BLOCK_ON_PAUSE                   = C.SDL_HINT_ANDROID_BLOCK_ON_PAUSE                   // specifies a variable to control whether the event loop will block itself when the app is paused.\n\tHINT_DISPLAY_USABLE_BOUNDS                    = C.SDL_HINT_DISPLAY_USABLE_BOUNDS                    // Override for SDL_GetDisplayUsableBounds().\n\tHINT_GAMECONTROLLERTYPE                       = C.SDL_HINT_GAMECONTROLLERTYPE                       // Overrides the automatic controller type detection.\n\tHINT_GAMECONTROLLER_USE_BUTTON_LABELS         = C.SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS         // If set, game controller face buttons report their values according to their labels instead of their positional layout.\n\tHINT_JOYSTICK_HIDAPI_GAMECUBE                 = C.SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE                 // A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used.\n\tHINT_VIDEO_X11_WINDOW_VISUALID                = C.SDL_HINT_VIDEO_X11_WINDOW_VISUALID                // A variable forcing the visual ID chosen for new X11 windows.\n\tHINT_VIDEO_X11_FORCE_EGL                      = C.SDL_HINT_VIDEO_X11_FORCE_EGL                      // A variable controlling whether X11 should use GLX or EGL by default.\n\tHINT_JOYSTICK_HIDAPI_PS5                      = C.SDL_HINT_JOYSTICK_HIDAPI_PS5                      // A variable controlling whether the HIDAPI driver for PS5 controllers should be used.\n\tHINT_MOUSE_RELATIVE_SCALING                   = C.SDL_HINT_MOUSE_RELATIVE_SCALING                   // A variable controlling whether relative mouse motion is affected by renderer scaling.\n\tHINT_PREFERRED_LOCALES                        = C.SDL_HINT_PREFERRED_LOCALES                        // Override for SDL_GetPreferredLocales().\n\tHINT_JOYSTICK_RAWINPUT                        = C.SDL_HINT_JOYSTICK_RAWINPUT                        // A variable controlling whether the RAWINPUT joystick drivers should be used for better handling XInput-capable devices.\n\tHINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT       = C.SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT       // A variable controlling whether the HIDAPI driver for XBox controllers on Windows should pull correlated data from XInput.\n\tHINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT         = C.SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT         // A variable controlling whether the HIDAPI driver for XBox controllers on Windows should pull correlated data from XInput.\n\tHINT_AUDIO_DEVICE_APP_NAME                    = C.SDL_HINT_AUDIO_DEVICE_APP_NAME                    // Specify an application name for an audio device.\n\tHINT_AUDIO_DEVICE_STREAM_NAME                 = C.SDL_HINT_AUDIO_DEVICE_STREAM_NAME                 // Specify an application name for an audio device.\n\tHINT_LINUX_JOYSTICK_DEADZONES                 = C.SDL_HINT_LINUX_JOYSTICK_DEADZONES                 // A variable controlling whether joysticks on Linux adhere to their HID-defined deadzones or return unfiltered values.\n\tHINT_THREAD_PRIORITY_POLICY                   = C.SDL_HINT_THREAD_PRIORITY_POLICY                   // A string specifying additional information to use with SDL_SetThreadPriority.\n\tHINT_THREAD_FORCE_REALTIME_TIME_CRITICAL      = C.SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL      // Specifies whether SDL_THREAD_PRIORITY_TIME_CRITICAL should be treated as realtime.\n\tHINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO        = C.SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO        // A variable to control whether SDL will pause audio in background (Requires SDL_ANDROID_BLOCK_ON_PAUSE as \"Non blocking\").\n\tHINT_EMSCRIPTEN_ASYNCIFY                      = C.SDL_HINT_EMSCRIPTEN_ASYNCIFY                      // Disable giving back control to the browser automatically when running with asyncify.\n\tHINT_AUDIO_INCLUDE_MONITORS                   = C.SDL_HINT_AUDIO_INCLUDE_MONITORS                   // Control whether PulseAudio recording should include monitor devices\n\tHINT_AUDIO_DEVICE_STREAM_ROLE                 = C.SDL_HINT_AUDIO_DEVICE_STREAM_ROLE                 // Describe the role of your application for audio control panels\n\tHINT_APP_NAME                                 = C.SDL_HINT_APP_NAME                                 // Lets you specify the application name sent to the OS when required\n\tHINT_VIDEO_EGL_ALLOW_TRANSPARENCY             = C.SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY             // A variable controlling whether the EGL window is allowed to be composited as transparent, rather than opaque\n\tHINT_IME_SHOW_UI                              = C.SDL_HINT_IME_SHOW_UI                              // A variable to control whether certain IMEs should show native UI components (such as the Candidate List) instead of suppressing them\n\tHINT_IME_SUPPORT_EXTENDED_TEXT                = C.SDL_HINT_IME_SUPPORT_EXTENDED_TEXT                // A variable to control if extended IME text support is enabled.\n\tHINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME        = C.SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME        // This hint lets you specify the \"activity name\" sent to the OS when SDL_DisableScreenSaver() is used (or the screensaver is automatically disabled)\n\tHINT_LINUX_JOYSTICK_CLASSIC                   = C.SDL_HINT_LINUX_JOYSTICK_CLASSIC                   // A variable controlling whether to use the classic /dev/input/js* joystick interface or the newer /dev/input/event* joystick interface on Linux\n\tHINT_JOYSTICK_DEVICE                          = C.SDL_HINT_JOYSTICK_DEVICE                          // This variable is currently only used by the Linux joystick driver\n\tHINT_JOYSTICK_HIDAPI_STEAM                    = C.SDL_HINT_JOYSTICK_HIDAPI_STEAM                    // A variable controlling whether the HIDAPI driver for Steam Controllers should be used\n\tHINT_RENDER_LINE_METHOD                       = C.SDL_HINT_RENDER_LINE_METHOD                       // A variable controlling how the 2D render API renders lines\n        HINT_MOUSE_RELATIVE_MODE_CENTER               = C.SDL_HINT_MOUSE_RELATIVE_MODE_CENTER               // A variable controlling whether relative mouse mode constrains the mouse to the center of the window\n        HINT_MOUSE_AUTO_CAPTURE                       = C.SDL_HINT_MOUSE_AUTO_CAPTURE                       // A variable controlling whether the mouse is captured while mouse buttons are pressed\n        HINT_VIDEO_FOREIGN_WINDOW_OPENGL              = C.SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL              // When calling SDL_CreateWindowFrom(), make the window compatible with OpenGL\n        HINT_VIDEO_FOREIGN_WINDOW_VULKAN              = C.SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN              // When calling SDL_CreateWindowFrom(), make the window compatible with Vulkan\n\tHINT_QUIT_ON_LAST_WINDOW_CLOSE                = C.SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE                // A variable that decides whether to send SDL_QUIT when closing the final window\n        HINT_JOYSTICK_ROG_CHAKRAM                     = C.SDL_HINT_JOYSTICK_ROG_CHAKRAM                     // A variable controlling whether the ROG Chakram mice should show up as joysticks\n        HINT_X11_WINDOW_TYPE                          = C.SDL_HINT_X11_WINDOW_TYPE                          // A variable that forces X11 windows to create as a custom type\n        HINT_VIDEO_WAYLAND_PREFER_LIBDECOR            = C.SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR            // A variable controlling whether the libdecor Wayland backend is preferred over native decrations\n)\n\n// An enumeration of hint priorities.\n// (https://wiki.libsdl.org/SDL_HintPriority)\nconst (\n\tHINT_DEFAULT  = C.SDL_HINT_DEFAULT  // low priority, used for default values\n\tHINT_NORMAL   = C.SDL_HINT_NORMAL   // medium priority\n\tHINT_OVERRIDE = C.SDL_HINT_OVERRIDE // high priority\n)\n\n// HintCallback is the function to call when the hint value changes.\ntype HintCallback func(data interface{}, name, oldValue, newValue string)\n\n// HintCallbackAndData contains a callback function and userdata.\ntype HintCallbackAndData struct {\n\tcallback HintCallback // the function to call when the hint value changes\n\tdata     interface{}  // data to pass to the callback function\n}\n\nvar hintCallbacks = make(map[string]HintCallbackAndData)\n\n// HintPriority is a hint priority used in SetHintWithPriority().\n// (https://wiki.libsdl.org/SDL_HintPriority)\ntype HintPriority C.SDL_HintPriority\n\nfunc (hp HintPriority) c() C.SDL_HintPriority {\n\treturn C.SDL_HintPriority(hp)\n}\n\n// SetHintWithPriority sets a hint with a specific priority.\n// (https://wiki.libsdl.org/SDL_SetHintWithPriority)\nfunc SetHintWithPriority(name, value string, hp HintPriority) bool {\n\t_name := C.CString(name)\n\t_value := C.CString(value)\n\tdefer C.free(unsafe.Pointer(_name))\n\tdefer C.free(unsafe.Pointer(_value))\n\treturn C.SDL_SetHintWithPriority(_name, _value, hp.c()) > 0\n}\n\n// SetHint sets a hint with normal priority.\n// (https://wiki.libsdl.org/SDL_SetHint)\nfunc SetHint(name, value string) bool {\n\t_name := C.CString(name)\n\t_value := C.CString(value)\n\tdefer C.free(unsafe.Pointer(_name))\n\tdefer C.free(unsafe.Pointer(_value))\n\treturn C.SDL_SetHint(_name, _value) > 0\n}\n\n// GetHint returns the value of a hint.\n// (https://wiki.libsdl.org/SDL_GetHint)\nfunc GetHint(name string) string {\n\t_name := C.CString(name)\n\tdefer C.free(unsafe.Pointer(_name))\n\treturn C.GoString(C.SDL_GetHint(_name))\n}\n\n// ClearHints clears all hints.\n// (https://wiki.libsdl.org/SDL_ClearHints)\nfunc ClearHints() {\n\tC.SDL_ClearHints()\n}\n\n// AddHintCallback adds a function to watch a particular hint.\n// (https://wiki.libsdl.org/SDL_AddHintCallback)\nfunc AddHintCallback(name string, fn HintCallback, data interface{}) {\n\t_name := C.CString(name)\n\thintCallbacks[name] = HintCallbackAndData{\n\t\tcallback: fn,\n\t\tdata:     data,\n\t}\n\tC.addHintCallback(_name)\n}\n\n// DelHintCallback removes a function watching a particular hint.\n// (https://wiki.libsdl.org/SDL_DelHintCallback)\nfunc DelHintCallback(name string) {\n\t_name := C.CString(name)\n\tdelete(hintCallbacks, name)\n\tC.delHintCallback(_name)\n}\n\n//export goHintCallback\nfunc goHintCallback(_name, _oldValue, _newValue *C.char) {\n\tname := C.GoString(_name)\n\toldValue := C.GoString(_oldValue)\n\tnewValue := C.GoString(_newValue)\n\tif cb, ok := hintCallbacks[name]; ok {\n\t\tcb.callback(cb.data, name, oldValue, newValue)\n\t}\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/hints.h",
    "content": "void hintCallback(void *userdata, const char *name, const char *oldValue, const char *newValue);\nvoid addHintCallback(const char *name);\nvoid delHintCallback(const char *name);\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/joystick.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,4))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickPowerLevel is not supported before SDL 2.0.4\")\n#endif\n\ntypedef enum\n{\n    SDL_JOYSTICK_POWER_UNKNOWN = -1,\n    SDL_JOYSTICK_POWER_EMPTY,\n    SDL_JOYSTICK_POWER_LOW,\n    SDL_JOYSTICK_POWER_MEDIUM,\n    SDL_JOYSTICK_POWER_FULL,\n    SDL_JOYSTICK_POWER_WIRED,\n    SDL_JOYSTICK_POWER_MAX\n} SDL_JoystickPowerLevel;\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickCurrentPowerLevel is not supported before SDL 2.0.4\")\n#endif\n\nstatic SDL_JoystickPowerLevel SDL_JoystickCurrentPowerLevel(SDL_Joystick* joystick)\n{\n\treturn SDL_JOYSTICK_POWER_UNKNOWN;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickFromInstanceID is not supported before SDL 2.0.4\")\n#endif\n\nstatic SDL_Joystick* SDL_JoystickFromInstanceID(SDL_JoystickID joyid)\n{\n\treturn NULL;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,6))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickType is not supported before SDL 2.0.6\")\n#endif\n\ntypedef enum\n{\n\tSDL_JOYSTICK_TYPE_UNKNOWN,\n\tSDL_JOYSTICK_TYPE_GAMECONTROLLER,\n\tSDL_JOYSTICK_TYPE_WHEEL,\n\tSDL_JOYSTICK_TYPE_ARCADE_STICK,\n\tSDL_JOYSTICK_TYPE_FLIGHT_STICK,\n\tSDL_JOYSTICK_TYPE_DANCE_PAD,\n\tSDL_JOYSTICK_TYPE_GUITAR,\n\tSDL_JOYSTICK_TYPE_DRUM_KIT,\n\tSDL_JOYSTICK_TYPE_ARCADE_PAD,\n\tSDL_JOYSTICK_TYPE_THROTTLE\n} SDL_JoystickType;\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetDeviceVendor is not supported before SDL 2.0.6\")\n#endif\n\nstatic Uint16 SDL_JoystickGetDeviceVendor(int device_index)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetDeviceProduct is not supported before SDL 2.0.6\")\n#endif\n\nstatic Uint16 SDL_JoystickGetDeviceProduct(int device_index)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetDeviceProductVersion is not supported before SDL 2.0.6\")\n#endif\n\nstatic Uint16 SDL_JoystickGetDeviceProductVersion(int device_index)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetDeviceType is not supported before SDL 2.0.6\")\n#endif\n\nstatic SDL_JoystickType SDL_JoystickGetDeviceType(int device_index)\n{\n\treturn SDL_JOYSTICK_TYPE_UNKNOWN;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetDeviceInstanceID is not supported before SDL 2.0.6\")\n#endif\n\nstatic SDL_JoystickID SDL_JoystickGetDeviceInstanceID(int device_index)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetVendor is not supported before SDL 2.0.6\")\n#endif\n\nstatic Uint16 SDL_JoystickGetVendor(SDL_Joystick* joystick)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetProduct is not supported before SDL 2.0.6\")\n#endif\n\nstatic Uint16 SDL_JoystickGetProduct(SDL_Joystick* joystick)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetProductVersion is not supported before SDL 2.0.6\")\n#endif\n\nstatic Uint16 SDL_JoystickGetProductVersion(SDL_Joystick* joystick)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetType is not supported before SDL 2.0.6\")\n#endif\n\nstatic SDL_JoystickType SDL_JoystickGetType(SDL_Joystick* joystick)\n{\n\treturn SDL_JOYSTICK_TYPE_UNKNOWN;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetAxisInitialState is not supported before SDL 2.0.6\")\n#endif\n\nstatic SDL_bool SDL_JoystickGetAxisInitialState(SDL_Joystick* joystick, int axis, Sint16* state)\n{\n\treturn SDL_FALSE;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,7))\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_LockJoysticks is not supported before SDL 2.0.7\")\n#endif\n\nstatic void SDL_LockJoysticks()\n{\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_UnlockJoysticks is not supported before SDL 2.0.7\")\n#endif\n\nstatic void SDL_UnlockJoysticks()\n{\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,9))\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetDevicePlayerIndex is not supported before SDL 2.0.9\")\n#endif\n\nstatic int SDL_JoystickGetDevicePlayerIndex(int device_index)\n{\n\treturn 0;\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickGetPlayerIndex is not supported before SDL 2.0.9\")\n#endif\n\nstatic int SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick)\n{\n\treturn 0;\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickRumble is not supported before SDL 2.0.9\")\n#endif\n\nstatic int SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms)\n{\n\treturn -1;\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,18))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_JoystickHasRumble is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_JoystickHasRumbleTriggers is not supported before SDL 2.0.18\")\n#endif\n\nstatic SDL_bool SDL_JoystickHasRumble(SDL_Joystick *joystick)\n{\n\treturn SDL_FALSE;\n}\n\nstatic SDL_bool SDL_JoystickHasRumbleTriggers(SDL_Joystick *joystick)\n{\n\treturn SDL_FALSE;\n}\n\n#endif\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// Hat positions.\n// (https://wiki.libsdl.org/SDL_JoystickGetHat)\nconst (\n\tHAT_CENTERED  = C.SDL_HAT_CENTERED\n\tHAT_UP        = C.SDL_HAT_UP\n\tHAT_RIGHT     = C.SDL_HAT_RIGHT\n\tHAT_DOWN      = C.SDL_HAT_DOWN\n\tHAT_LEFT      = C.SDL_HAT_LEFT\n\tHAT_RIGHTUP   = C.SDL_HAT_RIGHTUP\n\tHAT_RIGHTDOWN = C.SDL_HAT_RIGHTDOWN\n\tHAT_LEFTUP    = C.SDL_HAT_LEFTUP\n\tHAT_LEFTDOWN  = C.SDL_HAT_LEFTDOWN\n)\n\n// Types of a joystick.\nconst (\n\tJOYSTICK_TYPE_UNKNOWN        = C.SDL_JOYSTICK_TYPE_UNKNOWN\n\tJOYSTICK_TYPE_GAMECONTROLLER = C.SDL_JOYSTICK_TYPE_GAMECONTROLLER\n\tJOYSTICK_TYPE_WHEEL          = C.SDL_JOYSTICK_TYPE_WHEEL\n\tJOYSTICK_TYPE_ARCADE_STICK   = C.SDL_JOYSTICK_TYPE_ARCADE_STICK\n\tJOYSTICK_TYPE_FLIGHT_STICK   = C.SDL_JOYSTICK_TYPE_FLIGHT_STICK\n\tJOYSTICK_TYPE_DANCE_PAD      = C.SDL_JOYSTICK_TYPE_DANCE_PAD\n\tJOYSTICK_TYPE_GUITAR         = C.SDL_JOYSTICK_TYPE_GUITAR\n\tJOYSTICK_TYPE_DRUM_KIT       = C.SDL_JOYSTICK_TYPE_DRUM_KIT\n\tJOYSTICK_TYPE_ARCADE_PAD     = C.SDL_JOYSTICK_TYPE_ARCADE_PAD\n\tJOYSTICK_TYPE_THROTTLE       = C.SDL_JOYSTICK_TYPE_THROTTLE\n)\n\n// An enumeration of battery levels of a joystick.\n// (https://wiki.libsdl.org/SDL_JoystickPowerLevel)\nconst (\n\tJOYSTICK_POWER_UNKNOWN = C.SDL_JOYSTICK_POWER_UNKNOWN\n\tJOYSTICK_POWER_EMPTY   = C.SDL_JOYSTICK_POWER_EMPTY\n\tJOYSTICK_POWER_LOW     = C.SDL_JOYSTICK_POWER_LOW\n\tJOYSTICK_POWER_MEDIUM  = C.SDL_JOYSTICK_POWER_MEDIUM\n\tJOYSTICK_POWER_FULL    = C.SDL_JOYSTICK_POWER_FULL\n\tJOYSTICK_POWER_WIRED   = C.SDL_JOYSTICK_POWER_WIRED\n\tJOYSTICK_POWER_MAX     = C.SDL_JOYSTICK_POWER_MAX\n)\n\n// Joystick is an SDL joystick.\ntype Joystick C.SDL_Joystick\n\n// JoystickGUID is a stable unique id for a joystick device.\ntype JoystickGUID C.SDL_JoystickGUID\n\n// JoystickID is joystick's instance id.\ntype JoystickID C.SDL_JoystickID\n\n// JoystickType is a type of a joystick.\ntype JoystickType C.SDL_JoystickType\n\n// JoystickPowerLevel is a battery level of a joystick.\ntype JoystickPowerLevel C.SDL_JoystickPowerLevel\n\nfunc (joy *Joystick) cptr() *C.SDL_Joystick {\n\treturn (*C.SDL_Joystick)(unsafe.Pointer(joy))\n}\n\nfunc (guid JoystickGUID) c() C.SDL_JoystickGUID {\n\treturn C.SDL_JoystickGUID(guid)\n}\n\nfunc (joyid JoystickID) c() C.SDL_JoystickID {\n\treturn C.SDL_JoystickID(joyid)\n}\n\n// NumJoysticks returns the number of joysticks attached to the system.\n// (https://wiki.libsdl.org/SDL_NumJoysticks)\nfunc NumJoysticks() int {\n\treturn (int)(C.SDL_NumJoysticks())\n}\n\n// JoystickNameForIndex returns the implementation dependent name of a joystick.\n// (https://wiki.libsdl.org/SDL_JoystickNameForIndex)\nfunc JoystickNameForIndex(index int) string {\n\treturn (C.GoString)(C.SDL_JoystickNameForIndex(C.int(index)))\n}\n\n// JoystickGetDevicePlayerIndex returns the player index of a joystick, or -1 if it's not available\n// TODO: (https://wiki.libsdl.org/SDL_JoystickGetDevicePlayerIndex)\nfunc JoystickGetDevicePlayerIndex(index int) int {\n\treturn int(C.SDL_JoystickGetDevicePlayerIndex(C.int(index)))\n}\n\n// JoystickGetDeviceGUID returns the implementation dependent GUID for the joystick at a given device index.\n// (https://wiki.libsdl.org/SDL_JoystickGetDeviceGUID)\nfunc JoystickGetDeviceGUID(index int) JoystickGUID {\n\treturn (JoystickGUID)(C.SDL_JoystickGetDeviceGUID(C.int(index)))\n}\n\n// JoystickGetDeviceVendor returns the USB vendor ID of a joystick, if available, 0 otherwise.\nfunc JoystickGetDeviceVendor(index int) int {\n\treturn int(C.SDL_JoystickGetDeviceVendor(C.int(index)))\n}\n\n// JoystickGetDeviceProduct returns the USB product ID of a joystick, if available, 0 otherwise.\nfunc JoystickGetDeviceProduct(index int) int {\n\treturn int(C.SDL_JoystickGetDeviceProduct(C.int(index)))\n}\n\n// JoystickGetDeviceProductVersion returns the product version of a joystick, if available, 0 otherwise.\nfunc JoystickGetDeviceProductVersion(index int) int {\n\treturn int(C.SDL_JoystickGetDeviceProductVersion(C.int(index)))\n}\n\n// JoystickGetDeviceType returns the type of a joystick.\nfunc JoystickGetDeviceType(index int) JoystickType {\n\treturn JoystickType(C.SDL_JoystickGetDeviceType(C.int(index)))\n}\n\n// JoystickGetDeviceInstanceID returns the instance ID of a joystick.\nfunc JoystickGetDeviceInstanceID(index int) JoystickID {\n\treturn JoystickID(C.SDL_JoystickGetDeviceInstanceID(C.int(index)))\n}\n\n// JoystickGetGUIDString returns an ASCII string representation for a given JoystickGUID.\n// (https://wiki.libsdl.org/SDL_JoystickGetGUIDString)\nfunc JoystickGetGUIDString(guid JoystickGUID) string {\n\t_pszGUID := make([]rune, 1024)\n\tpszGUID := C.CString(string(_pszGUID[:]))\n\tdefer C.free(unsafe.Pointer(pszGUID))\n\tC.SDL_JoystickGetGUIDString(guid.c(), pszGUID, C.int(unsafe.Sizeof(_pszGUID)))\n\treturn C.GoString(pszGUID)\n}\n\n// JoystickGetGUIDFromString converts a GUID string into a JoystickGUID structure.\n// (https://wiki.libsdl.org/SDL_JoystickGetGUIDFromString)\nfunc JoystickGetGUIDFromString(pchGUID string) JoystickGUID {\n\t_pchGUID := C.CString(pchGUID)\n\tdefer C.free(unsafe.Pointer(_pchGUID))\n\treturn (JoystickGUID)(C.SDL_JoystickGetGUIDFromString(_pchGUID))\n}\n\n// JoystickUpdate updates the current state of the open joysticks.\n// (https://wiki.libsdl.org/SDL_JoystickUpdate)\nfunc JoystickUpdate() {\n\tC.SDL_JoystickUpdate()\n}\n\n// JoystickEventState enables or disables joystick event polling.\n// (https://wiki.libsdl.org/SDL_JoystickEventState)\nfunc JoystickEventState(state int) int {\n\treturn (int)(C.SDL_JoystickEventState(C.int(state)))\n}\n\n// JoystickOpen opens a joystick for use.\n// (https://wiki.libsdl.org/SDL_JoystickOpen)\nfunc JoystickOpen(index int) *Joystick {\n\treturn (*Joystick)(C.SDL_JoystickOpen(C.int(index)))\n}\n\n// JoystickFromInstanceID returns the Joystick associated with an instance id.\n// (https://wiki.libsdl.org/SDL_JoystickFromInstanceID)\nfunc JoystickFromInstanceID(joyid JoystickID) *Joystick {\n\treturn (*Joystick)(C.SDL_JoystickFromInstanceID(joyid.c()))\n}\n\n// LockJoysticks locks joysticks for multi-threaded access to the joystick API\n// TODO: (https://wiki.libsdl.org/SDL_LockJoysticks)\nfunc LockJoysticks() {\n\tC.SDL_LockJoysticks()\n}\n\n// UnlockJoysticks unlocks joysticks for multi-threaded access to the joystick API\n// TODO: (https://wiki.libsdl.org/SDL_UnlockJoysticks)\nfunc UnlockJoysticks() {\n\tC.SDL_UnlockJoysticks()\n}\n\n// Name returns the implementation dependent name of a joystick.\n// (https://wiki.libsdl.org/SDL_JoystickName)\nfunc (joy *Joystick) Name() string {\n\treturn (C.GoString)(C.SDL_JoystickName(joy.cptr()))\n}\n\n// PlayerIndex returns the player index of an opened joystick, or -1 if it's not available.\n// (https://wiki.libsdl.org/SDL_JoystickGetPlayerIndex)\nfunc (joy *Joystick) PlayerIndex() int {\n\treturn int(C.SDL_JoystickGetPlayerIndex(joy.cptr()))\n}\n\n// GUID returns the implementation-dependent GUID for the joystick.\n// (https://wiki.libsdl.org/SDL_JoystickGetGUID)\nfunc (joy *Joystick) GUID() JoystickGUID {\n\treturn (JoystickGUID)(C.SDL_JoystickGetGUID(joy.cptr()))\n}\n\n// Vendor returns the USB vendor ID of an opened joystick, if available, 0 otherwise.\nfunc (joy *Joystick) Vendor() int {\n\treturn int(C.SDL_JoystickGetVendor(joy.cptr()))\n}\n\n// Product returns the USB product ID of an opened joystick, if available, 0 otherwise.\nfunc (joy *Joystick) Product() int {\n\treturn int(C.SDL_JoystickGetProduct(joy.cptr()))\n}\n\n// ProductVersion returns the product version of an opened joystick, if available, 0 otherwise.\nfunc (joy *Joystick) ProductVersion() int {\n\treturn int(C.SDL_JoystickGetProductVersion(joy.cptr()))\n}\n\n// Type returns the the type of an opened joystick.\nfunc (joy *Joystick) Type() JoystickType {\n\treturn JoystickType(C.SDL_JoystickGetType(joy.cptr()))\n}\n\n// Attached returns the status of a specified joystick.\n// (https://wiki.libsdl.org/SDL_JoystickGetAttached)\nfunc (joy *Joystick) Attached() bool {\n\treturn C.SDL_JoystickGetAttached(joy.cptr()) == C.SDL_TRUE\n}\n\n// InstanceID returns the instance ID of an opened joystick.\n// (https://wiki.libsdl.org/SDL_JoystickInstanceID)\nfunc (joy *Joystick) InstanceID() JoystickID {\n\treturn (JoystickID)(C.SDL_JoystickInstanceID(joy.cptr()))\n}\n\n// NumAxes returns the number of general axis controls on a joystick.\n// (https://wiki.libsdl.org/SDL_JoystickNumAxes)\nfunc (joy *Joystick) NumAxes() int {\n\treturn (int)(C.SDL_JoystickNumAxes(joy.cptr()))\n}\n\n// NumBalls returns the number of trackballs on a joystick.\n// (https://wiki.libsdl.org/SDL_JoystickNumBalls)\nfunc (joy *Joystick) NumBalls() int {\n\treturn (int)(C.SDL_JoystickNumBalls(joy.cptr()))\n}\n\n// NumHats returns the number of POV hats on a joystick.\n// (https://wiki.libsdl.org/SDL_JoystickNumHats)\nfunc (joy *Joystick) NumHats() int {\n\treturn (int)(C.SDL_JoystickNumHats(joy.cptr()))\n}\n\n// NumButtons returns the number of buttons on a joystick.\n// (https://wiki.libsdl.org/SDL_JoystickNumButtons)\nfunc (joy *Joystick) NumButtons() int {\n\treturn (int)(C.SDL_JoystickNumButtons(joy.cptr()))\n}\n\n// Axis returns the current state of an axis control on a joystick.\n// (https://wiki.libsdl.org/SDL_JoystickGetAxis)\nfunc (joy *Joystick) Axis(axis int) int16 {\n\treturn (int16)(C.SDL_JoystickGetAxis(joy.cptr(), C.int(axis)))\n}\n\n// AxisInitialState returns the initial state of an axis control on a joystick, ok is true if this axis has any initial value.\nfunc (joy *Joystick) AxisInitialState(axis int) (state int16, ok bool) {\n\tok = C.SDL_JoystickGetAxisInitialState(joy.cptr(), C.int(axis), (*C.Sint16)(&state)) == C.SDL_TRUE\n\treturn\n}\n\n// Hat returns the current state of a POV hat on a joystick.\n// (https://wiki.libsdl.org/SDL_JoystickGetHat)\nfunc (joy *Joystick) Hat(hat int) byte {\n\treturn (byte)(C.SDL_JoystickGetHat(joy.cptr(), C.int(hat)))\n}\n\n// Ball returns the ball axis change since the last poll.\n// (https://wiki.libsdl.org/SDL_JoystickGetBall)\nfunc (joy *Joystick) Ball(ball int, dx, dy *int32) int {\n\t_dx := (*C.int)(unsafe.Pointer(dx))\n\t_dy := (*C.int)(unsafe.Pointer(dy))\n\treturn (int)(C.SDL_JoystickGetBall(joy.cptr(), C.int(ball), _dx, _dy))\n}\n\n// Button the current state of a button on a joystick.\n// (https://wiki.libsdl.org/SDL_JoystickGetButton)\nfunc (joy *Joystick) Button(button int) byte {\n\treturn (byte)(C.SDL_JoystickGetButton(joy.cptr(), C.int(button)))\n}\n\n// Rumble triggers a rumble effect\n// Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.\n//\n// lowFrequencyRumble - The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF\n// highFrequencyRumble - The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF\n// durationMS - The duration of the rumble effect, in milliseconds\n//\n// Returns error if rumble isn't supported on this joystick.\n//\n// TODO: (https://wiki.libsdl.org/SDL_JoystickRumble)\nfunc (joy *Joystick) Rumble(lowFrequencyRumble, highFrequencyRumble uint16, durationMS uint32) error {\n\treturn errorFromInt(int(C.SDL_JoystickRumble(joy.cptr(), C.Uint16(lowFrequencyRumble), C.Uint16(highFrequencyRumble), C.Uint32(durationMS))))\n}\n\n// Close closes a joystick previously opened with JoystickOpen().\n// (https://wiki.libsdl.org/SDL_JoystickClose)\nfunc (joy *Joystick) Close() {\n\tC.SDL_JoystickClose(joy.cptr())\n}\n\n// CurrentPowerLevel returns the battery level of a joystick as JoystickPowerLevel.\n// (https://wiki.libsdl.org/SDL_JoystickCurrentPowerLevel)\nfunc (joy *Joystick) CurrentPowerLevel() JoystickPowerLevel {\n\treturn JoystickPowerLevel(C.SDL_JoystickCurrentPowerLevel(joy.cptr()))\n}\n\n// HasRumble queries whether a game controller has rumble support.\n// (https://wiki.libsdl.org/SDL_JoystickHasRumble)\nfunc (ctrl *Joystick) HasRumble() bool {\n\treturn C.SDL_JoystickHasRumble(ctrl.cptr()) == C.SDL_TRUE\n}\n\n// HasRumbleTriggers queries whether a game controller has rumble support on triggers.\n// (https://wiki.libsdl.org/SDL_JoystickHasRumbleTriggers)\nfunc (ctrl *Joystick) HasRumbleTriggers() bool {\n\treturn C.SDL_JoystickHasRumbleTriggers(ctrl.cptr()) == C.SDL_TRUE\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/keyboard.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,22))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_IsTextInputShown is not supported before SDL 2.0.22\")\n#pragma message(\"SDL_ClearComposition is not supported before SDL 2.0.22\")\n#endif\n\nstatic inline SDL_bool SDL_IsTextInputShown(void)\n{\n\treturn SDL_FALSE;\n}\n\nstatic inline void SDL_ClearComposition(void)\n{\n}\n\n#endif\n*/\nimport \"C\"\nimport (\n\t\"reflect\"\n\t\"unsafe\"\n)\n\n// Keysym contains key information used in key events.\n// (https://wiki.libsdl.org/SDL_Keysym)\ntype Keysym struct {\n\tScancode Scancode // SDL physical key code\n\tSym      Keycode  // SDL virtual key code\n\tMod      uint16   // current key modifiers\n\tunused   uint32   // unused\n}\n\n// GetKeyboardFocus returns the window which currently has keyboard focus.\n// (https://wiki.libsdl.org/SDL_GetKeyboardFocus)\nfunc GetKeyboardFocus() *Window {\n\treturn (*Window)(unsafe.Pointer(C.SDL_GetKeyboardFocus()))\n}\n\n// GetKeyboardState returns a snapshot of the current state of the keyboard.\n// (https://wiki.libsdl.org/SDL_GetKeyboardState)\nfunc GetKeyboardState() []uint8 {\n\tvar numkeys C.int\n\tstart := C.SDL_GetKeyboardState(&numkeys)\n\tsh := reflect.SliceHeader{}\n\tsh.Len = int(numkeys)\n\tsh.Cap = int(numkeys)\n\tsh.Data = uintptr(unsafe.Pointer(start))\n\treturn *(*[]uint8)(unsafe.Pointer(&sh))\n}\n\n// GetModState returns the current key modifier state for the keyboard.\n// (https://wiki.libsdl.org/SDL_GetModState)\nfunc GetModState() Keymod {\n\treturn (Keymod)(C.SDL_GetModState())\n}\n\n// SetModState sets the current key modifier state for the keyboard.\n// (https://wiki.libsdl.org/SDL_SetModState)\nfunc SetModState(mod Keymod) {\n\tC.SDL_SetModState(mod.c())\n}\n\n// GetKeyFromScancode returns the key code corresponding to the given scancode according to the current keyboard layout.\n// (https://wiki.libsdl.org/SDL_GetKeyFromScancode)\nfunc GetKeyFromScancode(code Scancode) Keycode {\n\treturn (Keycode)(C.SDL_GetKeyFromScancode(code.c()))\n}\n\n// GetScancodeFromKey returns the scancode corresponding to the given key code according to the current keyboard layout.\n// (https://wiki.libsdl.org/SDL_GetScancodeFromKey)\nfunc GetScancodeFromKey(code Keycode) Scancode {\n\treturn (Scancode)(C.SDL_GetScancodeFromKey(code.c()))\n}\n\n// GetScancodeName returns a human-readable name for a scancode\n// (https://wiki.libsdl.org/SDL_GetScancodeName)\nfunc GetScancodeName(code Scancode) string {\n\treturn (C.GoString)(C.SDL_GetScancodeName(code.c()))\n}\n\n// GetScancodeFromName returns a scancode from a human-readable name.\n// (https://wiki.libsdl.org/SDL_GetScancodeFromName)\nfunc GetScancodeFromName(name string) Scancode {\n\t_name := C.CString(name)\n\tdefer C.free(unsafe.Pointer(_name))\n\treturn (Scancode)(C.SDL_GetScancodeFromName(_name))\n}\n\n// GetKeyName returns a human-readable name for a key.\n// (https://wiki.libsdl.org/SDL_GetKeyName)\nfunc GetKeyName(code Keycode) string {\n\treturn (C.GoString)(C.SDL_GetKeyName(code.c()))\n}\n\n// GetKeyFromName returns a key code from a human-readable name.\n// (https://wiki.libsdl.org/SDL_GetKeyFromName)\nfunc GetKeyFromName(name string) Keycode {\n\t_name := C.CString(name)\n\tdefer C.free(unsafe.Pointer(_name))\n\treturn (Keycode)(C.SDL_GetKeyFromName(_name))\n}\n\n// StartTextInput starts accepting Unicode text input events.\n// (https://wiki.libsdl.org/SDL_StartTextInput)\nfunc StartTextInput() {\n\tC.SDL_StartTextInput()\n}\n\n// IsTextInputActive checks whether or not Unicode text input events are enabled.\n// (https://wiki.libsdl.org/SDL_IsTextInputActive)\nfunc IsTextInputActive() bool {\n\treturn C.SDL_IsTextInputActive() > 0\n}\n\n// StopTextInput stops receiving any text input events.\n// (https://wiki.libsdl.org/SDL_StopTextInput)\nfunc StopTextInput() {\n\tC.SDL_StopTextInput()\n}\n\n// SetTextInputRect sets the rectangle used to type Unicode text inputs.\n// (https://wiki.libsdl.org/SDL_SetTextInputRect)\nfunc SetTextInputRect(rect *Rect) {\n\tC.SDL_SetTextInputRect(rect.cptr())\n}\n\n// HasScreenKeyboardSupport reports whether the platform has some screen keyboard support.\n// (https://wiki.libsdl.org/SDL_HasScreenKeyboardSupport)\nfunc HasScreenKeyboardSupport() bool {\n\treturn C.SDL_HasScreenKeyboardSupport() > 0\n}\n\n// IsScreenKeyboardShown reports whether the screen keyboard is shown for given window.\n// (https://wiki.libsdl.org/SDL_IsScreenKeyboardShown)\nfunc IsScreenKeyboardShown(window *Window) bool {\n\treturn C.SDL_IsScreenKeyboardShown(window.cptr()) > 0\n}\n\n// IsTextInputShown returns if an IME Composite or Candidate window is currently shown.\n// (https://wiki.libsdl.org/SDL_IsTextInputShown)\nfunc IsTextInputShown() bool {\n\treturn C.SDL_IsTextInputShown() > 0\n}\n\n// ClearComposition dismisses the composition window/IME without disabling the subsystem.\n// (https://wiki.libsdl.org/SDL_ClearComposition)\nfunc ClearComposition() {\n\tC.SDL_ClearComposition()\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/keycode.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\n\nconst K_SCANCODE_MASK = 1 << 30\n\n// The SDL virtual key representation.\n// (https://wiki.libsdl.org/SDL_Keycode)\n// (https://wiki.libsdl.org/SDLKeycodeLookup)\nconst (\n\tK_UNKNOWN = C.SDLK_UNKNOWN // \"\" (no name, empty string)\n\n\tK_RETURN     = C.SDLK_RETURN     // \"Return\" (the Enter key (main keyboard))\n\tK_ESCAPE     = C.SDLK_ESCAPE     // \"Escape\" (the Esc key)\n\tK_BACKSPACE  = C.SDLK_BACKSPACE  // \"Backspace\"\n\tK_TAB        = C.SDLK_TAB        // \"Tab\" (the Tab key)\n\tK_SPACE      = C.SDLK_SPACE      // \"Space\" (the Space Bar key(s))\n\tK_EXCLAIM    = C.SDLK_EXCLAIM    // \"!\"\n\tK_QUOTEDBL   = C.SDLK_QUOTEDBL   // \"\"\"\n\tK_HASH       = C.SDLK_HASH       // \"#\"\n\tK_PERCENT    = C.SDLK_PERCENT    // \"%\"\n\tK_DOLLAR     = C.SDLK_DOLLAR     // \"$\"\n\tK_AMPERSAND  = C.SDLK_AMPERSAND  // \"&\"\n\tK_QUOTE      = C.SDLK_QUOTE      // \"'\"\n\tK_LEFTPAREN  = C.SDLK_LEFTPAREN  // \"(\"\n\tK_RIGHTPAREN = C.SDLK_RIGHTPAREN // \")\"\n\tK_ASTERISK   = C.SDLK_ASTERISK   // \"*\"\n\tK_PLUS       = C.SDLK_PLUS       // \"+\"\n\tK_COMMA      = C.SDLK_COMMA      // \",\"\n\tK_MINUS      = C.SDLK_MINUS      // \"-\"\n\tK_PERIOD     = C.SDLK_PERIOD     // \".\"\n\tK_SLASH      = C.SDLK_SLASH      // \"/\"\n\tK_0          = C.SDLK_0          // \"0\"\n\tK_1          = C.SDLK_1          // \"1\"\n\tK_2          = C.SDLK_2          // \"2\"\n\tK_3          = C.SDLK_3          // \"3\"\n\tK_4          = C.SDLK_4          // \"4\"\n\tK_5          = C.SDLK_5          // \"5\"\n\tK_6          = C.SDLK_6          // \"6\"\n\tK_7          = C.SDLK_7          // \"7\"\n\tK_8          = C.SDLK_8          // \"8\"\n\tK_9          = C.SDLK_9          // \"9\"\n\tK_COLON      = C.SDLK_COLON      // \":\"\n\tK_SEMICOLON  = C.SDLK_SEMICOLON  // \";\"\n\tK_LESS       = C.SDLK_LESS       // \"<\"\n\tK_EQUALS     = C.SDLK_EQUALS     // \"=\"\n\tK_GREATER    = C.SDLK_GREATER    // \">\"\n\tK_QUESTION   = C.SDLK_QUESTION   // \"?\"\n\tK_AT         = C.SDLK_AT         // \"@\"\n\t/*\n\t   Skip uppercase letters\n\t*/\n\tK_LEFTBRACKET  = C.SDLK_LEFTBRACKET  // \"[\"\n\tK_BACKSLASH    = C.SDLK_BACKSLASH    // \"\\\"\n\tK_RIGHTBRACKET = C.SDLK_RIGHTBRACKET // \"]\"\n\tK_CARET        = C.SDLK_CARET        // \"^\"\n\tK_UNDERSCORE   = C.SDLK_UNDERSCORE   // \"_\"\n\tK_BACKQUOTE    = C.SDLK_BACKQUOTE    // \"`\"\n\tK_a            = C.SDLK_a            // \"A\"\n\tK_b            = C.SDLK_b            // \"B\"\n\tK_c            = C.SDLK_c            // \"C\"\n\tK_d            = C.SDLK_d            // \"D\"\n\tK_e            = C.SDLK_e            // \"E\"\n\tK_f            = C.SDLK_f            // \"F\"\n\tK_g            = C.SDLK_g            // \"G\"\n\tK_h            = C.SDLK_h            // \"H\"\n\tK_i            = C.SDLK_i            // \"I\"\n\tK_j            = C.SDLK_j            // \"J\"\n\tK_k            = C.SDLK_k            // \"K\"\n\tK_l            = C.SDLK_l            // \"L\"\n\tK_m            = C.SDLK_m            // \"M\"\n\tK_n            = C.SDLK_n            // \"N\"\n\tK_o            = C.SDLK_o            // \"O\"\n\tK_p            = C.SDLK_p            // \"P\"\n\tK_q            = C.SDLK_q            // \"Q\"\n\tK_r            = C.SDLK_r            // \"R\"\n\tK_s            = C.SDLK_s            // \"S\"\n\tK_t            = C.SDLK_t            // \"T\"\n\tK_u            = C.SDLK_u            // \"U\"\n\tK_v            = C.SDLK_v            // \"V\"\n\tK_w            = C.SDLK_w            // \"W\"\n\tK_x            = C.SDLK_x            // \"X\"\n\tK_y            = C.SDLK_y            // \"Y\"\n\tK_z            = C.SDLK_z            // \"Z\"\n\n\tK_CAPSLOCK = C.SDLK_CAPSLOCK // \"CapsLock\"\n\n\tK_F1  = C.SDLK_F1  // \"F1\"\n\tK_F2  = C.SDLK_F2  // \"F2\"\n\tK_F3  = C.SDLK_F3  // \"F3\"\n\tK_F4  = C.SDLK_F4  // \"F4\"\n\tK_F5  = C.SDLK_F5  // \"F5\"\n\tK_F6  = C.SDLK_F6  // \"F6\"\n\tK_F7  = C.SDLK_F7  // \"F7\"\n\tK_F8  = C.SDLK_F8  // \"F8\"\n\tK_F9  = C.SDLK_F9  // \"F9\"\n\tK_F10 = C.SDLK_F10 // \"F10\"\n\tK_F11 = C.SDLK_F11 // \"F11\"\n\tK_F12 = C.SDLK_F12 // \"F12\"\n\n\tK_PRINTSCREEN = C.SDLK_PRINTSCREEN // \"PrintScreen\"\n\tK_SCROLLLOCK  = C.SDLK_SCROLLLOCK  // \"ScrollLock\"\n\tK_PAUSE       = C.SDLK_PAUSE       // \"Pause\" (the Pause / Break key)\n\tK_INSERT      = C.SDLK_INSERT      // \"Insert\" (insert on PC, help on some Mac keyboards (but does send code 73, not 117))\n\tK_HOME        = C.SDLK_HOME        // \"Home\"\n\tK_PAGEUP      = C.SDLK_PAGEUP      // \"PageUp\"\n\tK_DELETE      = C.SDLK_DELETE      // \"Delete\"\n\tK_END         = C.SDLK_END         // \"End\"\n\tK_PAGEDOWN    = C.SDLK_PAGEDOWN    // \"PageDown\"\n\tK_RIGHT       = C.SDLK_RIGHT       // \"Right\" (the Right arrow key (navigation keypad))\n\tK_LEFT        = C.SDLK_LEFT        // \"Left\" (the Left arrow key (navigation keypad))\n\tK_DOWN        = C.SDLK_DOWN        // \"Down\" (the Down arrow key (navigation keypad))\n\tK_UP          = C.SDLK_UP          // \"Up\" (the Up arrow key (navigation keypad))\n\n\tK_NUMLOCKCLEAR = C.SDLK_NUMLOCKCLEAR // \"Numlock\" (the Num Lock key (PC) / the Clear key (Mac))\n\tK_KP_DIVIDE    = C.SDLK_KP_DIVIDE    // \"Keypad /\" (the / key (numeric keypad))\n\tK_KP_MULTIPLY  = C.SDLK_KP_MULTIPLY  // \"Keypad *\" (the * key (numeric keypad))\n\tK_KP_MINUS     = C.SDLK_KP_MINUS     // \"Keypad -\" (the - key (numeric keypad))\n\tK_KP_PLUS      = C.SDLK_KP_PLUS      // \"Keypad +\" (the + key (numeric keypad))\n\tK_KP_ENTER     = C.SDLK_KP_ENTER     // \"Keypad Enter\" (the Enter key (numeric keypad))\n\tK_KP_1         = C.SDLK_KP_1         // \"Keypad 1\" (the 1 key (numeric keypad))\n\tK_KP_2         = C.SDLK_KP_2         // \"Keypad 2\" (the 2 key (numeric keypad))\n\tK_KP_3         = C.SDLK_KP_3         // \"Keypad 3\" (the 3 key (numeric keypad))\n\tK_KP_4         = C.SDLK_KP_4         // \"Keypad 4\" (the 4 key (numeric keypad))\n\tK_KP_5         = C.SDLK_KP_5         // \"Keypad 5\" (the 5 key (numeric keypad))\n\tK_KP_6         = C.SDLK_KP_6         // \"Keypad 6\" (the 6 key (numeric keypad))\n\tK_KP_7         = C.SDLK_KP_7         // \"Keypad 7\" (the 7 key (numeric keypad))\n\tK_KP_8         = C.SDLK_KP_8         // \"Keypad 8\" (the 8 key (numeric keypad))\n\tK_KP_9         = C.SDLK_KP_9         // \"Keypad 9\" (the 9 key (numeric keypad))\n\tK_KP_0         = C.SDLK_KP_0         // \"Keypad 0\" (the 0 key (numeric keypad))\n\tK_KP_PERIOD    = C.SDLK_KP_PERIOD    // \"Keypad .\" (the . key (numeric keypad))\n\n\tK_APPLICATION    = C.SDLK_APPLICATION    // \"Application\" (the Application / Compose / Context Menu (Windows) key)\n\tK_POWER          = C.SDLK_POWER          // \"Power\" (The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key.)\n\tK_KP_EQUALS      = C.SDLK_KP_EQUALS      // \"Keypad =\" (the = key (numeric keypad))\n\tK_F13            = C.SDLK_F13            // \"F13\"\n\tK_F14            = C.SDLK_F14            // \"F14\"\n\tK_F15            = C.SDLK_F15            // \"F15\"\n\tK_F16            = C.SDLK_F16            // \"F16\"\n\tK_F17            = C.SDLK_F17            // \"F17\"\n\tK_F18            = C.SDLK_F18            // \"F18\"\n\tK_F19            = C.SDLK_F19            // \"F19\"\n\tK_F20            = C.SDLK_F20            // \"F20\"\n\tK_F21            = C.SDLK_F21            // \"F21\"\n\tK_F22            = C.SDLK_F22            // \"F22\"\n\tK_F23            = C.SDLK_F23            // \"F23\"\n\tK_F24            = C.SDLK_F24            // \"F24\"\n\tK_EXECUTE        = C.SDLK_EXECUTE        // \"Execute\"\n\tK_HELP           = C.SDLK_HELP           // \"Help\"\n\tK_MENU           = C.SDLK_MENU           // \"Menu\"\n\tK_SELECT         = C.SDLK_SELECT         // \"Select\"\n\tK_STOP           = C.SDLK_STOP           // \"Stop\"\n\tK_AGAIN          = C.SDLK_AGAIN          // \"Again\" (the Again key (Redo))\n\tK_UNDO           = C.SDLK_UNDO           // \"Undo\"\n\tK_CUT            = C.SDLK_CUT            // \"Cut\"\n\tK_COPY           = C.SDLK_COPY           // \"Copy\"\n\tK_PASTE          = C.SDLK_PASTE          // \"Paste\"\n\tK_FIND           = C.SDLK_FIND           // \"Find\"\n\tK_MUTE           = C.SDLK_MUTE           // \"Mute\"\n\tK_VOLUMEUP       = C.SDLK_VOLUMEUP       // \"VolumeUp\"\n\tK_VOLUMEDOWN     = C.SDLK_VOLUMEDOWN     // \"VolumeDown\"\n\tK_KP_COMMA       = C.SDLK_KP_COMMA       // \"Keypad ,\" (the Comma key (numeric keypad))\n\tK_KP_EQUALSAS400 = C.SDLK_KP_EQUALSAS400 // \"Keypad = (AS400)\" (the Equals AS400 key (numeric keypad))\n\n\tK_ALTERASE   = C.SDLK_ALTERASE   // \"AltErase\" (Erase-Eaze)\n\tK_SYSREQ     = C.SDLK_SYSREQ     // \"SysReq\" (the SysReq key)\n\tK_CANCEL     = C.SDLK_CANCEL     // \"Cancel\"\n\tK_CLEAR      = C.SDLK_CLEAR      // \"Clear\"\n\tK_PRIOR      = C.SDLK_PRIOR      // \"Prior\"\n\tK_RETURN2    = C.SDLK_RETURN2    // \"Return\"\n\tK_SEPARATOR  = C.SDLK_SEPARATOR  // \"Separator\"\n\tK_OUT        = C.SDLK_OUT        // \"Out\"\n\tK_OPER       = C.SDLK_OPER       // \"Oper\"\n\tK_CLEARAGAIN = C.SDLK_CLEARAGAIN // \"Clear / Again\"\n\tK_CRSEL      = C.SDLK_CRSEL      // \"CrSel\"\n\tK_EXSEL      = C.SDLK_EXSEL      // \"ExSel\"\n\n\tK_KP_00              = C.SDLK_KP_00              // \"Keypad 00\" (the 00 key (numeric keypad))\n\tK_KP_000             = C.SDLK_KP_000             // \"Keypad 000\" (the 000 key (numeric keypad))\n\tK_THOUSANDSSEPARATOR = C.SDLK_THOUSANDSSEPARATOR // \"ThousandsSeparator\" (the Thousands Separator key)\n\tK_DECIMALSEPARATOR   = C.SDLK_DECIMALSEPARATOR   // \"DecimalSeparator\" (the Decimal Separator key)\n\tK_CURRENCYUNIT       = C.SDLK_CURRENCYUNIT       // \"CurrencyUnit\" (the Currency Unit key)\n\tK_CURRENCYSUBUNIT    = C.SDLK_CURRENCYSUBUNIT    // \"CurrencySubUnit\" (the Currency Subunit key)\n\tK_KP_LEFTPAREN       = C.SDLK_KP_LEFTPAREN       // \"Keypad (\" (the Left Parenthesis key (numeric keypad))\n\tK_KP_RIGHTPAREN      = C.SDLK_KP_RIGHTPAREN      // \"Keypad )\" (the Right Parenthesis key (numeric keypad))\n\tK_KP_LEFTBRACE       = C.SDLK_KP_LEFTBRACE       // \"Keypad {\" (the Left Brace key (numeric keypad))\n\tK_KP_RIGHTBRACE      = C.SDLK_KP_RIGHTBRACE      // \"Keypad }\" (the Right Brace key (numeric keypad))\n\tK_KP_TAB             = C.SDLK_KP_TAB             // \"Keypad Tab\" (the Tab key (numeric keypad))\n\tK_KP_BACKSPACE       = C.SDLK_KP_BACKSPACE       // \"Keypad Backspace\" (the Backspace key (numeric keypad))\n\tK_KP_A               = C.SDLK_KP_A               // \"Keypad A\" (the A key (numeric keypad))\n\tK_KP_B               = C.SDLK_KP_B               // \"Keypad B\" (the B key (numeric keypad))\n\tK_KP_C               = C.SDLK_KP_C               // \"Keypad C\" (the C key (numeric keypad))\n\tK_KP_D               = C.SDLK_KP_D               // \"Keypad D\" (the D key (numeric keypad))\n\tK_KP_E               = C.SDLK_KP_E               // \"Keypad E\" (the E key (numeric keypad))\n\tK_KP_F               = C.SDLK_KP_F               // \"Keypad F\" (the F key (numeric keypad))\n\tK_KP_XOR             = C.SDLK_KP_XOR             // \"Keypad XOR\" (the XOR key (numeric keypad))\n\tK_KP_POWER           = C.SDLK_KP_POWER           // \"Keypad ^\" (the Power key (numeric keypad))\n\tK_KP_PERCENT         = C.SDLK_KP_PERCENT         // \"Keypad %\" (the Percent key (numeric keypad))\n\tK_KP_LESS            = C.SDLK_KP_LESS            // \"Keypad <\" (the Less key (numeric keypad))\n\tK_KP_GREATER         = C.SDLK_KP_GREATER         // \"Keypad >\" (the Greater key (numeric keypad))\n\tK_KP_AMPERSAND       = C.SDLK_KP_AMPERSAND       // \"Keypad &\" (the & key (numeric keypad))\n\tK_KP_DBLAMPERSAND    = C.SDLK_KP_DBLAMPERSAND    // \"Keypad &&\" (the && key (numeric keypad))\n\tK_KP_VERTICALBAR     = C.SDLK_KP_VERTICALBAR     // \"Keypad |\" (the | key (numeric keypad))\n\tK_KP_DBLVERTICALBAR  = C.SDLK_KP_DBLVERTICALBAR  // \"Keypad ||\" (the || key (numeric keypad))\n\tK_KP_COLON           = C.SDLK_KP_COLON           // \"Keypad :\" (the : key (numeric keypad))\n\tK_KP_HASH            = C.SDLK_KP_HASH            // \"Keypad #\" (the # key (numeric keypad))\n\tK_KP_SPACE           = C.SDLK_KP_SPACE           // \"Keypad Space\" (the Space key (numeric keypad))\n\tK_KP_AT              = C.SDLK_KP_AT              // \"Keypad @\" (the @ key (numeric keypad))\n\tK_KP_EXCLAM          = C.SDLK_KP_EXCLAM          // \"Keypad !\" (the ! key (numeric keypad))\n\tK_KP_MEMSTORE        = C.SDLK_KP_MEMSTORE        // \"Keypad MemStore\" (the Mem Store key (numeric keypad))\n\tK_KP_MEMRECALL       = C.SDLK_KP_MEMRECALL       // \"Keypad MemRecall\" (the Mem Recall key (numeric keypad))\n\tK_KP_MEMCLEAR        = C.SDLK_KP_MEMCLEAR        // \"Keypad MemClear\" (the Mem Clear key (numeric keypad))\n\tK_KP_MEMADD          = C.SDLK_KP_MEMADD          // \"Keypad MemAdd\" (the Mem Add key (numeric keypad))\n\tK_KP_MEMSUBTRACT     = C.SDLK_KP_MEMSUBTRACT     // \"Keypad MemSubtract\" (the Mem Subtract key (numeric keypad))\n\tK_KP_MEMMULTIPLY     = C.SDLK_KP_MEMMULTIPLY     // \"Keypad MemMultiply\" (the Mem Multiply key (numeric keypad))\n\tK_KP_MEMDIVIDE       = C.SDLK_KP_MEMDIVIDE       // \"Keypad MemDivide\" (the Mem Divide key (numeric keypad))\n\tK_KP_PLUSMINUS       = C.SDLK_KP_PLUSMINUS       // \"Keypad +/-\" (the +/- key (numeric keypad))\n\tK_KP_CLEAR           = C.SDLK_KP_CLEAR           // \"Keypad Clear\" (the Clear key (numeric keypad))\n\tK_KP_CLEARENTRY      = C.SDLK_KP_CLEARENTRY      // \"Keypad ClearEntry\" (the Clear Entry key (numeric keypad))\n\tK_KP_BINARY          = C.SDLK_KP_BINARY          // \"Keypad Binary\" (the Binary key (numeric keypad))\n\tK_KP_OCTAL           = C.SDLK_KP_OCTAL           // \"Keypad Octal\" (the Octal key (numeric keypad))\n\tK_KP_DECIMAL         = C.SDLK_KP_DECIMAL         // \"Keypad Decimal\" (the Decimal key (numeric keypad))\n\tK_KP_HEXADECIMAL     = C.SDLK_KP_HEXADECIMAL     // \"Keypad Hexadecimal\" (the Hexadecimal key (numeric keypad))\n\n\tK_LCTRL  = C.SDLK_LCTRL  // \"Left Ctrl\"\n\tK_LSHIFT = C.SDLK_LSHIFT // \"Left Shift\"\n\tK_LALT   = C.SDLK_LALT   // \"Left Alt\" (alt, option)\n\tK_LGUI   = C.SDLK_LGUI   // \"Left GUI\" (windows, command (apple), meta)\n\tK_RCTRL  = C.SDLK_RCTRL  // \"Right Ctrl\"\n\tK_RSHIFT = C.SDLK_RSHIFT // \"Right Shift\"\n\tK_RALT   = C.SDLK_RALT   // \"Right Alt\" (alt, option)\n\tK_RGUI   = C.SDLK_RGUI   // \"Right GUI\" (windows, command (apple), meta)\n\n\tK_MODE = C.SDLK_MODE // \"ModeSwitch\" (I'm not sure if this is really not covered by any of the above, but since there's a special KMOD_MODE for it I'm adding it here)\n\n\tK_AUDIONEXT    = C.SDLK_AUDIONEXT    // \"AudioNext\" (the Next Track media key)\n\tK_AUDIOPREV    = C.SDLK_AUDIOPREV    // \"AudioPrev\" (the Previous Track media key)\n\tK_AUDIOSTOP    = C.SDLK_AUDIOSTOP    // \"AudioStop\" (the Stop media key)\n\tK_AUDIOPLAY    = C.SDLK_AUDIOPLAY    // \"AudioPlay\" (the Play media key)\n\tK_AUDIOMUTE    = C.SDLK_AUDIOMUTE    // \"AudioMute\" (the Mute volume key)\n\tK_MEDIASELECT  = C.SDLK_MEDIASELECT  // \"MediaSelect\" (the Media Select key)\n\tK_WWW          = C.SDLK_WWW          // \"WWW\" (the WWW/World Wide Web key)\n\tK_MAIL         = C.SDLK_MAIL         // \"Mail\" (the Mail/eMail key)\n\tK_CALCULATOR   = C.SDLK_CALCULATOR   // \"Calculator\" (the Calculator key)\n\tK_COMPUTER     = C.SDLK_COMPUTER     // \"Computer\" (the My Computer key)\n\tK_AC_SEARCH    = C.SDLK_AC_SEARCH    // \"AC Search\" (the Search key (application control keypad))\n\tK_AC_HOME      = C.SDLK_AC_HOME      // \"AC Home\" (the Home key (application control keypad))\n\tK_AC_BACK      = C.SDLK_AC_BACK      // \"AC Back\" (the Back key (application control keypad))\n\tK_AC_FORWARD   = C.SDLK_AC_FORWARD   // \"AC Forward\" (the Forward key (application control keypad))\n\tK_AC_STOP      = C.SDLK_AC_STOP      // \"AC Stop\" (the Stop key (application control keypad))\n\tK_AC_REFRESH   = C.SDLK_AC_REFRESH   // \"AC Refresh\" (the Refresh key (application control keypad))\n\tK_AC_BOOKMARKS = C.SDLK_AC_BOOKMARKS // \"AC Bookmarks\" (the Bookmarks key (application control keypad))\n\n\tK_BRIGHTNESSDOWN = C.SDLK_BRIGHTNESSDOWN // \"BrightnessDown\" (the Brightness Down key)\n\tK_BRIGHTNESSUP   = C.SDLK_BRIGHTNESSUP   // \"BrightnessUp\" (the Brightness Up key)\n\tK_DISPLAYSWITCH  = C.SDLK_DISPLAYSWITCH  // \"DisplaySwitch\" (display mirroring/dual display switch, video mode switch)\n\tK_KBDILLUMTOGGLE = C.SDLK_KBDILLUMTOGGLE // \"KBDIllumToggle\" (the Keyboard Illumination Toggle key)\n\tK_KBDILLUMDOWN   = C.SDLK_KBDILLUMDOWN   // \"KBDIllumDown\" (the Keyboard Illumination Down key)\n\tK_KBDILLUMUP     = C.SDLK_KBDILLUMUP     // \"KBDIllumUp\" (the Keyboard Illumination Up key)\n\tK_EJECT          = C.SDLK_EJECT          // \"Eject\" (the Eject key)\n\tK_SLEEP          = C.SDLK_SLEEP          // \"Sleep\" (the Sleep key)\n)\n\n// An enumeration of key modifier masks.\n// (https://wiki.libsdl.org/SDL_Keymod)\nconst (\n\tKMOD_NONE     = C.KMOD_NONE     // 0 (no modifier is applicable)\n\tKMOD_LSHIFT   = C.KMOD_LSHIFT   // the left Shift key is down\n\tKMOD_RSHIFT   = C.KMOD_RSHIFT   // the right Shift key is down\n\tKMOD_LCTRL    = C.KMOD_LCTRL    // the left Ctrl (Control) key is down\n\tKMOD_RCTRL    = C.KMOD_RCTRL    // the right Ctrl (Control) key is down\n\tKMOD_LALT     = C.KMOD_LALT     // the left Alt key is down\n\tKMOD_RALT     = C.KMOD_RALT     // the right Alt key is down\n\tKMOD_LGUI     = C.KMOD_LGUI     // the left GUI key (often the Windows key) is down\n\tKMOD_RGUI     = C.KMOD_RGUI     // the right GUI key (often the Windows key) is down\n\tKMOD_NUM      = C.KMOD_NUM      // the Num Lock key (may be located on an extended keypad) is down\n\tKMOD_CAPS     = C.KMOD_CAPS     // the Caps Lock key is down\n\tKMOD_MODE     = C.KMOD_MODE     // the AltGr key is down\n\tKMOD_CTRL     = C.KMOD_CTRL     // (KMOD_LCTRL|KMOD_RCTRL)\n\tKMOD_SHIFT    = C.KMOD_SHIFT    // (KMOD_LSHIFT|KMOD_RSHIFT)\n\tKMOD_ALT      = C.KMOD_ALT      // (KMOD_LALT|KMOD_RALT)\n\tKMOD_GUI      = C.KMOD_GUI      // (KMOD_LGUI|KMOD_RGUI)\n\tKMOD_RESERVED = C.KMOD_RESERVED // reserved for future use\n)\n\n// Keycode is the SDL virtual key representation.\n// (https://wiki.libsdl.org/SDL_Keycode)\ntype Keycode C.SDL_Keycode\n\n// Keymod is a key modifier masks.\n// (https://wiki.libsdl.org/SDL_Keymod)\ntype Keymod C.SDL_Keymod\n\nfunc (code Keycode) c() C.SDL_Keycode {\n\treturn C.SDL_Keycode(code)\n}\n\nfunc (mod Keymod) c() C.SDL_Keymod {\n\treturn C.SDL_Keymod(mod)\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/loadso.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\nimport \"unsafe\"\n\n// SharedObject is a pointer to the object handle.\ntype SharedObject uintptr\n\n// LoadObject dynamically loads a shared object and returns a pointer to the object handle.\n// (https://wiki.libsdl.org/SDL_LoadObject)\nfunc LoadObject(sofile string) SharedObject {\n\t_sofile := C.CString(sofile)\n\tdefer C.free(unsafe.Pointer(_sofile))\n\treturn (SharedObject)(C.SDL_LoadObject(_sofile))\n}\n\n// LoadFunction returns a pointer to the named function from the shared object.\n// (https://wiki.libsdl.org/SDL_LoadFunction)\nfunc (handle SharedObject) LoadFunction(name string) unsafe.Pointer {\n\t_name := C.CString(name)\n\tdefer C.free(unsafe.Pointer(_name))\n\treturn (unsafe.Pointer)(C.SDL_LoadFunction((unsafe.Pointer)(handle), _name))\n}\n\n// Unload unloads a shared object from memory.\n// (https://wiki.libsdl.org/SDL_UnloadObject)\nfunc (handle SharedObject) Unload() {\n\tC.SDL_UnloadObject((unsafe.Pointer)(handle))\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/log.c",
    "content": "#include \"_cgo_export.h\"\n\nvoid LogSetOutputFunction(void *data)\n{\n    SDL_LogSetOutputFunction((SDL_LogOutputFunction)logOutputFunction, data);\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/log.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n#include \"log.h\"\n\nstatic inline void _SDL_Log(const char *fmt)\n{\n    SDL_Log(\"%s\", fmt);\n}\n\nstatic inline void _SDL_LogVerbose(int category, const char *fmt)\n{\n    SDL_LogVerbose(category, \"%s\", fmt);\n}\n\nstatic inline void _SDL_LogDebug(int category, const char *fmt)\n{\n    SDL_LogDebug(category, \"%s\", fmt);\n}\n\nstatic inline void _SDL_LogInfo(int category, const char *fmt)\n{\n    SDL_LogInfo(category, \"%s\", fmt);\n}\n\nstatic inline void _SDL_LogWarn(int category, const char *fmt)\n{\n    SDL_LogWarn(category, \"%s\", fmt);\n}\n\nstatic inline void _SDL_LogError(int category, const char *fmt)\n{\n    SDL_LogError(category, \"%s\", fmt);\n}\n\nstatic inline void _SDL_LogCritical(int category, const char *fmt)\n{\n    SDL_LogCritical(category, \"%s\", fmt);\n}\n\nstatic inline void _SDL_LogMessage(int category, SDL_LogPriority priority, const char *fmt)\n{\n    SDL_LogCritical(category, \"%s\", fmt);\n}\n*/\nimport \"C\"\nimport \"fmt\"\nimport \"unsafe\"\n\n// An enumeration of the predefined log categories.\n// (https://wiki.libsdl.org/SDL_LOG_CATEGORY)\nconst (\n\tLOG_CATEGORY_APPLICATION = iota // application log\n\tLOG_CATEGORY_ERROR              // error log\n\tLOG_CATEGORY_ASSERT             // assert log\n\tLOG_CATEGORY_SYSTEM             // system log\n\tLOG_CATEGORY_AUDIO              // audio log\n\tLOG_CATEGORY_VIDEO              // video log\n\tLOG_CATEGORY_RENDER             // render log\n\tLOG_CATEGORY_INPUT              // input log\n\tLOG_CATEGORY_TEST               // test log\n\tLOG_CATEGORY_RESERVED1          // reserved for future SDL library use\n\tLOG_CATEGORY_RESERVED2          // reserved for future SDL library use\n\tLOG_CATEGORY_RESERVED3          // reserved for future SDL library use\n\tLOG_CATEGORY_RESERVED4          // reserved for future SDL library use\n\tLOG_CATEGORY_RESERVED5          // reserved for future SDL library use\n\tLOG_CATEGORY_RESERVED6          // reserved for future SDL library use\n\tLOG_CATEGORY_RESERVED7          // reserved for future SDL library use\n\tLOG_CATEGORY_RESERVED8          // reserved for future SDL library use\n\tLOG_CATEGORY_RESERVED9          // reserved for future SDL library use\n\tLOG_CATEGORY_RESERVED10         // reserved for future SDL library use\n\tLOG_CATEGORY_CUSTOM             // reserved for application use\n)\n\n// An enumeration of the predefined log priorities.\n// (https://wiki.libsdl.org/SDL_LogPriority)\nconst (\n\tLOG_PRIORITY_VERBOSE  = iota + 1 // verbose\n\tLOG_PRIORITY_DEBUG               // debug\n\tLOG_PRIORITY_INFO                // info\n\tLOG_PRIORITY_WARN                // warn\n\tLOG_PRIORITY_ERROR               // error\n\tLOG_PRIORITY_CRITICAL            // critical\n\tNUM_LOG_PRIORITIES               // (internal use)\n)\n\n// LogPriority is a predefined log priority.\n// (https://wiki.libsdl.org/SDL_LogPriority)\ntype LogPriority C.SDL_LogPriority\n\nfunc (p LogPriority) c() C.SDL_LogPriority {\n\treturn C.SDL_LogPriority(p)\n}\n\n// LogSetAllPriority sets the priority of all log categories.\n// (https://wiki.libsdl.org/SDL_LogSetAllPriority)\nfunc LogSetAllPriority(p LogPriority) {\n\tC.SDL_LogSetAllPriority(p.c())\n}\n\n// LogSetPriority sets the priority of a particular log category.\n// (https://wiki.libsdl.org/SDL_LogSetPriority)\nfunc LogSetPriority(category int, p LogPriority) {\n\tC.SDL_LogSetPriority(C.int(category), p.c())\n}\n\n// LogGetPriority returns the priority of a particular log category.\n// (https://wiki.libsdl.org/SDL_LogGetPriority)\nfunc LogGetPriority(category int) LogPriority {\n\treturn LogPriority(C.SDL_LogGetPriority(C.int(category)))\n}\n\n// LogResetPriorities resets all priorities to default.\n// (https://wiki.libsdl.org/SDL_LogResetPriorities)\nfunc LogResetPriorities() {\n\tC.SDL_LogResetPriorities()\n}\n\n// Log logs a message with LOG_CATEGORY_APPLICATION and LOG_PRIORITY_INFO.\n// (https://wiki.libsdl.org/SDL_Log)\nfunc Log(str string, args ...interface{}) {\n\tstr = fmt.Sprintf(str, args...)\n\n\tcstr := C.CString(str)\n\tdefer C.free(unsafe.Pointer(cstr))\n\n\tC._SDL_Log(cstr)\n}\n\n// LogVerbose logs a message with LOG_PRIORITY_VERBOSE.\n// (https://wiki.libsdl.org/SDL_LogVerbose)\nfunc LogVerbose(category int, str string, args ...interface{}) {\n\tstr = fmt.Sprintf(str, args...)\n\n\tcstr := C.CString(str)\n\tdefer C.free(unsafe.Pointer(cstr))\n\n\tC._SDL_LogVerbose(C.int(category), cstr)\n}\n\n// LogDebug logs a message with LOG_PRIORITY_DEBUG.\n// (https://wiki.libsdl.org/SDL_LogDebug)\nfunc LogDebug(category int, str string, args ...interface{}) {\n\tstr = fmt.Sprintf(str, args...)\n\n\tcstr := C.CString(str)\n\tdefer C.free(unsafe.Pointer(cstr))\n\n\tC._SDL_LogDebug(C.int(category), cstr)\n}\n\n// LogInfo logs a message with LOG_PRIORITY_INFO.\n// (https://wiki.libsdl.org/SDL_LogInfo)\nfunc LogInfo(category int, str string, args ...interface{}) {\n\tstr = fmt.Sprintf(str, args...)\n\n\tcstr := C.CString(str)\n\tdefer C.free(unsafe.Pointer(cstr))\n\n\tC._SDL_LogInfo(C.int(category), cstr)\n}\n\n// LogWarn logs a message with LOG_PRIORITY_WARN.\n// (https://wiki.libsdl.org/SDL_LogWarn)\nfunc LogWarn(category int, str string, args ...interface{}) {\n\tstr = fmt.Sprintf(str, args...)\n\n\tcstr := C.CString(str)\n\tdefer C.free(unsafe.Pointer(cstr))\n\n\tC._SDL_LogWarn(C.int(category), cstr)\n}\n\n// LogError logs a message with LOG_PRIORITY_ERROR.\n// (https://wiki.libsdl.org/SDL_LogError)\nfunc LogError(category int, str string, args ...interface{}) {\n\tstr = fmt.Sprintf(str, args...)\n\n\tcstr := C.CString(str)\n\tdefer C.free(unsafe.Pointer(cstr))\n\n\tC._SDL_LogError(C.int(category), cstr)\n}\n\n// LogCritical logs a message with LOG_PRIORITY_CRITICAL.\n// (https://wiki.libsdl.org/SDL_LogCritical)\nfunc LogCritical(category int, str string, args ...interface{}) {\n\tstr = fmt.Sprintf(str, args...)\n\n\tcstr := C.CString(str)\n\tdefer C.free(unsafe.Pointer(cstr))\n\n\tC._SDL_LogCritical(C.int(category), cstr)\n}\n\n// LogMessage logs a message with the specified category and priority.\n// (https://wiki.libsdl.org/SDL_LogMessage)\nfunc LogMessage(category int, pri LogPriority, str string, args ...interface{}) {\n\tstr = fmt.Sprintf(str, args...)\n\n\tcstr := C.CString(str)\n\tdefer C.free(unsafe.Pointer(cstr))\n\n\tC._SDL_LogMessage(C.int(category), C.SDL_LogPriority(pri), cstr)\n}\n\n// LogOutputFunction is the function to call instead of the default\ntype LogOutputFunction func(data interface{}, category int, pri LogPriority, message string)\n\ntype logOutputFunctionCtx struct {\n\tf LogOutputFunction\n\td interface{}\n}\n\n// Yissakhar Z. Beck (DeedleFake)'s implementation\n//\n//export logOutputFunction\nfunc logOutputFunction(data unsafe.Pointer, category C.int, pri C.SDL_LogPriority, message *C.char) {\n\tctx := (*logOutputFunctionCtx)(data)\n\n\tctx.f(ctx.d, int(category), LogPriority(pri), C.GoString(message))\n}\n\nvar (\n\tlogOutputFunctionCache LogOutputFunction\n\tlogOutputDataCache     interface{}\n)\n\n// LogGetOutputFunction returns the current log output function.\n// (https://wiki.libsdl.org/SDL_LogGetOutputFunction)\nfunc LogGetOutputFunction() (LogOutputFunction, interface{}) {\n\treturn logOutputFunctionCache, logOutputDataCache\n}\n\n// LogSetOutputFunction replaces the default log output function with one of your own.\n// (https://wiki.libsdl.org/SDL_LogSetOutputFunction)\nfunc LogSetOutputFunction(f LogOutputFunction, data interface{}) {\n\tctx := &logOutputFunctionCtx{\n\t\tf: f,\n\t\td: data,\n\t}\n\n\tC.LogSetOutputFunction(unsafe.Pointer(ctx))\n\n\tlogOutputFunctionCache = f\n\tlogOutputDataCache = data\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/log.h",
    "content": "void LogSetOutputFunction(void *data);\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/mouse.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if defined(__WIN32)\n#include <SDL2/SDL_syswm.h>\n#else\n#include <SDL_syswm.h>\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,4))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_CaptureMouse is not supported before SDL 2.0.4\")\n#endif\n\nstatic int SDL_CaptureMouse(SDL_bool enabled)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_MOUSEWHEEL_NORMAL is not supported before SDL 2.0.4\")\n#endif\n\n#define SDL_MOUSEWHEEL_NORMAL (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_MOUSEWHEEL_FLIPPED is not supported before SDL 2.0.4\")\n#endif\n\n#define SDL_MOUSEWHEEL_FLIPPED (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WarpMouseGlobal is not supported before SDL 2.0.4\")\n#endif\n\nstatic int SDL_WarpMouseGlobal(int x, int y)\n{\n\treturn -1;\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetGlobalMouseState is not supported before SDL 2.0.4\")\n#endif\n\nstatic Uint32 SDL_GetGlobalMouseState(int *x, int *y)\n{\n\treturn 0;\n}\n\n#endif\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// Cursor types for CreateSystemCursor()\nconst (\n\tSYSTEM_CURSOR_ARROW     = C.SDL_SYSTEM_CURSOR_ARROW     // arrow\n\tSYSTEM_CURSOR_IBEAM     = C.SDL_SYSTEM_CURSOR_IBEAM     // i-beam\n\tSYSTEM_CURSOR_WAIT      = C.SDL_SYSTEM_CURSOR_WAIT      // wait\n\tSYSTEM_CURSOR_CROSSHAIR = C.SDL_SYSTEM_CURSOR_CROSSHAIR // crosshair\n\tSYSTEM_CURSOR_WAITARROW = C.SDL_SYSTEM_CURSOR_WAITARROW // small wait cursor (or wait if not available)\n\tSYSTEM_CURSOR_SIZENWSE  = C.SDL_SYSTEM_CURSOR_SIZENWSE  // double arrow pointing northwest and southeast\n\tSYSTEM_CURSOR_SIZENESW  = C.SDL_SYSTEM_CURSOR_SIZENESW  // double arrow pointing northeast and southwest\n\tSYSTEM_CURSOR_SIZEWE    = C.SDL_SYSTEM_CURSOR_SIZEWE    // double arrow pointing west and east\n\tSYSTEM_CURSOR_SIZENS    = C.SDL_SYSTEM_CURSOR_SIZENS    // double arrow pointing north and south\n\tSYSTEM_CURSOR_SIZEALL   = C.SDL_SYSTEM_CURSOR_SIZEALL   // four pointed arrow pointing north, south, east, and west\n\tSYSTEM_CURSOR_NO        = C.SDL_SYSTEM_CURSOR_NO        // slashed circle or crossbones\n\tSYSTEM_CURSOR_HAND      = C.SDL_SYSTEM_CURSOR_HAND      // hand\n\tNUM_SYSTEM_CURSORS      = C.SDL_NUM_SYSTEM_CURSORS      // (only for bounding internal arrays)\n)\n\n// Scroll direction types for the Scroll event\nconst (\n\tMOUSEWHEEL_NORMAL  = C.SDL_MOUSEWHEEL_NORMAL  // the scroll direction is normal\n\tMOUSEWHEEL_FLIPPED = C.SDL_MOUSEWHEEL_FLIPPED // the scroll direction is flipped / natural\n)\n\n// Used as a mask when testing buttons in buttonstate.\nconst (\n\tBUTTON_LEFT   = C.SDL_BUTTON_LEFT   // left mouse button\n\tBUTTON_MIDDLE = C.SDL_BUTTON_MIDDLE // middle mouse button\n\tBUTTON_RIGHT  = C.SDL_BUTTON_RIGHT  // right mouse button\n\tBUTTON_X1     = C.SDL_BUTTON_X1     // x1 mouse button\n\tBUTTON_X2     = C.SDL_BUTTON_X2     // x2 mouse button\n)\n\n// Cursor is a custom cursor created by CreateCursor() or CreateColorCursor().\ntype Cursor C.SDL_Cursor\n\n// SystemCursor is a system cursor created by CreateSystemCursor().\ntype SystemCursor C.SDL_SystemCursor\n\nfunc (c *Cursor) cptr() *C.SDL_Cursor {\n\treturn (*C.SDL_Cursor)(unsafe.Pointer(c))\n}\n\nfunc (c SystemCursor) c() C.SDL_SystemCursor {\n\treturn C.SDL_SystemCursor(c)\n}\n\n// GetMouseFocus returns the window which currently has mouse focus.\n// (https://wiki.libsdl.org/SDL_GetMouseFocus)\nfunc GetMouseFocus() *Window {\n\treturn (*Window)(unsafe.Pointer(C.SDL_GetMouseFocus()))\n}\n\n// GetGlobalMouseState returns the current state of the mouse.\n// (https://wiki.libsdl.org/SDL_GetGlobalMouseState)\nfunc GetGlobalMouseState() (x, y int32, state uint32) {\n\tvar _x, _y C.int\n\t_state := uint32(C.SDL_GetGlobalMouseState(&_x, &_y))\n\treturn int32(_x), int32(_y), _state\n}\n\n// GetMouseState returns the current state of the mouse.\n// (https://wiki.libsdl.org/SDL_GetMouseState)\nfunc GetMouseState() (x, y int32, state uint32) {\n\tvar _x, _y C.int\n\t_state := uint32(C.SDL_GetMouseState(&_x, &_y))\n\treturn int32(_x), int32(_y), _state\n}\n\n// GetRelativeMouseState returns the relative state of the mouse.\n// (https://wiki.libsdl.org/SDL_GetRelativeMouseState)\nfunc GetRelativeMouseState() (x, y int32, state uint32) {\n\tvar _x, _y C.int\n\t_state := uint32(C.SDL_GetRelativeMouseState(&_x, &_y))\n\treturn int32(_x), int32(_y), _state\n}\n\n// WarpMouseInWindow moves the mouse to the given position within the window.\n// (https://wiki.libsdl.org/SDL_WarpMouseInWindow)\nfunc (window *Window) WarpMouseInWindow(x, y int32) {\n\tC.SDL_WarpMouseInWindow(window.cptr(), C.int(x), C.int(y))\n}\n\n// SetRelativeMouseMode sets relative mouse mode.\n// (https://wiki.libsdl.org/SDL_SetRelativeMouseMode)\nfunc SetRelativeMouseMode(enabled bool) int {\n\treturn int(C.SDL_SetRelativeMouseMode(C.SDL_bool(Btoi(enabled))))\n}\n\n// GetRelativeMouseMode reports where relative mouse mode is enabled.\n// (https://wiki.libsdl.org/SDL_GetRelativeMouseMode)\nfunc GetRelativeMouseMode() bool {\n\treturn C.SDL_GetRelativeMouseMode() > 0\n}\n\n// CreateCursor creates a cursor using the specified bitmap data and mask (in MSB format).\n// (https://wiki.libsdl.org/SDL_CreateCursor)\nfunc CreateCursor(data, mask *uint8, w, h, hotX, hotY int32) *Cursor {\n\t_data := (*C.Uint8)(unsafe.Pointer(data))\n\t_mask := (*C.Uint8)(unsafe.Pointer(mask))\n\treturn (*Cursor)(C.SDL_CreateCursor(_data, _mask, C.int(w), C.int(h), C.int(hotX), C.int(hotY)))\n}\n\n// CreateColorCursor creates a color cursor.\n// (https://wiki.libsdl.org/SDL_CreateColorCursor)\nfunc CreateColorCursor(surface *Surface, hotX, hotY int32) *Cursor {\n\treturn (*Cursor)(C.SDL_CreateColorCursor(surface.cptr(), C.int(hotX), C.int(hotY)))\n}\n\n// CreateSystemCursor creates a system cursor.\n// (https://wiki.libsdl.org/SDL_CreateSystemCursor)\nfunc CreateSystemCursor(id SystemCursor) *Cursor {\n\treturn (*Cursor)(C.SDL_CreateSystemCursor(id.c()))\n}\n\n// SetCursor sets the active cursor.\n// (https://wiki.libsdl.org/SDL_SetCursor)\nfunc SetCursor(cursor *Cursor) {\n\tC.SDL_SetCursor(cursor.cptr())\n}\n\n// GetCursor returns the active cursor.\n// (https://wiki.libsdl.org/SDL_GetCursor)\nfunc GetCursor() *Cursor {\n\treturn (*Cursor)(C.SDL_GetCursor())\n}\n\n// GetDefaultCursor returns the default cursor.\n// (https://wiki.libsdl.org/SDL_GetDefaultCursor)\nfunc GetDefaultCursor() *Cursor {\n\treturn (*Cursor)(C.SDL_GetDefaultCursor())\n}\n\n// FreeCursor frees a cursor created with CreateCursor(), CreateColorCursor() or CreateSystemCursor().\n// (https://wiki.libsdl.org/SDL_FreeCursor)\nfunc FreeCursor(cursor *Cursor) {\n\tC.SDL_FreeCursor(cursor.cptr())\n}\n\n// ShowCursor toggles whether or not the cursor is shown.\n// (https://wiki.libsdl.org/SDL_ShowCursor)\nfunc ShowCursor(toggle int) (int, error) {\n\ti := int(C.SDL_ShowCursor(C.int(toggle)))\n\treturn i, errorFromInt(i)\n}\n\n// CaptureMouse captures the mouse and tracks input outside an SDL window.\n// (https://wiki.libsdl.org/SDL_CaptureMouse)\nfunc CaptureMouse(toggle bool) error {\n\tvar ierr C.int\n\tif toggle {\n\t\tierr = C.SDL_CaptureMouse(C.SDL_TRUE)\n\t} else {\n\t\tierr = C.SDL_CaptureMouse(C.SDL_FALSE)\n\t}\n\tif ierr != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Button is used as a mask when testing buttons in buttonstate.\nfunc Button(flag uint32) uint32 {\n\treturn 1 << (flag - 1)\n}\n\n// ButtonLMask is used as a mask when testing buttons in buttonstate.\nfunc ButtonLMask() uint32 {\n\treturn Button(BUTTON_LEFT)\n}\n\n// ButtonMMask is used as a mask when testing buttons in buttonstate.\nfunc ButtonMMask() uint32 {\n\treturn Button(BUTTON_MIDDLE)\n}\n\n// ButtonRMask is used as a mask when testing buttons in buttonstate.\nfunc ButtonRMask() uint32 {\n\treturn Button(BUTTON_RIGHT)\n}\n\n// ButtonX1Mask is used as a mask when testing buttons in buttonstate.\nfunc ButtonX1Mask() uint32 {\n\treturn Button(BUTTON_X1)\n}\n\n// ButtonX2Mask is used as a mask when testing buttons in buttonstate.\nfunc ButtonX2Mask() uint32 {\n\treturn Button(BUTTON_X2)\n}\n\n// WarpMouseGlobal moves the mouse to the given position in global screen space.\n// (https://wiki.libsdl.org/SDL_WarpMouseGlobal)\nfunc WarpMouseGlobal(x, y int32) error {\n\ti := int(C.SDL_WarpMouseGlobal(C.int(x), C.int(y)))\n\treturn errorFromInt(i)\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/mutex.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\nimport \"unsafe\"\n\n// ThreadID is the thread identifier for a thread.\ntype ThreadID uint64\n\n// Mutex is the SDL mutex structure.\ntype Mutex struct {\n\tRecursive int\n\tOwner     ThreadID\n\tSem       *Sem\n}\n\n// Sem is the SDL semaphore structure.\ntype Sem struct {\n\tCount        uint32\n\tWaitersCount uint32\n\tCountLock    *Mutex\n\tCountNonzero *Cond\n}\n\n// Cond is the SDL condition variable structure.\ntype Cond struct {\n\tLock     *Mutex\n\tWaiting  int\n\tSignals  int\n\tWaitSem  *Sem\n\tWaitDone *Sem\n}\n\nfunc (m *Mutex) cptr() *C.SDL_mutex {\n\treturn (*C.SDL_mutex)(unsafe.Pointer(m))\n}\n\nfunc (s *Sem) cptr() *C.SDL_sem {\n\treturn (*C.SDL_sem)(unsafe.Pointer(s))\n}\n\nfunc (c *Cond) cptr() *C.SDL_cond {\n\treturn (*C.SDL_cond)(unsafe.Pointer(c))\n}\n\n// CreateMutex creates a new mutex.\n// (https://wiki.libsdl.org/SDL_CreateMutex)\nfunc CreateMutex() (*Mutex, error) {\n\tmutex := C.SDL_CreateMutex()\n\tif mutex == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Mutex)(unsafe.Pointer(mutex)), nil\n}\n\n// Lock locks a mutex created with CreateMutex().\n// (https://wiki.libsdl.org/SDL_LockMutex)\nfunc (mutex *Mutex) Lock() error {\n\tret := int(C.SDL_LockMutex(mutex.cptr()))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// TryLock tries to lock a mutex without blocking.\n// (https://wiki.libsdl.org/SDL_TryLockMutex)\nfunc (mutex *Mutex) TryLock() error {\n\tret := int(C.SDL_TryLockMutex(mutex.cptr()))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Unlock unlocks a mutex created with CreateMutex().\n// (https://wiki.libsdl.org/SDL_UnlockMutex)\nfunc (mutex *Mutex) Unlock() error {\n\tret := int(C.SDL_UnlockMutex(mutex.cptr()))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Destroy destroys a mutex created with CreateMutex().\n// (https://wiki.libsdl.org/SDL_DestroyMutex)\nfunc (mutex *Mutex) Destroy() {\n\tC.SDL_DestroyMutex(mutex.cptr())\n}\n\n// CreateSemaphore creates a semaphore.\n// (https://wiki.libsdl.org/SDL_CreateSemaphore)\nfunc CreateSemaphore(initialValue uint32) (*Sem, error) {\n\tsem := C.SDL_CreateSemaphore(C.Uint32(initialValue))\n\tif sem == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Sem)(unsafe.Pointer(sem)), nil\n}\n\n// Destroy destroys a semaphore.\n// (https://wiki.libsdl.org/SDL_DestroySemaphore)\nfunc (sem *Sem) Destroy() {\n\tC.SDL_DestroySemaphore(sem.cptr())\n}\n\n// Wait waits until a semaphore has a positive value and then decrements it.\n// (https://wiki.libsdl.org/SDL_SemWait)\nfunc (sem *Sem) Wait() error {\n\tret := int(C.SDL_SemWait(sem.cptr()))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// TryWait sees if a semaphore has a positive value and decrement it if it does.\n// (https://wiki.libsdl.org/SDL_SemTryWait)\nfunc (sem *Sem) TryWait() error {\n\tret := int(C.SDL_SemTryWait(sem.cptr()))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// WaitTimeout waits until a semaphore has a positive value and then decrements it.\n// (https://wiki.libsdl.org/SDL_SemWaitTimeout)\nfunc (sem *Sem) WaitTimeout(ms uint32) error {\n\tret := int(C.SDL_SemWaitTimeout(sem.cptr(), C.Uint32(ms)))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Post atomically increments a semaphore's value and wake waiting threads.\n// (https://wiki.libsdl.org/SDL_SemPost)\nfunc (sem *Sem) Post() error {\n\tret := int(C.SDL_SemPost(sem.cptr()))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Value returns the current value of a semaphore.\n// (https://wiki.libsdl.org/SDL_SemValue)\nfunc (sem *Sem) Value() uint32 {\n\treturn uint32(C.SDL_SemValue(sem.cptr()))\n}\n\n// CreateCond (https://wiki.libsdl.org/SDL_CreateCond)\nfunc CreateCond() *Cond {\n\treturn (*Cond)(unsafe.Pointer(C.SDL_CreateCond()))\n}\n\n// Destroy creates a condition variable.\n// (https://wiki.libsdl.org/SDL_DestroyCond)\nfunc (cond *Cond) Destroy() {\n\tC.SDL_DestroyCond(cond.cptr())\n}\n\n// Signal restarts one of the threads that are waiting on the condition variable.\n// (https://wiki.libsdl.org/SDL_CondSignal)\nfunc (cond *Cond) Signal() error {\n\tret := int(C.SDL_CondSignal(cond.cptr()))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Broadcast restarts all threads that are waiting on the condition variable.\n// (https://wiki.libsdl.org/SDL_CondBroadcast)\nfunc (cond *Cond) Broadcast() error {\n\tret := int(C.SDL_CondBroadcast(cond.cptr()))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Wait waits until a condition variable is signaled.\n// (https://wiki.libsdl.org/SDL_CondWait)\nfunc (cond *Cond) Wait(mutex *Mutex) error {\n\tret := int(C.SDL_CondWait(cond.cptr(), mutex.cptr()))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// WaitTimeout waits until a condition variable is signaled or a specified amount of time has passed.\n// (https://wiki.libsdl.org/SDL_CondWaitTimeout)\nfunc (cond *Cond) WaitTimeout(mutex *Mutex, ms uint32) error {\n\tret := int(C.SDL_CondWaitTimeout(cond.cptr(), mutex.cptr(), C.Uint32(ms)))\n\tif ret != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/pixels.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\n//\n// #if !(SDL_VERSION_ATLEAST(2,0,5))\n//\n// enum\n// {\n// #if SDL_BYTEORDER == SDL_BIG_ENDIAN\n//     SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_RGBA8888,\n//     SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888,\n//     SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888,\n//     SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888\n// #else\n//     SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888,\n//     SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888,\n//     SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888,\n//     SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888\n// #endif\n// };\n//\n// #endif\n//\n// int bytesPerPixel(Uint32 format) {\n//   return SDL_BYTESPERPIXEL(format);\n// }\n//\n// int bitsPerPixel(Uint32 format) {\n//   return SDL_BITSPERPIXEL(format);\n// }\nimport \"C\"\nimport (\n\t\"image/color\"\n\t\"unsafe\"\n)\n\n// PixelFormat contains pixel format information.\n// (https://wiki.libsdl.org/SDL_PixelFormat)\ntype PixelFormat struct {\n\tFormat        uint32       // one of the PIXELFORMAT values (https://wiki.libsdl.org/SDL_PixelFormatEnum)\n\tPalette       *Palette     // palette structure associated with this pixel format, or nil if the format doesn't have a palette (https://wiki.libsdl.org/SDL_Palette)\n\tBitsPerPixel  uint8        // the number of significant bits in a pixel value, eg: 8, 15, 16, 24, 32\n\tBytesPerPixel uint8        // the number of bytes required to hold a pixel value, eg: 1, 2, 3, 4\n\t_             [2]uint8     // padding\n\tRmask         uint32       // a mask representing the location of the red component of the pixel\n\tGmask         uint32       // a mask representing the location of the green component of the pixel\n\tBmask         uint32       // a mask representing the location of the blue component of the pixel\n\tAmask         uint32       // a mask representing the location of the alpha component of the pixel or 0 if the pixel format doesn't have any alpha information\n\trLoss         uint8        // (internal use)\n\tgLoss         uint8        // (internal use)\n\tbLoss         uint8        // (internal use)\n\taLoss         uint8        // (internal use)\n\trShift        uint8        // (internal use)\n\tgShift        uint8        // (internal use)\n\tbShift        uint8        // (internal use)\n\taShift        uint8        // (internal use)\n\trefCount      int32        // (internal use)\n\tnext          *PixelFormat // (internal use)\n}\ntype cPixelFormat C.SDL_PixelFormat\n\n// Palette contains palette information.\n// (https://wiki.libsdl.org/SDL_Palette)\ntype Palette struct {\n\tNcolors  int32  // the number of colors in the palette\n\tColors   *Color // an array of Color structures representing the palette (https://wiki.libsdl.org/SDL_Color)\n\tversion  uint32 // incrementally tracks changes to the palette (internal use)\n\trefCount int32  // reference count (internal use)\n}\ntype cPalette C.SDL_Palette\n\n// Color represents a color. This implements image/color.Color interface.\n// (https://wiki.libsdl.org/SDL_Color)\ntype Color color.NRGBA\n\n// Uint32 return uint32 representation of RGBA color.\nfunc (c Color) Uint32() uint32 {\n\tvar v uint32\n\tv |= uint32(c.R) << 24\n\tv |= uint32(c.G) << 16\n\tv |= uint32(c.B) << 8\n\tv |= uint32(c.A)\n\treturn v\n}\n\n// Pixel types.\nconst (\n\tPIXELTYPE_UNKNOWN  = C.SDL_PIXELTYPE_UNKNOWN\n\tPIXELTYPE_INDEX1   = C.SDL_PIXELTYPE_INDEX1\n\tPIXELTYPE_INDEX4   = C.SDL_PIXELTYPE_INDEX4\n\tPIXELTYPE_INDEX8   = C.SDL_PIXELTYPE_INDEX8\n\tPIXELTYPE_PACKED8  = C.SDL_PIXELTYPE_PACKED8\n\tPIXELTYPE_PACKED16 = C.SDL_PIXELTYPE_PACKED16\n\tPIXELTYPE_PACKED32 = C.SDL_PIXELTYPE_PACKED32\n\tPIXELTYPE_ARRAYU8  = C.SDL_PIXELTYPE_ARRAYU8\n\tPIXELTYPE_ARRAYU16 = C.SDL_PIXELTYPE_ARRAYU16\n\tPIXELTYPE_ARRAYU32 = C.SDL_PIXELTYPE_ARRAYU32\n\tPIXELTYPE_ARRAYF16 = C.SDL_PIXELTYPE_ARRAYF16\n\tPIXELTYPE_ARRAYF32 = C.SDL_PIXELTYPE_ARRAYF32\n)\n\n// Bitmap pixel order high bit -> low bit.\nconst (\n\tBITMAPORDER_NONE = C.SDL_BITMAPORDER_NONE\n\tBITMAPORDER_4321 = C.SDL_BITMAPORDER_4321\n\tBITMAPORDER_1234 = C.SDL_BITMAPORDER_1234\n)\n\n// Packed component order high bit -> low bit.\nconst (\n\tPACKEDORDER_NONE = C.SDL_PACKEDORDER_NONE\n\tPACKEDORDER_XRGB = C.SDL_PACKEDORDER_XRGB\n\tPACKEDORDER_RGBX = C.SDL_PACKEDORDER_RGBX\n\tPACKEDORDER_ARGB = C.SDL_PACKEDORDER_ARGB\n\tPACKEDORDER_RGBA = C.SDL_PACKEDORDER_RGBA\n\tPACKEDORDER_XBGR = C.SDL_PACKEDORDER_XBGR\n\tPACKEDORDER_BGRX = C.SDL_PACKEDORDER_BGRX\n\tPACKEDORDER_ABGR = C.SDL_PACKEDORDER_ABGR\n\tPACKEDORDER_BGRA = C.SDL_PACKEDORDER_BGRA\n)\n\n// Array component order low byte -> high byte.\nconst (\n\tARRAYORDER_NONE = C.SDL_ARRAYORDER_NONE\n\tARRAYORDER_RGB  = C.SDL_ARRAYORDER_RGB\n\tARRAYORDER_RGBA = C.SDL_ARRAYORDER_RGBA\n\tARRAYORDER_ARGB = C.SDL_ARRAYORDER_ARGB\n\tARRAYORDER_BGR  = C.SDL_ARRAYORDER_BGR\n\tARRAYORDER_BGRA = C.SDL_ARRAYORDER_BGRA\n\tARRAYORDER_ABGR = C.SDL_ARRAYORDER_ABGR\n)\n\n// Packed component layout.\nconst (\n\tPACKEDLAYOUT_NONE    = C.SDL_PACKEDLAYOUT_NONE\n\tPACKEDLAYOUT_332     = C.SDL_PACKEDLAYOUT_332\n\tPACKEDLAYOUT_4444    = C.SDL_PACKEDLAYOUT_4444\n\tPACKEDLAYOUT_1555    = C.SDL_PACKEDLAYOUT_1555\n\tPACKEDLAYOUT_5551    = C.SDL_PACKEDLAYOUT_5551\n\tPACKEDLAYOUT_565     = C.SDL_PACKEDLAYOUT_565\n\tPACKEDLAYOUT_8888    = C.SDL_PACKEDLAYOUT_8888\n\tPACKEDLAYOUT_2101010 = C.SDL_PACKEDLAYOUT_2101010\n\tPACKEDLAYOUT_1010102 = C.SDL_PACKEDLAYOUT_1010102\n)\n\n// Pixel format values.\nconst (\n\tPIXELFORMAT_UNKNOWN     = C.SDL_PIXELFORMAT_UNKNOWN\n\tPIXELFORMAT_INDEX1LSB   = C.SDL_PIXELFORMAT_INDEX1LSB\n\tPIXELFORMAT_INDEX1MSB   = C.SDL_PIXELFORMAT_INDEX1MSB\n\tPIXELFORMAT_INDEX4LSB   = C.SDL_PIXELFORMAT_INDEX4LSB\n\tPIXELFORMAT_INDEX4MSB   = C.SDL_PIXELFORMAT_INDEX4MSB\n\tPIXELFORMAT_INDEX8      = C.SDL_PIXELFORMAT_INDEX8\n\tPIXELFORMAT_RGB332      = C.SDL_PIXELFORMAT_RGB332\n\tPIXELFORMAT_RGB444      = C.SDL_PIXELFORMAT_RGB444\n\tPIXELFORMAT_RGB555      = C.SDL_PIXELFORMAT_RGB555\n\tPIXELFORMAT_BGR555      = C.SDL_PIXELFORMAT_BGR555\n\tPIXELFORMAT_ARGB4444    = C.SDL_PIXELFORMAT_ARGB4444\n\tPIXELFORMAT_RGBA4444    = C.SDL_PIXELFORMAT_RGBA4444\n\tPIXELFORMAT_ABGR4444    = C.SDL_PIXELFORMAT_ABGR4444\n\tPIXELFORMAT_BGRA4444    = C.SDL_PIXELFORMAT_BGRA4444\n\tPIXELFORMAT_ARGB1555    = C.SDL_PIXELFORMAT_ARGB1555\n\tPIXELFORMAT_RGBA5551    = C.SDL_PIXELFORMAT_RGBA5551\n\tPIXELFORMAT_ABGR1555    = C.SDL_PIXELFORMAT_ABGR1555\n\tPIXELFORMAT_BGRA5551    = C.SDL_PIXELFORMAT_BGRA5551\n\tPIXELFORMAT_RGB565      = C.SDL_PIXELFORMAT_RGB565\n\tPIXELFORMAT_BGR565      = C.SDL_PIXELFORMAT_BGR565\n\tPIXELFORMAT_RGB24       = C.SDL_PIXELFORMAT_RGB24\n\tPIXELFORMAT_BGR24       = C.SDL_PIXELFORMAT_BGR24\n\tPIXELFORMAT_RGB888      = C.SDL_PIXELFORMAT_RGB888\n\tPIXELFORMAT_RGBX8888    = C.SDL_PIXELFORMAT_RGBX8888\n\tPIXELFORMAT_BGR888      = C.SDL_PIXELFORMAT_BGR888\n\tPIXELFORMAT_BGRX8888    = C.SDL_PIXELFORMAT_BGRX8888\n\tPIXELFORMAT_ARGB8888    = C.SDL_PIXELFORMAT_ARGB8888\n\tPIXELFORMAT_RGBA8888    = C.SDL_PIXELFORMAT_RGBA8888\n\tPIXELFORMAT_ABGR8888    = C.SDL_PIXELFORMAT_ABGR8888\n\tPIXELFORMAT_BGRA8888    = C.SDL_PIXELFORMAT_BGRA8888\n\tPIXELFORMAT_ARGB2101010 = C.SDL_PIXELFORMAT_ARGB2101010\n\tPIXELFORMAT_YV12        = C.SDL_PIXELFORMAT_YV12\n\tPIXELFORMAT_IYUV        = C.SDL_PIXELFORMAT_IYUV\n\tPIXELFORMAT_YUY2        = C.SDL_PIXELFORMAT_YUY2\n\tPIXELFORMAT_UYVY        = C.SDL_PIXELFORMAT_UYVY\n\tPIXELFORMAT_YVYU        = C.SDL_PIXELFORMAT_YVYU\n)\n\n// Pixel format variables.\nvar (\n\tPIXELFORMAT_RGBA32 = C.SDL_PIXELFORMAT_RGBA32\n\tPIXELFORMAT_ARGB32 = C.SDL_PIXELFORMAT_ARGB32\n\tPIXELFORMAT_BGRA32 = C.SDL_PIXELFORMAT_BGRA32\n\tPIXELFORMAT_ABGR32 = C.SDL_PIXELFORMAT_ABGR32\n)\n\n// These define alpha as the opacity of a surface.\nconst (\n\tALPHA_OPAQUE      = C.SDL_ALPHA_OPAQUE\n\tALPHA_TRANSPARENT = C.SDL_ALPHA_TRANSPARENT\n)\n\nfunc (format *PixelFormat) cptr() *C.SDL_PixelFormat {\n\treturn (*C.SDL_PixelFormat)(unsafe.Pointer(format))\n}\n\nfunc (palette *Palette) cptr() *C.SDL_Palette {\n\treturn (*C.SDL_Palette)(unsafe.Pointer(palette))\n}\n\n/*\n * the following code is modified version of the code from bitbucket.org/dooots/go-sdl2\n */\n\n// GetPixelFormatName returns the human readable name of a pixel format.\n// (https://wiki.libsdl.org/SDL_GetPixelFormatName)\nfunc GetPixelFormatName(format uint) string {\n\treturn C.GoString(C.SDL_GetPixelFormatName(C.Uint32(format)))\n}\n\n// PixelFormatEnumToMasks converts one of the enumerated pixel formats to a bpp value and RGBA masks.\n// (https://wiki.libsdl.org/SDL_PixelFormatEnumToMasks)\nfunc PixelFormatEnumToMasks(format uint) (bpp int, rmask, gmask, bmask, amask uint32, err error) {\n\tresult := C.SDL_PixelFormatEnumToMasks(C.Uint32(format), (*C.int)(unsafe.Pointer(&bpp)),\n\t\t(*C.Uint32)(&rmask), (*C.Uint32)(&gmask), (*C.Uint32)(&bmask),\n\t\t(*C.Uint32)(&amask))\n\tif result == C.SDL_FALSE {\n\t\terr = GetError()\n\t}\n\treturn\n}\n\n// MasksToPixelFormatEnum converts a bpp value and RGBA masks to an enumerated pixel format.\n// (https://wiki.libsdl.org/SDL_MasksToPixelFormatEnum)\nfunc MasksToPixelFormatEnum(bpp int, rmask, gmask, bmask, amask uint32) uint {\n\treturn uint(C.SDL_MasksToPixelFormatEnum(C.int(bpp), C.Uint32(rmask), C.Uint32(gmask),\n\t\tC.Uint32(bmask), C.Uint32(amask)))\n}\n\n// AllocFormat creates a PixelFormat structure corresponding to a pixel format.\n// (https://wiki.libsdl.org/SDL_AllocFormat)\nfunc AllocFormat(format uint) (*PixelFormat, error) {\n\tr := (*PixelFormat)(unsafe.Pointer(C.SDL_AllocFormat(C.Uint32(format))))\n\tif r == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn r, nil\n}\n\n// Free frees the PixelFormat structure allocated by AllocFormat().\n// (https://wiki.libsdl.org/SDL_FreeFormat)\nfunc (format *PixelFormat) Free() {\n\tC.SDL_FreeFormat((*C.SDL_PixelFormat)(unsafe.Pointer(format)))\n}\n\n// AllocPalette creates a palette structure with the specified number of color entries.\n// (https://wiki.libsdl.org/SDL_AllocPalette)\nfunc AllocPalette(ncolors int) (*Palette, error) {\n\tr := (*Palette)(unsafe.Pointer(C.SDL_AllocPalette(C.int(ncolors))))\n\tif r == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn r, nil\n}\n\n// SetPalette sets the palette for the pixel format structure.\n// (https://wiki.libsdl.org/SDL_SetPixelFormatPalette)\nfunc (format *PixelFormat) SetPalette(palette *Palette) error {\n\tr := C.SDL_SetPixelFormatPalette((*C.SDL_PixelFormat)(unsafe.Pointer(format)),\n\t\t(*C.SDL_Palette)(unsafe.Pointer(palette)))\n\tif r != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// SetColors sets a range of colors in the palette.\n// (https://wiki.libsdl.org/SDL_SetPaletteColors)\nfunc (palette *Palette) SetColors(colors []Color) error {\n\tif colors == nil {\n\t\treturn nil\n\t}\n\tvar ptr *C.SDL_Color\n\tif len(colors) > 0 {\n\t\tptr = (*C.SDL_Color)(unsafe.Pointer(&colors[0]))\n\t}\n\n\tr := C.SDL_SetPaletteColors((*C.SDL_Palette)(unsafe.Pointer(palette)),\n\t\tptr, 0, C.int(len(colors)))\n\tif r != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Free frees the palette created with AllocPalette().\n// (https://wiki.libsdl.org/SDL_FreePalette)\nfunc (palette *Palette) Free() {\n\tC.SDL_FreePalette((*C.SDL_Palette)(unsafe.Pointer(palette)))\n}\n\n// MapRGB maps an RGB triple to an opaque pixel value for a given pixel format.\n// (https://wiki.libsdl.org/SDL_MapRGB)\nfunc MapRGB(format *PixelFormat, r, g, b uint8) uint32 {\n\treturn uint32(C.SDL_MapRGB((*C.SDL_PixelFormat)(unsafe.Pointer(format)),\n\t\tC.Uint8(r), C.Uint8(g), C.Uint8(b)))\n}\n\n// MapRGBA maps an RGBA quadruple to a pixel value for a given pixel format.\n// (https://wiki.libsdl.org/SDL_MapRGBA)\nfunc MapRGBA(format *PixelFormat, r, g, b, a uint8) uint32 {\n\treturn uint32(C.SDL_MapRGBA((*C.SDL_PixelFormat)(unsafe.Pointer(format)),\n\t\tC.Uint8(r), C.Uint8(g), C.Uint8(b), C.Uint8(a)))\n}\n\n// GetRGB returns RGB values from a pixel in the specified format.\n// (https://wiki.libsdl.org/SDL_GetRGB)\nfunc GetRGB(pixel uint32, format *PixelFormat) (r, g, b uint8) {\n\tC.SDL_GetRGB(C.Uint32(pixel), (*C.SDL_PixelFormat)(unsafe.Pointer(format)),\n\t\t(*C.Uint8)(&r), (*C.Uint8)(&g), (*C.Uint8)(&b))\n\treturn\n}\n\n// GetRGBA returns RGBA values from a pixel in the specified format.\n// (https://wiki.libsdl.org/SDL_GetRGBA)\nfunc GetRGBA(pixel uint32, format *PixelFormat) (r, g, b, a uint8) {\n\tC.SDL_GetRGBA(C.Uint32(pixel), (*C.SDL_PixelFormat)(unsafe.Pointer(format)),\n\t\t(*C.Uint8)(&r), (*C.Uint8)(&g), (*C.Uint8)(&b), (*C.Uint8)(&a))\n\treturn\n}\n\n// CalculateGammaRamp calculates a 256 entry gamma ramp for a gamma value.\n// (https://wiki.libsdl.org/SDL_CalculateGammaRamp)\nfunc CalculateGammaRamp(gamma float32, ramp *[256]uint16) {\n\tC.SDL_CalculateGammaRamp(C.float(gamma), (*C.Uint16)(unsafe.Pointer(&ramp[0])))\n}\n\n// BytesPerPixel returns the number of bytes per pixel for the given format\nfunc BytesPerPixel(format uint32) int {\n\treturn int(C.bytesPerPixel(C.Uint32(format)))\n}\n\n// BitsPerPixel returns the number of bits per pixel for the given format\nfunc BitsPerPixel(format uint32) int {\n\treturn int(C.bitsPerPixel(C.Uint32(format)))\n}\n\nvar (\n\tRGB444Model   color.Model = color.ModelFunc(rgb444Model)\n\tRGB332Model   color.Model = color.ModelFunc(rgb332Model)\n\tRGB565Model   color.Model = color.ModelFunc(rgb565Model)\n\tRGB555Model   color.Model = color.ModelFunc(rgb555Model)\n\tBGR565Model   color.Model = color.ModelFunc(bgr565Model)\n\tBGR555Model   color.Model = color.ModelFunc(bgr555Model)\n\tARGB4444Model color.Model = color.ModelFunc(argb4444Model)\n\tABGR4444Model color.Model = color.ModelFunc(abgr4444Model)\n\tRGBA4444Model color.Model = color.ModelFunc(rgba4444Model)\n\tBGRA4444Model color.Model = color.ModelFunc(bgra4444Model)\n\tARGB1555Model color.Model = color.ModelFunc(argb1555Model)\n\tRGBA5551Model color.Model = color.ModelFunc(rgba5551Model)\n\tABGR1555Model color.Model = color.ModelFunc(abgr1555Model)\n\tBGRA5551Model color.Model = color.ModelFunc(bgra5551Model)\n\tRGBA8888Model color.Model = color.ModelFunc(rgba8888Model)\n\tBGRA8888Model color.Model = color.ModelFunc(bgra8888Model)\n)\n\ntype RGB444 struct {\n\tR, G, B byte\n}\n\nfunc (c RGB444) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale4to8bit(c.R),\n\t\tG: upscale4to8bit(c.G),\n\t\tB: upscale4to8bit(c.B),\n\t\tA: 0xFF,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc rgb444Model(c color.Color) color.Color {\n\tif _, ok := c.(RGB444); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn RGB444{\n\t\tR: downscale8to4bit(nrgba.R),\n\t\tG: downscale8to4bit(nrgba.G),\n\t\tB: downscale8to4bit(nrgba.B),\n\t}\n}\n\ntype RGB332 struct {\n\tR, G, B byte\n}\n\nfunc (c RGB332) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale3to8bit(c.R),\n\t\tG: upscale3to8bit(c.G),\n\t\tB: upscale2to8bit(c.B),\n\t\tA: 0xFF,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc rgb332Model(c color.Color) color.Color {\n\tif _, ok := c.(RGB332); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn RGB332{\n\t\tR: downscale8to3bit(nrgba.R),\n\t\tG: downscale8to3bit(nrgba.G),\n\t\tB: downscale8to2bit(nrgba.B),\n\t}\n}\n\ntype RGB565 struct {\n\tR, G, B byte\n}\n\nfunc (c RGB565) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale5to8bit(c.R),\n\t\tG: upscale6to8bit(c.G),\n\t\tB: upscale5to8bit(c.B),\n\t\tA: 0xFF,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc rgb565Model(c color.Color) color.Color {\n\tif _, ok := c.(RGB565); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn RGB565{\n\t\tR: downscale8to5bit(nrgba.R),\n\t\tG: downscale8to6bit(nrgba.G),\n\t\tB: downscale8to5bit(nrgba.B),\n\t}\n}\n\ntype RGB555 struct {\n\tR, G, B byte\n}\n\nfunc (c RGB555) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale5to8bit(c.R),\n\t\tG: upscale5to8bit(c.G),\n\t\tB: upscale5to8bit(c.B),\n\t\tA: 0xFF,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc rgb555Model(c color.Color) color.Color {\n\tif _, ok := c.(RGB555); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn RGB555{\n\t\tR: downscale8to5bit(nrgba.R),\n\t\tG: downscale8to5bit(nrgba.G),\n\t\tB: downscale8to5bit(nrgba.B),\n\t}\n}\n\ntype BGR565 struct {\n\tB, G, R byte\n}\n\nfunc (c BGR565) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale5to8bit(c.R),\n\t\tG: upscale6to8bit(c.G),\n\t\tB: upscale5to8bit(c.B),\n\t\tA: 0xFF,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc bgr565Model(c color.Color) color.Color {\n\tif _, ok := c.(BGR565); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn BGR565{\n\t\tB: downscale8to5bit(nrgba.B),\n\t\tG: downscale8to6bit(nrgba.G),\n\t\tR: downscale8to5bit(nrgba.R),\n\t}\n}\n\ntype BGR555 struct {\n\tB, G, R byte\n}\n\nfunc (c BGR555) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale5to8bit(c.R),\n\t\tG: upscale5to8bit(c.G),\n\t\tB: upscale5to8bit(c.B),\n\t\tA: 0xFF,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc bgr555Model(c color.Color) color.Color {\n\tif _, ok := c.(BGR555); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn BGR555{\n\t\tB: downscale8to5bit(nrgba.B),\n\t\tG: downscale8to5bit(nrgba.G),\n\t\tR: downscale8to5bit(nrgba.R),\n\t}\n}\n\ntype RGB888 struct {\n\tR, G, B byte\n}\n\nfunc (c RGB888) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: c.R,\n\t\tG: c.G,\n\t\tB: c.B,\n\t\tA: 0xFF,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc rgb888Model(c color.Color) color.Color {\n\tif _, ok := c.(RGB888); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn RGB888{\n\t\tR: nrgba.R,\n\t\tG: nrgba.G,\n\t\tB: nrgba.B,\n\t}\n}\n\ntype BGR888 struct {\n\tB, G, R byte\n}\n\nfunc (c BGR888) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: c.R,\n\t\tG: c.G,\n\t\tB: c.B,\n\t\tA: 0xFF,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc bgr888Model(c color.Color) color.Color {\n\tif _, ok := c.(BGR888); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn BGR888{\n\t\tB: nrgba.B,\n\t\tG: nrgba.G,\n\t\tR: nrgba.R,\n\t}\n}\n\ntype ARGB4444 struct {\n\tA, R, G, B byte\n}\n\nfunc (c ARGB4444) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale4to8bit(c.R),\n\t\tG: upscale4to8bit(c.G),\n\t\tB: upscale4to8bit(c.B),\n\t\tA: upscale4to8bit(c.A),\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc argb4444Model(c color.Color) color.Color {\n\tif _, ok := c.(ARGB4444); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn ARGB4444{\n\t\tA: downscale8to4bit(nrgba.A),\n\t\tR: downscale8to4bit(nrgba.R),\n\t\tG: downscale8to4bit(nrgba.G),\n\t\tB: downscale8to4bit(nrgba.B),\n\t}\n}\n\ntype ABGR4444 struct {\n\tA, B, G, R byte\n}\n\nfunc (c ABGR4444) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale4to8bit(c.R),\n\t\tG: upscale4to8bit(c.G),\n\t\tB: upscale4to8bit(c.B),\n\t\tA: upscale4to8bit(c.A),\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc abgr4444Model(c color.Color) color.Color {\n\tif _, ok := c.(ABGR4444); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn ABGR4444{\n\t\tA: downscale8to4bit(nrgba.A),\n\t\tB: downscale8to4bit(nrgba.B),\n\t\tG: downscale8to4bit(nrgba.G),\n\t\tR: downscale8to4bit(nrgba.R),\n\t}\n}\n\ntype RGBA4444 struct {\n\tR, G, B, A byte\n}\n\nfunc (c RGBA4444) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale4to8bit(c.R),\n\t\tG: upscale4to8bit(c.G),\n\t\tB: upscale4to8bit(c.B),\n\t\tA: upscale4to8bit(c.A),\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc rgba4444Model(c color.Color) color.Color {\n\tif _, ok := c.(RGBA4444); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn RGBA4444{\n\t\tR: downscale8to4bit(nrgba.R),\n\t\tG: downscale8to4bit(nrgba.G),\n\t\tB: downscale8to4bit(nrgba.B),\n\t\tA: downscale8to4bit(nrgba.A),\n\t}\n}\n\ntype BGRA4444 struct {\n\tB, G, R, A byte\n}\n\nfunc (c BGRA4444) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale4to8bit(c.R),\n\t\tG: upscale4to8bit(c.G),\n\t\tB: upscale4to8bit(c.B),\n\t\tA: upscale4to8bit(c.A),\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc bgra4444Model(c color.Color) color.Color {\n\tif _, ok := c.(BGRA4444); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn BGRA4444{\n\t\tB: downscale8to4bit(nrgba.B),\n\t\tG: downscale8to4bit(nrgba.G),\n\t\tR: downscale8to4bit(nrgba.R),\n\t\tA: downscale8to4bit(nrgba.A),\n\t}\n}\n\ntype ARGB1555 struct {\n\tA, R, G, B byte\n}\n\nfunc (c ARGB1555) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale5to8bit(c.R),\n\t\tG: upscale5to8bit(c.G),\n\t\tB: upscale5to8bit(c.B),\n\t\tA: upscale1to8bit(c.A),\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc argb1555Model(c color.Color) color.Color {\n\tif _, ok := c.(ARGB1555); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn ARGB1555{\n\t\tA: downscale8to1bit(nrgba.A),\n\t\tR: downscale8to5bit(nrgba.R),\n\t\tG: downscale8to5bit(nrgba.G),\n\t\tB: downscale8to5bit(nrgba.B),\n\t}\n}\n\ntype RGBA5551 struct {\n\tR, G, B, A byte\n}\n\nfunc (c RGBA5551) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale5to8bit(c.R),\n\t\tG: upscale5to8bit(c.G),\n\t\tB: upscale5to8bit(c.B),\n\t\tA: upscale1to8bit(c.A),\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc rgba5551Model(c color.Color) color.Color {\n\tif _, ok := c.(RGBA5551); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn RGBA5551{\n\t\tR: downscale8to5bit(nrgba.R),\n\t\tG: downscale8to5bit(nrgba.G),\n\t\tB: downscale8to5bit(nrgba.B),\n\t\tA: downscale8to1bit(nrgba.A),\n\t}\n}\n\ntype ABGR1555 struct {\n\tA, R, G, B byte\n}\n\nfunc (c ABGR1555) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale5to8bit(c.R),\n\t\tG: upscale5to8bit(c.G),\n\t\tB: upscale5to8bit(c.B),\n\t\tA: upscale1to8bit(c.A),\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc abgr1555Model(c color.Color) color.Color {\n\tif _, ok := c.(ABGR1555); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn ABGR1555{\n\t\tA: downscale8to1bit(nrgba.A),\n\t\tR: downscale8to5bit(nrgba.R),\n\t\tG: downscale8to5bit(nrgba.G),\n\t\tB: downscale8to5bit(nrgba.B),\n\t}\n}\n\ntype BGRA5551 struct {\n\tB, G, R, A byte\n}\n\nfunc (c BGRA5551) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: upscale5to8bit(c.R),\n\t\tG: upscale5to8bit(c.G),\n\t\tB: upscale5to8bit(c.B),\n\t\tA: upscale1to8bit(c.A),\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc bgra5551Model(c color.Color) color.Color {\n\tif _, ok := c.(BGRA5551); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn BGRA5551{\n\t\tB: downscale8to5bit(nrgba.B),\n\t\tG: downscale8to5bit(nrgba.G),\n\t\tR: downscale8to5bit(nrgba.R),\n\t\tA: downscale8to1bit(nrgba.A),\n\t}\n}\n\ntype RGBA8888 struct {\n\tR, G, B, A byte\n}\n\nfunc (c RGBA8888) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: c.R,\n\t\tG: c.G,\n\t\tB: c.B,\n\t\tA: c.A,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc rgba8888Model(c color.Color) color.Color {\n\tif _, ok := c.(RGBA8888); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn RGBA8888{\n\t\tR: nrgba.R,\n\t\tG: nrgba.G,\n\t\tB: nrgba.B,\n\t\tA: nrgba.A,\n\t}\n}\n\ntype BGRA8888 struct {\n\tB, G, R, A byte\n}\n\nfunc (c BGRA8888) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: c.R,\n\t\tG: c.G,\n\t\tB: c.B,\n\t\tA: c.A,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc bgra8888Model(c color.Color) color.Color {\n\tif _, ok := c.(BGRA8888); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn BGRA8888{\n\t\tB: nrgba.B,\n\t\tG: nrgba.G,\n\t\tR: nrgba.R,\n\t\tA: nrgba.A,\n\t}\n}\n\ntype ARGB8888 struct {\n\tA, R, G, B byte\n}\n\nfunc (c ARGB8888) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: c.R,\n\t\tG: c.G,\n\t\tB: c.B,\n\t\tA: c.A,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc argb8888Model(c color.Color) color.Color {\n\tif _, ok := c.(ARGB8888); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn ARGB8888{\n\t\tA: nrgba.A,\n\t\tR: nrgba.R,\n\t\tG: nrgba.G,\n\t\tB: nrgba.B,\n\t}\n}\n\ntype ABGR8888 struct {\n\tA, B, G, R byte\n}\n\nfunc (c ABGR8888) RGBA() (r, g, b, a uint32) {\n\tnrgba := color.NRGBA{\n\t\tR: c.R,\n\t\tG: c.G,\n\t\tB: c.B,\n\t\tA: c.A,\n\t}\n\treturn nrgba.RGBA()\n}\n\nfunc abgr8888Model(c color.Color) color.Color {\n\tif _, ok := c.(ABGR8888); ok {\n\t\treturn c\n\t}\n\tnrgba := color.NRGBAModel.Convert(c).(color.NRGBA)\n\treturn ABGR8888{\n\t\tA: nrgba.A,\n\t\tB: nrgba.B,\n\t\tG: nrgba.G,\n\t\tR: nrgba.R,\n\t}\n}\n\nfunc downscale8to1bit(alpha byte) byte {\n\tif alpha == 0 {\n\t\treturn 0\n\t}\n\treturn 1\n}\n\nfunc downscale8to2bit(in byte) byte {\n\treturn in >> 6\n}\n\nfunc downscale8to3bit(in byte) byte {\n\treturn in >> 5\n}\n\nfunc downscale8to4bit(in byte) byte {\n\treturn in >> 4\n}\n\nfunc downscale8to5bit(in byte) byte {\n\treturn in >> 3\n}\n\nfunc downscale8to6bit(in byte) byte {\n\treturn in >> 2\n}\n\nfunc upscale1to8bit(alphaBit byte) byte {\n\tif alphaBit == 0 {\n\t\treturn 0\n\t}\n\treturn 0xFF\n}\n\nfunc upscale2to8bit(in byte) byte {\n\treturn in<<6 | in<<4 | in<<2 | in\n}\n\nfunc upscale3to8bit(in byte) byte {\n\treturn in<<5 | in<<2 | (in>>1)&0b11\n}\n\nfunc upscale4to8bit(in byte) byte {\n\treturn in<<4 | in\n}\n\nfunc upscale5to8bit(in byte) byte {\n\treturn in<<3 | (in>>2)&0b111\n}\n\nfunc upscale6to8bit(in byte) byte {\n\treturn in<<2 | (in>>4)&0b11\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/power.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\n\n// An enumeration of the basic state of the system's power supply.\n// (https://wiki.libsdl.org/SDL_PowerState)\nconst (\n\tPOWERSTATE_UNKNOWN    = C.SDL_POWERSTATE_UNKNOWN    // cannot determine power status\n\tPOWERSTATE_ON_BATTERY = C.SDL_POWERSTATE_ON_BATTERY // not plugged in, running on the battery\n\tPOWERSTATE_NO_BATTERY = C.SDL_POWERSTATE_NO_BATTERY // plugged in, no battery available\n\tPOWERSTATE_CHARGING   = C.SDL_POWERSTATE_CHARGING   // plugged in, charging battery\n\tPOWERSTATE_CHARGED    = C.SDL_POWERSTATE_CHARGED    // plugged in, battery charged\n)\n\n// PowerState is the basic state for the system's power supply.\n// (https://wiki.libsdl.org/SDL_PowerState)\ntype PowerState C.SDL_PowerState\n\n// GetPowerInfo returns the current power supply details.\n// (https://wiki.libsdl.org/SDL_GetPowerInfo)\nfunc GetPowerInfo() (int, int, int) {\n\t_secs := C.int(0)\n\t_percent := C.int(0)\n\t_state := C.SDL_GetPowerInfo(&_secs, &_percent)\n\treturn (int)(_state), (int)(_secs), (int)(_percent)\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/rect.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\nimport (\n\t\"math\"\n\t\"unsafe\"\n)\n\n// Point defines a two dimensional point.\n// (https://wiki.libsdl.org/SDL_Point)\ntype Point struct {\n\tX int32 // the x coordinate of the point\n\tY int32 // the y coordinate of the point\n}\n\n// Rect contains the definition of a rectangle, with the origin at the upper left.\n// (https://wiki.libsdl.org/SDL_Rect)\ntype Rect struct {\n\tX int32 // the x location of the rectangle's upper left corner\n\tY int32 // the y location of the rectangle's upper left corner\n\tW int32 // the width of the rectangle\n\tH int32 // the height of the rectangle\n}\n\n// FPoint defines a two dimensional point.\n// TODO: (https://wiki.libsdl.org/SDL_FPoint)\ntype FPoint struct {\n\tX float32 // the x coordinate of the point\n\tY float32 // the y coordinate of the point\n}\n\n// FRect contains the definition of a rectangle, with the origin at the upper left.\n// TODO: (https://wiki.libsdl.org/SDL_FRect)\ntype FRect struct {\n\tX float32 // the x location of the rectangle's upper left corner\n\tY float32 // the y location of the rectangle's upper left corner\n\tW float32 // the width of the rectangle\n\tH float32 // the height of the rectangle\n}\n\nfunc (p *Point) cptr() *C.SDL_Point {\n\treturn (*C.SDL_Point)(unsafe.Pointer(p))\n}\n\nfunc (a *Rect) cptr() *C.SDL_Rect {\n\treturn (*C.SDL_Rect)(unsafe.Pointer(a))\n}\n\nfunc (p *FPoint) cptr() *C.SDL_FPoint {\n\treturn (*C.SDL_FPoint)(unsafe.Pointer(p))\n}\n\nfunc (a *FRect) cptr() *C.SDL_FRect {\n\treturn (*C.SDL_FRect)(unsafe.Pointer(a))\n}\n\n// InRect reports whether the point resides inside a rectangle.\n// (https://wiki.libsdl.org/SDL_PointInRect)\nfunc (p *Point) InRect(r *Rect) bool {\n\tif (p.X >= r.X) && (p.X < (r.X + r.W)) &&\n\t\t(p.Y >= r.Y) && (p.Y < (r.Y + r.H)) {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// InRect reports whether the point resides inside a rectangle.\n// (https://wiki.libsdl.org/SDL_PointInRect)\nfunc (p *FPoint) InRect(r *FRect) bool {\n\tif (p.X >= r.X) && (p.X < (r.X + r.W)) &&\n\t\t(p.Y >= r.Y) && (p.Y < (r.Y + r.H)) {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Empty reports whether a rectangle has no area.\n// (https://wiki.libsdl.org/SDL_RectEmpty)\nfunc (a *Rect) Empty() bool {\n\treturn a == nil || a.W <= 0 || a.H <= 0\n}\n\n// Equals reports whether two rectangles are equal.\n// (https://wiki.libsdl.org/SDL_RectEquals)\nfunc (a *Rect) Equals(b *Rect) bool {\n\tif (a != nil) && (b != nil) &&\n\t\t(a.X == b.X) && (a.Y == b.Y) &&\n\t\t(a.W == b.W) && (a.H == b.H) {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// HasIntersection reports whether two rectangles intersect.\n// (https://wiki.libsdl.org/SDL_HasIntersection)\nfunc (a *Rect) HasIntersection(b *Rect) bool {\n\tif a == nil || b == nil {\n\t\treturn false\n\t}\n\n\t// Special case for empty rects\n\tif a.Empty() || b.Empty() {\n\t\treturn false\n\t}\n\n\tif a.X >= b.X+b.W || a.X+a.W <= b.X || a.Y >= b.Y+b.H || a.Y+a.H <= b.Y {\n\t\treturn false\n\t}\n\n\treturn true\n}\n\n// Intersect calculates the intersection of two rectangles.\n// (https://wiki.libsdl.org/SDL_IntersectRect)\nfunc (a *Rect) Intersect(b *Rect) (Rect, bool) {\n\tvar result Rect\n\n\tif a == nil || b == nil {\n\t\treturn result, false\n\t}\n\n\t// Special case for empty rects\n\tif a.Empty() || b.Empty() {\n\t\tresult.W = 0\n\t\tresult.H = 0\n\t\treturn result, false\n\t}\n\n\taMin := a.X\n\taMax := aMin + a.W\n\tbMin := b.X\n\tbMax := bMin + b.W\n\tif bMin > aMin {\n\t\taMin = bMin\n\t}\n\tresult.X = aMin\n\tif bMax < aMax {\n\t\taMax = bMax\n\t}\n\tresult.W = aMax - aMin\n\n\taMin = a.Y\n\taMax = aMin + a.H\n\tbMin = b.Y\n\tbMax = bMin + b.H\n\tif bMin > aMin {\n\t\taMin = bMin\n\t}\n\tresult.Y = aMin\n\tif bMax < aMax {\n\t\taMax = bMax\n\t}\n\tresult.H = aMax - aMin\n\n\treturn result, !result.Empty()\n}\n\n// Union calculates the union of two rectangles.\n// (https://wiki.libsdl.org/SDL_UnionRect)\nfunc (a *Rect) Union(b *Rect) Rect {\n\tvar result Rect\n\n\tif a == nil || b == nil {\n\t\treturn result\n\t}\n\n\t// Special case for empty rects\n\tif a.Empty() {\n\t\treturn *b\n\t} else if b.Empty() {\n\t\treturn *a\n\t} else if a.Empty() && b.Empty() {\n\t\treturn result\n\t}\n\n\taMin := a.X\n\taMax := aMin + a.W\n\tbMin := b.X\n\tbMax := bMin + b.W\n\tif bMin < aMin {\n\t\taMin = bMin\n\t}\n\tresult.X = aMin\n\tif bMax > aMax {\n\t\taMax = bMax\n\t}\n\tresult.W = aMax - aMin\n\n\taMin = a.Y\n\taMax = aMin + a.H\n\tbMin = b.Y\n\tbMax = bMin + b.H\n\tif bMin < aMin {\n\t\taMin = bMin\n\t}\n\tresult.Y = aMin\n\tif bMax > aMax {\n\t\taMax = bMax\n\t}\n\tresult.H = aMax - aMin\n\n\treturn result\n}\n\n// Empty reports whether a rectangle has no area.\n// (https://wiki.libsdl.org/SDL_RectEmpty)\nfunc (a *FRect) Empty() bool {\n\treturn a == nil || a.W <= 0 || a.H <= 0\n}\n\n// Equals reports whether two rectangles are equal.\n// (https://wiki.libsdl.org/SDL_RectEquals)\nfunc (a *FRect) Equals(b *FRect) bool {\n\tif (a != nil) && (b != nil) &&\n\t\t(a.X == b.X) && (a.Y == b.Y) &&\n\t\t(a.W == b.W) && (a.H == b.H) {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// EqualsEpsilon returns true if the two rectangles are equal, within some given epsilon.\n// (https://wiki.libsdl.org/SDL_FRectEqualsEpsilon)\nfunc (a *FRect) EqualsEpsilon(b *FRect, epsilon float32) bool {\n\tif (a != nil) && (b != nil) && (a == b ||\n\t\t(float32(math.Abs(float64(a.X-b.X))) <= epsilon) &&\n\t\t\t(float32(math.Abs(float64(a.Y-b.Y))) <= epsilon) &&\n\t\t\t(float32(math.Abs(float64(a.W-b.W))) <= epsilon) &&\n\t\t\t(float32(math.Abs(float64(a.H-b.H))) <= epsilon)) {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// HasIntersection reports whether two rectangles intersect.\n// (https://wiki.libsdl.org/SDL_HasIntersection)\nfunc (a *FRect) HasIntersection(b *FRect) bool {\n\tif a == nil || b == nil {\n\t\treturn false\n\t}\n\n\t// Special case for empty rects\n\tif a.Empty() || b.Empty() {\n\t\treturn false\n\t}\n\n\tif a.X >= b.X+b.W || a.X+a.W <= b.X || a.Y >= b.Y+b.H || a.Y+a.H <= b.Y {\n\t\treturn false\n\t}\n\n\treturn true\n}\n\n// Intersect calculates the intersection of two rectangles.\n// (https://wiki.libsdl.org/SDL_IntersectRect)\nfunc (a *FRect) Intersect(b *FRect) (FRect, bool) {\n\tvar result FRect\n\n\tif a == nil || b == nil {\n\t\treturn result, false\n\t}\n\n\t// Special case for empty rects\n\tif a.Empty() || b.Empty() {\n\t\tresult.W = 0\n\t\tresult.H = 0\n\t\treturn result, false\n\t}\n\n\taMin := a.X\n\taMax := aMin + a.W\n\tbMin := b.X\n\tbMax := bMin + b.W\n\tif bMin > aMin {\n\t\taMin = bMin\n\t}\n\tresult.X = aMin\n\tif bMax < aMax {\n\t\taMax = bMax\n\t}\n\tresult.W = aMax - aMin\n\n\taMin = a.Y\n\taMax = aMin + a.H\n\tbMin = b.Y\n\tbMax = bMin + b.H\n\tif bMin > aMin {\n\t\taMin = bMin\n\t}\n\tresult.Y = aMin\n\tif bMax < aMax {\n\t\taMax = bMax\n\t}\n\tresult.H = aMax - aMin\n\n\treturn result, !result.Empty()\n}\n\n// Union calculates the union of two rectangles.\n// (https://wiki.libsdl.org/SDL_UnionRect)\nfunc (a *FRect) Union(b *FRect) FRect {\n\tvar result FRect\n\n\tif a == nil || b == nil {\n\t\treturn result\n\t}\n\n\t// Special case for empty rects\n\tif a.Empty() {\n\t\treturn *b\n\t} else if b.Empty() {\n\t\treturn *a\n\t} else if a.Empty() && b.Empty() {\n\t\treturn result\n\t}\n\n\taMin := a.X\n\taMax := aMin + a.W\n\tbMin := b.X\n\tbMax := bMin + b.W\n\tif bMin < aMin {\n\t\taMin = bMin\n\t}\n\tresult.X = aMin\n\tif bMax > aMax {\n\t\taMax = bMax\n\t}\n\tresult.W = aMax - aMin\n\n\taMin = a.Y\n\taMax = aMin + a.H\n\tbMin = b.Y\n\tbMax = bMin + b.H\n\tif bMin < aMin {\n\t\taMin = bMin\n\t}\n\tresult.Y = aMin\n\tif bMax > aMax {\n\t\taMax = bMax\n\t}\n\tresult.H = aMax - aMin\n\n\treturn result\n}\n\n// EnclosePoints calculates a minimal rectangle that encloses a set of points.\n// (https://wiki.libsdl.org/SDL_EnclosePoints)\nfunc EnclosePoints(points []Point, clip *Rect) (Rect, bool) {\n\tvar result Rect\n\n\tif len(points) == 0 {\n\t\treturn result, false\n\t}\n\n\tvar minX, minY, maxX, maxY int32\n\tif clip != nil {\n\t\tadded := false\n\t\tclipMinX := clip.X\n\t\tclipMinY := clip.Y\n\t\tclipMaxX := clip.X + clip.W - 1\n\t\tclipMaxY := clip.Y + clip.H - 1\n\n\t\t// If the clip has no size, we're done\n\t\tif clip.Empty() {\n\t\t\treturn result, false\n\t\t}\n\n\t\tfor _, val := range points {\n\t\t\t// Check if the point is inside the clip rect\n\t\t\tif val.X < clipMinX || val.X > clipMaxX || val.Y < clipMinY || val.Y > clipMaxY {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif !added {\n\t\t\t\t// If it's the first point\n\t\t\t\tminX = val.X\n\t\t\t\tmaxX = val.X\n\t\t\t\tminY = val.Y\n\t\t\t\tmaxY = val.Y\n\t\t\t\tadded = true\n\t\t\t}\n\n\t\t\t// Find mins and maxes\n\t\t\tif val.X < minX {\n\t\t\t\tminX = val.X\n\t\t\t} else if val.X > maxX {\n\t\t\t\tmaxX = val.X\n\t\t\t}\n\t\t\tif val.Y < minY {\n\t\t\t\tminY = val.Y\n\t\t\t} else if val.Y > maxY {\n\t\t\t\tmaxY = val.Y\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor i, val := range points {\n\t\t\tif i == 0 {\n\t\t\t\t// Populate the first point\n\t\t\t\tminX = val.X\n\t\t\t\tmaxX = val.X\n\t\t\t\tminY = val.Y\n\t\t\t\tmaxY = val.Y\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Find mins and maxes\n\t\t\tif val.X < minX {\n\t\t\t\tminX = val.X\n\t\t\t} else if val.X > maxX {\n\t\t\t\tmaxX = val.X\n\t\t\t}\n\t\t\tif val.Y < minY {\n\t\t\t\tminY = val.Y\n\t\t\t} else if val.Y > maxY {\n\t\t\t\tmaxY = val.Y\n\t\t\t}\n\t\t}\n\t}\n\n\tresult.X = minX\n\tresult.Y = minY\n\tresult.W = (maxX - minX) + 1\n\tresult.H = (maxY - minY) + 1\n\n\treturn result, true\n}\n\n// EncloseFPoints calculates a minimal rectangle that encloses a set of points with float precision.\n// (https://wiki.libsdl.org/SDL_EncloseFPoints)\nfunc EncloseFPoints(points []FPoint, clip *FRect) (result FRect, enclosed bool) {\n\tif len(points) == 0 {\n\t\treturn result, false\n\t}\n\n\tvar minX, minY, maxX, maxY float32\n\tif clip != nil {\n\t\tadded := false\n\t\tclipMinX := clip.X\n\t\tclipMinY := clip.Y\n\t\tclipMaxX := clip.X + clip.W - 1\n\t\tclipMaxY := clip.Y + clip.H - 1\n\n\t\t// If the clip has no size, we're done\n\t\tif clip.Empty() {\n\t\t\treturn result, false\n\t\t}\n\n\t\tfor _, val := range points {\n\t\t\t// Check if the point is inside the clip rect\n\t\t\tif val.X < clipMinX || val.X > clipMaxX || val.Y < clipMinY || val.Y > clipMaxY {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif !added {\n\t\t\t\t// If it's the first point\n\t\t\t\tminX = val.X\n\t\t\t\tmaxX = val.X\n\t\t\t\tminY = val.Y\n\t\t\t\tmaxY = val.Y\n\t\t\t\tadded = true\n\t\t\t}\n\n\t\t\t// Find mins and maxes\n\t\t\tif val.X < minX {\n\t\t\t\tminX = val.X\n\t\t\t} else if val.X > maxX {\n\t\t\t\tmaxX = val.X\n\t\t\t}\n\t\t\tif val.Y < minY {\n\t\t\t\tminY = val.Y\n\t\t\t} else if val.Y > maxY {\n\t\t\t\tmaxY = val.Y\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor i, val := range points {\n\t\t\tif i == 0 {\n\t\t\t\t// Populate the first point\n\t\t\t\tminX = val.X\n\t\t\t\tmaxX = val.X\n\t\t\t\tminY = val.Y\n\t\t\t\tmaxY = val.Y\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Find mins and maxes\n\t\t\tif val.X < minX {\n\t\t\t\tminX = val.X\n\t\t\t} else if val.X > maxX {\n\t\t\t\tmaxX = val.X\n\t\t\t}\n\t\t\tif val.Y < minY {\n\t\t\t\tminY = val.Y\n\t\t\t} else if val.Y > maxY {\n\t\t\t\tmaxY = val.Y\n\t\t\t}\n\t\t}\n\t}\n\n\tresult.X = minX\n\tresult.Y = minY\n\tresult.W = (maxX - minX) + 1\n\tresult.H = (maxY - minY) + 1\n\n\treturn result, true\n}\n\nconst (\n\tcodeBottom = 1\n\tcodeTop    = 2\n\tcodeLeft   = 4\n\tcodeRight  = 8\n)\n\nfunc computeOutCode(rect *Rect, x, y int32) int {\n\tcode := 0\n\tif y < rect.Y {\n\t\tcode |= codeTop\n\t} else if y >= rect.Y+rect.H {\n\t\tcode |= codeBottom\n\t}\n\tif x < rect.X {\n\t\tcode |= codeLeft\n\t} else if x >= rect.X+rect.W {\n\t\tcode |= codeRight\n\t}\n\n\treturn code\n}\n\nfunc computeFOutCode(rect *FRect, x, y float32) int {\n\tcode := 0\n\tif y < rect.Y {\n\t\tcode |= codeTop\n\t} else if y >= rect.Y+rect.H {\n\t\tcode |= codeBottom\n\t}\n\tif x < rect.X {\n\t\tcode |= codeLeft\n\t} else if x >= rect.X+rect.W {\n\t\tcode |= codeRight\n\t}\n\n\treturn code\n}\n\n// IntersectLine calculates the intersection of a rectangle and a line segment.\n// (https://wiki.libsdl.org/SDL_IntersectRectAndLine)\nfunc (a *Rect) IntersectLine(X1, Y1, X2, Y2 *int32) bool {\n\tif a.Empty() {\n\t\treturn false\n\t}\n\n\tx1 := *X1\n\ty1 := *Y1\n\tx2 := *X2\n\ty2 := *Y2\n\trectX1 := a.X\n\trectY1 := a.Y\n\trectX2 := a.X + a.W - 1\n\trectY2 := a.Y + a.H - 1\n\n\t// Check if the line is entirely inside the rect\n\tif x1 >= rectX1 && x1 <= rectX2 && x2 >= rectX1 && x2 <= rectX2 &&\n\t\ty1 >= rectY1 && y1 <= rectY2 && y2 >= rectY1 && y2 <= rectY2 {\n\t\treturn true\n\t}\n\n\t// Check if the line is entirely outside the rect\n\tif (x1 < rectX1 && x2 < rectX1) || (x1 > rectX2 && x2 > rectX2) ||\n\t\t(y1 < rectY1 && y2 < rectY1) || (y1 > rectY2 && y2 > rectY2) {\n\t\treturn false\n\t}\n\n\t// Check if the line is horizontal\n\tif y1 == y2 {\n\t\tif x1 < rectX1 {\n\t\t\t*X1 = rectX1\n\t\t} else if x1 > rectX2 {\n\t\t\t*X1 = rectX2\n\t\t}\n\t\tif x2 < rectX1 {\n\t\t\t*X2 = rectX1\n\t\t} else if x2 > rectX2 {\n\t\t\t*X2 = rectX2\n\t\t}\n\n\t\treturn true\n\t}\n\n\t// Check if the line is vertical\n\tif x1 == x2 {\n\t\tif y1 < rectY1 {\n\t\t\t*Y1 = rectY1\n\t\t} else if y1 > rectY2 {\n\t\t\t*Y1 = rectY2\n\t\t}\n\t\tif y2 < rectY1 {\n\t\t\t*Y2 = rectY1\n\t\t} else if y2 > rectY2 {\n\t\t\t*Y2 = rectY2\n\t\t}\n\n\t\treturn true\n\t}\n\n\t// Use Cohen-Sutherland algorithm when all shortcuts fail\n\toutCode1 := computeOutCode(a, x1, y1)\n\toutCode2 := computeOutCode(a, x2, y2)\n\tfor outCode1 != 0 || outCode2 != 0 {\n\t\tif outCode1&outCode2 != 0 {\n\t\t\treturn false\n\t\t}\n\n\t\tif outCode1 != 0 {\n\t\t\tvar x, y int32\n\t\t\tif outCode1&codeTop != 0 {\n\t\t\t\ty = rectY1\n\t\t\t\tx = x1 + ((x2-x1)*(y-y1))/(y2-y1)\n\t\t\t} else if outCode1&codeBottom != 0 {\n\t\t\t\ty = rectY2\n\t\t\t\tx = x1 + ((x2-x1)*(y-y1))/(y2-y1)\n\t\t\t} else if outCode1&codeLeft != 0 {\n\t\t\t\tx = rectX1\n\t\t\t\ty = y1 + ((y2-y1)*(x-x1))/(x2-x1)\n\t\t\t} else if outCode1&codeRight != 0 {\n\t\t\t\tx = rectX2\n\t\t\t\ty = y1 + ((y2-y1)*(x-x1))/(x2-x1)\n\t\t\t}\n\n\t\t\tx1 = x\n\t\t\ty1 = y\n\t\t\toutCode1 = computeOutCode(a, x, y)\n\t\t} else {\n\t\t\tvar x, y int32\n\t\t\tif outCode2&codeTop != 0 {\n\t\t\t\ty = rectY1\n\t\t\t\tx = x1 + ((x2-x1)*(y-y1))/(y2-y1)\n\t\t\t} else if outCode2&codeBottom != 0 {\n\t\t\t\ty = rectY2\n\t\t\t\tx = x1 + ((x2-x1)*(y-y1))/(y2-y1)\n\t\t\t} else if outCode2&codeLeft != 0 {\n\t\t\t\tx = rectX1\n\t\t\t\ty = y1 + ((y2-y1)*(x-x1))/(x2-x1)\n\t\t\t} else if outCode2&codeRight != 0 {\n\t\t\t\tx = rectX2\n\t\t\t\ty = y1 + ((y2-y1)*(x-x1))/(x2-x1)\n\t\t\t}\n\n\t\t\tx2 = x\n\t\t\ty2 = y\n\t\t\toutCode2 = computeOutCode(a, x, y)\n\t\t}\n\t}\n\n\t*X1 = x1\n\t*Y1 = y1\n\t*X2 = x2\n\t*Y2 = y2\n\n\treturn true\n}\n\n// IntersectLine calculates the intersection of a rectangle and a line segment.\n// (https://wiki.libsdl.org/SDL_IntersectFRectAndLine)\nfunc (a *FRect) IntersectLine(X1, Y1, X2, Y2 *float32) bool {\n\tif a.Empty() {\n\t\treturn false\n\t}\n\n\tx1 := *X1\n\ty1 := *Y1\n\tx2 := *X2\n\ty2 := *Y2\n\trectX1 := a.X\n\trectY1 := a.Y\n\trectX2 := a.X + a.W - 1\n\trectY2 := a.Y + a.H - 1\n\n\t// Check if the line is entirely inside the rect\n\tif x1 >= rectX1 && x1 <= rectX2 && x2 >= rectX1 && x2 <= rectX2 &&\n\t\ty1 >= rectY1 && y1 <= rectY2 && y2 >= rectY1 && y2 <= rectY2 {\n\t\treturn true\n\t}\n\n\t// Check if the line is entirely outside the rect\n\tif (x1 < rectX1 && x2 < rectX1) || (x1 > rectX2 && x2 > rectX2) ||\n\t\t(y1 < rectY1 && y2 < rectY1) || (y1 > rectY2 && y2 > rectY2) {\n\t\treturn false\n\t}\n\n\t// Check if the line is horizontal\n\tif y1 == y2 {\n\t\tif x1 < rectX1 {\n\t\t\t*X1 = rectX1\n\t\t} else if x1 > rectX2 {\n\t\t\t*X1 = rectX2\n\t\t}\n\t\tif x2 < rectX1 {\n\t\t\t*X2 = rectX1\n\t\t} else if x2 > rectX2 {\n\t\t\t*X2 = rectX2\n\t\t}\n\n\t\treturn true\n\t}\n\n\t// Check if the line is vertical\n\tif x1 == x2 {\n\t\tif y1 < rectY1 {\n\t\t\t*Y1 = rectY1\n\t\t} else if y1 > rectY2 {\n\t\t\t*Y1 = rectY2\n\t\t}\n\t\tif y2 < rectY1 {\n\t\t\t*Y2 = rectY1\n\t\t} else if y2 > rectY2 {\n\t\t\t*Y2 = rectY2\n\t\t}\n\n\t\treturn true\n\t}\n\n\t// Use Cohen-Sutherland algorithm when all shortcuts fail\n\toutCode1 := computeFOutCode(a, x1, y1)\n\toutCode2 := computeFOutCode(a, x2, y2)\n\tfor outCode1 != 0 || outCode2 != 0 {\n\t\tif outCode1&outCode2 != 0 {\n\t\t\treturn false\n\t\t}\n\n\t\tif outCode1 != 0 {\n\t\t\tvar x, y float32\n\t\t\tif outCode1&codeTop != 0 {\n\t\t\t\ty = rectY1\n\t\t\t\tx = x1 + ((x2-x1)*(y-y1))/(y2-y1)\n\t\t\t} else if outCode1&codeBottom != 0 {\n\t\t\t\ty = rectY2\n\t\t\t\tx = x1 + ((x2-x1)*(y-y1))/(y2-y1)\n\t\t\t} else if outCode1&codeLeft != 0 {\n\t\t\t\tx = rectX1\n\t\t\t\ty = y1 + ((y2-y1)*(x-x1))/(x2-x1)\n\t\t\t} else if outCode1&codeRight != 0 {\n\t\t\t\tx = rectX2\n\t\t\t\ty = y1 + ((y2-y1)*(x-x1))/(x2-x1)\n\t\t\t}\n\n\t\t\tx1 = x\n\t\t\ty1 = y\n\t\t\toutCode1 = computeFOutCode(a, x, y)\n\t\t} else {\n\t\t\tvar x, y float32\n\t\t\tif outCode2&codeTop != 0 {\n\t\t\t\ty = rectY1\n\t\t\t\tx = x1 + ((x2-x1)*(y-y1))/(y2-y1)\n\t\t\t} else if outCode2&codeBottom != 0 {\n\t\t\t\ty = rectY2\n\t\t\t\tx = x1 + ((x2-x1)*(y-y1))/(y2-y1)\n\t\t\t} else if outCode2&codeLeft != 0 {\n\t\t\t\tx = rectX1\n\t\t\t\ty = y1 + ((y2-y1)*(x-x1))/(x2-x1)\n\t\t\t} else if outCode2&codeRight != 0 {\n\t\t\t\tx = rectX2\n\t\t\t\ty = y1 + ((y2-y1)*(x-x1))/(x2-x1)\n\t\t\t}\n\n\t\t\tx2 = x\n\t\t\ty2 = y\n\t\t\toutCode2 = computeFOutCode(a, x, y)\n\t\t}\n\t}\n\n\t*X1 = x1\n\t*Y1 = y1\n\t*X2 = x2\n\t*Y2 = y2\n\n\treturn true\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/render.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,1))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_UpdateYUVTexture is not supported before SDL 2.0.1\")\n#endif\n\nstatic inline int SDL_UpdateYUVTexture(SDL_Texture* texture, const SDL_Rect* rect, const Uint8* Yplane, int Ypitch, const Uint8* Uplane, int Upitch, const Uint8* Vplane, int Vpitch)\n{\n\treturn -1;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,4))\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderIsClipEnabled is not supported before SDL 2.0.4\")\n#endif\nstatic inline SDL_bool SDLCALL SDL_RenderIsClipEnabled(SDL_Renderer * renderer)\n{\n\treturn SDL_FALSE;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,5))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderSetIntegerScale is not supported before SDL 2.0.5\")\n#endif\n\nstatic inline int SDL_RenderSetIntegerScale(SDL_Renderer* renderer, SDL_bool enable)\n{\n\tSDL_Unsupported();\n\treturn -1;\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderGetIntegerScale is not supported before SDL 2.0.5\")\n#endif\n\nstatic inline SDL_bool SDL_RenderGetIntegerScale(SDL_Renderer* renderer)\n{\n\tSDL_Unsupported();\n\treturn -1;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,8))\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderGetMetalLayer is not supported before SDL 2.0.8\")\n#endif\n\nstatic inline void * SDL_RenderGetMetalLayer(SDL_Renderer *renderer)\n{\n\treturn NULL;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderGetMetalCommandEncoder is not supported before SDL 2.0.8\")\n#endif\n\nstatic inline void * SDL_RenderGetMetalCommandEncoder(SDL_Renderer *renderer)\n{\n\treturn NULL;\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,10))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderDrawPointF is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderDrawPointF(SDL_Renderer * renderer, float x, float y)\n{\n\treturn SDL_RenderDrawPoint(renderer, (int) x, (int) y);\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderDrawPointsF is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderDrawPointsF(SDL_Renderer * renderer, const SDL_FPoint * points, int count)\n{\n\treturn SDL_RenderDrawPoints(renderer, (const SDL_Point *) points, count);\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderDrawLineF is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderDrawLineF(SDL_Renderer * renderer, float x1, float y1, float x2, float y2)\n{\n\treturn SDL_RenderDrawLine(renderer, (int) x1, (int) y1, (int) x2, (int) y2);\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderDrawLinesF is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderDrawLinesF(SDL_Renderer * renderer, const SDL_FPoint * points, int count)\n{\n\treturn SDL_RenderDrawLines(renderer, (const SDL_Point *) points, count);\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderDrawRectF is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderDrawRectF(SDL_Renderer * renderer, const SDL_FRect * rect)\n{\n\treturn SDL_RenderDrawRect(renderer, (const SDL_Rect *) rect);\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderDrawRectsF is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderDrawRectsF(SDL_Renderer * renderer, const SDL_FRect *rects, int count)\n{\n\treturn SDL_RenderDrawRects(renderer, (const SDL_Rect *) rects, count);\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderFillRectF is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderFillRectF(SDL_Renderer * renderer, const SDL_FRect * rect)\n{\n\treturn SDL_RenderFillRect(renderer, (const SDL_Rect *) rect);\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderFillRectsF is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderFillRectsF(SDL_Renderer * renderer, const SDL_FRect * rects, int count)\n{\n\treturn SDL_RenderFillRects(renderer, (const SDL_Rect *) rects, count);\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderCopyF is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderCopyF(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * srcrect, const SDL_FRect * dstrect)\n{\n\treturn SDL_RenderCopy(renderer, texture, srcrect, (const SDL_Rect *) dstrect);\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderCopyExF is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderCopyExF(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * srcrect, const SDL_FRect * dstrect, const double angle, const SDL_FPoint * center, const SDL_RendererFlip flip)\n{\n\treturn SDL_RenderCopyEx(renderer, texture, srcrect, (const SDL_Rect *) dstrect, angle, (const SDL_Point *) center, flip);\n}\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderFlush is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline int SDL_RenderFlush(SDL_Renderer * renderer)\n{\n\treturn 0;\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,12))\n\ntypedef enum\n{\n    SDL_ScaleModeNearest,\n    SDL_ScaleModeLinear,\n    SDL_ScaleModeBest\n} SDL_ScaleMode;\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SetTextureScaleMode is not supported before SDL 2.0.12\")\n#pragma message(\"SDL_GetTextureScaleMode is not supported before SDL 2.0.12\")\n#pragma message(\"SDL_LockTextureToSurface is not supported before SDL 2.0.12\")\n#endif\n\nstatic int SDL_SetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode scaleMode)\n{\n\treturn -1;\n}\n\nstatic int SDLCALL SDL_GetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode *scaleMode)\n{\n\treturn -1;\n}\n\nstatic int SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, SDL_Surface **surface)\n{\n\treturn -1;\n}\n#endif\n\n\n#if !(SDL_VERSION_ATLEAST(2,0,16))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_UpdateNVTexture is not supported before SDL 2.0.16\")\n#endif\n\nstatic int SDL_UpdateNVTexture(SDL_Texture * texture, const SDL_Rect * rect, const Uint8 *Yplane, int Ypitch, const Uint8 *UVplane, int UVpitch)\n{\n\treturn -1;\n}\n\n#endif\n\n\n#if !(SDL_VERSION_ATLEAST(2,0,18))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderGeometry is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_RenderGeometryRaw is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_SetTextureUserData is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_GetTextureUserData is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_RenderWindowToLogical is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_RenderLogicalToWindow is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_RenderSetVSync is not supported before SDL 2.0.18\")\n#endif\n\n// Vertex structure\ntypedef struct SDL_Vertex\n{\n    SDL_FPoint position;  // Vertex position, in SDL_Renderer coordinates\n    SDL_Color  color;     // Vertex color\n    SDL_FPoint tex_coord; // Normalized texture coordinates, if needed\n} SDL_Vertex;\n\nstatic int SDL_RenderGeometry(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Vertex *vertices, int num_vertices, const int *indices, int num_indices)\n{\n\treturn -1;\n}\n\nstatic int SDL_RenderGeometryRaw(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, int num_vertices, const void *indices, int num_indices, int size_indices)\n{\n\treturn -1;\n}\n\nstatic int SDL_SetTextureUserData(SDL_Texture * texture, void *userdata)\n{\n\treturn -1;\n}\n\nstatic void * SDLCALL SDL_GetTextureUserData(SDL_Texture * texture)\n{\n\treturn NULL;\n}\n\nstatic void SDL_RenderWindowToLogical(SDL_Renderer * renderer, int windowX, int windowY, float *logicalX, float *logicalY)\n{\n}\n\nstatic void SDL_RenderLogicalToWindow(SDL_Renderer * renderer, float logicalX, float logicalY, int *windowX, int *windowY)\n{\n}\n\nstatic int SDL_RenderSetVSync(SDL_Renderer* renderer, int vsync)\n{\n\treturn -1;\n}\n\n#endif\n\n#if SDL_COMPILEDVERSION == SDL_VERSIONNUM(2,0,18)\nstatic inline int RenderGeometryRaw(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, int num_vertices, const void *indices, int num_indices, int size_indices)\n{\n\treturn SDL_RenderGeometryRaw(renderer, texture, xy, xy_stride, (int*) color, color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices);\n}\n#else\nstatic inline int RenderGeometryRaw(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, int num_vertices, const void *indices, int num_indices, int size_indices)\n{\n\treturn SDL_RenderGeometryRaw(renderer, texture, xy, xy_stride, color, color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices);\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,22))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderGetWindow is not supported before SDL 2.0.22\")\n#endif\n\nstatic inline SDL_Window * SDLCALL SDL_RenderGetWindow(SDL_Renderer *renderer)\n{\n\treturn NULL;\n}\n\n#endif\n\n// WORKAROUND: This prevents audio from seemingly going corrupt when drawing outside the screen bounding box?\n// It does that by allocating SDL_Rect in the C context instead of Go context.\nstatic inline int RenderCopy(SDL_Renderer *renderer, SDL_Texture *texture, SDL_Rect *src, int dst_x, int dst_y, int dst_w, int dst_h)\n{\n\tSDL_Rect dst = {dst_x, dst_y, dst_w, dst_h};\n\treturn SDL_RenderCopy(renderer, texture, src, &dst);\n}\n*/\nimport \"C\"\nimport (\n\t\"reflect\"\n\t\"unsafe\"\n)\n\n// An enumeration of flags used when creating a rendering context.\n// (https://wiki.libsdl.org/SDL_RendererFlags)\nconst (\n\tRENDERER_SOFTWARE      = C.SDL_RENDERER_SOFTWARE      // the renderer is a software fallback\n\tRENDERER_ACCELERATED   = C.SDL_RENDERER_ACCELERATED   // the renderer uses hardware acceleration\n\tRENDERER_PRESENTVSYNC  = C.SDL_RENDERER_PRESENTVSYNC  // present is synchronized with the refresh rate\n\tRENDERER_TARGETTEXTURE = C.SDL_RENDERER_TARGETTEXTURE // the renderer supports rendering to texture\n)\n\ntype ScaleMode C.SDL_ScaleMode\n\n// The scaling mode for a texture.\nconst (\n\tScaleModeNearest ScaleMode = C.SDL_ScaleModeNearest // nearest pixel sampling\n\tScaleModeLinear            = C.SDL_ScaleModeLinear  // linear filtering\n\tScaleModeBest              = C.SDL_ScaleModeBest    // anisotropic filtering\n)\n\n// An enumeration of texture access patterns..\n// (https://wiki.libsdl.org/SDL_TextureAccess)\nconst (\n\tTEXTUREACCESS_STATIC    = C.SDL_TEXTUREACCESS_STATIC    // changes rarely, not lockable\n\tTEXTUREACCESS_STREAMING = C.SDL_TEXTUREACCESS_STREAMING // changes frequently, lockable\n\tTEXTUREACCESS_TARGET    = C.SDL_TEXTUREACCESS_TARGET    // can be used as a render target\n)\n\n// An enumeration of the texture channel modulation used in Renderer.Copy().\n// (https://wiki.libsdl.org/SDL_TextureModulate)\nconst (\n\tTEXTUREMODULATE_NONE  = C.SDL_TEXTUREMODULATE_NONE  // no modulation\n\tTEXTUREMODULATE_COLOR = C.SDL_TEXTUREMODULATE_COLOR // srcC = srcC * color\n\tTEXTUREMODULATE_ALPHA = C.SDL_TEXTUREMODULATE_ALPHA // srcA = srcA * alpha\n)\n\n// An enumeration of flags that can be used in the flip parameter for Renderer.CopyEx().\n// (https://wiki.libsdl.org/SDL_RendererFlip)\nconst (\n\tFLIP_NONE       RendererFlip = C.SDL_FLIP_NONE       // do not flip\n\tFLIP_HORIZONTAL              = C.SDL_FLIP_HORIZONTAL // flip horizontally\n\tFLIP_VERTICAL                = C.SDL_FLIP_VERTICAL   // flip vertically\n)\n\n// RendererInfo contains information on the capabilities of a render driver or the current render context.\n// (https://wiki.libsdl.org/SDL_RendererInfo)\ntype RendererInfo struct {\n\tName string // the name of the renderer\n\tRendererInfoData\n}\n\ntype cRendererInfo struct {\n\tName *C.char\n\tRendererInfoData\n}\n\n// RendererInfoData contains information on the capabilities of a render driver or the current render context.\n// (https://wiki.libsdl.org/SDL_RendererInfo)\ntype RendererInfoData struct {\n\tFlags             uint32    // a mask of supported renderer flags\n\tNumTextureFormats uint32    // the number of available texture formats\n\tTextureFormats    [16]int32 // the available texture formats\n\tMaxTextureWidth   int32     // the maximum texture width\n\tMaxTextureHeight  int32     // the maximum texture height\n}\n\nfunc (info *RendererInfo) cptr() *C.SDL_RendererInfo {\n\treturn (*C.SDL_RendererInfo)(unsafe.Pointer(info))\n}\n\nfunc (info *cRendererInfo) cptr() *C.SDL_RendererInfo {\n\treturn (*C.SDL_RendererInfo)(unsafe.Pointer(info))\n}\n\n// RendererFlip is an enumeration of flags that can be used in the flip parameter for Renderer.CopyEx().\n// (https://wiki.libsdl.org/SDL_RendererFlip)\ntype RendererFlip uint32\ntype cRendererFlip C.SDL_RendererFlip\n\n// Vertex structure\ntype Vertex struct {\n\tPosition FPoint // Vertex position, in SDL_Renderer coordinates\n\tColor    Color  // Vertex color\n\tTexCoord FPoint // Normalized texture coordinates, if needed\n}\n\nfunc (flip RendererFlip) c() C.SDL_RendererFlip {\n\treturn C.SDL_RendererFlip(flip)\n}\n\n// GetNumRenderDrivers returns the number of 2D rendering drivers available for the current display.\n// (https://wiki.libsdl.org/SDL_GetNumRenderDrivers)\nfunc GetNumRenderDrivers() (int, error) {\n\ti := int(C.SDL_GetNumRenderDrivers())\n\treturn i, errorFromInt(i)\n}\n\n// GetRenderDriverInfo returns information about a specific 2D rendering driver for the current display.\n// (https://wiki.libsdl.org/SDL_GetRenderDriverInfo)\nfunc GetRenderDriverInfo(index int, info *RendererInfo) (int, error) {\n\tvar cinfo cRendererInfo\n\tret := int(C.SDL_GetRenderDriverInfo(C.int(index), cinfo.cptr()))\n\tif ret < 0 {\n\t\treturn ret, GetError()\n\t}\n\tinfo.RendererInfoData = cinfo.RendererInfoData\n\t// No need to free, it's done by DestroyRenderer\n\tinfo.Name = C.GoString(cinfo.Name)\n\treturn ret, nil\n}\n\n// CreateWindowAndRenderer returns a new window and default renderer.\n// (https://wiki.libsdl.org/SDL_CreateWindowAndRenderer)\nfunc CreateWindowAndRenderer(w, h int32, flags uint32) (*Window, *Renderer, error) {\n\tvar window *C.SDL_Window\n\tvar renderer *C.SDL_Renderer\n\tret := C.SDL_CreateWindowAndRenderer(\n\t\tC.int(w),\n\t\tC.int(h),\n\t\tC.Uint32(flags),\n\t\t&window,\n\t\t&renderer)\n\tif ret == -1 {\n\t\treturn nil, nil, GetError()\n\t}\n\treturn (*Window)(unsafe.Pointer(window)), (*Renderer)(unsafe.Pointer(renderer)), nil\n}\n\n// CreateRenderer returns a new 2D rendering context for a window.\n// (https://wiki.libsdl.org/SDL_CreateRenderer)\nfunc CreateRenderer(window *Window, index int, flags uint32) (*Renderer, error) {\n\trenderer := C.SDL_CreateRenderer(window.cptr(), C.int(index), C.Uint32(flags))\n\tif renderer == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Renderer)(unsafe.Pointer(renderer)), nil\n}\n\n// CreateSoftwareRenderer returns a new 2D software rendering context for a surface.\n// (https://wiki.libsdl.org/SDL_CreateSoftwareRenderer)\nfunc CreateSoftwareRenderer(surface *Surface) (*Renderer, error) {\n\trenderer := C.SDL_CreateSoftwareRenderer(surface.cptr())\n\tif renderer == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Renderer)(unsafe.Pointer(renderer)), nil\n}\n\n// GetRenderer returns the renderer associated with a window.\n// (https://wiki.libsdl.org/SDL_GetRenderer)\nfunc (window *Window) GetRenderer() (*Renderer, error) {\n\trenderer := C.SDL_GetRenderer(window.cptr())\n\tif renderer == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Renderer)(unsafe.Pointer(renderer)), nil\n}\n\n// GetInfo returns information about a rendering context.\n// (https://wiki.libsdl.org/SDL_GetRendererInfo)\nfunc (renderer *Renderer) GetInfo() (RendererInfo, error) {\n\tvar cinfo cRendererInfo\n\tvar info RendererInfo\n\tret := int(C.SDL_GetRendererInfo(renderer.cptr(), cinfo.cptr()))\n\tif ret < 0 {\n\t\treturn info, GetError()\n\t}\n\tinfo.RendererInfoData = cinfo.RendererInfoData\n\t// No need to free, it's done by DestroyRenderer\n\tinfo.Name = C.GoString(cinfo.Name)\n\treturn info, nil\n}\n\n// GetOutputSize returns the output size in pixels of a rendering context.\n// (https://wiki.libsdl.org/SDL_GetRendererOutputSize)\nfunc (renderer *Renderer) GetOutputSize() (w, h int32, err error) {\n\tret := C.SDL_GetRendererOutputSize(\n\t\trenderer.cptr(),\n\t\t(*C.int)(unsafe.Pointer(&w)),\n\t\t(*C.int)(unsafe.Pointer(&h)))\n\terr = errorFromInt(int(ret))\n\treturn\n}\n\n// CreateTexture returns a new texture for a rendering context.\n// (https://wiki.libsdl.org/SDL_CreateTexture)\nfunc (renderer *Renderer) CreateTexture(format uint32, access int, w, h int32) (*Texture, error) {\n\ttexture := C.SDL_CreateTexture(\n\t\trenderer.cptr(),\n\t\tC.Uint32(format),\n\t\tC.int(access),\n\t\tC.int(w),\n\t\tC.int(h))\n\tif texture == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Texture)(unsafe.Pointer(texture)), nil\n}\n\n// CreateTextureFromSurface returns a new texture from an existing surface.\n// (https://wiki.libsdl.org/SDL_CreateTextureFromSurface)\nfunc (renderer *Renderer) CreateTextureFromSurface(surface *Surface) (*Texture, error) {\n\ttexture := C.SDL_CreateTextureFromSurface(renderer.cptr(), surface.cptr())\n\tif texture == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Texture)(unsafe.Pointer(texture)), nil\n}\n\n// Query returns the attributes of a texture.\n// (https://wiki.libsdl.org/SDL_QueryTexture)\nfunc (texture *Texture) Query() (format uint32, access int, width int32, height int32, err error) {\n\tvar _format C.Uint32\n\tvar _access C.int\n\tvar _width C.int\n\tvar _height C.int\n\n\tret := int(C.SDL_QueryTexture(texture.cptr(), &_format, &_access, &_width, &_height))\n\n\tformat = uint32(_format)\n\taccess = int(_access)\n\twidth = int32(_width)\n\theight = int32(_height)\n\terr = errorFromInt(ret)\n\n\treturn\n}\n\n// SetColorMod sets an additional color value multiplied into render copy operations.\n// (https://wiki.libsdl.org/SDL_SetTextureColorMod)\nfunc (texture *Texture) SetColorMod(r uint8, g uint8, b uint8) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetTextureColorMod(\n\t\t\ttexture.cptr(),\n\t\t\tC.Uint8(r),\n\t\t\tC.Uint8(g),\n\t\t\tC.Uint8(b))))\n}\n\n// SetAlphaMod sets an additional alpha value multiplied into render copy operations.\n// (https://wiki.libsdl.org/SDL_SetTextureAlphaMod)\nfunc (texture *Texture) SetAlphaMod(alpha uint8) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetTextureAlphaMod(texture.cptr(), C.Uint8(alpha))))\n}\n\n// GetAlphaMod returns the additional alpha value multiplied into render copy operations.\n// (https://wiki.libsdl.org/SDL_GetTextureAlphaMod)\nfunc (texture *Texture) GetAlphaMod() (alpha uint8, err error) {\n\tret := C.SDL_GetTextureAlphaMod(texture.cptr(), (*C.Uint8)(unsafe.Pointer(&alpha)))\n\treturn alpha, errorFromInt(int(ret))\n}\n\n// SetBlendMode sets the blend mode for a texture, used by Renderer.Copy().\n// (https://wiki.libsdl.org/SDL_SetTextureBlendMode)\nfunc (texture *Texture) SetBlendMode(bm BlendMode) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetTextureBlendMode(texture.cptr(), bm.c())))\n}\n\n// GetBlendMode returns the blend mode used for texture copy operations.\n// (https://wiki.libsdl.org/SDL_GetTextureBlendMode)\nfunc (texture *Texture) GetBlendMode() (bm BlendMode, err error) {\n\tret := C.SDL_GetTextureBlendMode(texture.cptr(), bm.cptr())\n\treturn bm, errorFromInt(int(ret))\n}\n\n// Update updates the given texture rectangle with new pixel data.\n// (https://wiki.libsdl.org/SDL_UpdateTexture)\nfunc (texture *Texture) Update(rect *Rect, pixels unsafe.Pointer, pitch int) error {\n\tif pixels == nil {\n\t\treturn nil\n\t}\n\treturn errorFromInt(int(\n\t\tC.SDL_UpdateTexture(\n\t\t\ttexture.cptr(),\n\t\t\trect.cptr(),\n\t\t\tpixels,\n\t\t\tC.int(pitch))))\n}\n\n// UpdateRGBA updates the given texture rectangle with new uint32 pixel data.\n// (https://wiki.libsdl.org/SDL_UpdateTexture)\nfunc (texture *Texture) UpdateRGBA(rect *Rect, pixels []uint32, pitch int) error {\n\tif pixels == nil {\n\t\treturn nil\n\t}\n\treturn errorFromInt(int(\n\t\tC.SDL_UpdateTexture(\n\t\t\ttexture.cptr(),\n\t\t\trect.cptr(),\n\t\t\tunsafe.Pointer(&pixels[0]),\n\t\t\tC.int(4*pitch)))) // 4 bytes in one uint32\n}\n\n// UpdateYUV updates a rectangle within a planar YV12 or IYUV texture with new pixel data.\n// (https://wiki.libsdl.org/SDL_UpdateYUVTexture)\nfunc (texture *Texture) UpdateYUV(rect *Rect, yPlane []byte, yPitch int, uPlane []byte, uPitch int, vPlane []byte, vPitch int) error {\n\tvar yPlanePtr, uPlanePtr, vPlanePtr *byte\n\tif yPlane != nil {\n\t\tyPlanePtr = &yPlane[0]\n\t}\n\tif uPlane != nil {\n\t\tuPlanePtr = &uPlane[0]\n\t}\n\tif vPlane != nil {\n\t\tvPlanePtr = &vPlane[0]\n\t}\n\treturn errorFromInt(int(\n\t\tC.SDL_UpdateYUVTexture(\n\t\t\ttexture.cptr(),\n\t\t\trect.cptr(),\n\t\t\t(*C.Uint8)(unsafe.Pointer(yPlanePtr)),\n\t\t\tC.int(yPitch),\n\t\t\t(*C.Uint8)(unsafe.Pointer(uPlanePtr)),\n\t\t\tC.int(uPitch),\n\t\t\t(*C.Uint8)(unsafe.Pointer(vPlanePtr)),\n\t\t\tC.int(vPitch))))\n}\n\n// Lock locks a portion of the texture for write-only pixel access.\n// (https://wiki.libsdl.org/SDL_LockTexture)\nfunc (texture *Texture) Lock(rect *Rect) ([]byte, int, error) {\n\tvar _pitch C.int\n\tvar _pixels unsafe.Pointer\n\tvar b []byte\n\tvar length int\n\n\tret := C.SDL_LockTexture(texture.cptr(), rect.cptr(), &_pixels, &_pitch)\n\tif ret < 0 {\n\t\treturn b, int(_pitch), GetError()\n\t}\n\n\t_, _, w, h, err := texture.Query()\n\tif err != nil {\n\t\treturn b, int(_pitch), GetError()\n\t}\n\n\tpitch := int32(_pitch)\n\tif rect != nil {\n\t\tbytesPerPixel := pitch / w\n\t\tlength = int(bytesPerPixel * (w*rect.H - rect.X - (w - rect.X - rect.W)))\n\t} else {\n\t\tlength = int(pitch * h)\n\t}\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&b))\n\tsliceHeader.Cap = int(length)\n\tsliceHeader.Len = int(length)\n\tsliceHeader.Data = uintptr(_pixels)\n\n\treturn b, int(pitch), nil\n}\n\n// Unlock unlocks a texture, uploading the changes to video memory, if needed.\n// (https://wiki.libsdl.org/SDL_UnlockTexture)\nfunc (texture *Texture) Unlock() {\n\tC.SDL_UnlockTexture(texture.cptr())\n}\n\n// RenderTargetSupported reports whether a window supports the use of render targets.\n// (https://wiki.libsdl.org/SDL_RenderTargetSupported)\nfunc (renderer *Renderer) RenderTargetSupported() bool {\n\treturn C.SDL_RenderTargetSupported(renderer.cptr()) != 0\n}\n\n// SetRenderTarget sets a texture as the current rendering target.\n// (https://wiki.libsdl.org/SDL_SetRenderTarget)\nfunc (renderer *Renderer) SetRenderTarget(texture *Texture) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetRenderTarget(renderer.cptr(), texture.cptr())))\n\n}\n\n// GetRenderTarget returns the current render target.\n// (https://wiki.libsdl.org/SDL_GetRenderTarget)\nfunc (renderer *Renderer) GetRenderTarget() *Texture {\n\treturn (*Texture)(unsafe.Pointer(C.SDL_GetRenderTarget(renderer.cptr())))\n}\n\n// SetLogicalSize sets a device independent resolution for rendering.\n// (https://wiki.libsdl.org/SDL_RenderSetLogicalSize)\nfunc (renderer *Renderer) SetLogicalSize(w, h int32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderSetLogicalSize(renderer.cptr(), C.int(w), C.int(h))))\n}\n\n// GetLogicalSize returns device independent resolution for rendering.\n// (https://wiki.libsdl.org/SDL_RenderGetLogicalSize)\nfunc (renderer *Renderer) GetLogicalSize() (w, h int32) {\n\tC.SDL_RenderGetLogicalSize(\n\t\trenderer.cptr(),\n\t\t(*C.int)(unsafe.Pointer(&w)),\n\t\t(*C.int)(unsafe.Pointer(&h)))\n\treturn\n}\n\n// SetViewport sets the drawing area for rendering on the current target.\n// (https://wiki.libsdl.org/SDL_RenderSetViewport)\nfunc (renderer *Renderer) SetViewport(rect *Rect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderSetViewport(renderer.cptr(), rect.cptr())))\n}\n\n// GetViewport returns the drawing area for the current target.\n// (https://wiki.libsdl.org/SDL_RenderGetViewport)\nfunc (renderer *Renderer) GetViewport() (rect Rect) {\n\tC.SDL_RenderGetViewport(renderer.cptr(), rect.cptr())\n\treturn\n}\n\n// IsClipEnabled returns whether clipping is enabled on the given renderer.\n// (https://wiki.libsdl.org/SDL_RenderIsClipEnabled)\nfunc (renderer *Renderer) IsClipEnabled() bool {\n\treturn C.SDL_RenderIsClipEnabled(renderer.cptr()) == C.SDL_TRUE\n}\n\n// SetClipRect sets the clip rectangle for rendering on the specified target.\n// (https://wiki.libsdl.org/SDL_RenderSetClipRect)\nfunc (renderer *Renderer) SetClipRect(rect *Rect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderSetClipRect(renderer.cptr(), rect.cptr())))\n}\n\n// GetClipRect returns the clip rectangle for the current target.\n// (https://wiki.libsdl.org/SDL_RenderGetClipRect)\nfunc (renderer *Renderer) GetClipRect() (rect Rect) {\n\tC.SDL_RenderGetClipRect(renderer.cptr(), rect.cptr())\n\treturn\n}\n\n// SetScale sets the drawing scale for rendering on the current target.\n// (https://wiki.libsdl.org/SDL_RenderSetScale)\nfunc (renderer *Renderer) SetScale(scaleX, scaleY float32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderSetScale(\n\t\t\trenderer.cptr(),\n\t\t\tC.float(scaleX),\n\t\t\tC.float(scaleY))))\n}\n\n// GetScale returns the drawing scale for the current target.\n// (https://wiki.libsdl.org/SDL_RenderGetScale)\nfunc (renderer *Renderer) GetScale() (scaleX, scaleY float32) {\n\tC.SDL_RenderGetScale(\n\t\trenderer.cptr(),\n\t\t(*C.float)(unsafe.Pointer(&scaleX)),\n\t\t(*C.float)(unsafe.Pointer(&scaleY)))\n\treturn\n}\n\n// SetIntegerScale sets whether to force integer scales for\n// resolution-independent rendering.\n//\n// This function restricts the logical viewport to integer values - that is,\n// when a resolution is between two multiples of a logical size, the viewport\n// size is rounded down to the lower multiple.\n//\n// (https://wiki.libsdl.org/SDL_RenderSetIntegerScale)\nfunc (renderer *Renderer) SetIntegerScale(v bool) error {\n\tvar cv C.SDL_bool = C.SDL_FALSE\n\tif v {\n\t\tcv = C.SDL_TRUE\n\t}\n\n\treturn errorFromInt(int(C.SDL_RenderSetIntegerScale(renderer.cptr(), cv)))\n}\n\n// GetIntegerScale reports whether integer scales are forced for\n// resolution-independent rendering.\n//\n// (https://wiki.libsdl.org/SDL_RenderGetIntegerScale)\nfunc (renderer *Renderer) GetIntegerScale() (bool, error) {\n\tClearError()\n\tif C.SDL_RenderGetIntegerScale(renderer.cptr()) == C.SDL_TRUE {\n\t\treturn true, nil\n\t}\n\treturn false, GetError()\n}\n\n// SetDrawColor sets the color used for drawing operations (Rect, Line and Clear).\n// (https://wiki.libsdl.org/SDL_SetRenderDrawColor)\nfunc (renderer *Renderer) SetDrawColor(r, g, b, a uint8) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetRenderDrawColor(\n\t\t\trenderer.cptr(),\n\t\t\tC.Uint8(r),\n\t\t\tC.Uint8(g),\n\t\t\tC.Uint8(b),\n\t\t\tC.Uint8(a))))\n}\n\n// SetDrawColorArray is a custom variant of SetDrawColor.\nfunc (renderer *Renderer) SetDrawColorArray(bs ...uint8) error {\n\t_bs := []C.Uint8{0, 0, 0, 255}\n\tfor i := 0; i < len(_bs) && i < len(bs); i++ {\n\t\t_bs[i] = C.Uint8(bs[i])\n\t}\n\treturn errorFromInt(int(\n\t\tC.SDL_SetRenderDrawColor(\n\t\t\trenderer.cptr(),\n\t\t\t_bs[0],\n\t\t\t_bs[1],\n\t\t\t_bs[2],\n\t\t\t_bs[3])))\n}\n\n// GetDrawColor returns the color used for drawing operations (Rect, Line and Clear).\n// (https://wiki.libsdl.org/SDL_GetRenderDrawColor)\nfunc (renderer *Renderer) GetDrawColor() (r, g, b, a uint8, err error) {\n\tret := C.SDL_GetRenderDrawColor(\n\t\trenderer.cptr(),\n\t\t(*C.Uint8)(unsafe.Pointer(&r)),\n\t\t(*C.Uint8)(unsafe.Pointer(&g)),\n\t\t(*C.Uint8)(unsafe.Pointer(&b)),\n\t\t(*C.Uint8)(unsafe.Pointer(&a)))\n\treturn r, g, b, a, errorFromInt(int(ret))\n}\n\n// SetDrawBlendMode sets the blend mode used for drawing operations (Fill and Line).\n// (https://wiki.libsdl.org/SDL_SetRenderDrawBlendMode)\nfunc (renderer *Renderer) SetDrawBlendMode(bm BlendMode) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetRenderDrawBlendMode(renderer.cptr(), bm.c())))\n}\n\n// GetDrawBlendMode returns the blend mode used for drawing operations.\n// (https://wiki.libsdl.org/SDL_GetRenderDrawBlendMode)\nfunc (renderer *Renderer) GetDrawBlendMode(bm *BlendMode) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_GetRenderDrawBlendMode(renderer.cptr(), bm.cptr())))\n}\n\n// Clear clears the current rendering target with the drawing color.\n// (https://wiki.libsdl.org/SDL_RenderClear)\nfunc (renderer *Renderer) Clear() error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderClear(renderer.cptr())))\n}\n\n// DrawPoint draws a point on the current rendering target.\n// (https://wiki.libsdl.org/SDL_RenderDrawPoint)\nfunc (renderer *Renderer) DrawPoint(x, y int32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawPoint(renderer.cptr(), C.int(x), C.int(y))))\n}\n\n// DrawPoints draws multiple points on the current rendering target.\n// (https://wiki.libsdl.org/SDL_RenderDrawPoints)\nfunc (renderer *Renderer) DrawPoints(points []Point) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawPoints(\n\t\t\trenderer.cptr(),\n\t\t\tpoints[0].cptr(),\n\t\t\tC.int(len(points)))))\n}\n\n// DrawLine draws a line on the current rendering target.\n// (https://wiki.libsdl.org/SDL_RenderDrawLine)\nfunc (renderer *Renderer) DrawLine(x1, y1, x2, y2 int32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawLine(\n\t\t\trenderer.cptr(),\n\t\t\tC.int(x1),\n\t\t\tC.int(y1),\n\t\t\tC.int(x2),\n\t\t\tC.int(y2))))\n}\n\n// DrawLines draws a series of connected lines on the current rendering target.\n// (https://wiki.libsdl.org/SDL_RenderDrawLines)\nfunc (renderer *Renderer) DrawLines(points []Point) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawLines(\n\t\t\trenderer.cptr(),\n\t\t\tpoints[0].cptr(),\n\t\t\tC.int(len(points)))))\n}\n\n// DrawRect draws a rectangle on the current rendering target.\n// (https://wiki.libsdl.org/SDL_RenderDrawRect)\nfunc (renderer *Renderer) DrawRect(rect *Rect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawRect(renderer.cptr(), rect.cptr())))\n}\n\n// DrawRects draws some number of rectangles on the current rendering target.\n// (https://wiki.libsdl.org/SDL_RenderDrawRects)\nfunc (renderer *Renderer) DrawRects(rects []Rect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawRects(\n\t\t\trenderer.cptr(),\n\t\t\trects[0].cptr(),\n\t\t\tC.int(len(rects)))))\n}\n\n// FillRect fills a rectangle on the current rendering target with the drawing color.\n// (https://wiki.libsdl.org/SDL_RenderFillRect)\nfunc (renderer *Renderer) FillRect(rect *Rect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderFillRect(renderer.cptr(), rect.cptr())))\n}\n\n// FillRects fills some number of rectangles on the current rendering target with the drawing color.\n// (https://wiki.libsdl.org/SDL_RenderFillRects)\nfunc (renderer *Renderer) FillRects(rects []Rect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderFillRects(\n\t\t\trenderer.cptr(),\n\t\t\trects[0].cptr(),\n\t\t\tC.int(len(rects)))))\n}\n\n// Copy copies a portion of the texture to the current rendering target.\n// (https://wiki.libsdl.org/SDL_RenderCopy)\nfunc (renderer *Renderer) Copy(texture *Texture, src, dst *Rect) error {\n\tif dst == nil {\n\t\treturn errorFromInt(int(\n\t\t\tC.SDL_RenderCopy(\n\t\t\t\trenderer.cptr(),\n\t\t\t\ttexture.cptr(),\n\t\t\t\tsrc.cptr(),\n\t\t\t\tdst.cptr())))\n\t}\n\treturn errorFromInt(int(\n\t\tC.RenderCopy(\n\t\t\trenderer.cptr(),\n\t\t\ttexture.cptr(),\n\t\t\tsrc.cptr(),\n\t\t\tC.int(dst.X), C.int(dst.Y), C.int(dst.W), C.int(dst.H))))\n}\n\n// CopyEx copies a portion of the texture to the current rendering target, optionally rotating it by angle around the given center and also flipping it top-bottom and/or left-right.\n// (https://wiki.libsdl.org/SDL_RenderCopyEx)\nfunc (renderer *Renderer) CopyEx(texture *Texture, src, dst *Rect, angle float64, center *Point, flip RendererFlip) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderCopyEx(\n\t\t\trenderer.cptr(),\n\t\t\ttexture.cptr(),\n\t\t\tsrc.cptr(),\n\t\t\tdst.cptr(),\n\t\t\tC.double(angle),\n\t\t\tcenter.cptr(),\n\t\t\tflip.c())))\n}\n\n// DrawPointF draws a point on the current rendering target.\n// TODO: (https://wiki.libsdl.org/SDL_RenderDrawPointF)\nfunc (renderer *Renderer) DrawPointF(x, y float32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawPointF(renderer.cptr(), C.float(x), C.float(y))))\n}\n\n// DrawPointsF draws multiple points on the current rendering target.\n// TODO: (https://wiki.libsdl.org/SDL_RenderDrawPointsF)\nfunc (renderer *Renderer) DrawPointsF(points []FPoint) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawPointsF(\n\t\t\trenderer.cptr(),\n\t\t\tpoints[0].cptr(),\n\t\t\tC.int(len(points)))))\n}\n\n// DrawLineF draws a line on the current rendering target.\n// TODO: (https://wiki.libsdl.org/SDL_RenderDrawLineF)\nfunc (renderer *Renderer) DrawLineF(x1, y1, x2, y2 float32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawLineF(\n\t\t\trenderer.cptr(),\n\t\t\tC.float(x1),\n\t\t\tC.float(y1),\n\t\t\tC.float(x2),\n\t\t\tC.float(y2))))\n}\n\n// DrawLinesF draws a series of connected lines on the current rendering target.\n// TODO: (https://wiki.libsdl.org/SDL_RenderDrawLinesF)\nfunc (renderer *Renderer) DrawLinesF(points []FPoint) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawLinesF(\n\t\t\trenderer.cptr(),\n\t\t\tpoints[0].cptr(),\n\t\t\tC.int(len(points)))))\n}\n\n// DrawRectF draws a rectangle on the current rendering target.\n// TODO: (https://wiki.libsdl.org/SDL_RenderDrawRectF)\nfunc (renderer *Renderer) DrawRectF(rect *FRect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawRectF(renderer.cptr(), rect.cptr())))\n}\n\n// DrawRectsF draws some number of rectangles on the current rendering target.\n// TODO: (https://wiki.libsdl.org/SDL_RenderDrawRectsF)\nfunc (renderer *Renderer) DrawRectsF(rects []FRect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderDrawRectsF(\n\t\t\trenderer.cptr(),\n\t\t\trects[0].cptr(),\n\t\t\tC.int(len(rects)))))\n}\n\n// FillRectF fills a rectangle on the current rendering target with the drawing color.\n// TODO: (https://wiki.libsdl.org/SDL_RenderFillRectF)\nfunc (renderer *Renderer) FillRectF(rect *FRect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderFillRectF(renderer.cptr(), rect.cptr())))\n}\n\n// FillRectsF fills some number of rectangles on the current rendering target with the drawing color.\n// TODO: (https://wiki.libsdl.org/SDL_RenderFillRectsF)\nfunc (renderer *Renderer) FillRectsF(rects []FRect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderFillRectsF(\n\t\t\trenderer.cptr(),\n\t\t\trects[0].cptr(),\n\t\t\tC.int(len(rects)))))\n}\n\n// CopyF copies a portion of the texture to the current rendering target.\n// TODO: (https://wiki.libsdl.org/SDL_RenderCopyF)\nfunc (renderer *Renderer) CopyF(texture *Texture, src *Rect, dst *FRect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderCopyF(\n\t\t\trenderer.cptr(),\n\t\t\ttexture.cptr(),\n\t\t\tsrc.cptr(),\n\t\t\tdst.cptr())))\n}\n\n// CopyExF copies a portion of the texture to the current rendering target, optionally rotating it by angle around the given center and also flipping it top-bottom and/or left-right.\n// TODO: (https://wiki.libsdl.org/SDL_RenderCopyExF)\nfunc (renderer *Renderer) CopyExF(texture *Texture, src *Rect, dst *FRect, angle float64, center *FPoint, flip RendererFlip) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderCopyExF(\n\t\t\trenderer.cptr(),\n\t\t\ttexture.cptr(),\n\t\t\tsrc.cptr(),\n\t\t\tdst.cptr(),\n\t\t\tC.double(angle),\n\t\t\tcenter.cptr(),\n\t\t\tflip.c())))\n}\n\n// ReadPixels reads pixels from the current rendering target.\n// (https://wiki.libsdl.org/SDL_RenderReadPixels)\nfunc (renderer *Renderer) ReadPixels(rect *Rect, format uint32, pixels unsafe.Pointer, pitch int) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_RenderReadPixels(\n\t\t\trenderer.cptr(),\n\t\t\trect.cptr(),\n\t\t\tC.Uint32(format),\n\t\t\tpixels,\n\t\t\tC.int(pitch))))\n}\n\n// Present updates the screen with any rendering performed since the previous call.\n// (https://wiki.libsdl.org/SDL_RenderPresent)\nfunc (renderer *Renderer) Present() {\n\tC.SDL_RenderPresent(renderer.cptr())\n}\n\n// Destroy destroys the specified texture.\n// (https://wiki.libsdl.org/SDL_DestroyTexture)\nfunc (texture *Texture) Destroy() error {\n\tlastErr := GetError()\n\tClearError()\n\tC.SDL_DestroyTexture(texture.cptr())\n\terr := GetError()\n\tif err != nil {\n\t\treturn err\n\t}\n\tSetError(lastErr)\n\treturn nil\n}\n\n// Destroy destroys the rendering context for a window and free associated textures.\n// (https://wiki.libsdl.org/SDL_DestroyRenderer)\nfunc (renderer *Renderer) Destroy() error {\n\tlastErr := GetError()\n\tClearError()\n\tC.SDL_DestroyRenderer(renderer.cptr())\n\terr := GetError()\n\tif err != nil {\n\t\treturn err\n\t}\n\tSetError(lastErr)\n\treturn nil\n}\n\n// Flush forces the rendering context to flush any pending commands to the underlying rendering API.\n// TODO: (https://wiki.libsdl.org/SDL_RenderFlush)\nfunc (renderer *Renderer) Flush() error {\n\treturn errorFromInt(int(C.SDL_RenderFlush(renderer.cptr())))\n}\n\n// GLBind binds an OpenGL/ES/ES2 texture to the current context for use with OpenGL instructions when rendering OpenGL primitives directly.\n// (https://wiki.libsdl.org/SDL_GL_BindTexture)\nfunc (texture *Texture) GLBind(texw, texh *float32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_GL_BindTexture(\n\t\t\ttexture.cptr(),\n\t\t\t(*C.float)(unsafe.Pointer(texw)),\n\t\t\t(*C.float)(unsafe.Pointer(texh)))))\n}\n\n// GLUnbind unbinds an OpenGL/ES/ES2 texture from the current context.\n// (https://wiki.libsdl.org/SDL_GL_UnbindTexture)\nfunc (texture *Texture) GLUnbind() error {\n\treturn errorFromInt(int(\n\t\tC.SDL_GL_UnbindTexture(texture.cptr())))\n}\n\n// GetMetalLayer gets the CAMetalLayer associated with the given Metal renderer\n// (https://wiki.libsdl.org/SDL_RenderGetMetalLayer)\nfunc (renderer *Renderer) GetMetalLayer() (layer unsafe.Pointer, err error) {\n\tlayer = C.SDL_RenderGetMetalLayer(renderer.cptr())\n\tif layer == nil {\n\t\terr = GetError()\n\t}\n\treturn\n}\n\n// GetMetalCommandEncoder gets the Metal command encoder for the current frame\n// (https://wiki.libsdl.org/SDL_RenderGetMetalCommandEncoder)\nfunc (renderer *Renderer) GetMetalCommandEncoder() (encoder unsafe.Pointer, err error) {\n\tencoder = C.SDL_RenderGetMetalCommandEncoder(renderer.cptr())\n\tif encoder == nil {\n\t\terr = GetError()\n\t}\n\treturn\n}\n\n// UpdateNV updates a rectangle within a planar NV12 or NV21 texture with new pixels.\n// (https://wiki.libsdl.org/SDL_UpdateNVTexture)\nfunc (texture *Texture) UpdateNV(rect *Rect, yPlane []byte, yPitch int, uvPlane []byte, uvPitch int) error {\n\tvar yPlanePtr, uvPlanePtr *byte\n\tif yPlane != nil {\n\t\tyPlanePtr = &yPlane[0]\n\t}\n\tif uvPlane != nil {\n\t\tuvPlanePtr = &uvPlane[0]\n\t}\n\treturn errorFromInt(int(\n\t\tC.SDL_UpdateNVTexture(\n\t\t\ttexture.cptr(),\n\t\t\trect.cptr(),\n\t\t\t(*C.Uint8)(unsafe.Pointer(yPlanePtr)),\n\t\t\tC.int(yPitch),\n\t\t\t(*C.Uint8)(unsafe.Pointer(uvPlanePtr)),\n\t\t\tC.int(uvPitch))))\n}\n\n// RenderGeometry renders a list of triangles, optionally using a texture and\n// indices into the vertex array Color and alpha modulation is done per vertex\n// (SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are ignored).\n// (https://wiki.libsdl.org/SDL_RenderGeometry)\nfunc (renderer *Renderer) RenderGeometry(texture *Texture, vertices []Vertex, indices []int32) (err error) {\n\t_texture := texture.cptr()\n\t_vertices := (*C.SDL_Vertex)(unsafe.Pointer(&vertices[0]))\n\t_num_vertices := C.int(len(vertices))\n\tvar _indices *C.int\n\t_num_indices := C.int(0)\n\tif indices != nil {\n\t\t_indices = (*C.int)(unsafe.Pointer(&indices[0]))\n\t\t_num_indices = C.int(len(indices))\n\t}\n\terr = errorFromInt(int(C.SDL_RenderGeometry(renderer.cptr(), _texture, _vertices, _num_vertices, _indices, _num_indices)))\n\treturn\n}\n\n// RenderGeomtryRaw renders a list of triangles, optionally using a texture and\n// indices into the vertex arrays Color and alpha modulation is done per vertex\n// (SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are ignored).\n// (https://wiki.libsdl.org/SDL_RenderGeometryRaw)\nfunc (renderer *Renderer) RenderGeometryRaw(texture *Texture, xy *float32, xy_stride int, color *Color, color_stride int, uv *float32, uv_stride int, num_vertices int, indices unsafe.Pointer, num_indices int, size_indices int) (err error) {\n\t_texture := texture.cptr()\n\t_xy := (*C.float)(xy)\n\t_xy_stride := C.int(xy_stride)\n\t_color := (*C.SDL_Color)(unsafe.Pointer(color))\n\t_color_stride := C.int(color_stride)\n\t_uv := (*C.float)(uv)\n\t_uv_stride := C.int(uv_stride)\n\t_num_vertices := C.int(num_vertices)\n\t_num_indices := C.int(num_indices)\n\t_size_indices := C.int(size_indices)\n\t_indices := indices\n\n\terr = errorFromInt(int(C.RenderGeometryRaw(renderer.cptr(), _texture, _xy, _xy_stride, _color, _color_stride, _uv, _uv_stride, _num_vertices, _indices, _num_indices, _size_indices)))\n\treturn\n}\n\n// SetTextureUserData associates a user-specified pointer with a texture.\n// (https://wiki.libsdl.org/SDL_SetTextureUserData)\nfunc (texture *Texture) SetTextureUserData(userdata unsafe.Pointer) (err error) {\n\terr = errorFromInt(int(C.SDL_SetTextureUserData(texture.cptr(), userdata)))\n\treturn\n}\n\n// GetTextureUserData gets the user-specified pointer associated with a texture.\n// (https://wiki.libsdl.org/SDL_GetTextureUserData)\nfunc (texture *Texture) GetTextureUserData() (userdata unsafe.Pointer) {\n\tuserdata = C.SDL_GetTextureUserData(texture.cptr())\n\treturn\n}\n\n// RenderWindowToLogical gets logical coordinates of point in renderer when given real coordinates of\n// point in window.\n//\n// Logical coordinates will differ from real coordinates when render is scaled\n// and logical renderer size set\n//\n// (https://wiki.libsdl.org/SDL_RenderWindowToLogical)\nfunc (renderer *Renderer) RenderWindowToLogical(windowX, windowY int) (logicalX, logicalY float32) {\n\t_windowX := C.int(windowX)\n\t_windowY := C.int(windowY)\n\t_logicalX := C.float(0)\n\t_logicalY := C.float(0)\n\tC.SDL_RenderWindowToLogical(renderer.cptr(), _windowX, _windowY, &_logicalX, &_logicalY)\n\tlogicalX = float32(_logicalX)\n\tlogicalY = float32(_logicalY)\n\treturn\n}\n\n// RenderLogicalToWindow gets real coordinates of point in window when given logical coordinates of point in renderer.\n// Logical coordinates will differ from real coordinates when render is scaled and logical renderer size set.\n// (https://wiki.libsdl.org/SDL_RenderLogicalToWindow)\nfunc (renderer *Renderer) RenderLogicalToWindow(logicalX, logicalY float32) (windowX, windowY int) {\n\t_logicalX := C.float(logicalX)\n\t_logicalY := C.float(logicalY)\n\t_windowX := C.int(0)\n\t_windowY := C.int(0)\n\tC.SDL_RenderLogicalToWindow(renderer.cptr(), _logicalX, _logicalY, &_windowX, &_windowY)\n\twindowX = int(_windowX)\n\twindowY = int(_windowY)\n\treturn\n}\n\n// RenderSetVSync toggles VSync of the given renderer.\n// (https://wiki.libsdl.org/SDL_RenderSetVSync)\nfunc (renderer *Renderer) RenderSetVSync(vsync bool) (err error) {\n\t_vsync := C.int(Btoi(vsync))\n\terr = errorFromInt(int(C.SDL_RenderSetVSync(renderer.cptr(), _vsync)))\n\treturn\n}\n\n// GetWindow gets the window associated with a renderer.\n// (https://wiki.libsdl.org/SDL_RenderGetWindow)\nfunc (renderer *Renderer) GetWindow() (window *Window, err error) {\n\twindow = (*Window)(unsafe.Pointer(C.SDL_RenderGetWindow(renderer.cptr())))\n\treturn\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/rwops.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\nstatic Sint64 RWsize(SDL_RWops *ctx)\n{\n\treturn ctx->size(ctx);\n}\n\nstatic Sint64 RWseek(SDL_RWops *ctx, Sint64 offset, int whence)\n{\n\treturn ctx->seek(ctx, offset, whence);\n}\n\nstatic size_t RWread(SDL_RWops *ctx, void *ptr, size_t size, size_t maxnum)\n{\n\treturn ctx->read(ctx, ptr, size, maxnum);\n}\n\nstatic size_t RWwrite(SDL_RWops *ctx, void *ptr, size_t size, size_t num)\n{\n\treturn ctx->write(ctx, ptr, size, num);\n}\n\nstatic int RWclose(SDL_RWops *ctx)\n{\n\treturn ctx->close(ctx);\n}\n\n#if !(SDL_VERSION_ATLEAST(2,0,6))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_LoadFile_RW is not supported before SDL 2.0.6\")\n#endif\n\nstatic void * SDL_LoadFile_RW(SDL_RWops * src, size_t *datasize, int freesrc)\n{\n\treturn 0;\n}\n#endif\n*/\nimport \"C\"\nimport (\n\t\"reflect\"\n\t\"unsafe\"\n)\n\n// RWops types\nconst (\n\tRWOPS_UNKNOWN   = 0 // unknown stream type\n\tRWOPS_WINFILE   = 1 // win32 file\n\tRWOPS_STDFILE   = 2 // stdio file\n\tRWOPS_JNIFILE   = 3 // android asset\n\tRWOPS_MEMORY    = 4 // memory stream\n\tRWOPS_MEMORY_RO = 5 // read-only memory stream\n)\n\n// RWops seek from\nconst (\n\tRW_SEEK_SET = C.RW_SEEK_SET // seek from the beginning of data\n\tRW_SEEK_CUR = C.RW_SEEK_CUR // seek relative to current read point\n\tRW_SEEK_END = C.RW_SEEK_END // seek relative to the end of data\n)\n\n// RWops provides an abstract interface to stream I/O. Applications can generally ignore the specifics of this structure's internals and treat them as opaque pointers. The details are important to lower-level code that might need to implement one of these, however.\n// (https://wiki.libsdl.org/SDL_RWops)\ntype RWops C.SDL_RWops\n\nfunc (rwops *RWops) cptr() *C.SDL_RWops {\n\treturn (*C.SDL_RWops)(rwops)\n}\n\n// RWFromFile creates a new RWops structure for reading from and/or writing to a named file.\n// (https://wiki.libsdl.org/SDL_RWFromFile)\nfunc RWFromFile(file, mode string) *RWops {\n\t_file := C.CString(file)\n\t_mode := C.CString(mode)\n\tdefer C.free(unsafe.Pointer(_file))\n\tdefer C.free(unsafe.Pointer(_mode))\n\treturn (*RWops)(unsafe.Pointer(C.SDL_RWFromFile(_file, _mode)))\n}\n\n// RWFromMem prepares a read-write memory buffer for use with RWops.\n// (https://wiki.libsdl.org/SDL_RWFromMem)\nfunc RWFromMem(mem []byte) (*RWops, error) {\n\tif mem == nil {\n\t\treturn nil, ErrInvalidParameters\n\t}\n\n\theader := (*reflect.SliceHeader)(unsafe.Pointer(&mem))\n\t_mem := unsafe.Pointer(header.Data)\n\n\trwops := (*RWops)(unsafe.Pointer(C.SDL_RWFromMem(_mem, C.int(len(mem)))))\n\tif rwops == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn rwops, nil\n}\n\n// AllocRW allocates an empty, unpopulated RWops structure.\n// (https://wiki.libsdl.org/SDL_AllocRW)\nfunc AllocRW() *RWops {\n\treturn (*RWops)(unsafe.Pointer(C.SDL_AllocRW()))\n}\n\n// Free frees the RWops structure allocated by AllocRW().\n// (https://wiki.libsdl.org/SDL_FreeRW)\nfunc (rwops *RWops) Free() error {\n\tif rwops == nil {\n\t\treturn ErrInvalidParameters\n\t}\n\n\tC.SDL_FreeRW(rwops.cptr())\n\treturn nil\n}\n\n// Size returns the size of the data stream in the RWops.\n// (https://wiki.libsdl.org/SDL_RWsize)\nfunc (rwops *RWops) Size() (int64, error) {\n\tn := int64(C.RWsize(rwops.cptr()))\n\tif n < 0 {\n\t\treturn n, GetError()\n\t}\n\treturn n, nil\n}\n\n// Seek seeks within the RWops data stream.\n// (https://wiki.libsdl.org/SDL_RWseek)\nfunc (rwops *RWops) Seek(offset int64, whence int) (int64, error) {\n\tif rwops == nil {\n\t\treturn -1, ErrInvalidParameters\n\t}\n\n\tret := int64(C.RWseek(rwops.cptr(), C.Sint64(offset), C.int(whence)))\n\tif ret < 0 {\n\t\treturn ret, GetError()\n\t}\n\treturn ret, nil\n}\n\n// Read reads from a data source.\n// (https://wiki.libsdl.org/SDL_RWread)\nfunc (rwops *RWops) Read(buf []byte) (n int, err error) {\n\treturn rwops.Read2(buf, 1, uint(len(buf)))\n}\n\n// Read2 reads from a data source (native).\n// (https://wiki.libsdl.org/SDL_RWread)\nfunc (rwops *RWops) Read2(buf []byte, size, maxnum uint) (n int, err error) {\n\tif rwops == nil || buf == nil {\n\t\treturn 0, ErrInvalidParameters\n\t}\n\n\theader := (*reflect.SliceHeader)(unsafe.Pointer(&buf))\n\t_data := unsafe.Pointer(header.Data)\n\n\tn = int(C.RWread(rwops.cptr(), _data, C.size_t(size), C.size_t(maxnum)))\n\tif n == 0 {\n\t\terr = GetError()\n\t}\n\treturn\n}\n\n// Tell returns the current read/write offset in the RWops data stream.\n// (https://wiki.libsdl.org/SDL_RWtell)\nfunc (rwops *RWops) Tell() (int64, error) {\n\tif rwops == nil {\n\t\treturn 0, ErrInvalidParameters\n\t}\n\n\tret := int64(C.RWseek(rwops.cptr(), 0, C.int(RW_SEEK_CUR)))\n\tif ret < 0 {\n\t\treturn ret, GetError()\n\t}\n\treturn ret, nil\n}\n\n// Write writes to the RWops data stream.\n// (https://wiki.libsdl.org/SDL_RWwrite)\nfunc (rwops *RWops) Write(buf []byte) (n int, err error) {\n\treturn rwops.Write2(buf, 1, uint(len(buf)))\n}\n\n// Write2 writes to the RWops data stream (native).\n// (https://wiki.libsdl.org/SDL_RWwrite)\nfunc (rwops *RWops) Write2(buf []byte, size, num uint) (n int, err error) {\n\tif rwops == nil || buf == nil {\n\t\treturn 0, ErrInvalidParameters\n\t}\n\n\theader := (*reflect.SliceHeader)(unsafe.Pointer(&buf))\n\t_data := unsafe.Pointer(header.Data)\n\n\tn = int(C.RWwrite(rwops.cptr(), _data, C.size_t(size), C.size_t(num)))\n\tif n < int(num) {\n\t\terr = GetError()\n\t}\n\treturn\n}\n\n// Close closes and frees the allocated RWops structure.\n// (https://wiki.libsdl.org/SDL_RWclose)\nfunc (rwops *RWops) Close() error {\n\tif rwops != nil && C.RWclose(rwops.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// ReadU8 reads a byte from the RWops.\n// (https://wiki.libsdl.org/SDL_ReadU8)\nfunc (rwops *RWops) ReadU8() uint8 {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint8(C.SDL_ReadU8(rwops.cptr()))\n}\n\n// ReadLE16 reads 16 bits of little-endian data from the RWops and returns in native format.\n// (https://wiki.libsdl.org/SDL_ReadLE16)\nfunc (rwops *RWops) ReadLE16() uint16 {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint16(C.SDL_ReadLE16(rwops.cptr()))\n}\n\n// ReadBE16 read 16 bits of big-endian data from the RWops and returns in native format.\n// (https://wiki.libsdl.org/SDL_ReadBE16)\nfunc (rwops *RWops) ReadBE16() uint16 {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint16(C.SDL_ReadBE16(rwops.cptr()))\n}\n\n// ReadLE32 reads 32 bits of little-endian data from the RWops and returns in native format.\n// (https://wiki.libsdl.org/SDL_ReadLE32)\nfunc (rwops *RWops) ReadLE32() uint32 {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint32(C.SDL_ReadLE32(rwops.cptr()))\n}\n\n// ReadBE32 reads 32 bits of big-endian data from the RWops and returns in native format.\n// (https://wiki.libsdl.org/SDL_ReadBE32)\nfunc (rwops *RWops) ReadBE32() uint32 {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint32(C.SDL_ReadBE32(rwops.cptr()))\n}\n\n// ReadLE64 reads 64 bits of little-endian data from the RWops and returns in native format.\n// (https://wiki.libsdl.org/SDL_ReadLE64)\nfunc (rwops *RWops) ReadLE64() uint64 {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint64(C.SDL_ReadLE64(rwops.cptr()))\n}\n\n// ReadBE64 reads 64 bits of big-endian data from the RWops and returns in native format.\n// (https://wiki.libsdl.org/SDL_ReadBE64)\nfunc (rwops *RWops) ReadBE64() uint64 {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint64(C.SDL_ReadBE64(rwops.cptr()))\n}\n\n// LoadFile_RW loads all the data from an SDL data stream.\n// (https://wiki.libsdl.org/SDL_LoadFile_RW)\nfunc (src *RWops) LoadFileRW(freesrc bool) (data []byte, size int) {\n\tvar _size C.size_t\n\tvar _freesrc C.int = 0\n\n\tif freesrc {\n\t\t_freesrc = 1\n\t}\n\n\t_data := C.SDL_LoadFile_RW(src.cptr(), &_size, _freesrc)\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&data))\n\tsliceHeader.Cap = int(_size)\n\tsliceHeader.Len = int(_size)\n\tsliceHeader.Data = uintptr(_data)\n\tsize = int(_size)\n\treturn\n}\n\n// LoadFile loads an entire file\n// (https://wiki.libsdl.org/SDL_LoadFile)\nfunc LoadFile(file string) (data []byte, size int) {\n\treturn RWFromFile(file, \"rb\").LoadFileRW(true)\n}\n\n// WriteU8 writes a byte to the RWops.\n// (https://wiki.libsdl.org/SDL_WriteU8)\nfunc (rwops *RWops) WriteU8(value uint8) uint {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint(C.SDL_WriteU8(rwops.cptr(), C.Uint8(value)))\n}\n\n// WriteLE16 writes 16 bits in native format to the RWops as little-endian data.\n// (https://wiki.libsdl.org/SDL_WriteLE16)\nfunc (rwops *RWops) WriteLE16(value uint16) uint {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint(C.SDL_WriteLE16(rwops.cptr(), C.Uint16(value)))\n}\n\n// WriteBE16 writes 16 bits in native format to the RWops as big-endian data.\n// (https://wiki.libsdl.org/SDL_WriteBE16)\nfunc (rwops *RWops) WriteBE16(value uint16) uint {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint(C.SDL_WriteBE16(rwops.cptr(), C.Uint16(value)))\n}\n\n// WriteLE32 writes 32 bits in native format to the RWops as little-endian data.\n// (https://wiki.libsdl.org/SDL_WriteLE32)\nfunc (rwops *RWops) WriteLE32(value uint32) uint {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint(C.SDL_WriteLE32(rwops.cptr(), C.Uint32(value)))\n}\n\n// WriteBE32 writes 32 bits in native format to the RWops as big-endian data.\n// (https://wiki.libsdl.org/SDL_WriteBE32)\nfunc (rwops *RWops) WriteBE32(value uint32) uint {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint(C.SDL_WriteBE32(rwops.cptr(), C.Uint32(value)))\n}\n\n// WriteLE64 writes 64 bits in native format to the RWops as little-endian data.\n// (https://wiki.libsdl.org/SDL_WriteLE64)\nfunc (rwops *RWops) WriteLE64(value uint64) uint {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint(C.SDL_WriteLE64(rwops.cptr(), C.Uint64(value)))\n}\n\n// WriteBE64 writes 64 bits in native format to the RWops as big-endian data.\n// (https://wiki.libsdl.org/SDL_WriteBE64)\nfunc (rwops *RWops) WriteBE64(value uint64) uint {\n\tif rwops == nil {\n\t\treturn 0\n\t}\n\treturn uint(C.SDL_WriteBE64(rwops.cptr(), C.Uint64(value)))\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/scancode.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\n\n// The SDL keyboard scancode representation.\n// (https://wiki.libsdl.org/SDL_Scancode)\n// (https://wiki.libsdl.org/SDLScancodeLookup)\nconst (\n\tSCANCODE_UNKNOWN = 0 // \"\" (no name, empty string)\n\n\tSCANCODE_A = C.SDL_SCANCODE_A // \"A\"\n\tSCANCODE_B = C.SDL_SCANCODE_B // \"B\"\n\tSCANCODE_C = C.SDL_SCANCODE_C // \"C\"\n\tSCANCODE_D = C.SDL_SCANCODE_D // \"D\"\n\tSCANCODE_E = C.SDL_SCANCODE_E // \"E\"\n\tSCANCODE_F = C.SDL_SCANCODE_F // \"F\"\n\tSCANCODE_G = C.SDL_SCANCODE_G // \"G\"\n\tSCANCODE_H = C.SDL_SCANCODE_H // \"H\"\n\tSCANCODE_I = C.SDL_SCANCODE_I // \"I\"\n\tSCANCODE_J = C.SDL_SCANCODE_J // \"J\"\n\tSCANCODE_K = C.SDL_SCANCODE_K // \"K\"\n\tSCANCODE_L = C.SDL_SCANCODE_L // \"L\"\n\tSCANCODE_M = C.SDL_SCANCODE_M // \"M\"\n\tSCANCODE_N = C.SDL_SCANCODE_N // \"N\"\n\tSCANCODE_O = C.SDL_SCANCODE_O // \"O\"\n\tSCANCODE_P = C.SDL_SCANCODE_P // \"P\"\n\tSCANCODE_Q = C.SDL_SCANCODE_Q // \"Q\"\n\tSCANCODE_R = C.SDL_SCANCODE_R // \"R\"\n\tSCANCODE_S = C.SDL_SCANCODE_S // \"S\"\n\tSCANCODE_T = C.SDL_SCANCODE_T // \"T\"\n\tSCANCODE_U = C.SDL_SCANCODE_U // \"U\"\n\tSCANCODE_V = C.SDL_SCANCODE_V // \"V\"\n\tSCANCODE_W = C.SDL_SCANCODE_W // \"W\"\n\tSCANCODE_X = C.SDL_SCANCODE_X // \"X\"\n\tSCANCODE_Y = C.SDL_SCANCODE_Y // \"Y\"\n\tSCANCODE_Z = C.SDL_SCANCODE_Z // \"Z\"\n\n\tSCANCODE_1 = C.SDL_SCANCODE_1 // \"1\"\n\tSCANCODE_2 = C.SDL_SCANCODE_2 // \"2\"\n\tSCANCODE_3 = C.SDL_SCANCODE_3 // \"3\"\n\tSCANCODE_4 = C.SDL_SCANCODE_4 // \"4\"\n\tSCANCODE_5 = C.SDL_SCANCODE_5 // \"5\"\n\tSCANCODE_6 = C.SDL_SCANCODE_6 // \"6\"\n\tSCANCODE_7 = C.SDL_SCANCODE_7 // \"7\"\n\tSCANCODE_8 = C.SDL_SCANCODE_8 // \"8\"\n\tSCANCODE_9 = C.SDL_SCANCODE_9 // \"9\"\n\tSCANCODE_0 = C.SDL_SCANCODE_0 // \"0\"\n\n\tSCANCODE_RETURN    = C.SDL_SCANCODE_RETURN    // \"Return\"\n\tSCANCODE_ESCAPE    = C.SDL_SCANCODE_ESCAPE    // \"Escape\" (the Esc key)\n\tSCANCODE_BACKSPACE = C.SDL_SCANCODE_BACKSPACE // \"Backspace\"\n\tSCANCODE_TAB       = C.SDL_SCANCODE_TAB       // \"Tab\" (the Tab key)\n\tSCANCODE_SPACE     = C.SDL_SCANCODE_SPACE     // \"Space\" (the Space Bar key(s))\n\n\tSCANCODE_MINUS        = C.SDL_SCANCODE_MINUS        // \"-\"\n\tSCANCODE_EQUALS       = C.SDL_SCANCODE_EQUALS       // \"=\"\n\tSCANCODE_LEFTBRACKET  = C.SDL_SCANCODE_LEFTBRACKET  // \"[\"\n\tSCANCODE_RIGHTBRACKET = C.SDL_SCANCODE_RIGHTBRACKET // \"]\"\n\tSCANCODE_BACKSLASH    = C.SDL_SCANCODE_BACKSLASH    // \"\\\"\n\tSCANCODE_NONUSHASH    = C.SDL_SCANCODE_NONUSHASH    // \"#\" (ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards.)\n\tSCANCODE_SEMICOLON    = C.SDL_SCANCODE_SEMICOLON    // \";\"\n\tSCANCODE_APOSTROPHE   = C.SDL_SCANCODE_APOSTROPHE   // \"'\"\n\tSCANCODE_GRAVE        = C.SDL_SCANCODE_GRAVE        // \"`\"\n\tSCANCODE_COMMA        = C.SDL_SCANCODE_COMMA        // \",\"\n\tSCANCODE_PERIOD       = C.SDL_SCANCODE_PERIOD       // \".\"\n\tSCANCODE_SLASH        = C.SDL_SCANCODE_SLASH        // \"/\"\n\tSCANCODE_CAPSLOCK     = C.SDL_SCANCODE_CAPSLOCK     // \"CapsLock\"\n\tSCANCODE_F1           = C.SDL_SCANCODE_F1           // \"F1\"\n\tSCANCODE_F2           = C.SDL_SCANCODE_F2           // \"F2\"\n\tSCANCODE_F3           = C.SDL_SCANCODE_F3           // \"F3\"\n\tSCANCODE_F4           = C.SDL_SCANCODE_F4           // \"F4\"\n\tSCANCODE_F5           = C.SDL_SCANCODE_F5           // \"F5\"\n\tSCANCODE_F6           = C.SDL_SCANCODE_F6           // \"F6\"\n\tSCANCODE_F7           = C.SDL_SCANCODE_F7           // \"F7\"\n\tSCANCODE_F8           = C.SDL_SCANCODE_F8           // \"F8\"\n\tSCANCODE_F9           = C.SDL_SCANCODE_F9           // \"F9\"\n\tSCANCODE_F10          = C.SDL_SCANCODE_F10          // \"F10\"\n\tSCANCODE_F11          = C.SDL_SCANCODE_F11          // \"F11\"\n\tSCANCODE_F12          = C.SDL_SCANCODE_F12          // \"F12\"\n\tSCANCODE_PRINTSCREEN  = C.SDL_SCANCODE_PRINTSCREEN  // \"PrintScreen\"\n\tSCANCODE_SCROLLLOCK   = C.SDL_SCANCODE_SCROLLLOCK   // \"ScrollLock\"\n\tSCANCODE_PAUSE        = C.SDL_SCANCODE_PAUSE        // \"Pause\" (the Pause / Break key)\n\tSCANCODE_INSERT       = C.SDL_SCANCODE_INSERT       // \"Insert\" (insert on PC, help on some Mac keyboards (but does send code 73, not 117))\n\tSCANCODE_HOME         = C.SDL_SCANCODE_HOME         // \"Home\"\n\tSCANCODE_PAGEUP       = C.SDL_SCANCODE_PAGEUP       // \"PageUp\"\n\tSCANCODE_DELETE       = C.SDL_SCANCODE_DELETE       // \"Delete\"\n\tSCANCODE_END          = C.SDL_SCANCODE_END          // \"End\"\n\tSCANCODE_PAGEDOWN     = C.SDL_SCANCODE_PAGEDOWN     // \"PageDown\"\n\tSCANCODE_RIGHT        = C.SDL_SCANCODE_RIGHT        // \"Right\" (the Right arrow key (navigation keypad))\n\tSCANCODE_LEFT         = C.SDL_SCANCODE_LEFT         // \"Left\" (the Left arrow key (navigation keypad))\n\tSCANCODE_DOWN         = C.SDL_SCANCODE_DOWN         // \"Down\" (the Down arrow key (navigation keypad))\n\tSCANCODE_UP           = C.SDL_SCANCODE_UP           // \"Up\" (the Up arrow key (navigation keypad))\n\n\tSCANCODE_NUMLOCKCLEAR = C.SDL_SCANCODE_NUMLOCKCLEAR // \"Numlock\" (the Num Lock key (PC) / the Clear key (Mac))\n\tSCANCODE_KP_DIVIDE    = C.SDL_SCANCODE_KP_DIVIDE    // \"Keypad /\" (the / key (numeric keypad))\n\tSCANCODE_KP_MULTIPLY  = C.SDL_SCANCODE_KP_MULTIPLY  // \"Keypad *\" (the * key (numeric keypad))\n\tSCANCODE_KP_MINUS     = C.SDL_SCANCODE_KP_MINUS     // \"Keypad -\" (the - key (numeric keypad))\n\tSCANCODE_KP_PLUS      = C.SDL_SCANCODE_KP_PLUS      // \"Keypad +\" (the + key (numeric keypad))\n\tSCANCODE_KP_ENTER     = C.SDL_SCANCODE_KP_ENTER     // \"Keypad Enter\" (the Enter key (numeric keypad))\n\tSCANCODE_KP_1         = C.SDL_SCANCODE_KP_1         // \"Keypad 1\" (the 1 key (numeric keypad))\n\tSCANCODE_KP_2         = C.SDL_SCANCODE_KP_2         // \"Keypad 2\" (the 2 key (numeric keypad))\n\tSCANCODE_KP_3         = C.SDL_SCANCODE_KP_3         // \"Keypad 3\" (the 3 key (numeric keypad))\n\tSCANCODE_KP_4         = C.SDL_SCANCODE_KP_4         // \"Keypad 4\" (the 4 key (numeric keypad))\n\tSCANCODE_KP_5         = C.SDL_SCANCODE_KP_5         // \"Keypad 5\" (the 5 key (numeric keypad))\n\tSCANCODE_KP_6         = C.SDL_SCANCODE_KP_6         // \"Keypad 6\" (the 6 key (numeric keypad))\n\tSCANCODE_KP_7         = C.SDL_SCANCODE_KP_7         // \"Keypad 7\" (the 7 key (numeric keypad))\n\tSCANCODE_KP_8         = C.SDL_SCANCODE_KP_8         // \"Keypad 8\" (the 8 key (numeric keypad))\n\tSCANCODE_KP_9         = C.SDL_SCANCODE_KP_9         // \"Keypad 9\" (the 9 key (numeric keypad))\n\tSCANCODE_KP_0         = C.SDL_SCANCODE_KP_0         // \"Keypad 0\" (the 0 key (numeric keypad))\n\tSCANCODE_KP_PERIOD    = C.SDL_SCANCODE_KP_PERIOD    // \"Keypad .\" (the . key (numeric keypad))\n\n\tSCANCODE_NONUSBACKSLASH = C.SDL_SCANCODE_NONUSBACKSLASH // \"\" (no name, empty string; This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout.)\n\tSCANCODE_APPLICATION    = C.SDL_SCANCODE_APPLICATION    // \"Application\" (the Application / Compose / Context Menu (Windows) key)\n\tSCANCODE_POWER          = C.SDL_SCANCODE_POWER          // \"Power\" (The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key.)\n\tSCANCODE_KP_EQUALS      = C.SDL_SCANCODE_KP_EQUALS      // \"Keypad =\" (the = key (numeric keypad))\n\tSCANCODE_F13            = C.SDL_SCANCODE_F13            // \"F13\"\n\tSCANCODE_F14            = C.SDL_SCANCODE_F14            // \"F14\"\n\tSCANCODE_F15            = C.SDL_SCANCODE_F15            // \"F15\"\n\tSCANCODE_F16            = C.SDL_SCANCODE_F16            // \"F16\"\n\tSCANCODE_F17            = C.SDL_SCANCODE_F17            // \"F17\"\n\tSCANCODE_F18            = C.SDL_SCANCODE_F18            // \"F18\"\n\tSCANCODE_F19            = C.SDL_SCANCODE_F19            // \"F19\"\n\tSCANCODE_F20            = C.SDL_SCANCODE_F20            // \"F20\"\n\tSCANCODE_F21            = C.SDL_SCANCODE_F21            // \"F21\"\n\tSCANCODE_F22            = C.SDL_SCANCODE_F22            // \"F22\"\n\tSCANCODE_F23            = C.SDL_SCANCODE_F23            // \"F23\"\n\tSCANCODE_F24            = C.SDL_SCANCODE_F24            // \"F24\"\n\tSCANCODE_EXECUTE        = C.SDL_SCANCODE_EXECUTE        // \"Execute\"\n\tSCANCODE_HELP           = C.SDL_SCANCODE_HELP           // \"Help\"\n\tSCANCODE_MENU           = C.SDL_SCANCODE_MENU           // \"Menu\"\n\tSCANCODE_SELECT         = C.SDL_SCANCODE_SELECT         // \"Select\"\n\tSCANCODE_STOP           = C.SDL_SCANCODE_STOP           // \"Stop\"\n\tSCANCODE_AGAIN          = C.SDL_SCANCODE_AGAIN          // \"Again\" (the Again key (Redo))\n\tSCANCODE_UNDO           = C.SDL_SCANCODE_UNDO           // \"Undo\"\n\tSCANCODE_CUT            = C.SDL_SCANCODE_CUT            // \"Cut\"\n\tSCANCODE_COPY           = C.SDL_SCANCODE_COPY           // \"Copy\"\n\tSCANCODE_PASTE          = C.SDL_SCANCODE_PASTE          // \"Paste\"\n\tSCANCODE_FIND           = C.SDL_SCANCODE_FIND           // \"Find\"\n\tSCANCODE_MUTE           = C.SDL_SCANCODE_MUTE           // \"Mute\"\n\tSCANCODE_VOLUMEUP       = C.SDL_SCANCODE_VOLUMEUP       // \"VolumeUp\"\n\tSCANCODE_VOLUMEDOWN     = C.SDL_SCANCODE_VOLUMEDOWN     // \"VolumeDown\"\n\tSCANCODE_KP_COMMA       = C.SDL_SCANCODE_KP_COMMA       // \"Keypad ,\" (the Comma key (numeric keypad))\n\tSCANCODE_KP_EQUALSAS400 = C.SDL_SCANCODE_KP_EQUALSAS400 // \"Keypad = (AS400)\" (the Equals AS400 key (numeric keypad))\n\n\tSCANCODE_INTERNATIONAL1 = C.SDL_SCANCODE_INTERNATIONAL1 // \"\" (no name, empty string; used on Asian keyboards, see footnotes in USB doc)\n\tSCANCODE_INTERNATIONAL2 = C.SDL_SCANCODE_INTERNATIONAL2 // \"\" (no name, empty string)\n\tSCANCODE_INTERNATIONAL3 = C.SDL_SCANCODE_INTERNATIONAL3 // \"\" (no name, empty string; Yen)\n\tSCANCODE_INTERNATIONAL4 = C.SDL_SCANCODE_INTERNATIONAL4 // \"\" (no name, empty string)\n\tSCANCODE_INTERNATIONAL5 = C.SDL_SCANCODE_INTERNATIONAL5 // \"\" (no name, empty string)\n\tSCANCODE_INTERNATIONAL6 = C.SDL_SCANCODE_INTERNATIONAL6 // \"\" (no name, empty string)\n\tSCANCODE_INTERNATIONAL7 = C.SDL_SCANCODE_INTERNATIONAL7 // \"\" (no name, empty string)\n\tSCANCODE_INTERNATIONAL8 = C.SDL_SCANCODE_INTERNATIONAL8 // \"\" (no name, empty string)\n\tSCANCODE_INTERNATIONAL9 = C.SDL_SCANCODE_INTERNATIONAL9 // \"\" (no name, empty string)\n\tSCANCODE_LANG1          = C.SDL_SCANCODE_LANG1          // \"\" (no name, empty string; Hangul/English toggle)\n\tSCANCODE_LANG2          = C.SDL_SCANCODE_LANG2          // \"\" (no name, empty string; Hanja conversion)\n\tSCANCODE_LANG3          = C.SDL_SCANCODE_LANG3          // \"\" (no name, empty string; Katakana)\n\tSCANCODE_LANG4          = C.SDL_SCANCODE_LANG4          // \"\" (no name, empty string; Hiragana)\n\tSCANCODE_LANG5          = C.SDL_SCANCODE_LANG5          // \"\" (no name, empty string; Zenkaku/Hankaku)\n\tSCANCODE_LANG6          = C.SDL_SCANCODE_LANG6          // \"\" (no name, empty string; reserved)\n\tSCANCODE_LANG7          = C.SDL_SCANCODE_LANG7          // \"\" (no name, empty string; reserved)\n\tSCANCODE_LANG8          = C.SDL_SCANCODE_LANG8          // \"\" (no name, empty string; reserved)\n\tSCANCODE_LANG9          = C.SDL_SCANCODE_LANG9          // \"\" (no name, empty string; reserved)\n\n\tSCANCODE_ALTERASE   = C.SDL_SCANCODE_ALTERASE   // \"AltErase\" (Erase-Eaze)\n\tSCANCODE_SYSREQ     = C.SDL_SCANCODE_SYSREQ     // \"SysReq\" (the SysReq key)\n\tSCANCODE_CANCEL     = C.SDL_SCANCODE_CANCEL     // \"Cancel\"\n\tSCANCODE_CLEAR      = C.SDL_SCANCODE_CLEAR      // \"Clear\"\n\tSCANCODE_PRIOR      = C.SDL_SCANCODE_PRIOR      // \"Prior\"\n\tSCANCODE_RETURN2    = C.SDL_SCANCODE_RETURN2    // \"Return\"\n\tSCANCODE_SEPARATOR  = C.SDL_SCANCODE_SEPARATOR  // \"Separator\"\n\tSCANCODE_OUT        = C.SDL_SCANCODE_OUT        // \"Out\"\n\tSCANCODE_OPER       = C.SDL_SCANCODE_OPER       // \"Oper\"\n\tSCANCODE_CLEARAGAIN = C.SDL_SCANCODE_CLEARAGAIN // \"Clear / Again\"\n\tSCANCODE_CRSEL      = C.SDL_SCANCODE_CRSEL      // \"CrSel\"\n\tSCANCODE_EXSEL      = C.SDL_SCANCODE_EXSEL      // \"ExSel\"\n\n\tSCANCODE_KP_00              = C.SDL_SCANCODE_KP_00              // \"Keypad 00\" (the 00 key (numeric keypad))\n\tSCANCODE_KP_000             = C.SDL_SCANCODE_KP_000             // \"Keypad 000\" (the 000 key (numeric keypad))\n\tSCANCODE_THOUSANDSSEPARATOR = C.SDL_SCANCODE_THOUSANDSSEPARATOR // \"ThousandsSeparator\" (the Thousands Separator key)\n\tSCANCODE_DECIMALSEPARATOR   = C.SDL_SCANCODE_DECIMALSEPARATOR   // \"DecimalSeparator\" (the Decimal Separator key)\n\tSCANCODE_CURRENCYUNIT       = C.SDL_SCANCODE_CURRENCYUNIT       // \"CurrencyUnit\" (the Currency Unit key)\n\tSCANCODE_CURRENCYSUBUNIT    = C.SDL_SCANCODE_CURRENCYSUBUNIT    // \"CurrencySubUnit\" (the Currency Subunit key)\n\tSCANCODE_KP_LEFTPAREN       = C.SDL_SCANCODE_KP_LEFTPAREN       // \"Keypad (\" (the Left Parenthesis key (numeric keypad))\n\tSCANCODE_KP_RIGHTPAREN      = C.SDL_SCANCODE_KP_RIGHTPAREN      // \"Keypad )\" (the Right Parenthesis key (numeric keypad))\n\tSCANCODE_KP_LEFTBRACE       = C.SDL_SCANCODE_KP_LEFTBRACE       // \"Keypad {\" (the Left Brace key (numeric keypad))\n\tSCANCODE_KP_RIGHTBRACE      = C.SDL_SCANCODE_KP_RIGHTBRACE      // \"Keypad }\" (the Right Brace key (numeric keypad))\n\tSCANCODE_KP_TAB             = C.SDL_SCANCODE_KP_TAB             // \"Keypad Tab\" (the Tab key (numeric keypad))\n\tSCANCODE_KP_BACKSPACE       = C.SDL_SCANCODE_KP_BACKSPACE       // \"Keypad Backspace\" (the Backspace key (numeric keypad))\n\tSCANCODE_KP_A               = C.SDL_SCANCODE_KP_A               // \"Keypad A\" (the A key (numeric keypad))\n\tSCANCODE_KP_B               = C.SDL_SCANCODE_KP_B               // \"Keypad B\" (the B key (numeric keypad))\n\tSCANCODE_KP_C               = C.SDL_SCANCODE_KP_C               // \"Keypad C\" (the C key (numeric keypad))\n\tSCANCODE_KP_D               = C.SDL_SCANCODE_KP_D               // \"Keypad D\" (the D key (numeric keypad))\n\tSCANCODE_KP_E               = C.SDL_SCANCODE_KP_E               // \"Keypad E\" (the E key (numeric keypad))\n\tSCANCODE_KP_F               = C.SDL_SCANCODE_KP_F               // \"Keypad F\" (the F key (numeric keypad))\n\tSCANCODE_KP_XOR             = C.SDL_SCANCODE_KP_XOR             // \"Keypad XOR\" (the XOR key (numeric keypad))\n\tSCANCODE_KP_POWER           = C.SDL_SCANCODE_KP_POWER           // \"Keypad ^\" (the Power key (numeric keypad))\n\tSCANCODE_KP_PERCENT         = C.SDL_SCANCODE_KP_PERCENT         // \"Keypad %\" (the Percent key (numeric keypad))\n\tSCANCODE_KP_LESS            = C.SDL_SCANCODE_KP_LESS            // \"Keypad <\" (the Less key (numeric keypad))\n\tSCANCODE_KP_GREATER         = C.SDL_SCANCODE_KP_GREATER         // \"Keypad >\" (the Greater key (numeric keypad))\n\tSCANCODE_KP_AMPERSAND       = C.SDL_SCANCODE_KP_AMPERSAND       // \"Keypad &\" (the & key (numeric keypad))\n\tSCANCODE_KP_DBLAMPERSAND    = C.SDL_SCANCODE_KP_DBLAMPERSAND    // \"Keypad &&\" (the && key (numeric keypad))\n\tSCANCODE_KP_VERTICALBAR     = C.SDL_SCANCODE_KP_VERTICALBAR     // \"Keypad |\" (the | key (numeric keypad))\n\tSCANCODE_KP_DBLVERTICALBAR  = C.SDL_SCANCODE_KP_DBLVERTICALBAR  // \"Keypad ||\" (the || key (numeric keypad))\n\tSCANCODE_KP_COLON           = C.SDL_SCANCODE_KP_COLON           // \"Keypad :\" (the : key (numeric keypad))\n\tSCANCODE_KP_HASH            = C.SDL_SCANCODE_KP_HASH            // \"Keypad #\" (the # key (numeric keypad))\n\tSCANCODE_KP_SPACE           = C.SDL_SCANCODE_KP_SPACE           // \"Keypad Space\" (the Space key (numeric keypad))\n\tSCANCODE_KP_AT              = C.SDL_SCANCODE_KP_AT              // \"Keypad @\" (the @ key (numeric keypad))\n\tSCANCODE_KP_EXCLAM          = C.SDL_SCANCODE_KP_EXCLAM          // \"Keypad !\" (the ! key (numeric keypad))\n\tSCANCODE_KP_MEMSTORE        = C.SDL_SCANCODE_KP_MEMSTORE        // \"Keypad MemStore\" (the Mem Store key (numeric keypad))\n\tSCANCODE_KP_MEMRECALL       = C.SDL_SCANCODE_KP_MEMRECALL       // \"Keypad MemRecall\" (the Mem Recall key (numeric keypad))\n\tSCANCODE_KP_MEMCLEAR        = C.SDL_SCANCODE_KP_MEMCLEAR        // \"Keypad MemClear\" (the Mem Clear key (numeric keypad))\n\tSCANCODE_KP_MEMADD          = C.SDL_SCANCODE_KP_MEMADD          // \"Keypad MemAdd\" (the Mem Add key (numeric keypad))\n\tSCANCODE_KP_MEMSUBTRACT     = C.SDL_SCANCODE_KP_MEMSUBTRACT     // \"Keypad MemSubtract\" (the Mem Subtract key (numeric keypad))\n\tSCANCODE_KP_MEMMULTIPLY     = C.SDL_SCANCODE_KP_MEMMULTIPLY     // \"Keypad MemMultiply\" (the Mem Multiply key (numeric keypad))\n\tSCANCODE_KP_MEMDIVIDE       = C.SDL_SCANCODE_KP_MEMDIVIDE       // \"Keypad MemDivide\" (the Mem Divide key (numeric keypad))\n\tSCANCODE_KP_PLUSMINUS       = C.SDL_SCANCODE_KP_PLUSMINUS       // \"Keypad +/-\" (the +/- key (numeric keypad))\n\tSCANCODE_KP_CLEAR           = C.SDL_SCANCODE_KP_CLEAR           // \"Keypad Clear\" (the Clear key (numeric keypad))\n\tSCANCODE_KP_CLEARENTRY      = C.SDL_SCANCODE_KP_CLEARENTRY      // \"Keypad ClearEntry\" (the Clear Entry key (numeric keypad))\n\tSCANCODE_KP_BINARY          = C.SDL_SCANCODE_KP_BINARY          // \"Keypad Binary\" (the Binary key (numeric keypad))\n\tSCANCODE_KP_OCTAL           = C.SDL_SCANCODE_KP_OCTAL           // \"Keypad Octal\" (the Octal key (numeric keypad))\n\tSCANCODE_KP_DECIMAL         = C.SDL_SCANCODE_KP_DECIMAL         // \"Keypad Decimal\" (the Decimal key (numeric keypad))\n\tSCANCODE_KP_HEXADECIMAL     = C.SDL_SCANCODE_KP_HEXADECIMAL     // \"Keypad Hexadecimal\" (the Hexadecimal key (numeric keypad))\n\n\tSCANCODE_LCTRL          = C.SDL_SCANCODE_LCTRL          // \"Left Ctrl\"\n\tSCANCODE_LSHIFT         = C.SDL_SCANCODE_LSHIFT         // \"Left Shift\"\n\tSCANCODE_LALT           = C.SDL_SCANCODE_LALT           // \"Left Alt\" (alt, option)\n\tSCANCODE_LGUI           = C.SDL_SCANCODE_LGUI           // \"Left GUI\" (windows, command (apple), meta)\n\tSCANCODE_RCTRL          = C.SDL_SCANCODE_RCTRL          // \"Right Ctrl\"\n\tSCANCODE_RSHIFT         = C.SDL_SCANCODE_RSHIFT         // \"Right Shift\"\n\tSCANCODE_RALT           = C.SDL_SCANCODE_RALT           // \"Right Alt\" (alt gr, option)\n\tSCANCODE_RGUI           = C.SDL_SCANCODE_RGUI           // \"Right GUI\" (windows, command (apple), meta)\n\tSCANCODE_MODE           = C.SDL_SCANCODE_MODE           // \"ModeSwitch\" (I'm not sure if this is really not covered by any of the above, but since there's a special KMOD_MODE for it I'm adding it here)\n\tSCANCODE_AUDIONEXT      = C.SDL_SCANCODE_AUDIONEXT      // \"AudioNext\" (the Next Track media key)\n\tSCANCODE_AUDIOPREV      = C.SDL_SCANCODE_AUDIOPREV      // \"AudioPrev\" (the Previous Track media key)\n\tSCANCODE_AUDIOSTOP      = C.SDL_SCANCODE_AUDIOSTOP      // \"AudioStop\" (the Stop media key)\n\tSCANCODE_AUDIOPLAY      = C.SDL_SCANCODE_AUDIOPLAY      // \"AudioPlay\" (the Play media key)\n\tSCANCODE_AUDIOMUTE      = C.SDL_SCANCODE_AUDIOMUTE      // \"AudioMute\" (the Mute volume key)\n\tSCANCODE_MEDIASELECT    = C.SDL_SCANCODE_MEDIASELECT    // \"MediaSelect\" (the Media Select key)\n\tSCANCODE_WWW            = C.SDL_SCANCODE_WWW            // \"WWW\" (the WWW/World Wide Web key)\n\tSCANCODE_MAIL           = C.SDL_SCANCODE_MAIL           // \"Mail\" (the Mail/eMail key)\n\tSCANCODE_CALCULATOR     = C.SDL_SCANCODE_CALCULATOR     // \"Calculator\" (the Calculator key)\n\tSCANCODE_COMPUTER       = C.SDL_SCANCODE_COMPUTER       // \"Computer\" (the My Computer key)\n\tSCANCODE_AC_SEARCH      = C.SDL_SCANCODE_AC_SEARCH      // \"AC Search\" (the Search key (application control keypad))\n\tSCANCODE_AC_HOME        = C.SDL_SCANCODE_AC_HOME        // \"AC Home\" (the Home key (application control keypad))\n\tSCANCODE_AC_BACK        = C.SDL_SCANCODE_AC_BACK        // \"AC Back\" (the Back key (application control keypad))\n\tSCANCODE_AC_FORWARD     = C.SDL_SCANCODE_AC_FORWARD     // \"AC Forward\" (the Forward key (application control keypad))\n\tSCANCODE_AC_STOP        = C.SDL_SCANCODE_AC_STOP        // \"AC Stop\" (the Stop key (application control keypad))\n\tSCANCODE_AC_REFRESH     = C.SDL_SCANCODE_AC_REFRESH     // \"AC Refresh\" (the Refresh key (application control keypad))\n\tSCANCODE_AC_BOOKMARKS   = C.SDL_SCANCODE_AC_BOOKMARKS   // \"AC Bookmarks\" (the Bookmarks key (application control keypad))\n\tSCANCODE_BRIGHTNESSDOWN = C.SDL_SCANCODE_BRIGHTNESSDOWN // \"BrightnessDown\" (the Brightness Down key)\n\tSCANCODE_BRIGHTNESSUP   = C.SDL_SCANCODE_BRIGHTNESSUP   // \"BrightnessUp\" (the Brightness Up key)\n\tSCANCODE_DISPLAYSWITCH  = C.SDL_SCANCODE_DISPLAYSWITCH  // \"DisplaySwitch\" (display mirroring/dual display switch, video mode switch)\n\tSCANCODE_KBDILLUMTOGGLE = C.SDL_SCANCODE_KBDILLUMTOGGLE // \"KBDIllumToggle\" (the Keyboard Illumination Toggle key)\n\tSCANCODE_KBDILLUMDOWN   = C.SDL_SCANCODE_KBDILLUMDOWN   // \"KBDIllumDown\" (the Keyboard Illumination Down key)\n\tSCANCODE_KBDILLUMUP     = C.SDL_SCANCODE_KBDILLUMUP     // \"KBDIllumUp\" (the Keyboard Illumination Up key)\n\tSCANCODE_EJECT          = C.SDL_SCANCODE_EJECT          // \"Eject\" (the Eject key)\n\tSCANCODE_SLEEP          = C.SDL_SCANCODE_SLEEP          // \"Sleep\" (the Sleep key)\n\tSCANCODE_APP1           = C.SDL_SCANCODE_APP1\n\tSCANCODE_APP2           = C.SDL_SCANCODE_APP2\n\tNUM_SCANCODES           = C.SDL_NUM_SCANCODES\n)\n\n// Scancode is an SDL keyboard scancode representation.\n// (https://wiki.libsdl.org/SDL_Scancode)\ntype Scancode uint32\n\nfunc (code Scancode) c() C.SDL_Scancode {\n\treturn C.SDL_Scancode(code)\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/sdl.go",
    "content": "// Package sdl is SDL2 wrapped for Go users. It enables interoperability between Go and the SDL2 library which is written in C. That means the original SDL2 installation is required for this to work. SDL2 is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.\npackage sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,9))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_INIT_SENSOR is not supported before SDL 2.0.9\")\n#endif\n\n#define SDL_INIT_SENSOR (0x00008000u)\n#endif\n*/\nimport \"C\"\n\nimport (\n\t\"runtime\"\n)\n\n// These are the flags which may be passed to SDL_Init().\n// (https://wiki.libsdl.org/SDL_Init)\nconst (\n\tINIT_TIMER          = C.SDL_INIT_TIMER          // timer subsystem\n\tINIT_AUDIO          = C.SDL_INIT_AUDIO          // audio subsystem\n\tINIT_VIDEO          = C.SDL_INIT_VIDEO          // video subsystem; automatically initializes the events subsystem\n\tINIT_JOYSTICK       = C.SDL_INIT_JOYSTICK       // joystick subsystem; automatically initializes the events subsystem\n\tINIT_HAPTIC         = C.SDL_INIT_HAPTIC         // haptic (force feedback) subsystem\n\tINIT_GAMECONTROLLER = C.SDL_INIT_GAMECONTROLLER // controller subsystem; automatically initializes the joystick subsystem\n\tINIT_EVENTS         = C.SDL_INIT_EVENTS         // events subsystem\n\tINIT_NOPARACHUTE    = C.SDL_INIT_NOPARACHUTE    // compatibility; this flag is ignored\n\tINIT_SENSOR         = C.SDL_INIT_SENSOR         // sensor subsystem\n\tINIT_EVERYTHING     = C.SDL_INIT_EVERYTHING     // all of the above subsystems\n)\n\nconst (\n\tRELEASED = 0\n\tPRESSED  = 1\n)\n\n// Calls a function in the main thread. It is only properly initialized inside\n// sdl.Main(..). As a default, it panics. It is used by sdl.Do(..) below.\nvar callInMain = func(f func()) {\n\tpanic(\"sdl.Main(main func()) must be called before sdl.Do(f func())\")\n}\n\nfunc init() {\n\t// Make sure the main goroutine is bound to the main thread.\n\truntime.LockOSThread()\n}\n\n// Main entry point. Run this function at the beginning of main(), and pass your\n// own main body to it as a function. E.g.:\n//\n// \tfunc main() {\n// \t\tsdl.Main(func() {\n// \t\t\t// Your code here....\n// \t\t\t// [....]\n//\n// \t\t\t// Calls to SDL can be made by any goroutine, but always guarded by sdl.Do()\n// \t\t\tsdl.Do(func() {\n// \t\t\t\tsdl.Init(0)\n// \t\t\t})\n// \t\t})\n// \t}\n//\n// Avoid calling functions like os.Exit(..) within your passed-in function since\n// they don't respect deferred calls. Instead, do this:\n//\n// \tfunc main() {\n// \t\tvar exitcode int\n// \t\tsdl.Main(func() {\n// \t\t\texitcode = run()) // assuming run has signature func() int\n// \t\t})\n// \t\tos.Exit(exitcode)\n// \t}\nfunc Main(main func()) {\n\t// Queue of functions that are thread-sensitive\n\tcallQueue := make(chan func())\n\n\t// Properly initialize callInMain for use by sdl.Do(..)\n\tcallInMain = func(f func()) {\n\t\tdone := make(chan bool, 1)\n\t\tcallQueue <- func() {\n\t\t\tf()\n\t\t\tdone <- true\n\t\t}\n\t\t<-done\n\t}\n\n\tgo func() {\n\t\tmain()\n\t\t// fmt.Println(\"END\") // to check if os.Exit(..) is called by main() above\n\t\tclose(callQueue)\n\t}()\n\n\tfor f := range callQueue {\n\t\tf()\n\t}\n}\n\n// Do the specified function in the main thread.\n// For this function to work, you must have correctly used sdl.Main(..) in your\n// main() function. Calling this function before/without sdl.Main(..) will cause\n// a panic.\nfunc Do(f func()) {\n\tcallInMain(f)\n}\n\n// Init initialize the SDL library. This must be called before using most other SDL functions.\n// (https://wiki.libsdl.org/SDL_Init)\nfunc Init(flags uint32) error {\n\tif C.SDL_Init(C.Uint32(flags)) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Quit cleans up all initialized subsystems. You should call it upon all exit conditions.\n// (https://wiki.libsdl.org/SDL_Quit)\nfunc Quit() {\n\tC.SDL_Quit()\n\n\teventFilterCache = nil\n\tfor k := range eventWatches {\n\t\tdelete(eventWatches, k)\n\t}\n}\n\n// InitSubSystem initializes specific SDL subsystems.\n// (https://wiki.libsdl.org/SDL_InitSubSystem)\nfunc InitSubSystem(flags uint32) error {\n\tif C.SDL_InitSubSystem(C.Uint32(flags)) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// QuitSubSystem shuts down specific SDL subsystems.\n// (https://wiki.libsdl.org/SDL_QuitSubSystem)\nfunc QuitSubSystem(flags uint32) {\n\tC.SDL_QuitSubSystem(C.Uint32(flags))\n}\n\n// WasInit returns a mask of the specified subsystems which have previously been initialized.\n// (https://wiki.libsdl.org/SDL_WasInit)\nfunc WasInit(flags uint32) uint32 {\n\treturn uint32(C.SDL_WasInit(C.Uint32(flags)))\n}\n\n// GetPlatform returns the name of the platform.\n// (https://wiki.libsdl.org/SDL_GetPlatform)\nfunc GetPlatform() string {\n\treturn string(C.GoString(C.SDL_GetPlatform()))\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/sdl_cgo.go",
    "content": "// +build !static\n\npackage sdl\n\n//#cgo windows LDFLAGS: -lSDL2\n//#cgo linux freebsd darwin openbsd pkg-config: sdl2\nimport \"C\"\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/sdl_cgo_static.go",
    "content": "// +build static\n\npackage sdl\n\n//#cgo CFLAGS: -I${SRCDIR}/../_libs/include -I${SRCDIR}/../_libs/include/SDL2\n//#cgo LDFLAGS: -L${SRCDIR}/../_libs\n//#cgo linux,386 LDFLAGS: -lSDL2_linux_386 -lm -ldl -lasound -lm -ldl -lpthread -lX11 -lXext -lXcursor -lXinerama -lXi -lXrandr -lXss -lXxf86vm -lpthread -lrt\n//#cgo linux,amd64 LDFLAGS: -lSDL2_linux_amd64 -lm -ldl -lasound -lm -ldl -lpthread -lX11 -lXext -lXcursor -lXinerama -lXi -lXrandr -lXss -lXxf86vm -lpthread -lrt\n//#cgo windows,386 LDFLAGS: -lSDL2_windows_386 -lSDL2main_windows_386 -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid -static-libgcc\n//#cgo windows,amd64 LDFLAGS: -lSDL2_windows_amd64 -lSDL2main_windows_amd64 -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -lsetupapi -static-libgcc\n//#cgo darwin,amd64 LDFLAGS: -lSDL2_darwin_amd64 -lm -liconv -Wl,-framework,OpenGL -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,ForceFeedback -lobjc -Wl,-framework,CoreVideo -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,IOKit -Wl,-framework,Metal\n//#cgo darwin,arm64 LDFLAGS: -lSDL2_darwin_arm64 -lm -liconv -Wl,-framework,OpenGL -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,ForceFeedback -lobjc -Wl,-framework,CoreVideo -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,IOKit -Wl,-framework,Metal\n//#cgo android,arm LDFLAGS: -lSDL2_android_arm -lm -ldl -llog -landroid -lGLESv2 -lGLESv1_CM\n//#cgo linux,arm,!android LDFLAGS: -L/opt/vc/lib -L/opt/vc/lib64 -lSDL2_linux_arm -lm -ldl -liconv -lbcm_host -lvcos -lvchiq_arm -pthread\nimport \"C\"\nimport (\n       _ \"github.com/veandco/go-sdl2/_libs\"\n       _ \"github.com/veandco/go-sdl2/_libs\"\n)\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/sdl_wrapper.h",
    "content": "#if defined(_WIN32)\n\t#include <SDL2/SDL.h>\n\t#include <stdlib.h>\n#else\n\t#include <SDL.h>\n#endif\n\n#if !defined(SDL_2_0_10)\n#define SDL_2_0_10\n\n#if !(SDL_VERSION_ATLEAST(2,0,10))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_FPoint is not supported before SDL 2.0.10\")\n#endif\n\ntypedef struct SDL_FPoint\n{\n    float x;\n    float y;\n} SDL_FPoint;\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_FRect is not supported before SDL 2.0.10\")\n#endif\n\ntypedef struct SDL_FRect\n{\n    float x;\n    float y;\n    float w;\n    float h;\n} SDL_FRect;\n\n\n#endif\n\n#endif\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/sensor.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,9))\ntypedef struct _SDL_Sensor SDL_Sensor;\n\ntypedef Sint32 SDL_SensorID;\n\ntypedef enum\n{\n    SDL_SENSOR_INVALID = -1,\n    SDL_SENSOR_UNKNOWN,\n    SDL_SENSOR_ACCEL,\n    SDL_SENSOR_GYRO\n} SDL_SensorType;\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_NumSensors is not supported before SDL 2.0.9\")\n#endif\n\nstatic inline int SDL_NumSensors()\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorGetDeviceName is not supported before SDL 2.0.9\")\n#endif\n\nstatic const char * SDL_SensorGetDeviceName(int device_index)\n{\n\treturn NULL;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorGetDeviceType is not supported before SDL 2.0.9\")\n#endif\n\nstatic SDL_SensorType SDL_SensorGetDeviceType(int device_index)\n{\n\treturn SDL_SENSOR_INVALID;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorGetDeviceNonPortableType is not supported before SDL 2.0.9\")\n#endif\n\nstatic int SDL_SensorGetDeviceNonPortableType(int device_index)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorGetDeviceInstanceID is not supported before SDL 2.0.9\")\n#endif\n\nstatic SDL_SensorID SDL_SensorGetDeviceInstanceID(int device_index)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorOpen is not supported before SDL 2.0.9\")\n#endif\n\nstatic SDL_Sensor * SDL_SensorOpen(int device_index)\n{\n\treturn NULL;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorFromInstanceID is not supported before SDL 2.0.9\")\n#endif\n\nstatic SDL_Sensor * SDL_SensorFromInstanceID(SDL_SensorID instance_id)\n{\n\treturn NULL;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorGetName is not supported before SDL 2.0.9\")\n#endif\n\nstatic const char * SDL_SensorGetName(SDL_Sensor *sensor)\n{\n\treturn NULL;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorGetType is not supported before SDL 2.0.9\")\n#endif\n\nstatic SDL_SensorType SDL_SensorGetType(SDL_Sensor *sensor)\n{\n\treturn SDL_SENSOR_INVALID;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorGetNonPortableType is not supported before SDL 2.0.9\")\n#endif\n\nstatic int SDL_SensorGetNonPortableType(SDL_Sensor *sensor)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorGetInstanceID is not supported before SDL 2.0.9\")\n#endif\n\nstatic SDL_SensorID SDL_SensorGetInstanceID(SDL_Sensor *sensor)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorGetData is not supported before SDL 2.0.9\")\n#endif\n\nstatic int SDL_SensorGetData(SDL_Sensor *sensor, float *data, int num_values)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorClose is not supported before SDL 2.0.9\")\n#endif\n\nstatic void SDL_SensorClose(SDL_Sensor *sensor)\n{\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SensorUpdate is not supported before SDL 2.0.9\")\n#endif\n\nstatic void SDL_SensorUpdate()\n{\n}\n#endif\n*/\nimport \"C\"\nimport \"unsafe\"\n\nconst (\n\tSTANDARD_GRAVITY = 9.80665\n)\n\n// The different sensors defined by SDL\n//\n// Additional sensors may be available, using platform dependent semantics.\n//\n// Here are the additional Android sensors:\n// https://developer.android.com/reference/android/hardware/SensorEvent.html#values\nconst (\n\tSENSOR_INVALID SensorType = C.SDL_SENSOR_INVALID // Returned for an invalid sensor\n\tSENSOR_UNKNOWN SensorType = C.SDL_SENSOR_UNKNOWN // Unknown sensor type\n\tSENSOR_ACCEL   SensorType = C.SDL_SENSOR_ACCEL   // Accelerometer\n\tSENSOR_GYRO    SensorType = C.SDL_SENSOR_GYRO    // Gyroscope\n)\n\ntype Sensor C.SDL_Sensor\ntype SensorID int32\ntype SensorType int\n\n// NumSensors counts the number of sensors attached to the system right now\n// (https://wiki.libsdl.org/SDL_NumSensors)\nfunc NumSensors() int {\n\treturn int(C.SDL_NumSensors())\n}\n\n// SensorGetDeviceName gets the implementation dependent name of a sensor.\n//\n// This can be called before any sensors are opened.\n//\n// Returns the sensor name, or empty string if deviceIndex is out of range.\n// (https://wiki.libsdl.org/SDL_SensorGetDeviceName)\nfunc SensorGetDeviceName(deviceIndex int) (name string) {\n\tname = C.GoString(C.SDL_SensorGetDeviceName(C.int(deviceIndex)))\n\treturn\n}\n\n//  SensorGetDeviceType gets the type of a sensor.\n//\n//  This can be called before any sensors are opened.\n//\n//  Returns the sensor type, or SDL_SENSOR_INVALID if deviceIndex is out of range.\n// (https://wiki.libsdl.org/SDL_SensorGetDeviceType)\nfunc SensorGetDeviceType(deviceIndex int) (typ SensorType) {\n\ttyp = SensorType(C.SDL_SensorGetDeviceType(C.int(deviceIndex)))\n\treturn\n}\n\n// SensorGetDeviceNonPortableType gets the platform dependent type of a sensor.\n//\n// This can be called before any sensors are opened.\n//\n// Returns the sensor platform dependent type, or -1 if deviceIndex is out of range.\n// (https://wiki.libsdl.org/SDL_SensorGetDeviceNonPortableType)\nfunc SensorGetDeviceNonPortableType(deviceIndex int) (typ int) {\n\ttyp = int(C.SDL_SensorGetDeviceNonPortableType(C.int(deviceIndex)))\n\treturn\n}\n\n// SensorGetDeviceInstanceID gets the instance ID of a sensor.\n//\n// This can be called before any sensors are opened.\n//\n// Returns the sensor instance ID, or -1 if deviceIndex is out of range.\n// (https://wiki.libsdl.org/SDL_SensorGetDeviceInstanceID)\nfunc SensorGetDeviceInstanceID(deviceIndex int) (id SensorID) {\n\tid = SensorID(C.SDL_SensorGetDeviceInstanceID(C.int(deviceIndex)))\n\treturn\n}\n\n// SensorOpen opens a sensor for use.\n//\n// The index passed as an argument refers to the N'th sensor on the system.\n//\n// Returns a sensor identifier, or nil if an error occurred.\n// (https://wiki.libsdl.org/SDL_SensorOpen)\nfunc SensorOpen(deviceIndex int) (sensor *Sensor) {\n\tsensor = (*Sensor)(unsafe.Pointer(C.SDL_SensorOpen(C.int(deviceIndex))))\n\treturn\n}\n\n// SensorFromInstanceID returns the Sensor associated with an instance id.\n// (https://wiki.libsdl.org/SDL_SensorFromInstanceID)\nfunc SensorFromInstanceID(id SensorID) (sensor *Sensor) {\n\tsensor = (*Sensor)(unsafe.Pointer(C.SDL_SensorFromInstanceID(C.SDL_SensorID(id))))\n\treturn\n}\n\n// GetName gets the implementation dependent name of a sensor.\n//\n// Returns the sensor name, or empty string if the sensor is nil.\n// (https://wiki.libsdl.org/SDL_SensorGetName)\nfunc (sensor *Sensor) GetName() (name string) {\n\tname = C.GoString(C.SDL_SensorGetName((*C.SDL_Sensor)(sensor)))\n\treturn\n}\n\n// GetType gets the type of a sensor.\n//\n// This can be called before any sensors are opened.\n//\n// Returns the sensor type, or SENSOR_INVALID if the sensor is nil.\n// (https://wiki.libsdl.org/SDL_SensorGetType)\nfunc (sensor *Sensor) GetType() (typ SensorType) {\n\ttyp = SensorType(C.SDL_SensorGetType((*C.SDL_Sensor)(sensor)))\n\treturn\n}\n\n// GetNonPortableType gets the platform dependent type of a sensor.\n//\n// This can be called before any sensors are opened.\n//\n// Returns the sensor platform dependent type, or -1 if the sensor is nil.\n// (https://wiki.libsdl.org/SDL_SensorGetNonPortableType)\nfunc (sensor *Sensor) GetNonPortableType() (typ int) {\n\ttyp = int(C.SDL_SensorGetNonPortableType((*C.SDL_Sensor)(sensor)))\n\treturn\n}\n\n// GetInstanceID gets the instance ID of a sensor.\n//\n// This can be called before any sensors are opened.\n//\n// Returns the sensor instance ID, or -1 if the sensor is nil.\n// (https://wiki.libsdl.org/SDL_SensorGetInstanceID)\nfunc (sensor *Sensor) GetInstanceID() (id SensorID) {\n\tid = SensorID(C.SDL_SensorGetInstanceID((*C.SDL_Sensor)(sensor)))\n\treturn\n}\n\n// GetData gets the current state of an opened sensor.\n//\n// The number of values and interpretation of the data is sensor dependent.\n// (https://wiki.libsdl.org/SDL_SensorGetData)\nfunc (sensor *Sensor) GetData(data []float32) (err error) {\n\tif data == nil {\n\t\treturn nil\n\t}\n\t_data := (*C.float)(unsafe.Pointer(&data[0]))\n\t_numValues := C.int(len(data))\n\terr = errorFromInt(int(C.SDL_SensorGetData((*C.SDL_Sensor)(sensor), _data, _numValues)))\n\treturn\n}\n\n// Close closes a sensor previously opened with SensorOpen()\n// (https://wiki.libsdl.org/SDL_SensorClose)\nfunc (sensor *Sensor) Close() {\n\tC.SDL_SensorClose((*C.SDL_Sensor)(sensor))\n}\n\n// SensorUpdate updates the current state of the open sensors.\n//\n// This is called automatically by the event loop if sensor events are enabled.\n//\n// This needs to be called from the thread that initialized the sensor subsystem.\n// (https://wiki.libsdl.org/SDL_SensorUpdate)\nfunc SensorUpdate() {\n\tC.SDL_SensorUpdate()\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/shape.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n// until SDL 2.0.6 SDL_shape.h was not included in SDL.h\n#if !(SDL_VERSION_ATLEAST(2,0,6))\n#if defined(_WIN32)\n\t#include <SDL2/SDL_shape.h>\n#else\n\t#include <SDL_shape.h>\n#endif\n#endif\n*/\nimport \"C\"\nimport \"unsafe\"\n\nconst (\n\tNONSHAPEABLE_WINDOW    = C.SDL_NONSHAPEABLE_WINDOW\n\tINVALID_SHAPE_ARGUMENT = C.SDL_INVALID_SHAPE_ARGUMENT\n\tWINDOW_LACKS_SHAPE     = C.SDL_WINDOW_LACKS_SHAPE\n)\n\ntype WindowShapeModeKind C.WindowShapeMode\n\nconst (\n\tShapeModeDefaultKind              WindowShapeModeKind = C.ShapeModeDefault              // the default mode, a binarized alpha cutoff of 1\n\tShapeModeBinarizeAlphaKind        WindowShapeModeKind = C.ShapeModeBinarizeAlpha        // a binarized alpha cutoff with a given integer value\n\tShapeModeReverseBinarizeAlphaKind WindowShapeModeKind = C.ShapeModeReverseBinarizeAlpha // a binarized alpha cutoff with a given integer value, but with the opposite comparison\n\tShapeModeColorKeyKind             WindowShapeModeKind = C.ShapeModeColorKey             // a color key is applied\n)\n\nfunc SHAPEMODEALPHA(mode WindowShapeModeKind) bool {\n\treturn (mode == ShapeModeDefaultKind ||\n\t\tmode == ShapeModeBinarizeAlphaKind ||\n\t\tmode == ShapeModeReverseBinarizeAlphaKind)\n}\n\n// A union containing parameters for shaped windows\n// uint8 or Color\ntype cWindowShapeParams C.SDL_WindowShapeParams\n\ntype cWindowShapeMode struct {\n\tmode       WindowShapeModeKind\n\tparameters cWindowShapeParams\n}\n\ntype WindowShapeMode interface {\n\tMode() WindowShapeModeKind\n\tcWSM() cWindowShapeMode\n}\n\ntype ShapeModeDefault struct{}\n\nfunc (smd ShapeModeDefault) Mode() WindowShapeModeKind {\n\treturn ShapeModeDefaultKind\n}\n\nfunc (smd ShapeModeDefault) cWSM() cWindowShapeMode {\n\treturn cWindowShapeMode{\n\t\tmode:       ShapeModeDefaultKind,\n\t\tparameters: [4]uint8{1, 0, 0, 0},\n\t}\n}\n\ntype ShapeModeBinarizeAlpha struct {\n\tCutoff uint8\n}\n\nfunc (smba ShapeModeBinarizeAlpha) Mode() WindowShapeModeKind {\n\treturn ShapeModeBinarizeAlphaKind\n}\n\nfunc (smba ShapeModeBinarizeAlpha) cWSM() cWindowShapeMode {\n\treturn cWindowShapeMode{\n\t\tmode:       ShapeModeBinarizeAlphaKind,\n\t\tparameters: [4]uint8{smba.Cutoff, 0, 0, 0},\n\t}\n}\n\ntype ShapeModeReverseBinarizeAlpha struct {\n\tCutoff uint8\n}\n\nfunc (smba ShapeModeReverseBinarizeAlpha) Mode() WindowShapeModeKind {\n\treturn ShapeModeReverseBinarizeAlphaKind\n}\n\nfunc (smba ShapeModeReverseBinarizeAlpha) cWSM() cWindowShapeMode {\n\treturn cWindowShapeMode{\n\t\tmode:       ShapeModeReverseBinarizeAlphaKind,\n\t\tparameters: [4]uint8{smba.Cutoff, 0, 0, 0},\n\t}\n}\n\ntype ShapeModeColorKey struct {\n\tColor Color\n}\n\nfunc (smck ShapeModeColorKey) Mode() WindowShapeModeKind {\n\treturn ShapeModeColorKeyKind\n}\n\nfunc (smck ShapeModeColorKey) cWSM() cWindowShapeMode {\n\treturn cWindowShapeMode{\n\t\tmode:       ShapeModeReverseBinarizeAlphaKind,\n\t\tparameters: [4]uint8{smck.Color.R, smck.Color.G, smck.Color.B, smck.Color.A},\n\t}\n}\n\nfunc (cwsm cWindowShapeMode) goWSM() WindowShapeMode {\n\tswitch cwsm.mode {\n\tcase ShapeModeDefaultKind:\n\t\treturn ShapeModeDefault{}\n\n\tcase ShapeModeBinarizeAlphaKind:\n\t\treturn ShapeModeBinarizeAlpha{\n\t\t\tCutoff: ([4]uint8)(cwsm.parameters)[0],\n\t\t}\n\n\tcase ShapeModeReverseBinarizeAlphaKind:\n\t\treturn ShapeModeReverseBinarizeAlpha{\n\t\t\tCutoff: ([4]uint8)(cwsm.parameters)[0],\n\t\t}\n\n\tcase ShapeModeColorKeyKind:\n\t\treturn ShapeModeColorKey{\n\t\t\tColor: Color{\n\t\t\t\tR: ([4]uint8)(cwsm.parameters)[0],\n\t\t\t\tG: ([4]uint8)(cwsm.parameters)[1],\n\t\t\t\tB: ([4]uint8)(cwsm.parameters)[2],\n\t\t\t\tA: ([4]uint8)(cwsm.parameters)[3],\n\t\t\t},\n\t\t}\n\n\tdefault:\n\t\tpanic(\"Unknown WindowShapeModeKind\")\n\n\t}\n}\n\nfunc (wsm *cWindowShapeMode) cptr() *C.SDL_WindowShapeMode {\n\treturn (*C.SDL_WindowShapeMode)(unsafe.Pointer(wsm))\n}\n\n// CreateShapedWindow creates a window that can be shaped with the specified position, dimensions, and flags\n// (https://wiki.libsdl.org/SDL_CreateShapedWindow)\nfunc CreateShapedWindow(title string, x, y, w, h uint32, flags uint32) (*Window, error) {\n\tvar _window = C.SDL_CreateShapedWindow(C.CString(title), C.uint(x), C.uint(y), C.uint(w), C.uint(h), C.Uint32(flags))\n\tif _window == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Window)(unsafe.Pointer(_window)), nil\n}\n\n// IsShapedWindow returns whether the given window is a shaped window.\n// (https://wiki.libsdl.org/SDL_IsShapedWindow)\nfunc (window *Window) IsShaped() bool {\n\treturn (C.SDL_IsShapedWindow(window.cptr()) & 1) == 1\n}\n\n// SetShape sets the shape and parameters of a shaped window\n// (https://wiki.libsdl.org/SDL_SetWindowShape)\nfunc (window *Window) SetShape(shape *Surface, shape_mode WindowShapeMode) int32 {\n\tif shape_mode == nil {\n\t\tpanic(\"shape_mode can not be nil\")\n\t}\n\tvar _cWSM cWindowShapeMode = shape_mode.cWSM()\n\n\treturn (int32)(C.SDL_SetWindowShape(window.cptr(), shape.cptr(), _cWSM.cptr()))\n}\n\n// GetShapeMode gets the shape parameters of a shaped window\n// (https://wiki.libsdl.org/SDL_GetShapedWindowMode)\nfunc (window *Window) GetShapeMode() (WindowShapeMode, int32) {\n\tvar _cWSM cWindowShapeMode\n\tvar _resInt32 = (int32)(C.SDL_GetShapedWindowMode(window.cptr(), _cWSM.cptr()))\n\tif _resInt32 != 0 {\n\t\treturn nil, _resInt32\n\t}\n\treturn _cWSM.goWSM(), _resInt32\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/surface.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,9))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_HasColorKey is not supported before SDL 2.0.9\")\n#endif\n\nstatic SDL_bool SDL_HasColorKey(SDL_Surface * surface)\n{\n\treturn SDL_FALSE;\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,8))\ntypedef enum {\n\tSDL_YUV_CONVERSION_JPEG,\n\tSDL_YUV_CONVERSION_BT601,\n\tSDL_YUV_CONVERSION_BT709,\n\tSDL_YUV_CONVERSION_AUTOMATIC\n} SDL_YUV_CONVERSION_MODE;\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SetYUVConversionMode is not supported before SDL 2.0.8\")\n#endif\n\nvoid SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode)\n{\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetYUVConversionMode is not supported before SDL 2.0.8\")\n#endif\n\nSDL_YUV_CONVERSION_MODE SDL_GetYUVConversionMode(void)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetYUVConversionModeForResolution is not supported before SDL 2.0.8\")\n#endif\n\nSDL_YUV_CONVERSION_MODE SDL_GetYUVConversionModeForResolution(int width, int height)\n{\n\treturn -1;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,6))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_DuplicateSurface is not supported before SDL 2.0.6\")\n#endif\n\nstatic inline SDL_Surface* SDL_DuplicateSurface(SDL_Surface *surface)\n{\n\treturn NULL;\n}\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,5))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_CreateRGBSurfaceWithFormat is not supported before SDL 2.0.5\")\n#endif\n\nstatic inline SDL_Surface* SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth, Uint32 format)\n{\n\treturn NULL;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_CreateRGBSurfaceWithFormatFrom is not supported before SDL 2.0.5\")\n#endif\n\nstatic inline SDL_Surface* SDL_CreateRGBSurfaceWithFormatFrom(void* pixels, int width, int height, int depth, int pitch, Uint32 format)\n{\n\treturn NULL;\n}\n#endif\n\n\n#if !(SDL_VERSION_ATLEAST(2,0,16))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SoftStretchLinear is not supported before SDL 2.0.16\")\n#endif\n\nstatic int SDL_SoftStretchLinear(SDL_Surface * src, const SDL_Rect * srcrect, SDL_Surface * dst, const SDL_Rect * dstrect)\n{\n\treturn -1;\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,18))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_PremultiplyAlpha is not supported before SDL 2.0.18\")\n#endif\n\nstatic int SDL_PremultiplyAlpha(int width, int height, Uint32 src_format, const void * src, int src_pitch, Uint32 dst_format, void * dst, int dst_pitch)\n{\n\treturn -1;\n}\n\n#endif\n*/\nimport \"C\"\nimport (\n\t\"image\"\n\t\"image/color\"\n\t\"reflect\"\n\t\"unsafe\"\n)\n\n// Surface flags (internal use)\nconst (\n\tSWSURFACE = C.SDL_SWSURFACE // just here for compatibility\n\tPREALLOC  = C.SDL_PREALLOC  // surface uses preallocated memory\n\tRLEACCEL  = C.SDL_RLEACCEL  // surface is RLE encoded\n\tDONTFREE  = C.SDL_DONTFREE  // surface is referenced internally\n)\n\ntype YUV_CONVERSION_MODE C.SDL_YUV_CONVERSION_MODE\n\n// YUV Conversion Modes\nconst (\n\tYUV_CONVERSION_JPEG      YUV_CONVERSION_MODE = C.SDL_YUV_CONVERSION_JPEG      // Full range JPEG\n\tYUV_CONVERSION_BT601                         = C.SDL_YUV_CONVERSION_BT601     // BT.601 (the default)\n\tYUV_CONVERSION_BT709                         = C.SDL_YUV_CONVERSION_BT709     // BT.709\n\tYUV_CONVERSION_AUTOMATIC                     = C.SDL_YUV_CONVERSION_AUTOMATIC // BT.601 for SD content, BT.709 for HD content\n)\n\n// Surface contains a collection of pixels used in software blitting.\n// (https://wiki.libsdl.org/SDL_Surface)\ntype Surface struct {\n\tflags    uint32         // (internal use)\n\tFormat   *PixelFormat   // the format of the pixels stored in the surface (read-only) (https://wiki.libsdl.org/SDL_PixelFormat)\n\tW        int32          // the width in pixels (read-only)\n\tH        int32          // the height in pixels (read-only)\n\tPitch    int32          // the length of a row of pixels in bytes (read-only)\n\tpixels   unsafe.Pointer // the pointer to the actual pixel data; use Pixels() for access\n\tUserData unsafe.Pointer // an arbitrary pointer you can set\n\tlocked   int32          // used for surfaces that require locking (internal use)\n\tlockData unsafe.Pointer // used for surfaces that require locking (internal use)\n\tClipRect Rect           // a Rect structure used to clip blits to the surface which can be set by SetClipRect() (read-only)\n\t_        unsafe.Pointer // map; info for fast blit mapping to other surfaces (internal use)\n\tRefCount int32          // reference count that can be incremented by the application\n}\ntype cSurface C.SDL_Surface\n\nfunc (surface *Surface) cptr() *C.SDL_Surface {\n\treturn (*C.SDL_Surface)(unsafe.Pointer(surface))\n}\n\n// MustLock reports whether the surface must be locked for access.\n// (https://wiki.libsdl.org/SDL_MUSTLOCK)\nfunc (surface *Surface) MustLock() bool {\n\treturn (surface.flags & RLEACCEL) != 0\n}\n\n// CreateRGBSurface allocates a new RGB surface.\n// (https://wiki.libsdl.org/SDL_CreateRGBSurface)\nfunc CreateRGBSurface(flags uint32, width, height, depth int32, Rmask, Gmask, Bmask, Amask uint32) (*Surface, error) {\n\tsurface := (*Surface)(unsafe.Pointer(C.SDL_CreateRGBSurface(\n\t\tC.Uint32(flags),\n\t\tC.int(width),\n\t\tC.int(height),\n\t\tC.int(depth),\n\t\tC.Uint32(Rmask),\n\t\tC.Uint32(Gmask),\n\t\tC.Uint32(Bmask),\n\t\tC.Uint32(Amask))))\n\tif surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn surface, nil\n}\n\n// CreateRGBSurfaceFrom allocate a new RGB surface with existing pixel data.\n// (https://wiki.libsdl.org/SDL_CreateRGBSurfaceFrom)\nfunc CreateRGBSurfaceFrom(pixels unsafe.Pointer, width, height int32, depth, pitch int, Rmask, Gmask, Bmask, Amask uint32) (*Surface, error) {\n\tsurface := (*Surface)(unsafe.Pointer(C.SDL_CreateRGBSurfaceFrom(\n\t\tpixels,\n\t\tC.int(width),\n\t\tC.int(height),\n\t\tC.int(depth),\n\t\tC.int(pitch),\n\t\tC.Uint32(Rmask),\n\t\tC.Uint32(Gmask),\n\t\tC.Uint32(Bmask),\n\t\tC.Uint32(Amask))))\n\tif surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn surface, nil\n}\n\n// CreateRGBSurfaceWithFormat allocates an RGB surface.\n// (https://wiki.libsdl.org/SDL_CreateRGBSurfaceWithFormat)\nfunc CreateRGBSurfaceWithFormat(flags uint32, width, height, depth int32, format uint32) (*Surface, error) {\n\tsurface := (*Surface)(unsafe.Pointer(C.SDL_CreateRGBSurfaceWithFormat(\n\t\tC.Uint32(flags),\n\t\tC.int(width),\n\t\tC.int(height),\n\t\tC.int(depth),\n\t\tC.Uint32(format))))\n\tif surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn surface, nil\n}\n\n// CreateRGBSurfaceWithFormatFrom allocates an RGB surface from provided pixel data.\n// (https://wiki.libsdl.org/SDL_CreateRGBSurfaceWithFormatFrom)\nfunc CreateRGBSurfaceWithFormatFrom(pixels unsafe.Pointer, width, height, depth, pitch int32, format uint32) (*Surface, error) {\n\tsurface := (*Surface)(unsafe.Pointer(C.SDL_CreateRGBSurfaceWithFormatFrom(\n\t\tpixels,\n\t\tC.int(width),\n\t\tC.int(height),\n\t\tC.int(depth),\n\t\tC.int(pitch),\n\t\tC.Uint32(format))))\n\tif surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn surface, nil\n}\n\n// SetYUVConversionMode sets the YUV conversion mode\n// TODO: (https://wiki.libsdl.org/SDL_SetYUVConversionMode)\nfunc SetYUVConversionMode(mode YUV_CONVERSION_MODE) {\n\t_mode := C.SDL_YUV_CONVERSION_MODE(mode)\n\tC.SDL_SetYUVConversionMode(_mode)\n}\n\n// GetYUVConversionMode gets the YUV conversion mode\n// TODO: (https://wiki.libsdl.org/SDL_GetYUVConversionMode)\nfunc GetYUVConversionMode() YUV_CONVERSION_MODE {\n\treturn YUV_CONVERSION_MODE(C.SDL_GetYUVConversionMode())\n}\n\n// GetYUVConversionModeForResolution gets the YUV conversion mode\n// TODO: (https://wiki.libsdl.org/SDL_GetYUVConversionModeForResolution)\nfunc GetYUVConversionModeForResolution(width, height int) YUV_CONVERSION_MODE {\n\t_width := C.int(width)\n\t_height := C.int(height)\n\treturn YUV_CONVERSION_MODE(C.SDL_GetYUVConversionModeForResolution(_width, _height))\n}\n\n// Free frees the RGB surface.\n// (https://wiki.libsdl.org/SDL_FreeSurface)\nfunc (surface *Surface) Free() {\n\tC.SDL_FreeSurface(surface.cptr())\n}\n\n// SetPalette sets the palette used by the surface.\n// (https://wiki.libsdl.org/SDL_SetSurfacePalette)\nfunc (surface *Surface) SetPalette(palette *Palette) error {\n\tif C.SDL_SetSurfacePalette(surface.cptr(), palette.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Lock sets up the surface for directly accessing the pixels.\n// (https://wiki.libsdl.org/SDL_LockSurface)\nfunc (surface *Surface) Lock() error {\n\tif C.SDL_LockSurface(surface.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Unlock releases the surface after directly accessing the pixels.\n// (https://wiki.libsdl.org/SDL_UnlockSurface)\nfunc (surface *Surface) Unlock() {\n\tC.SDL_UnlockSurface(surface.cptr())\n}\n\n// LoadBMPRW loads a BMP image from a seekable SDL data stream (memory or file).\n// (https://wiki.libsdl.org/SDL_LoadBMP_RW)\nfunc LoadBMPRW(src *RWops, freeSrc bool) (*Surface, error) {\n\tsurface := (*Surface)(unsafe.Pointer(C.SDL_LoadBMP_RW(src.cptr(), C.int(Btoi(freeSrc)))))\n\tif surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn surface, nil\n}\n\n// LoadBMP loads a surface from a BMP file.\n// (https://wiki.libsdl.org/SDL_LoadBMP)\nfunc LoadBMP(file string) (*Surface, error) {\n\treturn LoadBMPRW(RWFromFile(file, \"rb\"), true)\n}\n\n// SaveBMPRW save the surface to a seekable SDL data stream (memory or file) in BMP format.\n// (https://wiki.libsdl.org/SDL_SaveBMP_RW)\nfunc (surface *Surface) SaveBMPRW(dst *RWops, freeDst bool) error {\n\tif C.SDL_SaveBMP_RW(surface.cptr(), dst.cptr(), C.int(Btoi(freeDst))) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// SaveBMP saves the surface to a BMP file.\n// (https://wiki.libsdl.org/SDL_SaveBMP)\nfunc (surface *Surface) SaveBMP(file string) error {\n\treturn surface.SaveBMPRW(RWFromFile(file, \"wb\"), true)\n}\n\n// SetRLE sets the RLE acceleration hint for the surface.\n// (https://wiki.libsdl.org/SDL_SetSurfaceRLE)\nfunc (surface *Surface) SetRLE(flag bool) error {\n\tif C.SDL_SetSurfaceRLE(surface.cptr(), C.int(Btoi(flag))) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// SetColorKey sets the color key (transparent pixel) in the surface.\n// (https://wiki.libsdl.org/SDL_SetColorKey)\nfunc (surface *Surface) SetColorKey(flag bool, key uint32) error {\n\tif C.SDL_SetColorKey(surface.cptr(), C.int(Btoi(flag)), C.Uint32(key)) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// HasColorKey returns the color key (transparent pixel) for the surface.\n// TODO: (https://wiki.libsdl.org/SDL_HasColorKey)\nfunc (surface *Surface) HasColorKey() bool {\n\treturn C.SDL_HasColorKey(surface.cptr()) == C.SDL_TRUE\n}\n\n// GetColorKey returns the color key (transparent pixel) for the surface.\n// (https://wiki.libsdl.org/SDL_GetColorKey)\nfunc (surface *Surface) GetColorKey() (key uint32, err error) {\n\t_key := (*C.Uint32)(unsafe.Pointer(&key))\n\tif C.SDL_GetColorKey(surface.cptr(), _key) != 0 {\n\t\treturn key, GetError()\n\t}\n\treturn key, nil\n}\n\n// SetColorMod sets an additional color value multiplied into blit operations.\n// (https://wiki.libsdl.org/SDL_SetSurfaceColorMod)\nfunc (surface *Surface) SetColorMod(r, g, b uint8) error {\n\tif C.SDL_SetSurfaceColorMod(surface.cptr(), C.Uint8(r), C.Uint8(g), C.Uint8(b)) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// GetColorMod returns the additional color value multiplied into blit operations.\n// (https://wiki.libsdl.org/SDL_GetSurfaceColorMod)\nfunc (surface *Surface) GetColorMod() (r, g, b uint8, err error) {\n\t_r := (*C.Uint8)(unsafe.Pointer(&r))\n\t_g := (*C.Uint8)(unsafe.Pointer(&g))\n\t_b := (*C.Uint8)(unsafe.Pointer(&b))\n\tif C.SDL_GetSurfaceColorMod(surface.cptr(), _r, _g, _b) != 0 {\n\t\treturn r, g, b, GetError()\n\t}\n\treturn r, g, b, nil\n}\n\n// SetAlphaMod sets an additional alpha value used in blit operations.\n// (https://wiki.libsdl.org/SDL_SetSurfaceAlphaMod)\nfunc (surface *Surface) SetAlphaMod(alpha uint8) error {\n\tif C.SDL_SetSurfaceAlphaMod(surface.cptr(), C.Uint8(alpha)) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// GetAlphaMod returns the additional alpha value used in blit operations.\n// (https://wiki.libsdl.org/SDL_GetSurfaceAlphaMod)\nfunc (surface *Surface) GetAlphaMod() (alpha uint8, err error) {\n\t_alpha := (*C.Uint8)(unsafe.Pointer(&alpha))\n\tif C.SDL_GetSurfaceAlphaMod(surface.cptr(), _alpha) != 0 {\n\t\treturn alpha, GetError()\n\t}\n\treturn alpha, nil\n}\n\n// SetBlendMode sets the blend mode used for blit operations.\n// (https://wiki.libsdl.org/SDL_SetSurfaceBlendMode)\nfunc (surface *Surface) SetBlendMode(bm BlendMode) error {\n\tif C.SDL_SetSurfaceBlendMode(surface.cptr(), bm.c()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// GetBlendMode returns the blend mode used for blit operations.\n// (https://wiki.libsdl.org/SDL_GetSurfaceBlendMode)\nfunc (surface *Surface) GetBlendMode() (bm BlendMode, err error) {\n\tif C.SDL_GetSurfaceBlendMode(surface.cptr(), bm.cptr()) != 0 {\n\t\treturn bm, GetError()\n\t}\n\treturn bm, nil\n}\n\n// SetClipRect sets the clipping rectangle for the surface\n// (https://wiki.libsdl.org/SDL_SetClipRect)\nfunc (surface *Surface) SetClipRect(rect *Rect) bool {\n\treturn C.SDL_SetClipRect(surface.cptr(), rect.cptr()) > 0\n}\n\n// GetClipRect returns the clipping rectangle for a surface.\n// (https://wiki.libsdl.org/SDL_GetClipRect)\nfunc (surface *Surface) GetClipRect(rect *Rect) {\n\tC.SDL_GetClipRect(surface.cptr(), rect.cptr())\n}\n\n// Convert copies the existing surface into a new one that is optimized for blitting to a surface of a specified pixel format.\n// (https://wiki.libsdl.org/SDL_ConvertSurface)\nfunc (surface *Surface) Convert(fmt *PixelFormat, flags uint32) (*Surface, error) {\n\t_surface := (*Surface)(unsafe.Pointer(C.SDL_ConvertSurface(surface.cptr(), fmt.cptr(), C.Uint32(flags))))\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn _surface, nil\n}\n\n// ConvertFormat copies the existing surface to a new surface of the specified format.\n// (https://wiki.libsdl.org/SDL_ConvertSurfaceFormat)\nfunc (surface *Surface) ConvertFormat(pixelFormat uint32, flags uint32) (*Surface, error) {\n\t_surface := (*Surface)(unsafe.Pointer(C.SDL_ConvertSurfaceFormat(surface.cptr(), C.Uint32(pixelFormat), C.Uint32(flags))))\n\tif _surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn _surface, nil\n}\n\n// ConvertPixels copies a block of pixels of one format to another format.\n// (https://wiki.libsdl.org/SDL_ConvertPixels)\nfunc ConvertPixels(width, height int32, srcFormat uint32, src unsafe.Pointer, srcPitch int,\n\tdstFormat uint32, dst unsafe.Pointer, dstPitch int) error {\n\tif C.SDL_ConvertPixels(C.int(width), C.int(height), C.Uint32(srcFormat), src, C.int(srcPitch), C.Uint32(dstFormat), dst, C.int(dstPitch)) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// FillRect performs a fast fill of a rectangle with a specific color.\n// (https://wiki.libsdl.org/SDL_FillRect)\nfunc (surface *Surface) FillRect(rect *Rect, color uint32) error {\n\tif C.SDL_FillRect(surface.cptr(), rect.cptr(), C.Uint32(color)) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// FillRects performs a fast fill of a set of rectangles with a specific color.\n// (https://wiki.libsdl.org/SDL_FillRects)\nfunc (surface *Surface) FillRects(rects []Rect, color uint32) error {\n\tif C.SDL_FillRects(surface.cptr(), rects[0].cptr(), C.int(len(rects)), C.Uint32(color)) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// Blit performs a fast surface copy to a destination surface.\n// (https://wiki.libsdl.org/SDL_BlitSurface)\nfunc (surface *Surface) Blit(srcRect *Rect, dst *Surface, dstRect *Rect) error {\n\tif C.SDL_BlitSurface(surface.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// BlitScaled performs a scaled surface copy to a destination surface.\n// (https://wiki.libsdl.org/SDL_BlitScaled)\nfunc (surface *Surface) BlitScaled(srcRect *Rect, dst *Surface, dstRect *Rect) error {\n\tif C.SDL_BlitScaled(surface.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// UpperBlit has been replaced by Blit().\n// (https://wiki.libsdl.org/SDL_UpperBlit)\nfunc (surface *Surface) UpperBlit(srcRect *Rect, dst *Surface, dstRect *Rect) error {\n\tif C.SDL_UpperBlit(surface.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// LowerBlit performs low-level surface blitting only.\n// (https://wiki.libsdl.org/SDL_LowerBlit)\nfunc (surface *Surface) LowerBlit(srcRect *Rect, dst *Surface, dstRect *Rect) error {\n\tif C.SDL_LowerBlit(surface.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// SoftStretch has been replaced by BlitScaled().\n// (https://wiki.libsdl.org/SDL_SoftStretch)\nfunc (surface *Surface) SoftStretch(srcRect *Rect, dst *Surface, dstRect *Rect) error {\n\tif C.SDL_SoftStretch(surface.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// UpperBlitScaled has been replaced by BlitScaled().\n// (https://wiki.libsdl.org/SDL_UpperBlitScaled)\nfunc (surface *Surface) UpperBlitScaled(srcRect *Rect, dst *Surface, dstRect *Rect) error {\n\tif C.SDL_UpperBlitScaled(surface.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// LowerBlitScaled performs low-level surface scaled blitting only.\n// (https://wiki.libsdl.org/SDL_LowerBlitScaled)\nfunc (surface *Surface) LowerBlitScaled(srcRect *Rect, dst *Surface, dstRect *Rect) error {\n\tif C.SDL_LowerBlitScaled(surface.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr()) != 0 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// PixelNum returns the number of pixels stored in the surface.\nfunc (surface *Surface) PixelNum() int {\n\treturn int(surface.W * surface.H)\n}\n\n// BytesPerPixel return the number of significant bits in a pixel values of the surface.\nfunc (surface *Surface) BytesPerPixel() int {\n\treturn int(surface.Format.BytesPerPixel)\n}\n\n// Pixels returns the actual pixel data of the surface.\nfunc (surface *Surface) Pixels() []byte {\n\tvar b []byte\n\tlength := int(surface.H) * int(surface.Pitch)\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&b))\n\tsliceHeader.Cap = int(length)\n\tsliceHeader.Len = int(length)\n\tsliceHeader.Data = uintptr(surface.pixels)\n\treturn b\n}\n\n// Data returns the pointer to the actual pixel data of the surface.\nfunc (surface *Surface) Data() unsafe.Pointer {\n\treturn surface.pixels\n}\n\n// Duplicate creates a new surface identical to the existing surface\nfunc (surface *Surface) Duplicate() (newSurface *Surface, err error) {\n\t_newSurface := C.SDL_DuplicateSurface(surface.cptr())\n\tif _newSurface == nil {\n\t\terr = GetError()\n\t\treturn\n\t}\n\n\tnewSurface = (*Surface)(unsafe.Pointer(_newSurface))\n\treturn\n}\n\n// ColorModel returns the color model used by this Surface.\nfunc (surface *Surface) ColorModel() color.Model {\n\tswitch surface.Format.Format {\n\tcase PIXELFORMAT_ARGB8888, PIXELFORMAT_ABGR8888:\n\t\treturn color.RGBAModel\n\tcase PIXELFORMAT_RGB888:\n\t\treturn color.RGBAModel\n\tcase PIXELFORMAT_RGB444:\n\t\treturn RGB444Model\n\tcase PIXELFORMAT_RGB332:\n\t\treturn RGB332Model\n\tcase PIXELFORMAT_RGB555:\n\t\treturn RGB555Model\n\tcase PIXELFORMAT_RGB565:\n\t\treturn RGB565Model\n\tcase PIXELFORMAT_BGR555:\n\t\treturn BGR555Model\n\tcase PIXELFORMAT_BGR565:\n\t\treturn BGR565Model\n\tcase PIXELFORMAT_ARGB4444:\n\t\treturn ARGB4444Model\n\tcase PIXELFORMAT_ABGR4444:\n\t\treturn ABGR4444Model\n\tcase PIXELFORMAT_RGBA4444:\n\t\treturn RGBA4444Model\n\tcase PIXELFORMAT_BGRA4444:\n\t\treturn BGRA4444Model\n\tcase PIXELFORMAT_ARGB1555:\n\t\treturn ARGB1555Model\n\tcase PIXELFORMAT_RGBA5551:\n\t\treturn RGBA5551Model\n\tcase PIXELFORMAT_ABGR1555:\n\t\treturn ABGR1555Model\n\tcase PIXELFORMAT_BGRA5551:\n\t\treturn BGRA5551Model\n\tcase PIXELFORMAT_RGBA8888:\n\t\treturn RGBA8888Model\n\tcase PIXELFORMAT_BGRA8888:\n\t\treturn BGRA8888Model\n\tdefault:\n\t\tpanic(\"Not implemented yet\")\n\t}\n}\n\n// Bounds return the bounds of this surface. Currently, it always starts at\n// (0,0), but this is not guaranteed in the future so don't rely on it.\nfunc (surface *Surface) Bounds() image.Rectangle {\n\treturn image.Rect(0, 0, int(surface.W), int(surface.H))\n}\n\n// At returns the pixel color at (x, y)\nfunc (surface *Surface) At(x, y int) color.Color {\n\tpix := surface.Pixels()\n\ti := int32(y)*surface.Pitch + int32(x)*int32(surface.Format.BytesPerPixel)\n\tr, g, b, a := GetRGBA(*((*uint32)(unsafe.Pointer(&pix[i]))), surface.Format)\n\treturn color.NRGBA{R: r, G: g, B: b, A: a}\n}\n\n// Set the color of the pixel at (x, y) using this surface's color format to\n// convert c to the appropriate byte sequence. This method is required for the\n// draw.Image interface. The surface may require locking before calling Set.\nfunc (surface *Surface) Set(x, y int, c color.Color) {\n\t// All sdl2 colors are a subset of NRGBA so it is safe precision-wise to\n\t// convert to NRGBA and use the color components from there.\n\tnrgbaColor := color.NRGBAModel.Convert(c).(color.NRGBA)\n\tcolR, colG, colB, colA := nrgbaColor.R, nrgbaColor.G, nrgbaColor.B, nrgbaColor.A\n\n\tpix := surface.Pixels()\n\ti := int32(y)*surface.Pitch + int32(x)*int32(surface.Format.BytesPerPixel)\n\tswitch surface.Format.Format {\n\tcase PIXELFORMAT_ARGB8888:\n\t\tpix[i+3] = colA\n\t\tpix[i+2] = colR\n\t\tpix[i+1] = colG\n\t\tpix[i+0] = colB\n\tcase PIXELFORMAT_ABGR8888:\n\t\tpix[i+3] = colA\n\t\tpix[i+2] = colB\n\t\tpix[i+1] = colG\n\t\tpix[i+0] = colR\n\tcase PIXELFORMAT_RGB24, PIXELFORMAT_RGB888:\n\t\tpix[i+2] = colR\n\t\tpix[i+1] = colG\n\t\tpix[i+0] = colB\n\tcase PIXELFORMAT_BGR24, PIXELFORMAT_BGR888:\n\t\tpix[i+2] = colB\n\t\tpix[i+1] = colG\n\t\tpix[i+0] = colR\n\tcase PIXELFORMAT_RGB444:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 4 & 0x0F\n\t\tg := uint32(colG) >> 4 & 0x0F\n\t\tb := uint32(colB) >> 4 & 0x0F\n\t\t*buf = r<<8 | g<<4 | b\n\tcase PIXELFORMAT_RGB332:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 5 & 0x0F\n\t\tg := uint32(colG) >> 5 & 0x0F\n\t\tb := uint32(colB) >> 6 & 0x0F\n\t\t*buf = r<<5 | g<<2 | b\n\tcase PIXELFORMAT_RGB565:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 3 & 0xFF\n\t\tg := uint32(colG) >> 2 & 0xFF\n\t\tb := uint32(colB) >> 3 & 0xFF\n\t\t*buf = r<<11 | g<<5 | b\n\tcase PIXELFORMAT_RGB555:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 3 & 0xFF\n\t\tg := uint32(colG) >> 3 & 0xFF\n\t\tb := uint32(colB) >> 3 & 0xFF\n\t\t*buf = r<<10 | g<<5 | b\n\tcase PIXELFORMAT_BGR565:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 3 & 0xFF\n\t\tg := uint32(colG) >> 2 & 0xFF\n\t\tb := uint32(colB) >> 3 & 0xFF\n\t\t*buf = b<<11 | g<<5 | r\n\tcase PIXELFORMAT_BGR555:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 3 & 0xFF\n\t\tg := uint32(colG) >> 3 & 0xFF\n\t\tb := uint32(colB) >> 3 & 0xFF\n\t\t*buf = b<<10 | g<<5 | r\n\tcase PIXELFORMAT_ARGB4444:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\ta := uint32(colA) >> 4 & 0x0F\n\t\tr := uint32(colR) >> 4 & 0x0F\n\t\tg := uint32(colG) >> 4 & 0x0F\n\t\tb := uint32(colB) >> 4 & 0x0F\n\t\t*buf = a<<12 | r<<8 | g<<4 | b\n\tcase PIXELFORMAT_ABGR4444:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\ta := uint32(colA) >> 4 & 0x0F\n\t\tr := uint32(colR) >> 4 & 0x0F\n\t\tg := uint32(colG) >> 4 & 0x0F\n\t\tb := uint32(colB) >> 4 & 0x0F\n\t\t*buf = a<<12 | b<<8 | g<<4 | r\n\tcase PIXELFORMAT_RGBA4444:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 4 & 0x0F\n\t\tg := uint32(colG) >> 4 & 0x0F\n\t\tb := uint32(colB) >> 4 & 0x0F\n\t\ta := uint32(colA) >> 4 & 0x0F\n\t\t*buf = r<<12 | g<<8 | b<<4 | a\n\tcase PIXELFORMAT_BGRA4444:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 4 & 0x0F\n\t\tg := uint32(colG) >> 4 & 0x0F\n\t\tb := uint32(colB) >> 4 & 0x0F\n\t\ta := uint32(colA) >> 4 & 0x0F\n\t\t*buf = b<<12 | g<<8 | r<<4 | a\n\tcase PIXELFORMAT_ARGB1555:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 3 & 0xFF\n\t\tg := uint32(colG) >> 3 & 0xFF\n\t\tb := uint32(colB) >> 3 & 0xFF\n\t\ta := uint32(0)\n\t\tif colA > 0 {\n\t\t\ta = 1\n\t\t}\n\t\t*buf = a<<15 | r<<10 | g<<5 | b\n\tcase PIXELFORMAT_RGBA5551:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 3 & 0xFF\n\t\tg := uint32(colG) >> 3 & 0xFF\n\t\tb := uint32(colB) >> 3 & 0xFF\n\t\ta := uint32(0)\n\t\tif colA > 0 {\n\t\t\ta = 1\n\t\t}\n\t\t*buf = r<<11 | g<<6 | b<<1 | a\n\tcase PIXELFORMAT_ABGR1555:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 3 & 0xFF\n\t\tg := uint32(colG) >> 3 & 0xFF\n\t\tb := uint32(colB) >> 3 & 0xFF\n\t\ta := uint32(0)\n\t\tif colA > 0 {\n\t\t\ta = 1\n\t\t}\n\t\t*buf = a<<15 | b<<10 | g<<5 | r\n\tcase PIXELFORMAT_BGRA5551:\n\t\tbuf := (*uint32)(unsafe.Pointer(&pix[i]))\n\t\tr := uint32(colR) >> 3 & 0xFF\n\t\tg := uint32(colG) >> 3 & 0xFF\n\t\tb := uint32(colB) >> 3 & 0xFF\n\t\ta := uint32(0)\n\t\tif colA > 0 {\n\t\t\ta = 1\n\t\t}\n\t\t*buf = b<<11 | g<<6 | r<<1 | a\n\tcase PIXELFORMAT_RGBA8888:\n\t\tpix[i+3] = colR\n\t\tpix[i+2] = colG\n\t\tpix[i+1] = colB\n\t\tpix[i+0] = colA\n\tcase PIXELFORMAT_BGRA8888:\n\t\tpix[i+3] = colB\n\t\tpix[i+2] = colG\n\t\tpix[i+1] = colR\n\t\tpix[i+0] = colA\n\tdefault:\n\t\tpanic(\"Unknown pixel format!\")\n\t}\n}\n\n// SoftStretchLinear performs bilinear scaling between two surfaces of the same format, 32BPP.\n// (https://wiki.libsdl.org/SDL_SoftStretchLinear)\nfunc (surface *Surface) SoftStretchLinear(srcRect *Rect, dst *Surface, dstRect *Rect) (err error) {\n\treturn errorFromInt(int(C.SDL_SoftStretchLinear(surface.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr())))\n}\n\n// PremultiplyAlpha premultiplies the alpha on a block of pixels.\n//\n// This is safe to use with src == dst, but not for other overlapping areas.\n//\n// This function is currently only implemented for SDL_PIXELFORMAT_ARGB8888.\n//\n// (https://wiki.libsdl.org/SDL_PremultiplyAlpha)\nfunc PremultiplyAlpha(width, height int, srcFormat uint32, src []byte, srcPitch int, dstFormat uint32, dst []byte, dstPitch int) (err error) {\n\t_width := C.int(width)\n\t_height := C.int(height)\n\t_srcFormat := C.Uint32(srcFormat)\n\t_src := unsafe.Pointer(&src[0])\n\t_srcPitch := C.int(srcPitch)\n\t_dstFormat := C.Uint32(dstFormat)\n\t_dst := unsafe.Pointer(&dst[0])\n\t_dstPitch := C.int(dstPitch)\n\terr = errorFromInt(int(C.SDL_PremultiplyAlpha(_width, _height, _srcFormat, _src, _srcPitch, _dstFormat, _dst, _dstPitch)))\n\treturn\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/sysrender.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\nimport \"unsafe\"\n\n// Texture contains an efficient, driver-specific representation of pixel data.\n// (https://wiki.libsdl.org/SDL_Texture)\ntype Texture C.SDL_Texture\n\n// Renderer contains a rendering state.\n// (https://wiki.libsdl.org/SDL_Renderer)\ntype Renderer C.SDL_Renderer\n\nfunc (t *Texture) cptr() *C.SDL_Texture {\n\treturn (*C.SDL_Texture)(unsafe.Pointer(t))\n}\n\nfunc (r *Renderer) cptr() *C.SDL_Renderer {\n\treturn (*C.SDL_Renderer)(unsafe.Pointer(r))\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/system.c",
    "content": "#include \"_cgo_export.h\"\n#include \"system.h\"\n\n#if defined(_WIN32)\nvoid SetWindowsMessageHook()\n{\n\tSDL_SetWindowsMessageHook((SDL_WindowsMessageHook) goWindowsMessageHook, NULL);\n}\n#endif\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/system.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,9))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_IsTablet is not supported before SDL 2.0.9\")\n#endif\n\nstatic inline SDL_bool SDL_IsTablet()\n{\n\treturn SDL_FALSE;\n}\n\n#endif\n*/\nimport \"C\"\n\n// IsTablet returns true if the current device is a tablet\n// TODO: (https://wiki.libsdl.org/SDL_IsTablet)\nfunc IsTablet() bool {\n\treturn C.SDL_IsTablet() == C.SDL_TRUE\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/system.h",
    "content": "#ifndef _GO_SDL_SYSTEM_H\n#define _GO_SDL_SYSTEM_H\n\n#if defined(_WIN32)\n\textern void SetWindowsMessageHook();\n#endif\n\n#endif\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/system_android.go",
    "content": "// +build go1.4\n\npackage sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,8))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_IsAndroidTV is not supported before SDL 2.0.8\")\n#endif\n\nstatic int SDL_IsAndroidTV(void)\n{\n\treturn -1;\n}\n\n#endif\n\n\n#if !(SDL_VERSION_ATLEAST(2,0,16))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_AndroidShowToast is not supported before SDL 2.0.16\")\n#endif\n\nstatic int SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset)\n{\n\treturn -1;\n}\n\n#endif\n\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// External storage states. See the official Android developer guide for more information.\n// (http://developer.android.com/guide/topics/data/data-storage.html)\nconst (\n\tANDROID_EXTERNAL_STORAGE_READ  = C.SDL_ANDROID_EXTERNAL_STORAGE_READ\n\tANDROID_EXTERNAL_STORAGE_WRITE = C.SDL_ANDROID_EXTERNAL_STORAGE_WRITE\n)\n\n// AndroidGetInternalStoragePath returns the path used for internal storage for this application.\n// (https://wiki.libsdl.org/SDL_AndroidGetInternalStoragePath)\nfunc AndroidGetInternalStoragePath() string {\n\treturn C.GoString(C.SDL_AndroidGetInternalStoragePath())\n}\n\n// AndroidGetExternalStoragePath returns the path used for external storage for this application.\n// (https://wiki.libsdl.org/SDL_AndroidGetExternalStoragePath)\nfunc AndroidGetExternalStoragePath() string {\n\treturn C.GoString(C.SDL_AndroidGetExternalStoragePath())\n}\n\n// AndroidGetExternalStorageState returns the current state of external storage.\n// (https://wiki.libsdl.org/SDL_AndroidGetExternalStorageState)\nfunc AndroidGetExternalStorageState() int {\n\treturn int(C.SDL_AndroidGetExternalStorageState())\n}\n\n// AndroidGetJNIEnv returns the Java native interface object (JNIEnv) of the current thread on Android builds.\n// (https://wiki.libsdl.org/SDL_AndroidGetJNIEnv)\nfunc AndroidGetJNIEnv() unsafe.Pointer {\n\treturn unsafe.Pointer(C.SDL_AndroidGetJNIEnv())\n}\n\n// AndroidGetActivity returns the Java instance of the activity class in an Android application.\n// (https://wiki.libsdl.org/SDL_AndroidGetActivity)\nfunc AndroidGetActivity() unsafe.Pointer {\n\treturn unsafe.Pointer(C.SDL_AndroidGetActivity())\n}\n\n// IsAndroidTV returns true if the application is running on Android TV\n// (https://wiki.libsdl.org/SDL_IsAndroidTV)\nfunc IsAndroidTV() bool {\n\treturn C.SDL_IsAndroidTV() >= 0\n}\n\n// AndroidShowToast shows an Android toast notification.\n// (https://wiki.libsdl.org/SDL_AndroidShowToast)\nfunc AndroidShowToast(message string, duration, gravity, xoffset, yoffset int) (err error) {\n\t_message := C.CString(message)\n\tdefer C.free(unsafe.Pointer(_message))\n\treturn errorFromInt(int(C.SDL_AndroidShowToast(_message, C.int(duration), C.int(gravity), C.int(xoffset), C.int(yoffset))))\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/system_linux.go",
    "content": "// +build !android\n\npackage sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,9))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_LinuxSetThreadPriority is not supported before SDL 2.0.9\")\n#endif\n\nstatic int SDL_LinuxSetThreadPriority(Sint64 threadID, int priority)\n{\n\treturn -1;\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,18))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_LinuxSetThreadPriorityAndPolicy is not supported before SDL 2.0.18\")\n#endif\n\nstatic int SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy)\n{\n\treturn -1;\n}\n\n#endif\n*/\nimport \"C\"\n\n// LinuxSetThreadPriority sets the UNIX nice value for a thread.\n//\n// This uses setpriority() if possible, and RealtimeKit if available.\n//\n// (https://wiki.libsdl.org/SDL_LinuxSetThreadPriority)\nfunc LinuxSetThreadPriority(threadID int64, priority int) (err error) {\n\t_threadID := C.Sint64(threadID)\n\t_priority := C.int(priority)\n\treturn errorFromInt(int(C.SDL_LinuxSetThreadPriority(_threadID, _priority)))\n}\n\n// LinuxSetThreadPriority sets the priority (not nice level) and scheduling policy for a thread.\n//\n// This uses setpriority() if possible, and RealtimeKit if available.\n//\n// (https://wiki.libsdl.org/SDL_LinuxSetThreadPriorityAndPolicy)\nfunc LinuxSetThreadPriorityAndPolicy(threadID int64, sdlPriority, schedPolicy int) (err error) {\n\t_threadID := C.Sint64(threadID)\n\t_sdlPriority := C.int(sdlPriority)\n\t_schedPolicy := C.int(schedPolicy)\n\treturn errorFromInt(int(C.SDL_LinuxSetThreadPriorityAndPolicy(_threadID, _sdlPriority, _schedPolicy)))\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/system_windows.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n#include \"system.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,16))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_RenderGetD3D11Device is not supported before SDL 2.0.16\")\n#endif\n\ntypedef struct ID3D11Device ID3D11Device;\n\nstatic ID3D11Device* SDL_RenderGetD3D11Device(SDL_Renderer * renderer)\n{\n\treturn NULL;\n}\n\n#endif\n*/\nimport \"C\"\nimport (\n\t\"unsafe\"\n)\n\ntype WindowsMessageHook func(userdata interface{}, hWnd unsafe.Pointer, message uint32, wParam uint64, lParam int64)\nvar windowsMessageHook WindowsMessageHook\n\ntype ID3D11Device C.ID3D11Device;\n\n// SetWindowsMessageHook sets a callback for every Windows message, run before TranslateMessage().\n// (https://wiki.libsdl.org/SDL_SetWindowsMessageHook)\nfunc SetWindowsMessageHook(callback WindowsMessageHook, userdata interface{}) {\n\twindowsMessageHook = callback\n\tC.SetWindowsMessageHook()\n}\n\n//export goWindowsMessageHook\nfunc goWindowsMessageHook(userdata interface{}, hWnd unsafe.Pointer, message uint32, wParam uint64, lParam int64) {\n\tif windowsMessageHook == nil {\n\t\treturn\n\t}\n\twindowsMessageHook(userdata, hWnd, message, wParam, lParam)\n}\n\n// SDL_RenderGetD3D11Device gets the D3D11 device associated with a renderer.\n// (https://wiki.libsdl.org/SDL_RenderGetD3D11Device)\nfunc (renderer *Renderer) GetD3D11Device() (device *ID3D11Device, err error) {\n\tdevice = (*ID3D11Device)(C.SDL_RenderGetD3D11Device(renderer.cptr()))\n\tif device == nil {\n\t\terr = GetError()\n\t}\n\treturn\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/syswm.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if defined(__WIN32)\n#include <SDL2/SDL_syswm.h>\n#else\n#include <SDL_syswm.h>\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,2))\n#define SDL_SYSWM_WAYLAND SDL_SYSWM_UNKNOWN\n#define SDL_SYSWM_MIR SDL_SYSWM_UNKNOWN\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,3))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SYSWM_WINRT is not supported before SDL 2.0.3\")\n#endif\n\n#define SDL_SYSWM_WINRT (0)\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,4))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SYSWM_ANDROID is not supported before SDL 2.0.4\")\n#endif\n\n#define SDL_SYSWM_ANDROID (0)\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,5))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SYSWM_VIVANTE is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_SYSWM_VIVANTE (0)\n#endif\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// Various supported windowing subsystems.\nconst (\n\tSYSWM_UNKNOWN  = C.SDL_SYSWM_UNKNOWN\n\tSYSWM_WINDOWS  = C.SDL_SYSWM_WINDOWS  // Microsoft Windows\n\tSYSWM_X11      = C.SDL_SYSWM_X11      // X Window System\n\tSYSWM_DIRECTFB = C.SDL_SYSWM_DIRECTFB // DirectFB\n\tSYSWM_COCOA    = C.SDL_SYSWM_COCOA    // Apple Mac OS X\n\tSYSWM_UIKIT    = C.SDL_SYSWM_UIKIT    // Apple iOS\n\tSYSWM_WAYLAND  = C.SDL_SYSWM_WAYLAND  // Wayland (>= SDL 2.0.2)\n\tSYSWM_MIR      = C.SDL_SYSWM_MIR      // Mir (>= SDL 2.0.2)\n\tSYSWM_WINRT    = C.SDL_SYSWM_WINRT    // WinRT (>= SDL 2.0.3)\n\tSYSWM_ANDROID  = C.SDL_SYSWM_ANDROID  // Android (>= SDL 2.0.4)\n\tSYSWM_VIVANTE  = C.SDL_SYSWM_VIVANTE  // Vivante (>= SDL 2.0.5)\n)\n\n// SysWMInfo contains system-dependent information about a window.\n// (https://wiki.libsdl.org/SDL_SysWMinfo)\ntype SysWMInfo struct {\n\tVersion   Version  // a Version structure that contains the current SDL version\n\tSubsystem uint32   // the windowing system type\n\tdummy     [24]byte // unused (to help compilers when no specific system is available)\n}\n\n// WindowsInfo contains Microsoft Windows window information.\ntype WindowsInfo struct {\n\tWindow unsafe.Pointer // the window handle\n\tDeviceContext unsafe.Pointer // the device context handle\n\tInstance unsafe.Pointer // the instance handle\n}\n\n// X11Info contains X Window System window information.\ntype X11Info struct {\n\tDisplay unsafe.Pointer // the X11 display\n\tWindow  uint           // the X11 window\n}\n\n// DFBInfo contains DirectFB window information.\ntype DFBInfo struct {\n\tDfb     unsafe.Pointer // the DirectFB main interface\n\tWindow  unsafe.Pointer // the DirectFB window handle\n\tSurface unsafe.Pointer // the DirectFB client surface\n}\n\n// CocoaInfo contains Apple Mac OS X window information.\ntype CocoaInfo struct {\n\tWindow unsafe.Pointer // the Cocoa window\n}\n\n// UIKitInfo contains Apple iOS window information.\ntype UIKitInfo struct {\n\tWindow unsafe.Pointer // the UIKit window\n}\n\n// SysWMmsg contains system-dependent window manager messages.\n// (https://wiki.libsdl.org/SDL_SysWMmsg)\ntype SysWMmsg struct {\n\tVersion   Version  // a Version structure that contains the current SDL version\n\tSubsystem uint32   // the windowing system type\n\tdata      [24]byte // internal data\n}\n\nfunc (info *SysWMInfo) cptr() *C.SDL_SysWMinfo {\n\treturn (*C.SDL_SysWMinfo)(unsafe.Pointer(info))\n}\n\n// GetWMInfo returns driver specific information about a window.\n// (https://wiki.libsdl.org/SDL_GetWindowWMInfo)\nfunc (window *Window) GetWMInfo() (*SysWMInfo, error) {\n\tvar info SysWMInfo\n\tVERSION(&info.Version)\n\tif C.SDL_GetWindowWMInfo(window.cptr(), info.cptr()) == 0 {\n\t\treturn nil, GetError()\n\t}\n\treturn &info, nil\n}\n\n// GetWindowsInfo returns Microsoft Windows window information.\nfunc (info *SysWMInfo) GetWindowsInfo() *WindowsInfo {\n\treturn (*WindowsInfo)(unsafe.Pointer(&info.dummy[0]))\n}\n\n// GetX11Info returns X Window System window information.\nfunc (info *SysWMInfo) GetX11Info() *X11Info {\n\treturn (*X11Info)(unsafe.Pointer(&info.dummy[0]))\n}\n\n// GetDFBInfo returns DirectFB window information.\nfunc (info *SysWMInfo) GetDFBInfo() *DFBInfo {\n\treturn (*DFBInfo)(unsafe.Pointer(&info.dummy[0]))\n}\n\n// GetCocoaInfo returns Apple Mac OS X window information.\nfunc (info *SysWMInfo) GetCocoaInfo() *CocoaInfo {\n\treturn (*CocoaInfo)(unsafe.Pointer(&info.dummy[0]))\n}\n\n// GetUIKitInfo returns Apple iOS window information.\nfunc (info *SysWMInfo) GetUIKitInfo() *UIKitInfo {\n\treturn (*UIKitInfo)(unsafe.Pointer(&info.dummy[0]))\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/syswm_cocoa.go",
    "content": "// +build cocoa OR darwin\n\npackage sdl\n\nimport \"C\"\nimport \"unsafe\"\n\n// CocoaMsg contains Apple Mac OS X window information.\ntype CocoaMsg struct {\n\tdummy C.int\n}\n\n// Cocoa() returns Apple Mac OS X message.\nfunc (msg *SysWMmsg) Cocoa() *CocoaMsg {\n\treturn (*CocoaMsg)(unsafe.Pointer(&msg.data[0]))\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/syswm_dfb.go",
    "content": "// +build dfb\n\npackage sdl\n\nimport \"C\"\nimport \"unsafe\"\n\n// DFBMsg contains DirectFB window information.\ntype DFBMsg struct {\n\tEvent C.DFBEvent\n}\n\n// DFB() returns DirectFB message.\nfunc (msg *SysWMmsg) DFB() *DFBMsg {\n\treturn (*DFBMsg)(unsafe.Pointer(&msg.data[0]))\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/syswm_uikit.go",
    "content": "// +build uikit\n\npackage sdl\n\nimport \"C\"\nimport \"unsafe\"\n\n// UIKitMsg contains Apple iOS window information.\ntype UIKitMsg struct {\n\tdummy C.int\n}\n\n// UIKit() returns Apple iOS message.\nfunc (msg *SysWMmsg) UIKit() *UIKitMsg {\n\treturn (*UIKitMsg)(unsafe.Pointer(&msg.data[0]))\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/syswm_vivante.go",
    "content": "// +build vivante\n\npackage sdl\n\nimport \"C\"\nimport \"unsafe\"\n\n// VivanteKitMsg contains Vivante window information.\ntype VivanteKitMsg struct {\n\tdummy C.int\n}\n\n// Vivante() returns Vivante message.\nfunc (msg *SysWMmsg) Vivante() *VivanteMsg {\n\treturn (*VivanteMsg)(unsafe.Pointer(&msg.data[0]))\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/syswm_windows.go",
    "content": "// +build windows\n\npackage sdl\n\n/*\n#include <windef.h>\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// WindowsMsg contains Microsoft Windows window information.\ntype WindowsMsg struct {\n\tHwnd   C.HWND\n\tMsg    C.UINT\n\tWParam C.WPARAM\n\tLParam C.LPARAM\n}\n\n// Windows() returns Microsoft Windows message.\nfunc (msg *SysWMmsg) Windows() *WindowsMsg {\n\treturn (*WindowsMsg)(unsafe.Pointer(&msg.data[0]))\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/syswm_x11.go",
    "content": "// +build x11\n\npackage sdl\n\n/*\n#include <X11/Xlib.h>\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// X11Msg contains X Window System window information.\ntype X11Msg struct {\n\tEvent C.XEvent\n}\n\n// X11() returns X Window System message.\nfunc (msg *SysWMmsg) X11() *X11Msg {\n\treturn (*X11Msg)(unsafe.Pointer(&msg.data[0]))\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/thread.go",
    "content": "package sdl\n\n// #include \"sdl_wrapper.h\"\nimport \"C\"\n\n// CurrentThreadID gets the thread identifier for the current thread.\n// (https://wiki.libsdl.org/SDL_ThreadID)\nfunc CurrentThreadID() uint {\n\treturn uint(C.SDL_ThreadID())\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/timer.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,18))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetTicks64 is not supported before SDL 2.0.18\")\n#endif\n\nstatic inline Uint64 SDLCALL SDL_GetTicks64(void)\n{\n\treturn 0;\n}\n#endif\n*/\nimport \"C\"\n\n// GetTicks returns the number of milliseconds since the SDL library initialization.\n//\n// Deprecated: This function is not recommended as of SDL 2.0.18; use GetTicks64()\n// instead, where the value doesn't wrap every ~49 days. There are places in\n// SDL where we provide a 32-bit timestamp that can not change without\n// breaking binary compatibility, though, so this function isn't officially\n// deprecated.\n//\n// (https://wiki.libsdl.org/SDL_GetTicks)\nfunc GetTicks() uint32 {\n\treturn uint32(C.SDL_GetTicks())\n}\n\n// GetTicks64 returns the number of milliseconds since the SDL library initialization.\n// (https://wiki.libsdl.org/SDL_GetTicks64)\nfunc GetTicks64() uint64 {\n\treturn uint64(C.SDL_GetTicks64())\n}\n\n// GetPerformanceCounter returns the current value of the high resolution counter.\n// (https://wiki.libsdl.org/SDL_GetPerformanceCounter)\nfunc GetPerformanceCounter() uint64 {\n\treturn uint64(C.SDL_GetPerformanceCounter())\n}\n\n// GetPerformanceFrequency returns the count per second of the high resolution counter.\n// (https://wiki.libsdl.org/SDL_GetPerformanceFrequency)\nfunc GetPerformanceFrequency() uint64 {\n\treturn uint64(C.SDL_GetPerformanceFrequency())\n}\n\n// Delay waits a specified number of milliseconds before returning.\n// (https://wiki.libsdl.org/SDL_Delay)\nfunc Delay(ms uint32) {\n\tC.SDL_Delay(C.Uint32(ms))\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/touch.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if !(SDL_VERSION_ATLEAST(2,0,10))\n\ntypedef enum\n{\n    SDL_TOUCH_DEVICE_INVALID = -1,\n    SDL_TOUCH_DEVICE_DIRECT,            // touch screen with window-relative coordinates\n    SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, // trackpad with absolute device coordinates\n    SDL_TOUCH_DEVICE_INDIRECT_RELATIVE  // trackpad with screen cursor-relative coordinates\n} SDL_TouchDeviceType;\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetTouchDeviceType is not supported before SDL 2.0.10\")\n#endif\n\nstatic inline SDL_TouchDeviceType SDL_GetTouchDeviceType(SDL_TouchID touchID)\n{\n\treturn SDL_TOUCH_DEVICE_INVALID;\n}\n\n#endif\n\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// TOUCH_MOUSEID is the device ID for mouse events simulated with touch input\nconst TOUCH_MOUSEID = C.SDL_TOUCH_MOUSEID\n\n// TouchID is the ID of a touch device.\ntype TouchID C.SDL_TouchID\n\n// FingerID is a finger id.\ntype FingerID C.SDL_FingerID\n\n// TouchDeviceType is a touch device type.\ntype TouchDeviceType C.SDL_TouchDeviceType\n\nconst (\n\tTOUCH_DEVICE_INVALID           TouchDeviceType = C.SDL_TOUCH_DEVICE_INVALID\n\tTOUCH_DEVICE_DIRECT                            = C.SDL_TOUCH_DEVICE_DIRECT            // touch screen with window-relative coordinates\n\tTOUCH_DEVICE_INDIRECT_ABSOLUTE                 = C.SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE // trackpad with absolute device coordinates\n\tTOUCH_DEVICE_INDIRECT_RELATIVE                 = C.SDL_TOUCH_DEVICE_INDIRECT_RELATIVE // trackpad with screen cursor-relative coordinates\n)\n\n// Finger contains touch information.\ntype Finger struct {\n\tID       FingerID // the finger id\n\tX        float32  // the x-axis location of the touch event, normalized (0...1)\n\tY        float32  // the y-axis location of the touch event, normalized (0...1)\n\tPressure float32  // the quantity of pressure applied, normalized (0...1)\n}\n\nfunc (t TouchID) c() C.SDL_TouchID {\n\treturn C.SDL_TouchID(t)\n}\n\n// GetNumTouchDevices returns the number of registered touch devices.\n// (https://wiki.libsdl.org/SDL_GetNumTouchDevices)\nfunc GetNumTouchDevices() int {\n\treturn int(C.SDL_GetNumTouchDevices())\n}\n\n// GetTouchDevice returns the touch ID with the given index.\n// (https://wiki.libsdl.org/SDL_GetTouchDevice)\nfunc GetTouchDevice(index int) TouchID {\n\treturn TouchID(C.SDL_GetTouchDevice(C.int(index)))\n}\n\n// GetTouchDeviceType returns the type of the given touch device.\n// TODO: (https://wiki.libsdl.org/SDL_GetTouchDeviceType)\nfunc GetTouchDeviceType(id TouchID) TouchDeviceType {\n\treturn TouchDeviceType(C.SDL_GetTouchDeviceType(C.SDL_TouchID(id)))\n}\n\n// GetNumTouchFingers returns the number of active fingers for a given touch device.\n// (https://wiki.libsdl.org/SDL_GetNumTouchFingers)\nfunc GetNumTouchFingers(t TouchID) int {\n\treturn int(C.SDL_GetNumTouchFingers(t.c()))\n}\n\n// GetTouchFinger returns the finger object for specified touch device ID and finger index.\n// (https://wiki.libsdl.org/SDL_GetTouchFinger)\nfunc GetTouchFinger(t TouchID, index int) *Finger {\n\treturn (*Finger)(unsafe.Pointer(C.SDL_GetTouchFinger(t.c(), C.int(index))))\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/version.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if SDL_VERSION_ATLEAST(2,0,16)\n\nstatic inline int GetRevisionNumber(void)\n{\n\treturn 0;\n}\n\n#else\n\nstatic inline int GetRevisionNumber(void)\n{\n\treturn SDL_GetRevisionNumber();\n}\n\n#endif\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// The version of SDL in use.\nconst (\n\tMAJOR_VERSION = C.SDL_MAJOR_VERSION // major version\n\tMINOR_VERSION = C.SDL_MINOR_VERSION // minor version\n\tPATCHLEVEL    = C.SDL_PATCHLEVEL    // update version (patchlevel)\n)\n\n// Version contains information about the version of SDL in use.\n// (https://wiki.libsdl.org/SDL_version)\ntype Version struct {\n\tMajor uint8 // major version\n\tMinor uint8 // minor version\n\tPatch uint8 // update version (patchlevel)\n}\ntype cVersion C.SDL_version\n\nfunc (v *Version) cptr() *C.SDL_version {\n\treturn (*C.SDL_version)(unsafe.Pointer(v))\n}\n\n// VERSION fills the selected struct with the version of SDL in use.\n// (https://wiki.libsdl.org/SDL_VERSION)\nfunc VERSION(v *Version) {\n\tv.Major = MAJOR_VERSION\n\tv.Minor = MINOR_VERSION\n\tv.Patch = PATCHLEVEL\n}\n\n// VERSIONNUM converts separate version components into a single numeric value.\n// (https://wiki.libsdl.org/SDL_VERSIONNUM)\nfunc VERSIONNUM(x, y, z int) int {\n\treturn (x*1000 + y*100 + z)\n}\n\n// COMPILEDVERSION returns the SDL version number that you compiled against.\n// (https://wiki.libsdl.org/SDL_COMPILEDVERSION)\nfunc COMPILEDVERSION() int {\n\treturn VERSIONNUM(MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL)\n}\n\n// VERSION_ATLEAST reports whether the SDL version compiled against is at least as new as the specified version.\n// (https://wiki.libsdl.org/SDL_VERSION_ATLEAST)\nfunc VERSION_ATLEAST(x, y, z int) bool {\n\treturn COMPILEDVERSION() >= VERSIONNUM(x, y, z)\n}\n\n// GetVersion returns the version of SDL that is linked against your program.\n// (https://wiki.libsdl.org/SDL_GetVersion)\nfunc GetVersion(v *Version) {\n\tC.SDL_GetVersion(v.cptr())\n}\n\n// GetRevision returns the code revision of SDL that is linked against your program.\n// (https://wiki.libsdl.org/SDL_GetRevision)\nfunc GetRevision() string {\n\treturn (string)(C.GoString(C.SDL_GetRevision()))\n}\n\n// Deprecated: GetRevisionNumber is deprecated in SDL2 2.0.16 and will return 0. Users should use GetRevision instead.\nfunc GetRevisionNumber() int {\n\treturn (int)(C.GetRevisionNumber())\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/video.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\nstatic inline Sint32 ShowMessageBox(SDL_MessageBoxData data)\n{\n\tSint32 buttonid;\n\tSDL_ShowMessageBox(&data, &buttonid);\n\treturn buttonid;\n}\n\n#if !(SDL_VERSION_ATLEAST(2,0,1))\nstatic void SDL_GL_GetDrawableSize(SDL_Window *window, int *w, int *h)\n{\n\t*w = 0;\n\t*h = 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WINDOW_ALLOW_HIGHDPI is not supported before SDL 2.0.1\")\n#endif\n\n#define SDL_WINDOW_ALLOW_HIGHDPI (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GL_FRAMEBUFFER_SRGB_CAPABLE is not supported before SDL 2.0.1\")\n#endif\n\n#define SDL_GL_FRAMEBUFFER_SRGB_CAPABLE (0)\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,4))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WINDOW_MOUSE_CAPTURE is not supported before SDL 2.0.4\")\n#endif\n\n#define SDL_WINDOW_MOUSE_CAPTURE (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GL_CONTEXT_RELEASE_BEHAVIOR is not supported before SDL 2.0.4\")\n#endif\n\n#define SDL_GL_CONTEXT_RELEASE_BEHAVIOR (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetDisplayDPI is not supported before SDL 2.0.4\")\n#endif\n\nstatic int SDL_GetDisplayDPI(int displayIndex, float* ddpi, float* hdpi, float* vdpi)\n{\n\treturn -1;\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,5))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SetWindowResizable is not supported before SDL 2.0.5\")\n#endif\n\nstatic void SDL_SetWindowResizable(SDL_Window *window, SDL_bool resizable)\n{\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_SetWindowOpacity is not supported before SDL 2.0.5\")\n#endif\n\nstatic int SDL_SetWindowOpacity(SDL_Window *window, float opacity)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetWindowOpacity is not supported before SDL 2.0.5\")\n#endif\n\nstatic int SDL_GetWindowOpacity(SDL_Window *window, float *opacity)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetDisplayUsableBounds is not supported before SDL 2.0.5\")\n#endif\n\nstatic int SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect* rect)\n{\n\treturn -1;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WINDOW_ALWAYS_ON_TOP is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_WINDOW_ALWAYS_ON_TOP (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WINDOW_SKIP_TASKBAR is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_WINDOW_SKIP_TASKBAR (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WINDOW_UTILITY is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_WINDOW_UTILITY (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WINDOW_TOOLTIP is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_WINDOW_TOOLTIP (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WINDOW_POPUP_MENU is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_WINDOW_POPUP_MENU (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WINDOWEVENT_TAKE_FOCUS is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_WINDOWEVENT_TAKE_FOCUS (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WINDOWEVENT_HIT_TEST is not supported before SDL 2.0.5\")\n#endif\n\n#define SDL_WINDOWEVENT_HIT_TEST (0)\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,6))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_WINDOW_VULKAN is not supported before SDL 2.0.6\")\n#endif\n\n#define SDL_WINDOW_VULKAN (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GL_CONTEXT_RESET_NOTIFICATION is not supported before SDL 2.0.6\")\n#endif\n\n#define SDL_GL_CONTEXT_RESET_NOTIFICATION (0)\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GL_CONTEXT_NO_ERROR is not supported before SDL 2.0.6\")\n#endif\n\n#define SDL_GL_CONTEXT_NO_ERROR (0)\n#endif\n\n\n#if !(SDL_VERSION_ATLEAST(2,0,16))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_FlashWindow is not supported before SDL 2.0.16\")\n#pragma message(\"SDL_SetWindowAlwaysOnTop is not supported before SDL 2.0.16\")\n#pragma message(\"SDL_SetWindowKeyboardGrab is not supported before SDL 2.0.16\")\n#endif\n\ntypedef enum\n{\n    SDL_FLASH_CANCEL,                   // Cancel any window flash state\n    SDL_FLASH_BRIEFLY,                  // Flash the window briefly to get attention\n    SDL_FLASH_UNTIL_FOCUSED,            // Flash the window until it gets focus\n} SDL_FlashOperation;\n\nstatic int SDL_FlashWindow(SDL_Window * window, SDL_FlashOperation operation)\n{\n\treturn -1;\n}\n\nstatic void SDL_SetWindowAlwaysOnTop(SDL_Window * window, SDL_bool on_top)\n{\n\treturn;\n}\n\nstatic void SDL_SetWindowKeyboardGrab(SDL_Window * window, SDL_bool grabbed)\n{\n\treturn;\n}\n\n#endif\n\n#if !(SDL_VERSION_ATLEAST(2,0,18))\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_GetWindowICCProfile is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_SetWindowMouseRect is not supported before SDL 2.0.18\")\n#pragma message(\"SDL_GetWindowMouseRect is not supported before SDL 2.0.18\")\n#endif\n\n#define SDL_WINDOWEVENT_ICCPROF_CHANGED (17) // The ICC profile of the window's display has changed.\n#define SDL_WINDOWEVENT_DISPLAY_CHANGED (18) // Window has been moved to display data1.\n\nstatic void* SDLCALL SDL_GetWindowICCProfile(SDL_Window * window, size_t* size)\n{\n\treturn NULL;\n}\n\nstatic int SDL_SetWindowMouseRect(SDL_Window * window, const SDL_Rect * rect)\n{\n\treturn -1;\n}\n\nstatic const SDL_Rect * SDLCALL SDL_GetWindowMouseRect(SDL_Window * window)\n{\n\treturn NULL;\n}\n\n#endif\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// An enumeration of window states.\n// (https://wiki.libsdl.org/SDL_WindowFlags)\nconst (\n\tWINDOW_FULLSCREEN         = C.SDL_WINDOW_FULLSCREEN         // fullscreen window\n\tWINDOW_OPENGL             = C.SDL_WINDOW_OPENGL             // window usable with OpenGL context\n\tWINDOW_SHOWN              = C.SDL_WINDOW_SHOWN              // window is visible\n\tWINDOW_HIDDEN             = C.SDL_WINDOW_HIDDEN             // window is not visible\n\tWINDOW_BORDERLESS         = C.SDL_WINDOW_BORDERLESS         // no window decoration\n\tWINDOW_RESIZABLE          = C.SDL_WINDOW_RESIZABLE          // window can be resized\n\tWINDOW_MINIMIZED          = C.SDL_WINDOW_MINIMIZED          // window is minimized\n\tWINDOW_MAXIMIZED          = C.SDL_WINDOW_MAXIMIZED          // window is maximized\n\tWINDOW_INPUT_GRABBED      = C.SDL_WINDOW_INPUT_GRABBED      // window has grabbed input focus\n\tWINDOW_INPUT_FOCUS        = C.SDL_WINDOW_INPUT_FOCUS        // window has input focus\n\tWINDOW_MOUSE_FOCUS        = C.SDL_WINDOW_MOUSE_FOCUS        // window has mouse focus\n\tWINDOW_FULLSCREEN_DESKTOP = C.SDL_WINDOW_FULLSCREEN_DESKTOP // fullscreen window at the current desktop resolution\n\tWINDOW_FOREIGN            = C.SDL_WINDOW_FOREIGN            // window not created by SDL\n\tWINDOW_ALLOW_HIGHDPI      = C.SDL_WINDOW_ALLOW_HIGHDPI      // window should be created in high-DPI mode if supported (>= SDL 2.0.1)\n\tWINDOW_MOUSE_CAPTURE      = C.SDL_WINDOW_MOUSE_CAPTURE      // window has mouse captured (unrelated to INPUT_GRABBED, >= SDL 2.0.4)\n\tWINDOW_ALWAYS_ON_TOP      = C.SDL_WINDOW_ALWAYS_ON_TOP      // window should always be above others (X11 only, >= SDL 2.0.5)\n\tWINDOW_SKIP_TASKBAR       = C.SDL_WINDOW_SKIP_TASKBAR       // window should not be added to the taskbar (X11 only, >= SDL 2.0.5)\n\tWINDOW_UTILITY            = C.SDL_WINDOW_UTILITY            // window should be treated as a utility window (X11 only, >= SDL 2.0.5)\n\tWINDOW_TOOLTIP            = C.SDL_WINDOW_TOOLTIP            // window should be treated as a tooltip (X11 only, >= SDL 2.0.5)\n\tWINDOW_POPUP_MENU         = C.SDL_WINDOW_POPUP_MENU         // window should be treated as a popup menu (X11 only, >= SDL 2.0.5)\n\tWINDOW_VULKAN             = C.SDL_WINDOW_VULKAN             // window usable for Vulkan surface (>= SDL 2.0.6)\n)\n\n// An enumeration of window events.\n// (https://wiki.libsdl.org/SDL_WindowEventID)\nconst (\n\tWINDOWEVENT_NONE            = C.SDL_WINDOWEVENT_NONE            // (never used)\n\tWINDOWEVENT_SHOWN           = C.SDL_WINDOWEVENT_SHOWN           // window has been shown\n\tWINDOWEVENT_HIDDEN          = C.SDL_WINDOWEVENT_HIDDEN          // window has been hidden\n\tWINDOWEVENT_EXPOSED         = C.SDL_WINDOWEVENT_EXPOSED         // window has been exposed and should be redrawn\n\tWINDOWEVENT_MOVED           = C.SDL_WINDOWEVENT_MOVED           // window has been moved to data1, data2\n\tWINDOWEVENT_RESIZED         = C.SDL_WINDOWEVENT_RESIZED         // window has been resized to data1xdata2; this event is always preceded by WINDOWEVENT_SIZE_CHANGED\n\tWINDOWEVENT_SIZE_CHANGED    = C.SDL_WINDOWEVENT_SIZE_CHANGED    // window size has changed, either as a result of an API call or through the system or user changing the window size; this event is followed by WINDOWEVENT_RESIZED if the size was changed by an external event, i.e. the user or the window manager\n\tWINDOWEVENT_MINIMIZED       = C.SDL_WINDOWEVENT_MINIMIZED       // window has been minimized\n\tWINDOWEVENT_MAXIMIZED       = C.SDL_WINDOWEVENT_MAXIMIZED       // window has been maximized\n\tWINDOWEVENT_RESTORED        = C.SDL_WINDOWEVENT_RESTORED        // window has been restored to normal size and position\n\tWINDOWEVENT_ENTER           = C.SDL_WINDOWEVENT_ENTER           // window has gained mouse focus\n\tWINDOWEVENT_LEAVE           = C.SDL_WINDOWEVENT_LEAVE           // window has lost mouse focus\n\tWINDOWEVENT_FOCUS_GAINED    = C.SDL_WINDOWEVENT_FOCUS_GAINED    // window has gained keyboard focus\n\tWINDOWEVENT_FOCUS_LOST      = C.SDL_WINDOWEVENT_FOCUS_LOST      // window has lost keyboard focus\n\tWINDOWEVENT_CLOSE           = C.SDL_WINDOWEVENT_CLOSE           // the window manager requests that the window be closed\n\tWINDOWEVENT_TAKE_FOCUS      = C.SDL_WINDOWEVENT_TAKE_FOCUS      // window is being offered a focus (should SDL_SetWindowInputFocus() on itself or a subwindow, or ignore) (>= SDL 2.0.5)\n\tWINDOWEVENT_HIT_TEST        = C.SDL_WINDOWEVENT_HIT_TEST        // window had a hit test that wasn't SDL_HITTEST_NORMAL (>= SDL 2.0.5)\n\tWINDOWEVENT_ICCPROF_CHANGED = C.SDL_WINDOWEVENT_ICCPROF_CHANGED // the ICC profile of the window's display has changed\n\tWINDOWEVENT_DISPLAY_CHANGED = C.SDL_WINDOWEVENT_DISPLAY_CHANGED // window has been moved to display data1\n)\n\n// Window position flags.\n// (https://wiki.libsdl.org/SDL_CreateWindow)\nconst (\n\tWINDOWPOS_UNDEFINED_MASK = C.SDL_WINDOWPOS_UNDEFINED_MASK // used to indicate that you don't care what the window position is\n\tWINDOWPOS_UNDEFINED      = C.SDL_WINDOWPOS_UNDEFINED      // used to indicate that you don't care what the window position is\n\tWINDOWPOS_CENTERED_MASK  = C.SDL_WINDOWPOS_CENTERED_MASK  // used to indicate that the window position should be centered\n\tWINDOWPOS_CENTERED       = C.SDL_WINDOWPOS_CENTERED       // used to indicate that the window position should be centered\n)\n\n// An enumeration of message box flags (e.g. if supported message box will display warning icon).\n// (https://wiki.libsdl.org/SDL_MessageBoxFlags)\nconst (\n\tMESSAGEBOX_ERROR       = C.SDL_MESSAGEBOX_ERROR       // error dialog\n\tMESSAGEBOX_WARNING     = C.SDL_MESSAGEBOX_WARNING     // warning dialog\n\tMESSAGEBOX_INFORMATION = C.SDL_MESSAGEBOX_INFORMATION // informational dialog\n)\n\n// Flags for MessageBoxButtonData.\nconst (\n\tMESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = C.SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT // marks the default button when return is hit\n\tMESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = C.SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT // marks the default button when escape is hit\n)\n\n// OpenGL configuration attributes.\n// (https://wiki.libsdl.org/SDL_GL_SetAttribute)\nconst (\n\tGL_RED_SIZE                   = C.SDL_GL_RED_SIZE                   // the minimum number of bits for the red channel of the color buffer; defaults to 3\n\tGL_GREEN_SIZE                 = C.SDL_GL_GREEN_SIZE                 // the minimum number of bits for the green channel of the color buffer; defaults to 3\n\tGL_BLUE_SIZE                  = C.SDL_GL_BLUE_SIZE                  // the minimum number of bits for the blue channel of the color buffer; defaults to 2\n\tGL_ALPHA_SIZE                 = C.SDL_GL_ALPHA_SIZE                 // the minimum number of bits for the alpha channel of the color buffer; defaults to 0\n\tGL_BUFFER_SIZE                = C.SDL_GL_BUFFER_SIZE                // the minimum number of bits for frame buffer size; defaults to 0\n\tGL_DOUBLEBUFFER               = C.SDL_GL_DOUBLEBUFFER               // whether the output is single or double buffered; defaults to double buffering on\n\tGL_DEPTH_SIZE                 = C.SDL_GL_DEPTH_SIZE                 // the minimum number of bits in the depth buffer; defaults to 16\n\tGL_STENCIL_SIZE               = C.SDL_GL_STENCIL_SIZE               // the minimum number of bits in the stencil buffer; defaults to 0\n\tGL_ACCUM_RED_SIZE             = C.SDL_GL_ACCUM_RED_SIZE             // the minimum number of bits for the red channel of the accumulation buffer; defaults to 0\n\tGL_ACCUM_GREEN_SIZE           = C.SDL_GL_ACCUM_GREEN_SIZE           // the minimum number of bits for the green channel of the accumulation buffer; defaults to 0\n\tGL_ACCUM_BLUE_SIZE            = C.SDL_GL_ACCUM_BLUE_SIZE            // the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0\n\tGL_ACCUM_ALPHA_SIZE           = C.SDL_GL_ALPHA_SIZE                 // the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0\n\tGL_STEREO                     = C.SDL_GL_STEREO                     // whether the output is stereo 3D; defaults to off\n\tGL_MULTISAMPLEBUFFERS         = C.SDL_GL_MULTISAMPLEBUFFERS         // the number of buffers used for multisample anti-aliasing; defaults to 0; see Remarks for details\n\tGL_MULTISAMPLESAMPLES         = C.SDL_GL_MULTISAMPLESAMPLES         // the number of samples used around the current pixel used for multisample anti-aliasing; defaults to 0; see Remarks for details\n\tGL_ACCELERATED_VISUAL         = C.SDL_GL_ACCELERATED_VISUAL         // set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either\n\tGL_RETAINED_BACKING           = C.SDL_GL_RETAINED_BACKING           // not used (deprecated)\n\tGL_CONTEXT_MAJOR_VERSION      = C.SDL_GL_CONTEXT_MAJOR_VERSION      // OpenGL context major version\n\tGL_CONTEXT_MINOR_VERSION      = C.SDL_GL_CONTEXT_MINOR_VERSION      // OpenGL context minor version\n\tGL_CONTEXT_EGL                = C.SDL_GL_CONTEXT_EGL                // not used (deprecated)\n\tGL_CONTEXT_FLAGS              = C.SDL_GL_CONTEXT_FLAGS              // some combination of 0 or more of elements of the GLcontextFlag enumeration; defaults to 0 (https://wiki.libsdl.org/SDL_GLcontextFlag)\n\tGL_CONTEXT_PROFILE_MASK       = C.SDL_GL_CONTEXT_PROFILE_MASK       // type of GL context (Core, Compatibility, ES); default value depends on platform (https://wiki.libsdl.org/SDL_GLprofile)\n\tGL_SHARE_WITH_CURRENT_CONTEXT = C.SDL_GL_SHARE_WITH_CURRENT_CONTEXT // OpenGL context sharing; defaults to 0\n\tGL_FRAMEBUFFER_SRGB_CAPABLE   = C.SDL_GL_FRAMEBUFFER_SRGB_CAPABLE   // requests sRGB capable visual; defaults to 0 (>= SDL 2.0.1)\n\tGL_CONTEXT_RELEASE_BEHAVIOR   = C.SDL_GL_CONTEXT_RELEASE_BEHAVIOR   // sets context the release behavior; defaults to 1 (>= SDL 2.0.4)\n\tGL_CONTEXT_RESET_NOTIFICATION = C.SDL_GL_CONTEXT_RESET_NOTIFICATION // (>= SDL 2.0.6)\n\tGL_CONTEXT_NO_ERROR           = C.SDL_GL_CONTEXT_NO_ERROR           // (>= SDL 2.0.6)\n)\n\n// An enumeration of OpenGL profiles.\n// (https://wiki.libsdl.org/SDL_GLprofile)\nconst (\n\tGL_CONTEXT_PROFILE_CORE          = C.SDL_GL_CONTEXT_PROFILE_CORE          // OpenGL core profile - deprecated functions are disabled\n\tGL_CONTEXT_PROFILE_COMPATIBILITY = C.SDL_GL_CONTEXT_PROFILE_COMPATIBILITY // OpenGL compatibility profile - deprecated functions are allowed\n\tGL_CONTEXT_PROFILE_ES            = C.SDL_GL_CONTEXT_PROFILE_ES            // OpenGL ES profile - only a subset of the base OpenGL functionality is available\n)\n\n// An enumeration of OpenGL context configuration flags.\n// (https://wiki.libsdl.org/SDL_GLcontextFlag)\nconst (\n\tGL_CONTEXT_DEBUG_FLAG              = C.SDL_GL_CONTEXT_DEBUG_FLAG              // intended to put the GL into a \"debug\" mode which might offer better developer insights, possibly at a loss of performance\n\tGL_CONTEXT_FORWARD_COMPATIBLE_FLAG = C.SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG // intended to put the GL into a \"forward compatible\" mode, which means that no deprecated functionality will be supported, possibly at a gain in performance, and only applies to GL 3.0 and later contexts\n\tGL_CONTEXT_ROBUST_ACCESS_FLAG      = C.SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG      // intended to require a GL context that supports the GL_ARB_robustness extension--a mode that offers a few APIs that are safer than the usual defaults (think snprintf() vs sprintf())\n\tGL_CONTEXT_RESET_ISOLATION_FLAG    = C.SDL_GL_CONTEXT_RESET_ISOLATION_FLAG    // intended to require the GL to make promises about what to do in the face of driver or hardware failure\n)\n\n//\n// Window flash operation\n//\nconst (\n\tFLASH_CANCEL        FlashOperation = C.SDL_FLASH_CANCEL        // Cancel any window flash state\n\tFLASH_BRIEFLY                      = C.SDL_FLASH_BRIEFLY       // Flash the window briefly to get attention\n\tFLASH_UNTIL_FOCUSED                = C.SDL_FLASH_UNTIL_FOCUSED // Flash the window until it gets focus\n)\n\ntype FlashOperation C.SDL_FlashOperation\n\n// DisplayMode contains the description of a display mode.\n// (https://wiki.libsdl.org/SDL_DisplayMode)\ntype DisplayMode struct {\n\tFormat      uint32         // one of the PixelFormatEnum values (https://wiki.libsdl.org/SDL_PixelFormatEnum)\n\tW           int32          // width, in screen coordinates\n\tH           int32          // height, in screen coordinates\n\tRefreshRate int32          // refresh rate (in Hz), or 0 for unspecified\n\tDriverData  unsafe.Pointer // driver-specific data, initialize to 0\n}\ntype cDisplayMode C.SDL_DisplayMode\n\n// Window is a type used to identify a window.\ntype Window C.SDL_Window\n\n// GLContext is an opaque handle to an OpenGL context.\ntype GLContext C.SDL_GLContext\n\n// GLattr is an OpenGL configuration attribute.\n//(https://wiki.libsdl.org/SDL_GLattr)\ntype GLattr C.SDL_GLattr\n\n// MessageBoxColor contains RGB value used in an MessageBoxColorScheme.\n// (https://wiki.libsdl.org/SDL_MessageBoxColor)\ntype MessageBoxColor struct {\n\tR uint8 // the red component in the range 0-255\n\tG uint8 // the green component in the range 0-255\n\tB uint8 // the blue component in the range 0-255\n}\ntype cMessageBoxColor C.SDL_MessageBoxColor\n\n// MessageBoxColorScheme contains a set of colors to use for message box dialogs.\n// (https://wiki.libsdl.org/SDL_MessageBoxColorScheme)\ntype MessageBoxColorScheme struct {\n\tColors [5]MessageBoxColor // background, text, button border, button background, button selected\n}\ntype cMessageBoxColorScheme C.SDL_MessageBoxColorScheme\n\n// MessageBoxButtonData contains individual button data for a message box.\n// (https://wiki.libsdl.org/SDL_MessageBoxButtonData)\ntype MessageBoxButtonData struct {\n\tFlags    uint32 // MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT\n\tButtonID int32  // user defined button id (value returned via ShowMessageBox())\n\tText     string // the UTF-8 button text\n}\n\n// MessageBoxData contains title, text, window and other data for a message box.\n// (https://wiki.libsdl.org/SDL_MessageBoxData)\ntype MessageBoxData struct {\n\tFlags       uint32  // MESSAGEBOX_ERROR, MESSAGEBOX_WARNING, MESSAGEBOX_INFORMATION\n\tWindow      *Window // parent window or nil\n\tTitle       string\n\tMessage     string\n\tButtons     []MessageBoxButtonData\n\tColorScheme *MessageBoxColorScheme // nil to use system settings\n}\n\nfunc (window *Window) cptr() *C.SDL_Window {\n\treturn (*C.SDL_Window)(unsafe.Pointer(window))\n}\n\nfunc (dm *DisplayMode) cptr() *C.SDL_DisplayMode {\n\treturn (*C.SDL_DisplayMode)(unsafe.Pointer(dm))\n}\n\nfunc (mc *MessageBoxColor) cptr() *C.SDL_MessageBoxColor {\n\treturn (*C.SDL_MessageBoxColor)(unsafe.Pointer(mc))\n}\n\nfunc (mcs *MessageBoxColorScheme) cptr() *C.SDL_MessageBoxColorScheme {\n\treturn (*C.SDL_MessageBoxColorScheme)(unsafe.Pointer(mcs))\n}\n\nfunc (mbd *MessageBoxButtonData) cptr() *C.SDL_MessageBoxButtonData {\n\treturn (*C.SDL_MessageBoxButtonData)(unsafe.Pointer(mbd))\n}\n\nfunc (md *MessageBoxData) cptr() *C.SDL_MessageBoxData {\n\treturn (*C.SDL_MessageBoxData)(unsafe.Pointer(md))\n}\n\nfunc (attr GLattr) c() C.SDL_GLattr {\n\treturn C.SDL_GLattr(attr)\n}\n\n// GetDisplayName returns the name of a display in UTF-8 encoding.\n// (https://wiki.libsdl.org/SDL_GetDisplayName)\nfunc GetDisplayName(displayIndex int) (string, error) {\n\tname := C.SDL_GetDisplayName(C.int(displayIndex))\n\tif name == nil {\n\t\treturn \"\", GetError()\n\t}\n\treturn C.GoString(name), nil\n}\n\n// GetNumVideoDisplays returns the number of available video displays.\n// (https://wiki.libsdl.org/SDL_GetNumVideoDisplays)\nfunc GetNumVideoDisplays() (int, error) {\n\tn := int(C.SDL_GetNumVideoDisplays())\n\treturn n, errorFromInt(n)\n}\n\n// GetNumVideoDrivers returns the number of video drivers compiled into SDL.\n// (https://wiki.libsdl.org/SDL_GetNumVideoDrivers)\nfunc GetNumVideoDrivers() (int, error) {\n\tn := int(C.SDL_GetNumVideoDrivers())\n\treturn n, errorFromInt(n)\n}\n\n// GetVideoDriver returns the name of a built in video driver.\n// (https://wiki.libsdl.org/SDL_GetVideoDriver)\nfunc GetVideoDriver(index int) string {\n\treturn string(C.GoString(C.SDL_GetVideoDriver(C.int(index))))\n}\n\n// VideoInit initializes the video subsystem, optionally specifying a video driver.\n// (https://wiki.libsdl.org/SDL_VideoInit)\nfunc VideoInit(driverName string) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_VideoInit(C.CString(driverName))))\n}\n\n// VideoQuit shuts down the video subsystem, if initialized with VideoInit().\n// (https://wiki.libsdl.org/SDL_VideoQuit)\nfunc VideoQuit() {\n\tC.SDL_VideoQuit()\n}\n\n// GetCurrentVideoDriver returns the name of the currently initialized video driver.\n// (https://wiki.libsdl.org/SDL_GetCurrentVideoDriver)\nfunc GetCurrentVideoDriver() (string, error) {\n\tname := C.SDL_GetCurrentVideoDriver()\n\tif name == nil {\n\t\treturn \"\", GetError()\n\t}\n\treturn C.GoString(name), nil\n}\n\n// GetNumDisplayModes returns the number of available display modes.\n// (https://wiki.libsdl.org/SDL_GetNumDisplayModes)\nfunc GetNumDisplayModes(displayIndex int) (int, error) {\n\tn := int(C.SDL_GetNumDisplayModes(C.int(displayIndex)))\n\treturn n, errorFromInt(n)\n}\n\n// GetDisplayBounds returns the desktop area represented by a display, with the primary display located at 0,0.\n// (https://wiki.libsdl.org/SDL_GetDisplayBounds)\nfunc GetDisplayBounds(displayIndex int) (rect Rect, err error) {\n\terr = errorFromInt(int(\n\t\tC.SDL_GetDisplayBounds(C.int(displayIndex), (&rect).cptr())))\n\treturn\n}\n\n// GetDisplayUsableBounds returns the usable desktop area represented by a display, with the primary display located at 0,0.\n// (https://wiki.libsdl.org/SDL_GetDisplayUsableBounds)\nfunc GetDisplayUsableBounds(displayIndex int) (rect Rect, err error) {\n\terr = errorFromInt(int(\n\t\tC.SDL_GetDisplayUsableBounds(C.int(displayIndex), rect.cptr())))\n\treturn\n}\n\n// GetDisplayMode returns information about a specific display mode.\n// (https://wiki.libsdl.org/SDL_GetDisplayMode)\nfunc GetDisplayMode(displayIndex int, modeIndex int) (mode DisplayMode, err error) {\n\terr = errorFromInt(int(\n\t\tC.SDL_GetDisplayMode(C.int(displayIndex), C.int(modeIndex), (&mode).cptr())))\n\treturn\n}\n\n// GetDesktopDisplayMode returns information about the desktop display mode.\n// (https://wiki.libsdl.org/SDL_GetDesktopDisplayMode)\nfunc GetDesktopDisplayMode(displayIndex int) (mode DisplayMode, err error) {\n\terr = errorFromInt(int(\n\t\tC.SDL_GetDesktopDisplayMode(C.int(displayIndex), (&mode).cptr())))\n\treturn\n}\n\n// GetCurrentDisplayMode returns information about the current display mode.\n// (https://wiki.libsdl.org/SDL_GetCurrentDisplayMode)\nfunc GetCurrentDisplayMode(displayIndex int) (mode DisplayMode, err error) {\n\terr = errorFromInt(int(\n\t\tC.SDL_GetCurrentDisplayMode(C.int(displayIndex), (&mode).cptr())))\n\treturn\n}\n\n// GetClosestDisplayMode returns the closest match to the requested display mode.\n// (https://wiki.libsdl.org/SDL_GetClosestDisplayMode)\nfunc GetClosestDisplayMode(displayIndex int, mode *DisplayMode, closest *DisplayMode) (*DisplayMode, error) {\n\tm := (*DisplayMode)(unsafe.Pointer((C.SDL_GetClosestDisplayMode(C.int(displayIndex), mode.cptr(), closest.cptr()))))\n\tif m == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn m, nil\n}\n\n// GetDisplayDPI returns the dots/pixels-per-inch for a display.\n// (https://wiki.libsdl.org/SDL_GetDisplayDPI)\nfunc GetDisplayDPI(displayIndex int) (ddpi, hdpi, vdpi float32, err error) {\n\terr = errorFromInt(int(\n\t\tC.SDL_GetDisplayDPI(C.int(displayIndex), (*C.float)(unsafe.Pointer(&ddpi)), (*C.float)(unsafe.Pointer(&hdpi)), (*C.float)(unsafe.Pointer(&vdpi)))))\n\treturn\n}\n\n// GetDisplayIndex returns the index of the display associated with the window.\n// (https://wiki.libsdl.org/SDL_GetWindowDisplayIndex)\nfunc (window *Window) GetDisplayIndex() (int, error) {\n\ti := int(C.SDL_GetWindowDisplayIndex(window.cptr()))\n\treturn i, errorFromInt(i)\n}\n\n// SetDisplayMode sets the display mode to use when the window is visible at fullscreen.\n// (https://wiki.libsdl.org/SDL_SetWindowDisplayMode)\nfunc (window *Window) SetDisplayMode(mode *DisplayMode) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetWindowDisplayMode(window.cptr(), mode.cptr())))\n}\n\n// GetDisplayMode fills in information about the display mode to use when the window is visible at fullscreen.\n// (https://wiki.libsdl.org/SDL_GetWindowDisplayMode)\nfunc (window *Window) GetDisplayMode() (mode DisplayMode, err error) {\n\terr = errorFromInt(int(\n\t\tC.SDL_GetWindowDisplayMode(window.cptr(), (&mode).cptr())))\n\treturn\n}\n\n// GetPixelFormat returns the pixel format associated with the window.\n// (https://wiki.libsdl.org/SDL_GetWindowPixelFormat)\nfunc (window *Window) GetPixelFormat() (uint32, error) {\n\tf := (uint32)(C.SDL_GetWindowPixelFormat(window.cptr()))\n\tif f == PIXELFORMAT_UNKNOWN {\n\t\treturn f, GetError()\n\t}\n\treturn f, nil\n}\n\n// CreateWindow creates a window with the specified position, dimensions, and flags.\n// (https://wiki.libsdl.org/SDL_CreateWindow)\nfunc CreateWindow(title string, x, y, w, h int32, flags uint32) (*Window, error) {\n\tvar _window = C.SDL_CreateWindow(C.CString(title), C.int(x), C.int(y), C.int(w), C.int(h), C.Uint32(flags))\n\tif _window == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Window)(unsafe.Pointer(_window)), nil\n}\n\n// CreateWindowFrom creates an SDL window from an existing native window.\n// (https://wiki.libsdl.org/SDL_CreateWindowFrom)\nfunc CreateWindowFrom(data unsafe.Pointer) (*Window, error) {\n\t_window := C.SDL_CreateWindowFrom(data)\n\tif _window == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Window)(unsafe.Pointer(_window)), nil\n}\n\n// Destroy destroys the window.\n// (https://wiki.libsdl.org/SDL_DestroyWindow)\nfunc (window *Window) Destroy() error {\n\tlastErr := GetError()\n\tClearError()\n\tC.SDL_DestroyWindow(window.cptr())\n\terr := GetError()\n\tif err != nil {\n\t\treturn err\n\t}\n\tSetError(lastErr)\n\treturn nil\n}\n\n// GetID returns the numeric ID of the window, for logging purposes.\n//  (https://wiki.libsdl.org/SDL_GetWindowID)\nfunc (window *Window) GetID() (uint32, error) {\n\tid := uint32(C.SDL_GetWindowID(window.cptr()))\n\tif id == 0 {\n\t\treturn 0, GetError()\n\t}\n\treturn id, nil\n}\n\n// GetWindowFromID returns a window from a stored ID.\n// (https://wiki.libsdl.org/SDL_GetWindowFromID)\nfunc GetWindowFromID(id uint32) (*Window, error) {\n\t_window := C.SDL_GetWindowFromID(C.Uint32(id))\n\tif _window == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn (*Window)(unsafe.Pointer((_window))), nil\n}\n\n// GetFlags returns the window flags.\n// (https://wiki.libsdl.org/SDL_GetWindowFlags)\nfunc (window *Window) GetFlags() uint32 {\n\treturn (uint32)(C.SDL_GetWindowFlags(window.cptr()))\n}\n\n// SetTitle sets the title of the window.\n// (https://wiki.libsdl.org/SDL_SetWindowTitle)\nfunc (window *Window) SetTitle(title string) {\n\tC.SDL_SetWindowTitle(window.cptr(), C.CString(title))\n}\n\n// GetTitle returns the title of the window.\n// (https://wiki.libsdl.org/SDL_GetWindowTitle)\nfunc (window *Window) GetTitle() string {\n\treturn C.GoString(C.SDL_GetWindowTitle(window.cptr()))\n}\n\n// SetIcon sets the icon for the window.\n// (https://wiki.libsdl.org/SDL_SetWindowIcon)\nfunc (window *Window) SetIcon(icon *Surface) {\n\tC.SDL_SetWindowIcon(window.cptr(), icon.cptr())\n}\n\n// SetData associates an arbitrary named pointer with the window.\n// (https://wiki.libsdl.org/SDL_SetWindowData)\nfunc (window *Window) SetData(name string, userdata unsafe.Pointer) unsafe.Pointer {\n\treturn unsafe.Pointer(C.SDL_SetWindowData(window.cptr(), C.CString(name), userdata))\n}\n\n// GetData returns the data pointer associated with the window.\n// (https://wiki.libsdl.org/SDL_GetWindowData)\nfunc (window *Window) GetData(name string) unsafe.Pointer {\n\treturn unsafe.Pointer(C.SDL_GetWindowData(window.cptr(), C.CString(name)))\n}\n\n// SetPosition sets the position of the window.\n// (https://wiki.libsdl.org/SDL_SetWindowPosition)\nfunc (window *Window) SetPosition(x, y int32) {\n\tC.SDL_SetWindowPosition(window.cptr(), C.int(x), C.int(y))\n}\n\n// GetPosition returns the position of the window.\n// (https://wiki.libsdl.org/SDL_GetWindowPosition)\nfunc (window *Window) GetPosition() (x, y int32) {\n\tvar _x, _y C.int\n\tC.SDL_GetWindowPosition(window.cptr(), &_x, &_y)\n\treturn int32(_x), int32(_y)\n}\n\n// SetResizable sets the user-resizable state of the window.\n// (https://wiki.libsdl.org/SDL_SetWindowResizable)\nfunc (window *Window) SetResizable(resizable bool) {\n\tC.SDL_SetWindowResizable(window.cptr(), C.SDL_bool(Btoi(resizable)))\n}\n\n// SetSize sets the size of the window's client area.\n// (https://wiki.libsdl.org/SDL_SetWindowSize)\nfunc (window *Window) SetSize(w, h int32) {\n\tC.SDL_SetWindowSize(window.cptr(), C.int(w), C.int(h))\n}\n\n// GetSize returns the size of the window's client area.\n// (https://wiki.libsdl.org/SDL_GetWindowSize)\nfunc (window *Window) GetSize() (w, h int32) {\n\tvar _w, _h C.int\n\tC.SDL_GetWindowSize(window.cptr(), &_w, &_h)\n\treturn int32(_w), int32(_h)\n}\n\n// SetMinimumSize sets the minimum size of the window's client area.\n// (https://wiki.libsdl.org/SDL_SetWindowMinimumSize)\nfunc (window *Window) SetMinimumSize(minW, minH int32) {\n\tC.SDL_SetWindowMinimumSize(window.cptr(), C.int(minW), C.int(minH))\n}\n\n// GetMinimumSize returns the minimum size of the window's client area.\n// (https://wiki.libsdl.org/SDL_GetWindowMinimumSize)\nfunc (window *Window) GetMinimumSize() (w, h int32) {\n\tvar _w, _h C.int\n\tC.SDL_GetWindowMinimumSize(window.cptr(), &_w, &_h)\n\treturn int32(_w), int32(_h)\n}\n\n// SetMaximumSize sets the maximum size of the window's client area.\n// (https://wiki.libsdl.org/SDL_SetWindowMaximumSize)\nfunc (window *Window) SetMaximumSize(maxW, maxH int32) {\n\tC.SDL_SetWindowMaximumSize(window.cptr(), C.int(maxW), C.int(maxH))\n}\n\n// GetMaximumSize returns the maximum size of the window's client area.\n// (https://wiki.libsdl.org/SDL_GetWindowMaximumSize)\nfunc (window *Window) GetMaximumSize() (w, h int32) {\n\tvar _w, _h C.int\n\tC.SDL_GetWindowMaximumSize(window.cptr(), &_w, &_h)\n\treturn int32(_w), int32(_h)\n}\n\n// SetBordered sets the border state of the window.\n// (https://wiki.libsdl.org/SDL_SetWindowBordered)\nfunc (window *Window) SetBordered(bordered bool) {\n\tC.SDL_SetWindowBordered(window.cptr(), C.SDL_bool(Btoi(bordered)))\n}\n\n// Show shows the window.\n// (https://wiki.libsdl.org/SDL_ShowWindow)\nfunc (window *Window) Show() {\n\tC.SDL_ShowWindow(window.cptr())\n}\n\n// Hide hides the window.\n// (https://wiki.libsdl.org/SDL_HideWindow)\nfunc (window *Window) Hide() {\n\tC.SDL_HideWindow(window.cptr())\n}\n\n// Raise raises the window above other windows and set the input focus.\n// (https://wiki.libsdl.org/SDL_RaiseWindow)\nfunc (window *Window) Raise() {\n\tC.SDL_RaiseWindow(window.cptr())\n}\n\n// Maximize makes the window as large as possible.\n// (https://wiki.libsdl.org/SDL_MaximizeWindow)\nfunc (window *Window) Maximize() {\n\tC.SDL_MaximizeWindow(window.cptr())\n}\n\n// Minimize minimizes the window to an iconic representation.\n// (https://wiki.libsdl.org/SDL_MinimizeWindow)\nfunc (window *Window) Minimize() {\n\tC.SDL_MinimizeWindow(window.cptr())\n}\n\n// Restore restores the size and position of a minimized or maximized window.\n// (https://wiki.libsdl.org/SDL_RestoreWindow)\nfunc (window *Window) Restore() {\n\tC.SDL_RestoreWindow(window.cptr())\n}\n\n// SetFullscreen sets the window's fullscreen state.\n// (https://wiki.libsdl.org/SDL_SetWindowFullscreen)\nfunc (window *Window) SetFullscreen(flags uint32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetWindowFullscreen(window.cptr(), C.Uint32(flags))))\n}\n\n// GetSurface returns the SDL surface associated with the window.\n// (https://wiki.libsdl.org/SDL_GetWindowSurface)\nfunc (window *Window) GetSurface() (*Surface, error) {\n\tsurface := (*Surface)(unsafe.Pointer(C.SDL_GetWindowSurface(window.cptr())))\n\tif surface == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn surface, nil\n}\n\n// UpdateSurface copies the window surface to the screen.\n// (https://wiki.libsdl.org/SDL_UpdateWindowSurface)\nfunc (window *Window) UpdateSurface() error {\n\treturn errorFromInt(int(\n\t\tC.SDL_UpdateWindowSurface(window.cptr())))\n}\n\n// UpdateSurfaceRects copies areas of the window surface to the screen.\n// (https://wiki.libsdl.org/SDL_UpdateWindowSurfaceRects)\nfunc (window *Window) UpdateSurfaceRects(rects []Rect) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_UpdateWindowSurfaceRects(window.cptr(), rects[0].cptr(), C.int(len(rects)))))\n}\n\n// SetGrab sets the window's input grab mode.\n// (https://wiki.libsdl.org/SDL_SetWindowGrab)\nfunc (window *Window) SetGrab(grabbed bool) {\n\tC.SDL_SetWindowGrab(window.cptr(), C.SDL_bool((Btoi(grabbed))))\n}\n\n// GetGrab returns the window's input grab mode.\n// (https://wiki.libsdl.org/SDL_GetWindowGrab)\nfunc (window *Window) GetGrab() bool {\n\treturn C.SDL_GetWindowGrab(window.cptr()) != 0\n}\n\n// SetBrightness sets the brightness (gamma multiplier) for the display that owns the given window.\n// (https://wiki.libsdl.org/SDL_SetWindowBrightness)\nfunc (window *Window) SetBrightness(brightness float32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetWindowBrightness(window.cptr(), C.float(brightness))))\n}\n\n// GetBrightness returns the brightness (gamma multiplier) for the display that owns the given window.\n// (https://wiki.libsdl.org/SDL_GetWindowBrightness)\nfunc (window *Window) GetBrightness() float32 {\n\treturn float32(C.SDL_GetWindowBrightness(window.cptr()))\n}\n\n// SetGammaRamp sets the gamma ramp for the display that owns the given window.\n// (https://wiki.libsdl.org/SDL_SetWindowGammaRamp)\nfunc (window *Window) SetGammaRamp(red, green, blue *[256]uint16) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetWindowGammaRamp(\n\t\t\twindow.cptr(),\n\t\t\t(*C.Uint16)(unsafe.Pointer(red)),\n\t\t\t(*C.Uint16)(unsafe.Pointer(green)),\n\t\t\t(*C.Uint16)(unsafe.Pointer(blue)))))\n}\n\n// GetGammaRamp returns the gamma ramp for the display that owns a given window.\n// (https://wiki.libsdl.org/SDL_GetWindowGammaRamp)\nfunc (window *Window) GetGammaRamp() (red, green, blue *[256]uint16, err error) {\n\tcode := int(C.SDL_GetWindowGammaRamp(\n\t\twindow.cptr(),\n\t\t(*C.Uint16)(unsafe.Pointer(red)),\n\t\t(*C.Uint16)(unsafe.Pointer(green)),\n\t\t(*C.Uint16)(unsafe.Pointer(blue))))\n\treturn red, green, blue, errorFromInt(code)\n}\n\n// SetWindowOpacity sets the opacity of the window.\n// (https://wiki.libsdl.org/SDL_SetWindowOpacity)\nfunc (window *Window) SetWindowOpacity(opacity float32) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_SetWindowOpacity(window.cptr(), C.float(opacity))))\n}\n\n// GetWindowOpacity returns the opacity of the window.\n// (https://wiki.libsdl.org/SDL_GetWindowOpacity)\nfunc (window *Window) GetWindowOpacity() (opacity float32, err error) {\n\treturn opacity, errorFromInt(int(\n\t\tC.SDL_GetWindowOpacity(window.cptr(), (*C.float)(unsafe.Pointer(&opacity)))))\n}\n\n// ShowSimpleMessageBox displays a simple modal message box.\n// (https://wiki.libsdl.org/SDL_ShowSimpleMessageBox)\nfunc ShowSimpleMessageBox(flags uint32, title, message string, window *Window) error {\n\t_title := C.CString(title)\n\tdefer C.free(unsafe.Pointer(_title))\n\t_message := C.CString(message)\n\tdefer C.free(unsafe.Pointer(_message))\n\treturn errorFromInt(int(\n\t\tC.SDL_ShowSimpleMessageBox(C.Uint32(flags), _title, _message, window.cptr())))\n}\n\n// ShowMessageBox creates a modal message box.\n// (https://wiki.libsdl.org/SDL_ShowMessageBox)\nfunc ShowMessageBox(data *MessageBoxData) (buttonid int32, err error) {\n\t_title := C.CString(data.Title)\n\tdefer C.free(unsafe.Pointer(_title))\n\t_message := C.CString(data.Message)\n\tdefer C.free(unsafe.Pointer(_message))\n\n\tvar cbuttons []C.SDL_MessageBoxButtonData\n\tvar cbtntexts []*C.char\n\tdefer func(texts []*C.char) {\n\t\tfor _, t := range texts {\n\t\t\tC.free(unsafe.Pointer(t))\n\t\t}\n\t}(cbtntexts)\n\n\tfor _, btn := range data.Buttons {\n\t\tctext := C.CString(btn.Text)\n\t\tcbtn := C.SDL_MessageBoxButtonData{\n\t\t\tflags:    C.Uint32(btn.Flags),\n\t\t\tbuttonid: C.int(btn.ButtonID),\n\t\t\ttext:     ctext,\n\t\t}\n\n\t\tcbuttons = append(cbuttons, cbtn)\n\t\tcbtntexts = append(cbtntexts, ctext)\n\t}\n\n\tvar buttonPtr *C.SDL_MessageBoxButtonData\n\tif len(cbuttons) > 0 {\n\t\tbuttonPtr = &cbuttons[0]\n\t}\n\tcdata := C.SDL_MessageBoxData{\n\t\tflags:       C.Uint32(data.Flags),\n\t\twindow:      data.Window.cptr(),\n\t\ttitle:       _title,\n\t\tmessage:     _message,\n\t\tnumbuttons:  C.int(len(data.Buttons)),\n\t\tbuttons:     buttonPtr,\n\t\tcolorScheme: data.ColorScheme.cptr(),\n\t}\n\n\tbuttonid = int32(C.ShowMessageBox(cdata))\n\treturn buttonid, errorFromInt(int(buttonid))\n}\n\n// IsScreenSaverEnabled reports whether the screensaver is currently enabled.\n// (https://wiki.libsdl.org/SDL_IsScreenSaverEnabled)\nfunc IsScreenSaverEnabled() bool {\n\treturn C.SDL_IsScreenSaverEnabled() != 0\n}\n\n// EnableScreenSaver allows the screen to be blanked by a screen saver.\n// (https://wiki.libsdl.org/SDL_EnableScreenSaver)\nfunc EnableScreenSaver() {\n\tC.SDL_EnableScreenSaver()\n}\n\n// DisableScreenSaver prevents the screen from being blanked by a screen saver.\n// (https://wiki.libsdl.org/SDL_DisableScreenSaver)\nfunc DisableScreenSaver() {\n\tC.SDL_DisableScreenSaver()\n}\n\n// GLLoadLibrary dynamically loads an OpenGL library.\n// (https://wiki.libsdl.org/SDL_GL_LoadLibrary)\nfunc GLLoadLibrary(path string) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_GL_LoadLibrary(C.CString(path))))\n}\n\n// GLGetProcAddress returns an OpenGL function by name.\n// (https://wiki.libsdl.org/SDL_GL_GetProcAddress)\nfunc GLGetProcAddress(proc string) unsafe.Pointer {\n\treturn unsafe.Pointer(C.SDL_GL_GetProcAddress(C.CString(proc)))\n}\n\n// GLUnloadLibrary unloads the OpenGL library previously loaded by GLLoadLibrary().\n// (https://wiki.libsdl.org/SDL_GL_UnloadLibrary)\nfunc GLUnloadLibrary() {\n\tC.SDL_GL_UnloadLibrary()\n}\n\n// GLExtensionSupported reports whether an OpenGL extension is supported for the current context.\n// (https://wiki.libsdl.org/SDL_GL_ExtensionSupported)\nfunc GLExtensionSupported(extension string) bool {\n\treturn C.SDL_GL_ExtensionSupported(C.CString(extension)) != 0\n}\n\n// GLSetAttribute sets an OpenGL window attribute before window creation.\n// (https://wiki.libsdl.org/SDL_GL_SetAttribute)\nfunc GLSetAttribute(attr GLattr, value int) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_GL_SetAttribute(attr.c(), C.int(value))))\n}\n\n// GLGetAttribute returns the actual value for an attribute from the current context.\n// (https://wiki.libsdl.org/SDL_GL_GetAttribute)\nfunc GLGetAttribute(attr GLattr) (int, error) {\n\tvar _value C.int\n\tif C.SDL_GL_GetAttribute(attr.c(), &_value) != 0 {\n\t\treturn int(_value), GetError()\n\t}\n\treturn int(_value), nil\n}\n\n// GLCreateContext creates an OpenGL context for use with an OpenGL window, and make it current.\n// (https://wiki.libsdl.org/SDL_GL_CreateContext)\nfunc (window *Window) GLCreateContext() (GLContext, error) {\n\tc := GLContext(C.SDL_GL_CreateContext(window.cptr()))\n\tif c == nil {\n\t\treturn nil, GetError()\n\t}\n\treturn c, nil\n}\n\n// GLMakeCurrent sets up an OpenGL context for rendering into an OpenGL window.\n// (https://wiki.libsdl.org/SDL_GL_MakeCurrent)\nfunc (window *Window) GLMakeCurrent(glcontext GLContext) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_GL_MakeCurrent(window.cptr(), C.SDL_GLContext(glcontext))))\n}\n\n// GLSetSwapInterval sets the swap interval for the current OpenGL context.\n// (https://wiki.libsdl.org/SDL_GL_SetSwapInterval)\nfunc GLSetSwapInterval(interval int) error {\n\treturn errorFromInt(int(\n\t\tC.SDL_GL_SetSwapInterval(C.int(interval))))\n}\n\n// GLGetSwapInterval returns the swap interval for the current OpenGL context.\n// (https://wiki.libsdl.org/SDL_GL_GetSwapInterval)\nfunc GLGetSwapInterval() (int, error) {\n\ti := int(C.SDL_GL_GetSwapInterval())\n\t// -1 means adaptive vsync, not an error\n\t// 0 means vsync off\n\t// 1 means vsync on\n\tif i == -1 || i == 0 || i == 1 {\n\t\treturn i, nil\n\t}\n\t// any other value should be an error\n\treturn i, errorFromInt(i)\n}\n\n// GLGetDrawableSize returns the size of a window's underlying drawable in pixels (for use with glViewport).\n// (https://wiki.libsdl.org/SDL_GL_GetDrawableSize)\nfunc (window *Window) GLGetDrawableSize() (w, h int32) {\n\tvar _w, _h C.int\n\tC.SDL_GL_GetDrawableSize(window.cptr(), &_w, &_h)\n\treturn int32(_w), int32(_h)\n}\n\n// GLSwap updates a window with OpenGL rendering.\n// (https://wiki.libsdl.org/SDL_GL_SwapWindow)\nfunc (window *Window) GLSwap() {\n\tC.SDL_GL_SwapWindow(window.cptr())\n}\n\n// GLDeleteContext deletes an OpenGL context.\n// (https://wiki.libsdl.org/SDL_GL_DeleteContext)\nfunc GLDeleteContext(context GLContext) {\n\tC.SDL_GL_DeleteContext(C.SDL_GLContext(context))\n}\n\n// Flash requests the window to demand attention from the user.\n// (https://wiki.libsdl.org/SDL_FlashWindow)\nfunc (window *Window) Flash(operation FlashOperation) (err error) {\n\treturn errorFromInt(int(C.SDL_FlashWindow(window.cptr(), C.SDL_FlashOperation(operation))))\n}\n\n// SetAlwaysOnTop sets the window to always be above the others.\n// (https://wiki.libsdl.org/SDL_SetWindowAlwaysOnTop)\nfunc (window *Window) SetAlwaysOnTop(onTop bool) {\n\tC.SDL_SetWindowAlwaysOnTop(window.cptr(), C.SDL_bool(Btoi(onTop)))\n}\n\n// SetKeyboardGrab sets a window's keyboard grab mode.\n// (https://wiki.libsdl.org/SDL_GetWindowKeyboardGrab)\nfunc (window *Window) SetKeyboardGrab(grabbed bool) {\n\tC.SDL_SetWindowKeyboardGrab(window.cptr(), C.SDL_bool(Btoi(grabbed)))\n}\n\n// GetICCProfile gets the raw ICC profile data for the screen the window is currently on.\n//\n// Data returned should be freed with SDL_free.\n//\n// (https://wiki.libsdl.org/SDL_GetWindowICCProfile)\nfunc (window *Window) GetICCProfile() (iccProfile unsafe.Pointer, size uintptr, err error) {\n\t_size := (*C.size_t)(unsafe.Pointer(&size))\n\ticcProfile = C.SDL_GetWindowICCProfile(window.cptr(), _size)\n\tif iccProfile == nil {\n\t\terr = GetError()\n\t}\n\treturn\n}\n\n// SetMouseRect confines the cursor to the specified area of a window.\n//\n// Note that this does NOT grab the cursor, it only defines the area a cursor\n// is restricted to when the window has mouse focus.\n//\n// (https://wiki.libsdl.org/SDL_SetWindowMouseRect)\nfunc (window *Window) SetMouseRect(rect Rect) (err error) {\n\t_rect := (*C.SDL_Rect)(unsafe.Pointer(&rect))\n\terr = errorFromInt(int(C.SDL_SetWindowMouseRect(window.cptr(), _rect)))\n\treturn\n}\n\n// GetMouseRect gets the mouse confinement rectangle of a window.\n// (https://wiki.libsdl.org/SDL_GetWindowMouseRect)\nfunc (window *Window) GetMouseRect() (rect Rect) {\n\t_rect := C.SDL_GetWindowMouseRect(window.cptr())\n\trect = *((*Rect)(unsafe.Pointer(_rect)))\n\treturn\n}\n"
  },
  {
    "path": "go/vendor/github.com/veandco/go-sdl2/sdl/vulkan.go",
    "content": "package sdl\n\n/*\n#include \"sdl_wrapper.h\"\n\n#if (SDL_VERSION_ATLEAST(2,0,6))\n#if defined(_WIN32)\n\t#include <SDL2/SDL_vulkan.h>\n#else\n\t#include <SDL_vulkan.h>\n#endif\n#else //!SDL_VERSION_ATLEAST(2,0,6)\n\n#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object;\n#if defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)\n#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object;\n#else\n#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object;\n#endif\n\nVK_DEFINE_HANDLE(VkInstance)\nVK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR)\ntypedef VkInstance SDL_vulkanInstance;\ntypedef VkSurfaceKHR SDL_vulkanSurface;\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_Vulkan_LoadLibrary is not supported before SDL 2.0.6\")\n#endif\n\nstatic int SDL_Vulkan_LoadLibrary(const char *path)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_Vulkan_GetVkGetInstanceProcAddr is not supported before SDL 2.0.6\")\n#endif\n\nstatic void* SDL_Vulkan_GetVkGetInstanceProcAddr(void)\n{\n\treturn NULL;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_Vulkan_UnloadLibrary is not supported before SDL 2.0.6\")\n#endif\n\nstatic void SDL_Vulkan_UnloadLibrary(void) {}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_Vulkan_GetInstanceExtensions is not supported before SDL 2.0.6\")\n#endif\n\nstatic int SDL_Vulkan_GetInstanceExtensions(SDL_Window *window, unsigned int *pCount, const char **pNames)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_Vulkan_CreateSurface is not supported before SDL 2.0.6\")\n#endif\n\nstatic int SDL_Vulkan_CreateSurface(SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface)\n{\n\treturn 0;\n}\n\n\n#if defined(WARN_OUTDATED)\n#pragma message(\"SDL_Vulkan_GetDrawableSize is not supported before SDL 2.0.6\")\n#endif\n\nstatic void SDL_Vulkan_GetDrawableSize(SDL_Window *window, int *w, int *h) {\n\t*w = 0;\n\t*h = 0;\n}\n\n#endif\n*/\nimport \"C\"\nimport (\n\t\"errors\"\n\t\"reflect\"\n\t\"unsafe\"\n)\n\n// VulkanLoadLibrary dynamically loads a Vulkan loader library.\n// (https://wiki.libsdl.org/SDL_Vulkan_LoadLibrary)\nfunc VulkanLoadLibrary(path string) error {\n\tvar ret C.int\n\tif path == \"\" {\n\t\tret = C.SDL_Vulkan_LoadLibrary(nil)\n\t} else {\n\t\tcpath := C.CString(path)\n\t\tdefer C.free(unsafe.Pointer(cpath))\n\t\tret = C.SDL_Vulkan_LoadLibrary(cpath)\n\t}\n\tif int(ret) == -1 {\n\t\treturn GetError()\n\t}\n\treturn nil\n}\n\n// VulkanGetVkGetInstanceProcAddr gets the address of the vkGetInstanceProcAddr function.\n// (https://wiki.libsdl.org/SDL_Vulkan_GetVkInstanceProcAddr)\nfunc VulkanGetVkGetInstanceProcAddr() unsafe.Pointer {\n\treturn C.SDL_Vulkan_GetVkGetInstanceProcAddr()\n}\n\n// VulkanUnloadLibrary unloads the Vulkan loader library previously loaded by VulkanLoadLibrary().\n// (https://wiki.libsdl.org/SDL_Vulkan_UnloadLibrary)\nfunc VulkanUnloadLibrary() {\n\tC.SDL_Vulkan_UnloadLibrary()\n}\n\n// VulkanGetInstanceExtensions gets the names of the Vulkan instance extensions needed to create a surface with VulkanCreateSurface().\n// (https://wiki.libsdl.org/SDL_Vulkan_GetInstanceExtensions)\nfunc (window *Window) VulkanGetInstanceExtensions() []string {\n\tvar count C.uint\n\tC.SDL_Vulkan_GetInstanceExtensions(window.cptr(), &count, nil)\n\tif count == 0 {\n\t\treturn nil\n\t}\n\n\tstrptrs := make([]*C.char, uint(count))\n\tC.SDL_Vulkan_GetInstanceExtensions(window.cptr(), &count, &strptrs[0])\n\textensions := make([]string, uint(count))\n\tfor i := range strptrs {\n\t\textensions[i] = C.GoString(strptrs[i])\n\t}\n\treturn extensions\n}\n\n// VulkanCreateSurface creates a Vulkan rendering surface for a window.\n// (https://wiki.libsdl.org/SDL_Vulkan_CreateSurface)\nfunc (window *Window) VulkanCreateSurface(instance interface{}) (surface unsafe.Pointer, err error) {\n\tif instance == nil {\n\t\treturn nil, errors.New(\"vulkan: instance is nil\")\n\t}\n\tval := reflect.ValueOf(instance)\n\tif val.Kind() != reflect.Ptr {\n\t\treturn nil, errors.New(\"vulkan: instance is not a VkInstance (expected kind Ptr, got \" + val.Kind().String() + \")\")\n\t}\n\tvar vulkanSurface C.VkSurfaceKHR\n\tif C.SDL_Vulkan_CreateSurface(window.cptr(),\n\t\t(C.VkInstance)(unsafe.Pointer(val.Pointer())),\n\t\t(*C.VkSurfaceKHR)(unsafe.Pointer(&vulkanSurface))) == C.SDL_FALSE {\n\n\t\treturn nil, GetError()\n\t}\n\treturn unsafe.Pointer(&vulkanSurface), nil\n}\n\n// VulkanGetDrawableSize gets the size of a window's underlying drawable in pixels (for use with setting viewport, scissor & etc).\n// (https://wiki.libsdl.org/SDL_Vulkan_GetDrawableSize)\nfunc (window *Window) VulkanGetDrawableSize() (w, h int32) {\n\tvar _w, _h C.int\n\tC.SDL_Vulkan_GetDrawableSize(window.cptr(), &_w, &_h)\n\treturn int32(_w), int32(_h)\n}\n"
  },
  {
    "path": "go/vendor/modules.txt",
    "content": "# github.com/veandco/go-sdl2 v0.4.36\n## explicit; go 1.15\ngithub.com/veandco/go-sdl2/_libs\ngithub.com/veandco/go-sdl2/img\ngithub.com/veandco/go-sdl2/sdl\n"
  },
  {
    "path": "haskell/.gitignore",
    "content": ".stack-work/\n*~"
  },
  {
    "path": "haskell/Makefile",
    "content": ".PHONY: all msg clean fullclean main\n\nall: msg main\n\nmsg:\n\t@echo '--- Haskell ---'\n\nmain: src/Lib.hs app/Main.hs\n\tstack build\n\nrun: msg\n\ttime stack run\n\nclean:\n\tstack clean\n\nfullclean: clean\n"
  },
  {
    "path": "haskell/README.md",
    "content": "## SDL2 example for Haskell\n\nRequires `stack` and `SDL2`.\n\n### Building\n\n    stack setup\n    stack build\n\n### Running\n\n    stack exec grumpycat-exe\n\nOr simply\n\n    stack run\n\n### Source code\n\nThe source code is in `src/Lib.hs` (library) and `app/Main.hs` (executable).\n\nThe main package configuration file is `package.yaml`. The `.cabal` file is generated by Stack.\n"
  },
  {
    "path": "haskell/Setup.hs",
    "content": "import Distribution.Simple\nmain = defaultMain\n"
  },
  {
    "path": "haskell/app/Main.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Main where\n\nimport Lib\nimport Foreign.C.Types\nimport SDL.Vect\nimport qualified SDL\nimport System.FilePath\nimport System.Directory (getCurrentDirectory)\n\nscreenWidth, screenHeight :: CInt\n(screenWidth, screenHeight) = (620, 387)\n\nmain :: IO ()\nmain = do\n  SDL.initializeAll\n  win <- SDL.createWindow \"Hello World!\" SDL.defaultWindow { SDL.windowInitialSize = V2 screenWidth screenHeight }\n  ren <- SDL.createRenderer win (-1) SDL.defaultRenderer\n  -- Load the image from ../img/grumpy-cat.bmp\n  currentDirectory <- getCurrentDirectory\n  let imageFileName = currentDirectory </> \"..\" </> \"img\" </> \"grumpy-cat.bmp\"\n  putStrLn (\"Loading \" ++ imageFileName)\n  bmp <- SDL.loadBMP imageFileName\n  -- Create a texture from the surface\n  tex <- SDL.createTextureFromSurface ren bmp\n  -- Render the image in a loop for 2 seconds (20 * 100ms)\n  mainLoop ren tex 20\n  SDL.destroyWindow win\n"
  },
  {
    "path": "haskell/grumpycat.cabal",
    "content": "cabal-version: 1.12\n\n-- This file has been generated from package.yaml by hpack version 0.35.0.\n--\n-- see: https://github.com/sol/hpack\n\nname:           grumpycat\nversion:        0.1.0.0\ndescription:    Please see the README on GitHub at <https://github.com/githubuser/grumpycat#readme>\nhomepage:       https://github.com/githubuser/grumpycat#readme\nbug-reports:    https://github.com/githubuser/grumpycat/issues\nauthor:         Author name here\nmaintainer:     example@example.com\ncopyright:      2022 Author name here\nlicense:        BSD3\nbuild-type:     Simple\nextra-source-files:\n    README.md\n\nsource-repository head\n  type: git\n  location: https://github.com/githubuser/grumpycat\n\nlibrary\n  exposed-modules:\n      Lib\n  other-modules:\n      Paths_grumpycat\n  hs-source-dirs:\n      src\n  build-depends:\n      base >=4.7 && <5\n    , directory\n    , filepath\n    , sdl2\n  default-language: Haskell2010\n\nexecutable grumpycat-exe\n  main-is: Main.hs\n  other-modules:\n      Paths_grumpycat\n  hs-source-dirs:\n      app\n  ghc-options: -threaded -rtsopts -with-rtsopts=-N\n  build-depends:\n      base >=4.7 && <5\n    , directory\n    , filepath\n    , grumpycat\n    , sdl2\n  default-language: Haskell2010\n\ntest-suite grumpycat-test\n  type: exitcode-stdio-1.0\n  main-is: Spec.hs\n  other-modules:\n      Paths_grumpycat\n  hs-source-dirs:\n      test\n  ghc-options: -threaded -rtsopts -with-rtsopts=-N\n  build-depends:\n      base >=4.7 && <5\n    , directory\n    , filepath\n    , grumpycat\n    , sdl2\n  default-language: Haskell2010\n"
  },
  {
    "path": "haskell/package.yaml",
    "content": "name:                grumpycat\nversion:             0.1.0.0\ngithub:              \"githubuser/grumpycat\"\nlicense:             BSD3\nauthor:              \"Author name here\"\nmaintainer:          \"example@example.com\"\ncopyright:           \"2022 Author name here\"\n\nextra-source-files:\n- README.md\n\n# Metadata used when publishing your package\n# synopsis:            Short description of your package\n# category:            Web\n\n# To avoid duplicated efforts in documentation and dealing with the\n# complications of embedding Haddock markup inside cabal files, it is\n# common to point users to the README.md file.\ndescription:         Please see the README on GitHub at <https://github.com/githubuser/grumpycat#readme>\n\ndependencies:\n- base >= 4.7 && < 5\n- sdl2\n- filepath\n- directory\n\nlibrary:\n  source-dirs: src\n\nexecutables:\n  grumpycat-exe:\n    main:                Main.hs\n    source-dirs:         app\n    ghc-options:\n    - -threaded\n    - -rtsopts\n    - -with-rtsopts=-N\n    dependencies:\n    - grumpycat\n\ntests:\n  grumpycat-test:\n    main:                Spec.hs\n    source-dirs:         test\n    ghc-options:\n    - -threaded\n    - -rtsopts\n    - -with-rtsopts=-N\n    dependencies:\n    - grumpycat\n"
  },
  {
    "path": "haskell/src/Lib.hs",
    "content": "{-# LANGUAGE OverloadedStrings #-}\nmodule Lib\n    ( mainLoop\n    ) where\n\nimport SDL\n\nmainLoop :: Renderer -> Texture -> Int -> IO ()\nmainLoop ren tex 0 = return ()\nmainLoop ren tex n = do\n  -- Present the texture and wait 100 ms\n  SDL.clear ren\n  SDL.copy ren tex Nothing Nothing\n  SDL.present ren\n  SDL.delay 100\n  -- Call mainLoop recursively until n is 0\n  mainLoop ren tex (n - 1)\n"
  },
  {
    "path": "haskell/stack.yaml",
    "content": "# This file was automatically generated by 'stack init'\n#\n# Some commonly used options have been documented as comments in this file.\n# For advanced use and comprehensive documentation of the format, please see:\n# https://docs.haskellstack.org/en/stable/yaml_configuration/\n\n# Resolver to choose a 'specific' stackage snapshot or a compiler version.\n# A snapshot resolver dictates the compiler version and the set of packages\n# to be used for project dependencies. For example:\n#\n# resolver: lts-3.5\n# resolver: nightly-2015-09-21\n# resolver: ghc-7.10.2\n#\n# The location of a snapshot can be provided as a file or url. Stack assumes\n# a snapshot provided as a file might change, whereas a url resource does not.\n#\n# resolver: ./custom-snapshot.yaml\n# resolver: https://example.com/snapshots/2018-01-01.yaml\nresolver:\n  url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/5.yaml\n\n# User packages to be built.\n# Various formats can be used as shown in the example below.\n#\n# packages:\n# - some-directory\n# - https://example.com/foo/bar/baz-0.0.2.tar.gz\n#   subdirs:\n#   - auto-update\n#   - wai\npackages:\n- .\n# Dependency packages to be pulled from upstream that are not in the resolver.\n# These entries can reference officially published versions as well as\n# forks / in-progress versions pinned to a git hash. For example:\n#\n# extra-deps:\n# - acme-missiles-0.3\n# - git: https://github.com/commercialhaskell/stack.git\n#   commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a\n#\n# extra-deps: []\n\n# Override default flag values for local packages and extra-deps\n# flags: {}\n\n# Extra package databases containing global packages\n# extra-package-dbs: []\n\n# Control whether we use the GHC we find on the path\n# system-ghc: true\n#\n# Require a specific version of stack, using version ranges\n# require-stack-version: -any # Default\n# require-stack-version: \">=2.7\"\n#\n# Override the architecture used by stack, especially useful on Windows\n# arch: i386\n# arch: x86_64\n#\n# Extra directories used by stack for building\n# extra-include-dirs: [/path/to/dir]\n# extra-lib-dirs: [/path/to/dir]\n#\n# Allow a newer minor version of GHC than the snapshot specifies\n# compiler-check: newer-minor\n"
  },
  {
    "path": "haskell/test/Spec.hs",
    "content": "main :: IO ()\nmain = putStrLn \"Test suite not yet implemented\"\n"
  },
  {
    "path": "include/sdl2.h",
    "content": "#pragma once\n\n#include <SDL2/SDL.h>\n#include <memory>\n\nnamespace sdl2 {\n\n// Very useful function from Eric Scott Barr:\n// https://eb2.co/blog/2014/04/c-plus-plus-14-and-sdl2-managing-resources/\ntemplate <typename Creator, typename Destructor, typename... Arguments>\nauto make_resource(Creator c, Destructor d, Arguments&&... args)\n{\n    auto r = c(std::forward<Arguments>(args)...);\n    return std::unique_ptr<std::decay_t<decltype(*r)>, decltype(d)>(r, d);\n}\n\n// The \"internal type\" of the SDL System\nusing SDL_System = int;\n\n// SDL_CreateSDL initiates the use of SDL.\n// The given flags are passed to SDL_Init.\n// The returned value contains the exit code.\ninline SDL_System* SDL_CreateSDL(Uint32 flags)\n{\n    auto init_status = new SDL_System;\n    *init_status = SDL_Init(flags);\n    return init_status;\n}\n\n// SDL_DestroySDL ends the use of SDL\ninline void SDL_DestroySDL(SDL_System* init_status)\n{\n    delete init_status; // Delete the int that contains the return value from SDL_Init\n    SDL_Quit();\n}\n\nusing sdlsystem_ptr_t = std::unique_ptr<SDL_System, decltype(&SDL_DestroySDL)>;\nusing window_ptr_t = std::unique_ptr<SDL_Window, decltype(&SDL_DestroyWindow)>;\nusing renderer_ptr_t = std::unique_ptr<SDL_Renderer, decltype(&SDL_DestroyRenderer)>;\nusing surf_ptr_t = std::unique_ptr<SDL_Surface, decltype(&SDL_FreeSurface)>;\nusing texture_ptr_t = std::unique_ptr<SDL_Texture, decltype(&SDL_DestroyTexture)>;\n\n// Initialize SDL (the returned int* contains the return value from SDL_Init)\ninline sdlsystem_ptr_t make_sdlsystem(Uint32 flags)\n{\n    return make_resource(SDL_CreateSDL, SDL_DestroySDL, flags);\n}\n\n// Create a window (that contains both a SDL_Window and the destructor for SDL_Windows)\ninline window_ptr_t make_window(const char* title, int x, int y, int w, int h, Uint32 flags)\n{\n    return make_resource(SDL_CreateWindow, SDL_DestroyWindow, title, x, y, w, h, flags);\n}\n\n// Create a renderer given a window, containing both the renderer and the destructor\ninline renderer_ptr_t make_renderer(SDL_Window* win, int x, Uint32 flags)\n{\n    return make_resource(SDL_CreateRenderer, SDL_DestroyRenderer, win, x, flags);\n}\n\n// Create a surface from a bmp file, containing both the surface and the destructor\ninline surf_ptr_t make_bmp(SDL_RWops* sdlfile)\n{\n    // May throw an exception if sdlfile is nullptr\n    return make_resource(SDL_LoadBMP_RW, SDL_FreeSurface, sdlfile, 1);\n}\n\n// Create a texture from a renderer and a surface\ninline texture_ptr_t make_texture(SDL_Renderer* ren, SDL_Surface* surf)\n{\n    return make_resource(SDL_CreateTextureFromSurface, SDL_DestroyTexture, ren, surf);\n}\n\n} // namespace sdl2\n"
  },
  {
    "path": "java22/Main.java",
    "content": "import static java.lang.foreign.ValueLayout.*;\nimport java.lang.foreign.*;\nimport java.lang.invoke.MethodHandle;\nimport java.nio.charset.StandardCharsets;\nimport java.util.Optional;\nimport java.util.concurrent.atomic.AtomicBoolean;\n\npublic class Main {\n    private static final Linker linker = Linker.nativeLinker();\n    private static SymbolLookup lib;\n\n    // Constants from SDL\n    private static final int SDL_INIT_VIDEO = 0x00000020;\n    private static final int SDL_WINDOWPOS_UNDEFINED = 0x1FFF0000;\n    private static final int SDL_WINDOW_SHOWN = 0x00000004;\n    private static final int SDL_RENDERER_ACCELERATED = 0x00000002;\n    private static final int SDL_RENDERER_PRESENTVSYNC = 0x00000004;\n    private static final int SDL_QUIT = 0x100;\n    private static final int SDL_KEYDOWN = 0x300;\n    private static final int SDLK_ESCAPE = 0x1B;\n\n    public static void main(String[] args) {\n        try {\n            runSDL();\n        } catch (Throwable e) {\n            e.printStackTrace();\n        }\n    }\n\n    private static void runSDL() throws Throwable {\n        String libPath = System.getProperty(\"sdl2.library.path\");\n        if (libPath == null || libPath.isEmpty()) {\n            throw new IllegalArgumentException(\"Library path not specified. Use -Dsdl2.library.path=<path>\");\n        }\n\n        try (Arena arena = Arena.ofConfined()) {\n            lib = SymbolLookup.libraryLookup(libPath, arena);\n\n            MethodHandle SDL_Init = loadFunction(\"SDL_Init\", FunctionDescriptor.of(JAVA_INT, JAVA_INT));\n            MethodHandle SDL_Quit = loadFunction(\"SDL_Quit\", FunctionDescriptor.ofVoid());\n            MethodHandle SDL_CreateWindow = loadFunction(\"SDL_CreateWindow\", FunctionDescriptor.of(ADDRESS, ADDRESS, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT, JAVA_INT));\n            MethodHandle SDL_CreateRenderer = loadFunction(\"SDL_CreateRenderer\", FunctionDescriptor.of(ADDRESS, ADDRESS, JAVA_INT, JAVA_INT));\n            MethodHandle SDL_CreateTextureFromSurface = loadFunction(\"SDL_CreateTextureFromSurface\", FunctionDescriptor.of(ADDRESS, ADDRESS, ADDRESS));\n            MethodHandle SDL_DestroyRenderer = loadFunction(\"SDL_DestroyRenderer\", FunctionDescriptor.ofVoid(ADDRESS));\n            MethodHandle SDL_DestroyWindow = loadFunction(\"SDL_DestroyWindow\", FunctionDescriptor.ofVoid(ADDRESS));\n            MethodHandle SDL_FreeSurface = loadFunction(\"SDL_FreeSurface\", FunctionDescriptor.ofVoid(ADDRESS));\n            MethodHandle SDL_DestroyTexture = loadFunction(\"SDL_DestroyTexture\", FunctionDescriptor.ofVoid(ADDRESS));\n            MethodHandle SDL_RenderClear = loadFunction(\"SDL_RenderClear\", FunctionDescriptor.of(JAVA_INT, ADDRESS));\n            MethodHandle SDL_RenderCopy = loadFunction(\"SDL_RenderCopy\", FunctionDescriptor.of(JAVA_INT, ADDRESS, ADDRESS, ADDRESS, ADDRESS));\n            MethodHandle SDL_RenderPresent = loadFunction(\"SDL_RenderPresent\", FunctionDescriptor.ofVoid(ADDRESS));\n            MethodHandle SDL_LoadBMP_RW = loadFunction(\"SDL_LoadBMP_RW\", FunctionDescriptor.of(ADDRESS, ADDRESS, JAVA_INT));\n            MethodHandle SDL_RWFromFile = loadFunction(\"SDL_RWFromFile\", FunctionDescriptor.of(ADDRESS, ADDRESS, ADDRESS));\n            MethodHandle SDL_GetError = loadFunction(\"SDL_GetError\", FunctionDescriptor.of(ADDRESS));\n            MethodHandle SDL_PollEvent = loadFunction(\"SDL_PollEvent\", FunctionDescriptor.of(JAVA_INT, ADDRESS));\n            MethodHandle SDL_Delay = loadFunction(\"SDL_Delay\", FunctionDescriptor.ofVoid(JAVA_INT));\n\n            if (SDL_Init == null || SDL_Quit == null || SDL_CreateWindow == null || SDL_CreateRenderer == null || SDL_CreateTextureFromSurface == null ||\n                SDL_DestroyRenderer == null || SDL_DestroyWindow == null || SDL_FreeSurface == null || SDL_DestroyTexture == null ||\n                SDL_RenderClear == null || SDL_RenderCopy == null || SDL_RenderPresent == null || SDL_LoadBMP_RW == null || SDL_RWFromFile == null || SDL_GetError == null ||\n                SDL_PollEvent == null || SDL_Delay == null) {\n                System.err.println(\"Failed to load one or more SDL functions\");\n                return;\n            }\n\n            int result = (int) SDL_Init.invoke(SDL_INIT_VIDEO);\n            if (result != 0) {\n                System.err.println(\"SDL_Init failed with error code: \" + result);\n                return;\n            }\n\n            MemorySegment title = allocateString(arena, \"Hello, World!\");\n            MemorySegment window = (MemorySegment) SDL_CreateWindow.invoke(title, 100, 100, 620, 387, SDL_WINDOW_SHOWN);\n            if (window.address() == 0) {\n                System.err.println(\"SDL_CreateWindow failed: \" + getError(SDL_GetError));\n                SDL_Quit.invoke();\n                return;\n            }\n\n            MemorySegment renderer = (MemorySegment) SDL_CreateRenderer.invoke(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);\n            if (renderer.address() == 0) {\n                System.err.println(\"SDL_CreateRenderer failed: \" + getError(SDL_GetError));\n                SDL_DestroyWindow.invoke(window);\n                SDL_Quit.invoke();\n                return;\n            }\n\n            MemorySegment filename = allocateString(arena, \"../img/grumpy-cat.bmp\");\n            MemorySegment rwop = (MemorySegment) SDL_RWFromFile.invoke(filename, allocateString(arena, \"rb\"));\n            if (rwop.address() == 0) {\n                System.err.println(\"SDL_RWFromFile failed: \" + getError(SDL_GetError));\n                SDL_DestroyRenderer.invoke(renderer);\n                SDL_DestroyWindow.invoke(window);\n                SDL_Quit.invoke();\n                return;\n            }\n\n            MemorySegment bmp = (MemorySegment) SDL_LoadBMP_RW.invoke(rwop, 1);\n            if (bmp.address() == 0) {\n                System.err.println(\"SDL_LoadBMP_RW failed: \" + getError(SDL_GetError));\n                SDL_DestroyRenderer.invoke(renderer);\n                SDL_DestroyWindow.invoke(window);\n                SDL_Quit.invoke();\n                return;\n            }\n\n            MemorySegment texture = (MemorySegment) SDL_CreateTextureFromSurface.invoke(renderer, bmp);\n            SDL_FreeSurface.invoke(bmp);\n            if (texture.address() == 0) {\n                System.err.println(\"SDL_CreateTextureFromSurface failed: \" + getError(SDL_GetError));\n                SDL_DestroyRenderer.invoke(renderer);\n                SDL_DestroyWindow.invoke(window);\n                SDL_Quit.invoke();\n                return;\n            }\n\n            AtomicBoolean quit = new AtomicBoolean(false);\n            long startTime = System.currentTimeMillis();\n\n            MemorySegment event = arena.allocate(56);  // Size of SDL_Event structure\n\n            while (!quit.get()) {\n                while ((int) SDL_PollEvent.invoke(event) != 0) {\n                    int type = event.get(JAVA_INT, 0);\n                    switch (type) {\n                    case SDL_QUIT:\n                        quit.set(true);\n                        break;\n                    case SDL_KEYDOWN:\n                        int key = event.get(JAVA_INT, 4);\n                        if (key == SDLK_ESCAPE) {\n                            quit.set(true);\n                        }\n                    }\n                }\n\n                long elapsedTime = System.currentTimeMillis() - startTime;\n                if (elapsedTime > 2000) {\n                    break;\n                }\n\n                SDL_RenderClear.invoke(renderer);\n                SDL_RenderCopy.invoke(renderer, texture, MemorySegment.NULL, MemorySegment.NULL);\n                SDL_RenderPresent.invoke(renderer);\n                SDL_Delay.invoke(100);\n            }\n\n            SDL_DestroyTexture.invoke(texture);\n            SDL_DestroyRenderer.invoke(renderer);\n            SDL_DestroyWindow.invoke(window);\n            SDL_Quit.invoke();\n        }\n    }\n\n    private static String getError(MethodHandle SDL_GetError) {\n        try {\n            MemorySegment errorSegment = (MemorySegment) SDL_GetError.invoke();\n            return segmentToString(errorSegment);\n        } catch (Throwable e) {\n            return \"Unknown error\";\n        }\n    }\n\n    private static String segmentToString(MemorySegment segment) {\n        int length = 0;\n        while (segment.get(ValueLayout.JAVA_BYTE, length) != 0) {\n            length++;\n        }\n        byte[] bytes = new byte[length];\n        for (int i = 0; i < length; i++) {\n            bytes[i] = segment.get(ValueLayout.JAVA_BYTE, i);\n        }\n        return new String(bytes, StandardCharsets.UTF_8);\n    }\n\n    private static MemorySegment allocateString(Arena arena, String str) {\n        byte[] bytes = str.getBytes(StandardCharsets.UTF_8);\n        MemorySegment segment = arena.allocate(bytes.length + 1);  // +1 for null terminator\n        segment.asByteBuffer().put(bytes).put((byte) 0);\n        return segment;\n    }\n\n    private static MethodHandle loadFunction(String name, FunctionDescriptor descriptor) {\n        Optional<MemorySegment> address = lib.find(name);\n        if (address.isPresent()) {\n            return linker.downcallHandle(address.get(), descriptor);\n        } else {\n            System.err.println(\"Failed to load function: \" + name);\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "java22/Makefile",
    "content": ".PHONY: all clean build run\n# Java setup\nJAVA_HOME ?= $(shell if [ -x /usr/libexec/java_home ]; then /usr/libexec/java_home -v 22; elif [ -d /opt/homebrew/Cellar/openjdk/22.0.1 ]; then echo /opt/homebrew/Cellar/openjdk/22.0.1; else echo /usr/lib/jvm/java-22-openjdk; fi)\nJAVA=$(JAVA_HOME)/bin/java\nJAVAC=$(JAVA_HOME)/bin/javac\nJAR=$(JAVA_HOME)/bin/jar\n\n# Get Java version information once\nJAVA_VERSION_INFO=$(shell $(JAVA) -version 2>&1 | awk -F '\"' '/version/ {split($$2,v,\".\"); print v[1]}')\nJAVA_VERSION=$(JAVA_VERSION_INFO)\n\n# Check if Java version is sufficient\nifeq ($(shell expr $(JAVA_VERSION) \\>= 22 2>/dev/null), 1)\n  JAVA_VERSION_CHECK=found\nelse\n  JAVA_VERSION_CHECK=not found\nendif\n\nifeq ($(JAVA_VERSION_CHECK), not found)\n$(error JAVA_HOME needs to point to Java 22 or later)\nendif\n\n# Java options - conditional on Java version\nifeq ($(JAVA_VERSION), 22)\n  JAVA_OPTS=--enable-preview --enable-native-access=ALL-UNNAMED\n  JAVAC_OPTS=--enable-preview --source 22\nelse\n  JAVA_OPTS=--enable-native-access=ALL-UNNAMED\n  JAVAC_OPTS=--source $(JAVA_VERSION)\nendif\n\n# Project setup\nTARGET_JAR=main.jar\nJAVA_FILES=Main.java\nMAIN_CLASS=Main\nPACKAGE_NAME=main\nBUILD_DIR=build\n\n# Detect OS and set library path\nifeq ($(shell uname), Darwin)\n  SDL2_LIB_PATH=$(shell if [ -f /opt/homebrew/lib/libSDL2.dylib ]; then echo /opt/homebrew/lib/libSDL2.dylib; elif [ -f /usr/local/lib/libSDL2.dylib ]; then echo /usr/local/lib/libSDL2.dylib; else echo notfound; fi)\nelse ifeq ($(shell uname), Linux)\n  SDL2_LIB_PATH=$(shell pkg-config --variable=libdir sdl2 2>/dev/null)/libSDL2.so\n  ifeq ($(wildcard $(SDL2_LIB_PATH)),)\n    SDL2_LIB_PATH=$(shell if [ -f /usr/lib/libSDL2.so ]; then echo /usr/lib/libSDL2.so; elif [ -f /usr/lib64/libSDL2.so ]; then echo /usr/lib64/libSDL2.so; else echo notfound; fi)\n  endif\nelse ifeq ($(shell uname), FreeBSD)\n  SDL2_LIB_PATH=/usr/local/lib/libSDL2.so\nelse ifeq ($(OS), Windows_NT)\n  SDL2_LIB_PATH=SDL2.dll\nelse\n  $(error Unsupported OS)\nendif\n\n# Check if SDL2 library exists\nifeq ($(SDL2_LIB_PATH), notfound)\n  $(error SDL2 library not found. Please install SDL2 using your system's package manager)\nendif\n\nall: build\n\nbuild: $(TARGET_JAR)\n\n$(TARGET_JAR): $(JAVA_FILES)\n\t@mkdir -p \"$(BUILD_DIR)/META-INF\"\n\t@$(JAVAC) $(JAVAC_OPTS) -d \"$(BUILD_DIR)\" $(JAVA_FILES)\n\t@echo \"Main-Class: $(MAIN_CLASS)\" > \"$(BUILD_DIR)/META-INF/MANIFEST.MF\"\n\t@$(JAR) cmf \"$(BUILD_DIR)/META-INF/MANIFEST.MF\" $(TARGET_JAR) -C \"$(BUILD_DIR)\" .\n\t@rm -rf \"$(BUILD_DIR)\"\n\nrun:\n\t@$(JAVA) $(JAVA_OPTS) -Dsdl2.library.path=$(SDL2_LIB_PATH) -jar $(TARGET_JAR)\n\nscript_with_jar.sh: $(TARGET_JAR)\n\t@echo '#!/bin/bash' > $@\n\t@echo 'me=`realpath $$0`' >> $@\n\t@echo 'exec $(JAVA) $(JAVA_OPTS) -Dsdl2.library.path=$(SDL2_LIB_PATH) -jar $$me \"$$@\"' >> $@\n\t@cat $(TARGET_JAR) >> $@\n\t@chmod +x $@\n\nclean:\n\t@rm -f $(TARGET_JAR) script_with_jar.sh\n"
  },
  {
    "path": "java22/README.md",
    "content": "# Java\n\n* Requires Java 22 or later. Tested with OpenJDK 22.\n* Requires `make` and `SDL2`.\n* Builds and runs on Arch Linux.\n* ❗ Builds and crashes on macOS❗\n* Other platforms are a work in progress.\n\n## Build and run\n\n    make\n    make run\n\n### SDL2\n\n`SDL2.dll` is included (zlib license). It can also be downloaded from here: https://www.libsdl.org/download-2.0.php\n\nThis text came together with the `SDL2.dll` binary:\n\n```\nThe Simple DirectMedia Layer (SDL for short) is a cross-platform library\ndesigned to make it easy to write multi-media software, such as games\nand emulators.\n\nThe Simple DirectMedia Layer library source code is available from:\nhttps://www.libsdl.org/\n\nThis library is distributed under the terms of the zlib license:\nhttp://www.zlib.net/zlib_license.html\n```\n"
  },
  {
    "path": "kotlin/.gitignore",
    "content": "build/\n"
  },
  {
    "path": "kotlin/Main.kt",
    "content": "import kotlin.OptIn\nimport kotlinx.cinterop.*\nimport sdl2.*\n\n@OptIn(ExperimentalForeignApi::class)\nfun main() {\n    if (SDL_Init(SDL_INIT_EVERYTHING) != 0) {\n        println(\"SDL_Init failed: ${SDL_GetError()?.toKString()}\")\n        return\n    }\n\n    val window = SDL_CreateWindow(\n        \"Hello World!\", // Match the window title with the C program\n        100, 100,\n        620, 387,\n        SDL_WINDOW_SHOWN\n    )\n    if (window == null) {\n        println(\"SDL_CreateWindow failed: ${SDL_GetError()?.toKString()}\")\n        SDL_Quit()\n        return\n    }\n\n    val renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED or SDL_RENDERER_PRESENTVSYNC)\n    if (renderer == null) {\n        println(\"SDL_CreateRenderer failed: ${SDL_GetError()?.toKString()}\")\n        SDL_DestroyWindow(window)\n        SDL_Quit()\n        return\n    }\n\n    val imageFilename = \"../img/grumpy-cat.bmp\"\n    val rwop = SDL_RWFromFile(imageFilename, \"rb\")\n    if (rwop == null) {\n        println(\"SDL_RWFromFile failed: ${SDL_GetError()?.toKString()}\")\n        SDL_DestroyRenderer(renderer)\n        SDL_DestroyWindow(window)\n        SDL_Quit()\n        return\n    }\n\n    val bmp = SDL_LoadBMP_RW(rwop, 1)\n    if (bmp == null) {\n        println(\"SDL_LoadBMP_RW failed: ${SDL_GetError()?.toKString()}\")\n        SDL_DestroyRenderer(renderer)\n        SDL_DestroyWindow(window)\n        SDL_Quit()\n        return\n    }\n\n    val tex = SDL_CreateTextureFromSurface(renderer, bmp)\n    if (tex == null) {\n        println(\"SDL_CreateTextureFromSurface failed: ${SDL_GetError()?.toKString()}\")\n        SDL_FreeSurface(bmp)\n        SDL_DestroyRenderer(renderer)\n        SDL_DestroyWindow(window)\n        SDL_Quit()\n        return\n    }\n\n    SDL_FreeSurface(bmp)\n\n    repeat(20) {\n        SDL_RenderClear(renderer)\n        SDL_RenderCopy(renderer, tex, null, null)\n        SDL_RenderPresent(renderer)\n        SDL_Delay(100u)\n    }\n\n    SDL_DestroyTexture(tex)\n    SDL_DestroyRenderer(renderer)\n    SDL_DestroyWindow(window)\n    SDL_Quit()\n}\n"
  },
  {
    "path": "kotlin/Makefile",
    "content": "all: build/main.kexe\n\nbuild/sdl2.klib: sdl2.def\n\tmkdir -p build\n\tcinterop \\\n\t\t-compiler-options -I/usr/local/include/SDL2 \\\n\t\t-def sdl2.def \\\n\t\t-o build/sdl2\n\nbuild/main.kexe: build/sdl2.klib Main.kt\n\tkotlinc-native \\\n\t\t-l build/sdl2.klib \\\n\t\t-linker-options /opt/homebrew/lib/libSDL2.dylib \\\n\t\t-o build/main \\\n\t\tMain.kt\n\nrun: build/main.kexe\n\tbuild/main.kexe\n\nclean:\n\t@-rm -rfv build sdl2-build\n"
  },
  {
    "path": "kotlin/README.md",
    "content": "This is an early version of an example for Kotlin Native + SDL2.\n\nIt is currently only tested on macOS Sonoma with XCode installed, and with Kotlin Native installed through Homebrew.\n\nCurrently, the program compiles and runs, but no window appears here (!).\n\nPull requests are welcome!\n"
  },
  {
    "path": "kotlin/sdl2.def",
    "content": "headers = SDL.h stdlib.h time.h\nentryPoint = SDL_main\n\nheaderFilter = SDL* stdlib.h time.h\n\ncompilerOpts = -D_POSIX_SOURCE\ncompilerOpts.osx = -I/opt/homebrew/include/SDL2 -I/usr/local/include/SDL2\ncompilerOpts.linux = -I/usr/include/SDL2 -D_REENTRANT\n\nlinkerOpts =\nlinkerOpts.osx = -L/opt/homebrew/lib -L/usr/local/lib -lSDL2\nlinkerOpts.linux = -I/usr/lib -lSDL2\n"
  },
  {
    "path": "lisp/Makefile",
    "content": ".PHONY: all clean fullclean msg2 run\n\nPACKAGE_NAME := sdl2-examples\nMAIN_FUNCTION := renderer-test\n\nall: msg main\n\nquicklisp.lisp:\n\t@curl -Os \"https://beta.quicklisp.org/$@\"\n\nquicklisp/setup.lisp: quicklisp.lisp\n\t@sbcl \\\n\t  --non-interactive \\\n\t  --noprint \\\n\t  --no-sysinit \\\n\t  --no-userinit \\\n\t  --load $< \\\n\t  --eval \"(quicklisp-quickstart:install :path \\\"quicklisp\\\")\"\n\nmsg:\n\t@echo '--- Common Lisp ---'\n\nmain: quicklisp/setup.lisp main.lisp\n\t@echo -n '[main] Compiling...'\n\t@sbcl \\\n\t  --non-interactive \\\n\t  --noprint \\\n\t  --no-sysinit \\\n\t  --no-userinit \\\n\t  --load quicklisp/setup.lisp \\\n\t  --eval \"(ql:quickload 'sdl2)\" \\\n\t  --eval \"(ql:quickload 'cl-opengl)\" \\\n\t  --load main.lisp \\\n\t  --eval \"(sb-ext:save-lisp-and-die \\\"$@\\\" :executable t :toplevel '${PACKAGE_NAME}:${MAIN_FUNCTION})\"\n\t@echo 'ok'\n\nsmall: quicklisp/setup.lisp main.lisp\n\t@echo -n '[main] Compiling, with compression enabled...'\n\t@sbcl \\\n\t  --non-interactive \\\n\t  --noprint \\\n\t  --no-sysinit \\\n\t  --no-userinit \\\n\t  --load quicklisp/setup.lisp \\\n\t  --eval \"(ql:quickload 'sdl2)\" \\\n\t  --eval \"(ql:quickload 'cl-opengl)\" \\\n\t  --load main.lisp \\\n\t  --eval \"(sb-ext:save-lisp-and-die \\\"$@\\\" :executable t :compression 9 :toplevel '${PACKAGE_NAME}:${MAIN_FUNCTION})\"\n\t@echo 'ok'\n\nrun: msg quicklisp/setup.lisp main.lisp\n\t@time sbcl \\\n\t  --non-interactive \\\n\t  --noprint \\\n\t  --no-sysinit \\\n\t  --no-userinit \\\n\t  --load quicklisp/setup.lisp \\\n\t  --eval \"(ql:quickload 'sdl2)\" \\\n\t  --eval \"(ql:quickload 'cl-opengl)\" \\\n\t  --load main.lisp \\\n\t  --eval \"(${PACKAGE_NAME}:${MAIN_FUNCTION})\"\n\nclean:\n\t@-rm -f main small *.fas *.o\n\nfullclean: clean\n\t@-rm -fr quicklisp quicklisp.lisp\n"
  },
  {
    "path": "lisp/README.md",
    "content": "# Common Lisp\n\nThis example uses SDL2 and QuickLisp, and is based on examples from [cl-sdl2](https://github.com/lispgames/cl-sdl2).\n\nThe main function and package name are defined at the top of the `Makefile`.\n\nTested on Arch Linux (works) and macOS (didn't work).\n\n* [Additional examples for Common Lisp](https://github.com/lispgames/cl-sdl2/tree/master/examples)\n"
  },
  {
    "path": "lisp/main.lisp",
    "content": "(in-package :sdl2-examples)\n\n(require :sdl2)\n\n(defun renderer-test ()\n  \"Display an image of a grumpy cat\"\n  (sdl2:with-init (:everything)\n    (sdl2:with-window (win :title \"Hello World!\" :x 100 :y 100 :w 620 :h 387 :flags '(:shown))\n      (sdl2:with-renderer (ren win :flags '(:accelerated :presentvsync))\n        (let* (\n          (bmp (sdl2:load-bmp \"../img/grumpy-cat.bmp\"))\n          (tex (sdl2:create-texture-from-surface ren bmp)))\n            (loop repeat 20 do\n              (sdl2:render-clear ren)\n              (sdl2:render-copy ren tex)\n              (sdl2:render-present ren)\n              (sdl2:delay 100)))))))\n"
  },
  {
    "path": "lua/Makefile",
    "content": ".PHONY: all msg clean fullclean\n\nLUA_VERSION ?= 5.3\n\nall: msg\n\t@# Nothing to build\n\t@true\n\nmsg:\n\t@echo '--- Lua ---'\n\nrun: msg main.lua\n\ttime lua$(LUA_VERSION) main.lua\n\nclean:\n\t@# Nothing to clean\n\t@true\n\nfullclean: clean\n"
  },
  {
    "path": "lua/README.md",
    "content": "Instructions\n------------\n\n# Installation of SDL2 for Lua\n\n### With luarocks\n\n`sudo luarocks install lua-sdl2`\n\n### For Arch Linux\n\n`pacman -S lua-sdl2`\n\n# Running\n\nIf `lua main.lua` does not work, try using a specific Lua version that may have the SDL2 bindings available on your system, like `lua5.3 main.lua`.\n"
  },
  {
    "path": "lua/main.lua",
    "content": "local SDL\t= require \"SDL\"\nlocal image\t= require \"SDL.image\"\n\nlocal ret, err = SDL.init { SDL.flags.Video }\nif not ret then\n    error(err)\nend\n\nlocal win, err = SDL.createWindow {\n    title    = \"Hello World!\",\n    width    = 620,\n    height   = 387,\n    flags    = SDL.window.Shown\n}\nif not win then\n    error(err)\nend\n\nlocal rdr, err = SDL.createRenderer(win, -1, SDL.rendererFlags.Accelerated + SDL.rendererFlags.PresentVSYNC)\nif not rdr then\n    error(err)\nend\n\nlocal img, ret = SDL.loadBMP(\"../img/grumpy-cat.bmp\")\nif not img then\n    error(err)\nend\n\ntex = rdr:createTextureFromSurface(img)\n\nfor i = 1, 20 do\n    rdr:clear()\n    rdr:copy(tex)\n    rdr:present()\n\n    SDL.delay(100)\nend\n"
  },
  {
    "path": "mruby/Makefile",
    "content": ".PHONY: all msg clean fullclean\n\nall: msg\n\t@# Nothing to build\n\t@true\n\nmsg:\n\t@echo '--- Ruby ---'\n\nrun: msg main.rb\n\ttime mruby main.rb\n\nclean:\n\t@# Nothing to clean\n\t@true\n\nfullclean: clean\n"
  },
  {
    "path": "mruby/README.md",
    "content": "# Ruby\n\nThis example uses MRuby.\n\n* Install the SDL2 libraries and include files.\n\n* Install [MRuby](https://github.com/mruby/mruby) and [mruby-sdl2](https://github.com/crimsonwoods/mruby-sdl2).\n\nThe installation of `mruby-sdl2` may be tricky, and may involve recompiling mruby and also adding this line to `build_config.rb`:\n\n  conf.gem :github => 'crimsonwoods/mruby-sdl2', :branch => 'master'\n\nConsult the [mruby-sdl2 project](https://github.com/crimsonwoods/mruby-sdl2) for more information.\n\n* Run the SDL2 sample with `mruby main.rb`.\n"
  },
  {
    "path": "mruby/main.rb",
    "content": "SDL2::init\n\nX = SDL2::Video::Window::SDL_WINDOWPOS_UNDEFINED\nY = SDL2::Video::Window::SDL_WINDOWPOS_UNDEFINED\nW = 620\nH = 387\nFLAGS = SDL2::Video::Window::SDL_WINDOW_SHOWN\n\n# Note that error checking is built in for many of the functions below.\n\nbegin\n  begin\n    win = SDL2::Video::Window.new \"Hello World!\", X, Y, W, H, FLAGS\n    ren = SDL2::Video::Renderer.new(win)\n    bmp = SDL2::Video::Surface::load_bmp(\"../img/grumpy-cat.bmp\")\n    tex = SDL2::Video::Texture.new(ren, bmp)\n    bmp.free\n\n    for i in 0..20\n      # Show the image\n      ren.clear\n      ren.copy(tex)\n      ren.present\n\n      # Wait 100 ms\n      SDL2::delay(100)\n    end\n\n    # Clean up\n    tex.destroy\n    ren.destroy\n    win.destroy\n  ensure\n    SDL2::Video::quit\n  end\nensure\n  SDL2::quit\nend\n"
  },
  {
    "path": "nim/Makefile",
    "content": ".PHONY: all clean fullclean msg sdl2\n\nall: msg main\n\nmsg:\n\t@echo '--- Nim ---'\n\nsdl2:\n\t@-if [ ! -n \"$$(find ~/.nimble/pkgs -maxdepth 1 -type d -name \"sdl2-*\" | head -1)\" ]; then nimble install -y sdl2; fi\n\nmain: sdl2 main.nim\n\tnim -d:release c main.nim\n\nrun: msg main\n\ttime ./main\n\nclean:\n\trm -rf main nimcache\n\nfullclean: clean\n\trm -rf sdl2\n"
  },
  {
    "path": "nim/README.md",
    "content": "# SDL2 example for Nim\n\nRequirements:\n\n* Nim\n* Nimble (the Nim package manager)\n\nOn some platforms, `nimble install sdl2` might be required before building with `nim c main.nim`.\n"
  },
  {
    "path": "nim/main.nim",
    "content": "import sdl2\n\nvar\n  win: WindowPtr\n  ren: RendererPtr\n  bmp: SurfacePtr\n  tex: TexturePtr\n\ndiscard init(INIT_EVERYTHING)\n\nwin = createWindow(\"Hello World!\", 100, 100, 620, 387, SDL_WINDOW_SHOWN)\nif win == nil:\n  echo(\"createWindow Error: \", getError())\n  quit(1)\n\nren = createRenderer(win, -1, Renderer_Accelerated or Renderer_PresentVsync)\nif ren == nil:\n  echo(\"createRenderer Error: \", getError())\n  quit(1)\n\nbmp = loadBMP(\"../img/grumpy-cat.bmp\")\nif bmp == nil:\n  echo(\"loadBMP Error: \", getError())\n  quit(1)\n\ntex = createTextureFromSurface(ren, bmp)\nif tex == nil:\n  echo(\"createTextureFromSurface Error: \", getError())\n  quit(1)\nfreeSurface(bmp)\n\nfor i in countup(1, 20):\n  ren.clear\n  copy(ren, tex, nil, nil)\n  ren.present\n  delay(100)\n\ndestroy tex\ndestroy ren\ndestroy win\n\nsdl2.quit()\n"
  },
  {
    "path": "objc-cmake/CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.26)\nproject(main)\n\n# Enable Objective-C support\nenable_language(OBJC)\n\naux_source_directory(. SRC_LIST)\nadd_executable(${PROJECT_NAME} ${SRC_LIST})\ntarget_include_directories(${PROJECT_NAME} PRIVATE ../include)\n\n# Remove C++23 and add Objective-C specific flags\ntarget_compile_options(${PROJECT_NAME} PRIVATE\n    -fobjc-arc  # Enable ARC (Automatic Reference Counting)\n)\n\ntarget_compile_definitions(${PROJECT_NAME} PRIVATE IMGDIR=\"../img/\")\n\n# Add Foundation framework (required for Objective-C)\nfind_library(FOUNDATION_LIBRARY Foundation)\ntarget_link_libraries(${PROJECT_NAME} PRIVATE ${FOUNDATION_LIBRARY})\n\n# For macOS M2 systems with SDL2 installed via Homebrew\nlist(APPEND CMAKE_MODULE_PATH \"/usr/local/lib/cmake/SDL2\" \"/opt/homebrew/lib/cmake/SDL2\")\nlist(APPEND CMAKE_PREFIX_PATH \"/usr/local\" \"/opt/homebrew\")\n\nfind_package(SDL2 QUIET)\nif (SDL2_FOUND)\n    message(\"Using SDL2 from find_package\")\n    target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})\n    target_link_libraries(${PROJECT_NAME} PRIVATE ${SDL2_LIBRARIES})\nelse()\n    # Fall back on pkg-config\n    include(FindPkgConfig)\n    pkg_search_module(SDL2 REQUIRED sdl2)\n    message(\"Using SDL2 from pkg-config\")\n    target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})\n    target_link_libraries(${PROJECT_NAME} PRIVATE ${SDL2_LIBRARIES})\nendif()"
  },
  {
    "path": "objc-cmake/README.md",
    "content": "SDL2, Objective-C and CMake\n===========================\n\nRequirements\n------------\n\n* CMake\n* Compiler that supports Objective-C (like `clang`)\n* SDL2\n\nOne way of building with Objective-C, SDL2 and CMake\n----------------------------------------------------\n\n    cmake -S . -B build -DCMAKE_BUILD_TYPE=Release\n    make -C build\n\nRunning\n-------\n\n    build/main\n\nCleaning up the binary file and build directory\n-----------------------------------------------\n\n    rm -rf build/\n"
  },
  {
    "path": "objc-cmake/main.m",
    "content": "#import <Foundation/Foundation.h>\n#import <SDL2/SDL.h>\n\n@interface SDLWrapper : NSObject\n+ (SDL_Window*)createWindowWithTitle:(const char*)title\n                                   x:(int)x\n                                   y:(int)y\n                               width:(int)width\n                              height:(int)height\n                               flags:(Uint32)flags;\n+ (SDL_Renderer*)createRendererForWindow:(SDL_Window*)window\n                                  driver:(int)driver\n                                   flags:(Uint32)flags;\n+ (SDL_Texture*)createTextureFromBMP:(const char*)filename\n                            renderer:(SDL_Renderer*)renderer;\n+ (void)runEventLoopWithRenderer:(SDL_Renderer*)renderer\n                         texture:(SDL_Texture*)texture;\n@end\n\n@implementation SDLWrapper\n\n+ (SDL_Window*)createWindowWithTitle:(const char*)title\n                                   x:(int)x\n                                   y:(int)y\n                               width:(int)width\n                              height:(int)height\n                               flags:(Uint32)flags\n{\n    return SDL_CreateWindow(title, x, y, width, height, flags);\n}\n\n+ (SDL_Renderer*)createRendererForWindow:(SDL_Window*)window\n                                  driver:(int)driver\n                                   flags:(Uint32)flags\n{\n    return SDL_CreateRenderer(window, driver, flags);\n}\n\n+ (SDL_Texture*)createTextureFromBMP:(const char*)filename\n                            renderer:(SDL_Renderer*)renderer\n{\n    SDL_Surface* surface = SDL_LoadBMP(filename);\n    if (!surface) {\n        NSLog(@\"SDL_LoadBMP Error: %s\", SDL_GetError());\n        return NULL;\n    }\n\n    SDL_Texture* texture = SDL_CreateTextureFromSurface(renderer, surface);\n    SDL_FreeSurface(surface);\n\n    if (!texture) {\n        NSLog(@\"SDL_CreateTextureFromSurface Error: %s\", SDL_GetError());\n        return NULL;\n    }\n\n    return texture;\n}\n\n+ (void)runEventLoopWithRenderer:(SDL_Renderer*)renderer\n                         texture:(SDL_Texture*)texture\n{\n    SDL_Event event;\n    BOOL quit = NO;\n    Uint32 startTime = SDL_GetTicks();\n\n    while (!quit) {\n        while (SDL_PollEvent(&event)) {\n            switch (event.type) {\n            case SDL_QUIT:\n                quit = YES;\n                break;\n\n            case SDL_KEYDOWN:\n                if (event.key.keysym.sym == SDLK_ESCAPE) {\n                    quit = YES;\n                }\n                break;\n            }\n        }\n\n        Uint32 elapsedTime = SDL_GetTicks() - startTime;\n        if (elapsedTime > 2000) {\n            break;\n        }\n\n        SDL_RenderClear(renderer);\n        SDL_RenderCopy(renderer, texture, NULL, NULL);\n        SDL_RenderPresent(renderer);\n        SDL_Delay(100);\n    }\n}\n\n@end\n\nint main(int argc, char* argv[])\n{\n    @autoreleasepool {\n        if (SDL_Init(SDL_INIT_EVERYTHING) != 0) {\n            NSLog(@\"SDL_Init Error: %s\", SDL_GetError());\n            return EXIT_FAILURE;\n        }\n\n        SDL_Window* window = [SDLWrapper createWindowWithTitle:\"Hello World!\"\n                                                             x:-1\n                                                             y:-1\n                                                         width:620\n                                                        height:387\n                                                         flags:SDL_WINDOW_SHOWN];\n        if (!window) {\n            NSLog(@\"SDL_CreateWindow Error: %s\", SDL_GetError());\n            SDL_Quit();\n            return EXIT_FAILURE;\n        }\n\n        SDL_Renderer* renderer = [SDLWrapper createRendererForWindow:window\n                                                              driver:-1\n                                                               flags:SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC];\n        if (!renderer) {\n            NSLog(@\"SDL_CreateRenderer Error: %s\", SDL_GetError());\n            SDL_DestroyWindow(window);\n            SDL_Quit();\n            return EXIT_FAILURE;\n        }\n\n        SDL_Texture* texture = [SDLWrapper createTextureFromBMP:\"../img/grumpy-cat.bmp\"\n                                                       renderer:renderer];\n        if (!texture) {\n            SDL_DestroyRenderer(renderer);\n            SDL_DestroyWindow(window);\n            SDL_Quit();\n            return EXIT_FAILURE;\n        }\n\n        [SDLWrapper runEventLoopWithRenderer:renderer texture:texture];\n\n        SDL_DestroyTexture(texture);\n        SDL_DestroyRenderer(renderer);\n        SDL_DestroyWindow(window);\n        SDL_Quit();\n\n        return EXIT_SUCCESS;\n    }\n}\n"
  },
  {
    "path": "objectpascal/Makefile",
    "content": ".PHONY: all msg sdl2 clean fullclean\n\nall: msg main\n\nmsg:\n\t@echo '--- FPC ---'\n\nmain: sdl2 SDL2/SDL2.o main.pas\n\t@echo -n '[main] Compiling...'\n\t@fpc -FuSDL2 main.pas\n\t@echo 'ok'\n\nsdl2: checkout.sh\n\t@echo -n '[SDL2 for FPC] Checking out...'\n\t@./checkout.sh > /dev/null\n\t@echo 'ok'\n\nSDL2/SDL2.o: SDL2/SDL2.pas\n\t@fpc $<\n\nSDL2/SDL2_image.o: SDL2/SDL2_image.pas\n\t@fpc $<\n\nSDL2/SDL2_mixer.o: SDL2/SDL2_mixer.pas\n\t@fpc $<\n\nSDL2/SDL2_net.o: SDL2/SDL2_net.pas\n\t@fpc $<\n\nSDL2/SDL2_ttf.o: SDL2/SDL2_ttf.pas\n\t@fpc $<\n\nrun: msg main\n\ttime ./main\n\nclean:\n\trm -f *.o main link.res SDL2/*.o SDL2/*.ppu\n\nfullclean: clean\n\trm -rf SDL2\n"
  },
  {
    "path": "objectpascal/README.md",
    "content": "Requirements\n------------\n\n* git\n* fpc\n* sdl2\n"
  },
  {
    "path": "objectpascal/checkout.sh",
    "content": "#!/bin/bash\n[[ -d SDL2 ]] || git clone -q https://git@github.com/de-signer/sdl2-fpc SDL2\n[[ -d SDL2/SDL2 ]] && (mv SDL2/SDL2 temp; rm -rf SDL2; mv temp SDL2; chmod -x SDL2/*)\ntrue\n"
  },
  {
    "path": "objectpascal/main.pas",
    "content": "program sdltest;\n\nuses SDL2;\nvar\n  win : PSDL_Window;\n  ren : PSDL_Renderer;\n  bmp : PSDL_Surface;\n  tex : PSDL_Texture;\n  i : Integer;\nbegin\n  if SDL_Init(SDL_INIT_EVERYTHING) <> 0 then begin\n    WriteLn('SDL_Init Error: ', SDL_GetError());\n    Halt(1);\n  end;\n\n  win := SDL_CreateWindow('Hello World!', 100, 100, 620, 387, SDL_WINDOW_SHOWN);\n  if win = nil then begin\n    WriteLn('SDL_CreateWindow Error: ', SDL_GetError());\n    Halt(1);\n  end;\n\n  ren := SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED or SDL_RENDERER_PRESENTVSYNC);\n  if ren = nil then begin\n    WriteLn('SDL_CreateRenderer Error: ', SDL_GetError());\n    Halt(1);\n  end;\n\n  bmp := SDL_LoadBMP('../img/grumpy-cat.bmp');\n  if bmp = nil then begin\n    WriteLn('SDL_LoadBMP Error: ', SDL_GetError());\n    Halt(1);\n  end;\n\n  tex := SDL_CreateTextureFromSurface(ren, bmp);\n  SDL_FreeSurface(bmp);\n  if tex = nil then begin\n    WriteLn('SDL_CreateTextureFromSurface Error: ', SDL_GetError());\n    Halt(1);\n  end;\n\n  for i := 0 to 20 do begin\n    SDL_RenderClear(ren);\n    SDL_RenderCopy(ren, tex, nil, nil);\n    SDL_RenderPresent(ren);\n    SDL_Delay(100);\n  end;\n\n  SDL_DestroyTexture(tex);\n  SDL_DestroyRenderer(ren);\n  SDL_DestroyWindow(win);\n\n  SDL_Quit();\nend.\n"
  },
  {
    "path": "ocaml/Makefile",
    "content": ".PHONY: all msg run clean fullclean\n\nall: msg main\n\nmsg:\n\t@echo --- OCaml ---\n\nmain: main.ml\n\t@echo -n '[main] Compiling...'\n\tocamlfind ocamlopt -package tsdl -linkpkg -thread -o $@ $<\n\t@echo 'ok'\n\nrun: msg main\n\ttime ./main\n\nclean:\n\trm -f main *.o *.cmx\n\nfullclean: clean\n\trm -f *.cmi\n"
  },
  {
    "path": "ocaml/README.md",
    "content": "Requirements\n------------\n\nInstall tsdl and tsdl-image with opam:\n\n    opam install tsdl\n\nNow everything is ready to build and run.\n"
  },
  {
    "path": "ocaml/main.ml",
    "content": "open Tsdl\n\nlet run () =\n  let (let*) = Result.bind in\n  let* _ = Sdl.init Sdl.Init.everything in\n  let* w = Sdl.create_window \"Hello World!\"\n             ~x:Sdl.Window.pos_centered\n             ~y:Sdl.Window.pos_centered\n             ~w:620\n             ~h:387\n             Sdl.Window.shown in\n  let* r = Sdl.create_renderer w\n             ~index:(-1)\n             ~flags:Sdl.Renderer.software in\n  let* bmp = Sdl.load_bmp \"../img/grumpy-cat.bmp\" in\n  let* txt = Sdl.create_texture_from_surface r bmp in\n  Sdl.free_surface bmp;\n\n  for i = 0 to 20 do\n    ignore @@ Sdl.render_clear r;\n    ignore @@ Sdl.render_copy r txt;\n    Sdl.render_present r;\n    Sdl.delay (Int32.of_int 100);\n  done;\n\n  Sdl.destroy_texture txt;\n  Sdl.destroy_renderer r;\n  Sdl.destroy_window w;\n  Sdl.quit ();\n  Ok ()\n\nlet () =\n  match run () with\n  | Ok _ -> exit 0\n  | Error (`Msg e) ->\n     Sdl.log \"Error: %s\" e;\n     exit 1\n"
  },
  {
    "path": "odin/Makefile",
    "content": ".PHONY: all msg clean fullclean\n\nall: msg main\n\nmsg:\n\t@echo '--- Odin ---'\n\nmain: main.odin\n\todin build main.odin -file -out:main\n\nrun: msg main\n\ttime ./main\n\nodinrun: main.odin\n\todin run main.odin -file\n\nclean:\n\trm -f main\n\nfullclean: clean\n"
  },
  {
    "path": "odin/README.md",
    "content": "Requirements\n------------\n\n* git\n* odin\n* sdl2\n"
  },
  {
    "path": "odin/main.odin",
    "content": "package main\n\nimport \"core:log\"\nimport \"vendor:sdl2\"\n\nmain :: proc() {\n    // Initialize\n    if err := sdl2.Init(sdl2.INIT_EVERYTHING); err < 0 {\n\tlog.fatal(\"Init Error:\", sdl2.GetError())\n    }\n    // Make sure to quit when the function returns\n    defer sdl2.Quit()\n\n    // Create the window\n    win := sdl2.CreateWindow(\"Hello World!\", 100, 100, 620, 387, sdl2.WINDOW_SHOWN)\n    defer sdl2.DestroyWindow(win)\n\n    // Create a renderer\n    ren := sdl2.CreateRenderer(win, -1, sdl2.RENDERER_ACCELERATED|sdl2.RENDERER_PRESENTVSYNC)\n    defer sdl2.DestroyRenderer(ren)\n\n    // Load the image\n    bmp := sdl2.LoadBMP(\"../img/grumpy-cat.bmp\")\n\n    // Use the image as a texture\n    tex := sdl2.CreateTextureFromSurface(ren,bmp)\n    defer sdl2.DestroyTexture(tex)\n\n    // No need for the image data after the texture has been created\n    sdl2.FreeSurface(bmp)\n\n    for i := 0; i < 20; i += 1 {\n\t// Clear the renderer and display the image/texture\n\tsdl2.RenderClear(ren)\n\tsdl2.RenderCopy(ren, tex, nil, nil)\n\tsdl2.RenderPresent(ren)\n\n\t// Wait 100 ms\n\tsdl2.Delay(100)\n    }\n}\n"
  },
  {
    "path": "python/Makefile",
    "content": ".PHONY: all msg clean fullclean\n\nall: msg\n\t@# Nothing to build\n\t@true\n\nmsg:\n\t@echo '--- Python ---'\n\nrun: msg main.py\n\ttime python main.py\n\nclean:\n\t@# Nothing to clean\n\t@true\n\nfullclean: clean\n"
  },
  {
    "path": "python/README.md",
    "content": "# Python\n\n* First install SDL2.\n* Then install PySDL2 (the package may be named `python-pysdl2`).\n* Alternatively, install PySDL2 with `easy_install`.\n\nMore information about getting started with PySDL2:\n\nhttp://pysdl2.readthedocs.org/en/latest/\n"
  },
  {
    "path": "python/main.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom sdl2 import *\n\n# There are more pythonic ways of doing this, by using the sdl2.ext module.\n\ndef main():\n    SDL_Init(SDL_INIT_VIDEO)\n\n    win = SDL_CreateWindow(b\"Hello World!\", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 620, 387, SDL_WINDOW_SHOWN)\n    ren = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC)\n    bmp = SDL_LoadBMP(b\"../img/grumpy-cat.bmp\")\n    tex = SDL_CreateTextureFromSurface(ren, bmp)\n    SDL_FreeSurface(bmp)\n\n    for i in range(20):\n        SDL_RenderClear(ren)\n        SDL_RenderCopy(ren, tex, None, None)\n        SDL_RenderPresent(ren)\n        SDL_Delay(100)\n\n    SDL_DestroyTexture(tex)\n    SDL_DestroyRenderer(ren)\n    SDL_DestroyWindow(win)\n    SDL_Quit()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "ring/Makefile",
    "content": ".PHONY: all msg clean fullclean\n\nall: msg\n\nmsg:\n\t@echo '--- Ring ---'\n\nrun: msg main.ring\n\ttime ring main.ring\n\nclean:\n\t@# Nothing to clean\n\t@true\n\nfullclean: clean\n"
  },
  {
    "path": "ring/README.md",
    "content": "Requirements\n------------\n\n* git\n* ring\n* sdl2\n"
  },
  {
    "path": "ring/main.ring",
    "content": "Load \"libsdl.ring\"\n\nif SDL_Init(SDL_INIT_EVERYTHING) < 0\n   see \"Init Error:\" + SDL_GetError()\n   exit(-1)\nend\n\n// Create the window\nwin = SDL_CreateWindow(\"Hello World!\", 100, 100, 620, 387, SDL_WINDOW_SHOWN)\n\n// Create a renderer\nren = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED|SDL_RENDERER_PRESENTVSYNC)\n\n// Load the image\nbmp = SDL_LoadBMP(\"../img/grumpy-cat.bmp\")\n\n// Use the image as a texture\ntex = SDL_CreateTextureFromSurface(ren,bmp)\n\n// No need for the image data after the texture has been created\nSDL_FreeSurface(bmp)\n\nfor i = 0 to 20\n    // Clear the renderer and display the image/texture\n    SDL_RenderClear(ren)\n    SDL_RenderCopy(ren, tex, NULL, NULL)\n    SDL_RenderPresent(ren)\n\n    // Wait 100 ms\n    SDL_Delay(100)\nnext\n\nSDL_DestroyTexture(tex)\nSDL_DestroyRenderer(ren)\nSDL_DestroyWindow(win)\nSDL_Quit()\n"
  },
  {
    "path": "run.sh",
    "content": "#!/bin/sh\nmake run\nmake fullclean\n"
  },
  {
    "path": "rust/.gitignore",
    "content": "target\n*.lock\n"
  },
  {
    "path": "rust/Cargo.toml",
    "content": "[package]\nname = \"hello_sdl2\"\nversion = \"1.1.0\"\nauthors = [\"jdeseno\", \"Alexander F. Rødseth <xyproto@archlinux.org>\"]\n\n[dependencies]\nsdl2 = \"0.34.3\"\n\n[[bin]]\nname = \"rust\"\npath = \"src/main.rs\"\n"
  },
  {
    "path": "rust/Makefile",
    "content": ".PHONY: all msg clean fullclean\n\nall: msg main\n\nmsg:\n\t@echo '--- Rust ---'\n\nmain:\n\tcargo build --release\n\nrun: msg main\n\ttime ./target/release/rust\n\nclean:\n\tcargo clean\n\nfullclean: clean\n\trm -f Cargo.lock\n"
  },
  {
    "path": "rust/README.md",
    "content": "Requires `rustc`, `cargo`, and `git`.\n\nUse `cargo run` to build and run the example.\n\n"
  },
  {
    "path": "rust/src/main.rs",
    "content": "extern crate sdl2;\n\nuse sdl2::surface::Surface;\nuse std::path::Path;\n\nfn main() {\n    let ctx = sdl2::init().unwrap();\n    let video_subsystem = ctx.video().unwrap();\n    let mut timer = ctx.timer().unwrap();\n\n    // Create a new OpenGL window\n    let window = match video_subsystem\n        .window(\"Hello World!\", 620, 387)\n        .position_centered()\n        .opengl()\n        .build()\n    {\n        Ok(window) => window,\n        Err(err) => panic!(\"failed to create window: {}\", err),\n    };\n\n    // Load the image as a surface\n    let surface = match Surface::load_bmp(&Path::new(\"../img/grumpy-cat.bmp\")) {\n        Ok(surface) => surface,\n        Err(err) => panic!(\"failed to load surface: {}\", err),\n    };\n\n    // Get the window surface, and prepare to handle events\n    let event_pump = ctx.event_pump().unwrap();\n    let mut window_surf = window.surface(&event_pump).unwrap();\n\n    // Blit the image to the window surface\n    surface.blit(None, &mut window_surf, None).unwrap();\n\n    for _ in 0..20 {\n        // Display the contents of the window surface on the screen\n        if let Err(err) = window_surf.update_window() {\n            panic!(\"failed to update window surface: {}\", err);\n        }\n\n        // Wait 100ms\n        timer.delay(100);\n    }\n}\n"
  },
  {
    "path": "scala/Main.scala",
    "content": "/*\n * An SDL2 example in Scala Native\n *\n * Inspired by a Scala Native program by @densh: https://gist.github.com/densh/1885e8b03127fd52ff659505d8b3b76b\n */\n\nimport scalanative.unsafe._\nimport scala.scalanative.unsigned._\n\nimport SDL._\nimport SDLNonExternal._\n\n@extern\n@link(\"SDL2\")\nobject SDL {\n\n  // --- Types used by the external SDL2 functions ---\n\n  type Window = CStruct0\n  type Renderer = CStruct0\n  type Surface = CStruct0\n  type Texture = CStruct0\n  type SDL_RWops = CStruct0\n  type Rect = CStruct4[CInt, CInt, CInt, CInt]\n\n  // -- External functions that are provided by the SDL2 library ---\n\n  def SDL_Init(flags: CUnsignedInt): CInt = extern\n\n  def SDL_CreateWindow(\n      title: CString,\n      x: CUnsignedInt,\n      y: CUnsignedInt,\n      w: Int,\n      h: Int,\n      flags: CUnsignedInt\n  ): Ptr[Window] = extern\n\n  def SDL_CreateRenderer(\n      win: Ptr[Window],\n      index: CInt,\n      flags: CUnsignedInt\n  ): Ptr[Renderer] = extern\n\n  def SDL_CreateTextureFromSurface(\n      ren: Ptr[Renderer],\n      surf: Ptr[Surface]\n  ): Ptr[Texture] = extern\n\n  def SDL_DestroyRenderer(ren: Ptr[Renderer]): Unit = extern\n\n  def SDL_DestroyWindow(ren: Ptr[Window]): Unit = extern\n\n  def SDL_FreeSurface(ren: Ptr[Surface]): Unit = extern\n\n  def SDL_DestroyTexture(tex: Ptr[Texture]): Unit = extern\n\n  def SDL_RenderClear(ren: Ptr[Renderer]): Unit = extern\n\n  def SDL_RenderCopy(\n      ren: Ptr[Renderer],\n      tex: Ptr[Texture],\n      src: Ptr[Rect],\n      dst: Ptr[Rect]\n  ): CInt = extern\n\n  def SDL_RenderPresent(ren: Ptr[Renderer]): Unit = extern\n\n  def SDL_LoadBMP_RW(src: Ptr[SDL_RWops], freesrc: CInt): Ptr[Surface] = extern\n\n  def SDL_RWFromFile(filename: CString, permissions: CString): Ptr[SDL_RWops] =\n    extern\n\n  def SDL_Quit(): Unit = extern\n\n  def SDL_GetError(): CString = extern\n\n  def SDL_Delay(ms: CUnsignedInt): Unit = extern\n}\n\nobject SDLNonExternal {\n\n  // --- SDL2 constants found in the SDL2 headers ---\n\n  // From SDL.h\n  final val SDL_INIT_VIDEO = 0x00000020.toUInt\n\n  // From SDL_video.h\n  final val SDL_WINDOWPOS_UNDEFINED = 0x1FFF0000.toUInt\n  final val SDL_WINDOW_SHOWN = 0x00000004.toUInt\n\n  // From SDL_render.h\n  final val SDL_RENDERER_ACCELERATED: UInt = 0x00000002.toUInt\n  final val SDL_RENDERER_PRESENTVSYNC: UInt = 0x00000004.toUInt\n\n  // printErr is a helper function that prints a topic for the error,\n  // and the error message from SDL_GetError() to stderr.\n  def printErr(topic: String): Unit = {\n    Console.err.println(s\"$topic Error: ${fromCString(SDL.SDL_GetError())}\")\n  }\n\n}\n\nclass HelloSDL {\n\n  val title = c\"Hello, World!\"\n  val width = 620\n  val height = 387\n  val imageFilename = c\"../img/grumpy-cat.bmp\"\n\n  var win: Ptr[Window] = _\n  var ren: Ptr[Renderer] = _\n  var rwop: Ptr[SDL_RWops] = _\n  var bmp: Ptr[Surface] = _\n  var tex: Ptr[Texture] = _\n\n  def init(): Boolean = {\n    if (SDL_Init(SDL_INIT_VIDEO.toUInt) != 0) {\n      printErr(\"SDL_Init\")\n      return false\n    }\n\n    win = SDL_CreateWindow(\n      title,\n      SDL_WINDOWPOS_UNDEFINED,\n      SDL_WINDOWPOS_UNDEFINED,\n      width,\n      height,\n      SDL_WINDOW_SHOWN\n    )\n    if (win == null) {\n      printErr(\"SDL_CreateWindow\")\n      return false\n    }\n\n    ren = SDL_CreateRenderer(\n      win,\n      -1,\n      SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC\n    )\n    if (ren == null) {\n      printErr(\"SDL_CreateRenderer\")\n      SDL_DestroyWindow(win)\n      return false\n    }\n\n    rwop = SDL_RWFromFile(imageFilename, c\"rb\")\n    if (rwop == null) {\n      printErr(\"SDL_RWFromFile\")\n      SDL_DestroyRenderer(ren)\n      SDL_DestroyWindow(win)\n      return false\n    }\n\n    bmp = SDL_LoadBMP_RW(rwop, 1) // this also frees rwop\n    if (bmp == null) {\n      printErr(\"SDL_LoadBMP_RW\")\n      SDL_DestroyRenderer(ren)\n      SDL_DestroyWindow(win)\n      return false\n    }\n\n    tex = SDL_CreateTextureFromSurface(ren, bmp)\n    if (tex == null) {\n      printErr(\"SDL_CreateTextureFromSurface\")\n      SDL_FreeSurface(bmp)\n      SDL_DestroyRenderer(ren)\n      SDL_DestroyWindow(win)\n      return false\n    }\n\n    SDL_FreeSurface(bmp)\n\n    true\n  }\n\n  def loop(): Unit = {\n    // Repeat 20 times\n    (1 to 20).foreach { _ =>\n      SDL_RenderClear(ren)\n      SDL_RenderCopy(ren, tex, null, null)\n      SDL_RenderPresent(ren)\n      SDL_Delay(100.toUInt)\n    }\n  }\n\n  def destroy(): Unit = {\n    SDL_DestroyTexture(tex)\n    SDL_DestroyRenderer(ren)\n    SDL_DestroyWindow(win)\n  }\n\n  def quit(): Unit = {\n    SDL_Quit()\n  }\n\n  def run(): Unit = {\n    if (init()) {\n      loop()\n      destroy()\n    }\n    quit()\n  }\n\n}\n\nobject Main extends App {\n  new HelloSDL().run()\n}\n"
  },
  {
    "path": "scala/Makefile",
    "content": ".PHONY: all msg clean fullclean run\n\nall: msg main\n\nmsg:\n\t@echo '--- Scala Native ---'\n\nmain: Main.scala build.sbt project/plugins.sbt\n\tsbt nativeLink\n\t@mv -f ./target/scala-*/scalanative-out ./main\n\nrun: msg main\n\t@#time sbt run\n\ttime ./main\n\nclean:\n\t@#sbt clean\n\t@-rm -f main\n\nfullclean: clean\n\t@-rm -f project/build.properties\n\t@-rm -rf target project/{project,target}\n"
  },
  {
    "path": "scala/README.md",
    "content": "# Scala\n\nBuild and run with:\n\n    sbt run\n\nDepends on sbt, scala native, java and SDL2.\n\nWhen upgrading the scala stdlib version and the scala native version, view the changelog for the latest version here:\n\nhttps://scala-native.org/en/stable/\n\nThen, in the table of `Scala binary version` and `Scala release`, use the ones at the bottom row to update `build.sbt` and `project/plugins.sbt`.\n\nThen see if it builds by running `sbt run`.\n"
  },
  {
    "path": "scala/build.sbt",
    "content": "scalaVersion := \"3.3.0\"\n\nenablePlugins(ScalaNativePlugin)\n\n// needed to be able to set the build options below\nimport scala.scalanative.build._\n\n// compilation options, with available options shown in the comments\nnativeConfig ~= { c =>\n  c.withLTO(LTO.none) // none | full | thin\n    .withMode(Mode.releaseFast) // debug | releaseFast | releaseSize | releaseFull\n    .withGC(GC.immix) // none | boehm | immix | commix\n    .withBuildTarget(BuildTarget.application) // application | libraryDynamic | libraryStatic\n}\n\n// nativeLinkingOptions += \"-static\"\n"
  },
  {
    "path": "scala/project/plugins.sbt",
    "content": "addSbtPlugin(\"org.scala-native\" % \"sbt-scala-native\" % \"0.4.14\")\n"
  },
  {
    "path": "v/Makefile",
    "content": ".PHONY: all msg clean fullclean\n\nall: msg main\n\nmsg:\n\t@echo '--- V ---'\n\nmain: main.v\n\tv -o main main.v\n\nrun: msg main\n\ttime ./main\n\nvrun: main.v\n\tv run main.v\n\nclean:\n\trm -f main\n\nfullclean: clean\n"
  },
  {
    "path": "v/README.md",
    "content": "Install v then:\n\n* ´v install sdl´\n\nRun with `v run .`\n"
  },
  {
    "path": "v/main.v",
    "content": "module main\n\nimport sdl\n\nfn main() {\n\tif sdl.init(sdl.init_everything) != 0 {\n\t\terror_msg := unsafe { cstring_to_vstring(sdl.get_error()) }\n\t\tpanic('sdl.init error:\\n$error_msg')\n\t}\n\n\twindow := sdl.create_window(c'Hello World!', 100, 100, 620, 387, u32(sdl.WindowFlags.shown))\n\tif window == sdl.null {\n\t\terror_msg := unsafe { cstring_to_vstring(sdl.get_error()) }\n\t\tpanic('sdl.create_window error:\\n$error_msg')\n\t}\n\n\trenderer := sdl.create_renderer(window, -1, u32(sdl.RendererFlags.accelerated) | u32(sdl.RendererFlags.presentvsync))\n\tif renderer == sdl.null {\n\t\tsdl.destroy_window(window)\n\t\tsdl.quit()\n\t\terror_msg := unsafe { cstring_to_vstring(sdl.get_error()) }\n\t\tpanic('sdl.create_renderer error:\\n$error_msg')\n\t}\n\n\tbmp := sdl.load_bmp(c'../img/grumpy-cat.bmp')\n\tif bmp == sdl.null {\n\t\terror_msg := unsafe { cstring_to_vstring(sdl.get_error()) }\n\t\tpanic('sdl.load_bmp error:\\n$error_msg')\n\t}\n\n\ttexture := sdl.create_texture_from_surface(renderer, bmp)\n\tif texture == sdl.null {\n\t\tsdl.free_surface(bmp)\n\t\tsdl.destroy_renderer(renderer)\n\t\tsdl.destroy_window(window)\n\t\tsdl.quit()\n\t\terror_msg := unsafe { cstring_to_vstring(sdl.get_error()) }\n\t\tpanic('sdl.create_texture_from_surface error:\\n$error_msg')\n\t}\n\tsdl.free_surface(bmp)\n\n\tfor i := 0; i < 20; i++ {\n\t\tsdl.render_clear(renderer)\n\t\tsdl.render_copy(renderer, texture, sdl.null, sdl.null)\n\t\tsdl.render_present(renderer)\n\t\tsdl.delay(100)\n\t}\n\n\tsdl.destroy_texture(texture)\n\tsdl.destroy_renderer(renderer)\n\tsdl.destroy_window(window)\n\tsdl.quit()\n}\n"
  },
  {
    "path": "zig/Makefile",
    "content": ".PHONY: all msg clean fullclean\n\nall: msg main\n\nmsg:\n\t@echo '--- Zig ---'\n\nmain: main.zig\n\tzig build-exe -lc -lSDL2 -OReleaseFast --name $@ $<\n\nsmall: main.zig\n\tzig build-exe -lc -lSDL2 -OReleaseSmall --strip --name $@ $<\n\t-sstrip \"$@\"\n\ndebug: main.zig\n\tzig build-exe -lc -lSDL2 --name $@ $<\n\nmain.s: main.zig\n\t@# This only works after clearing the cache!\n\t@-rm -rf zig-cache\n\tzig build-exe -lc -lSDL2 -OReleaseFast -femit-asm $<\n\nasm: main.s\n\nrun: msg main\n\ttime ./main\n\nclean:\n\trm -f main small *.o *.s\n\nfullclean: clean\n\trm -rf zig-cache\n"
  },
  {
    "path": "zig/README.md",
    "content": "# Zig SDL2 example\n\nTested with these versions of Zig on Arch Linux:\n\n* 0.7.1\n* 0.8.0\n* 0.9.1\n"
  },
  {
    "path": "zig/build.zig",
    "content": "const Builder = @import(\"std\").build.Builder;\n\npub fn build(b: *Builder) void {\n    // Standard target options allows the person running `zig build` to choose\n    // what target to build for. Here we do not override the defaults, which\n    // means any target is allowed, and the default is native. Other options\n    // for restricting supported target set are available.\n    const target = b.standardTargetOptions(.{});\n\n    // Standard release options allow the person running `zig build` to select\n    // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.\n    const mode = b.standardReleaseOptions();\n\n    const exe = b.addExecutable(\"zig\", \"main.zig\");\n    exe.setTarget(target);\n    exe.setBuildMode(mode);\n    exe.install();\n\n    exe.linkSystemLibrary(\"sdl2\");\n\n    const run_cmd = exe.run();\n    run_cmd.step.dependOn(b.getInstallStep());\n    if (b.args) |args| {\n        run_cmd.addArgs(args);\n    }\n\n    const run_step = b.step(\"run\", \"Run the app\");\n    run_step.dependOn(&run_cmd.step);\n}\n"
  },
  {
    "path": "zig/main.zig",
    "content": "const sdl2 = @cImport(@cInclude(\"SDL2/SDL.h\"));\nconst print = @import(\"std\").debug.print;\n\npub fn main() !u8 {\n\n    // Initialize SDL2\n    if (sdl2.SDL_Init(sdl2.SDL_INIT_EVERYTHING) != 0) {\n        print(\"SDL_Init Error: {s}\\n\", .{sdl2.SDL_GetError()});\n        return 1;\n    }\n    defer sdl2.SDL_Quit();\n\n    // Create a SDL_Window\n    const win: ?*sdl2.SDL_Window = sdl2.SDL_CreateWindow(\"Hello World!\", 100, 100, 620, 387, sdl2.SDL_WINDOW_SHOWN);\n    if (win == null) {\n        print(\"SDL_CreateWindow Error: {s}\\n\", .{sdl2.SDL_GetError()});\n        return 1;\n    }\n    defer sdl2.SDL_DestroyWindow(win);\n\n    // Create a SDL_Renderer\n    const ren: ?*sdl2.SDL_Renderer = sdl2.SDL_CreateRenderer(win, -1, sdl2.SDL_RENDERER_ACCELERATED | sdl2.SDL_RENDERER_PRESENTVSYNC);\n    if (ren == null) {\n        print(\"SDL_CreateRenderer Error: {s}\\n\", .{sdl2.SDL_GetError()});\n        return 1;\n    }\n    defer sdl2.SDL_DestroyRenderer(ren);\n\n    // Load the image as an SDL_Surface\n    const bmp: ?*sdl2.SDL_Surface = sdl2.SDL_LoadBMP(\"../img/grumpy-cat.bmp\");\n    if (bmp == null) {\n        print(\"SDL_LoadBMP Error: {s}\\n\", .{sdl2.SDL_GetError()});\n        return 1;\n    }\n    defer sdl2.SDL_FreeSurface(bmp);\n\n    // Create a SDL_Texture from the SDL_Surface\n    const tex: ?*sdl2.SDL_Texture = sdl2.SDL_CreateTextureFromSurface(ren, bmp);\n    if (tex == null) {\n        print(\"SDL_CreateTextureFromSurface Error: {s}\\n\", .{sdl2.SDL_GetError()});\n        return 1;\n    }\n    defer sdl2.SDL_DestroyTexture(tex);\n\n    // Render the SDL_Texture to the SDL_Window, repeatedly\n    var i: usize = 0;\n    while (i < 20) : (i += 1) {\n        _ = sdl2.SDL_RenderClear(ren);\n        _ = sdl2.SDL_RenderCopy(ren, tex, null, null);\n        sdl2.SDL_RenderPresent(ren);\n        sdl2.SDL_Delay(100);\n    }\n\n    return 0;\n}\n"
  }
]