Merge branch 'WebAssembly' into 'master'
Web assembly See merge request Mergul/bubel-ecs!3
This commit is contained in:
commit
46530ff45b
131 changed files with 25545 additions and 1264 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -5,3 +5,6 @@
|
||||||
!README.md
|
!README.md
|
||||||
!./dub.json
|
!./dub.json
|
||||||
!.gitignore
|
!.gitignore
|
||||||
|
!meson.build
|
||||||
|
!meson_options.txt
|
||||||
|
!compile_wasm.py
|
||||||
9
.gitlab-ci.yml
Normal file
9
.gitlab-ci.yml
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
test_dmd:
|
||||||
|
stage: test
|
||||||
|
image: mmcomando/ecs_enviroment
|
||||||
|
script:
|
||||||
|
- source $(/script/dlang/install.sh dmd -a) && dmd --version
|
||||||
|
- source $(/script/dlang/install.sh dmd -a) && dub -c unittest-runner -b unittest
|
||||||
|
artifacts:
|
||||||
|
reports:
|
||||||
|
junit: test_report.xml
|
||||||
93
compile_wasm.py
Normal file
93
compile_wasm.py
Normal file
|
|
@ -0,0 +1,93 @@
|
||||||
|
import os
|
||||||
|
import ntpath
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def compile(sources, output):
|
||||||
|
files = []
|
||||||
|
# r=root, d=directories, f = files
|
||||||
|
for path in sources:
|
||||||
|
for r, d, f in os.walk(path):
|
||||||
|
for file in f:
|
||||||
|
if ntpath.basename(file) != 'win_dll.d':
|
||||||
|
filename, file_extension = os.path.splitext(file)
|
||||||
|
if file_extension == '.d' and filename != 'package':
|
||||||
|
files.append(os.path.join(r, file))
|
||||||
|
|
||||||
|
ldc_cmd = 'ldc2 ' + shared_flags + ldc_flags + '-oq -mtriple=wasm32-unknown-unknown-wasm -betterC --output-bc --od=.bc --singleobj --checkaction=C --of=' + output + ' '
|
||||||
|
|
||||||
|
for path in sources:
|
||||||
|
ldc_cmd += '-I' + path + ' '
|
||||||
|
|
||||||
|
for path in import_paths:
|
||||||
|
ldc_cmd += '-I' + path + ' '
|
||||||
|
|
||||||
|
for f in files:
|
||||||
|
ldc_cmd += f + ' '
|
||||||
|
|
||||||
|
print(ldc_cmd)
|
||||||
|
|
||||||
|
if os.system(ldc_cmd):
|
||||||
|
exit(0)
|
||||||
|
print()
|
||||||
|
|
||||||
|
shared_flags = ''
|
||||||
|
clean = 0
|
||||||
|
emc_flags = ''
|
||||||
|
ldc_flags = '--d-version=ECSEmscripten '
|
||||||
|
import_paths = ['source','tests']
|
||||||
|
build_tests = 0
|
||||||
|
|
||||||
|
for arg in sys.argv[1:]:
|
||||||
|
if(arg == '-release'):
|
||||||
|
ldc_flags += '-release '
|
||||||
|
elif(arg == '-enable-inlining'):
|
||||||
|
ldc_flags += '-enable-inlining '
|
||||||
|
elif(arg == '-O3'):
|
||||||
|
shared_flags += '-O3 '
|
||||||
|
elif(arg == '-O2'):
|
||||||
|
shared_flags += '-O2 '
|
||||||
|
elif(arg == '-O1'):
|
||||||
|
shared_flags += '-O1 '
|
||||||
|
elif(arg == '-O0'):
|
||||||
|
shared_flags += '-O0 '
|
||||||
|
elif(arg == '-Os'):
|
||||||
|
shared_flags += '-Os '
|
||||||
|
elif(arg == '-Oz'):
|
||||||
|
shared_flags += '-Oz '
|
||||||
|
elif(arg == '-g'):
|
||||||
|
shared_flags += '-g '
|
||||||
|
elif(arg == '-g4'):
|
||||||
|
ldc_flags += '-g '
|
||||||
|
emc_flags += '-g4 '
|
||||||
|
elif(arg == '--build-tests'):
|
||||||
|
build_tests = 1
|
||||||
|
elif(arg == '--llvm-lto'):
|
||||||
|
emc_flags += '--llvm-lto 3 '
|
||||||
|
elif(arg == '--simd'):
|
||||||
|
emc_flags += '-s SIMD=1 '
|
||||||
|
elif(arg == '-opt'):
|
||||||
|
shared_flags += '-O3 '
|
||||||
|
ldc_flags += '-release -enable-inlining '
|
||||||
|
emc_flags += '--llvm-lto 3 -s SIMD=1 '
|
||||||
|
elif(arg == '-pthread'):
|
||||||
|
emc_flags += '-s PTHREAD_POOL_SIZE=16 -s USE_PTHREADS=1 '
|
||||||
|
else:
|
||||||
|
print('unknown argument: ' + arg)
|
||||||
|
exit()
|
||||||
|
|
||||||
|
compile(['source'], 'ecs.bc')
|
||||||
|
|
||||||
|
if build_tests == 0:
|
||||||
|
exit(0)
|
||||||
|
|
||||||
|
compile(['tests'], 'tests.bc')
|
||||||
|
|
||||||
|
emcc_cmd = 'emcc -v ' + shared_flags + emc_flags + '-s ALLOW_MEMORY_GROWTH=1 -s WASM_MEM_MAX=1024MB -s MALLOC=dlmalloc -s WASM=1 -o index.html '
|
||||||
|
#-s ALLOW_MEMORY_GROWTH=1
|
||||||
|
|
||||||
|
emcc_cmd += 'ecs.bc tests.bc'
|
||||||
|
#emcc_cmd += 'tests.bc'
|
||||||
|
|
||||||
|
print(emcc_cmd)
|
||||||
|
|
||||||
|
os.system(emcc_cmd)
|
||||||
15
demos/.gitignore
vendored
Normal file
15
demos/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
*
|
||||||
|
!*/
|
||||||
|
!**/dub.json
|
||||||
|
!libs/
|
||||||
|
!*.dll
|
||||||
|
!libs/**
|
||||||
|
!utils/**/*.d
|
||||||
|
!source/**/*.d
|
||||||
|
!launcher/**/*.d
|
||||||
|
!assets/**
|
||||||
|
!external/**/*.d
|
||||||
|
!.gitignore
|
||||||
|
!compile_wasm.py
|
||||||
|
!cimgui.bc
|
||||||
|
.dub
|
||||||
BIN
demos/SDL2.dll
Normal file
BIN
demos/SDL2.dll
Normal file
Binary file not shown.
BIN
demos/SDL2_image.dll
Normal file
BIN
demos/SDL2_image.dll
Normal file
Binary file not shown.
BIN
demos/assets/fonts/Ruda-Bold.ttf
Normal file
BIN
demos/assets/fonts/Ruda-Bold.ttf
Normal file
Binary file not shown.
42
demos/assets/shaders/base.fp
Normal file
42
demos/assets/shaders/base.fp
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
precision mediump int;
|
||||||
|
precision mediump float;
|
||||||
|
precision lowp sampler2D;
|
||||||
|
precision lowp samplerCube;
|
||||||
|
|
||||||
|
#ifdef GLES
|
||||||
|
#if __VERSION__ >290
|
||||||
|
in mediump vec2 uv;
|
||||||
|
#else
|
||||||
|
varying mediump vec2 uv;
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#if __VERSION__ > 320
|
||||||
|
in vec2 uv;
|
||||||
|
#else
|
||||||
|
varying vec2 uv;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//layout(binding = 0)uniform sampler2D tex;
|
||||||
|
|
||||||
|
uniform sampler2D tex;
|
||||||
|
|
||||||
|
//layout(location = 0) out vec4 outColor;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
|
||||||
|
#ifdef GLES
|
||||||
|
#if __VERSION__ >290
|
||||||
|
gl_FragColor = texture(tex,uv);
|
||||||
|
#else
|
||||||
|
gl_FragColor = texture2D(tex,uv);
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#if __VERSION__ > 320
|
||||||
|
gl_FragColor = texture(tex,uv);
|
||||||
|
#else
|
||||||
|
gl_FragColor = texture2D(tex,uv);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
if(gl_FragColor.a < 0.01)discard;
|
||||||
|
}
|
||||||
55
demos/assets/shaders/base.vp
Normal file
55
demos/assets/shaders/base.vp
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
precision highp float;
|
||||||
|
precision highp int;
|
||||||
|
precision lowp sampler2D;
|
||||||
|
precision lowp samplerCube;
|
||||||
|
|
||||||
|
#ifdef GLES
|
||||||
|
#if __VERSION__ >290
|
||||||
|
layout(location = 0) uniform vec4 matrix_1;
|
||||||
|
layout(location = 1) uniform vec4 matrix_2;
|
||||||
|
layout(location = 2) uniform vec4 uv_transform;
|
||||||
|
|
||||||
|
layout(location = 0) in vec2 positions;
|
||||||
|
layout(location = 1) in vec2 tex_coords;
|
||||||
|
|
||||||
|
out mediump vec2 uv;
|
||||||
|
#else
|
||||||
|
uniform vec4 matrix_1;
|
||||||
|
uniform vec4 matrix_2;
|
||||||
|
uniform vec4 uv_transform;
|
||||||
|
|
||||||
|
attribute vec2 positions;
|
||||||
|
attribute vec2 tex_coords;
|
||||||
|
|
||||||
|
varying mediump vec2 uv;
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#if __VERSION__ > 320
|
||||||
|
uniform vec4 matrix_1;
|
||||||
|
uniform vec4 matrix_2;
|
||||||
|
uniform vec4 uv_transform;
|
||||||
|
|
||||||
|
layout(location = 0) in vec2 positions;
|
||||||
|
layout(location = 1) in vec2 tex_coords;
|
||||||
|
|
||||||
|
out vec2 uv;
|
||||||
|
#else
|
||||||
|
uniform vec4 matrix_1;
|
||||||
|
uniform vec4 matrix_2;
|
||||||
|
uniform vec4 uv_transform;
|
||||||
|
|
||||||
|
attribute vec2 positions;
|
||||||
|
attribute vec2 tex_coords;
|
||||||
|
|
||||||
|
varying vec2 uv;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
|
||||||
|
vec3 position = mat3(matrix_1.x,matrix_1.y,0,matrix_1.z,matrix_1.w,0,matrix_2.xy,1) * vec3(positions,1.0);
|
||||||
|
uv = tex_coords * uv_transform.zw + uv_transform.xy;
|
||||||
|
|
||||||
|
gl_Position = vec4(position.xy,0,1.0);
|
||||||
|
|
||||||
|
}
|
||||||
BIN
demos/assets/textures/buckler.png
Normal file
BIN
demos/assets/textures/buckler.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 575 B |
BIN
demos/cimgui.bc
Normal file
BIN
demos/cimgui.bc
Normal file
Binary file not shown.
BIN
demos/cimgui.dll
Normal file
BIN
demos/cimgui.dll
Normal file
Binary file not shown.
108
demos/compile_wasm.py
Normal file
108
demos/compile_wasm.py
Normal file
|
|
@ -0,0 +1,108 @@
|
||||||
|
import os
|
||||||
|
import ntpath
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def compile(sources, output):
|
||||||
|
files = []
|
||||||
|
# r=root, d=directories, f = files
|
||||||
|
for path in sources:
|
||||||
|
for r, d, f in os.walk(path):
|
||||||
|
for file in f:
|
||||||
|
if ntpath.basename(file) != 'win_dll.d':
|
||||||
|
filename, file_extension = os.path.splitext(file)
|
||||||
|
if file_extension == '.d' and filename != 'package':
|
||||||
|
files.append(os.path.join(r, file))
|
||||||
|
|
||||||
|
ldc_cmd = compiler + shared_flags + ldc_flags + '-oq -mtriple=wasm32-unknown-unknown-wasm -betterC --output-bc --od=.bc --singleobj --checkaction=C --of=' + output + ' '
|
||||||
|
|
||||||
|
for path in sources:
|
||||||
|
ldc_cmd += '-I' + path + ' '
|
||||||
|
|
||||||
|
for path in import_paths:
|
||||||
|
ldc_cmd += '-I' + path + ' '
|
||||||
|
|
||||||
|
for f in files:
|
||||||
|
ldc_cmd += f + ' '
|
||||||
|
|
||||||
|
print(ldc_cmd)
|
||||||
|
|
||||||
|
if os.system(ldc_cmd):
|
||||||
|
exit(0)
|
||||||
|
print()
|
||||||
|
|
||||||
|
|
||||||
|
compiler = 'ldc2 '
|
||||||
|
#compiler = 'ldmd2 -vtls '
|
||||||
|
shared_flags = ''
|
||||||
|
clean = 0
|
||||||
|
demo = 0
|
||||||
|
sources = ['tests', 'source']
|
||||||
|
emc_flags = '-s USE_SDL=2 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS="[\'png\']" --preload-file assets '
|
||||||
|
ldc_flags = '--d-version=ECSEmscripten --d-version=SDL_209 --d-version=BindSDL_Static --d-version=BindSDL_Image --d-version=MM_USE_POSIX_THREADS '
|
||||||
|
import_paths = ['external/sources', 'external/imports', 'external/wasm_imports', '../source', 'utils/source', 'simple/source']
|
||||||
|
|
||||||
|
for arg in sys.argv[1:]:
|
||||||
|
if(arg == '-release'):
|
||||||
|
ldc_flags += '-release '
|
||||||
|
elif(arg == '-enable-inlining'):
|
||||||
|
ldc_flags += '-enable-inlining '
|
||||||
|
elif(arg == '-O3'):
|
||||||
|
shared_flags += '-O3 '
|
||||||
|
elif(arg == '-O2'):
|
||||||
|
shared_flags += '-O2 '
|
||||||
|
elif(arg == '-O1'):
|
||||||
|
shared_flags += '-O1 '
|
||||||
|
elif(arg == '-O0'):
|
||||||
|
shared_flags += '-O0 '
|
||||||
|
elif(arg == '-Os'):
|
||||||
|
shared_flags += '-Os '
|
||||||
|
elif(arg == '-Oz'):
|
||||||
|
shared_flags += '-Oz '
|
||||||
|
elif(arg == '-g'):
|
||||||
|
shared_flags += '-g '
|
||||||
|
elif(arg == '-g4'):
|
||||||
|
ldc_flags += '-g '
|
||||||
|
emc_flags += '-g4 --source-map-base ./ '
|
||||||
|
elif(arg == '--llvm-lto'):
|
||||||
|
emc_flags += '--llvm-lto 3 '
|
||||||
|
elif(arg == '--simd'):
|
||||||
|
emc_flags += '-s SIMD=1 '
|
||||||
|
elif(arg == '-opt'):
|
||||||
|
shared_flags += '-O3 '
|
||||||
|
ldc_flags += '-release -enable-inlining '
|
||||||
|
emc_flags += '--llvm-lto 3 -s SIMD=1 '
|
||||||
|
elif(arg == '-quiet'):
|
||||||
|
emc_flags += "-Wl,--no-check-features "
|
||||||
|
elif(arg == '--clean'):
|
||||||
|
clean = 1
|
||||||
|
elif(arg == '-pthread'):
|
||||||
|
emc_flags += '-s USE_PTHREADS=1 '
|
||||||
|
elif(arg == '--demo=simple'):
|
||||||
|
demo = 0
|
||||||
|
else:
|
||||||
|
print('unknown argument: ' + arg)
|
||||||
|
exit()
|
||||||
|
|
||||||
|
compile(['external/wasm_imports/bindbc/sdl'], 'bindbc-sdl.bc')
|
||||||
|
compile(['utils/source'], 'utils.bc')
|
||||||
|
compile(['external/sources/mmutils'], 'mmutils.bc')
|
||||||
|
compile(['external/sources/glad'], 'glad.bc')
|
||||||
|
compile(['source'], 'demo.bc')
|
||||||
|
|
||||||
|
if clean or os.path.exists('../ecs.bc') == 0 or os.path.isfile('../ecs.bc') == 0:
|
||||||
|
compile(['../source'], '../ecs.bc')
|
||||||
|
|
||||||
|
emcc_cmd = 'emcc -v ' + shared_flags + emc_flags + '-s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1 -s ALLOW_MEMORY_GROWTH=1 -s WASM_MEM_MAX=2048MB -s MALLOC=dlmalloc -s WASM=1 -o index.html '
|
||||||
|
#-s ALLOW_MEMORY_GROWTH=1 -s PROXY_TO_PTHREAD=1 -Wl,--no-check-features -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s TOTAL_MEMORY=512MB
|
||||||
|
|
||||||
|
emcc_cmd += '../ecs.bc '
|
||||||
|
emcc_cmd += 'utils.bc '
|
||||||
|
emcc_cmd += 'bindbc-sdl.bc '
|
||||||
|
emcc_cmd += 'glad.bc '
|
||||||
|
emcc_cmd += 'cimgui.bc '
|
||||||
|
emcc_cmd += 'mmutils.bc '
|
||||||
|
emcc_cmd += 'demo.bc '
|
||||||
|
|
||||||
|
print(emcc_cmd)
|
||||||
|
|
||||||
|
os.system(emcc_cmd)
|
||||||
42
demos/dub.json
Normal file
42
demos/dub.json
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
{
|
||||||
|
"name": "demo",
|
||||||
|
"authors": [
|
||||||
|
"Michał Masiukiewicz", "Dawid Masiukiewicz"
|
||||||
|
],
|
||||||
|
"description": "Dynamic Entity Component System simple example",
|
||||||
|
"copyright": "Copyright © 2018-2019, Michał Masiukiewicz, Dawid Masiukiewicz",
|
||||||
|
"license": "BSD 3-clause",
|
||||||
|
"dependencies": {
|
||||||
|
"ecs_utils":{"path":"utils/"}
|
||||||
|
},
|
||||||
|
"sourcePaths": [
|
||||||
|
"source"
|
||||||
|
],
|
||||||
|
"importPaths": [
|
||||||
|
"source"
|
||||||
|
],
|
||||||
|
"libs-windows-x86_64": ["libs/windows/x64/SDL2","libs/windows/x64/SDL2_Image","libs/windows/x64/cimgui"],
|
||||||
|
"libs-linux-x86_64": ["cimgui","SDL2","SDL2_image"],
|
||||||
|
"lflags-linux-x86_64": ["-rpath=libs/linux/x64/","-Llibs/linux/x64/"],
|
||||||
|
"configurations" : [
|
||||||
|
{
|
||||||
|
"name" : "default",
|
||||||
|
"targetType" : "executable",
|
||||||
|
"subConfigurations":
|
||||||
|
{
|
||||||
|
"ecs_utils":"default"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "betterC",
|
||||||
|
"targetType" : "executable",
|
||||||
|
"dflags": [
|
||||||
|
"-betterC"
|
||||||
|
],
|
||||||
|
"subConfigurations":
|
||||||
|
{
|
||||||
|
"ecs_utils":"betterC"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
1990
demos/external/sources/cimgui/cimgui.d
vendored
Normal file
1990
demos/external/sources/cimgui/cimgui.d
vendored
Normal file
File diff suppressed because it is too large
Load diff
28
demos/external/sources/glad/gl/all.d
vendored
Normal file
28
demos/external/sources/glad/gl/all.d
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
|
||||||
|
OpenGL, OpenGL ES loader generated by glad 0.1.33 on Fri Nov 8 17:14:30 2019.
|
||||||
|
|
||||||
|
Language/Generator: D
|
||||||
|
Specification: gl
|
||||||
|
APIs: gl=3.3, gles2=3.0
|
||||||
|
Profile: compatibility
|
||||||
|
Extensions:
|
||||||
|
|
||||||
|
Loader: True
|
||||||
|
Local files: False
|
||||||
|
Omit khrplatform: False
|
||||||
|
Reproducible: False
|
||||||
|
|
||||||
|
Commandline:
|
||||||
|
--profile="compatibility" --api="gl=3.3,gles2=3.0" --generator="d" --spec="gl" --extensions=""
|
||||||
|
Online:
|
||||||
|
https://glad.dav1d.de/#profile=compatibility&language=d&specification=gl&loader=on&api=gl%3D3.3&api=gles2%3D3.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
module glad.gl.all;
|
||||||
|
|
||||||
|
|
||||||
|
public import glad.gl.funcs;
|
||||||
|
public import glad.gl.ext;
|
||||||
|
public import glad.gl.enums;
|
||||||
|
public import glad.gl.types;
|
||||||
1302
demos/external/sources/glad/gl/enums.d
vendored
Normal file
1302
demos/external/sources/glad/gl/enums.d
vendored
Normal file
File diff suppressed because it is too large
Load diff
10
demos/external/sources/glad/gl/ext.d
vendored
Normal file
10
demos/external/sources/glad/gl/ext.d
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
module glad.gl.ext;
|
||||||
|
|
||||||
|
|
||||||
|
private import glad.gl.types;
|
||||||
|
private import glad.gl.enums;
|
||||||
|
private import glad.gl.funcs;
|
||||||
|
nothrow @nogc extern(System) {
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
}
|
||||||
1508
demos/external/sources/glad/gl/funcs.d
vendored
Normal file
1508
demos/external/sources/glad/gl/funcs.d
vendored
Normal file
File diff suppressed because it is too large
Load diff
404
demos/external/sources/glad/gl/gl.d
vendored
Normal file
404
demos/external/sources/glad/gl/gl.d
vendored
Normal file
|
|
@ -0,0 +1,404 @@
|
||||||
|
module glad.gl.gl;
|
||||||
|
|
||||||
|
|
||||||
|
public import glad.gl.types;
|
||||||
|
public import glad.gl.funcs :
|
||||||
|
glCopyTexImage1D, glVertexAttribI3ui, glWindowPos2s, glWindowPos2i, glWindowPos2f,
|
||||||
|
glWindowPos2d, glVertex2fv, glColor4ub, glIndexi, glFramebufferRenderbuffer,
|
||||||
|
glRectdv, glCompressedTexSubImage3D, glEvalCoord2d, glEvalCoord2f, glIndexd,
|
||||||
|
glVertexAttrib1sv, glIndexf, glBindSampler, glLineWidth, glColorP3uiv,
|
||||||
|
glGetIntegeri_v, glGetMapfv, glIndexs, glCompileShader, glGetTransformFeedbackVarying,
|
||||||
|
glVertex3sv, glIndexfv, glFogiv, glStencilMaskSeparate, glRasterPos2fv,
|
||||||
|
glLightModeliv, glRectd, glSecondaryColor3fv, glMultiTexCoordP3ui, glFogfv,
|
||||||
|
glVertexP4ui, glEnablei, glVertex4iv, glEvalCoord1fv, glWindowPos2sv,
|
||||||
|
glVertexAttribP4ui, glCreateShader, glIsBuffer, glGetMultisamplefv, glGenRenderbuffers,
|
||||||
|
glCopyTexSubImage2D, glCompressedTexImage2D, glVertexAttrib1f, glBlendFuncSeparate, glVertex4fv,
|
||||||
|
glDrawBuffers, glVertexAttrib1s, glTexCoord2fv, glSampleMaski, glVertexP2ui,
|
||||||
|
glTexCoord1i, glTexCoord4fv, glUniformMatrix3x2fv, glPointSize, glVertexAttrib2dv,
|
||||||
|
glDeleteProgram, glColor4bv, glRasterPos2f, glRasterPos2d, glLoadIdentity,
|
||||||
|
glRasterPos2i, glUniformMatrix4x3fv, glColor3b, glClearBufferfv, glEdgeFlag,
|
||||||
|
glFogCoordf, glVertex3d, glVertex3f, glVertex3i, glColor3i,
|
||||||
|
glUniform3f, glVertexAttrib4ubv, glColor3s, glVertex3s, glTexCoordP2ui,
|
||||||
|
glColorMaski, glEnableClientState, glClearBufferfi, glTexCoord1iv, glMultiTexCoord1iv,
|
||||||
|
glMultiTexCoordP2ui, glGetSamplerParameterIiv, glGetFragDataIndex, glRasterPos4i, glVertex2iv,
|
||||||
|
glColor3sv, glGetVertexAttribdv, glUniformMatrix3x4fv, glNormalPointer, glTexCoordP3uiv,
|
||||||
|
glVertex4sv, glPassThrough, glMultiTexCoordP4ui, glFogi, glBegin,
|
||||||
|
glEvalCoord2dv, glColor3ubv, glVertexPointer, glScaled, glDeleteFramebuffers,
|
||||||
|
glDrawArrays, glUniform1ui, glMultiTexCoord1d, glMultiTexCoord1f, glLightfv,
|
||||||
|
glClear, glMultiTexCoord1i, glGetActiveUniformName, glMultiTexCoord1s, glStencilOp,
|
||||||
|
glTexCoord1s, glFramebufferTexture2D, glGetFramebufferAttachmentParameteriv, glTranslatef, glVertexAttrib4Nub,
|
||||||
|
glTranslated, glTexCoord3sv, glGetFragDataLocation, glTexImage1D, glTexParameteriv,
|
||||||
|
glCopyPixels, glSecondaryColor3bv, glGetMaterialfv, glGetTexImage, glFogCoordfv,
|
||||||
|
glVertexAttrib4iv, glPixelMapuiv, glColor4ubv, glGetQueryObjecti64v, glGenFramebuffers,
|
||||||
|
glIndexsv, glGetAttachedShaders, glIsRenderbuffer, glVertex3iv, glBitmap,
|
||||||
|
glMateriali, glIsVertexArray, glDisableVertexAttribArray, glGetQueryiv, glTexCoord4f,
|
||||||
|
glTexCoord4d, glGetSamplerParameterfv, glTexCoord4i, glMaterialf, glTexCoord4s,
|
||||||
|
glGetUniformIndices, glIsShader, glFeedbackBuffer, glVertexAttribI4ubv, glVertex3dv,
|
||||||
|
glPointParameteriv, glDisable, glEnable, glGetActiveUniformsiv, glColor4fv,
|
||||||
|
glTexCoord1fv, glTexCoord2sv, glVertexAttrib4dv, glMultiTexCoord1dv, glGetMapiv,
|
||||||
|
glTexCoord3fv, glSecondaryColor3usv, glMultiTexCoordP3uiv, glVertexAttribP3ui, glGetPointerv,
|
||||||
|
glPolygonOffset, glGetUniformuiv, glNormal3fv, glDepthRange, glFrustum,
|
||||||
|
glMultiTexCoord2f, glDrawBuffer, glPushMatrix, glRasterPos3fv, glOrtho,
|
||||||
|
glDrawElementsInstanced, glWindowPos3sv, glVertexAttrib4d, glClearIndex, glMap1d,
|
||||||
|
glMap1f, glFlush, glGetRenderbufferParameteriv, glIndexiv, glRasterPos3sv,
|
||||||
|
glGetVertexAttribPointerv, glPixelZoom, glDeleteBuffers, glFenceSync, glDeleteVertexArrays,
|
||||||
|
glColorP3ui, glVertexAttrib3sv, glVertexAttrib4s, glGetTexLevelParameteriv, glLighti,
|
||||||
|
glMultiTexCoordP4uiv, glLightf, glGetAttribLocation, glStencilFuncSeparate, glGenSamplers,
|
||||||
|
glClampColor, glUniform4iv, glClearStencil, glVertexAttrib2sv, glMultiTexCoord3fv,
|
||||||
|
glGetPixelMapuiv, glGenTextures, glTexCoord4iv, glGetTexParameterIuiv, glIndexPointer,
|
||||||
|
glVertexAttrib4Nbv, glGetQueryObjectiv, glIsSync, glVertex2f, glVertex2d,
|
||||||
|
glDeleteRenderbuffers, glUniform2i, glMapGrid2d, glMapGrid2f, glShaderSource,
|
||||||
|
glVertex2i, glVertexAttribPointer, glFramebufferTextureLayer, glVertex2s, glNormal3bv,
|
||||||
|
glFlushMappedBufferRange, glSecondaryColor3sv, glPointParameteri, glWindowPos2iv, glGenQueries,
|
||||||
|
glGetPixelMapfv, glTexEnvf, glVertexAttribP1ui, glTexSubImage3D, glGetInteger64i_v,
|
||||||
|
glFogCoordd, glDeleteSamplers, glCopyTexImage2D, glTexEnvi, glBlitFramebuffer,
|
||||||
|
glIsEnabledi, glSecondaryColorP3ui, glBindFragDataLocationIndexed, glMultiTexCoord2dv, glUniform2iv,
|
||||||
|
glUniform4uiv, glMatrixMode, glMultiTexCoord2s, glColor3uiv, glMultiTexCoord2i,
|
||||||
|
glFramebufferTexture1D, glGetShaderiv, glMultiTexCoord2d, glMultiTexCoord4sv, glBindFragDataLocation,
|
||||||
|
glPrioritizeTextures, glCallList, glSecondaryColor3ubv, glGetDoublev, glMultiTexCoord3iv,
|
||||||
|
glVertexAttrib1d, glLightModelf, glVertexAttrib1fv, glVertex2sv, glLightModeli,
|
||||||
|
glBindBufferRange, glWindowPos3iv, glMultiTexCoordP1uiv, glUniform3fv, glCallLists,
|
||||||
|
glMapBuffer, glSecondaryColor3d, glTexCoord3i, glMultiTexCoord4fv, glRasterPos3i,
|
||||||
|
glSecondaryColor3b, glRasterPos3d, glRasterPos3f, glCompressedTexImage3D, glTexCoord3f,
|
||||||
|
glDeleteSync, glMultiTexCoordP1ui, glGetVertexAttribiv, glSecondaryColor3s, glVertexAttrib3fv,
|
||||||
|
glTexCoord3s, glUniform3iv, glRasterPos3s, glPolygonMode, glGetActiveUniformBlockiv,
|
||||||
|
glAreTexturesResident, glIsList, glRasterPos4sv, glCopyTexSubImage3D, glColor4s,
|
||||||
|
glUseProgram, glLineStipple, glSamplerParameterIuiv, glMultiTexCoord1sv, glGetProgramInfoLog,
|
||||||
|
glMultiTexCoord2iv, glTexCoord1sv, glBindVertexArray, glColor4b, glSecondaryColor3f,
|
||||||
|
glColor4f, glColor4d, glColor4i, glMultiDrawElementsBaseVertex, glUniform4fv,
|
||||||
|
glRasterPos3iv, glVertex2dv, glTexCoord4sv, glUniform2uiv, glCompressedTexSubImage1D,
|
||||||
|
glFinish, glClipPlane, glDeleteShader, glRasterPos2s, glGetMapdv,
|
||||||
|
glVertexAttrib4Nsv, glTexGendv, glViewport, glBindBufferBase, glVertexP3uiv,
|
||||||
|
glTransformFeedbackVaryings, glIndexdv, glTexCoord3d, glTexCoord3iv, glVertexAttribI3i,
|
||||||
|
glClearDepth, glVertexAttribI4usv, glTexParameterf, glTexParameteri, glGetShaderSource,
|
||||||
|
glTexBuffer, glPixelStorei, glValidateProgram, glPixelStoref, glSecondaryColor3iv,
|
||||||
|
glRasterPos4fv, glEvalCoord1dv, glMultiTexCoordP2uiv, glRecti, glMultiDrawElements,
|
||||||
|
glRectf, glColor4ui, glNormal3sv, glGetFloatv, glColor4us,
|
||||||
|
glVertexAttribP1uiv, glLinkProgram, glTexSubImage1D, glBindTexture, glRects,
|
||||||
|
glTexCoord2dv, glRasterPos4iv, glGetString, glVertexAttribP2uiv, glEdgeFlagv,
|
||||||
|
glDetachShader, glScalef, glEndQuery, glSecondaryColor3uiv, glEdgeFlagPointer,
|
||||||
|
glVertexAttrib4Nuiv, glVertexAttribI2ui, glPopAttrib, glDeleteTextures, glStencilOpSeparate,
|
||||||
|
glDeleteQueries, glNormalP3uiv, glVertexAttrib4f, glRenderbufferStorage, glInitNames,
|
||||||
|
glColor3dv, glPixelMapfv, glGetTexParameteriv, glWaitSync, glBeginConditionalRender,
|
||||||
|
glDrawElementsBaseVertex, glSampleCoverage, glSamplerParameteri, glSamplerParameterf, glUniform1f,
|
||||||
|
glGetVertexAttribfv, glRenderMode, glGetCompressedTexImage, glWindowPos2dv, glUniform1i,
|
||||||
|
glGetActiveAttrib, glUniform3i, glPixelTransferi, glTexSubImage2D, glGetUniformiv,
|
||||||
|
glLogicOp, glEvalPoint2, glPixelTransferf, glUniform4ui, glColor3f,
|
||||||
|
glBindFramebuffer, glGetTexEnvfv, glRectfv, glCullFace, glGetLightfv,
|
||||||
|
glTexGenf, glTexGend, glTexGeni, glMultiTexCoord3s, glVertexAttribI2uiv,
|
||||||
|
glMultiTexCoord3i, glMultiTexCoord3f, glMultiTexCoord3d, glAttachShader, glFogCoorddv,
|
||||||
|
glGetTexGenfv, glQueryCounter, glFogCoordPointer, glProvokingVertex, glRasterPos4dv,
|
||||||
|
glTexGeniv, glDrawElements, glColorMaterial, glSecondaryColor3dv, glClientActiveTexture,
|
||||||
|
glVertexAttribI4sv, glTexCoord2iv, glUniform1iv, glGetBufferParameteriv, glReadBuffer,
|
||||||
|
glTexParameterIuiv, glDrawArraysInstanced, glGenerateMipmap, glWindowPos3fv, glLightModelfv,
|
||||||
|
glSamplerParameteriv, glDeleteLists, glGetClipPlane, glVertexAttrib3f, glTexCoord2d,
|
||||||
|
glVertexAttrib3d, glTexCoord2f, glRasterPos2dv, glIndexubv, glUnmapBuffer,
|
||||||
|
glTexCoord2i, glRasterPos4d, glRasterPos4f, glVertexAttrib3s, glTexCoord2s,
|
||||||
|
glBindRenderbuffer, glVertex3fv, glTexCoord4dv, glMaterialiv, glVertexAttribP4uiv,
|
||||||
|
glIsProgram, glPointParameterfv, glVertex4s, glPopMatrix, glVertexAttrib4fv,
|
||||||
|
glNormal3dv, glUniform4i, glActiveTexture, glEnableVertexAttribArray, glRotated,
|
||||||
|
glRotatef, glVertex4i, glArrayElement, glReadPixels, glVertexAttribI3iv,
|
||||||
|
glStencilMask, glUniform4f, glRenderbufferStorageMultisample, glColor3d, glGenVertexArrays,
|
||||||
|
glShadeModel, glMapGrid1d, glGetUniformfv, glMapGrid1f, glDrawPixels,
|
||||||
|
glDisableClientState, glMultiTexCoord3sv, glDrawElementsInstancedBaseVertex, glSecondaryColorPointer, glAlphaFunc,
|
||||||
|
glMultiTexCoord4iv, glTexEnvfv, glStencilFunc, glTexCoord3dv, glUniformBlockBinding,
|
||||||
|
glColor4uiv, glRectiv, glColorP4ui, glRasterPos3dv, glEvalMesh2,
|
||||||
|
glEvalMesh1, glTexCoordPointer, glLoadMatrixf, glVertexAttribI4iv, glEvalCoord2fv,
|
||||||
|
glGetShaderInfoLog, glLoadTransposeMatrixd, glLoadTransposeMatrixf, glVertexAttribI4i, glRasterPos2iv,
|
||||||
|
glGetBufferSubData, glTexEnviv, glBlendEquationSeparate, glVertexAttribI1ui, glGenBuffers,
|
||||||
|
glSelectBuffer, glTexCoordP1uiv, glPushAttrib, glVertexAttribIPointer, glBlendFunc,
|
||||||
|
glCreateProgram, glTexImage3D, glIsFramebuffer, glLightiv, glPrimitiveRestartIndex,
|
||||||
|
glTexGenfv, glTexCoord1dv, glEnd, glGetInteger64v, glScissor,
|
||||||
|
glTexCoordP4uiv, glGetBooleanv, glPushName, glMaterialfv, glIndexub,
|
||||||
|
glVertexP2uiv, glUniform3uiv, glMultTransposeMatrixf, glMultTransposeMatrixd, glClearColor,
|
||||||
|
glVertexAttrib4uiv, glPolygonStipple, glVertexAttrib4Niv, glClearBufferiv, glGetBufferParameteri64v,
|
||||||
|
glColorP4uiv, glBlendColor, glWindowPos3d, glGetStringi, glColor4iv,
|
||||||
|
glUniform3ui, glSecondaryColor3us, glVertexAttribI4uiv, glVertexAttrib4bv, glUniform2fv,
|
||||||
|
glSecondaryColor3ub, glSecondaryColor3ui, glMultiTexCoord1fv, glGetSamplerParameterIuiv, glNormal3i,
|
||||||
|
glTexCoordP3ui, glNormal3iv, glWindowPos3s, glPointParameterf, glColor3us,
|
||||||
|
glWindowPos3i, glUniformMatrix2x3fv, glWindowPos3f, glGetVertexAttribIuiv, glMultiTexCoord4s,
|
||||||
|
glVertexAttrib4Nusv, glGetLightiv, glDepthFunc, glCompressedTexSubImage2D, glListBase,
|
||||||
|
glMultiTexCoord4f, glColor3ub, glMultiTexCoord4d, glVertexAttribI4bv, glGetTexParameterfv,
|
||||||
|
glColor3ui, glMultiTexCoord4i, glGetPolygonStipple, glClientWaitSync, glVertexAttribI4ui,
|
||||||
|
glPixelMapusv, glColorMask, glTexParameterIiv, glBlendEquation, glGetUniformLocation,
|
||||||
|
glGetTexGeniv, glRasterPos4s, glEndTransformFeedback, glVertexAttrib4usv, glTexImage2DMultisample,
|
||||||
|
glColor4sv, glPopClientAttrib, glColor4dv, glBeginTransformFeedback, glFogf,
|
||||||
|
glVertexAttribI1iv, glIsSampler, glVertexP3ui, glVertexAttribDivisor, glColor3iv,
|
||||||
|
glCompressedTexImage1D, glCopyTexSubImage1D, glDrawRangeElementsBaseVertex, glCheckFramebufferStatus, glTexCoord1d,
|
||||||
|
glTexCoord1f, glEndConditionalRender, glUniform1uiv, glBindAttribLocation, glUniformMatrix4x2fv,
|
||||||
|
glMultiTexCoord2sv, glVertexAttrib1dv, glDrawRangeElements, glGetQueryObjectuiv, glSamplerParameterIiv,
|
||||||
|
glBufferSubData, glVertexAttribI2i, glGenLists, glColor3bv, glMapBufferRange,
|
||||||
|
glFramebufferTexture, glGetTexGendv, glMultiDrawArrays, glEndList, glVertexP4uiv,
|
||||||
|
glUniform2ui, glVertexAttribI2iv, glColor3usv, glWindowPos2fv, glDisablei,
|
||||||
|
glIndexMask, glPushClientAttrib, glVertex4dv, glTexCoordP4ui, glGetActiveUniformBlockName,
|
||||||
|
glVertexAttribI3uiv, glClearAccum, glGetSynciv, glTexCoordP2uiv, glUniform2f,
|
||||||
|
glBeginQuery, glUniformMatrix4fv, glBindBuffer, glMap2d, glMap2f,
|
||||||
|
glRasterPos2sv, glUniformMatrix2fv, glUniformMatrix2x4fv, glBufferData, glEvalPoint1,
|
||||||
|
glGetTexParameterIiv, glIsEnabled, glTexCoordP1ui, glGetError, glGetTexEnviv,
|
||||||
|
glGetProgramiv, glVertexAttribP2ui, glNewList, glSecondaryColor3i, glMultiTexCoord2fv,
|
||||||
|
glNormalP3ui, glEvalCoord1d, glGetTexLevelParameterfv, glEvalCoord1f, glVertexAttribI1i,
|
||||||
|
glVertex4d, glVertexAttribP3uiv, glGetPixelMapusv, glSecondaryColorP3uiv, glGetIntegerv,
|
||||||
|
glAccum, glGetBufferPointerv, glGetVertexAttribIiv, glFramebufferTexture3D, glVertexAttrib2fv,
|
||||||
|
glIsQuery, glVertexAttrib4sv, glWindowPos3dv, glTexImage2D, glLoadName,
|
||||||
|
glSamplerParameterfv, glMultMatrixd, glMultMatrixf, glIsTexture, glGetMaterialiv,
|
||||||
|
glUniform1fv, glVertexAttrib4Nubv, glLoadMatrixd, glTexParameterfv, glUniformMatrix3fv,
|
||||||
|
glVertex4f, glRectsv, glColor4usv, glNormal3s, glInterleavedArrays,
|
||||||
|
glHint, glNormal3f, glNormal3d, glNormal3b, glMultiTexCoord4dv,
|
||||||
|
glGetSamplerParameteriv, glPopName, glCopyBufferSubData, glVertexAttribI1uiv, glVertexAttrib2d,
|
||||||
|
glVertexAttrib2f, glVertexAttrib3dv, glGetQueryObjectui64v, glDepthMask, glVertexAttrib2s,
|
||||||
|
glColor3fv, glTexImage3DMultisample, glGetUniformBlockIndex, glMultiTexCoord3dv, glGetActiveUniform,
|
||||||
|
glColorPointer, glFrontFace, glGetBooleani_v, glClearBufferuiv;
|
||||||
|
|
||||||
|
public import glad.gl.enums :
|
||||||
|
GL_INDEX_CLEAR_VALUE, GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER, GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE, GL_FOG_INDEX, GL_ALPHA_TEST_FUNC,
|
||||||
|
GL_SOURCE1_ALPHA, GL_NORMAL_MAP, GL_DITHER, GL_QUERY_RESULT, GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE,
|
||||||
|
GL_R16_SNORM, GL_FOG_COORD_ARRAY, GL_FLOAT, GL_PROXY_TEXTURE_2D_MULTISAMPLE, GL_TEXTURE_MAX_LOD,
|
||||||
|
GL_RGB16_SNORM, GL_SAMPLER_2D_RECT, GL_RGB9_E5, GL_MAX_VERTEX_UNIFORM_BLOCKS, GL_TEXTURE_COMPRESSED,
|
||||||
|
GL_T2F_C4UB_V3F, GL_EDGE_FLAG_ARRAY_POINTER, GL_PROXY_TEXTURE_3D, GL_MAX_LIST_NESTING, GL_COLOR_ATTACHMENT22,
|
||||||
|
GL_SOURCE0_ALPHA, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, GL_BYTE, GL_TIMEOUT_IGNORED,
|
||||||
|
GL_COLOR_ARRAY, GL_ZOOM_Y, GL_ZOOM_X, GL_RENDERBUFFER_SAMPLES, GL_HINT_BIT,
|
||||||
|
GL_COLOR_CLEAR_VALUE, GL_LINEAR_MIPMAP_LINEAR, GL_DEPTH_WRITEMASK, GL_TEXTURE_GEN_MODE, GL_3D_COLOR_TEXTURE,
|
||||||
|
GL_COLOR_ARRAY_POINTER, GL_TEXTURE_DEPTH_SIZE, GL_FLOAT_MAT3x2, GL_PIXEL_MAP_G_TO_G, GL_RENDER,
|
||||||
|
GL_MAX_TEXTURE_COORDS, GL_FLOAT_MAT3x4, GL_COLOR_ATTACHMENT28, GL_TEXTURE_BINDING_2D_MULTISAMPLE, GL_COLOR_ATTACHMENT24,
|
||||||
|
GL_COLOR_ATTACHMENT25, GL_COLOR_ATTACHMENT26, GL_COLOR_ATTACHMENT27, GL_COLOR_ATTACHMENT20, GL_COLOR_ATTACHMENT21,
|
||||||
|
GL_COMPRESSED_RGBA, GL_COLOR_ATTACHMENT23, GL_CLIENT_ATTRIB_STACK_DEPTH, GL_UNSIGNED_SHORT_5_5_5_1, GL_TEXTURE_COMPONENTS,
|
||||||
|
GL_QUERY_NO_WAIT, GL_PROVOKING_VERTEX, GL_SIGNED_NORMALIZED, GL_CURRENT_RASTER_TEXTURE_COORDS, GL_EXP,
|
||||||
|
GL_LINE_STRIP_ADJACENCY, GL_POINT_SIZE, GL_TEXTURE_COMPARE_FUNC, GL_TRANSFORM_FEEDBACK_BUFFER_MODE, GL_BITMAP_TOKEN,
|
||||||
|
GL_RGB10, GL_RGB16, GL_POLYGON_OFFSET_FILL, GL_LINE_TOKEN, GL_DOUBLEBUFFER,
|
||||||
|
GL_MAX_CLIP_PLANES, GL_FOG_COORDINATE_ARRAY_STRIDE, GL_RGB_INTEGER, GL_COMPILE_AND_EXECUTE, GL_MULT,
|
||||||
|
GL_STENCIL_CLEAR_VALUE, GL_GREEN_BITS, GL_SHADING_LANGUAGE_VERSION, GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_SRC2_RGB,
|
||||||
|
GL_FRAGMENT_SHADER, GL_UNSIGNED_INT_2_10_10_10_REV, GL_INDEX_ARRAY_TYPE, GL_FRAGMENT_SHADER_DERIVATIVE_HINT, GL_TEXTURE_DEPTH,
|
||||||
|
GL_VIEWPORT, GL_DRAW_BUFFER6, GL_DRAW_BUFFER7, GL_DRAW_BUFFER4, GL_DRAW_BUFFER5,
|
||||||
|
GL_DRAW_BUFFER2, GL_DRAW_BUFFER3, GL_DRAW_BUFFER0, GL_DRAW_BUFFER1, GL_LIGHT1,
|
||||||
|
GL_LIGHT0, GL_LIGHT3, GL_LIGHT2, GL_COPY, GL_LIGHT4,
|
||||||
|
GL_BLEND_SRC, GL_LIGHT6, GL_MAP_STENCIL, GL_QUADRATIC_ATTENUATION, GL_TEXTURE_CUBE_MAP_SEAMLESS,
|
||||||
|
GL_TEXTURE_RECTANGLE, GL_FILL, GL_SRC_COLOR, GL_SAMPLER_BINDING, GL_DEPTH24_STENCIL8,
|
||||||
|
GL_SAMPLE_BUFFERS, GL_RGBA_INTEGER, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, GL_COLOR_INDEX, GL_EXTENSIONS,
|
||||||
|
GL_MAP2_NORMAL, GL_BUFFER_SIZE, GL_PASS_THROUGH_TOKEN, GL_MAX_EVAL_ORDER, GL_UPPER_LEFT,
|
||||||
|
GL_TEXTURE_COMPARE_MODE, GL_ANY_SAMPLES_PASSED, GL_LAST_VERTEX_CONVENTION, GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE, GL_DEPTH_BUFFER_BIT,
|
||||||
|
GL_STENCIL_BACK_PASS_DEPTH_FAIL, GL_UNSIGNALED, GL_UNIFORM_BUFFER, GL_MAP_WRITE_BIT, GL_SHADE_MODEL,
|
||||||
|
GL_COMPRESSED_SLUMINANCE, GL_CCW, GL_RGB32I, GL_DEPTH_COMPONENT24, GL_INDEX_SHIFT,
|
||||||
|
GL_VERTEX_ATTRIB_ARRAY_INTEGER, GL_LIST_BIT, GL_ONE_MINUS_SRC1_COLOR, GL_STREAM_READ, GL_LINEAR,
|
||||||
|
GL_R32F, GL_VERTEX_ARRAY, GL_OR_REVERSE, GL_LUMINANCE12_ALPHA4, GL_LOGIC_OP,
|
||||||
|
GL_VERTEX_ARRAY_BUFFER_BINDING, GL_PIXEL_MAP_R_TO_R, GL_FOG_COORDINATE_SOURCE, GL_UNSIGNED_SHORT_5_6_5_REV, GL_TEXTURE_BORDER,
|
||||||
|
GL_GREATER, GL_MAX_GEOMETRY_UNIFORM_COMPONENTS, GL_VERTEX_ATTRIB_ARRAY_ENABLED, GL_MAX_TEXTURE_IMAGE_UNITS, GL_RGB32F,
|
||||||
|
GL_FLOAT_MAT2, GL_FLOAT_MAT3, GL_FRONT_FACE, GL_DEPTH, GL_REPLACE,
|
||||||
|
GL_VERTEX_ATTRIB_ARRAY_STRIDE, GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE, GL_OPERAND1_RGB, GL_RGBA32UI, GL_RG8I,
|
||||||
|
GL_RGBA8I, GL_TEXTURE_FILTER_CONTROL, GL_ACCUM_CLEAR_VALUE, GL_SRC1_ALPHA, GL_RG32F,
|
||||||
|
GL_R3_G3_B2, GL_ALPHA_BIAS, GL_RENDERBUFFER_BINDING, GL_TEXTURE_STACK_DEPTH, GL_TEXTURE_LUMINANCE_SIZE,
|
||||||
|
GL_TEXTURE_MIN_LOD, GL_FOG_COORDINATE_ARRAY, GL_BLEND, GL_FEEDBACK_BUFFER_TYPE, GL_MAP1_TEXTURE_COORD_3,
|
||||||
|
GL_R16UI, GL_MAP1_TEXTURE_COORD_1, GL_UNSIGNED_SHORT, GL_MIN, GL_MAP1_TEXTURE_COORD_4,
|
||||||
|
GL_COMPRESSED_SRGB_ALPHA, GL_ONE_MINUS_SRC_COLOR, GL_TEXTURE, GL_INTENSITY12, GL_MAX_PROJECTION_STACK_DEPTH,
|
||||||
|
GL_RGB_SCALE, GL_MAX_CLIP_DISTANCES, GL_PERSPECTIVE_CORRECTION_HINT, GL_LIST_MODE, GL_TIMESTAMP,
|
||||||
|
GL_ACTIVE_UNIFORMS, GL_VERTEX_PROGRAM_POINT_SIZE, GL_MAX_COLOR_ATTACHMENTS, GL_TEXTURE_BINDING_CUBE_MAP, GL_OPERAND2_RGB,
|
||||||
|
GL_R, GL_SRGB_ALPHA, GL_S, GL_NUM_COMPRESSED_TEXTURE_FORMATS, GL_PACK_SKIP_ROWS,
|
||||||
|
GL_T, GL_MAX_TEXTURE_UNITS, GL_SLUMINANCE8, GL_MAX_TEXTURE_BUFFER_SIZE, GL_MAP1_COLOR_4,
|
||||||
|
GL_GEOMETRY_SHADER, GL_R8I, GL_TEXTURE_MAX_LEVEL, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_BLEND_COLOR,
|
||||||
|
GL_ALPHA_BITS, GL_LINE_STIPPLE, GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, GL_ONE_MINUS_CONSTANT_ALPHA, GL_NEAREST_MIPMAP_LINEAR,
|
||||||
|
GL_ALPHA8, GL_BLEND_EQUATION, GL_SRC2_ALPHA, GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER, GL_ALPHA4,
|
||||||
|
GL_MAX_GEOMETRY_OUTPUT_COMPONENTS, GL_FOG_END, GL_SAMPLER_1D, GL_LINE, GL_STENCIL_BITS,
|
||||||
|
GL_FOG_COORDINATE_ARRAY_TYPE, GL_SAMPLES_PASSED, GL_RENDERBUFFER_RED_SIZE, GL_COMPRESSED_SLUMINANCE_ALPHA, GL_BLUE_INTEGER,
|
||||||
|
GL_DYNAMIC_COPY, GL_CURRENT_FOG_COORD, GL_SYNC_FLAGS, GL_RG32I, GL_UNSIGNED_BYTE_2_3_3_REV,
|
||||||
|
GL_RENDERBUFFER_INTERNAL_FORMAT, GL_CLIENT_ACTIVE_TEXTURE, GL_TEXTURE_HEIGHT, GL_RGBA16I, GL_RGBA16F,
|
||||||
|
GL_OPERAND2_ALPHA, GL_SAMPLE_ALPHA_TO_COVERAGE, GL_FOG_DENSITY, GL_TEXTURE_FIXED_SAMPLE_LOCATIONS, GL_CONSTANT_ATTENUATION,
|
||||||
|
GL_RED, GL_DEPTH_BIAS, GL_EQUIV, GL_POLYGON_OFFSET_LINE, GL_FUNC_REVERSE_SUBTRACT,
|
||||||
|
GL_GREEN, GL_INVALID_OPERATION, GL_CLAMP_READ_COLOR, GL_RED_INTEGER, GL_TEXTURE_BINDING_BUFFER,
|
||||||
|
GL_COLOR_ATTACHMENT5, GL_COLOR_ATTACHMENT4, GL_MAP2_TEXTURE_COORD_2, GL_COLOR_ATTACHMENT6, GL_MAP2_TEXTURE_COORD_4,
|
||||||
|
GL_COLOR_ATTACHMENT0, GL_4_BYTES, GL_COLOR_ATTACHMENT2, GL_MAX_MODELVIEW_STACK_DEPTH, GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS,
|
||||||
|
GL_COLOR_ATTACHMENT9, GL_COLOR_ATTACHMENT8, GL_PACK_IMAGE_HEIGHT, GL_PIXEL_MAP_B_TO_B_SIZE, GL_BUFFER_USAGE,
|
||||||
|
GL_CULL_FACE_MODE, GL_UNSIGNED_INT_8_8_8_8_REV, GL_BOOL, GL_MAX_COMBINED_UNIFORM_BLOCKS, GL_3D_COLOR,
|
||||||
|
GL_GREEN_INTEGER, GL_DST_COLOR, GL_T2F_V3F, GL_UNSIGNED_INT, GL_OPERAND0_ALPHA,
|
||||||
|
GL_ALWAYS, GL_NOOP, GL_V3F, GL_POINT_SPRITE_COORD_ORIGIN, GL_POINT_SIZE_RANGE,
|
||||||
|
GL_TRANSFORM_FEEDBACK_BUFFER_BINDING, GL_LUMINANCE16, GL_GREEN_BIAS, GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES, GL_LUMINANCE12,
|
||||||
|
GL_SAMPLER_2D_MULTISAMPLE_ARRAY, GL_SHADER_TYPE, GL_RG16_SNORM, GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE, GL_COLOR_ARRAY_TYPE,
|
||||||
|
GL_QUERY_COUNTER_BITS, GL_MODULATE, GL_RG_INTEGER, GL_DRAW_BUFFER10, GL_FOG_COORD_ARRAY_BUFFER_BINDING,
|
||||||
|
GL_TEXTURE_LUMINANCE_TYPE, GL_RENDERBUFFER_HEIGHT, GL_RG16UI, GL_INTERLEAVED_ATTRIBS, GL_TEXTURE_ALPHA_TYPE,
|
||||||
|
GL_COLOR_ATTACHMENT29, GL_MAP2_TEXTURE_COORD_1, GL_DRAW_BUFFER14, GL_FOG_COORD_ARRAY_STRIDE, GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS,
|
||||||
|
GL_MAP2_TEXTURE_COORD_3, GL_TEXTURE_BLUE_TYPE, GL_COLOR_ATTACHMENT1, GL_C4F_N3F_V3F, GL_COMBINE_RGB,
|
||||||
|
GL_STEREO, GL_ALREADY_SIGNALED, GL_T4F_V4F, GL_STREAM_COPY, GL_LIGHT_MODEL_LOCAL_VIEWER,
|
||||||
|
GL_SOURCE0_RGB, GL_EYE_PLANE, GL_TEXTURE_CUBE_MAP, GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY, GL_TEXTURE_2D_MULTISAMPLE_ARRAY,
|
||||||
|
GL_CLIP_PLANE1, GL_CLIP_PLANE0, GL_CLIP_PLANE3, GL_CLIP_PLANE2, GL_CLIP_PLANE5,
|
||||||
|
GL_CLIP_PLANE4, GL_ORDER, GL_NORMAL_ARRAY_TYPE, GL_TEXTURE_BUFFER, GL_TRANSFORM_FEEDBACK_BUFFER,
|
||||||
|
GL_LINE_STIPPLE_REPEAT, GL_POINTS, GL_LIGHTING_BIT, GL_SYNC_STATUS, GL_RENDERBUFFER_BLUE_SIZE,
|
||||||
|
GL_UNIFORM_NAME_LENGTH, GL_FASTEST, GL_LUMINANCE8, GL_LUMINANCE4, GL_POLYGON,
|
||||||
|
GL_NAND, GL_MAP1_INDEX, GL_LINE_WIDTH_GRANULARITY, GL_ADD_SIGNED, GL_MAX_3D_TEXTURE_SIZE,
|
||||||
|
GL_CLIENT_PIXEL_STORE_BIT, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, GL_DONT_CARE,
|
||||||
|
GL_POLYGON_BIT, GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING, GL_QUERY_WAIT, GL_MAP_FLUSH_EXPLICIT_BIT, GL_TEXTURE_COORD_ARRAY_SIZE,
|
||||||
|
GL_RED_SCALE, GL_SRGB8, GL_CURRENT_NORMAL, GL_COMPRESSED_SIGNED_RED_RGTC1, GL_FRAGMENT_DEPTH,
|
||||||
|
GL_UNIFORM_BLOCK_BINDING, GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, GL_SRC0_ALPHA, GL_LEQUAL, GL_PIXEL_MAP_A_TO_A_SIZE,
|
||||||
|
GL_TEXTURE_WIDTH, GL_ONE_MINUS_SRC1_ALPHA, GL_MAP_COLOR, GL_UNIFORM_SIZE, GL_POINT_SPRITE,
|
||||||
|
GL_FLOAT_MAT4x2, GL_SHADER_SOURCE_LENGTH, GL_DOT3_RGBA, GL_COMPRESSED_RG, GL_UNPACK_SWAP_BYTES,
|
||||||
|
GL_CURRENT_VERTEX_ATTRIB, GL_POLYGON_OFFSET_UNITS, GL_LUMINANCE6_ALPHA2, GL_MAX_COLOR_TEXTURE_SAMPLES, GL_COLOR_ATTACHMENT7,
|
||||||
|
GL_PRIMARY_COLOR, GL_C3F_V3F, GL_OUT_OF_MEMORY, GL_AUX_BUFFERS, GL_NORMAL_ARRAY_STRIDE,
|
||||||
|
GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_SMOOTH, GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS, GL_GEOMETRY_OUTPUT_TYPE, GL_RASTERIZER_DISCARD,
|
||||||
|
GL_MAX_TEXTURE_LOD_BIAS, GL_CURRENT_TEXTURE_COORDS, GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER, GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE, GL_FRONT_RIGHT,
|
||||||
|
GL_EDGE_FLAG_ARRAY, GL_INT_SAMPLER_2D_MULTISAMPLE, GL_RETURN, GL_STENCIL_TEST, GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION,
|
||||||
|
GL_R11F_G11F_B10F, GL_LUMINANCE_ALPHA, GL_PIXEL_UNPACK_BUFFER_BINDING, GL_INVERT, GL_PROXY_TEXTURE_1D,
|
||||||
|
GL_COMPRESSED_INTENSITY, GL_TRANSFORM_FEEDBACK_VARYINGS, GL_DEPTH_COMPONENT32F, GL_TRIANGLE_FAN, GL_LIST_BASE,
|
||||||
|
GL_MAX_ELEMENTS_VERTICES, GL_CURRENT_COLOR, GL_INVALID_FRAMEBUFFER_OPERATION, GL_RGB12, GL_UNIFORM_BUFFER_SIZE,
|
||||||
|
GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING, GL_DEPTH32F_STENCIL8, GL_MAX_ARRAY_TEXTURE_LAYERS, GL_RED_BITS, GL_MAX_SERVER_WAIT_TIMEOUT,
|
||||||
|
GL_NOR, GL_FLAT, GL_PACK_ALIGNMENT, GL_PIXEL_MAP_S_TO_S, GL_UNPACK_LSB_FIRST,
|
||||||
|
GL_BGRA, GL_ACTIVE_UNIFORM_BLOCKS, GL_SOURCE1_RGB, GL_UNPACK_SKIP_IMAGES, GL_RGB16I,
|
||||||
|
GL_ACTIVE_TEXTURE, GL_TEXTURE_BASE_LEVEL, GL_RGB16F, GL_SMOOTH_LINE_WIDTH_RANGE, GL_ALPHA_INTEGER,
|
||||||
|
GL_GREEN_SCALE, GL_CLIP_DISTANCE7, GL_FOG_BIT, GL_TRANSPOSE_TEXTURE_MATRIX, GL_UNSIGNED_INT_SAMPLER_3D,
|
||||||
|
GL_SAMPLE_MASK, GL_INT_VEC4, GL_INT_VEC3, GL_INT_VEC2, GL_STENCIL_FAIL,
|
||||||
|
GL_CURRENT_FOG_COORDINATE, GL_CONDITION_SATISFIED, GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT, GL_FRAMEBUFFER_UNSUPPORTED, GL_RED_BIAS,
|
||||||
|
GL_DST_ALPHA, GL_SECONDARY_COLOR_ARRAY_POINTER, GL_R8, GL_RENDER_MODE, GL_EDGE_FLAG_ARRAY_BUFFER_BINDING,
|
||||||
|
GL_MAX_CUBE_MAP_TEXTURE_SIZE, GL_TEXTURE_1D_ARRAY, GL_RENDERBUFFER_WIDTH, GL_READ_FRAMEBUFFER_BINDING, GL_FRAMEBUFFER_ATTACHMENT_LAYERED,
|
||||||
|
GL_TEXTURE_BLUE_SIZE, GL_COORD_REPLACE, GL_RGBA2, GL_RGBA4, GL_MULTISAMPLE_BIT,
|
||||||
|
GL_FOG_COLOR, GL_DRAW_BUFFER11, GL_DRAW_BUFFER12, GL_DRAW_BUFFER13, GL_UNSIGNED_INT_10_10_10_2,
|
||||||
|
GL_DRAW_BUFFER15, GL_INFO_LOG_LENGTH, GL_R16F, GL_RENDERBUFFER_STENCIL_SIZE, GL_CONSTANT_ALPHA,
|
||||||
|
GL_RESCALE_NORMAL, GL_R16I, GL_POINT_SIZE_GRANULARITY, GL_STATIC_READ, GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER,
|
||||||
|
GL_COMPARE_R_TO_TEXTURE, GL_PREVIOUS, GL_MAP_READ_BIT, GL_SPOT_DIRECTION, GL_DEPTH_SCALE,
|
||||||
|
GL_STENCIL, GL_SAMPLE_MASK_VALUE, GL_LINE_BIT, GL_DIFFUSE, GL_MAX_RENDERBUFFER_SIZE,
|
||||||
|
GL_T2F_N3F_V3F, GL_TRANSFORM_BIT, GL_COLOR_ATTACHMENT30, GL_STENCIL_PASS_DEPTH_PASS, GL_INCR_WRAP,
|
||||||
|
GL_SOURCE2_RGB, GL_TEXTURE_GEN_T, GL_TEXTURE_GEN_S, GL_TEXTURE_GEN_R, GL_TEXTURE_GEN_Q,
|
||||||
|
GL_RENDERBUFFER_ALPHA_SIZE, GL_ALPHA12, GL_LIGHT_MODEL_TWO_SIDE, GL_ALPHA16, GL_DECR_WRAP,
|
||||||
|
GL_POLYGON_SMOOTH, GL_COMPILE, GL_SAMPLE_POSITION, GL_TRANSPOSE_MODELVIEW_MATRIX, GL_INCR,
|
||||||
|
GL_POINT_SIZE_MIN, GL_MAX_RECTANGLE_TEXTURE_SIZE, GL_RGBA12, GL_GENERATE_MIPMAP_HINT, GL_ALPHA_TEST_REF,
|
||||||
|
GL_RGBA16, GL_UNPACK_SKIP_ROWS, GL_MAP1_NORMAL, GL_SOURCE2_ALPHA, GL_DEPTH_CLAMP,
|
||||||
|
GL_POLYGON_STIPPLE_BIT, GL_BLEND_DST_ALPHA, GL_INT_SAMPLER_CUBE, GL_CURRENT_QUERY, GL_RGB5_A1,
|
||||||
|
GL_EXP2, GL_UNPACK_SKIP_PIXELS, GL_RGB16UI, GL_COPY_INVERTED, GL_TEXTURE_PRIORITY,
|
||||||
|
GL_MAX_GEOMETRY_INPUT_COMPONENTS, GL_LOWER_LEFT, GL_FOG_HINT, GL_TEXTURE_BINDING_1D, GL_PROJECTION_MATRIX,
|
||||||
|
GL_AUX0, GL_PIXEL_UNPACK_BUFFER, GL_LINEAR_MIPMAP_NEAREST, GL_POINT_DISTANCE_ATTENUATION, GL_TEXTURE_BUFFER_DATA_STORE_BINDING,
|
||||||
|
GL_RGB10_A2, GL_AMBIENT_AND_DIFFUSE, GL_ZERO, GL_ELEMENT_ARRAY_BUFFER, GL_CONTEXT_CORE_PROFILE_BIT,
|
||||||
|
GL_SCISSOR_BIT, GL_READ_ONLY, GL_MAX_FRAGMENT_INPUT_COMPONENTS, GL_MAP1_GRID_DOMAIN, GL_PIXEL_MAP_I_TO_A_SIZE,
|
||||||
|
GL_UNSIGNED_NORMALIZED, GL_SMOOTH_POINT_SIZE_GRANULARITY, GL_CLAMP_VERTEX_COLOR, GL_MAP2_INDEX, GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS,
|
||||||
|
GL_PIXEL_MAP_I_TO_R_SIZE, GL_NOTEQUAL, GL_TEXTURE_COORD_ARRAY, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, GL_MAP2_GRID_DOMAIN,
|
||||||
|
GL_COMPRESSED_RED, GL_INT_SAMPLER_1D_ARRAY, GL_DRAW_PIXEL_TOKEN, GL_MAX_LIGHTS, GL_RGBA16_SNORM,
|
||||||
|
GL_OBJECT_LINEAR, GL_LIST_INDEX, GL_TEXTURE_BORDER_COLOR, GL_LUMINANCE16_ALPHA16, GL_TEXTURE_SHARED_SIZE,
|
||||||
|
GL_COMPILE_STATUS, GL_LOGIC_OP_MODE, GL_LUMINANCE8_ALPHA8, GL_RENDERBUFFER_DEPTH_SIZE, GL_MAX_FRAGMENT_UNIFORM_BLOCKS,
|
||||||
|
GL_SLUMINANCE_ALPHA, GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, GL_FEEDBACK_BUFFER_POINTER, GL_SPOT_EXPONENT, GL_SHORT,
|
||||||
|
GL_BLUE, GL_CW, GL_UNSIGNED_INT_24_8, GL_UNSIGNED_BYTE, GL_MAX_VERTEX_UNIFORM_COMPONENTS,
|
||||||
|
GL_QUADS, GL_DEPTH_TEXTURE_MODE, GL_UNSIGNED_INT_10F_11F_11F_REV, GL_R16, GL_PIXEL_PACK_BUFFER,
|
||||||
|
GL_PACK_LSB_FIRST, GL_RENDERBUFFER, GL_UNSIGNED_BYTE_3_3_2, GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE, GL_RGB8I,
|
||||||
|
GL_TRANSFORM_FEEDBACK_BUFFER_SIZE, GL_DRAW_BUFFER, GL_STENCIL_INDEX1, GL_STENCIL_INDEX4, GL_SAMPLER_3D,
|
||||||
|
GL_TEXTURE_GREEN_TYPE, GL_STENCIL_INDEX8, GL_DEPTH_BITS, GL_OR_INVERTED, GL_RGB8UI,
|
||||||
|
GL_STENCIL_INDEX16, GL_STENCIL_BACK_REF, GL_SELECT, GL_INTENSITY4, GL_BLEND_DST_RGB,
|
||||||
|
GL_INTENSITY8, GL_LIGHT5, GL_LINE_RESET_TOKEN, GL_MAP1_VERTEX_3, GL_TEXTURE_BINDING_2D_ARRAY,
|
||||||
|
GL_VERTEX_ATTRIB_ARRAY_DIVISOR, GL_CLEAR, GL_DRAW_BUFFER8, GL_CURRENT_RASTER_POSITION_VALID, GL_FOG_COORD_SRC,
|
||||||
|
GL_DRAW_BUFFER9, GL_SRC0_RGB, GL_PIXEL_PACK_BUFFER_BINDING, GL_DECAL, GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS,
|
||||||
|
GL_2D, GL_SELECTION_BUFFER_POINTER, GL_SELECTION_BUFFER_SIZE, GL_SAMPLES, GL_UNSIGNED_INT_VEC2,
|
||||||
|
GL_UNSIGNED_INT_VEC3, GL_UNSIGNED_INT_VEC4, GL_UNSIGNED_SHORT_5_6_5, GL_CURRENT_RASTER_POSITION, GL_VERTEX_ATTRIB_ARRAY_SIZE,
|
||||||
|
GL_VERTEX_SHADER, GL_RGBA_MODE, GL_FLOAT_VEC2, GL_FLOAT_VEC3, GL_FLOAT_VEC4,
|
||||||
|
GL_COEFF, GL_RGB32UI, GL_BUFFER_MAP_OFFSET, GL_MIN_PROGRAM_TEXEL_OFFSET, GL_PROXY_TEXTURE_RECTANGLE,
|
||||||
|
GL_UNSIGNED_INT_SAMPLER_BUFFER, GL_UNIFORM_BUFFER_START, GL_MAX_TEXTURE_STACK_DEPTH, GL_UNSIGNED_INT_SAMPLER_2D, GL_TEXTURE8,
|
||||||
|
GL_INT_SAMPLER_2D_RECT, GL_TEXTURE_COORD_ARRAY_STRIDE, GL_TEXTURE4, GL_TEXTURE5, GL_TEXTURE6,
|
||||||
|
GL_TEXTURE7, GL_TEXTURE0, GL_CONTEXT_PROFILE_MASK, GL_TEXTURE2, GL_TEXTURE3,
|
||||||
|
GL_BOOL_VEC4, GL_DOUBLE, GL_RG8_SNORM, GL_BOOL_VEC3, GL_BOOL_VEC2,
|
||||||
|
GL_COLOR_MATERIAL_PARAMETER, GL_DOT3_RGB, GL_ONE, GL_SRC_ALPHA_SATURATE, GL_MAX_SAMPLES,
|
||||||
|
GL_UNPACK_IMAGE_HEIGHT, GL_TRIANGLE_STRIP, GL_N3F_V3F, GL_CONTEXT_FLAGS, GL_FRONT_LEFT,
|
||||||
|
GL_CLAMP, GL_POINT_SMOOTH_HINT, GL_INDEX_OFFSET, GL_INTENSITY, GL_POINT_SIZE_MAX,
|
||||||
|
GL_MODELVIEW_MATRIX, GL_VERTEX_ARRAY_BINDING, GL_INDEX_BITS, GL_TIMEOUT_EXPIRED, GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY,
|
||||||
|
GL_STENCIL_FUNC, GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING, GL_TEXTURE_ENV, GL_ALIASED_LINE_WIDTH_RANGE, GL_DECR,
|
||||||
|
GL_BACK, GL_VIEWPORT_BIT, GL_INT, GL_CLIP_DISTANCE1, GL_CLIP_DISTANCE0,
|
||||||
|
GL_CLIP_DISTANCE3, GL_CLIP_DISTANCE2, GL_CLIP_DISTANCE5, GL_CLIP_DISTANCE4, GL_MINOR_VERSION,
|
||||||
|
GL_PIXEL_MAP_G_TO_G_SIZE, GL_FRONT_AND_BACK, GL_POINT, GL_COMPRESSED_RG_RGTC2, GL_POLYGON_TOKEN,
|
||||||
|
GL_SMOOTH_LINE_WIDTH_GRANULARITY, GL_SRGB, GL_NORMAL_ARRAY_POINTER, GL_SYNC_FENCE, GL_ONE_MINUS_CONSTANT_COLOR,
|
||||||
|
GL_UNSIGNED_INT_8_8_8_8, GL_RGB8_SNORM, GL_TEXTURE_ALPHA_SIZE, GL_UNSIGNED_INT_SAMPLER_2D_RECT, GL_CONSTANT_COLOR,
|
||||||
|
GL_UNSIGNED_SHORT_4_4_4_4, GL_NO_ERROR, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, GL_BLEND_SRC_ALPHA, GL_CURRENT_SECONDARY_COLOR,
|
||||||
|
GL_RGBA16UI, GL_AND_REVERSE, GL_MAX_INTEGER_SAMPLES, GL_CLAMP_FRAGMENT_COLOR, GL_QUERY_RESULT_AVAILABLE,
|
||||||
|
GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT, GL_MAX_DRAW_BUFFERS, GL_ONE_MINUS_DST_ALPHA, GL_FOG_MODE, GL_R32UI,
|
||||||
|
GL_RGBA8_SNORM, GL_C4UB_V2F, GL_INT_SAMPLER_3D, GL_CURRENT_INDEX, GL_AND,
|
||||||
|
GL_INDEX_MODE, GL_ACCUM_GREEN_BITS, GL_MAJOR_VERSION, GL_STATIC_COPY, GL_REFLECTION_MAP,
|
||||||
|
GL_BGR_INTEGER, GL_3_BYTES, GL_UNIFORM_BUFFER_BINDING, GL_UNIFORM_TYPE, GL_DELETE_STATUS,
|
||||||
|
GL_POINT_BIT, GL_SYNC_GPU_COMMANDS_COMPLETE, GL_SMOOTH_POINT_SIZE_RANGE, GL_ALIASED_POINT_SIZE_RANGE, GL_3D,
|
||||||
|
GL_MAP_INVALIDATE_BUFFER_BIT, GL_UNSIGNED_INT_5_9_9_9_REV, GL_DEPTH_TEST, GL_BUFFER_MAP_LENGTH, GL_VERTEX_ATTRIB_ARRAY_POINTER,
|
||||||
|
GL_MULTISAMPLE, GL_MAX_GEOMETRY_OUTPUT_VERTICES, GL_TEXTURE_RED_TYPE, GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, GL_FUNC_SUBTRACT,
|
||||||
|
GL_VERTEX_PROGRAM_TWO_SIDE, GL_SAMPLER_BUFFER, GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, GL_TEXTURE_COORD_ARRAY_TYPE, GL_CLAMP_TO_BORDER,
|
||||||
|
GL_COLOR_ATTACHMENT15, GL_COLOR_ATTACHMENT14, GL_COLOR_ATTACHMENT17, GL_DEPTH_RANGE, GL_COLOR_ATTACHMENT11,
|
||||||
|
GL_COLOR_ATTACHMENT10, GL_COLOR_ATTACHMENT13, GL_COLOR_ATTACHMENT12, GL_NEAREST, GL_COMPRESSED_TEXTURE_FORMATS,
|
||||||
|
GL_COLOR_ATTACHMENT19, GL_COLOR_ATTACHMENT18, GL_RENDERBUFFER_GREEN_SIZE, GL_MAX_DUAL_SOURCE_DRAW_BUFFERS, GL_PIXEL_MAP_S_TO_S_SIZE,
|
||||||
|
GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT, GL_RGBA8, GL_T2F_C3F_V3F, GL_SAMPLER_2D_RECT_SHADOW, GL_ALL_ATTRIB_BITS,
|
||||||
|
GL_POINT_TOKEN, GL_T4F_C4F_N3F_V4F, GL_TEXTURE30, GL_TEXTURE31, GL_UNSIGNED_INT_SAMPLER_1D,
|
||||||
|
GL_POINT_SMOOTH, GL_DEPTH_CLEAR_VALUE, GL_GEOMETRY_INPUT_TYPE, GL_BACK_LEFT, GL_TEXTURE_ENV_COLOR,
|
||||||
|
GL_BUFFER_MAP_POINTER, GL_LINE_SMOOTH, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_STENCIL_REF, GL_CURRENT_BIT,
|
||||||
|
GL_FOG_COORDINATE, GL_COPY_WRITE_BUFFER, GL_MAX_VARYING_FLOATS, GL_PRIMITIVE_RESTART_INDEX, GL_OPERAND0_RGB,
|
||||||
|
GL_LIGHT_MODEL_COLOR_CONTROL, GL_FEEDBACK, GL_ONE_MINUS_DST_COLOR, GL_MAX_ATTRIB_STACK_DEPTH, GL_FOG_COORD_ARRAY_TYPE,
|
||||||
|
GL_PROXY_TEXTURE_1D_ARRAY, GL_ACCUM_ALPHA_BITS, GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B, GL_PIXEL_MAP_I_TO_A,
|
||||||
|
GL_COLOR_BUFFER_BIT, GL_PIXEL_MAP_I_TO_I, GL_SPOT_CUTOFF, GL_PIXEL_MAP_I_TO_R, GL_LINEAR_ATTENUATION,
|
||||||
|
GL_SAMPLER_2D, GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, GL_NEAREST_MIPMAP_NEAREST, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER, GL_EDGE_FLAG_ARRAY_STRIDE,
|
||||||
|
GL_TEXTURE_MAG_FILTER, GL_COLOR_MATERIAL_FACE, GL_CONTEXT_COMPATIBILITY_PROFILE_BIT, GL_SINGLE_COLOR, GL_R32I,
|
||||||
|
GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY, GL_SAMPLER_CUBE, GL_INT_2_10_10_10_REV, GL_SAMPLER_CUBE_SHADOW, GL_LEFT,
|
||||||
|
GL_AND_INVERTED, GL_ACCUM_BLUE_BITS, GL_FRAMEBUFFER_SRGB, GL_SECONDARY_COLOR_ARRAY_TYPE, GL_POLYGON_OFFSET_POINT,
|
||||||
|
GL_BGR, GL_MAX_TEXTURE_SIZE, GL_COMBINE_ALPHA, GL_RIGHT, GL_UNSIGNED_INT_SAMPLER_2D_ARRAY,
|
||||||
|
GL_ARRAY_BUFFER, GL_COMPRESSED_ALPHA, GL_STENCIL_INDEX, GL_DEPTH_COMPONENT16, GL_MAX_SAMPLE_MASK_WORDS,
|
||||||
|
GL_TEXTURE_COMPRESSED_IMAGE_SIZE, GL_TEXTURE_RED_SIZE, GL_TEXTURE_1D, GL_MAX_VARYING_COMPONENTS, GL_NAME_STACK_DEPTH,
|
||||||
|
GL_BLEND_SRC_RGB, GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH, GL_BGRA_INTEGER, GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, GL_FALSE,
|
||||||
|
GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS, GL_ONE_MINUS_SRC_ALPHA, GL_SAMPLE_ALPHA_TO_ONE, GL_WEIGHT_ARRAY_BUFFER_BINDING, GL_COLOR_ATTACHMENT3,
|
||||||
|
GL_PIXEL_MAP_I_TO_G_SIZE, GL_MAP2_GRID_SEGMENTS, GL_PROGRAM_POINT_SIZE, GL_COLOR_ATTACHMENT16, GL_MAX_VIEWPORT_DIMS,
|
||||||
|
GL_DEPTH_ATTACHMENT, GL_INT_SAMPLER_2D, GL_UNSIGNED_INT_SAMPLER_1D_ARRAY, GL_STENCIL_PASS_DEPTH_FAIL, GL_PIXEL_MAP_A_TO_A,
|
||||||
|
GL_TEXTURE_COORD_ARRAY_POINTER, GL_MAP1_GRID_SEGMENTS, GL_MAX_GEOMETRY_UNIFORM_BLOCKS, GL_ATTRIB_STACK_DEPTH, GL_LINE_WIDTH,
|
||||||
|
GL_FEEDBACK_BUFFER_SIZE, GL_BLUE_BIAS, GL_FIXED_ONLY, GL_NONE, GL_FRAMEBUFFER_DEFAULT,
|
||||||
|
GL_POLYGON_MODE, GL_HALF_FLOAT, GL_UNIFORM_BLOCK_NAME_LENGTH, GL_V2F, GL_TEXTURE_BINDING_RECTANGLE,
|
||||||
|
GL_LINE_SMOOTH_HINT, GL_CLAMP_TO_EDGE, GL_FRONT, GL_SCISSOR_BOX, GL_UNIFORM_BLOCK_DATA_SIZE,
|
||||||
|
GL_AMBIENT, GL_NUM_EXTENSIONS, GL_UNIFORM_IS_ROW_MAJOR, GL_MAX_UNIFORM_BLOCK_SIZE, GL_INDEX_ARRAY,
|
||||||
|
GL_FRAMEBUFFER_BINDING, GL_NORMAL_ARRAY_BUFFER_BINDING, GL_ALPHA, GL_SET, GL_COLOR_WRITEMASK,
|
||||||
|
GL_DEPTH_FUNC, GL_TEXTURE_WRAP_R, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, GL_TEXTURE9,
|
||||||
|
GL_INVALID_ENUM, GL_EVAL_BIT, GL_INT_SAMPLER_2D_ARRAY, GL_COMPRESSED_RGB, GL_LIGHT_MODEL_AMBIENT,
|
||||||
|
GL_DEPTH_COMPONENT, GL_SRC1_COLOR, GL_FOG_START, GL_WAIT_FAILED, GL_COMPARE_REF_TO_TEXTURE,
|
||||||
|
GL_PROJECTION_STACK_DEPTH, GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, GL_TRUE, GL_TEXTURE_MIN_FILTER, GL_FLOAT_MAT4,
|
||||||
|
GL_BLUE_BITS, GL_STACK_UNDERFLOW, GL_AUX1, GL_TEXTURE_SWIZZLE_R, GL_AUX3,
|
||||||
|
GL_AUX2, GL_PACK_SWAP_BYTES, GL_FIRST_VERTEX_CONVENTION, GL_EQUAL, GL_TEXTURE_SWIZZLE_G,
|
||||||
|
GL_DEPTH_STENCIL_ATTACHMENT, GL_TRIANGLE_STRIP_ADJACENCY, GL_ADD, GL_TEXTURE_BINDING_1D_ARRAY, GL_TEXTURE_SWIZZLE_B,
|
||||||
|
GL_TEXTURE_SWIZZLE_A, GL_FUNC_ADD, GL_MODELVIEW_STACK_DEPTH, GL_FLOAT_MAT4x3, GL_POINT_FADE_THRESHOLD_SIZE,
|
||||||
|
GL_INT_SAMPLER_BUFFER, GL_UNPACK_ALIGNMENT, GL_LINE_STRIP, GL_PACK_ROW_LENGTH, GL_COLOR_MATERIAL,
|
||||||
|
GL_MAX_PIXEL_MAP_TABLE, GL_COLOR, GL_POLYGON_STIPPLE, GL_BITMAP, GL_DYNAMIC_READ,
|
||||||
|
GL_COMPRESSED_LUMINANCE, GL_LUMINANCE12_ALPHA12, GL_DEPTH_STENCIL, GL_RG8UI, GL_MAX_VERTEX_OUTPUT_COMPONENTS,
|
||||||
|
GL_KEEP, GL_TEXTURE_INTENSITY_SIZE, GL_PROXY_TEXTURE_2D, GL_SYNC_CONDITION, GL_ACTIVE_UNIFORM_MAX_LENGTH,
|
||||||
|
GL_OR, GL_MAP_INVALIDATE_RANGE_BIT, GL_TEXTURE23, GL_TEXTURE22, GL_TEXTURE21,
|
||||||
|
GL_TEXTURE20, GL_TEXTURE27, GL_TEXTURE26, GL_TEXTURE25, GL_TEXTURE24,
|
||||||
|
GL_R8_SNORM, GL_TEXTURE29, GL_TEXTURE28, GL_SAMPLER_1D_ARRAY, GL_ELEMENT_ARRAY_BUFFER_BINDING,
|
||||||
|
GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER, GL_TRIANGLES_ADJACENCY, GL_PIXEL_MODE_BIT, GL_LINE_LOOP, GL_ALPHA_SCALE,
|
||||||
|
GL_READ_BUFFER, GL_PACK_SKIP_PIXELS, GL_BACK_RIGHT, GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS, GL_SUBPIXEL_BITS,
|
||||||
|
GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS, GL_GEQUAL, GL_ALPHA_TEST, GL_SLUMINANCE8_ALPHA8, GL_SAMPLER_2D_MULTISAMPLE,
|
||||||
|
GL_LUMINANCE4_ALPHA4, GL_RGBA8UI, GL_UNIFORM_OFFSET, GL_TEXTURE1, GL_OBJECT_PLANE,
|
||||||
|
GL_UNSIGNED_INT_SAMPLER_CUBE, GL_SUBTRACT, GL_TIME_ELAPSED, GL_SECONDARY_COLOR_ARRAY_SIZE, GL_COMPRESSED_RED_RGTC1,
|
||||||
|
GL_READ_WRITE, GL_BUFFER_ACCESS, GL_LINES_ADJACENCY, GL_ARRAY_BUFFER_BINDING, GL_INDEX_WRITEMASK,
|
||||||
|
GL_TEXTURE_2D, GL_VERTEX_ARRAY_STRIDE, GL_DYNAMIC_DRAW, GL_4D_COLOR_TEXTURE, GL_NICEST,
|
||||||
|
GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS, GL_UNPACK_ROW_LENGTH, GL_CURRENT_PROGRAM, GL_BUFFER_MAPPED, GL_EYE_LINEAR,
|
||||||
|
GL_STREAM_DRAW, GL_POLYGON_SMOOTH_HINT, GL_INDEX, GL_MAX_UNIFORM_BUFFER_BINDINGS, GL_SIGNALED,
|
||||||
|
GL_FRAMEBUFFER, GL_SPECULAR, GL_TEXTURE_BINDING_2D, GL_GENERATE_MIPMAP, GL_DOMAIN,
|
||||||
|
GL_COLOR_ARRAY_SIZE, GL_STENCIL_BACK_FAIL, GL_POLYGON_OFFSET_FACTOR, GL_R8UI, GL_SYNC_FLUSH_COMMANDS_BIT,
|
||||||
|
GL_DRAW_FRAMEBUFFER_BINDING, GL_STATIC_DRAW, GL_MODELVIEW, GL_PIXEL_MAP_I_TO_B_SIZE, GL_TRIANGLES,
|
||||||
|
GL_SAMPLER_2D_ARRAY_SHADOW, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, GL_UNIFORM_MATRIX_STRIDE, GL_MAX_DEPTH_TEXTURE_SAMPLES, GL_QUERY_BY_REGION_WAIT,
|
||||||
|
GL_TEXTURE_RESIDENT, GL_SLUMINANCE, GL_SRGB8_ALPHA8, GL_FOG, GL_FOG_COORD,
|
||||||
|
GL_SAMPLER_2D_ARRAY, GL_POSITION, GL_RENDERER, GL_MIRRORED_REPEAT, GL_RG,
|
||||||
|
GL_PIXEL_MAP_B_TO_B, GL_LINE_STIPPLE_PATTERN, GL_STENCIL_BACK_FUNC, GL_PIXEL_MAP_R_TO_R_SIZE, GL_MAP1_TEXTURE_COORD_2,
|
||||||
|
GL_TEXTURE_BINDING_3D, GL_COLOR_LOGIC_OP, GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH, GL_UNIFORM_BLOCK_INDEX, GL_ENABLE_BIT,
|
||||||
|
GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS, GL_MAX_VERTEX_ATTRIBS, GL_SPHERE_MAP, GL_CONSTANT, GL_LINE_WIDTH_RANGE,
|
||||||
|
GL_XOR, GL_PROJECTION, GL_LESS, GL_COPY_PIXEL_TOKEN, GL_FRAMEBUFFER_UNDEFINED,
|
||||||
|
GL_2_BYTES, GL_TEXTURE_STENCIL_SIZE, GL_CURRENT_RASTER_INDEX, GL_EMISSION, GL_COMPRESSED_SRGB,
|
||||||
|
GL_TEXTURE_DEPTH_TYPE, GL_TEXTURE_ENV_MODE, GL_COMPRESSED_LUMINANCE_ALPHA, GL_INT_SAMPLER_1D, GL_CURRENT_RASTER_COLOR,
|
||||||
|
GL_PROXY_TEXTURE_2D_ARRAY, GL_QUAD_STRIP, GL_REPEAT, GL_ACCUM, GL_T2F_C4F_N3F_V3F,
|
||||||
|
GL_TEXTURE_INTENSITY_TYPE, GL_INTENSITY16, GL_VERTEX_ARRAY_TYPE, GL_VERTEX_ARRAY_SIZE, GL_TEXTURE_GREEN_SIZE,
|
||||||
|
GL_CLIENT_ALL_ATTRIB_BITS, GL_VALIDATE_STATUS, GL_RG16, GL_LIGHT7, GL_STENCIL_BACK_VALUE_MASK,
|
||||||
|
GL_SCISSOR_TEST, GL_STENCIL_BUFFER_BIT, GL_TEXTURE_2D_MULTISAMPLE, GL_SAMPLER_1D_ARRAY_SHADOW, GL_SRC1_RGB,
|
||||||
|
GL_BLEND_EQUATION_ALPHA, GL_ACTIVE_ATTRIBUTES, GL_COLOR_ATTACHMENT31, GL_LIGHTING, GL_CURRENT_RASTER_DISTANCE,
|
||||||
|
GL_VERTEX_ARRAY_POINTER, GL_ATTACHED_SHADERS, GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY, GL_QUERY_BY_REGION_NO_WAIT, GL_SAMPLE_COVERAGE_INVERT,
|
||||||
|
GL_LINES, GL_TEXTURE18, GL_TEXTURE19, GL_TEXTURE16, GL_TEXTURE17,
|
||||||
|
GL_TEXTURE14, GL_TEXTURE15, GL_TEXTURE12, GL_TEXTURE13, GL_TEXTURE10,
|
||||||
|
GL_TEXTURE11, GL_RGB, GL_SEPARATE_SPECULAR_COLOR, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, GL_TRANSFORM_FEEDBACK_BUFFER_START,
|
||||||
|
GL_MAX_PROGRAM_TEXEL_OFFSET, GL_STACK_OVERFLOW, GL_MAP1_VERTEX_4, GL_TEXTURE_COMPRESSION_HINT, GL_RGBA32F,
|
||||||
|
GL_RGBA32I, GL_COLOR_ARRAY_BUFFER_BINDING, GL_VERTEX_ATTRIB_ARRAY_TYPE, GL_TRANSPOSE_COLOR_MATRIX, GL_STENCIL_WRITEMASK,
|
||||||
|
GL_RG8, GL_FOG_COORDINATE_ARRAY_POINTER, GL_STENCIL_BACK_PASS_DEPTH_PASS, GL_INVALID_VALUE, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE,
|
||||||
|
GL_VERSION, GL_MAP_UNSYNCHRONIZED_BIT, GL_PRIMITIVE_RESTART, GL_COLOR_ARRAY_STRIDE, GL_MAX_ELEMENTS_INDICES,
|
||||||
|
GL_SRC_ALPHA, GL_TEXTURE_3D, GL_GEOMETRY_VERTICES_OUT, GL_RGB8, GL_INDEX_ARRAY_POINTER,
|
||||||
|
GL_MATRIX_MODE, GL_UNIFORM_ARRAY_STRIDE, GL_TEXTURE_SAMPLES, GL_RGB4, GL_RGB5,
|
||||||
|
GL_CULL_FACE, GL_PIXEL_MAP_I_TO_I_SIZE, GL_SAMPLE_COVERAGE_VALUE, GL_PROXY_TEXTURE_CUBE_MAP, GL_SECONDARY_COLOR_ARRAY_STRIDE,
|
||||||
|
GL_COMPRESSED_SIGNED_RG_RGTC2, GL_COLOR_INDEXES, GL_RG32UI, GL_OPERAND1_ALPHA, GL_NORMALIZE,
|
||||||
|
GL_NEVER, GL_STENCIL_VALUE_MASK, GL_BLEND_DST, GL_STENCIL_BACK_WRITEMASK, GL_BLUE_SCALE,
|
||||||
|
GL_TEXTURE_INTERNAL_FORMAT, GL_LOAD, GL_FRAMEBUFFER_COMPLETE, GL_COPY_READ_BUFFER, GL_INDEX_ARRAY_STRIDE,
|
||||||
|
GL_FOG_COORD_ARRAY_POINTER, GL_MAP2_VERTEX_3, GL_TEXTURE_SWIZZLE_RGBA, GL_DEPTH_COMPONENT32, GL_RGBA,
|
||||||
|
GL_READ_FRAMEBUFFER, GL_NORMAL_ARRAY, GL_COLOR_SUM, GL_BLEND_EQUATION_RGB, GL_MAP2_COLOR_4,
|
||||||
|
GL_VENDOR, GL_TEXTURE_2D_ARRAY, GL_ACCUM_BUFFER_BIT, GL_EDGE_FLAG, GL_OBJECT_TYPE,
|
||||||
|
GL_C4UB_V3F, GL_INTERPOLATE, GL_BUFFER_ACCESS_FLAGS, GL_LINK_STATUS, GL_PACK_SKIP_IMAGES,
|
||||||
|
GL_FLOAT_MAT2x3, GL_COMBINE, GL_FLOAT_MAT2x4, GL_Q, GL_SECONDARY_COLOR_ARRAY,
|
||||||
|
GL_INDEX_LOGIC_OP, GL_SEPARATE_ATTRIBS, GL_PRIMITIVES_GENERATED, GL_MAX, GL_LUMINANCE,
|
||||||
|
GL_INVALID_INDEX, GL_MAP2_VERTEX_4, GL_AUTO_NORMAL, GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS, GL_CURRENT_RASTER_SECONDARY_COLOR,
|
||||||
|
GL_SAMPLER_1D_SHADOW, GL_ACCUM_RED_BITS, GL_SAMPLER_2D_SHADOW, GL_TEXTURE_MATRIX, GL_TRANSPOSE_PROJECTION_MATRIX,
|
||||||
|
GL_CLIP_DISTANCE6, GL_RG16F, GL_MAX_NAME_STACK_DEPTH, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, GL_TEXTURE_BIT,
|
||||||
|
GL_RG16I, GL_WRITE_ONLY, GL_STENCIL_ATTACHMENT, GL_CLIENT_VERTEX_ARRAY_BIT, GL_SAMPLE_COVERAGE,
|
||||||
|
GL_INDEX_ARRAY_BUFFER_BINDING, GL_SHININESS, GL_DRAW_FRAMEBUFFER, GL_TEXTURE_LOD_BIAS, GL_RGB10_A2UI
|
||||||
|
;
|
||||||
|
|
||||||
183
demos/external/sources/glad/gl/gles2.d
vendored
Normal file
183
demos/external/sources/glad/gl/gles2.d
vendored
Normal file
|
|
@ -0,0 +1,183 @@
|
||||||
|
module glad.gl.gles2;
|
||||||
|
|
||||||
|
|
||||||
|
public import glad.gl.types;
|
||||||
|
public import glad.gl.funcs :
|
||||||
|
glUniformMatrix2fv, glBeginTransformFeedback, glFlush, glGetRenderbufferParameteriv, glClearColor,
|
||||||
|
glClearBufferiv, glStencilMaskSeparate, glGetVertexAttribPointerv, glLinkProgram, glBindTexture,
|
||||||
|
glGetStringi, glFenceSync, glUniform3ui, glFramebufferRenderbuffer, glGetString,
|
||||||
|
glCompressedTexSubImage3D, glDetachShader, glVertexAttribI4uiv, glEndQuery, glBindSampler,
|
||||||
|
glLineWidth, glUniform2fv, glGetIntegeri_v, glCompileShader, glGetTransformFeedbackVarying,
|
||||||
|
glDeleteTextures, glStencilOpSeparate, glStencilFuncSeparate, glBindBufferRange, glVertexAttrib4f,
|
||||||
|
glUniform2f, glRenderbufferStorage, glDeleteShader, glGetBufferParameteri64v, glDepthRangef,
|
||||||
|
glUniform4iv, glGetTexParameteriv, glClearStencil, glUniformMatrix2x3fv, glGetUniformiv,
|
||||||
|
glGenTransformFeedbacks, glGetVertexAttribIuiv, glSampleCoverage, glSamplerParameteri, glGenTextures,
|
||||||
|
glSamplerParameterf, glDepthFunc, glCompressedTexSubImage2D, glUniform1f, glGetVertexAttribfv,
|
||||||
|
glProgramBinary, glGetTexParameterfv, glCreateShader, glIsBuffer, glUniform1i,
|
||||||
|
glGenRenderbuffers, glCopyTexSubImage2D, glCompressedTexImage2D, glDisable, glUniform2i,
|
||||||
|
glBlendFuncSeparate, glGetProgramiv, glColorMask, glHint, glFramebufferTextureLayer,
|
||||||
|
glBlendEquation, glGetUniformLocation, glBindFramebuffer, glEndTransformFeedback, glCullFace,
|
||||||
|
glUniformMatrix3x2fv, glTexStorage2D, glUniform4fv, glGetInternalformativ, glDeleteProgram,
|
||||||
|
glIsSampler, glVertexAttribDivisor, glGenQueries, glWaitSync, glAttachShader,
|
||||||
|
glUniformMatrix4x3fv, glUniform3i, glClearBufferfv, glDeleteTransformFeedbacks, glShaderBinary,
|
||||||
|
glCheckFramebufferStatus, glTexSubImage3D, glGetInteger64i_v, glDeleteSamplers, glCopyTexImage2D,
|
||||||
|
glUniform3f, glBlitFramebuffer, glBindAttribLocation, glUniformMatrix4x2fv, glBlendEquationSeparate,
|
||||||
|
glDrawElements, glGetShaderSource, glUniform2iv, glGetQueryObjectuiv, glGenVertexArrays,
|
||||||
|
glBindBufferBase, glBufferSubData, glUniform1iv, glGetBufferParameteriv, glMapBufferRange,
|
||||||
|
glReadBuffer, glTexStorage3D, glClientWaitSync, glDrawArraysInstanced, glViewport,
|
||||||
|
glGenerateMipmap, glGetShaderiv, glUniformMatrix3x4fv, glUniform2ui, glVertexAttrib3f,
|
||||||
|
glGetActiveAttrib, glBlendColor, glGetShaderPrecisionFormat, glResumeTransformFeedback, glUnmapBuffer,
|
||||||
|
glGetUniformfv, glDisableVertexAttribArray, glShaderSource, glBindRenderbuffer, glDeleteRenderbuffers,
|
||||||
|
glIsSync, glReleaseShaderCompiler, glDeleteFramebuffers, glDrawArrays, glUniform1ui,
|
||||||
|
glIsProgram, glTexSubImage2D, glGetSynciv, glVertexAttrib1fv, glClear,
|
||||||
|
glVertexAttrib4fv, glProgramParameteri, glIsTransformFeedback, glUniform4i, glActiveTexture,
|
||||||
|
glEnableVertexAttribArray, glDrawRangeElements, glBindBuffer, glIsEnabled, glStencilOp,
|
||||||
|
glReadPixels, glStencilMask, glUniform4f, glFramebufferTexture2D, glGetFramebufferAttachmentParameteriv,
|
||||||
|
glUniformMatrix2x4fv, glUniform3fv, glBufferData, glCompressedTexImage3D, glDeleteSync,
|
||||||
|
glPauseTransformFeedback, glGetError, glGetActiveUniformBlockName, glGetVertexAttribiv, glTexParameteriv,
|
||||||
|
glGetProgramBinary, glVertexAttrib3fv, glGetFloatv, glUniform3iv, glVertexAttrib2fv,
|
||||||
|
glGetShaderInfoLog, glGenFramebuffers, glDrawBuffers, glGetActiveUniformBlockiv, glStencilFunc,
|
||||||
|
glGetIntegerv, glGetAttachedShaders, glUniformBlockBinding, glIsRenderbuffer, glGetBufferPointerv,
|
||||||
|
glDeleteVertexArrays, glIsShader, glRenderbufferStorageMultisample, glUniform4uiv, glIsQuery,
|
||||||
|
glIsVertexArray, glUseProgram, glVertexAttribI4iv, glGetQueryiv, glTexImage2D,
|
||||||
|
glGetProgramInfoLog, glGetSamplerParameterfv, glBindTransformFeedback, glUniform4ui, glSamplerParameterfv,
|
||||||
|
glClearBufferuiv, glBindVertexArray, glIsTexture, glGetUniformIndices, glUniform1fv,
|
||||||
|
glGetInteger64v, glVertexAttribPointer, glTexParameterfv, glInvalidateSubFramebuffer, glUniformMatrix3fv,
|
||||||
|
glScissor, glEnable, glGetActiveUniformsiv, glVertexAttribI4i, glVertexAttribI4ui,
|
||||||
|
glGetFragDataLocation, glUniform2uiv, glGenBuffers, glFinish, glGetAttribLocation,
|
||||||
|
glBeginQuery, glVertexAttribIPointer, glBlendFunc, glCreateProgram, glTexImage3D,
|
||||||
|
glGenSamplers, glGetSamplerParameteriv, glIsFramebuffer, glFlushMappedBufferRange, glUniformMatrix4fv,
|
||||||
|
glCopyBufferSubData, glInvalidateFramebuffer, glUniform1uiv, glTransformFeedbackVaryings, glVertexAttrib2f,
|
||||||
|
glVertexAttrib1f, glCopyTexSubImage3D, glDepthMask, glGetUniformuiv, glGetUniformBlockIndex,
|
||||||
|
glGetVertexAttribIiv, glGetActiveUniform, glTexParameterf, glClearBufferfi, glTexParameteri,
|
||||||
|
glFrontFace, glClearDepthf, glDeleteBuffers, glSamplerParameteriv, glDrawElementsInstanced,
|
||||||
|
glGetBooleanv, glPixelStorei, glValidateProgram, glPolygonOffset, glDeleteQueries,
|
||||||
|
glUniform3uiv;
|
||||||
|
|
||||||
|
public import glad.gl.enums :
|
||||||
|
GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE, GL_UNSIGNED_INT_VEC2, GL_UNSIGNED_INT_VEC3, GL_UNSIGNED_INT_VEC4, GL_UNSIGNED_SHORT_5_6_5,
|
||||||
|
GL_VERTEX_ATTRIB_ARRAY_SIZE, GL_DEPTH_ATTACHMENT, GL_DITHER, GL_TRANSFORM_FEEDBACK_PAUSED, GL_RGB16UI,
|
||||||
|
GL_QUERY_RESULT, GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE, GL_FLOAT_VEC2, GL_FLOAT_VEC3, GL_FLOAT_VEC4,
|
||||||
|
GL_FLOAT, GL_RGB32UI, GL_TEXTURE_MAX_LOD, GL_BUFFER_MAP_OFFSET, GL_BUFFER_SIZE,
|
||||||
|
GL_RGB9_E5, GL_UNIFORM_BUFFER_START, GL_COMPRESSED_R11_EAC, GL_RGBA32UI, GL_UNSIGNED_INT_SAMPLER_2D,
|
||||||
|
GL_TEXTURE_MIN_LOD, GL_TEXTURE8, GL_TEXTURE9, GL_TEXTURE4, GL_TEXTURE5,
|
||||||
|
GL_TEXTURE6, GL_TEXTURE7, GL_TEXTURE0, GL_LINEAR_MIPMAP_LINEAR, GL_TEXTURE2,
|
||||||
|
GL_TEXTURE3, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_BLEND_EQUATION, GL_BYTE,
|
||||||
|
GL_BOOL_VEC3, GL_BOOL_VEC2, GL_TIMEOUT_IGNORED, GL_MAX_VARYING_VECTORS, GL_RENDERBUFFER_SAMPLES,
|
||||||
|
GL_ONE, GL_RG, GL_COLOR_CLEAR_VALUE, GL_MAX_SAMPLES, GL_BUFFER_USAGE,
|
||||||
|
GL_UNPACK_IMAGE_HEIGHT, GL_FLOAT_MAT3x2, GL_TRIANGLE_STRIP, GL_PROGRAM_BINARY_RETRIEVABLE_HINT, GL_TRANSFORM_FEEDBACK_BUFFER_BINDING,
|
||||||
|
GL_FLOAT_MAT3x4, GL_COLOR_ATTACHMENT28, GL_COLOR_ATTACHMENT29, GL_COLOR_ATTACHMENT24, GL_COLOR_ATTACHMENT25,
|
||||||
|
GL_COLOR_ATTACHMENT26, GL_COLOR_ATTACHMENT27, GL_COLOR_ATTACHMENT20, GL_COLOR_ATTACHMENT21, GL_COLOR_ATTACHMENT22,
|
||||||
|
GL_COLOR_ATTACHMENT23, GL_TRANSFORM_FEEDBACK_BUFFER, GL_VERTEX_ARRAY_BINDING, GL_UNSIGNED_SHORT_5_5_5_1, GL_TIMEOUT_EXPIRED,
|
||||||
|
GL_COMPRESSED_RGB8_ETC2, GL_SIGNED_NORMALIZED, GL_STENCIL_FUNC, GL_MAX_TEXTURE_LOD_BIAS, GL_ALIASED_LINE_WIDTH_RANGE,
|
||||||
|
GL_DECR, GL_BACK, GL_TEXTURE_COMPARE_FUNC, GL_TRANSFORM_FEEDBACK_BUFFER_MODE, GL_INT,
|
||||||
|
GL_COMPRESSED_SIGNED_RG11_EAC, GL_POLYGON_OFFSET_FILL, GL_MINOR_VERSION, GL_FRONT_AND_BACK, GL_R8,
|
||||||
|
GL_RGB_INTEGER, GL_STENCIL_CLEAR_VALUE, GL_SRGB, GL_GREEN_BITS, GL_SYNC_FENCE,
|
||||||
|
GL_ONE_MINUS_CONSTANT_COLOR, GL_SHADING_LANGUAGE_VERSION, GL_RGB8_SNORM, GL_UNPACK_SKIP_PIXELS, GL_TEXTURE_IMMUTABLE_LEVELS,
|
||||||
|
GL_FRAGMENT_SHADER, GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_SHORT_4_4_4_4, GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, GL_FRAGMENT_SHADER_DERIVATIVE_HINT,
|
||||||
|
GL_NO_ERROR, GL_VIEWPORT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, GL_BLEND_SRC_ALPHA, GL_DRAW_BUFFER6,
|
||||||
|
GL_DRAW_BUFFER7, GL_DRAW_BUFFER4, GL_DRAW_BUFFER5, GL_DRAW_BUFFER2, GL_DRAW_BUFFER3,
|
||||||
|
GL_DRAW_BUFFER0, GL_DRAW_BUFFER1, GL_COMPRESSED_SRGB8_ETC2, GL_QUERY_RESULT_AVAILABLE, GL_DRAW_BUFFER8,
|
||||||
|
GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT, GL_MAX_DRAW_BUFFERS, GL_KEEP, GL_DELETE_STATUS, GL_R32UI,
|
||||||
|
GL_RGBA8_SNORM, GL_INT_SAMPLER_3D, GL_SRC_COLOR, GL_SAMPLER_BINDING, GL_DEPTH24_STENCIL8,
|
||||||
|
GL_SAMPLE_BUFFERS, GL_MAJOR_VERSION, GL_STATIC_COPY, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, GL_EXTENSIONS,
|
||||||
|
GL_UNIFORM_BUFFER_BINDING, GL_UNIFORM_TYPE, GL_COPY_READ_BUFFER_BINDING, GL_TEXTURE_COMPARE_MODE, GL_ANY_SAMPLES_PASSED,
|
||||||
|
GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE, GL_DEPTH_BUFFER_BIT, GL_STENCIL_BACK_PASS_DEPTH_FAIL, GL_UNIFORM_BUFFER, GL_MAP_WRITE_BIT,
|
||||||
|
GL_VERTEX_ATTRIB_ARRAY_POINTER, GL_ALIASED_POINT_SIZE_RANGE, GL_CCW, GL_MAP_INVALIDATE_BUFFER_BIT, GL_DEPTH_COMPONENT24,
|
||||||
|
GL_UNSIGNED_INT_5_9_9_9_REV, GL_DEPTH_TEST, GL_SYNC_GPU_COMMANDS_COMPLETE, GL_VERTEX_ATTRIB_ARRAY_INTEGER, GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE,
|
||||||
|
GL_MAX_VERTEX_UNIFORM_BLOCKS, GL_STREAM_READ, GL_LINEAR, GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, GL_FUNC_SUBTRACT,
|
||||||
|
GL_R32F, GL_MAX_VARYING_COMPONENTS, GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH, GL_IMPLEMENTATION_COLOR_READ_FORMAT, GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING,
|
||||||
|
GL_MAX_ELEMENT_INDEX, GL_COLOR_ATTACHMENT15, GL_COLOR_ATTACHMENT14, GL_HIGH_FLOAT, GL_DEPTH_RANGE,
|
||||||
|
GL_GREATER, GL_CLAMP_TO_EDGE, GL_COLOR_ATTACHMENT13, GL_COLOR_ATTACHMENT12, GL_NEAREST,
|
||||||
|
GL_VERTEX_ATTRIB_ARRAY_ENABLED, GL_COLOR_ATTACHMENT19, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER, GL_MAX_TEXTURE_IMAGE_UNITS, GL_RGB32F,
|
||||||
|
GL_FLOAT_MAT2, GL_FLOAT_MAT3, GL_FRONT_FACE, GL_DEPTH, GL_FLOAT_MAT4,
|
||||||
|
GL_RENDERBUFFER_GREEN_SIZE, GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE, GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT, GL_TEXTURE30, GL_TEXTURE31,
|
||||||
|
GL_RG8I, GL_RGBA8I, GL_RG8UI, GL_DEPTH_CLEAR_VALUE, GL_BUFFER_MAP_POINTER,
|
||||||
|
GL_RENDERBUFFER_BINDING, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, GL_STENCIL_REF, GL_MAX_3D_TEXTURE_SIZE, GL_COPY_WRITE_BUFFER_BINDING,
|
||||||
|
GL_COPY_WRITE_BUFFER, GL_BLEND, GL_MIRRORED_REPEAT, GL_R16UI, GL_TEXTURE_BINDING_3D,
|
||||||
|
GL_UNSIGNED_SHORT, GL_MIN, GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_TEXTURE,
|
||||||
|
GL_COLOR_BUFFER_BIT, GL_DONT_CARE, GL_ACTIVE_UNIFORMS, GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_MAX_VERTEX_UNIFORM_VECTORS,
|
||||||
|
GL_TEXTURE_BINDING_CUBE_MAP, GL_SAMPLER_2D, GL_INVALID_VALUE, GL_DRAW_BUFFER12, GL_NEAREST_MIPMAP_NEAREST,
|
||||||
|
GL_NUM_COMPRESSED_TEXTURE_FORMATS, GL_PACK_SKIP_ROWS, GL_TEXTURE_MAG_FILTER, GL_TEXTURE1, GL_BLEND_EQUATION_RGB,
|
||||||
|
GL_LINK_STATUS, GL_TEXTURE_MAX_LEVEL, GL_R32I, GL_BLEND_COLOR, GL_ALPHA_BITS,
|
||||||
|
GL_BOOL_VEC4, GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, GL_ONE_MINUS_CONSTANT_ALPHA, GL_NEAREST_MIPMAP_LINEAR, GL_INT_2_10_10_10_REV,
|
||||||
|
GL_SAMPLER_CUBE_SHADOW, GL_WAIT_FAILED, GL_MAX_TEXTURE_SIZE, GL_RG32F, GL_UNSIGNED_INT_SAMPLER_2D_ARRAY,
|
||||||
|
GL_ARRAY_BUFFER, GL_DEPTH_COMPONENT16, GL_UNSIGNALED, GL_RGB32I, GL_BLEND_SRC_RGB,
|
||||||
|
GL_FRAMEBUFFER_UNDEFINED, GL_SYNC_FLAGS, GL_FALSE, GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS, GL_ONE_MINUS_SRC_ALPHA,
|
||||||
|
GL_RG32I, GL_RENDERBUFFER_INTERNAL_FORMAT, GL_NUM_SHADER_BINARY_FORMATS, GL_RGBA16I, GL_R8I,
|
||||||
|
GL_SAMPLE_ALPHA_TO_COVERAGE, GL_INT_SAMPLER_2D, GL_STENCIL_BITS, GL_STENCIL_PASS_DEPTH_FAIL, GL_RED,
|
||||||
|
GL_FUNC_REVERSE_SUBTRACT, GL_RGBA8UI, GL_GREEN, GL_INVALID_OPERATION, GL_RED_INTEGER,
|
||||||
|
GL_NONE, GL_STENCIL_BACK_PASS_DEPTH_PASS, GL_COLOR_ATTACHMENT5, GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS, GL_COLOR_ATTACHMENT7,
|
||||||
|
GL_UNIFORM_BLOCK_NAME_LENGTH, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT3, GL_COLOR_ATTACHMENT2,
|
||||||
|
GL_UNIFORM_BLOCK_INDEX, GL_FRAMEBUFFER_DEFAULT, GL_RGBA16UI, GL_COLOR_ATTACHMENT9, GL_COLOR_ATTACHMENT8,
|
||||||
|
GL_COLOR_ATTACHMENT10, GL_FRONT, GL_SCISSOR_BOX, GL_UNIFORM_BLOCK_DATA_SIZE, GL_DEPTH_WRITEMASK,
|
||||||
|
GL_CULL_FACE_MODE, GL_MAX_FRAGMENT_UNIFORM_VECTORS, GL_NUM_EXTENSIONS, GL_UNIFORM_IS_ROW_MAJOR, GL_MAX_UNIFORM_BLOCK_SIZE,
|
||||||
|
GL_BOOL, GL_MAX_COMBINED_UNIFORM_BLOCKS, GL_FRAMEBUFFER_BINDING, GL_UNSIGNED_INT_24_8, GL_COMPRESSED_TEXTURE_FORMATS,
|
||||||
|
GL_ALPHA, GL_COLOR_WRITEMASK, GL_DST_COLOR, GL_UNSIGNED_INT, GL_DEPTH_FUNC,
|
||||||
|
GL_ALWAYS, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, GL_INVALID_ENUM, GL_PROGRAM_BINARY_LENGTH,
|
||||||
|
GL_STENCIL_BACK_VALUE_MASK, GL_INT_SAMPLER_2D_ARRAY, GL_DEPTH_COMPONENT, GL_SCISSOR_TEST, GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES,
|
||||||
|
GL_SHADER_TYPE, GL_COMPARE_REF_TO_TEXTURE, GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE, GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, GL_TRUE,
|
||||||
|
GL_TEXTURE_MIN_FILTER, GL_REPLACE, GL_BLUE_BITS, GL_RG_INTEGER, GL_TEXTURE_SWIZZLE_R,
|
||||||
|
GL_VERTEX_ATTRIB_ARRAY_STRIDE, GL_EQUAL, GL_TEXTURE_SWIZZLE_G, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER_HEIGHT,
|
||||||
|
GL_RG16UI, GL_INTERLEAVED_ATTRIBS, GL_TEXTURE_SWIZZLE_A, GL_POLYGON_OFFSET_UNITS, GL_LOW_FLOAT,
|
||||||
|
GL_HALF_FLOAT, GL_FLOAT_MAT4x3, GL_DYNAMIC_COPY, GL_COLOR_ATTACHMENT6, GL_UNPACK_ALIGNMENT,
|
||||||
|
GL_ALREADY_SIGNALED, GL_LINE_STRIP, GL_STREAM_COPY, GL_PACK_ROW_LENGTH, GL_NUM_SAMPLE_COUNTS,
|
||||||
|
GL_MEDIUM_INT, GL_TEXTURE_CUBE_MAP, GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS, GL_COLOR, GL_RENDERBUFFER_DEPTH_SIZE,
|
||||||
|
GL_DYNAMIC_READ, GL_PROGRAM_BINARY_FORMATS, GL_LOW_INT, GL_DEPTH_STENCIL, GL_VERTEX_ATTRIB_ARRAY_DIVISOR,
|
||||||
|
GL_MAX_VERTEX_OUTPUT_COMPONENTS, GL_POINTS, GL_COMPRESSED_RG11_EAC, GL_RENDERBUFFER_BLUE_SIZE, GL_UNIFORM_NAME_LENGTH,
|
||||||
|
GL_FASTEST, GL_SYNC_CONDITION, GL_ACTIVE_UNIFORM_MAX_LENGTH, GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS, GL_MAP_INVALIDATE_RANGE_BIT,
|
||||||
|
GL_TEXTURE23, GL_TEXTURE22, GL_TEXTURE21, GL_TEXTURE20, GL_TEXTURE27,
|
||||||
|
GL_TEXTURE26, GL_TEXTURE25, GL_TEXTURE24, GL_R8_SNORM, GL_TEXTURE29,
|
||||||
|
GL_TEXTURE28, GL_ELEMENT_ARRAY_BUFFER_BINDING, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
|
||||||
|
GL_LINE_LOOP, GL_READ_BUFFER, GL_MAP_FLUSH_EXPLICIT_BIT, GL_PACK_SKIP_PIXELS, GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS,
|
||||||
|
GL_SUBPIXEL_BITS, GL_R16F, GL_GEQUAL, GL_READ_FRAMEBUFFER, GL_UNIFORM_BLOCK_BINDING,
|
||||||
|
GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, GL_LINE_WIDTH, GL_UNIFORM_OFFSET, GL_LEQUAL, GL_TRANSFORM_FEEDBACK,
|
||||||
|
GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, GL_UNSIGNED_INT_SAMPLER_CUBE, GL_COLOR_ATTACHMENT4, GL_UNIFORM_SIZE, GL_FUNC_ADD,
|
||||||
|
GL_FLOAT_MAT4x2, GL_SHADER_SOURCE_LENGTH, GL_CURRENT_VERTEX_ATTRIB, GL_ARRAY_BUFFER_BINDING, GL_TEXTURE_2D,
|
||||||
|
GL_DYNAMIC_DRAW, GL_OUT_OF_MEMORY, GL_NICEST, GL_IMPLEMENTATION_COLOR_READ_TYPE, GL_UNPACK_ROW_LENGTH,
|
||||||
|
GL_CURRENT_PROGRAM, GL_BUFFER_MAPPED, GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS, GL_RASTERIZER_DISCARD, GL_NUM_PROGRAM_BINARY_FORMATS,
|
||||||
|
GL_STREAM_DRAW, GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER, GL_MAX_UNIFORM_BUFFER_BINDINGS, GL_SIGNALED, GL_FRAMEBUFFER,
|
||||||
|
GL_UNPACK_SKIP_ROWS, GL_MEDIUM_FLOAT, GL_STENCIL_TEST, GL_R11F_G11F_B10F, GL_SRGB8,
|
||||||
|
GL_LUMINANCE_ALPHA, GL_PIXEL_UNPACK_BUFFER_BINDING, GL_INVERT, GL_STENCIL_BACK_FAIL, GL_POLYGON_OFFSET_FACTOR,
|
||||||
|
GL_TRANSFORM_FEEDBACK_VARYINGS, GL_DEPTH_COMPONENT32F, GL_TRIANGLE_FAN, GL_SYNC_FLUSH_COMMANDS_BIT, GL_ONE_MINUS_DST_ALPHA,
|
||||||
|
GL_DRAW_FRAMEBUFFER_BINDING, GL_MAX_ELEMENTS_VERTICES, GL_STENCIL_BACK_WRITEMASK, GL_INVALID_FRAMEBUFFER_OPERATION, GL_BUFFER_ACCESS_FLAGS,
|
||||||
|
GL_COMPRESSED_RGBA8_ETC2_EAC, GL_UNIFORM_BUFFER_SIZE, GL_TRIANGLES, GL_SAMPLER_2D_ARRAY_SHADOW, GL_DEPTH32F_STENCIL8,
|
||||||
|
GL_MAX_ARRAY_TEXTURE_LAYERS, GL_RED_BITS, GL_UNIFORM_MATRIX_STRIDE, GL_MAX_SERVER_WAIT_TIMEOUT, GL_SRGB8_ALPHA8,
|
||||||
|
GL_RGBA16F, GL_PACK_ALIGNMENT, GL_SAMPLER_2D_ARRAY, GL_RENDERER, GL_MAX_COLOR_ATTACHMENTS,
|
||||||
|
GL_ACTIVE_UNIFORM_BLOCKS, GL_UNPACK_SKIP_IMAGES, GL_STENCIL_BACK_FUNC, GL_RGB16I, GL_ACTIVE_TEXTURE,
|
||||||
|
GL_TEXTURE_BASE_LEVEL, GL_RGB16F, GL_COMPRESSED_SIGNED_R11_EAC, GL_UNSIGNED_INT_SAMPLER_3D, GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH,
|
||||||
|
GL_TEXTURE_WRAP_R, GL_INT_VEC4, GL_INT_VEC3, GL_INT_VEC2, GL_STENCIL_FAIL,
|
||||||
|
GL_MAX_VERTEX_ATTRIBS, GL_CONDITION_SATISFIED, GL_TEXTURE_IMMUTABLE_FORMAT, GL_FRAMEBUFFER_UNSUPPORTED, GL_DST_ALPHA,
|
||||||
|
GL_LESS, GL_MAX_CUBE_MAP_TEXTURE_SIZE, GL_RGB565, GL_TRANSFORM_FEEDBACK_BINDING, GL_RENDERBUFFER_WIDTH,
|
||||||
|
GL_READ_FRAMEBUFFER_BINDING, GL_RGBA4, GL_DRAW_BUFFER10, GL_DRAW_BUFFER11, GL_RGBA8,
|
||||||
|
GL_DRAW_BUFFER13, GL_DRAW_BUFFER14, GL_DRAW_BUFFER15, GL_INFO_LOG_LENGTH, GL_PRIMITIVE_RESTART_FIXED_INDEX,
|
||||||
|
GL_SRC_ALPHA_SATURATE, GL_RENDERBUFFER_STENCIL_SIZE, GL_REPEAT, GL_R16I, GL_RG8_SNORM,
|
||||||
|
GL_PIXEL_PACK_BUFFER, GL_STATIC_READ, GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER, GL_VALIDATE_STATUS,
|
||||||
|
GL_MAP_READ_BIT, GL_STENCIL, GL_STENCIL_BUFFER_BIT, GL_TEXTURE_SWIZZLE_B, GL_COLOR_ATTACHMENT17,
|
||||||
|
GL_BLEND_EQUATION_ALPHA, GL_RGBA_INTEGER, GL_ACTIVE_ATTRIBUTES, GL_MAX_RENDERBUFFER_SIZE, GL_COLOR_ATTACHMENT31,
|
||||||
|
GL_COLOR_ATTACHMENT30, GL_STENCIL_PASS_DEPTH_PASS, GL_INCR_WRAP, GL_RENDERBUFFER_ALPHA_SIZE, GL_HIGH_INT,
|
||||||
|
GL_COLOR_ATTACHMENT16, GL_DECR_WRAP, GL_ATTACHED_SHADERS, GL_MAX_FRAGMENT_INPUT_COMPONENTS, GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
|
||||||
|
GL_LINES, GL_TEXTURE18, GL_TEXTURE19, GL_TEXTURE16, GL_TEXTURE17,
|
||||||
|
GL_TEXTURE14, GL_GENERATE_MIPMAP_HINT, GL_TEXTURE12, GL_COLOR_ATTACHMENT11, GL_TEXTURE10,
|
||||||
|
GL_MAX_FRAGMENT_UNIFORM_BLOCKS, GL_BLEND_DST_ALPHA, GL_RGB, GL_INT_SAMPLER_CUBE, GL_CURRENT_QUERY,
|
||||||
|
GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, GL_RGB5_A1, GL_VERTEX_SHADER, GL_TRANSFORM_FEEDBACK_BUFFER_START, GL_MAX_PROGRAM_TEXEL_OFFSET,
|
||||||
|
GL_SHADER_BINARY_FORMATS, GL_CONSTANT_COLOR, GL_RGBA32F, GL_RGBA32I, GL_VERTEX_ATTRIB_ARRAY_TYPE,
|
||||||
|
GL_PIXEL_UNPACK_BUFFER, GL_LINEAR_MIPMAP_NEAREST, GL_STENCIL_WRITEMASK, GL_RG8, GL_RGB10_A2,
|
||||||
|
GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE, GL_VERSION, GL_MAP_UNSYNCHRONIZED_BIT, GL_ZERO, GL_ELEMENT_ARRAY_BUFFER,
|
||||||
|
GL_SYNC_STATUS, GL_BUFFER_MAP_LENGTH, GL_MAX_ELEMENTS_INDICES, GL_UNSIGNED_NORMALIZED, GL_CONSTANT_ALPHA,
|
||||||
|
GL_SRC_ALPHA, GL_TEXTURE_3D, GL_FIXED, GL_RGB8, GL_SAMPLE_COVERAGE_INVERT,
|
||||||
|
GL_NOTEQUAL, GL_UNIFORM_ARRAY_STRIDE, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, GL_INCR, GL_CULL_FACE,
|
||||||
|
GL_SAMPLE_COVERAGE_VALUE, GL_RENDERBUFFER_RED_SIZE, GL_MAX_VIEWPORT_DIMS, GL_RG32UI, GL_NEVER,
|
||||||
|
GL_TEXTURE15, GL_STENCIL_VALUE_MASK, GL_TEXTURE13, GL_DRAW_BUFFER9, GL_COMPILE_STATUS,
|
||||||
|
GL_FRAMEBUFFER_COMPLETE, GL_TEXTURE11, GL_COPY_READ_BUFFER, GL_SHADER_COMPILER, GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS,
|
||||||
|
GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, GL_LUMINANCE, GL_RGBA, GL_SHORT, GL_BLUE,
|
||||||
|
GL_CW, GL_MIN_PROGRAM_TEXEL_OFFSET, GL_UNSIGNED_BYTE, GL_MAX_VERTEX_UNIFORM_COMPONENTS, GL_VENDOR,
|
||||||
|
GL_TEXTURE_2D_ARRAY, GL_UNSIGNED_INT_10F_11F_11F_REV, GL_TEXTURE_BINDING_2D, GL_OBJECT_TYPE, GL_R8UI,
|
||||||
|
GL_STATIC_DRAW, GL_RENDERBUFFER, GL_FLOAT_MAT2x3, GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE, GL_FLOAT_MAT2x4,
|
||||||
|
GL_RGB8I, GL_COLOR_ATTACHMENT18, GL_TRANSFORM_FEEDBACK_BUFFER_SIZE, GL_TRANSFORM_FEEDBACK_ACTIVE, GL_SEPARATE_ATTRIBS,
|
||||||
|
GL_SAMPLER_3D, GL_MAX, GL_STENCIL_INDEX8, GL_DEPTH_BITS, GL_RGB8UI,
|
||||||
|
GL_STENCIL_BACK_REF, GL_INVALID_INDEX, GL_BLEND_DST_RGB, GL_SAMPLER_2D_SHADOW, GL_TEXTURE_BINDING_2D_ARRAY,
|
||||||
|
GL_RG16F, GL_SAMPLER_CUBE, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, GL_RG16I,
|
||||||
|
GL_PIXEL_PACK_BUFFER_BINDING, GL_STENCIL_ATTACHMENT, GL_SAMPLE_COVERAGE, GL_ANY_SAMPLES_PASSED_CONSERVATIVE, GL_DRAW_FRAMEBUFFER,
|
||||||
|
GL_RGB10_A2UI, GL_SAMPLES;
|
||||||
|
|
||||||
1323
demos/external/sources/glad/gl/loader.d
vendored
Normal file
1323
demos/external/sources/glad/gl/loader.d
vendored
Normal file
File diff suppressed because it is too large
Load diff
46
demos/external/sources/glad/gl/types.d
vendored
Normal file
46
demos/external/sources/glad/gl/types.d
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
module glad.gl.types;
|
||||||
|
|
||||||
|
|
||||||
|
alias GLvoid = void;
|
||||||
|
alias GLintptr = ptrdiff_t;
|
||||||
|
alias GLsizei = int;
|
||||||
|
alias GLchar = char;
|
||||||
|
alias GLcharARB = byte;
|
||||||
|
alias GLushort = ushort;
|
||||||
|
alias GLint64EXT = long;
|
||||||
|
alias GLshort = short;
|
||||||
|
alias GLuint64 = ulong;
|
||||||
|
alias GLhalfARB = ushort;
|
||||||
|
alias GLubyte = ubyte;
|
||||||
|
alias GLdouble = double;
|
||||||
|
alias GLhandleARB = uint;
|
||||||
|
alias GLint64 = long;
|
||||||
|
alias GLenum = uint;
|
||||||
|
alias GLeglImageOES = void*;
|
||||||
|
alias GLintptrARB = ptrdiff_t;
|
||||||
|
alias GLsizeiptr = ptrdiff_t;
|
||||||
|
alias GLint = int;
|
||||||
|
alias GLboolean = ubyte;
|
||||||
|
alias GLbitfield = uint;
|
||||||
|
alias GLsizeiptrARB = ptrdiff_t;
|
||||||
|
alias GLfloat = float;
|
||||||
|
alias GLuint64EXT = ulong;
|
||||||
|
alias GLclampf = float;
|
||||||
|
alias GLbyte = byte;
|
||||||
|
alias GLclampd = double;
|
||||||
|
alias GLuint = uint;
|
||||||
|
alias GLvdpauSurfaceNV = ptrdiff_t;
|
||||||
|
alias GLfixed = int;
|
||||||
|
alias GLhalf = ushort;
|
||||||
|
alias GLclampx = int;
|
||||||
|
alias GLhalfNV = ushort;
|
||||||
|
struct ___GLsync; alias __GLsync = ___GLsync*;
|
||||||
|
alias GLsync = __GLsync*;
|
||||||
|
struct __cl_context; alias _cl_context = __cl_context*;
|
||||||
|
struct __cl_event; alias _cl_event = __cl_event*;
|
||||||
|
extern(System) {
|
||||||
|
alias GLDEBUGPROC = void function(GLenum, GLenum, GLuint, GLenum, GLsizei, in GLchar*, GLvoid*);
|
||||||
|
alias GLDEBUGPROCARB = GLDEBUGPROC;
|
||||||
|
alias GLDEBUGPROCKHR = GLDEBUGPROC;
|
||||||
|
alias GLDEBUGPROCAMD = void function(GLuint, GLenum, GLenum, GLsizei, in GLchar*, GLvoid*);
|
||||||
|
}
|
||||||
1736
demos/external/sources/mmutils/thread_pool.d
vendored
Normal file
1736
demos/external/sources/mmutils/thread_pool.d
vendored
Normal file
File diff suppressed because it is too large
Load diff
46
demos/external/wasm_imports/bindbc/sdl/bind/package.d
vendored
Normal file
46
demos/external/wasm_imports/bindbc/sdl/bind/package.d
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind;
|
||||||
|
|
||||||
|
public
|
||||||
|
import bindbc.sdl.bind.sdl,
|
||||||
|
bindbc.sdl.bind.sdlassert,
|
||||||
|
bindbc.sdl.bind.sdlaudio,
|
||||||
|
bindbc.sdl.bind.sdlblendmode,
|
||||||
|
bindbc.sdl.bind.sdlclipboard,
|
||||||
|
bindbc.sdl.bind.sdlcpuinfo,
|
||||||
|
bindbc.sdl.bind.sdlerror,
|
||||||
|
bindbc.sdl.bind.sdlevents,
|
||||||
|
bindbc.sdl.bind.sdlfilesystem,
|
||||||
|
bindbc.sdl.bind.sdlgamecontroller,
|
||||||
|
bindbc.sdl.bind.sdlgesture,
|
||||||
|
bindbc.sdl.bind.sdlhaptic,
|
||||||
|
bindbc.sdl.bind.sdlhints,
|
||||||
|
bindbc.sdl.bind.sdljoystick,
|
||||||
|
bindbc.sdl.bind.sdlkeyboard,
|
||||||
|
bindbc.sdl.bind.sdlkeycode,
|
||||||
|
bindbc.sdl.bind.sdlloadso,
|
||||||
|
bindbc.sdl.bind.sdllog,
|
||||||
|
bindbc.sdl.bind.sdlmessagebox,
|
||||||
|
bindbc.sdl.bind.sdlmouse,
|
||||||
|
bindbc.sdl.bind.sdlpixels,
|
||||||
|
bindbc.sdl.bind.sdlplatform,
|
||||||
|
bindbc.sdl.bind.sdlpower,
|
||||||
|
bindbc.sdl.bind.sdlrect,
|
||||||
|
bindbc.sdl.bind.sdlrender,
|
||||||
|
bindbc.sdl.bind.sdlrwops,
|
||||||
|
bindbc.sdl.bind.sdlscancode,
|
||||||
|
bindbc.sdl.bind.sdlshape,
|
||||||
|
bindbc.sdl.bind.sdlstdinc,
|
||||||
|
bindbc.sdl.bind.sdlsurface,
|
||||||
|
bindbc.sdl.bind.sdlsystem,
|
||||||
|
bindbc.sdl.bind.sdlsyswm,
|
||||||
|
bindbc.sdl.bind.sdltimer,
|
||||||
|
bindbc.sdl.bind.sdltouch,
|
||||||
|
bindbc.sdl.bind.sdlversion,
|
||||||
|
bindbc.sdl.bind.sdlvideo,
|
||||||
|
bindbc.sdl.bind.sdlvulkan;
|
||||||
69
demos/external/wasm_imports/bindbc/sdl/bind/sdl.d
vendored
Normal file
69
demos/external/wasm_imports/bindbc/sdl/bind/sdl.d
vendored
Normal file
|
|
@ -0,0 +1,69 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdl;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
enum : uint {
|
||||||
|
SDL_INIT_TIMER = 0x00000001,
|
||||||
|
SDL_INIT_AUDIO = 0x00000010,
|
||||||
|
SDL_INIT_VIDEO = 0x00000020,
|
||||||
|
SDL_INIT_JOYSTICK = 0x00000200,
|
||||||
|
SDL_INIT_HAPTIC = 0x00001000,
|
||||||
|
SDL_INIT_GAMECONTROLLER = 0x00002000,
|
||||||
|
SDL_INIT_EVENTS = 0x00004000,
|
||||||
|
SDL_INIT_SENSOR = 0x00008000,
|
||||||
|
SDL_INIT_NOPARACHUTE = 0x00100000,
|
||||||
|
SDL_INIT_EVERYTHING =
|
||||||
|
SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO |
|
||||||
|
SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER |
|
||||||
|
SDL_INIT_EVENTS | SDL_INIT_SENSOR
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
enum : uint {
|
||||||
|
SDL_INIT_TIMER = 0x00000001,
|
||||||
|
SDL_INIT_AUDIO = 0x00000010,
|
||||||
|
SDL_INIT_VIDEO = 0x00000020,
|
||||||
|
SDL_INIT_JOYSTICK = 0x00000200,
|
||||||
|
SDL_INIT_HAPTIC = 0x00001000,
|
||||||
|
SDL_INIT_GAMECONTROLLER = 0x00002000,
|
||||||
|
SDL_INIT_EVENTS = 0x00004000,
|
||||||
|
SDL_INIT_NOPARACHUTE = 0x00100000,
|
||||||
|
SDL_INIT_EVERYTHING =
|
||||||
|
SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO |
|
||||||
|
SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER |
|
||||||
|
SDL_INIT_EVENTS
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
int SDL_Init(uint);
|
||||||
|
int SDL_InitSubSystem(uint);
|
||||||
|
void SDL_QuitSubSystem(uint);
|
||||||
|
uint SDL_WasInit(uint);
|
||||||
|
void SDL_Quit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_Init = int function(uint);
|
||||||
|
alias pSDL_InitSubSystem = int function(uint);
|
||||||
|
alias pSDL_QuitSubSystem = void function(uint);
|
||||||
|
alias pSDL_WasInit = uint function(uint);
|
||||||
|
alias pSDL_Quit = void function();
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_Init SDL_Init;
|
||||||
|
pSDL_InitSubSystem SDL_InitSubSystem;
|
||||||
|
pSDL_QuitSubSystem SDL_QuitSubSystem;
|
||||||
|
pSDL_WasInit SDL_WasInit;
|
||||||
|
pSDL_Quit SDL_Quit;
|
||||||
|
}
|
||||||
|
}
|
||||||
70
demos/external/wasm_imports/bindbc/sdl/bind/sdlassert.d
vendored
Normal file
70
demos/external/wasm_imports/bindbc/sdl/bind/sdlassert.d
vendored
Normal file
|
|
@ -0,0 +1,70 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlassert;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
|
||||||
|
enum SDL_assert_state : uint {
|
||||||
|
SDL_ASSERTION_RETRY = 0,
|
||||||
|
SDL_ASSERTION_BREAK = 1,
|
||||||
|
SDL_ASSERTION_ABORT = 2,
|
||||||
|
SDL_ASSERTION_IGNORE = 3,
|
||||||
|
SDL_ASSERTION_ALWAYS_IGNORE = 4
|
||||||
|
}
|
||||||
|
alias SDL_AssertState = SDL_assert_state;
|
||||||
|
mixin(expandEnum!SDL_AssertState);
|
||||||
|
|
||||||
|
struct SDL_assert_data {
|
||||||
|
int always_ignore;
|
||||||
|
uint trigger_count;
|
||||||
|
const(char) *condition;
|
||||||
|
const(char) *filename;
|
||||||
|
int linenum;
|
||||||
|
const(char) *function_;
|
||||||
|
const(SDL_assert_data) *next;
|
||||||
|
}
|
||||||
|
alias SDL_AssertData = SDL_assert_data;
|
||||||
|
|
||||||
|
extern(C) nothrow alias SDL_AssertionHandler = SDL_AssertState function(const(SDL_AssertData)* data, void* userdata);
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
void SDL_SetAssertionHandler(SDL_AssertionHandler,void*);
|
||||||
|
const(SDL_assert_data)* SDL_GetAssertionReport();
|
||||||
|
void SDL_ResetAssertionReport();
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl202) {
|
||||||
|
SDL_AssertionHandler SDL_GetAssertionHandler(void**);
|
||||||
|
SDL_AssertionHandler SDL_GetDefaultAssertionHandler();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_SetAssertionHandler = void function(SDL_AssertionHandler,void*);
|
||||||
|
alias pSDL_GetAssertionReport = const(SDL_assert_data)* function();
|
||||||
|
alias pSDL_ResetAssertionReport = void function();
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_SetAssertionHandler SDL_SetAssertionHandler;
|
||||||
|
pSDL_GetAssertionReport SDL_GetAssertionReport;
|
||||||
|
pSDL_ResetAssertionReport SDL_ResetAssertionReport;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl202) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GetAssertionHandler = SDL_AssertionHandler function(void**);
|
||||||
|
alias pSDL_GetDefaultAssertionHandler = SDL_AssertionHandler function();
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GetAssertionHandler SDL_GetAssertionHandler;
|
||||||
|
pSDL_GetDefaultAssertionHandler SDL_GetDefaultAssertionHandler;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
283
demos/external/wasm_imports/bindbc/sdl/bind/sdlaudio.d
vendored
Normal file
283
demos/external/wasm_imports/bindbc/sdl/bind/sdlaudio.d
vendored
Normal file
|
|
@ -0,0 +1,283 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlaudio;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
import bindbc.sdl.bind.sdlrwops;
|
||||||
|
|
||||||
|
enum : ushort {
|
||||||
|
SDL_AUDIO_MASK_BITSIZE = 0xFF,
|
||||||
|
SDL_AUDIO_MASK_DATATYPE = 1<<8,
|
||||||
|
SDL_AUDIO_MASK_ENDIAN = 1<<12,
|
||||||
|
SDL_AUDIO_MASK_SIGNED = 1<<15,
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SDL_AudioFormat : ushort {
|
||||||
|
AUDIO_U8 = 0x0008,
|
||||||
|
AUDIO_S8 = 0x8008,
|
||||||
|
AUDIO_U16LSB = 0x0010,
|
||||||
|
AUDIO_S16LSB = 0x8010,
|
||||||
|
AUDIO_U16MSB = 0x1010,
|
||||||
|
AUDIO_S16MSB = 0x9010,
|
||||||
|
AUDIO_U16 = AUDIO_U16LSB,
|
||||||
|
AUDIO_S16 = AUDIO_S16LSB,
|
||||||
|
AUDIO_S32LSB = 0x8020,
|
||||||
|
AUDIO_S32MSB = 0x9020,
|
||||||
|
AUDIO_S32 = AUDIO_S32LSB,
|
||||||
|
AUDIO_F32LSB = 0x8120,
|
||||||
|
AUDIO_F32MSB = 0x9120,
|
||||||
|
AUDIO_F32 = AUDIO_F32LSB,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_AudioFormat);
|
||||||
|
|
||||||
|
version(LittleEndian) {
|
||||||
|
alias AUDIO_U16SYS = AUDIO_U16LSB;
|
||||||
|
alias AUDIO_S16SYS = AUDIO_S16LSB;
|
||||||
|
alias AUDIO_S32SYS = AUDIO_S32LSB;
|
||||||
|
alias AUDIO_F32SYS = AUDIO_F32LSB;
|
||||||
|
} else {
|
||||||
|
alias AUDIO_U16SYS = AUDIO_U16MSB;
|
||||||
|
alias AUDIO_S16SYS = AUDIO_S16MSB;
|
||||||
|
alias AUDIO_S32SYS = AUDIO_S32MSB;
|
||||||
|
alias AUDIO_F32SYS = AUDIO_F32MSB;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SDL_AUDIO_BITSIZE(SDL_AudioFormat x) = x & SDL_AUDIO_MASK_BITSIZE;
|
||||||
|
enum SDL_AUDIO_ISFLOAT(SDL_AudioFormat x) = x & SDL_AUDIO_MASK_DATATYPE;
|
||||||
|
enum SDL_AUDIO_ISBIGENDIAN(SDL_AudioFormat x) = x & SDL_AUDIO_MASK_ENDIAN;
|
||||||
|
enum SDL_AUDIO_ISSIGNED(SDL_AudioFormat x) = x & SDL_AUDIO_MASK_SIGNED;
|
||||||
|
enum SDL_AUDIO_ISINT(SDL_AudioFormat x) = !SDL_AUDIO_ISFLOAT!x;
|
||||||
|
enum SDL_AUDIO_ISLITTLEENDIAN(SDL_AudioFormat x) = !SDL_AUDIO_ISBIGENDIAN!x;
|
||||||
|
enum SDL_AUDIO_ISUNSIGNED(SDL_AudioFormat x) = !SDL_AUDIO_ISSIGNED!x;
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
enum {
|
||||||
|
SDL_AUDIO_ALLOW_FREQUENCY_CHANGE = 0x00000001,
|
||||||
|
SDL_AUDIO_ALLOW_FORMAT_CHANGE = 0x00000002,
|
||||||
|
SDL_AUDIO_ALLOW_CHANNELS_CHANGE = 0x00000004,
|
||||||
|
SDL_AUDIO_ALLOW_SAMPLES_CHANGE = 0x00000008,
|
||||||
|
SDL_AUDIO_ALLOW_ANY_CHANGE = SDL_AUDIO_ALLOW_FREQUENCY_CHANGE |
|
||||||
|
SDL_AUDIO_ALLOW_FORMAT_CHANGE |
|
||||||
|
SDL_AUDIO_ALLOW_CHANNELS_CHANGE |
|
||||||
|
SDL_AUDIO_ALLOW_SAMPLES_CHANGE,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
enum {
|
||||||
|
SDL_AUDIO_ALLOW_FREQUENCY_CHANGE = 0x00000001,
|
||||||
|
SDL_AUDIO_ALLOW_FORMAT_CHANGE = 0x00000002,
|
||||||
|
SDL_AUDIO_ALLOW_CHANNELS_CHANGE = 0x00000004,
|
||||||
|
SDL_AUDIO_ALLOW_ANY_CHANGE = SDL_AUDIO_ALLOW_FREQUENCY_CHANGE |
|
||||||
|
SDL_AUDIO_ALLOW_FORMAT_CHANGE |
|
||||||
|
SDL_AUDIO_ALLOW_CHANNELS_CHANGE,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extern(C) nothrow alias SDL_AudioCallback = void function(void* userdata, ubyte* stream, int len);
|
||||||
|
struct SDL_AudioSpec {
|
||||||
|
int freq;
|
||||||
|
SDL_AudioFormat format;
|
||||||
|
ubyte channels;
|
||||||
|
ubyte silence;
|
||||||
|
ushort samples;
|
||||||
|
ushort padding;
|
||||||
|
uint size;
|
||||||
|
SDL_AudioCallback callback;
|
||||||
|
void* userdata;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Declared in 2.0.6, but doesn't hurt to use here
|
||||||
|
enum SDL_AUDIOCVT_MAX_FILTERS = 9;
|
||||||
|
|
||||||
|
extern(C) nothrow alias SDL_AudioFilter = void function(SDL_AudioCVT* cvt, SDL_AudioFormat format);
|
||||||
|
struct SDL_AudioCVT {
|
||||||
|
int needed;
|
||||||
|
SDL_AudioFormat src_format;
|
||||||
|
SDL_AudioFormat dst_format;
|
||||||
|
double rate_incr;
|
||||||
|
ubyte* buf;
|
||||||
|
int len;
|
||||||
|
int len_cvt;
|
||||||
|
int len_mult;
|
||||||
|
double len_ratio;
|
||||||
|
SDL_AudioFilter[SDL_AUDIOCVT_MAX_FILTERS + 1] filters;
|
||||||
|
int filter_index;
|
||||||
|
}
|
||||||
|
|
||||||
|
alias SDL_AudioDeviceID = uint;
|
||||||
|
|
||||||
|
enum SDL_AudioStatus {
|
||||||
|
SDL_AUDIO_STOPPED = 0,
|
||||||
|
SDL_AUDIO_PLAYING,
|
||||||
|
SDL_AUDIO_PAUSED,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_AudioStatus);
|
||||||
|
|
||||||
|
enum SDL_MIX_MAXVOLUME = 128;
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl207) {
|
||||||
|
struct SDL_AudioStream;
|
||||||
|
}
|
||||||
|
|
||||||
|
@nogc nothrow
|
||||||
|
SDL_AudioSpec* SDL_LoadWAV(const(char)* file, SDL_AudioSpec* spec, ubyte** audio_buf, uint* len) {
|
||||||
|
pragma(inline, true);
|
||||||
|
return SDL_LoadWAV_RW(SDL_RWFromFile(file,"rb"),1,spec,audio_buf,len);
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
int SDL_GetNumAudioDrivers();
|
||||||
|
const(char)* SDL_GetAudioDriver(int);
|
||||||
|
int SDL_AudioInit(const(char)*);
|
||||||
|
void SDL_AudioQuit();
|
||||||
|
const(char)* SDL_GetCurrentAudioDriver();
|
||||||
|
int SDL_OpenAudio(SDL_AudioSpec*,SDL_AudioSpec*);
|
||||||
|
int SDL_GetNumAudioDevices(int);
|
||||||
|
const(char)* SDL_GetAudioDeviceName(int,int);
|
||||||
|
SDL_AudioDeviceID SDL_OpenAudioDevice(const(char)*,int,const(SDL_AudioSpec)*,SDL_AudioSpec*,int);
|
||||||
|
SDL_AudioStatus SDL_GetAudioStatus();
|
||||||
|
SDL_AudioStatus SDL_GetAudioDeviceStatus(SDL_AudioDeviceID);
|
||||||
|
void SDL_PauseAudio(int);
|
||||||
|
void SDL_PauseAudioDevice(SDL_AudioDeviceID,int);
|
||||||
|
SDL_AudioSpec* SDL_LoadWAV_RW(SDL_RWops*,int,SDL_AudioSpec*,ubyte**,uint*);
|
||||||
|
void SDL_FreeWAV(ubyte*);
|
||||||
|
int SDL_BuildAudioCVT(SDL_AudioCVT*,SDL_AudioFormat,ubyte,int,SDL_AudioFormat,ubyte,int);
|
||||||
|
int SDL_ConvertAudio(SDL_AudioCVT*);
|
||||||
|
void SDL_MixAudio(ubyte*,const(ubyte)*,uint,int);
|
||||||
|
void SDL_MixAudioFormat(ubyte*,const(ubyte)*,SDL_AudioFormat,uint,int);
|
||||||
|
void SDL_LockAudio();
|
||||||
|
void SDL_LockAudioDevice(SDL_AudioDeviceID);
|
||||||
|
void SDL_UnlockAudio();
|
||||||
|
void SDL_UnlockAudioDevice(SDL_AudioDeviceID);
|
||||||
|
void SDL_CloseAudio();
|
||||||
|
void SDL_CloseAudioDevice(SDL_AudioDeviceID);
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
int SDL_ClearQueuedAudio(SDL_AudioDeviceID);
|
||||||
|
int SDL_GetQueuedAudioSize(SDL_AudioDeviceID);
|
||||||
|
int SDL_QueueAudio(SDL_AudioDeviceID,const (void)*,uint);
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl205) {
|
||||||
|
uint SDL_DequeueAudio(SDL_AudioDeviceID,void*,uint);
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl207) {
|
||||||
|
SDL_AudioStream* SDL_NewAudioStream(const(SDL_AudioFormat),const(ubyte),const(int),const(SDL_AudioFormat),const(ubyte),const(int));
|
||||||
|
int SDL_AudioStreamPut(SDL_AudioStream*,const(void)*,int);
|
||||||
|
int SDL_AudioStreamGet(SDL_AudioStream*,void*,int);
|
||||||
|
int SDL_AudioStreamAvailable(SDL_AudioStream*);
|
||||||
|
int SDL_AudioStreamFlush(SDL_AudioStream*);
|
||||||
|
void SDL_AudioStreamClear(SDL_AudioStream*);
|
||||||
|
void SDL_FreeAudioStream(SDL_AudioStream*);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GetNumAudioDrivers = int function();
|
||||||
|
alias pSDL_GetAudioDriver = const(char)* function(int);
|
||||||
|
alias pSDL_AudioInit = int function(const(char)*);
|
||||||
|
alias pSDL_AudioQuit = void function();
|
||||||
|
alias pSDL_GetCurrentAudioDriver = const(char)* function();
|
||||||
|
alias pSDL_OpenAudio = int function(SDL_AudioSpec*,SDL_AudioSpec*);
|
||||||
|
alias pSDL_GetNumAudioDevices = int function(int);
|
||||||
|
alias pSDL_GetAudioDeviceName = const(char)* function(int,int);
|
||||||
|
alias pSDL_OpenAudioDevice = SDL_AudioDeviceID function(const(char)*,int,const(SDL_AudioSpec)*,SDL_AudioSpec*,int);
|
||||||
|
alias pSDL_GetAudioStatus = SDL_AudioStatus function();
|
||||||
|
alias pSDL_GetAudioDeviceStatus = SDL_AudioStatus function(SDL_AudioDeviceID);
|
||||||
|
alias pSDL_PauseAudio = void function(int);
|
||||||
|
alias pSDL_PauseAudioDevice = void function(SDL_AudioDeviceID,int);
|
||||||
|
alias pSDL_LoadWAV_RW = SDL_AudioSpec* function(SDL_RWops*,int,SDL_AudioSpec*,ubyte**,uint*);
|
||||||
|
alias pSDL_FreeWAV = void function(ubyte*);
|
||||||
|
alias pSDL_BuildAudioCVT = int function(SDL_AudioCVT*,SDL_AudioFormat,ubyte,int,SDL_AudioFormat,ubyte,int);
|
||||||
|
alias pSDL_ConvertAudio = int function(SDL_AudioCVT*);
|
||||||
|
alias pSDL_MixAudio = void function(ubyte*,const(ubyte)*,uint,int);
|
||||||
|
alias pSDL_MixAudioFormat = void function(ubyte*,const(ubyte)*,SDL_AudioFormat,uint,int);
|
||||||
|
alias pSDL_LockAudio = void function();
|
||||||
|
alias pSDL_LockAudioDevice = void function(SDL_AudioDeviceID);
|
||||||
|
alias pSDL_UnlockAudio = void function();
|
||||||
|
alias pSDL_UnlockAudioDevice = void function(SDL_AudioDeviceID);
|
||||||
|
alias pSDL_CloseAudio = void function();
|
||||||
|
alias pSDL_CloseAudioDevice = void function(SDL_AudioDeviceID);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GetNumAudioDrivers SDL_GetNumAudioDrivers;
|
||||||
|
pSDL_GetAudioDriver SDL_GetAudioDriver;
|
||||||
|
pSDL_AudioInit SDL_AudioInit;
|
||||||
|
pSDL_AudioQuit SDL_AudioQuit;
|
||||||
|
pSDL_GetCurrentAudioDriver SDL_GetCurrentAudioDriver;
|
||||||
|
pSDL_OpenAudio SDL_OpenAudio;
|
||||||
|
pSDL_GetNumAudioDevices SDL_GetNumAudioDevices;
|
||||||
|
pSDL_GetAudioDeviceName SDL_GetAudioDeviceName;
|
||||||
|
pSDL_OpenAudioDevice SDL_OpenAudioDevice;
|
||||||
|
pSDL_GetAudioStatus SDL_GetAudioStatus;
|
||||||
|
pSDL_GetAudioDeviceStatus SDL_GetAudioDeviceStatus;
|
||||||
|
pSDL_PauseAudio SDL_PauseAudio;
|
||||||
|
pSDL_PauseAudioDevice SDL_PauseAudioDevice;
|
||||||
|
pSDL_LoadWAV_RW SDL_LoadWAV_RW;
|
||||||
|
pSDL_FreeWAV SDL_FreeWAV;
|
||||||
|
pSDL_BuildAudioCVT SDL_BuildAudioCVT;
|
||||||
|
pSDL_ConvertAudio SDL_ConvertAudio;
|
||||||
|
pSDL_MixAudio SDL_MixAudio;
|
||||||
|
pSDL_MixAudioFormat SDL_MixAudioFormat;
|
||||||
|
pSDL_LockAudio SDL_LockAudio;
|
||||||
|
pSDL_LockAudioDevice SDL_LockAudioDevice;
|
||||||
|
pSDL_UnlockAudio SDL_UnlockAudio;
|
||||||
|
pSDL_UnlockAudioDevice SDL_UnlockAudioDevice;
|
||||||
|
pSDL_CloseAudio SDL_CloseAudio;
|
||||||
|
pSDL_CloseAudioDevice SDL_CloseAudioDevice;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_ClearQueuedAudio = int function(SDL_AudioDeviceID);
|
||||||
|
alias pSDL_GetQueuedAudioSize = int function(SDL_AudioDeviceID);
|
||||||
|
alias pSDL_QueueAudio = int function(SDL_AudioDeviceID,const (void)*,uint);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_ClearQueuedAudio SDL_ClearQueuedAudio;
|
||||||
|
pSDL_GetQueuedAudioSize SDL_GetQueuedAudioSize;
|
||||||
|
pSDL_QueueAudio SDL_QueueAudio;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl205) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_DequeueAudio = uint function(SDL_AudioDeviceID,void*,uint);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_DequeueAudio SDL_DequeueAudio;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl207) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_NewAudioStream = SDL_AudioStream* function(const(SDL_AudioFormat),const(ubyte),const(int),const(SDL_AudioFormat),const(ubyte),const(int));
|
||||||
|
alias pSDL_AudioStreamPut = int function(SDL_AudioStream*,const(void)*,int);
|
||||||
|
alias pSDL_AudioStreamGet = int function(SDL_AudioStream*,void*,int);
|
||||||
|
alias pSDL_AudioStreamAvailable = int function(SDL_AudioStream*);
|
||||||
|
alias pSDL_AudioStreamFlush = int function(SDL_AudioStream*);
|
||||||
|
alias pSDL_AudioStreamClear = void function(SDL_AudioStream*);
|
||||||
|
alias pSDL_FreeAudioStream = void function(SDL_AudioStream*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_NewAudioStream SDL_NewAudioStream;
|
||||||
|
pSDL_AudioStreamPut SDL_AudioStreamPut;
|
||||||
|
pSDL_AudioStreamGet SDL_AudioStreamGet;
|
||||||
|
pSDL_AudioStreamAvailable SDL_AudioStreamAvailable;
|
||||||
|
pSDL_AudioStreamFlush SDL_AudioStreamFlush;
|
||||||
|
pSDL_AudioStreamClear SDL_AudioStreamClear;
|
||||||
|
pSDL_FreeAudioStream SDL_FreeAudioStream;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
71
demos/external/wasm_imports/bindbc/sdl/bind/sdlblendmode.d
vendored
Normal file
71
demos/external/wasm_imports/bindbc/sdl/bind/sdlblendmode.d
vendored
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlblendmode;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) {
|
||||||
|
enum SDL_BlendMode {
|
||||||
|
SDL_BLENDMODE_NONE = 0x00000000,
|
||||||
|
SDL_BLENDMODE_BLEND = 0x00000001,
|
||||||
|
SDL_BLENDMODE_ADD = 0x00000002,
|
||||||
|
SDL_BLENDMODE_MOD = 0x00000004,
|
||||||
|
SDL_BLENDMODE_INVALID = 0x7FFFFFFF,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_BlendMode);
|
||||||
|
|
||||||
|
enum SDL_BlendOperation {
|
||||||
|
SDL_BLENDOPERATION_ADD = 0x1,
|
||||||
|
SDL_BLENDOPERATION_SUBTRACT = 0x2,
|
||||||
|
SDL_BLENDOPERATION_REV_SUBTRACT = 0x3,
|
||||||
|
SDL_BLENDOPERATION_MINIMUM = 0x4,
|
||||||
|
SDL_BLENDOPERATION_MAXIMUM = 0x5,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_BlendOperation);
|
||||||
|
|
||||||
|
enum SDL_BlendFactor {
|
||||||
|
SDL_BLENDFACTOR_ZERO = 0x1,
|
||||||
|
SDL_BLENDFACTOR_ONE = 0x2,
|
||||||
|
SDL_BLENDFACTOR_SRC_COLOR = 0x3,
|
||||||
|
SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4,
|
||||||
|
SDL_BLENDFACTOR_SRC_ALPHA = 0x5,
|
||||||
|
SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6,
|
||||||
|
SDL_BLENDFACTOR_DST_COLOR = 0x7,
|
||||||
|
SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8,
|
||||||
|
SDL_BLENDFACTOR_DST_ALPHA = 0x9,
|
||||||
|
SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_BlendFactor);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
enum SDL_BlendMode {
|
||||||
|
SDL_BLENDMODE_NONE = 0x00000000,
|
||||||
|
SDL_BLENDMODE_BLEND = 0x00000001,
|
||||||
|
SDL_BLENDMODE_ADD = 0x00000002,
|
||||||
|
SDL_BLENDMODE_MOD = 0x00000004,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_BlendMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) {
|
||||||
|
SDL_BlendMode SDL_ComposeCustomBlendMode(SDL_BlendFactor,SDL_BlendFactor,SDL_BlendOperation,SDL_BlendFactor,SDL_BlendFactor,SDL_BlendOperation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_ComposeCustomBlendMode = SDL_BlendMode function(SDL_BlendFactor,SDL_BlendFactor,SDL_BlendOperation,SDL_BlendFactor,SDL_BlendFactor,SDL_BlendOperation);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_ComposeCustomBlendMode SDL_ComposeCustomBlendMode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
31
demos/external/wasm_imports/bindbc/sdl/bind/sdlclipboard.d
vendored
Normal file
31
demos/external/wasm_imports/bindbc/sdl/bind/sdlclipboard.d
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlclipboard;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
import bindbc.sdl.bind.sdlstdinc : SDL_bool;
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
int SDL_SetClipboardText(const(char)*);
|
||||||
|
char* SDL_GetClipboardText();
|
||||||
|
SDL_bool SDL_HasClipboardText();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_SetClipboardText = int function(const(char)*);
|
||||||
|
alias pSDL_GetClipboardText = char* function();
|
||||||
|
alias pSDL_HasClipboardText = SDL_bool function();
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_SetClipboardText SDL_SetClipboardText;
|
||||||
|
pSDL_GetClipboardText SDL_GetClipboardText;
|
||||||
|
pSDL_HasClipboardText SDL_HasClipboardText;
|
||||||
|
}
|
||||||
|
}
|
||||||
130
demos/external/wasm_imports/bindbc/sdl/bind/sdlcpuinfo.d
vendored
Normal file
130
demos/external/wasm_imports/bindbc/sdl/bind/sdlcpuinfo.d
vendored
Normal file
|
|
@ -0,0 +1,130 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlcpuinfo;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
import bindbc.sdl.bind.sdlstdinc : SDL_bool;
|
||||||
|
|
||||||
|
enum SDL_CACHELINE_SIZE = 128;
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
int SDL_GetCPUCount();
|
||||||
|
int SDL_GetCPUCacheLineSize();
|
||||||
|
SDL_bool SDL_HasRDTSC();
|
||||||
|
SDL_bool SDL_HasAltiVec();
|
||||||
|
SDL_bool SDL_HasMMX();
|
||||||
|
SDL_bool SDL_Has3DNow();
|
||||||
|
SDL_bool SDL_HasSSE();
|
||||||
|
SDL_bool SDL_HasSSE2();
|
||||||
|
SDL_bool SDL_HasSSE3();
|
||||||
|
SDL_bool SDL_HasSSE41();
|
||||||
|
SDL_bool SDL_HasSSE42();
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl201) {
|
||||||
|
int SDL_GetSystemRAM();
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl202) {
|
||||||
|
SDL_bool SDL_HasAVX();
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
SDL_bool SDL_HasAVX2();
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) {
|
||||||
|
SDL_bool SDL_HasNEON();
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
SDL_bool SDL_HasAVX512F();
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl2010) {
|
||||||
|
size_t SDL_SIMDGetAlignment();
|
||||||
|
void* SDL_SIMDAlloc(const(size_t));
|
||||||
|
void SDL_SIMDFree(void*);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GetCPUCount = int function();
|
||||||
|
alias pSDL_GetCPUCacheLineSize = int function();
|
||||||
|
alias pSDL_HasRDTSC = SDL_bool function();
|
||||||
|
alias pSDL_HasAltiVec = SDL_bool function();
|
||||||
|
alias pSDL_HasMMX = SDL_bool function();
|
||||||
|
alias pSDL_Has3DNow = SDL_bool function();
|
||||||
|
alias pSDL_HasSSE = SDL_bool function();
|
||||||
|
alias pSDL_HasSSE2 = SDL_bool function();
|
||||||
|
alias pSDL_HasSSE3 = SDL_bool function();
|
||||||
|
alias pSDL_HasSSE41 = SDL_bool function();
|
||||||
|
alias pSDL_HasSSE42 = SDL_bool function();
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GetCPUCount SDL_GetCPUCount;
|
||||||
|
pSDL_GetCPUCacheLineSize SDL_GetCPUCacheLineSize;
|
||||||
|
pSDL_HasRDTSC SDL_HasRDTSC;
|
||||||
|
pSDL_HasAltiVec SDL_HasAltiVec;
|
||||||
|
pSDL_HasMMX SDL_HasMMX;
|
||||||
|
pSDL_Has3DNow SDL_Has3DNow;
|
||||||
|
pSDL_HasSSE SDL_HasSSE;
|
||||||
|
pSDL_HasSSE2 SDL_HasSSE2;
|
||||||
|
pSDL_HasSSE3 SDL_HasSSE3;
|
||||||
|
pSDL_HasSSE41 SDL_HasSSE41;
|
||||||
|
pSDL_HasSSE42 SDL_HasSSE42;
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl201) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GetSystemRAM = int function();
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_GetSystemRAM SDL_GetSystemRAM;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl202) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_HasAVX = SDL_bool function();
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_HasAVX SDL_HasAVX;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_HasAVX2 = SDL_bool function();
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_HasAVX2 SDL_HasAVX2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_HasNEON = SDL_bool function();
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_HasNEON SDL_HasNEON;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_HasAVX512F = SDL_bool function();
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_HasAVX512F SDL_HasAVX512F;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl2010) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_SIMDGetAlignment = size_t function();
|
||||||
|
alias pSDL_SIMDAlloc = void* function(const(size_t));
|
||||||
|
alias pSDL_SIMDFree = void function(void*);
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_SIMDGetAlignment SDL_SIMDGetAlignment;
|
||||||
|
pSDL_SIMDAlloc SDL_SIMDAlloc;
|
||||||
|
pSDL_SIMDFree SDL_SIMDFree;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
28
demos/external/wasm_imports/bindbc/sdl/bind/sdlerror.d
vendored
Normal file
28
demos/external/wasm_imports/bindbc/sdl/bind/sdlerror.d
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlerror;
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
void SDL_SetError(const(char)*,...);
|
||||||
|
const(char)* SDL_GetError();
|
||||||
|
void SDL_ClearError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_SetError = void function(const(char)*,...);
|
||||||
|
alias pSDL_GetError = const(char)* function();
|
||||||
|
alias pSDL_ClearError = void function();
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_SetError SDL_SetError;
|
||||||
|
pSDL_GetError SDL_GetError;
|
||||||
|
pSDL_ClearError SDL_ClearError;
|
||||||
|
}
|
||||||
|
}
|
||||||
674
demos/external/wasm_imports/bindbc/sdl/bind/sdlevents.d
vendored
Normal file
674
demos/external/wasm_imports/bindbc/sdl/bind/sdlevents.d
vendored
Normal file
|
|
@ -0,0 +1,674 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlevents;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
|
||||||
|
import bindbc.sdl.bind.sdlgesture,
|
||||||
|
bindbc.sdl.bind.sdljoystick,
|
||||||
|
bindbc.sdl.bind.sdlkeyboard,
|
||||||
|
bindbc.sdl.bind.sdlkeycode,
|
||||||
|
bindbc.sdl.bind.sdlstdinc,
|
||||||
|
bindbc.sdl.bind.sdlsyswm,
|
||||||
|
bindbc.sdl.bind.sdltouch,
|
||||||
|
bindbc.sdl.bind.sdlvideo;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SDL_RELEASED = 0,
|
||||||
|
SDL_PRESSED = 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
enum SDL_EventType {
|
||||||
|
SDL_FIRSTEVENT = 0,
|
||||||
|
SDL_QUIT = 0x100,
|
||||||
|
SDL_APP_TERMINATING,
|
||||||
|
SDL_APP_LOWMEMORY,
|
||||||
|
SDL_APP_WILLENTERBACKGROUND,
|
||||||
|
SDL_APP_DIDENTERBACKGROUND,
|
||||||
|
SDL_APP_WILLENTERFOREGROUND,
|
||||||
|
SDL_APP_DIDENTERFOREGROUND,
|
||||||
|
SDL_DISPLAYEVENT = 0x150,
|
||||||
|
SDL_WINDOWEVENT = 0x200,
|
||||||
|
SDL_SYSWMEVENT,
|
||||||
|
SDL_KEYDOWN = 0x300,
|
||||||
|
SDL_KEYUP,
|
||||||
|
SDL_TEXTEDITING,
|
||||||
|
SDL_TEXTINPUT,
|
||||||
|
SDL_KEYMAPCHANGED,
|
||||||
|
SDL_MOUSEMOTION = 0x400,
|
||||||
|
SDL_MOUSEBUTTONDOWN,
|
||||||
|
SDL_MOUSEBUTTONUP,
|
||||||
|
SDL_MOUSEWHEEL,
|
||||||
|
SDL_JOYAXISMOTION = 0x600,
|
||||||
|
SDL_JOYBALLMOTION,
|
||||||
|
SDL_JOYHATMOTION,
|
||||||
|
SDL_JOYBUTTONDOWN,
|
||||||
|
SDL_JOYBUTTONUP,
|
||||||
|
SDL_JOYDEVICEADDED,
|
||||||
|
SDL_JOYDEVICEREMOVED,
|
||||||
|
SDL_CONTROLLERAXISMOTION = 0x650,
|
||||||
|
SDL_CONTROLLERBUTTONDOWN,
|
||||||
|
SDL_CONTROLLERBUTTONUP,
|
||||||
|
SDL_CONTROLLERDEVICEADDED,
|
||||||
|
SDL_CONTROLLERDEVICEREMOVED,
|
||||||
|
SDL_CONTROLLERDEVICEREMAPPED,
|
||||||
|
SDL_FINGERDOWN = 0x700,
|
||||||
|
SDL_FINGERUP,
|
||||||
|
SDL_FINGERMOTION,
|
||||||
|
SDL_DOLLARGESTURE = 0x800,
|
||||||
|
SDL_DOLLARRECORD,
|
||||||
|
SDL_MULTIGESTURE,
|
||||||
|
SDL_CLIPBOARDUPDATE = 0x900,
|
||||||
|
SDL_DROPFILE = 0x1000,
|
||||||
|
SDL_DROPTEXT,
|
||||||
|
SDL_DROPBEGIN,
|
||||||
|
SDL_DROPCOMPLETE,
|
||||||
|
SDL_AUDIODEVICEADDED = 0x1100,
|
||||||
|
SDL_AUDIODEVICEREMOVED,
|
||||||
|
SDL_SENSORUPDATE = 0x1200,
|
||||||
|
SDL_RENDER_TARGETS_RESET = 0x2000,
|
||||||
|
SDL_RENDER_DEVICE_RESET,
|
||||||
|
SDL_USEREVENT = 0x8000,
|
||||||
|
SDL_LASTEVENT = 0xFFFF
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else static if(sdlSupport >= SDLSupport.sdl205) {
|
||||||
|
enum SDL_EventType {
|
||||||
|
SDL_FIRSTEVENT = 0,
|
||||||
|
SDL_QUIT = 0x100,
|
||||||
|
SDL_APP_TERMINATING,
|
||||||
|
SDL_APP_LOWMEMORY,
|
||||||
|
SDL_APP_WILLENTERBACKGROUND,
|
||||||
|
SDL_APP_DIDENTERBACKGROUND,
|
||||||
|
SDL_APP_WILLENTERFOREGROUND,
|
||||||
|
SDL_APP_DIDENTERFOREGROUND,
|
||||||
|
SDL_WINDOWEVENT = 0x200,
|
||||||
|
SDL_SYSWMEVENT,
|
||||||
|
SDL_KEYDOWN = 0x300,
|
||||||
|
SDL_KEYUP,
|
||||||
|
SDL_TEXTEDITING,
|
||||||
|
SDL_TEXTINPUT,
|
||||||
|
SDL_KEYMAPCHANGED,
|
||||||
|
SDL_MOUSEMOTION = 0x400,
|
||||||
|
SDL_MOUSEBUTTONDOWN,
|
||||||
|
SDL_MOUSEBUTTONUP,
|
||||||
|
SDL_MOUSEWHEEL,
|
||||||
|
SDL_JOYAXISMOTION = 0x600,
|
||||||
|
SDL_JOYBALLMOTION,
|
||||||
|
SDL_JOYHATMOTION,
|
||||||
|
SDL_JOYBUTTONDOWN,
|
||||||
|
SDL_JOYBUTTONUP,
|
||||||
|
SDL_JOYDEVICEADDED,
|
||||||
|
SDL_JOYDEVICEREMOVED,
|
||||||
|
SDL_CONTROLLERAXISMOTION = 0x650,
|
||||||
|
SDL_CONTROLLERBUTTONDOWN,
|
||||||
|
SDL_CONTROLLERBUTTONUP,
|
||||||
|
SDL_CONTROLLERDEVICEADDED,
|
||||||
|
SDL_CONTROLLERDEVICEREMOVED,
|
||||||
|
SDL_CONTROLLERDEVICEREMAPPED,
|
||||||
|
SDL_FINGERDOWN = 0x700,
|
||||||
|
SDL_FINGERUP,
|
||||||
|
SDL_FINGERMOTION,
|
||||||
|
SDL_DOLLARGESTURE = 0x800,
|
||||||
|
SDL_DOLLARRECORD,
|
||||||
|
SDL_MULTIGESTURE,
|
||||||
|
SDL_CLIPBOARDUPDATE = 0x900,
|
||||||
|
SDL_DROPFILE = 0x1000,
|
||||||
|
SDL_DROPTEXT,
|
||||||
|
SDL_DROPBEGIN,
|
||||||
|
SDL_DROPCOMPLETE,
|
||||||
|
SDL_AUDIODEVICEADDED = 0x1100,
|
||||||
|
SDL_AUDIODEVICEREMOVED,
|
||||||
|
SDL_RENDER_TARGETS_RESET = 0x2000,
|
||||||
|
SDL_RENDER_DEVICE_RESET,
|
||||||
|
SDL_USEREVENT = 0x8000,
|
||||||
|
SDL_LASTEVENT = 0xFFFF
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
enum SDL_EventType {
|
||||||
|
SDL_FIRSTEVENT = 0,
|
||||||
|
SDL_QUIT = 0x100,
|
||||||
|
SDL_APP_TERMINATING,
|
||||||
|
SDL_APP_LOWMEMORY,
|
||||||
|
SDL_APP_WILLENTERBACKGROUND,
|
||||||
|
SDL_APP_DIDENTERBACKGROUND,
|
||||||
|
SDL_APP_WILLENTERFOREGROUND,
|
||||||
|
SDL_APP_DIDENTERFOREGROUND,
|
||||||
|
SDL_WINDOWEVENT = 0x200,
|
||||||
|
SDL_SYSWMEVENT,
|
||||||
|
SDL_KEYDOWN = 0x300,
|
||||||
|
SDL_KEYUP,
|
||||||
|
SDL_TEXTEDITING,
|
||||||
|
SDL_TEXTINPUT,
|
||||||
|
SDL_KEYMAPCHANGED,
|
||||||
|
SDL_MOUSEMOTION = 0x400,
|
||||||
|
SDL_MOUSEBUTTONDOWN,
|
||||||
|
SDL_MOUSEBUTTONUP,
|
||||||
|
SDL_MOUSEWHEEL,
|
||||||
|
SDL_JOYAXISMOTION = 0x600,
|
||||||
|
SDL_JOYBALLMOTION,
|
||||||
|
SDL_JOYHATMOTION,
|
||||||
|
SDL_JOYBUTTONDOWN,
|
||||||
|
SDL_JOYBUTTONUP,
|
||||||
|
SDL_JOYDEVICEADDED,
|
||||||
|
SDL_JOYDEVICEREMOVED,
|
||||||
|
SDL_CONTROLLERAXISMOTION = 0x650,
|
||||||
|
SDL_CONTROLLERBUTTONDOWN,
|
||||||
|
SDL_CONTROLLERBUTTONUP,
|
||||||
|
SDL_CONTROLLERDEVICEADDED,
|
||||||
|
SDL_CONTROLLERDEVICEREMOVED,
|
||||||
|
SDL_CONTROLLERDEVICEREMAPPED,
|
||||||
|
SDL_FINGERDOWN = 0x700,
|
||||||
|
SDL_FINGERUP,
|
||||||
|
SDL_FINGERMOTION,
|
||||||
|
SDL_DOLLARGESTURE = 0x800,
|
||||||
|
SDL_DOLLARRECORD,
|
||||||
|
SDL_MULTIGESTURE,
|
||||||
|
SDL_CLIPBOARDUPDATE = 0x900,
|
||||||
|
SDL_DROPFILE = 0x1000,
|
||||||
|
SDL_AUDIODEVICEADDED = 0x1100,
|
||||||
|
SDL_AUDIODEVICEREMOVED,
|
||||||
|
SDL_RENDER_TARGETS_RESET = 0x2000,
|
||||||
|
SDL_RENDER_DEVICE_RESET,
|
||||||
|
SDL_USEREVENT = 0x8000,
|
||||||
|
SDL_LASTEVENT = 0xFFFF
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else static if(sdlSupport >= SDLSupport.sdl201) {
|
||||||
|
enum SDL_EventType {
|
||||||
|
SDL_FIRSTEVENT = 0,
|
||||||
|
SDL_QUIT = 0x100,
|
||||||
|
SDL_APP_TERMINATING,
|
||||||
|
SDL_APP_LOWMEMORY,
|
||||||
|
SDL_APP_WILLENTERBACKGROUND,
|
||||||
|
SDL_APP_DIDENTERBACKGROUND,
|
||||||
|
SDL_APP_WILLENTERFOREGROUND,
|
||||||
|
SDL_APP_DIDENTERFOREGROUND,
|
||||||
|
SDL_WINDOWEVENT = 0x200,
|
||||||
|
SDL_SYSWMEVENT,
|
||||||
|
SDL_KEYDOWN = 0x300,
|
||||||
|
SDL_KEYUP,
|
||||||
|
SDL_TEXTEDITING,
|
||||||
|
SDL_TEXTINPUT,
|
||||||
|
SDL_MOUSEMOTION = 0x400,
|
||||||
|
SDL_MOUSEBUTTONDOWN,
|
||||||
|
SDL_MOUSEBUTTONUP,
|
||||||
|
SDL_MOUSEWHEEL,
|
||||||
|
SDL_JOYAXISMOTION = 0x600,
|
||||||
|
SDL_JOYBALLMOTION,
|
||||||
|
SDL_JOYHATMOTION,
|
||||||
|
SDL_JOYBUTTONDOWN,
|
||||||
|
SDL_JOYBUTTONUP,
|
||||||
|
SDL_JOYDEVICEADDED,
|
||||||
|
SDL_JOYDEVICEREMOVED,
|
||||||
|
SDL_CONTROLLERAXISMOTION = 0x650,
|
||||||
|
SDL_CONTROLLERBUTTONDOWN,
|
||||||
|
SDL_CONTROLLERBUTTONUP,
|
||||||
|
SDL_CONTROLLERDEVICEADDED,
|
||||||
|
SDL_CONTROLLERDEVICEREMOVED,
|
||||||
|
SDL_CONTROLLERDEVICEREMAPPED,
|
||||||
|
SDL_FINGERDOWN = 0x700,
|
||||||
|
SDL_FINGERUP,
|
||||||
|
SDL_FINGERMOTION,
|
||||||
|
SDL_DOLLARGESTURE = 0x800,
|
||||||
|
SDL_DOLLARRECORD,
|
||||||
|
SDL_MULTIGESTURE,
|
||||||
|
SDL_CLIPBOARDUPDATE = 0x900,
|
||||||
|
SDL_DROPFILE = 0x1000,
|
||||||
|
SDL_RENDER_TARGETS_RESET = 0x2000,
|
||||||
|
SDL_USEREVENT = 0x8000,
|
||||||
|
SDL_LASTEVENT = 0xFFFF
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
enum SDL_EventType {
|
||||||
|
SDL_FIRSTEVENT = 0,
|
||||||
|
SDL_QUIT = 0x100,
|
||||||
|
SDL_APP_TERMINATING,
|
||||||
|
SDL_APP_LOWMEMORY,
|
||||||
|
SDL_APP_WILLENTERBACKGROUND,
|
||||||
|
SDL_APP_DIDENTERBACKGROUND,
|
||||||
|
SDL_APP_WILLENTERFOREGROUND,
|
||||||
|
SDL_APP_DIDENTERFOREGROUND,
|
||||||
|
SDL_WINDOWEVENT = 0x200,
|
||||||
|
SDL_SYSWMEVENT,
|
||||||
|
SDL_KEYDOWN = 0x300,
|
||||||
|
SDL_KEYUP,
|
||||||
|
SDL_TEXTEDITING,
|
||||||
|
SDL_TEXTINPUT,
|
||||||
|
SDL_MOUSEMOTION = 0x400,
|
||||||
|
SDL_MOUSEBUTTONDOWN,
|
||||||
|
SDL_MOUSEBUTTONUP,
|
||||||
|
SDL_MOUSEWHEEL,
|
||||||
|
SDL_JOYAXISMOTION = 0x600,
|
||||||
|
SDL_JOYBALLMOTION,
|
||||||
|
SDL_JOYHATMOTION,
|
||||||
|
SDL_JOYBUTTONDOWN,
|
||||||
|
SDL_JOYBUTTONUP,
|
||||||
|
SDL_JOYDEVICEADDED,
|
||||||
|
SDL_JOYDEVICEREMOVED,
|
||||||
|
SDL_CONTROLLERAXISMOTION = 0x650,
|
||||||
|
SDL_CONTROLLERBUTTONDOWN,
|
||||||
|
SDL_CONTROLLERBUTTONUP,
|
||||||
|
SDL_CONTROLLERDEVICEADDED,
|
||||||
|
SDL_CONTROLLERDEVICEREMOVED,
|
||||||
|
SDL_CONTROLLERDEVICEREMAPPED,
|
||||||
|
SDL_FINGERDOWN = 0x700,
|
||||||
|
SDL_FINGERUP,
|
||||||
|
SDL_FINGERMOTION,
|
||||||
|
SDL_DOLLARGESTURE = 0x800,
|
||||||
|
SDL_DOLLARRECORD,
|
||||||
|
SDL_MULTIGESTURE,
|
||||||
|
SDL_CLIPBOARDUPDATE = 0x900,
|
||||||
|
SDL_DROPFILE = 0x1000,
|
||||||
|
SDL_USEREVENT = 0x8000,
|
||||||
|
SDL_LASTEVENT = 0xFFFF
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_EventType);
|
||||||
|
|
||||||
|
struct SDL_CommonEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
struct SDL_DisplayEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
uint display;
|
||||||
|
ubyte event;
|
||||||
|
ubyte padding1;
|
||||||
|
ubyte padding2;
|
||||||
|
ubyte padding3;
|
||||||
|
int data1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_WindowEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
uint windowID;
|
||||||
|
SDL_WindowEventID event;
|
||||||
|
ubyte padding1;
|
||||||
|
ubyte padding2;
|
||||||
|
ubyte padding3;
|
||||||
|
int data1;
|
||||||
|
int data2;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_KeyboardEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
uint windowID;
|
||||||
|
ubyte state;
|
||||||
|
ubyte repeat;
|
||||||
|
ubyte padding2;
|
||||||
|
ubyte padding3;
|
||||||
|
SDL_Keysym keysym;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SDL_TEXTEDITINGEVENT_TEXT_SIZE = 32;
|
||||||
|
struct SDL_TextEditingEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
uint windowID;
|
||||||
|
char[SDL_TEXTEDITINGEVENT_TEXT_SIZE] text;
|
||||||
|
int start;
|
||||||
|
int length;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SDL_TEXTINPUTEVENT_TEXT_SIZE = 32;
|
||||||
|
struct SDL_TextInputEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
uint windowID;
|
||||||
|
char[SDL_TEXTINPUTEVENT_TEXT_SIZE] text;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_MouseMotionEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
uint windowID;
|
||||||
|
uint which;
|
||||||
|
uint state;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int xrel;
|
||||||
|
int yrel;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_MouseButtonEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
uint windowID;
|
||||||
|
uint which;
|
||||||
|
ubyte button;
|
||||||
|
ubyte state;
|
||||||
|
static if(sdlSupport == SDLSupport.sdl200) {
|
||||||
|
ubyte padding1;
|
||||||
|
ubyte padding2;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ubyte clicks;
|
||||||
|
ubyte padding1;
|
||||||
|
}
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_MouseWheelEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
uint windowID;
|
||||||
|
uint which;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
uint direction;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_JoyAxisEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
SDL_JoystickID which;
|
||||||
|
ubyte axis;
|
||||||
|
ubyte padding1;
|
||||||
|
ubyte padding2;
|
||||||
|
ubyte padding3;
|
||||||
|
short value;
|
||||||
|
ushort padding4;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_JoyBallEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
SDL_JoystickID which;
|
||||||
|
ubyte ball;
|
||||||
|
ubyte padding1;
|
||||||
|
ubyte padding2;
|
||||||
|
ubyte padding3;
|
||||||
|
short xrel;
|
||||||
|
short yrel;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_JoyHatEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
SDL_JoystickID which;
|
||||||
|
ubyte hat;
|
||||||
|
ubyte value;
|
||||||
|
ubyte padding1;
|
||||||
|
ubyte padding2;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_JoyButtonEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
SDL_JoystickID which;
|
||||||
|
ubyte button;
|
||||||
|
ubyte state;
|
||||||
|
ubyte padding1;
|
||||||
|
ubyte padding2;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_JoyDeviceEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
int which;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_ControllerAxisEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
SDL_JoystickID which;
|
||||||
|
ubyte axis;
|
||||||
|
ubyte padding1;
|
||||||
|
ubyte padding2;
|
||||||
|
ubyte padding3;
|
||||||
|
short value;
|
||||||
|
ushort padding4;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_ControllerButtonEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
SDL_JoystickID which;
|
||||||
|
ubyte button;
|
||||||
|
ubyte state;
|
||||||
|
ubyte padding1;
|
||||||
|
ubyte padding2;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_ControllerDeviceEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
int which;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
struct SDL_AudioDeviceEvent {
|
||||||
|
uint type;
|
||||||
|
uint timestamp;
|
||||||
|
uint which;
|
||||||
|
ubyte iscapture;
|
||||||
|
ubyte padding1;
|
||||||
|
ubyte padding2;
|
||||||
|
ubyte padding3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_TouchFingerEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
SDL_TouchID touchId;
|
||||||
|
SDL_FingerID fingerId;
|
||||||
|
float x;
|
||||||
|
float y;
|
||||||
|
float dx;
|
||||||
|
float dy;
|
||||||
|
float pressure;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_MultiGestureEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
SDL_TouchID touchId;
|
||||||
|
float dTheta;
|
||||||
|
float dDist;
|
||||||
|
float x;
|
||||||
|
float y;
|
||||||
|
ushort numFingers;
|
||||||
|
ushort padding;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_DollarGestureEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
SDL_TouchID touchId;
|
||||||
|
SDL_GestureID gestureId;
|
||||||
|
uint numFingers;
|
||||||
|
float error;
|
||||||
|
float x;
|
||||||
|
float y;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_DropEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
char* file;
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl205) {
|
||||||
|
uint windowID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_SensorEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
int which;
|
||||||
|
float[6] data;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_QuitEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_OSEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_UserEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
uint windowID;
|
||||||
|
int code;
|
||||||
|
void* data1;
|
||||||
|
void* data2;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_SysWMEvent {
|
||||||
|
SDL_EventType type;
|
||||||
|
uint timestamp;
|
||||||
|
SDL_SysWMmsg* msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
union SDL_Event {
|
||||||
|
SDL_EventType type;
|
||||||
|
SDL_CommonEvent common;
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
SDL_DisplayEvent display;
|
||||||
|
}
|
||||||
|
SDL_WindowEvent window;
|
||||||
|
SDL_KeyboardEvent key;
|
||||||
|
SDL_TextEditingEvent edit;
|
||||||
|
SDL_TextInputEvent text;
|
||||||
|
SDL_MouseMotionEvent motion;
|
||||||
|
SDL_MouseButtonEvent button;
|
||||||
|
SDL_MouseWheelEvent wheel;
|
||||||
|
SDL_JoyAxisEvent jaxis;
|
||||||
|
SDL_JoyBallEvent jball;
|
||||||
|
SDL_JoyHatEvent jhat;
|
||||||
|
SDL_JoyButtonEvent jbutton;
|
||||||
|
SDL_JoyDeviceEvent jdevice;
|
||||||
|
SDL_ControllerAxisEvent caxis;
|
||||||
|
SDL_ControllerButtonEvent cbutton;
|
||||||
|
SDL_ControllerDeviceEvent cdevice;
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
SDL_AudioDeviceEvent adevice;
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
SDL_SensorEvent sensor;
|
||||||
|
}
|
||||||
|
SDL_QuitEvent quit;
|
||||||
|
SDL_UserEvent user;
|
||||||
|
SDL_SysWMEvent syswm;
|
||||||
|
SDL_TouchFingerEvent tfinger;
|
||||||
|
SDL_MultiGestureEvent mgesture;
|
||||||
|
SDL_DollarGestureEvent dgesture;
|
||||||
|
SDL_DropEvent drop;
|
||||||
|
|
||||||
|
ubyte[56] padding;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SDL_eventaction {
|
||||||
|
SDL_ADDEVENT,
|
||||||
|
SDL_PEEKEVENT,
|
||||||
|
SDL_GETEVENT
|
||||||
|
}
|
||||||
|
alias SDL_EventAction = SDL_eventaction;
|
||||||
|
mixin(expandEnum!SDL_EventAction);
|
||||||
|
|
||||||
|
extern(C) nothrow alias SDL_EventFilter = int function(void* userdata, SDL_Event* event);
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SDL_QUERY = -1,
|
||||||
|
SDL_IGNORE = 0,
|
||||||
|
SDL_DISABLE = 0,
|
||||||
|
SDL_ENABLE = 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
@nogc nothrow {
|
||||||
|
int SDL_GetEventState(SDL_EventType type) {
|
||||||
|
pragma(inline, true);
|
||||||
|
return SDL_EventState(type, SDL_QUERY);
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is implemented in SDL_quit.h, but works better here.
|
||||||
|
bool SDL_QuitRequested() {
|
||||||
|
pragma(inline, true);
|
||||||
|
SDL_PumpEvents();
|
||||||
|
return SDL_PeepEvents(null,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
void SDL_PumpEvents();
|
||||||
|
int SDL_PeepEvents(SDL_Event*,int,SDL_eventaction,uint,uint);
|
||||||
|
SDL_bool SDL_HasEvent(uint);
|
||||||
|
SDL_bool SDL_HasEvents(uint,uint);
|
||||||
|
void SDL_FlushEvent(uint);
|
||||||
|
void SDL_FlushEvents(uint,uint);
|
||||||
|
int SDL_PollEvent(SDL_Event*);
|
||||||
|
int SDL_WaitEvent(SDL_Event*);
|
||||||
|
int SDL_WaitEventTimeout(SDL_Event*,int);
|
||||||
|
int SDL_PushEvent(SDL_Event*);
|
||||||
|
void SDL_SetEventFilter(SDL_EventFilter,void*);
|
||||||
|
SDL_bool SDL_GetEventFilter(SDL_EventFilter*,void**);
|
||||||
|
void SDL_AddEventWatch(SDL_EventFilter,void*);
|
||||||
|
void SDL_DelEventWatch(SDL_EventFilter,void*);
|
||||||
|
void SDL_FilterEvents(SDL_EventFilter,void*);
|
||||||
|
ubyte SDL_EventState(uint,int);
|
||||||
|
uint SDL_RegisterEvents(int);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_PumpEvents = void function();
|
||||||
|
alias pSDL_PeepEvents = int function(SDL_Event*,int,SDL_eventaction,uint,uint);
|
||||||
|
alias pSDL_HasEvent = SDL_bool function(uint);
|
||||||
|
alias pSDL_HasEvents = SDL_bool function(uint,uint);
|
||||||
|
alias pSDL_FlushEvent = void function(uint);
|
||||||
|
alias pSDL_FlushEvents = void function(uint,uint);
|
||||||
|
alias pSDL_PollEvent = int function(SDL_Event*);
|
||||||
|
alias pSDL_WaitEvent = int function(SDL_Event*);
|
||||||
|
alias pSDL_WaitEventTimeout = int function(SDL_Event*,int);
|
||||||
|
alias pSDL_PushEvent = int function(SDL_Event*);
|
||||||
|
alias pSDL_SetEventFilter = void function(SDL_EventFilter,void*);
|
||||||
|
alias pSDL_GetEventFilter = SDL_bool function(SDL_EventFilter*,void**);
|
||||||
|
alias pSDL_AddEventWatch = void function(SDL_EventFilter,void*);
|
||||||
|
alias pSDL_DelEventWatch = void function(SDL_EventFilter,void*);
|
||||||
|
alias pSDL_FilterEvents = void function(SDL_EventFilter,void*);
|
||||||
|
alias pSDL_EventState = ubyte function(uint,int);
|
||||||
|
alias pSDL_RegisterEvents = uint function(int);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_PumpEvents SDL_PumpEvents;
|
||||||
|
pSDL_PeepEvents SDL_PeepEvents;
|
||||||
|
pSDL_HasEvent SDL_HasEvent;
|
||||||
|
pSDL_HasEvents SDL_HasEvents;
|
||||||
|
pSDL_FlushEvent SDL_FlushEvent;
|
||||||
|
pSDL_FlushEvents SDL_FlushEvents;
|
||||||
|
pSDL_PollEvent SDL_PollEvent;
|
||||||
|
pSDL_WaitEvent SDL_WaitEvent;
|
||||||
|
pSDL_WaitEventTimeout SDL_WaitEventTimeout;
|
||||||
|
pSDL_PushEvent SDL_PushEvent;
|
||||||
|
pSDL_SetEventFilter SDL_SetEventFilter;
|
||||||
|
pSDL_GetEventFilter SDL_GetEventFilter;
|
||||||
|
pSDL_AddEventWatch SDL_AddEventWatch;
|
||||||
|
pSDL_DelEventWatch SDL_DelEventWatch;
|
||||||
|
pSDL_FilterEvents SDL_FilterEvents;
|
||||||
|
pSDL_EventState SDL_EventState;
|
||||||
|
pSDL_RegisterEvents SDL_RegisterEvents;
|
||||||
|
}
|
||||||
|
}
|
||||||
31
demos/external/wasm_imports/bindbc/sdl/bind/sdlfilesystem.d
vendored
Normal file
31
demos/external/wasm_imports/bindbc/sdl/bind/sdlfilesystem.d
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlfilesystem;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
|
||||||
|
version(BindSDL_Static){
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl201) {
|
||||||
|
char* SDL_GetBasePath();
|
||||||
|
char* SDL_GetPrefPath(const(char)* org,const(char)* app);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl201) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GetBasePath = char* function();
|
||||||
|
alias pSDL_GetPrefPath = char* function(const(char)* org,const(char)* app);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GetBasePath SDL_GetBasePath;
|
||||||
|
pSDL_GetPrefPath SDL_GetPrefPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
225
demos/external/wasm_imports/bindbc/sdl/bind/sdlgamecontroller.d
vendored
Normal file
225
demos/external/wasm_imports/bindbc/sdl/bind/sdlgamecontroller.d
vendored
Normal file
|
|
@ -0,0 +1,225 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlgamecontroller;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
|
||||||
|
import bindbc.sdl.bind.sdljoystick,
|
||||||
|
bindbc.sdl.bind.sdlrwops;
|
||||||
|
import bindbc.sdl.bind.sdlstdinc : SDL_bool;
|
||||||
|
|
||||||
|
struct SDL_GameController;
|
||||||
|
|
||||||
|
enum SDL_GameControllerBindType {
|
||||||
|
SDL_CONTROLLER_BINDTYPE_NONE = 0,
|
||||||
|
SDL_CONTROLLER_BINDTYPE_BUTTON,
|
||||||
|
SDL_CONTROLLER_BINDTYPE_AXIS,
|
||||||
|
SDL_CONTROLLER_BINDTYPE_HAT,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_GameControllerBindType);
|
||||||
|
|
||||||
|
struct SDL_GameControllerButtonBind {
|
||||||
|
SDL_GameControllerBindType bindType;
|
||||||
|
union value {
|
||||||
|
int button;
|
||||||
|
int axis;
|
||||||
|
struct hat {
|
||||||
|
int hat;
|
||||||
|
int hat_mask;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
alias button = value.button;
|
||||||
|
alias axis = value.axis;
|
||||||
|
alias hat = value.hat;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SDL_GameControllerAxis {
|
||||||
|
SDL_CONTROLLER_AXIS_INVALID = -1,
|
||||||
|
SDL_CONTROLLER_AXIS_LEFTX,
|
||||||
|
SDL_CONTROLLER_AXIS_LEFTY,
|
||||||
|
SDL_CONTROLLER_AXIS_RIGHTX,
|
||||||
|
SDL_CONTROLLER_AXIS_RIGHTY,
|
||||||
|
SDL_CONTROLLER_AXIS_TRIGGERLEFT,
|
||||||
|
SDL_CONTROLLER_AXIS_TRIGGERRIGHT,
|
||||||
|
SDL_CONTROLLER_AXIS_MAX
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_GameControllerAxis);
|
||||||
|
|
||||||
|
enum SDL_GameControllerButton {
|
||||||
|
SDL_CONTROLLER_BUTTON_INVALID = -1,
|
||||||
|
SDL_CONTROLLER_BUTTON_A,
|
||||||
|
SDL_CONTROLLER_BUTTON_B,
|
||||||
|
SDL_CONTROLLER_BUTTON_X,
|
||||||
|
SDL_CONTROLLER_BUTTON_Y,
|
||||||
|
SDL_CONTROLLER_BUTTON_BACK,
|
||||||
|
SDL_CONTROLLER_BUTTON_GUIDE,
|
||||||
|
SDL_CONTROLLER_BUTTON_START,
|
||||||
|
SDL_CONTROLLER_BUTTON_LEFTSTICK,
|
||||||
|
SDL_CONTROLLER_BUTTON_RIGHTSTICK,
|
||||||
|
SDL_CONTROLLER_BUTTON_LEFTSHOULDER,
|
||||||
|
SDL_CONTROLLER_BUTTON_RIGHTSHOULDER,
|
||||||
|
SDL_CONTROLLER_BUTTON_DPAD_UP,
|
||||||
|
SDL_CONTROLLER_BUTTON_DPAD_DOWN,
|
||||||
|
SDL_CONTROLLER_BUTTON_DPAD_LEFT,
|
||||||
|
SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
|
||||||
|
SDL_CONTROLLER_BUTTON_MAX
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_GameControllerButton);
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl202) {
|
||||||
|
@nogc nothrow
|
||||||
|
int SDL_GameControllerAddMappingsFromFile(const(char)* file) {
|
||||||
|
pragma(inline, true);
|
||||||
|
return SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file,"rb"),1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
int SDL_GameControllerAddMapping(const(char)*);
|
||||||
|
char* SDL_GameControllerMappingForGUID(SDL_JoystickGUID);
|
||||||
|
char* SDL_GameControllerMapping(SDL_GameController*);
|
||||||
|
SDL_bool SDL_IsGameController(int);
|
||||||
|
const(char)* SDL_GameControllerNameForIndex(int);
|
||||||
|
SDL_GameController* SDL_GameControllerOpen(int);
|
||||||
|
const(char)* SDL_GameControllerName(SDL_GameController*);
|
||||||
|
SDL_bool SDL_GameControllerGetAttached(SDL_GameController*);
|
||||||
|
SDL_Joystick* SDL_GameControllerGetJoystick(SDL_GameController*);
|
||||||
|
int SDL_GameControllerEventState(int);
|
||||||
|
void SDL_GameControllerUpdate();
|
||||||
|
SDL_GameControllerAxis SDL_GameControllerGetAxisFromString(const(char)*);
|
||||||
|
const(char)* SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis);
|
||||||
|
SDL_GameControllerButtonBind SDL_GameControllerGetBindForAxis(SDL_GameController*,SDL_GameControllerAxis);
|
||||||
|
short SDL_GameControllerGetAxis(SDL_GameController*,SDL_GameControllerAxis);
|
||||||
|
SDL_GameControllerButton SDL_GameControllerGetButtonFromString(const(char*));
|
||||||
|
const(char)* SDL_GameControllerGetStringForButton(SDL_GameControllerButton);
|
||||||
|
SDL_GameControllerButtonBind SDL_GameControllerGetBindForButton(SDL_GameController*,SDL_GameControllerButton);
|
||||||
|
ubyte SDL_GameControllerGetButton(SDL_GameController*,SDL_GameControllerButton);
|
||||||
|
void SDL_GameControllerClose(SDL_GameController*);
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl202) {
|
||||||
|
int SDL_GameControllerAddMappingsFromRW(SDL_RWops*,int);
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
SDL_GameController* SDL_GameControllerFromInstanceID(SDL_JoystickID);
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) {
|
||||||
|
ushort SDL_GameControllerGetProduct(SDL_GameController*);
|
||||||
|
ushort SDL_GameControllerGetProductVersion(SDL_GameController*);
|
||||||
|
ushort SDL_GameControllerGetVendor(SDL_GameController*);
|
||||||
|
char* SDL_GameControllerMappingForIndex(int);
|
||||||
|
int SDL_GameControllerNumMappings();
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
char* SDL_GameControllerMappingForDeviceIndex(int);
|
||||||
|
int SDL_GameControllerRumble(SDL_GameController*,ushort,ushort,uint);
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl2010) {
|
||||||
|
int SDL_GameControllerGetPlayerIndex(SDL_GameController*);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GameControllerAddMapping = int function(const(char)*);
|
||||||
|
alias pSDL_GameControllerMappingForGUID = char* function(SDL_JoystickGUID);
|
||||||
|
alias pSDL_GameControllerMapping = char* function(SDL_GameController*);
|
||||||
|
alias pSDL_IsGameController = SDL_bool function(int);
|
||||||
|
alias pSDL_GameControllerNameForIndex = const(char)* function(int);
|
||||||
|
alias pSDL_GameControllerOpen = SDL_GameController* function(int);
|
||||||
|
alias pSDL_GameControllerName = const(char)* function(SDL_GameController*);
|
||||||
|
alias pSDL_GameControllerGetAttached = SDL_bool function(SDL_GameController*);
|
||||||
|
alias pSDL_GameControllerGetJoystick = SDL_Joystick* function(SDL_GameController*);
|
||||||
|
alias pSDL_GameControllerEventState = int function(int);
|
||||||
|
alias pSDL_GameControllerUpdate = void function();
|
||||||
|
alias pSDL_GameControllerGetAxisFromString = SDL_GameControllerAxis function(const(char)*);
|
||||||
|
alias pSDL_GameControllerGetStringForAxis = const(char)* function(SDL_GameControllerAxis);
|
||||||
|
alias pSDL_GameControllerGetBindForAxis = SDL_GameControllerButtonBind function(SDL_GameController*,SDL_GameControllerAxis);
|
||||||
|
alias pSDL_GameControllerGetAxis = short function(SDL_GameController*,SDL_GameControllerAxis);
|
||||||
|
alias pSDL_GameControllerGetButtonFromString = SDL_GameControllerButton function(const(char*));
|
||||||
|
alias pSDL_GameControllerGetStringForButton = const(char)* function(SDL_GameControllerButton);
|
||||||
|
alias pSDL_GameControllerGetBindForButton = SDL_GameControllerButtonBind function(SDL_GameController*,SDL_GameControllerButton);
|
||||||
|
alias pSDL_GameControllerGetButton = ubyte function(SDL_GameController*,SDL_GameControllerButton);
|
||||||
|
alias pSDL_GameControllerClose = void function(SDL_GameController*);
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_GameControllerAddMapping SDL_GameControllerAddMapping;
|
||||||
|
pSDL_GameControllerMappingForGUID SDL_GameControllerMappingForGUID;
|
||||||
|
pSDL_GameControllerMapping SDL_GameControllerMapping;
|
||||||
|
pSDL_IsGameController SDL_IsGameController;
|
||||||
|
pSDL_GameControllerNameForIndex SDL_GameControllerNameForIndex;
|
||||||
|
pSDL_GameControllerOpen SDL_GameControllerOpen;
|
||||||
|
pSDL_GameControllerName SDL_GameControllerName;
|
||||||
|
pSDL_GameControllerGetAttached SDL_GameControllerGetAttached;
|
||||||
|
pSDL_GameControllerGetJoystick SDL_GameControllerGetJoystick;
|
||||||
|
pSDL_GameControllerEventState SDL_GameControllerEventState;
|
||||||
|
pSDL_GameControllerUpdate SDL_GameControllerUpdate;
|
||||||
|
pSDL_GameControllerGetAxisFromString SDL_GameControllerGetAxisFromString;
|
||||||
|
pSDL_GameControllerGetStringForAxis SDL_GameControllerGetStringForAxis;
|
||||||
|
pSDL_GameControllerGetBindForAxis SDL_GameControllerGetBindForAxis;
|
||||||
|
pSDL_GameControllerGetAxis SDL_GameControllerGetAxis;
|
||||||
|
pSDL_GameControllerGetButtonFromString SDL_GameControllerGetButtonFromString;
|
||||||
|
pSDL_GameControllerGetStringForButton SDL_GameControllerGetStringForButton;
|
||||||
|
pSDL_GameControllerGetBindForButton SDL_GameControllerGetBindForButton;
|
||||||
|
pSDL_GameControllerGetButton SDL_GameControllerGetButton;
|
||||||
|
pSDL_GameControllerClose SDL_GameControllerClose;
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl202) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GameControllerAddMappingsFromRW = int function(SDL_RWops*,int);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GameControllerAddMappingsFromRW SDL_GameControllerAddMappingsFromRW;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GameControllerFromInstanceID = SDL_GameController* function(SDL_JoystickID);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GameControllerFromInstanceID SDL_GameControllerFromInstanceID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GameControllerGetProduct = ushort function(SDL_GameController*);
|
||||||
|
alias pSDL_GameControllerGetProductVersion = ushort function(SDL_GameController*);
|
||||||
|
alias pSDL_GameControllerGetVendor = ushort function(SDL_GameController*);
|
||||||
|
alias pSDL_GameControllerMappingForIndex = char* function(int);
|
||||||
|
alias pSDL_GameControllerNumMappings = int function();
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GameControllerGetProduct SDL_GameControllerGetProduct;
|
||||||
|
pSDL_GameControllerGetProductVersion SDL_GameControllerGetProductVersion;
|
||||||
|
pSDL_GameControllerGetVendor SDL_GameControllerGetVendor;
|
||||||
|
pSDL_GameControllerMappingForIndex SDL_GameControllerMappingForIndex;
|
||||||
|
pSDL_GameControllerNumMappings SDL_GameControllerNumMappings;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GameControllerMappingForDeviceIndex = char* function(int);
|
||||||
|
alias pSDL_GameControllerRumble = int function(SDL_GameController*,ushort,ushort,uint);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GameControllerMappingForDeviceIndex SDL_GameControllerMappingForDeviceIndex;
|
||||||
|
pSDL_GameControllerRumble SDL_GameControllerRumble;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl2010) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GameControllerGetPlayerIndex = int function(SDL_GameController*);
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_GameControllerGetPlayerIndex SDL_GameControllerGetPlayerIndex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
36
demos/external/wasm_imports/bindbc/sdl/bind/sdlgesture.d
vendored
Normal file
36
demos/external/wasm_imports/bindbc/sdl/bind/sdlgesture.d
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlgesture;
|
||||||
|
|
||||||
|
import bindbc.sdl.bind.sdltouch : SDL_TouchID;
|
||||||
|
import bindbc.sdl.bind.sdlrwops : SDL_RWops;
|
||||||
|
|
||||||
|
alias SDL_GestureID = long;
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
int SDL_RecordGesture(SDL_TouchID);
|
||||||
|
int SDL_SaveAllDollarTemplates(SDL_RWops*);
|
||||||
|
int SDL_SaveDollarTemplate(SDL_GestureID,SDL_RWops*);
|
||||||
|
int SDL_LoadDollarTemplates(SDL_TouchID,SDL_RWops*);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_RecordGesture = int function(SDL_TouchID);
|
||||||
|
alias pSDL_SaveAllDollarTemplates = int function(SDL_RWops*);
|
||||||
|
alias pSDL_SaveDollarTemplate = int function(SDL_GestureID,SDL_RWops*);
|
||||||
|
alias pSDL_LoadDollarTemplates = int function(SDL_TouchID,SDL_RWops*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_RecordGesture SDL_RecordGesture;
|
||||||
|
pSDL_SaveAllDollarTemplates SDL_SaveAllDollarTemplates;
|
||||||
|
pSDL_SaveDollarTemplate SDL_SaveDollarTemplate;
|
||||||
|
pSDL_LoadDollarTemplates SDL_LoadDollarTemplates;
|
||||||
|
}
|
||||||
|
}
|
||||||
240
demos/external/wasm_imports/bindbc/sdl/bind/sdlhaptic.d
vendored
Normal file
240
demos/external/wasm_imports/bindbc/sdl/bind/sdlhaptic.d
vendored
Normal file
|
|
@ -0,0 +1,240 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlhaptic;
|
||||||
|
|
||||||
|
import bindbc.sdl.bind.sdljoystick : SDL_Joystick;
|
||||||
|
|
||||||
|
struct SDL_Haptic;
|
||||||
|
|
||||||
|
enum : ushort {
|
||||||
|
SDL_HAPTIC_CONSTANT = 1u<<0,
|
||||||
|
SDL_HAPTIC_SINE = 1u<<1,
|
||||||
|
SDL_HAPTIC_LEFTRIGHT = 1u<<2,
|
||||||
|
SDL_HAPTIC_TRIANGLE = 1u<<3,
|
||||||
|
SDL_HAPTIC_SAWTOOTHUP = 1u<<4,
|
||||||
|
SDL_HAPTIC_SAWTOOTHDOWN = 1u<<5,
|
||||||
|
SDL_HAPTIC_RAMP = 1u<<6,
|
||||||
|
SDL_HAPTIC_SPRING = 1u<<7,
|
||||||
|
SDL_HAPTIC_DAMPER = 1u<<8,
|
||||||
|
SDL_HAPTIC_INERTIA = 1u<<9,
|
||||||
|
SDL_HAPTIC_FRICTION = 1u<<10,
|
||||||
|
SDL_HAPTIC_CUSTOM = 1u<<11,
|
||||||
|
SDL_HAPTIC_GAIN = 1u<<12,
|
||||||
|
SDL_HAPTIC_AUTOCENTER = 1u<<13,
|
||||||
|
SDL_HAPTIC_STATUS = 1u<<14,
|
||||||
|
SDL_HAPTIC_PAUSE = 1u<<15,
|
||||||
|
}
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SDL_HAPTIC_POLAR = 0,
|
||||||
|
SDL_HAPTIC_CARTESIAN = 1,
|
||||||
|
SDL_HAPTIC_SPHERICAL = 2,
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SDL_HAPTIC_INFINITY = 4294967295U;
|
||||||
|
|
||||||
|
struct SDL_HapticDirection {
|
||||||
|
ubyte type;
|
||||||
|
int[3] dir;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_HapticConstant {
|
||||||
|
ushort type;
|
||||||
|
SDL_HapticDirection direction;
|
||||||
|
uint length;
|
||||||
|
ushort delay;
|
||||||
|
ushort button;
|
||||||
|
ushort interval;
|
||||||
|
short level;
|
||||||
|
ushort attack_length;
|
||||||
|
ushort attack_level;
|
||||||
|
ushort fade_length;
|
||||||
|
ushort fade_level;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_HapticPeriodic {
|
||||||
|
ushort type;
|
||||||
|
SDL_HapticDirection direction;
|
||||||
|
uint length;
|
||||||
|
uint delay;
|
||||||
|
ushort button;
|
||||||
|
ushort interval;
|
||||||
|
ushort period;
|
||||||
|
short magnitude;
|
||||||
|
short offset;
|
||||||
|
ushort phase;
|
||||||
|
ushort attack_length;
|
||||||
|
ushort attack_level;
|
||||||
|
ushort fade_length;
|
||||||
|
ushort fade_level;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_HapticCondition {
|
||||||
|
ushort type;
|
||||||
|
SDL_HapticDirection direciton;
|
||||||
|
uint length;
|
||||||
|
ushort delay;
|
||||||
|
ushort button;
|
||||||
|
ushort interval;
|
||||||
|
ushort[3] right_sat;
|
||||||
|
ushort[3] left_sat;
|
||||||
|
short[3] right_coeff;
|
||||||
|
short[3] left_coeff;
|
||||||
|
ushort[3] deadband;
|
||||||
|
ushort[3] center;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_HapticRamp {
|
||||||
|
ushort type;
|
||||||
|
SDL_HapticDirection direction;
|
||||||
|
uint length;
|
||||||
|
ushort delay;
|
||||||
|
ushort button;
|
||||||
|
ushort interval;
|
||||||
|
short start;
|
||||||
|
short end;
|
||||||
|
ushort attack_length;
|
||||||
|
ushort attack_level;
|
||||||
|
ushort fade_length;
|
||||||
|
ushort fade_level;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_HapticLeftRight {
|
||||||
|
ushort type;
|
||||||
|
uint length;
|
||||||
|
ushort large_magnitude;
|
||||||
|
ushort small_magnitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_HapticCustom {
|
||||||
|
ushort type;
|
||||||
|
SDL_HapticDirection direction;
|
||||||
|
uint length;
|
||||||
|
ushort delay;
|
||||||
|
ushort button;
|
||||||
|
ushort interval;
|
||||||
|
ubyte channels;
|
||||||
|
ushort period;
|
||||||
|
ushort samples;
|
||||||
|
ushort* data;
|
||||||
|
ushort attack_length;
|
||||||
|
ushort attack_level;
|
||||||
|
ushort fade_length;
|
||||||
|
ushort fade_level;
|
||||||
|
}
|
||||||
|
|
||||||
|
union SDL_HapticEffect {
|
||||||
|
ushort type;
|
||||||
|
SDL_HapticConstant constant;
|
||||||
|
SDL_HapticPeriodic periodic;
|
||||||
|
SDL_HapticCondition condition;
|
||||||
|
SDL_HapticRamp ramp;
|
||||||
|
SDL_HapticLeftRight leftright;
|
||||||
|
SDL_HapticCustom custom;
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
int SDL_NumHaptics();
|
||||||
|
const(char)* SDL_HapticName(int);
|
||||||
|
SDL_Haptic* SDL_HapticOpen(int);
|
||||||
|
int SDL_HapticOpened(int);
|
||||||
|
int SDL_HapticIndex(SDL_Haptic*);
|
||||||
|
int SDL_MouseIsHaptic();
|
||||||
|
SDL_Haptic* SDL_HapticOpenFromMouse();
|
||||||
|
int SDL_JoystickIsHaptic(SDL_Joystick*);
|
||||||
|
SDL_Haptic* SDL_HapticOpenFromJoystick(SDL_Joystick*);
|
||||||
|
int SDL_HapticClose(SDL_Haptic*);
|
||||||
|
int SDL_HapticNumEffects(SDL_Haptic*);
|
||||||
|
int SDL_HapticNumEffectsPlaying(SDL_Haptic*);
|
||||||
|
uint SDL_HapticQuery(SDL_Haptic*);
|
||||||
|
int SDL_HapticNumAxes(SDL_Haptic*);
|
||||||
|
int SDL_HapticEffectSupported(SDL_Haptic*,SDL_HapticEffect*);
|
||||||
|
int SDL_HapticNewEffect(SDL_Haptic*,SDL_HapticEffect*);
|
||||||
|
int SDL_HapticUpdateEffect(SDL_Haptic*,int,SDL_HapticEffect*);
|
||||||
|
int SDL_HapticRunEffect(SDL_Haptic*,int,uint);
|
||||||
|
int SDL_HapticStopEffect(SDL_Haptic*,int);
|
||||||
|
int SDL_HapticDestroyEffect(SDL_Haptic*,int);
|
||||||
|
int SDL_HapticGetEffectStatus(SDL_Haptic*,int);
|
||||||
|
int SDL_HapticSetGain(SDL_Haptic*,int);
|
||||||
|
int SDL_HapticSetAutocenter(SDL_Haptic*,int);
|
||||||
|
int SDL_HapticPause(SDL_Haptic*);
|
||||||
|
int SDL_HapticUnpause(SDL_Haptic*);
|
||||||
|
int SDL_HapticStopAll(SDL_Haptic*);
|
||||||
|
int SDL_HapticRumbleSupported(SDL_Haptic*);
|
||||||
|
int SDL_HapticRumbleInit(SDL_Haptic*);
|
||||||
|
int SDL_HapticRumblePlay(SDL_Haptic*,float,uint);
|
||||||
|
int SDL_HapticRumbleStop(SDL_Haptic*);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_NumHaptics = int function();
|
||||||
|
alias pSDL_HapticName = const(char)* function(int);
|
||||||
|
alias pSDL_HapticOpen = SDL_Haptic* function(int);
|
||||||
|
alias pSDL_HapticOpened = int function(int);
|
||||||
|
alias pSDL_HapticIndex = int function(SDL_Haptic*);
|
||||||
|
alias pSDL_MouseIsHaptic = int function();
|
||||||
|
alias pSDL_HapticOpenFromMouse = SDL_Haptic* function();
|
||||||
|
alias pSDL_JoystickIsHaptic = int function(SDL_Joystick*);
|
||||||
|
alias pSDL_HapticOpenFromJoystick = SDL_Haptic* function(SDL_Joystick*);
|
||||||
|
alias pSDL_HapticClose = int function(SDL_Haptic*);
|
||||||
|
alias pSDL_HapticNumEffects = int function(SDL_Haptic*);
|
||||||
|
alias pSDL_HapticNumEffectsPlaying = int function(SDL_Haptic*);
|
||||||
|
alias pSDL_HapticQuery = uint function(SDL_Haptic*);
|
||||||
|
alias pSDL_HapticNumAxes = int function(SDL_Haptic*);
|
||||||
|
alias pSDL_HapticEffectSupported = int function(SDL_Haptic*,SDL_HapticEffect*);
|
||||||
|
alias pSDL_HapticNewEffect = int function(SDL_Haptic*,SDL_HapticEffect*);
|
||||||
|
alias pSDL_HapticUpdateEffect = int function(SDL_Haptic*,int,SDL_HapticEffect*);
|
||||||
|
alias pSDL_HapticRunEffect = int function(SDL_Haptic*,int,uint);
|
||||||
|
alias pSDL_HapticStopEffect = int function(SDL_Haptic*,int);
|
||||||
|
alias pSDL_HapticDestroyEffect = int function(SDL_Haptic*,int);
|
||||||
|
alias pSDL_HapticGetEffectStatus = int function(SDL_Haptic*,int);
|
||||||
|
alias pSDL_HapticSetGain = int function(SDL_Haptic*,int);
|
||||||
|
alias pSDL_HapticSetAutocenter = int function(SDL_Haptic*,int);
|
||||||
|
alias pSDL_HapticPause = int function(SDL_Haptic*);
|
||||||
|
alias pSDL_HapticUnpause = int function(SDL_Haptic*);
|
||||||
|
alias pSDL_HapticStopAll = int function(SDL_Haptic*);
|
||||||
|
alias pSDL_HapticRumbleSupported = int function(SDL_Haptic*);
|
||||||
|
alias pSDL_HapticRumbleInit = int function(SDL_Haptic*);
|
||||||
|
alias pSDL_HapticRumblePlay = int function(SDL_Haptic*,float,uint);
|
||||||
|
alias pSDL_HapticRumbleStop = int function(SDL_Haptic*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_NumHaptics SDL_NumHaptics;
|
||||||
|
pSDL_HapticName SDL_HapticName;
|
||||||
|
pSDL_HapticOpen SDL_HapticOpen;
|
||||||
|
pSDL_HapticOpened SDL_HapticOpened;
|
||||||
|
pSDL_HapticIndex SDL_HapticIndex;
|
||||||
|
pSDL_MouseIsHaptic SDL_MouseIsHaptic;
|
||||||
|
pSDL_HapticOpenFromMouse SDL_HapticOpenFromMouse;
|
||||||
|
pSDL_JoystickIsHaptic SDL_JoystickIsHaptic;
|
||||||
|
pSDL_HapticOpenFromJoystick SDL_HapticOpenFromJoystick;
|
||||||
|
pSDL_HapticClose SDL_HapticClose;
|
||||||
|
pSDL_HapticNumEffects SDL_HapticNumEffects;
|
||||||
|
pSDL_HapticNumEffectsPlaying SDL_HapticNumEffectsPlaying;
|
||||||
|
pSDL_HapticQuery SDL_HapticQuery;
|
||||||
|
pSDL_HapticNumAxes SDL_HapticNumAxes;
|
||||||
|
pSDL_HapticEffectSupported SDL_HapticEffectSupported;
|
||||||
|
pSDL_HapticNewEffect SDL_HapticNewEffect;
|
||||||
|
pSDL_HapticUpdateEffect SDL_HapticUpdateEffect;
|
||||||
|
pSDL_HapticRunEffect SDL_HapticRunEffect;
|
||||||
|
pSDL_HapticStopEffect SDL_HapticStopEffect;
|
||||||
|
pSDL_HapticDestroyEffect SDL_HapticDestroyEffect;
|
||||||
|
pSDL_HapticGetEffectStatus SDL_HapticGetEffectStatus;
|
||||||
|
pSDL_HapticSetGain SDL_HapticSetGain;
|
||||||
|
pSDL_HapticSetAutocenter SDL_HapticSetAutocenter;
|
||||||
|
pSDL_HapticPause SDL_HapticPause;
|
||||||
|
pSDL_HapticUnpause SDL_HapticUnpause;
|
||||||
|
pSDL_HapticStopAll SDL_HapticStopAll;
|
||||||
|
pSDL_HapticRumbleSupported SDL_HapticRumbleSupported;
|
||||||
|
pSDL_HapticRumbleInit SDL_HapticRumbleInit;
|
||||||
|
pSDL_HapticRumblePlay SDL_HapticRumblePlay;
|
||||||
|
pSDL_HapticRumbleStop SDL_HapticRumbleStop;
|
||||||
|
}
|
||||||
|
}
|
||||||
186
demos/external/wasm_imports/bindbc/sdl/bind/sdlhints.d
vendored
Normal file
186
demos/external/wasm_imports/bindbc/sdl/bind/sdlhints.d
vendored
Normal file
|
|
@ -0,0 +1,186 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlhints;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
import bindbc.sdl.bind.sdlstdinc : SDL_bool;
|
||||||
|
|
||||||
|
enum SDL_HINT_FRAMEBUFFER_ACCELERATION = "SDL_FRAMEBUFFER_ACCELERATION";
|
||||||
|
enum SDL_HINT_RENDER_DRIVER = "SDL_RENDER_DRIVER";
|
||||||
|
enum SDL_HINT_RENDER_OPENGL_SHADERS = "SDL_RENDER_OPENGL_SHADERS";
|
||||||
|
enum SDL_HINT_RENDER_SCALE_QUALITY = "SDL_RENDER_SCALE_QUALITY";
|
||||||
|
enum SDL_HINT_RENDER_VSYNC = "SDL_RENDER_VSYNC";
|
||||||
|
enum SDL_HINT_VIDEO_X11_XVIDMODE = "SDL_VIDEO_X11_XVIDMODE";
|
||||||
|
enum SDL_HINT_VIDEO_X11_XINERAMA = "SDL_VIDEO_X11_XINERAMA";
|
||||||
|
enum SDL_HINT_VIDEO_X11_XRANDR = "SDL_VIDEO_X11_XRANDR";
|
||||||
|
enum SDL_HINT_GRAB_KEYBOARD = "SDL_GRAB_KEYBOARD";
|
||||||
|
enum SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS = "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS";
|
||||||
|
enum SDL_HINT_IDLE_TIMER_DISABLED = "SDL_IOS_IDLE_TIMER_DISABLED";
|
||||||
|
enum SDL_HINT_ORIENTATIONS = "SDL_IOS_ORIENTATIONS";
|
||||||
|
enum SDL_HINT_XINPUT_ENABLED = "SDL_XINPUT_ENABLED";
|
||||||
|
enum SDL_HINT_GAMECONTROLLERCONFIG = "SDL_GAMECONTROLLERCONFIG";
|
||||||
|
enum SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS = "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS";
|
||||||
|
enum SDL_HINT_ALLOW_TOPMOST = "SDL_ALLOW_TOPMOST";
|
||||||
|
enum SDL_HINT_TIMER_RESOLUTION = "SDL_TIMER_RESOLUTION";
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl201) {
|
||||||
|
enum SDL_HINT_RENDER_DIRECT3D_THREADSAFE = "SDL_RENDER_DIRECT3D_THREADSAFE";
|
||||||
|
enum SDL_HINT_VIDEO_HIGHDPI_DISABLED = "SDL_VIDEO_HIGHDPI_DISABLED";
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl202) {
|
||||||
|
enum SDL_HINT_VIDEO_ALLOW_SCREENSAVER = "SDL_VIDEO_ALLOW_SCREENSAVER";
|
||||||
|
enum SDL_HINT_MOUSE_RELATIVE_MODE_WARP = "SDL_MOUSE_RELATIVE_MODE_WARP";
|
||||||
|
enum SDL_HINT_ACCELEROMETER_AS_JOYSTICK = "SDL_ACCELEROMETER_AS_JOYSTICK";
|
||||||
|
enum SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK = "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK";
|
||||||
|
enum SDL_HINT_VIDEO_WIN_D3DCOMPILER = "SDL_VIDEO_WIN_D3DCOMPILER";
|
||||||
|
enum SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT = "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT";
|
||||||
|
enum SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES = "SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES";
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is *intended* to be == and not >=. The values for all of these changed in 2.0.4.
|
||||||
|
static if(sdlSupport == SDLSupport.sdl203) {
|
||||||
|
enum SDL_HINT_RENDER_DIRECT3D11_DEBUG = "SDL_HINT_RENDER_DIRECT3D11_DEBUG";
|
||||||
|
enum SDL_HINT_WINRT_PRIVACY_POLICY_URL = "SDL_HINT_WINRT_PRIVACY_POLICY_URL";
|
||||||
|
enum SDL_HINT_WINRT_PRIVACY_POLICY_LABEL = "SDL_HINT_WINRT_PRIVACY_POLICY_LABEL";
|
||||||
|
enum SDL_HINT_WINRT_HANDLE_BACK_BUTTON = "SDL_HINT_WINRT_HANDLE_BACK_BUTTON";
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
enum SDL_HINT_VIDEO_X11_NET_WM_PING = "SDL_VIDEO_X11_NET_WM_PING";
|
||||||
|
enum SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN = "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN";
|
||||||
|
enum SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP = "SDL_WINDOWS_ENABLE_MESSAGELOOP";
|
||||||
|
enum SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING = "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING";
|
||||||
|
enum SDL_HINT_THREAD_STACK_SIZE = "SDL_THREAD_STACK_SIZE";
|
||||||
|
enum SDL_HINT_MAC_BACKGROUND_APP = "SDL_MAC_BACKGROUND_APP";
|
||||||
|
enum SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION = "SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION";
|
||||||
|
enum SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION = "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION";
|
||||||
|
enum SDL_HINT_IME_INTERNAL_EDITING = "SDL_IME_INTERNAL_EDITING";
|
||||||
|
enum SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT = "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT";
|
||||||
|
enum SDL_HINT_NO_SIGNAL_HANDLERS = "SDL_NO_SIGNAL_HANDLERS";
|
||||||
|
enum SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 = "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4";
|
||||||
|
|
||||||
|
// Changed values from those introduced in 2.0.3
|
||||||
|
enum SDL_HINT_RENDER_DIRECT3D11_DEBUG = "SDL_RENDER_DIRECT3D11_DEBUG";
|
||||||
|
enum SDL_HINT_WINRT_PRIVACY_POLICY_URL = "SDL_WINRT_PRIVACY_POLICY_URL";
|
||||||
|
enum SDL_HINT_WINRT_PRIVACY_POLICY_LABEL = "SDL_WINRT_PRIVACY_POLICY_LABEL";
|
||||||
|
enum SDL_HINT_WINRT_HANDLE_BACK_BUTTON = "SDL_WINRT_HANDLE_BACK_BUTTON";
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl205) {
|
||||||
|
enum SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH = "SDL_MOUSE_FOCUS_CLICKTHROUGH";
|
||||||
|
enum SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS = "SDL_APPLE_TV_CONTROLLER_UI_EVENTS";
|
||||||
|
enum SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION = "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION";
|
||||||
|
enum SDL_HINT_BMP_SAVE_LEGACY_FORMAT = "SDL_BMP_SAVE_LEGACY_FORMAT";
|
||||||
|
enum SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING = "SDL_WINDOWS_DISABLE_THREAD_NAMING";
|
||||||
|
enum SDL_HINT_RPI_VIDEO_LAYER = "SDL_RPI_VIDEO_LAYER";
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) {
|
||||||
|
enum SDL_HINT_RENDER_LOGICAL_SIZE_MODE = "SDL_RENDER_LOGICAL_SIZE_MODE";
|
||||||
|
enum SDL_HINT_WINDOWS_INTRESOURCE_ICON = "SDL_WINDOWS_INTRESOURCE_ICON";
|
||||||
|
enum SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL = "SDL_WINDOWS_INTRESOURCE_ICON_SMALL";
|
||||||
|
enum SDL_HINT_MOUSE_NORMAL_SPEED_SCALE = "SDL_MOUSE_NORMAL_SPEED_SCALE";
|
||||||
|
enum SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE = "SDL_MOUSE_RELATIVE_SPEED_SCALE";
|
||||||
|
enum SDL_HINT_TOUCH_MOUSE_EVENTS = "SDL_TOUCH_MOUSE_EVENTS";
|
||||||
|
enum SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES = "SDL_GAMECONTROLLER_IGNORE_DEVICES";
|
||||||
|
enum SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT = "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT";
|
||||||
|
enum SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION = "SDL_QTWAYLAND_CONTENT_ORIENTATION";
|
||||||
|
enum SDL_HINT_QTWAYLAND_WINDOW_FLAGS = "SDL_QTWAYLAND_WINDOW_FLAGS";
|
||||||
|
enum SDL_HINT_OPENGL_ES_DRIVER = "SDL_OPENGL_ES_DRIVER";
|
||||||
|
enum SDL_HINT_AUDIO_RESAMPLING_MODE = "SDL_AUDIO_RESAMPLING_MODE";
|
||||||
|
enum SDL_HINT_AUDIO_CATEGORY = "SDL_AUDIO_CATEGORY";
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl208) {
|
||||||
|
enum SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR = "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR";
|
||||||
|
enum SDL_HINT_IOS_HIDE_HOME_INDICATOR = "SDL_IOS_HIDE_HOME_INDICATOR";
|
||||||
|
enum SDL_HINT_TV_REMOTE_AS_JOYSTICK = "SDL_TV_REMOTE_AS_JOYSTICK";
|
||||||
|
enum SDL_HINT_RETURN_KEY_HIDES_IME = "SDL_RETURN_KEY_HIDES_IME";
|
||||||
|
enum SDL_HINT_VIDEO_DOUBLE_BUFFER = "SDL_VIDEO_DOUBLE_BUFFER";
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
enum SDL_HINT_MOUSE_DOUBLE_CLICK_TIME = "SDL_MOUSE_DOUBLE_CLICK_TIME";
|
||||||
|
enum SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS = "SDL_MOUSE_DOUBLE_CLICK_RADIUS";
|
||||||
|
enum SDL_HINT_JOYSTICK_HIDAPI = "SDL_JOYSTICK_HIDAPI";
|
||||||
|
enum SDL_HINT_JOYSTICK_HIDAPI_PS4 = "SDL_JOYSTICK_HIDAPI_PS4";
|
||||||
|
enum SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE = "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE";
|
||||||
|
enum SDL_HINT_JOYSTICK_HIDAPI_STEAM = "SDL_JOYSTICK_HIDAPI_STEAM";
|
||||||
|
enum SDL_HINT_JOYSTICK_HIDAPI_SWITCH = "SDL_JOYSTICK_HIDAPI_SWITCH";
|
||||||
|
enum SDL_HINT_JOYSTICK_HIDAPI_XBOX = "SDL_JOYSTICK_HIDAPI_XBOX";
|
||||||
|
enum SDL_HINT_ENABLE_STEAM_CONTROLLERS = "SDL_ENABLE_STEAM_CONTROLLERS";
|
||||||
|
enum SDL_HINT_ANDROID_TRAP_BACK_BUTTON = "SDL_ANDROID_TRAP_BACK_BUTTON";
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl2010) {
|
||||||
|
enum SDL_HINT_MOUSE_TOUCH_EVENTS = "SDL_MOUSE_TOUCH_EVENTS";
|
||||||
|
enum SDL_HINT_GAMECONTROLLERCONFIG_FILE = "SDL_GAMECONTROLLERCONFIG_FILE";
|
||||||
|
enum SDL_HINT_ANDROID_BLOCK_ON_PAUSE = "SDL_ANDROID_BLOCK_ON_PAUSE";
|
||||||
|
enum SDL_HINT_RENDER_BATCHING = "SDL_RENDER_BATCHING";
|
||||||
|
enum SDL_HINT_EVENT_LOGGING = "SDL_EVENT_LOGGING";
|
||||||
|
enum SDL_HINT_WAVE_RIFF_CHUNK_SIZE = "SDL_WAVE_RIFF_CHUNK_SIZE";
|
||||||
|
enum SDL_HINT_WAVE_TRUNCATION = "SDL_WAVE_TRUNCATION";
|
||||||
|
enum SDL_HINT_WAVE_FACT_CHUNK = "SDL_WAVE_FACT_CHUNK";
|
||||||
|
}
|
||||||
|
else static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
// Added in 2.0.4, removed in 2.0.10.
|
||||||
|
enum SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH = "SDL_ANDROID_SEPARATE_MOUSE_AND_TOUCH";
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SDL_HintPriority {
|
||||||
|
SDL_HINT_DEFAULT,
|
||||||
|
SDL_HINT_NORMAL,
|
||||||
|
SDL_HINT_OVERRIDE,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_HintPriority);
|
||||||
|
|
||||||
|
extern(C) nothrow alias SDL_HintCallback = void function(void*, const(char)*, const(char)*);
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
SDL_bool SDL_SetHintWithPriority(const(char)*,const(char)*,SDL_HintPriority);
|
||||||
|
SDL_bool SDL_SetHint(const(char)*,const(char)*);
|
||||||
|
const(char)* SDL_GetHint(const(char)*);
|
||||||
|
void SDL_AddHintCallback(const(char)*,SDL_HintCallback,void*);
|
||||||
|
void SDL_DelHintCallback(const(char)*,SDL_HintCallback,void*);
|
||||||
|
void SDL_ClearHints();
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl205) {
|
||||||
|
SDL_bool SDL_GetHintBoolean(const(char)*,SDL_bool);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_SetHintWithPriority = SDL_bool function(const(char)*,const(char)*,SDL_HintPriority);
|
||||||
|
alias pSDL_SetHint = SDL_bool function(const(char)*,const(char)*);
|
||||||
|
alias pSDL_GetHint = const(char)* function(const(char)*);
|
||||||
|
alias pSDL_AddHintCallback = void function(const(char)*,SDL_HintCallback,void*);
|
||||||
|
alias pSDL_DelHintCallback = void function(const(char)*,SDL_HintCallback,void*);
|
||||||
|
alias pSDL_ClearHints = void function();
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_SetHintWithPriority SDL_SetHintWithPriority;
|
||||||
|
pSDL_SetHint SDL_SetHint;
|
||||||
|
pSDL_GetHint SDL_GetHint;
|
||||||
|
pSDL_AddHintCallback SDL_AddHintCallback;
|
||||||
|
pSDL_DelHintCallback SDL_DelHintCallback;
|
||||||
|
pSDL_ClearHints SDL_ClearHints;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl205) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GetHintBoolean = SDL_bool function(const(char)*,SDL_bool);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GetHintBoolean SDL_GetHintBoolean;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
231
demos/external/wasm_imports/bindbc/sdl/bind/sdljoystick.d
vendored
Normal file
231
demos/external/wasm_imports/bindbc/sdl/bind/sdljoystick.d
vendored
Normal file
|
|
@ -0,0 +1,231 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdljoystick;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
import bindbc.sdl.bind.sdlstdinc : SDL_bool;
|
||||||
|
|
||||||
|
struct SDL_Joystick;
|
||||||
|
|
||||||
|
struct SDL_JoystickGUID {
|
||||||
|
ubyte[16] data;
|
||||||
|
}
|
||||||
|
|
||||||
|
alias SDL_JoystickID = int;
|
||||||
|
|
||||||
|
enum : ubyte {
|
||||||
|
SDL_HAT_CENTERED = 0x00,
|
||||||
|
SDL_HAT_UP = 0x01,
|
||||||
|
SDL_HAT_RIGHT = 0x02,
|
||||||
|
SDL_HAT_DOWN = 0x04,
|
||||||
|
SDL_HAT_LEFT = 0x08,
|
||||||
|
SDL_HAT_RIGHTUP = (SDL_HAT_RIGHT|SDL_HAT_UP),
|
||||||
|
SDL_HAT_RIGHTDOWN = (SDL_HAT_RIGHT|SDL_HAT_DOWN),
|
||||||
|
SDL_HAT_LEFTUP = (SDL_HAT_LEFT|SDL_HAT_UP),
|
||||||
|
SDL_HAT_LEFTDOWN = (SDL_HAT_LEFT|SDL_HAT_DOWN),
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
enum SDL_JoystickPowerLevel {
|
||||||
|
SDL_JOYSTICK_POWER_UNKNOWN = -1,
|
||||||
|
SDL_JOYSTICK_POWER_EMPTY,
|
||||||
|
SDL_JOYSTICK_POWER_LOW,
|
||||||
|
SDL_JOYSTICK_POWER_MEDIUM,
|
||||||
|
SDL_JOYSTICK_POWER_FULL,
|
||||||
|
SDL_JOYSTICK_POWER_WIRED,
|
||||||
|
SDL_JOYSTICK_POWER_MAX
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_JoystickPowerLevel);
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) {
|
||||||
|
enum SDL_JoystickType {
|
||||||
|
SDL_JOYSTICK_TYPE_UNKNOWN,
|
||||||
|
SDL_JOYSTICK_TYPE_GAMECONTROLLER,
|
||||||
|
SDL_JOYSTICK_TYPE_WHEEL,
|
||||||
|
SDL_JOYSTICK_TYPE_ARCADE_STICK,
|
||||||
|
SDL_JOYSTICK_TYPE_FLIGHT_STICK,
|
||||||
|
SDL_JOYSTICK_TYPE_DANCE_PAD,
|
||||||
|
SDL_JOYSTICK_TYPE_GUITAR,
|
||||||
|
SDL_JOYSTICK_TYPE_DRUM_KIT,
|
||||||
|
SDL_JOYSTICK_TYPE_ARCADE_PAD,
|
||||||
|
SDL_JOYSTICK_TYPE_THROTTLE,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_JoystickType);
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SDL_JOYSTICK_AXIS_MAX = 32767,
|
||||||
|
SDL_JOYSTICK_AXIS_MIN = -32768,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
int SDL_NumJoysticks();
|
||||||
|
const(char)* SDL_JoystickNameForIndex(int);
|
||||||
|
SDL_JoystickGUID SDL_JoystickGetDeviceGUID(int);
|
||||||
|
SDL_Joystick* SDL_JoystickOpen(int);
|
||||||
|
const(char)* SDL_JoystickName(SDL_Joystick*);
|
||||||
|
SDL_JoystickGUID SDL_JoystickGetGUID(SDL_Joystick*);
|
||||||
|
char* SDL_JoystickGetGUIDString(SDL_JoystickGUID);
|
||||||
|
SDL_JoystickGUID SDL_JoystickGetGUIDFromString(const(char)*);
|
||||||
|
SDL_bool SDL_JoystickGetAttached(SDL_Joystick*);
|
||||||
|
SDL_JoystickID SDL_JoystickInstanceID(SDL_Joystick*);
|
||||||
|
int SDL_JoystickNumAxes(SDL_Joystick*);
|
||||||
|
int SDL_JoystickNumBalls(SDL_Joystick*);
|
||||||
|
int SDL_JoystickNumHats(SDL_Joystick*);
|
||||||
|
int SDL_JoystickNumButtons(SDL_Joystick*);
|
||||||
|
void SDL_JoystickUpdate();
|
||||||
|
int SDL_JoystickEventState(int);
|
||||||
|
short SDL_JoystickGetAxis(SDL_Joystick*,int);
|
||||||
|
ubyte SDL_JoystickGetHat(SDL_Joystick*,int);
|
||||||
|
int SDL_JoystickGetBall(SDL_Joystick*,int,int*,int*);
|
||||||
|
ubyte SDL_JoystickGetButton(SDL_Joystick*,int);
|
||||||
|
void SDL_JoystickClose(SDL_Joystick*);
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
SDL_JoystickPowerLevel SDL_JoystickCurrentPowerLevel(SDL_Joystick*);
|
||||||
|
SDL_Joystick* SDL_JoystickFromInstanceID(SDL_JoystickID);
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) {
|
||||||
|
SDL_bool SDL_JoystickGetAxisInitialState(SDL_Joystick*,int,short*);
|
||||||
|
SDL_JoystickType SDL_JoystickGetDeviceInstanceID(int);
|
||||||
|
ushort SDL_JoystickGetDeviceProduct(int);
|
||||||
|
ushort SDL_JoystickGetDeviceProductVersion(int);
|
||||||
|
SDL_JoystickType SDL_JoystickGetDeviceType(int);
|
||||||
|
ushort SDL_JoystickGetDeviceVendor(int);
|
||||||
|
ushort SDL_JoystickGetProduct(SDL_Joystick*);
|
||||||
|
ushort SDL_JoystickGetProductVersion(SDL_Joystick*);
|
||||||
|
SDL_JoystickType SDL_JoystickGetType(SDL_Joystick*);
|
||||||
|
ushort SDL_JoystickGetVendor(SDL_Joystick*);
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl207) {
|
||||||
|
void SDL_LockJoysticks();
|
||||||
|
void SDL_UnlockJoysticks();
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
int SDL_JoystickRumble(SDL_Joystick*,ushort,ushort,uint);
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl2010) {
|
||||||
|
int SDL_JoystickGetDevicePlayerIndex(int);
|
||||||
|
int SDL_JoystickGetPlayerIndex(SDL_Joystick*);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_NumJoysticks = int function();
|
||||||
|
alias pSDL_JoystickNameForIndex = const(char)* function(int);
|
||||||
|
alias pSDL_JoystickGetDeviceGUID = SDL_JoystickGUID function(int);
|
||||||
|
alias pSDL_JoystickOpen = SDL_Joystick* function(int);
|
||||||
|
alias pSDL_JoystickName = const(char)* function(SDL_Joystick*);
|
||||||
|
alias pSDL_JoystickGetGUID = SDL_JoystickGUID function(SDL_Joystick*);
|
||||||
|
alias pSDL_JoystickGetGUIDString = char* function(SDL_JoystickGUID);
|
||||||
|
alias pSDL_JoystickGetGUIDFromString = SDL_JoystickGUID function(const(char)*);
|
||||||
|
alias pSDL_JoystickGetAttached = SDL_bool function(SDL_Joystick*);
|
||||||
|
alias pSDL_JoystickInstanceID = SDL_JoystickID function(SDL_Joystick*);
|
||||||
|
alias pSDL_JoystickNumAxes = int function(SDL_Joystick*);
|
||||||
|
alias pSDL_JoystickNumBalls = int function(SDL_Joystick*);
|
||||||
|
alias pSDL_JoystickNumHats = int function(SDL_Joystick*);
|
||||||
|
alias pSDL_JoystickNumButtons = int function(SDL_Joystick*);
|
||||||
|
alias pSDL_JoystickUpdate = void function();
|
||||||
|
alias pSDL_JoystickEventState = int function(int);
|
||||||
|
alias pSDL_JoystickGetAxis = short function(SDL_Joystick*,int);
|
||||||
|
alias pSDL_JoystickGetHat = ubyte function(SDL_Joystick*,int);
|
||||||
|
alias pSDL_JoystickGetBall = int function(SDL_Joystick*,int,int*,int*);
|
||||||
|
alias pSDL_JoystickGetButton = ubyte function(SDL_Joystick*,int);
|
||||||
|
alias pSDL_JoystickClose = void function(SDL_Joystick*);
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_NumJoysticks SDL_NumJoysticks;
|
||||||
|
pSDL_JoystickNameForIndex SDL_JoystickNameForIndex;
|
||||||
|
pSDL_JoystickGetDeviceGUID SDL_JoystickGetDeviceGUID;
|
||||||
|
pSDL_JoystickOpen SDL_JoystickOpen;
|
||||||
|
pSDL_JoystickName SDL_JoystickName;
|
||||||
|
pSDL_JoystickGetGUID SDL_JoystickGetGUID;
|
||||||
|
pSDL_JoystickGetGUIDString SDL_JoystickGetGUIDString;
|
||||||
|
pSDL_JoystickGetGUIDFromString SDL_JoystickGetGUIDFromString;
|
||||||
|
pSDL_JoystickGetAttached SDL_JoystickGetAttached;
|
||||||
|
pSDL_JoystickInstanceID SDL_JoystickInstanceID;
|
||||||
|
pSDL_JoystickNumAxes SDL_JoystickNumAxes;
|
||||||
|
pSDL_JoystickNumBalls SDL_JoystickNumBalls;
|
||||||
|
pSDL_JoystickNumHats SDL_JoystickNumHats;
|
||||||
|
pSDL_JoystickNumButtons SDL_JoystickNumButtons;
|
||||||
|
pSDL_JoystickUpdate SDL_JoystickUpdate;
|
||||||
|
pSDL_JoystickEventState SDL_JoystickEventState;
|
||||||
|
pSDL_JoystickGetAxis SDL_JoystickGetAxis;
|
||||||
|
pSDL_JoystickGetHat SDL_JoystickGetHat;
|
||||||
|
pSDL_JoystickGetBall SDL_JoystickGetBall;
|
||||||
|
pSDL_JoystickGetButton SDL_JoystickGetButton;
|
||||||
|
pSDL_JoystickClose SDL_JoystickClose;
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_JoystickCurrentPowerLevel = SDL_JoystickPowerLevel function(SDL_Joystick*);
|
||||||
|
alias pSDL_JoystickFromInstanceID = SDL_Joystick* function(SDL_JoystickID);
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_JoystickCurrentPowerLevel SDL_JoystickCurrentPowerLevel;
|
||||||
|
pSDL_JoystickFromInstanceID SDL_JoystickFromInstanceID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_JoystickGetAxisInitialState = SDL_bool function(SDL_Joystick*,int,short*);
|
||||||
|
alias pSDL_JoystickGetDeviceInstanceID = SDL_JoystickType function(int);
|
||||||
|
alias pSDL_JoystickGetDeviceProduct = ushort function(int);
|
||||||
|
alias pSDL_JoystickGetDeviceProductVersion = ushort function(int);
|
||||||
|
alias pSDL_JoystickGetDeviceType = SDL_JoystickType function(int);
|
||||||
|
alias pSDL_JoystickGetDeviceVendor = ushort function(int);
|
||||||
|
alias pSDL_JoystickGetProduct = ushort function(SDL_Joystick*);
|
||||||
|
alias pSDL_JoystickGetProductVersion = ushort function(SDL_Joystick*);
|
||||||
|
alias pSDL_JoystickGetType = SDL_JoystickType function(SDL_Joystick*);
|
||||||
|
alias pSDL_JoystickGetVendor = ushort function(SDL_Joystick*);
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_JoystickGetAxisInitialState SDL_JoystickGetAxisInitialState;
|
||||||
|
pSDL_JoystickGetDeviceInstanceID SDL_JoystickGetDeviceInstanceID;
|
||||||
|
pSDL_JoystickGetDeviceProduct SDL_JoystickGetDeviceProduct;
|
||||||
|
pSDL_JoystickGetDeviceProductVersion SDL_JoystickGetDeviceProductVersion;
|
||||||
|
pSDL_JoystickGetDeviceType SDL_JoystickGetDeviceType;
|
||||||
|
pSDL_JoystickGetDeviceVendor SDL_JoystickGetDeviceVendor;
|
||||||
|
pSDL_JoystickGetProduct SDL_JoystickGetProduct;
|
||||||
|
pSDL_JoystickGetProductVersion SDL_JoystickGetProductVersion;
|
||||||
|
pSDL_JoystickGetType SDL_JoystickGetType;
|
||||||
|
pSDL_JoystickGetVendor SDL_JoystickGetVendor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl207) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_LockJoysticks = void function();
|
||||||
|
alias pSDL_UnlockJoysticks = void function();
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_LockJoysticks SDL_LockJoysticks;
|
||||||
|
pSDL_UnlockJoysticks SDL_UnlockJoysticks;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_JoystickRumble = int function(SDL_Joystick*,ushort,ushort,uint);
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_JoystickRumble SDL_JoystickRumble;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl2010) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_JoystickGetDevicePlayerIndex = int function(int);
|
||||||
|
alias pSDL_JoystickGetPlayerIndex = int function(SDL_Joystick*);
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_JoystickGetDevicePlayerIndex SDL_JoystickGetDevicePlayerIndex;
|
||||||
|
pSDL_JoystickGetPlayerIndex SDL_JoystickGetPlayerIndex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
80
demos/external/wasm_imports/bindbc/sdl/bind/sdlkeyboard.d
vendored
Normal file
80
demos/external/wasm_imports/bindbc/sdl/bind/sdlkeyboard.d
vendored
Normal file
|
|
@ -0,0 +1,80 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlkeyboard;
|
||||||
|
|
||||||
|
import bindbc.sdl.bind.sdlkeycode : SDL_Keycode, SDL_Keymod;
|
||||||
|
import bindbc.sdl.bind.sdlrect : SDL_Rect;
|
||||||
|
import bindbc.sdl.bind.sdlscancode : SDL_Scancode;
|
||||||
|
import bindbc.sdl.bind.sdlstdinc : SDL_bool;
|
||||||
|
import bindbc.sdl.bind.sdlvideo : SDL_Window;
|
||||||
|
|
||||||
|
struct SDL_Keysym {
|
||||||
|
SDL_Scancode scancode;
|
||||||
|
SDL_Keycode sym;
|
||||||
|
ushort mod;
|
||||||
|
uint unused;
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
SDL_Window* SDL_GetKeyboardFocus();
|
||||||
|
ubyte* SDL_GetKeyboardState(int*);
|
||||||
|
SDL_Keymod SDL_GetModState();
|
||||||
|
void SDL_SetModState(SDL_Keymod);
|
||||||
|
SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode);
|
||||||
|
SDL_Scancode SDL_GetScancodeFromKey(SDL_Keycode);
|
||||||
|
const(char)* SDL_GetScancodeName(SDL_Scancode);
|
||||||
|
SDL_Scancode SDL_GetScancodeFromName(const(char)*);
|
||||||
|
const(char)* SDL_GetKeyName(SDL_Keycode);
|
||||||
|
SDL_Keycode SDL_GetKeyFromName(const(char)*);
|
||||||
|
void SDL_StartTextInput();
|
||||||
|
SDL_bool SDL_IsTextInputActive();
|
||||||
|
void SDL_StopTextInput();
|
||||||
|
void SDL_SetTextInputRect(SDL_Rect*);
|
||||||
|
SDL_bool SDL_HasScreenKeyboardSupport();
|
||||||
|
SDL_bool SDL_IsScreenKeyboardShown(SDL_Window*);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GetKeyboardFocus = SDL_Window* function();
|
||||||
|
alias pSDL_GetKeyboardState = ubyte* function(int*);
|
||||||
|
alias pSDL_GetModState = SDL_Keymod function();
|
||||||
|
alias pSDL_SetModState = void function(SDL_Keymod);
|
||||||
|
alias pSDL_GetKeyFromScancode = SDL_Keycode function(SDL_Scancode);
|
||||||
|
alias pSDL_GetScancodeFromKey = SDL_Scancode function(SDL_Keycode);
|
||||||
|
alias pSDL_GetScancodeName = const(char)* function(SDL_Scancode);
|
||||||
|
alias pSDL_GetScancodeFromName = SDL_Scancode function(const(char)*);
|
||||||
|
alias pSDL_GetKeyName = const(char)* function(SDL_Keycode);
|
||||||
|
alias pSDL_GetKeyFromName = SDL_Keycode function(const(char)*);
|
||||||
|
alias pSDL_StartTextInput = void function();
|
||||||
|
alias pSDL_IsTextInputActive = SDL_bool function();
|
||||||
|
alias pSDL_StopTextInput = void function();
|
||||||
|
alias pSDL_SetTextInputRect = void function(SDL_Rect*);
|
||||||
|
alias pSDL_HasScreenKeyboardSupport = SDL_bool function();
|
||||||
|
alias pSDL_IsScreenKeyboardShown = SDL_bool function(SDL_Window*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GetKeyboardFocus SDL_GetKeyboardFocus;
|
||||||
|
pSDL_GetKeyboardState SDL_GetKeyboardState;
|
||||||
|
pSDL_GetModState SDL_GetModState;
|
||||||
|
pSDL_SetModState SDL_SetModState;
|
||||||
|
pSDL_GetKeyFromScancode SDL_GetKeyFromScancode;
|
||||||
|
pSDL_GetScancodeFromKey SDL_GetScancodeFromKey;
|
||||||
|
pSDL_GetScancodeName SDL_GetScancodeName;
|
||||||
|
pSDL_GetScancodeFromName SDL_GetScancodeFromName;
|
||||||
|
pSDL_GetKeyName SDL_GetKeyName;
|
||||||
|
pSDL_GetKeyFromName SDL_GetKeyFromName;
|
||||||
|
pSDL_StartTextInput SDL_StartTextInput;
|
||||||
|
pSDL_IsTextInputActive SDL_IsTextInputActive;
|
||||||
|
pSDL_StopTextInput SDL_StopTextInput;
|
||||||
|
pSDL_SetTextInputRect SDL_SetTextInputRect;
|
||||||
|
pSDL_HasScreenKeyboardSupport SDL_HasScreenKeyboardSupport;
|
||||||
|
pSDL_IsScreenKeyboardShown SDL_IsScreenKeyboardShown;
|
||||||
|
}
|
||||||
|
}
|
||||||
288
demos/external/wasm_imports/bindbc/sdl/bind/sdlkeycode.d
vendored
Normal file
288
demos/external/wasm_imports/bindbc/sdl/bind/sdlkeycode.d
vendored
Normal file
|
|
@ -0,0 +1,288 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlkeycode;
|
||||||
|
|
||||||
|
import bindbc.sdl.config,
|
||||||
|
bindbc.sdl.bind.sdlscancode;
|
||||||
|
|
||||||
|
enum SDLK_SCANCODE_MASK = 1<<30;
|
||||||
|
|
||||||
|
enum SDL_SCANCODE_TO_KEYCODE(SDL_Scancode x) = x | SDLK_SCANCODE_MASK;
|
||||||
|
|
||||||
|
enum SDL_Keycode {
|
||||||
|
SDLK_UNKNOWN = 0,
|
||||||
|
SDLK_RETURN = '\r',
|
||||||
|
SDLK_ESCAPE = '\033',
|
||||||
|
SDLK_BACKSPACE = '\b',
|
||||||
|
SDLK_TAB = '\t',
|
||||||
|
SDLK_SPACE = ' ',
|
||||||
|
SDLK_EXCLAIM = '!',
|
||||||
|
SDLK_QUOTEDBL = '"',
|
||||||
|
SDLK_HASH = '#',
|
||||||
|
SDLK_PERCENT = '%',
|
||||||
|
SDLK_DOLLAR = '$',
|
||||||
|
SDLK_AMPERSAND = '&',
|
||||||
|
SDLK_QUOTE = '\'',
|
||||||
|
SDLK_LEFTPAREN = '(',
|
||||||
|
SDLK_RIGHTPAREN = ')',
|
||||||
|
SDLK_ASTERISK = '*',
|
||||||
|
SDLK_PLUS = '+',
|
||||||
|
SDLK_COMMA = ',',
|
||||||
|
SDLK_MINUS = '-',
|
||||||
|
SDLK_PERIOD = '.',
|
||||||
|
SDLK_SLASH = '/',
|
||||||
|
SDLK_0 = '0',
|
||||||
|
SDLK_1 = '1',
|
||||||
|
SDLK_2 = '2',
|
||||||
|
SDLK_3 = '3',
|
||||||
|
SDLK_4 = '4',
|
||||||
|
SDLK_5 = '5',
|
||||||
|
SDLK_6 = '6',
|
||||||
|
SDLK_7 = '7',
|
||||||
|
SDLK_8 = '8',
|
||||||
|
SDLK_9 = '9',
|
||||||
|
SDLK_COLON = ':',
|
||||||
|
SDLK_SEMICOLON = ';',
|
||||||
|
SDLK_LESS = '<',
|
||||||
|
SDLK_EQUALS = '=',
|
||||||
|
SDLK_GREATER = '>',
|
||||||
|
SDLK_QUESTION = '?',
|
||||||
|
SDLK_AT = '@',
|
||||||
|
|
||||||
|
SDLK_LEFTBRACKET = '[',
|
||||||
|
SDLK_BACKSLASH = '\\',
|
||||||
|
SDLK_RIGHTBRACKET = ']',
|
||||||
|
SDLK_CARET = '^',
|
||||||
|
SDLK_UNDERSCORE = '_',
|
||||||
|
SDLK_BACKQUOTE = '`',
|
||||||
|
SDLK_a = 'a',
|
||||||
|
SDLK_b = 'b',
|
||||||
|
SDLK_c = 'c',
|
||||||
|
SDLK_d = 'd',
|
||||||
|
SDLK_e = 'e',
|
||||||
|
SDLK_f = 'f',
|
||||||
|
SDLK_g = 'g',
|
||||||
|
SDLK_h = 'h',
|
||||||
|
SDLK_i = 'i',
|
||||||
|
SDLK_j = 'j',
|
||||||
|
SDLK_k = 'k',
|
||||||
|
SDLK_l = 'l',
|
||||||
|
SDLK_m = 'm',
|
||||||
|
SDLK_n = 'n',
|
||||||
|
SDLK_o = 'o',
|
||||||
|
SDLK_p = 'p',
|
||||||
|
SDLK_q = 'q',
|
||||||
|
SDLK_r = 'r',
|
||||||
|
SDLK_s = 's',
|
||||||
|
SDLK_t = 't',
|
||||||
|
SDLK_u = 'u',
|
||||||
|
SDLK_v = 'v',
|
||||||
|
SDLK_w = 'w',
|
||||||
|
SDLK_x = 'x',
|
||||||
|
SDLK_y = 'y',
|
||||||
|
SDLK_z = 'z',
|
||||||
|
|
||||||
|
SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_CAPSLOCK),
|
||||||
|
|
||||||
|
SDLK_F1 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F1),
|
||||||
|
SDLK_F2 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F2),
|
||||||
|
SDLK_F3 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F3),
|
||||||
|
SDLK_F4 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F4),
|
||||||
|
SDLK_F5 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F5),
|
||||||
|
SDLK_F6 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F6),
|
||||||
|
SDLK_F7 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F7),
|
||||||
|
SDLK_F8 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F8),
|
||||||
|
SDLK_F9 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F9),
|
||||||
|
SDLK_F10 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F10),
|
||||||
|
SDLK_F11 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F11),
|
||||||
|
SDLK_F12 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F12),
|
||||||
|
|
||||||
|
SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_PRINTSCREEN),
|
||||||
|
SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_SCROLLLOCK),
|
||||||
|
SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_PAUSE),
|
||||||
|
SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_INSERT),
|
||||||
|
SDLK_HOME = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_HOME),
|
||||||
|
SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_PAGEUP),
|
||||||
|
SDLK_DELETE = '\177',
|
||||||
|
SDLK_END = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_END),
|
||||||
|
SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_PAGEDOWN),
|
||||||
|
SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_RIGHT),
|
||||||
|
SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_LEFT),
|
||||||
|
SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_DOWN),
|
||||||
|
SDLK_UP = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_UP),
|
||||||
|
|
||||||
|
SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_NUMLOCKCLEAR),
|
||||||
|
SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_DIVIDE),
|
||||||
|
SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_MULTIPLY),
|
||||||
|
SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_MINUS),
|
||||||
|
SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_PLUS),
|
||||||
|
SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_ENTER),
|
||||||
|
SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_1),
|
||||||
|
SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_2),
|
||||||
|
SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_3),
|
||||||
|
SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_4),
|
||||||
|
SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_5),
|
||||||
|
SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_6),
|
||||||
|
SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_7),
|
||||||
|
SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_8),
|
||||||
|
SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_9),
|
||||||
|
SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_0),
|
||||||
|
SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_PERIOD),
|
||||||
|
|
||||||
|
SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_APPLICATION),
|
||||||
|
SDLK_POWER = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_POWER),
|
||||||
|
SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_EQUALS),
|
||||||
|
SDLK_F13 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F13),
|
||||||
|
SDLK_F14 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F14),
|
||||||
|
SDLK_F15 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F15),
|
||||||
|
SDLK_F16 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F16),
|
||||||
|
SDLK_F17 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F17),
|
||||||
|
SDLK_F18 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F18),
|
||||||
|
SDLK_F19 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F19),
|
||||||
|
SDLK_F20 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F20),
|
||||||
|
SDLK_F21 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F21),
|
||||||
|
SDLK_F22 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F22),
|
||||||
|
SDLK_F23 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F23),
|
||||||
|
SDLK_F24 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_F24),
|
||||||
|
SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_EXECUTE),
|
||||||
|
SDLK_HELP = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_HELP),
|
||||||
|
SDLK_MENU = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_MENU),
|
||||||
|
SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_SELECT),
|
||||||
|
SDLK_STOP = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_STOP),
|
||||||
|
SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_AGAIN),
|
||||||
|
SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_UNDO),
|
||||||
|
SDLK_CUT = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_CUT),
|
||||||
|
SDLK_COPY = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_COPY),
|
||||||
|
SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_PASTE),
|
||||||
|
SDLK_FIND = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_FIND),
|
||||||
|
SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_MUTE),
|
||||||
|
SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_VOLUMEUP),
|
||||||
|
SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_VOLUMEDOWN),
|
||||||
|
SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_COMMA),
|
||||||
|
SDLK_KP_EQUALSAS400 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_EQUALSAS400),
|
||||||
|
|
||||||
|
SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_ALTERASE),
|
||||||
|
SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_SYSREQ),
|
||||||
|
SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_CANCEL),
|
||||||
|
SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_CLEAR),
|
||||||
|
SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_PRIOR),
|
||||||
|
SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_RETURN2),
|
||||||
|
SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_SEPARATOR),
|
||||||
|
SDLK_OUT = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_OUT),
|
||||||
|
SDLK_OPER = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_OPER),
|
||||||
|
SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_CLEARAGAIN),
|
||||||
|
SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_CRSEL),
|
||||||
|
SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_EXSEL),
|
||||||
|
|
||||||
|
SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_00),
|
||||||
|
SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_000),
|
||||||
|
SDLK_THOUSANDSSEPARATOR = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_THOUSANDSSEPARATOR),
|
||||||
|
SDLK_DECIMALSEPARATOR = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_DECIMALSEPARATOR),
|
||||||
|
SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_CURRENCYUNIT),
|
||||||
|
SDLK_CURRENCYSUBUNIT = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_CURRENCYSUBUNIT),
|
||||||
|
SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_LEFTPAREN),
|
||||||
|
SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_RIGHTPAREN),
|
||||||
|
SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_LEFTBRACE),
|
||||||
|
SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_RIGHTBRACE),
|
||||||
|
SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_TAB),
|
||||||
|
SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_BACKSPACE),
|
||||||
|
SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_A),
|
||||||
|
SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_B),
|
||||||
|
SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_C),
|
||||||
|
SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_D),
|
||||||
|
SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_E),
|
||||||
|
SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_F),
|
||||||
|
SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_XOR),
|
||||||
|
SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_POWER),
|
||||||
|
SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_PERCENT),
|
||||||
|
SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_LESS),
|
||||||
|
SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_GREATER),
|
||||||
|
SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_AMPERSAND),
|
||||||
|
SDLK_KP_DBLAMPERSAND = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_DBLAMPERSAND),
|
||||||
|
SDLK_KP_VERTICALBAR = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_VERTICALBAR),
|
||||||
|
SDLK_KP_DBLVERTICALBAR = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_DBLVERTICALBAR),
|
||||||
|
SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_COLON),
|
||||||
|
SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_HASH),
|
||||||
|
SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_SPACE),
|
||||||
|
SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_AT),
|
||||||
|
SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_EXCLAM),
|
||||||
|
SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_MEMSTORE),
|
||||||
|
SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_MEMRECALL),
|
||||||
|
SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_MEMCLEAR),
|
||||||
|
SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_MEMADD),
|
||||||
|
SDLK_KP_MEMSUBTRACT = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_MEMSUBTRACT),
|
||||||
|
SDLK_KP_MEMMULTIPLY = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_MEMMULTIPLY),
|
||||||
|
SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_MEMDIVIDE),
|
||||||
|
SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_PLUSMINUS),
|
||||||
|
SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_CLEAR),
|
||||||
|
SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_CLEARENTRY),
|
||||||
|
SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_BINARY),
|
||||||
|
SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_OCTAL),
|
||||||
|
SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_DECIMAL),
|
||||||
|
SDLK_KP_HEXADECIMAL = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KP_HEXADECIMAL),
|
||||||
|
|
||||||
|
SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_LCTRL),
|
||||||
|
SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_LSHIFT),
|
||||||
|
SDLK_LALT = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_LALT),
|
||||||
|
SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_LGUI),
|
||||||
|
SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_RCTRL),
|
||||||
|
SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_RSHIFT),
|
||||||
|
SDLK_RALT = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_RALT),
|
||||||
|
SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_RGUI),
|
||||||
|
|
||||||
|
SDLK_MODE = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_MODE),
|
||||||
|
|
||||||
|
SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_AUDIONEXT),
|
||||||
|
SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_AUDIOPREV),
|
||||||
|
SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_AUDIOSTOP),
|
||||||
|
SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_AUDIOPLAY),
|
||||||
|
SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_AUDIOMUTE),
|
||||||
|
SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_MEDIASELECT),
|
||||||
|
SDLK_WWW = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_WWW),
|
||||||
|
SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_MAIL),
|
||||||
|
SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_CALCULATOR),
|
||||||
|
SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_COMPUTER),
|
||||||
|
SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_AC_SEARCH),
|
||||||
|
SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_AC_HOME),
|
||||||
|
SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_AC_BACK),
|
||||||
|
SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_AC_FORWARD),
|
||||||
|
SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_AC_STOP),
|
||||||
|
SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_AC_REFRESH),
|
||||||
|
SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_AC_BOOKMARKS),
|
||||||
|
|
||||||
|
SDLK_BRIGHTNESSDOWN = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_BRIGHTNESSDOWN),
|
||||||
|
SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_BRIGHTNESSUP),
|
||||||
|
SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_DISPLAYSWITCH),
|
||||||
|
SDLK_KBDILLUMTOGGLE = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KBDILLUMTOGGLE),
|
||||||
|
SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KBDILLUMDOWN),
|
||||||
|
SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_KBDILLUMUP),
|
||||||
|
SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_EJECT),
|
||||||
|
SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE!(SDL_Scancode.SDL_SCANCODE_SLEEP),
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_Keycode);
|
||||||
|
|
||||||
|
enum SDL_Keymod {
|
||||||
|
KMOD_NONE = 0x0000,
|
||||||
|
KMOD_LSHIFT = 0x0001,
|
||||||
|
KMOD_RSHIFT = 0x0002,
|
||||||
|
KMOD_LCTRL = 0x0040,
|
||||||
|
KMOD_RCTRL = 0x0080,
|
||||||
|
KMOD_LALT = 0x0100,
|
||||||
|
KMOD_RALT = 0x0200,
|
||||||
|
KMOD_LGUI = 0x0400,
|
||||||
|
KMOD_RGUI = 0x0800,
|
||||||
|
KMOD_NUM = 0x1000,
|
||||||
|
KMOD_CAPS = 0x2000,
|
||||||
|
KMOD_MODE = 0x4000,
|
||||||
|
KMOD_RESERVED = 0x8000,
|
||||||
|
|
||||||
|
KMOD_CTRL = (KMOD_LCTRL|KMOD_RCTRL),
|
||||||
|
KMOD_SHIFT = (KMOD_LSHIFT|KMOD_RSHIFT),
|
||||||
|
KMOD_ALT = (KMOD_LALT|KMOD_RALT),
|
||||||
|
KMOD_GUI = (KMOD_LGUI|KMOD_RGUI),
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_Keymod);
|
||||||
28
demos/external/wasm_imports/bindbc/sdl/bind/sdlloadso.d
vendored
Normal file
28
demos/external/wasm_imports/bindbc/sdl/bind/sdlloadso.d
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlloadso;
|
||||||
|
|
||||||
|
version(BindSDL_Static){
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
void* SDL_LoadObject(const(char)*);
|
||||||
|
void* SDL_LoadFunction(void*,const(char*));
|
||||||
|
void SDL_UnloadObject(void*);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_LoadObject = void* function(const(char)*);
|
||||||
|
alias pSDL_LoadFunction = void* function(void*,const(char*));
|
||||||
|
alias pSDL_UnloadObject = void function(void*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_LoadObject SDL_LoadObject;
|
||||||
|
pSDL_LoadFunction SDL_LoadFunction;
|
||||||
|
pSDL_UnloadObject SDL_UnloadObject;
|
||||||
|
}
|
||||||
|
}
|
||||||
107
demos/external/wasm_imports/bindbc/sdl/bind/sdllog.d
vendored
Normal file
107
demos/external/wasm_imports/bindbc/sdl/bind/sdllog.d
vendored
Normal file
|
|
@ -0,0 +1,107 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdllog;
|
||||||
|
|
||||||
|
import core.stdc.stdarg : va_list;
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
|
||||||
|
enum SDL_MAX_LOG_MESSAGE = 4096;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
SDL_LOG_CATEGORY_ERROR,
|
||||||
|
SDL_LOG_CATEGORY_ASSERT,
|
||||||
|
SDL_LOG_CATEGORY_SYSTEM,
|
||||||
|
SDL_LOG_CATEGORY_AUDIO,
|
||||||
|
SDL_LOG_CATEGORY_VIDEO,
|
||||||
|
SDL_LOG_CATEGORY_RENDER,
|
||||||
|
SDL_LOG_CATEGORY_INPUT,
|
||||||
|
SDL_LOG_CATEGORY_TEST,
|
||||||
|
|
||||||
|
SDL_LOG_CATEGORY_RESERVED1,
|
||||||
|
SDL_LOG_CATEGORY_RESERVED2,
|
||||||
|
SDL_LOG_CATEGORY_RESERVED3,
|
||||||
|
SDL_LOG_CATEGORY_RESERVED4,
|
||||||
|
SDL_LOG_CATEGORY_RESERVED5,
|
||||||
|
SDL_LOG_CATEGORY_RESERVED6,
|
||||||
|
SDL_LOG_CATEGORY_RESERVED7,
|
||||||
|
SDL_LOG_CATEGORY_RESERVED8,
|
||||||
|
SDL_LOG_CATEGORY_RESERVED9,
|
||||||
|
SDL_LOG_CATEGORY_RESERVED10,
|
||||||
|
|
||||||
|
SDL_LOG_CATEGORY_CUSTOM
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SDL_LogPriority {
|
||||||
|
SDL_LOG_PRIORITY_VERBOSE = 1,
|
||||||
|
SDL_LOG_PRIORITY_DEBUG,
|
||||||
|
SDL_LOG_PRIORITY_INFO,
|
||||||
|
SDL_LOG_PRIORITY_WARN,
|
||||||
|
SDL_LOG_PRIORITY_ERROR,
|
||||||
|
SDL_LOG_PRIORITY_CRITICAL,
|
||||||
|
SDL_NUM_LOG_PRIORITIES
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_LogPriority);
|
||||||
|
|
||||||
|
extern(C) nothrow alias SDL_LogOutputFunction = void function(void*, int, SDL_LogPriority, const(char)*);
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
void SDL_LogSetAllPriority(SDL_LogPriority);
|
||||||
|
void SDL_LogSetPriority(int,SDL_LogPriority);
|
||||||
|
SDL_LogPriority SDL_LogGetPriority(int);
|
||||||
|
void SDL_LogResetPriorities();
|
||||||
|
void SDL_Log(const(char)*,...);
|
||||||
|
void SDL_LogVerbose(int,const(char)*,...);
|
||||||
|
void SDL_LogDebug(int,const(char)*,...);
|
||||||
|
void SDL_LogInfo(int,const(char)*,...);
|
||||||
|
void SDL_LogWarn(int,const(char)*,...);
|
||||||
|
void SDL_LogError(int,const(char)*,...);
|
||||||
|
void SDL_LogCritical(int,const(char)*,...);
|
||||||
|
void SDL_LogMessage(int,SDL_LogPriority,const(char)*,...);
|
||||||
|
void SDL_LogMessageV(int,SDL_LogPriority,const(char)*,va_list);
|
||||||
|
void SDL_LogGetOutputFunction(SDL_LogOutputFunction,void**);
|
||||||
|
void SDL_LogSetOutputFunction(SDL_LogOutputFunction,void*);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_LogSetAllPriority = void function(SDL_LogPriority);
|
||||||
|
alias pSDL_LogSetPriority = void function(int,SDL_LogPriority);
|
||||||
|
alias pSDL_LogGetPriority = SDL_LogPriority function(int);
|
||||||
|
alias pSDL_LogResetPriorities = void function();
|
||||||
|
alias pSDL_Log = void function(const(char)*,...);
|
||||||
|
alias pSDL_LogVerbose = void function(int,const(char)*,...);
|
||||||
|
alias pSDL_LogDebug = void function(int,const(char)*,...);
|
||||||
|
alias pSDL_LogInfo = void function(int,const(char)*,...);
|
||||||
|
alias pSDL_LogWarn = void function(int,const(char)*,...);
|
||||||
|
alias pSDL_LogError = void function(int,const(char)*,...);
|
||||||
|
alias pSDL_LogCritical = void function(int,const(char)*,...);
|
||||||
|
alias pSDL_LogMessage = void function(int,SDL_LogPriority,const(char)*,...);
|
||||||
|
alias pSDL_LogMessageV = void function(int,SDL_LogPriority,const(char)*,va_list);
|
||||||
|
alias pSDL_LogGetOutputFunction = void function(SDL_LogOutputFunction,void**);
|
||||||
|
alias pSDL_LogSetOutputFunction = void function(SDL_LogOutputFunction,void*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_LogSetAllPriority SDL_LogSetAllPriority;
|
||||||
|
pSDL_LogSetPriority SDL_LogSetPriority;
|
||||||
|
pSDL_LogGetPriority SDL_LogGetPriority;
|
||||||
|
pSDL_LogResetPriorities SDL_LogResetPriorities;
|
||||||
|
pSDL_Log SDL_Log;
|
||||||
|
pSDL_LogVerbose SDL_LogVerbose;
|
||||||
|
pSDL_LogDebug SDL_LogDebug;
|
||||||
|
pSDL_LogInfo SDL_LogInfo;
|
||||||
|
pSDL_LogWarn SDL_LogWarn;
|
||||||
|
pSDL_LogError SDL_LogError;
|
||||||
|
pSDL_LogCritical SDL_LogCritical;
|
||||||
|
pSDL_LogMessage SDL_LogMessage;
|
||||||
|
pSDL_LogMessageV SDL_LogMessageV;
|
||||||
|
pSDL_LogGetOutputFunction SDL_LogGetOutputFunction;
|
||||||
|
pSDL_LogSetOutputFunction SDL_LogSetOutputFunction;
|
||||||
|
}
|
||||||
|
}
|
||||||
75
demos/external/wasm_imports/bindbc/sdl/bind/sdlmessagebox.d
vendored
Normal file
75
demos/external/wasm_imports/bindbc/sdl/bind/sdlmessagebox.d
vendored
Normal file
|
|
@ -0,0 +1,75 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlmessagebox;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
import bindbc.sdl.bind.sdlvideo : SDL_Window;
|
||||||
|
|
||||||
|
enum SDL_MessageBoxFlags {
|
||||||
|
SDL_MESSAGEBOX_ERROR = 0x00000010,
|
||||||
|
SDL_MESSAGEBOX_WARNING = 0x00000020,
|
||||||
|
SDL_MESSAGEBOX_INFORMATION = 0x00000040,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_MessageBoxFlags);
|
||||||
|
|
||||||
|
enum SDL_MessageBoxButtonFlags {
|
||||||
|
SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001,
|
||||||
|
SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_MessageBoxButtonFlags);
|
||||||
|
|
||||||
|
struct SDL_MessageBoxButtonData {
|
||||||
|
uint flags;
|
||||||
|
int buttonid;
|
||||||
|
const(char)* text;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_MessageBoxColor {
|
||||||
|
ubyte r, g, b;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SDL_MessageBoxColorType {
|
||||||
|
SDL_MESSAGEBOX_COLOR_BACKGROUND,
|
||||||
|
SDL_MESSAGEBOX_COLOR_TEXT,
|
||||||
|
SDL_MESSAGEBOX_COLOR_BUTTON_BORDER,
|
||||||
|
SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND,
|
||||||
|
SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED,
|
||||||
|
SDL_MESSAGEBOX_COLOR_MAX,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_MessageBoxColorType);
|
||||||
|
|
||||||
|
struct SDL_MessageBoxColorScheme {
|
||||||
|
SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_MAX] colors;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_MessageBoxData {
|
||||||
|
uint flags;
|
||||||
|
SDL_Window* window;
|
||||||
|
const(char)* title;
|
||||||
|
const(char)* message;
|
||||||
|
int numbuttons;
|
||||||
|
const(SDL_MessageBoxButtonData)* buttons;
|
||||||
|
const(SDL_MessageBoxColorScheme)* colorScheme;
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
int SDL_ShowMessageBox(const(SDL_MessageBoxData)*,int*);
|
||||||
|
int SDL_ShowSimpleMessageBox(uint,const(char)*,const(char)*,SDL_Window*);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_ShowMessageBox = int function(const(SDL_MessageBoxData)*,int*);
|
||||||
|
alias pSDL_ShowSimpleMessageBox = int function(uint,const(char)*,const(char)*,SDL_Window*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_ShowMessageBox SDL_ShowMessageBox;
|
||||||
|
pSDL_ShowSimpleMessageBox SDL_ShowSimpleMessageBox;
|
||||||
|
}
|
||||||
|
}
|
||||||
140
demos/external/wasm_imports/bindbc/sdl/bind/sdlmouse.d
vendored
Normal file
140
demos/external/wasm_imports/bindbc/sdl/bind/sdlmouse.d
vendored
Normal file
|
|
@ -0,0 +1,140 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlmouse;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
import bindbc.sdl.bind.sdlstdinc : SDL_bool;
|
||||||
|
import bindbc.sdl.bind.sdlsurface : SDL_Surface;
|
||||||
|
import bindbc.sdl.bind.sdlvideo : SDL_Window;
|
||||||
|
|
||||||
|
struct SDL_Cursor;
|
||||||
|
|
||||||
|
enum SDL_SystemCursor {
|
||||||
|
SDL_SYSTEM_CURSOR_ARROW,
|
||||||
|
SDL_SYSTEM_CURSOR_IBEAM,
|
||||||
|
SDL_SYSTEM_CURSOR_WAIT,
|
||||||
|
SDL_SYSTEM_CURSOR_CROSSHAIR,
|
||||||
|
SDL_SYSTEM_CURSOR_WAITARROW,
|
||||||
|
SDL_SYSTEM_CURSOR_SIZENWSE,
|
||||||
|
SDL_SYSTEM_CURSOR_SIZENESW,
|
||||||
|
SDL_SYSTEM_CURSOR_SIZEWE,
|
||||||
|
SDL_SYSTEM_CURSOR_SIZENS,
|
||||||
|
SDL_SYSTEM_CURSOR_SIZEALL,
|
||||||
|
SDL_SYSTEM_CURSOR_NO,
|
||||||
|
SDL_SYSTEM_CURSOR_HAND,
|
||||||
|
SDL_NUM_SYSTEM_CURSORS
|
||||||
|
}
|
||||||
|
|
||||||
|
alias SDL_SYSTEM_CURSOR_ARROW = SDL_SystemCursor.SDL_SYSTEM_CURSOR_ARROW;
|
||||||
|
alias SDL_SYSTEM_CURSOR_IBEAM = SDL_SystemCursor.SDL_SYSTEM_CURSOR_IBEAM;
|
||||||
|
alias SDL_SYSTEM_CURSOR_WAIT = SDL_SystemCursor.SDL_SYSTEM_CURSOR_WAIT;
|
||||||
|
alias SDL_SYSTEM_CURSOR_CROSSHAIR = SDL_SystemCursor.SDL_SYSTEM_CURSOR_CROSSHAIR;
|
||||||
|
alias SDL_SYSTEM_CURSOR_WAITARROW = SDL_SystemCursor.SDL_SYSTEM_CURSOR_WAITARROW;
|
||||||
|
alias SDL_SYSTEM_CURSOR_SIZENWSE = SDL_SystemCursor.SDL_SYSTEM_CURSOR_SIZENWSE;
|
||||||
|
alias SDL_SYSTEM_CURSOR_SIZENESW = SDL_SystemCursor.SDL_SYSTEM_CURSOR_SIZENESW;
|
||||||
|
alias SDL_SYSTEM_CURSOR_SIZEWE = SDL_SystemCursor.SDL_SYSTEM_CURSOR_SIZEWE;
|
||||||
|
alias SDL_SYSTEM_CURSOR_SIZENS = SDL_SystemCursor.SDL_SYSTEM_CURSOR_SIZENS;
|
||||||
|
alias SDL_SYSTEM_CURSOR_SIZEALL = SDL_SystemCursor.SDL_SYSTEM_CURSOR_SIZEALL;
|
||||||
|
alias SDL_SYSTEM_CURSOR_NO = SDL_SystemCursor.SDL_SYSTEM_CURSOR_NO;
|
||||||
|
alias SDL_SYSTEM_CURSOR_HAND = SDL_SystemCursor.SDL_SYSTEM_CURSOR_HAND;
|
||||||
|
alias SDL_NUM_SYSTEM_CURSORS = SDL_SystemCursor.SDL_NUM_SYSTEM_CURSORS;
|
||||||
|
|
||||||
|
enum SDL_BUTTON(ubyte x) = 1 << (x-1);
|
||||||
|
|
||||||
|
enum : ubyte {
|
||||||
|
SDL_BUTTON_LEFT = 1,
|
||||||
|
SDL_BUTTON_MIDDLE = 2,
|
||||||
|
SDL_BUTTON_RIGHT = 3,
|
||||||
|
SDL_BUTTON_X1 = 4,
|
||||||
|
SDL_BUTTON_X2 = 5,
|
||||||
|
SDL_BUTTON_LMASK = SDL_BUTTON!(SDL_BUTTON_LEFT),
|
||||||
|
SDL_BUTTON_MMASK = SDL_BUTTON!(SDL_BUTTON_MIDDLE),
|
||||||
|
SDL_BUTTON_RMASK = SDL_BUTTON!(SDL_BUTTON_RIGHT),
|
||||||
|
SDL_BUTTON_X1MASK = SDL_BUTTON!(SDL_BUTTON_X1),
|
||||||
|
SDL_BUTTON_X2MASK = SDL_BUTTON!(SDL_BUTTON_X2),
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
enum SDL_MouseWheelDirection {
|
||||||
|
SDL_MOUSEWHEEL_NORMAL,
|
||||||
|
SDL_MOUSEWHEEL_FLIPPED,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
SDL_Window* SDL_GetMouseFocus();
|
||||||
|
uint SDL_GetMouseState(int*,int*);
|
||||||
|
uint SDL_GetRelativeMouseState(int*,int*);
|
||||||
|
void SDL_WarpMouseInWindow(SDL_Window*,int,int);
|
||||||
|
int SDL_SetRelativeMouseMode(SDL_bool);
|
||||||
|
SDL_bool SDL_GetRelativeMouseMode();
|
||||||
|
SDL_Cursor* SDL_CreateCursor(const(ubyte)*,const(ubyte)*,int,int,int,int);
|
||||||
|
SDL_Cursor* SDL_CreateColorCursor(SDL_Surface*,int,int);
|
||||||
|
SDL_Cursor* SDL_CreateSystemCursor(SDL_SystemCursor);
|
||||||
|
void SDL_SetCursor(SDL_Cursor*);
|
||||||
|
SDL_Cursor* SDL_GetCursor();
|
||||||
|
SDL_Cursor* SDL_GetDefaultCursor();
|
||||||
|
void SDL_FreeCursor(SDL_Cursor*);
|
||||||
|
int SDL_ShowCursor(int);
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
int SDL_CaptureMouse(SDL_bool);
|
||||||
|
uint SDL_GetGlobalMouseState(int*,int*);
|
||||||
|
void SDL_WarpMouseGlobal(int,int);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GetMouseFocus = SDL_Window* function();
|
||||||
|
alias pSDL_GetMouseState = uint function(int*,int*);
|
||||||
|
alias pSDL_GetRelativeMouseState = uint function(int*,int*);
|
||||||
|
alias pSDL_WarpMouseInWindow = void function(SDL_Window*,int,int);
|
||||||
|
alias pSDL_SetRelativeMouseMode = int function(SDL_bool);
|
||||||
|
alias pSDL_GetRelativeMouseMode = SDL_bool function();
|
||||||
|
alias pSDL_CreateCursor = SDL_Cursor* function(const(ubyte)*,const(ubyte)*,int,int,int,int);
|
||||||
|
alias pSDL_CreateColorCursor = SDL_Cursor* function(SDL_Surface*,int,int);
|
||||||
|
alias pSDL_CreateSystemCursor = SDL_Cursor* function(SDL_SystemCursor);
|
||||||
|
alias pSDL_SetCursor = void function(SDL_Cursor*);
|
||||||
|
alias pSDL_GetCursor = SDL_Cursor* function();
|
||||||
|
alias pSDL_GetDefaultCursor = SDL_Cursor* function();
|
||||||
|
alias pSDL_FreeCursor = void function(SDL_Cursor*);
|
||||||
|
alias pSDL_ShowCursor = int function(int);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GetMouseFocus SDL_GetMouseFocus;
|
||||||
|
pSDL_GetMouseState SDL_GetMouseState;
|
||||||
|
pSDL_GetRelativeMouseState SDL_GetRelativeMouseState;
|
||||||
|
pSDL_WarpMouseInWindow SDL_WarpMouseInWindow;
|
||||||
|
pSDL_SetRelativeMouseMode SDL_SetRelativeMouseMode;
|
||||||
|
pSDL_GetRelativeMouseMode SDL_GetRelativeMouseMode;
|
||||||
|
pSDL_CreateCursor SDL_CreateCursor;
|
||||||
|
pSDL_CreateColorCursor SDL_CreateColorCursor;
|
||||||
|
pSDL_CreateSystemCursor SDL_CreateSystemCursor;
|
||||||
|
pSDL_SetCursor SDL_SetCursor;
|
||||||
|
pSDL_GetCursor SDL_GetCursor;
|
||||||
|
pSDL_GetDefaultCursor SDL_GetDefaultCursor;
|
||||||
|
pSDL_FreeCursor SDL_FreeCursor;
|
||||||
|
pSDL_ShowCursor SDL_ShowCursor;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_CaptureMouse = int function(SDL_bool);
|
||||||
|
alias pSDL_GetGlobalMouseState = uint function(int*,int*);
|
||||||
|
alias pSDL_WarpMouseGlobal = void function(int,int);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_CaptureMouse SDL_CaptureMouse;
|
||||||
|
pSDL_GetGlobalMouseState SDL_GetGlobalMouseState;
|
||||||
|
pSDL_WarpMouseGlobal SDL_WarpMouseGlobal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
283
demos/external/wasm_imports/bindbc/sdl/bind/sdlpixels.d
vendored
Normal file
283
demos/external/wasm_imports/bindbc/sdl/bind/sdlpixels.d
vendored
Normal file
|
|
@ -0,0 +1,283 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlpixels;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
import bindbc.sdl.bind.sdlstdinc : SDL_FOURCC, SDL_bool;
|
||||||
|
|
||||||
|
enum SDL_ALPHA_OPAQUE = 255;
|
||||||
|
enum SDL_ALPHA_TRANSPARENT = 0;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SDL_PIXELTYPE_UNKNOWN,
|
||||||
|
SDL_PIXELTYPE_INDEX1,
|
||||||
|
SDL_PIXELTYPE_INDEX4,
|
||||||
|
SDL_PIXELTYPE_INDEX8,
|
||||||
|
SDL_PIXELTYPE_PACKED8,
|
||||||
|
SDL_PIXELTYPE_PACKED16,
|
||||||
|
SDL_PIXELTYPE_PACKED32,
|
||||||
|
SDL_PIXELTYPE_ARRAYU8,
|
||||||
|
SDL_PIXELTYPE_ARRAYU16,
|
||||||
|
SDL_PIXELTYPE_ARRAYU32,
|
||||||
|
SDL_PIXELTYPE_ARRAYF16,
|
||||||
|
SDL_PIXELTYPE_ARRAYF32
|
||||||
|
}
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SDL_BITMAPORDER_NONE,
|
||||||
|
SDL_BITMAPORDER_4321,
|
||||||
|
SDL_BITMAPORDER_1234
|
||||||
|
}
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SDL_PACKEDORDER_NONE,
|
||||||
|
SDL_PACKEDORDER_XRGB,
|
||||||
|
SDL_PACKEDORDER_RGBX,
|
||||||
|
SDL_PACKEDORDER_ARGB,
|
||||||
|
SDL_PACKEDORDER_RGBA,
|
||||||
|
SDL_PACKEDORDER_XBGR,
|
||||||
|
SDL_PACKEDORDER_BGRX,
|
||||||
|
SDL_PACKEDORDER_ABGR,
|
||||||
|
SDL_PACKEDORDER_BGRA
|
||||||
|
}
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SDL_ARRAYORDER_NONE,
|
||||||
|
SDL_ARRAYORDER_RGB,
|
||||||
|
SDL_ARRAYORDER_RGBA,
|
||||||
|
SDL_ARRAYORDER_ARGB,
|
||||||
|
SDL_ARRAYORDER_BGR,
|
||||||
|
SDL_ARRAYORDER_BGRA,
|
||||||
|
SDL_ARRAYORDER_ABGR
|
||||||
|
}
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SDL_PACKEDLAYOUT_NONE,
|
||||||
|
SDL_PACKEDLAYOUT_332,
|
||||||
|
SDL_PACKEDLAYOUT_4444,
|
||||||
|
SDL_PACKEDLAYOUT_1555,
|
||||||
|
SDL_PACKEDLAYOUT_5551,
|
||||||
|
SDL_PACKEDLAYOUT_565,
|
||||||
|
SDL_PACKEDLAYOUT_8888,
|
||||||
|
SDL_PACKEDLAYOUT_2101010,
|
||||||
|
SDL_PACKEDLAYOUT_1010102
|
||||||
|
}
|
||||||
|
|
||||||
|
alias SDL_DEFINE_PIXELFOURCC = SDL_FOURCC;
|
||||||
|
|
||||||
|
enum uint SDL_DEFINE_PIXELFORMAT(int type, int order, int layout, int bits, int bytes) =
|
||||||
|
(1 << 28) | (type << 24) | (order << 20) | (layout << 16) | (bits << 8) | (bytes << 0);
|
||||||
|
|
||||||
|
enum uint SDL_PIXELFLAG(uint x) = (x >> 28) & 0x0F;
|
||||||
|
enum uint SDL_PIXELTYPE(uint x) = (x >> 24) & 0x0F;
|
||||||
|
enum uint SDL_PIXELORDER(uint x) = (x >> 20) & 0x0F;
|
||||||
|
enum uint SDL_PIXELLAYOUT(uint x) = (x >> 16) & 0x0F;
|
||||||
|
enum uint SDL_BITSPERPIXEL(uint x) = (x >> 8) & 0xFF;
|
||||||
|
|
||||||
|
template SDL_BYTESPERPIXEL(uint x) {
|
||||||
|
static if(SDL_ISPIXELFORMAT_FOURCC!x) {
|
||||||
|
static if(x == SDL_PIXELFORMAT_YUY2 || x == SDL_PIXELFORMAT_UYVY || x == SDL_PIXELFORMAT_YVYU)
|
||||||
|
enum SDL_BYTESPERPIXEL = 2;
|
||||||
|
else enum SDL_BYTESPERPIXEL = 1;
|
||||||
|
}
|
||||||
|
else enum SDL_BYTESPERPIXEL = (x >> 0) & 0xFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
template SDL_ISPIXELFORMAT_INDEXED(uint format) {
|
||||||
|
static if(SDL_ISPIXELFORMAT_FOURCC!format) {
|
||||||
|
enum SDL_ISPIXELFORMAT_INDEXED = SDL_PIXELTYPE!format == SDL_PIXELTYPE_INDEX1 || SDL_PIXELTYPE!format == SDL_PIXELTYPE_INDEX4 ||
|
||||||
|
SDL_PIXELTYPE!format == SDL_PIXELTYPE_INDEX8;
|
||||||
|
}
|
||||||
|
else enum SDL_ISPIXELFORMAT_INDEXED = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
template SDL_ISPIXELFORMAT_PACKED(uint format) {
|
||||||
|
static if(SDL_ISPIXELFORMAT_FOURCC!format) {
|
||||||
|
enum SDL_ISPIXELFORMAT_PACKED = SDL_PIXELTYPE!format == SDL_PIXELTYPE_PACKED8 || SDL_PIXELTYPE!format == SDL_PIXELTYPE_PACKED16 ||
|
||||||
|
SDL_PIXELTYPE!format == SDL_PIXELTYPE_PACKED32;
|
||||||
|
}
|
||||||
|
else enum SDL_ISPIXELFORMAT_PACKED = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
template SDL_ISPIXELFORMAT_ARRAY(uint format) {
|
||||||
|
static if(SDL_ISPIXELFORMAT_FOURCC!format) {
|
||||||
|
enum SDL_ISPIXELFORMAT_ARRAY = SDL_PIXELTYPE!format == SDL_PIXELTYPE_ARRAYU8 || SDL_PIXELTYPE!format == SDL_PIXELTYPE_ARRAYU16 ||
|
||||||
|
SDL_PIXELTYPE!format == SDL_PIXELTYPE_ARRAYU32 || SDL_PIXELTYPE!format == SDL_PIXELTYPE_ARRAYF16 ||
|
||||||
|
SDL_PIXELTYPE!format == SDL_PIXELTYPE_ARRAYF32;
|
||||||
|
}
|
||||||
|
else enum SDL_ISPIXELFORMAT_ARRAY = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template SDL_ISPIXELFORMAT_ALPHA(uint format) {
|
||||||
|
static if(SDL_ISPIXELFORMAT_PACKED!format) {
|
||||||
|
enum SDL_ISPIXELFORMAT_ALPHA = (SDL_PIXELORDER!format == SDL_PACKEDORDER_ARGB || SDL_PIXELORDER!format == SDL_PACKEDORDER_RGBA ||
|
||||||
|
SDL_PIXELORDER!format == SDL_PACKEDORDER_ABGR || SDL_PIXELORDER!format == SDL_PACKEDORDER_BGRA);
|
||||||
|
}
|
||||||
|
else static if(sdlSupport >= SDLSupport.sdl204 && SDL_ISPIXELFORMAT_ARRAY!format) {
|
||||||
|
enum SDL_ISPIXELFORMAT_ALPHA = (SDL_PIXELORDER!format == SDL_ARRAYORDER_ARGB || SDL_PIXELORDER!format == SDL_ARRAYORDER_RGBA ||
|
||||||
|
SDL_PIXELORDER!format == SDL_ARRAYORDER_ABGR || SDL_PIXELORDER!format == SDL_ARRAYORDER_BGRA);
|
||||||
|
}
|
||||||
|
else enum SDL_ISPIXELFORMAT_ALPHA = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SDL_ISPIXELFORMAT_FOURCC(uint format) = format && !(format & 0x80000000);
|
||||||
|
|
||||||
|
enum SDL_PIXELFORMAT_UNKNOWN = 0;
|
||||||
|
enum SDL_PIXELFORMAT_INDEX1LSB = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0, 1, 0);
|
||||||
|
enum SDL_PIXELFORMAT_INDEX1MSB = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0, 1, 0);
|
||||||
|
enum SDL_PIXELFORMAT_INDEX4LSB = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0, 4, 0);
|
||||||
|
enum SDL_PIXELFORMAT_INDEX4MSB = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0, 4, 0);
|
||||||
|
enum SDL_PIXELFORMAT_INDEX8 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1);
|
||||||
|
enum SDL_PIXELFORMAT_RGB332 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_332, 8, 1);
|
||||||
|
enum SDL_PIXELFORMAT_RGB444 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_4444, 12, 2);
|
||||||
|
enum SDL_PIXELFORMAT_RGB555 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_1555, 15, 2);
|
||||||
|
enum SDL_PIXELFORMAT_BGR555 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_1555, 15, 2);
|
||||||
|
enum SDL_PIXELFORMAT_ARGB4444 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_4444, 16, 2);
|
||||||
|
enum SDL_PIXELFORMAT_RGBA4444 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, SDL_PACKEDLAYOUT_4444, 16, 2);
|
||||||
|
enum SDL_PIXELFORMAT_ABGR4444 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_4444, 16, 2);
|
||||||
|
enum SDL_PIXELFORMAT_BGRA4444 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, SDL_PACKEDLAYOUT_4444, 16, 2);
|
||||||
|
enum SDL_PIXELFORMAT_ARGB1555 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_1555, 16, 2);
|
||||||
|
enum SDL_PIXELFORMAT_RGBA5551 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, SDL_PACKEDLAYOUT_5551, 16, 2);
|
||||||
|
enum SDL_PIXELFORMAT_ABGR1555 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_1555, 16, 2);
|
||||||
|
enum SDL_PIXELFORMAT_BGRA5551 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, SDL_PACKEDLAYOUT_5551, 16, 2);
|
||||||
|
enum SDL_PIXELFORMAT_RGB565 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_565, 16, 2);
|
||||||
|
enum SDL_PIXELFORMAT_BGR565 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_565, 16, 2);
|
||||||
|
enum SDL_PIXELFORMAT_RGB24 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0, 24, 3);
|
||||||
|
enum SDL_PIXELFORMAT_BGR24 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0, 24, 3);
|
||||||
|
enum SDL_PIXELFORMAT_RGB888 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_8888, 24, 4);
|
||||||
|
enum SDL_PIXELFORMAT_RGBX8888 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX, SDL_PACKEDLAYOUT_8888, 24, 4);
|
||||||
|
enum SDL_PIXELFORMAT_BGR888 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_8888, 24, 4);
|
||||||
|
enum SDL_PIXELFORMAT_BGRX8888 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX, SDL_PACKEDLAYOUT_8888, 24, 4);
|
||||||
|
enum SDL_PIXELFORMAT_ARGB8888 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_8888, 32, 4);
|
||||||
|
enum SDL_PIXELFORMAT_RGBA8888 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA, SDL_PACKEDLAYOUT_8888, 32, 4);
|
||||||
|
enum SDL_PIXELFORMAT_ABGR8888 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_8888, 32, 4);
|
||||||
|
enum SDL_PIXELFORMAT_BGRA8888 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA, SDL_PACKEDLAYOUT_8888, 32, 4);
|
||||||
|
enum SDL_PIXELFORMAT_ARGB2101010 = SDL_DEFINE_PIXELFORMAT!(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_2101010, 32, 4);
|
||||||
|
|
||||||
|
enum SDL_PIXELFORMAT_YV12 = SDL_DEFINE_PIXELFOURCC!('Y', 'V', '1', '2');
|
||||||
|
enum SDL_PIXELFORMAT_IYUV = SDL_DEFINE_PIXELFOURCC!('I', 'Y', 'U', 'V');
|
||||||
|
enum SDL_PIXELFORMAT_YUY2 = SDL_DEFINE_PIXELFOURCC!('Y', 'U', 'Y', '2');
|
||||||
|
enum SDL_PIXELFORMAT_UYVY = SDL_DEFINE_PIXELFOURCC!('U', 'Y', 'V', 'Y');
|
||||||
|
enum SDL_PIXELFORMAT_YVYU = SDL_DEFINE_PIXELFOURCC!('Y', 'V', 'Y', 'U');
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
enum SDL_PIXELFORMAT_NV12 = SDL_DEFINE_PIXELFOURCC!('N', 'V', '1', '2');
|
||||||
|
enum SDL_PIXELFORMAT_NV21 = SDL_DEFINE_PIXELFOURCC!('N', 'V', '2', '1');
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl208) {
|
||||||
|
enum SDL_PIXELFORMAT_EXTERNAL_OES = SDL_DEFINE_PIXELFOURCC!('O', 'E', 'S', ' ');
|
||||||
|
}
|
||||||
|
|
||||||
|
static assert(SDL_PIXELFORMAT_BGRX8888 == 0x16661804);
|
||||||
|
|
||||||
|
// Added in SDL 2.0.5, but doesn't hurt to make available for every version.
|
||||||
|
version(BigEndian) {
|
||||||
|
alias SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_RGBA8888;
|
||||||
|
alias SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888;
|
||||||
|
alias SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888;
|
||||||
|
alias SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
alias SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888;
|
||||||
|
alias SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888;
|
||||||
|
alias SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888;
|
||||||
|
alias SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_Color {
|
||||||
|
ubyte r;
|
||||||
|
ubyte g;
|
||||||
|
ubyte b;
|
||||||
|
ubyte a;
|
||||||
|
}
|
||||||
|
alias SDL_Colour = SDL_Color;
|
||||||
|
|
||||||
|
struct SDL_Palette {
|
||||||
|
int ncolors;
|
||||||
|
SDL_Color* colors;
|
||||||
|
uint version_; // NOTE: original was named 'version'
|
||||||
|
int refcount;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_PixelFormat {
|
||||||
|
uint format;
|
||||||
|
SDL_Palette *palette;
|
||||||
|
ubyte BitsPerPixel;
|
||||||
|
ubyte BytesPerPixel;
|
||||||
|
ubyte[2] padding;
|
||||||
|
uint Rmask;
|
||||||
|
uint Gmask;
|
||||||
|
uint Bmask;
|
||||||
|
uint Amask;
|
||||||
|
ubyte Rloss;
|
||||||
|
ubyte Gloss;
|
||||||
|
ubyte Bloss;
|
||||||
|
ubyte Aloss;
|
||||||
|
ubyte Rshift;
|
||||||
|
ubyte Gshift;
|
||||||
|
ubyte Bshift;
|
||||||
|
ubyte Ashift;
|
||||||
|
int refcount;
|
||||||
|
SDL_PixelFormat* next;
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
const(char)* SDL_GetPixelFormatName(uint);
|
||||||
|
SDL_bool SDL_PixelFormatEnumToMasks(uint,int*,uint*,uint*,uint*,uint*);
|
||||||
|
uint SDL_MasksToPixelFormatEnum(int,uint,uint,uint,uint);
|
||||||
|
SDL_PixelFormat* SDL_AllocFormat(uint);
|
||||||
|
void SDL_FreeFormat(SDL_PixelFormat*);
|
||||||
|
SDL_Palette* SDL_AllocPalette(int);
|
||||||
|
int SDL_SetPixelFormatPalette(SDL_PixelFormat*,SDL_Palette*);
|
||||||
|
int SDL_SetPaletteColors(SDL_Palette*,const(SDL_Color)*,int,int);
|
||||||
|
void SDL_FreePalette(SDL_Palette*);
|
||||||
|
uint SDL_MapRGB(const(SDL_PixelFormat)*,ubyte,ubyte,ubyte);
|
||||||
|
uint SDL_MapRGBA(const(SDL_PixelFormat)*,ubyte,ubyte,ubyte,ubyte);
|
||||||
|
void SDL_GetRGB(uint,const(SDL_PixelFormat)*,ubyte*,ubyte*,ubyte*);
|
||||||
|
void SDL_GetRGBA(uint,const(SDL_PixelFormat)*,ubyte*,ubyte*,ubyte*,ubyte*);
|
||||||
|
void SDL_CalculateGammaRamp(float,ushort*);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GetPixelFormatName = const(char)* function(uint);
|
||||||
|
alias pSDL_PixelFormatEnumToMasks = SDL_bool function(uint,int*,uint*,uint*,uint*,uint*);
|
||||||
|
alias pSDL_MasksToPixelFormatEnum = uint function(int,uint,uint,uint,uint);
|
||||||
|
alias pSDL_AllocFormat = SDL_PixelFormat* function(uint);
|
||||||
|
alias pSDL_FreeFormat = void function(SDL_PixelFormat*);
|
||||||
|
alias pSDL_AllocPalette = SDL_Palette* function(int);
|
||||||
|
alias pSDL_SetPixelFormatPalette = int function(SDL_PixelFormat*,SDL_Palette*);
|
||||||
|
alias pSDL_SetPaletteColors = int function(SDL_Palette*,const(SDL_Color)*,int,int);
|
||||||
|
alias pSDL_FreePalette = void function(SDL_Palette*);
|
||||||
|
alias pSDL_MapRGB = uint function(const(SDL_PixelFormat)*,ubyte,ubyte,ubyte);
|
||||||
|
alias pSDL_MapRGBA = uint function(const(SDL_PixelFormat)*,ubyte,ubyte,ubyte,ubyte);
|
||||||
|
alias pSDL_GetRGB = void function(uint,const(SDL_PixelFormat)*,ubyte*,ubyte*,ubyte*);
|
||||||
|
alias pSDL_GetRGBA = void function(uint,const(SDL_PixelFormat)*,ubyte*,ubyte*,ubyte*,ubyte*);
|
||||||
|
alias pSDL_CalculateGammaRamp = void function(float,ushort*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GetPixelFormatName SDL_GetPixelFormatName;
|
||||||
|
pSDL_PixelFormatEnumToMasks SDL_PixelFormatEnumToMasks;
|
||||||
|
pSDL_MasksToPixelFormatEnum SDL_MasksToPixelFormatEnum;
|
||||||
|
pSDL_AllocFormat SDL_AllocFormat;
|
||||||
|
pSDL_FreeFormat SDL_FreeFormat;
|
||||||
|
pSDL_AllocPalette SDL_AllocPalette;
|
||||||
|
pSDL_SetPixelFormatPalette SDL_SetPixelFormatPalette;
|
||||||
|
pSDL_SetPaletteColors SDL_SetPaletteColors;
|
||||||
|
pSDL_FreePalette SDL_FreePalette;
|
||||||
|
pSDL_MapRGB SDL_MapRGB;
|
||||||
|
pSDL_MapRGBA SDL_MapRGBA;
|
||||||
|
pSDL_GetRGB SDL_GetRGB;
|
||||||
|
pSDL_GetRGBA SDL_GetRGBA;
|
||||||
|
pSDL_CalculateGammaRamp SDL_CalculateGammaRamp;
|
||||||
|
}
|
||||||
|
}
|
||||||
22
demos/external/wasm_imports/bindbc/sdl/bind/sdlplatform.d
vendored
Normal file
22
demos/external/wasm_imports/bindbc/sdl/bind/sdlplatform.d
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlplatform;
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
const(char)* SDL_GetPlatform();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GetPlatform = const(char)* function();
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GetPlatform SDL_GetPlatform;
|
||||||
|
}
|
||||||
|
}
|
||||||
33
demos/external/wasm_imports/bindbc/sdl/bind/sdlpower.d
vendored
Normal file
33
demos/external/wasm_imports/bindbc/sdl/bind/sdlpower.d
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlpower;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
|
||||||
|
enum SDL_PowerState {
|
||||||
|
SDL_POWERSTATE_UNKNOWN,
|
||||||
|
SDL_POWERSTATE_ON_BATTERY,
|
||||||
|
SDL_POWERSTATE_NO_BATTERY,
|
||||||
|
SDL_POWERSTATE_CHARGING,
|
||||||
|
SDL_POWERSTATE_CHARGED
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_PowerState);
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
SDL_PowerState SDL_GetPowerInfo(int*,int*);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GetPowerInfo = SDL_PowerState function(int*,int*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GetPowerInfo SDL_GetPowerInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
80
demos/external/wasm_imports/bindbc/sdl/bind/sdlrect.d
vendored
Normal file
80
demos/external/wasm_imports/bindbc/sdl/bind/sdlrect.d
vendored
Normal file
|
|
@ -0,0 +1,80 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlrect;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
import bindbc.sdl.bind.sdlstdinc : SDL_bool;
|
||||||
|
|
||||||
|
struct SDL_Point {
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_Rect {
|
||||||
|
int x, y;
|
||||||
|
int w, h;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl2010) {
|
||||||
|
struct SDL_FPoint {
|
||||||
|
float x, y;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_FRect {
|
||||||
|
float x, y;
|
||||||
|
float w, h;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@nogc nothrow pure {
|
||||||
|
// This macro was added to SDL_rect.h in 2.0.4, but hurts nothing to implement for
|
||||||
|
// all versions.
|
||||||
|
bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r) {
|
||||||
|
pragma(inline, true);
|
||||||
|
return ((p.x >= r.x) && (p.x < (r.x + r.w)) &&
|
||||||
|
(p.y >= r.y) && (p.y < (r.y + r.h)));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SDL_RectEmpty(const(SDL_Rect)* X) {
|
||||||
|
pragma(inline, true);
|
||||||
|
return !X || (X.w <= 0) || (X.h <= 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SDL_RectEquals(const(SDL_Rect)* A, const(SDL_Rect)* B) {
|
||||||
|
pragma(inline, true);
|
||||||
|
return A && B &&
|
||||||
|
(A.x == B.x) && (A.y == B.y) &&
|
||||||
|
(A.w == B.w) && (A.h == B.h);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
SDL_bool SDL_HasIntersection(const(SDL_Rect)*,const(SDL_Rect)*);
|
||||||
|
SDL_bool SDL_IntersectRect(const(SDL_Rect)*,const(SDL_Rect)*,SDL_Rect*);
|
||||||
|
void SDL_UnionRect(const(SDL_Rect)*,const(SDL_Rect)*,SDL_Rect*);
|
||||||
|
SDL_bool SDL_EnclosePoints(const(SDL_Point)*,int,const(SDL_Rect)*,SDL_Rect*);
|
||||||
|
SDL_bool SDL_IntersectRectAndLine(const(SDL_Rect)*,int*,int*,int*,int*);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_HasIntersection = SDL_bool function(const(SDL_Rect)*,const(SDL_Rect)*);
|
||||||
|
alias pSDL_IntersectRect = SDL_bool function(const(SDL_Rect)*,const(SDL_Rect)*,SDL_Rect*);
|
||||||
|
alias pSDL_UnionRect = void function(const(SDL_Rect)*,const(SDL_Rect)*,SDL_Rect*);
|
||||||
|
alias pSDL_EnclosePoints = SDL_bool function(const(SDL_Point)*,int,const(SDL_Rect)*,SDL_Rect*);
|
||||||
|
alias pSDL_IntersectRectAndLine = SDL_bool function(const(SDL_Rect)*,int*,int*,int*,int*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_HasIntersection SDL_HasIntersection;
|
||||||
|
pSDL_IntersectRect SDL_IntersectRect;
|
||||||
|
pSDL_UnionRect SDL_UnionRect;
|
||||||
|
pSDL_EnclosePoints SDL_EnclosePoints;
|
||||||
|
pSDL_IntersectRectAndLine SDL_IntersectRectAndLine;
|
||||||
|
}
|
||||||
|
}
|
||||||
316
demos/external/wasm_imports/bindbc/sdl/bind/sdlrender.d
vendored
Normal file
316
demos/external/wasm_imports/bindbc/sdl/bind/sdlrender.d
vendored
Normal file
|
|
@ -0,0 +1,316 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlrender;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
import bindbc.sdl.bind.sdlblendmode : SDL_BlendMode;
|
||||||
|
import bindbc.sdl.bind.sdlrect;
|
||||||
|
import bindbc.sdl.bind.sdlstdinc : SDL_bool;
|
||||||
|
import bindbc.sdl.bind.sdlsurface : SDL_Surface;
|
||||||
|
import bindbc.sdl.bind.sdlvideo : SDL_Window;
|
||||||
|
|
||||||
|
enum SDL_RendererFlags : uint {
|
||||||
|
SDL_RENDERER_SOFTWARE = 0x00000001,
|
||||||
|
SDL_RENDERER_ACCELERATED = 0x00000002,
|
||||||
|
SDL_RENDERER_PRESENTVSYNC = 0x00000004,
|
||||||
|
SDL_RENDERER_TARGETTEXTURE = 0x00000008,
|
||||||
|
}
|
||||||
|
|
||||||
|
mixin(expandEnum!SDL_RendererFlags);
|
||||||
|
|
||||||
|
struct SDL_RendererInfo {
|
||||||
|
const(char)* name;
|
||||||
|
SDL_RendererFlags flags;
|
||||||
|
uint num_texture_formats;
|
||||||
|
uint[16] texture_formats;
|
||||||
|
int max_texture_width;
|
||||||
|
int max_texture_height;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SDL_TextureAccess {
|
||||||
|
SDL_TEXTUREACCESS_STATIC,
|
||||||
|
SDL_TEXTUREACCESS_STREAMING,
|
||||||
|
SDL_TEXTUREACCESS_TARGET,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_TextureAccess);
|
||||||
|
|
||||||
|
enum SDL_TextureModulate {
|
||||||
|
SDL_TEXTUREMODULATE_NONE = 0x00000000,
|
||||||
|
SDL_TEXTUREMODULATE_COLOR = 0x00000001,
|
||||||
|
SDL_TEXTUREMODULATE_ALPHA = 0x00000002
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_TextureModulate);
|
||||||
|
|
||||||
|
enum SDL_RendererFlip {
|
||||||
|
SDL_FLIP_NONE = 0x00000000,
|
||||||
|
SDL_FLIP_HORIZONTAL = 0x00000001,
|
||||||
|
SDL_FLIP_VERTICAL = 0x00000002,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_RendererFlip);
|
||||||
|
|
||||||
|
struct SDL_Renderer;
|
||||||
|
struct SDL_Texture;
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
int SDL_GetNumRenderDrivers();
|
||||||
|
int SDL_GetRenderDriverInfo(int,SDL_RendererInfo*);
|
||||||
|
int SDL_CreateWindowAndRenderer(int,int,uint,SDL_Window**,SDL_Renderer**);
|
||||||
|
SDL_Renderer* SDL_CreateRenderer(SDL_Window*,int,SDL_RendererFlags);
|
||||||
|
SDL_Renderer* SDL_CreateSoftwareRenderer(SDL_Surface*);
|
||||||
|
SDL_Renderer* SDL_GetRenderer(SDL_Window*);
|
||||||
|
int SDL_GetRendererInfo(SDL_Renderer*,SDL_RendererInfo*);
|
||||||
|
int SDL_GetRendererOutputSize(SDL_Renderer*,int*,int*);
|
||||||
|
SDL_Texture* SDL_CreateTexture(SDL_Renderer*,uint,SDL_TextureAccess,int,int);
|
||||||
|
SDL_Texture* SDL_CreateTextureFromSurface(SDL_Renderer*,SDL_Surface*);
|
||||||
|
int SDL_QueryTexture(SDL_Texture*,uint*,int*,int*,int*);
|
||||||
|
int SDL_SetTextureColorMod(SDL_Texture*,ubyte,ubyte,ubyte);
|
||||||
|
int SDL_GetTextureColorMod(SDL_Texture*,ubyte*,ubyte*,ubyte*);
|
||||||
|
int SDL_SetTextureAlphaMod(SDL_Texture*,ubyte);
|
||||||
|
int SDL_GetTextureAlphaMod(SDL_Texture*,ubyte*);
|
||||||
|
int SDL_SetTextureBlendMode(SDL_Texture*,SDL_BlendMode);
|
||||||
|
int SDL_GetTextureBlendMode(SDL_Texture*,SDL_BlendMode*);
|
||||||
|
int SDL_UpdateTexture(SDL_Texture*,const(SDL_Rect)*,const(void)*,int);
|
||||||
|
int SDL_LockTexture(SDL_Texture*,const(SDL_Rect)*,void**,int*);
|
||||||
|
void SDL_UnlockTexture(SDL_Texture*);
|
||||||
|
SDL_bool SDL_RenderTargetSupported(SDL_Renderer*);
|
||||||
|
int SDL_SetRenderTarget(SDL_Renderer*,SDL_Texture*);
|
||||||
|
SDL_Texture* SDL_GetRenderTarget(SDL_Renderer*);
|
||||||
|
int SDL_RenderSetClipRect(SDL_Renderer*,const(SDL_Rect)*);
|
||||||
|
void SDL_RenderGetClipRect(SDL_Renderer* renderer,SDL_Rect*);
|
||||||
|
int SDL_RenderSetLogicalSize(SDL_Renderer*,int,int);
|
||||||
|
void SDL_RenderGetLogicalSize(SDL_Renderer*,int*,int*);
|
||||||
|
int SDL_RenderSetViewport(SDL_Renderer*,const(SDL_Rect)*);
|
||||||
|
void SDL_RenderGetViewport(SDL_Renderer*,SDL_Rect*);
|
||||||
|
int SDL_RenderSetScale(SDL_Renderer*,float,float);
|
||||||
|
int SDL_RenderGetScale(SDL_Renderer*,float*,float*);
|
||||||
|
int SDL_SetRenderDrawColor(SDL_Renderer*,ubyte,ubyte,ubyte,ubyte);
|
||||||
|
int SDL_GetRenderDrawColor(SDL_Renderer*,ubyte*,ubyte*,ubyte*,ubyte*);
|
||||||
|
int SDL_SetRenderDrawBlendMode(SDL_Renderer*,SDL_BlendMode);
|
||||||
|
int SDL_GetRenderDrawBlendMode(SDL_Renderer*,SDL_BlendMode*);
|
||||||
|
int SDL_RenderClear(SDL_Renderer*);
|
||||||
|
int SDL_RenderDrawPoint(SDL_Renderer*,int,int);
|
||||||
|
int SDL_RenderDrawPoints(SDL_Renderer*,const(SDL_Point)*,int);
|
||||||
|
int SDL_RenderDrawLine(SDL_Renderer*,int,int,int,int);
|
||||||
|
int SDL_RenderDrawLines(SDL_Renderer*,const(SDL_Point)*,int);
|
||||||
|
int SDL_RenderDrawRect(SDL_Renderer*,const(SDL_Rect)*);
|
||||||
|
int SDL_RenderDrawRects(SDL_Renderer*,const(SDL_Rect)*,int);
|
||||||
|
int SDL_RenderFillRect(SDL_Renderer*,const(SDL_Rect)*);
|
||||||
|
int SDL_RenderFillRects(SDL_Renderer*,const(SDL_Rect)*,int);
|
||||||
|
int SDL_RenderCopy(SDL_Renderer*,SDL_Texture*,const(SDL_Rect)*,const(SDL_Rect*));
|
||||||
|
int SDL_RenderCopyEx(SDL_Renderer*,SDL_Texture*,const(SDL_Rect)*,const(SDL_Rect)*,const(double),const(SDL_Point)*,const(SDL_RendererFlip));
|
||||||
|
int SDL_RenderReadPixels(SDL_Renderer*,const(SDL_Rect)*,uint,void*,int);
|
||||||
|
void SDL_RenderPresent(SDL_Renderer*);
|
||||||
|
void SDL_DestroyTexture(SDL_Texture*);
|
||||||
|
void SDL_DestroyRenderer(SDL_Renderer*);
|
||||||
|
int SDL_GL_BindTexture(SDL_Texture*,float*,float*);
|
||||||
|
int SDL_GL_UnbindTexture(SDL_Texture*);
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl201) {
|
||||||
|
int SDL_UpdateYUVTexture(SDL_Texture*,const(SDL_Rect)*,const(ubyte)*,int,const(ubyte)*,int,const(ubyte)*,int);
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
SDL_bool SDL_RenderIsClipEnabled(SDL_Renderer*);
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl205) {
|
||||||
|
SDL_bool SDL_RenderGetIntegerScale(SDL_Renderer*);
|
||||||
|
int SDL_RenderSetIntegerScale(SDL_Renderer*,SDL_bool);
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl208) {
|
||||||
|
void* SDL_RenderGetMetalLayer(SDL_Renderer*);
|
||||||
|
void* SDL_RenderGetMetalCommandEncoder(SDL_Renderer*);
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl2010) {
|
||||||
|
int SDL_RenderDrawPointF(SDL_Renderer*,float,float);
|
||||||
|
int SDL_RenderDrawPointsF(SDL_Renderer*,const(SDL_FPoint)*,int);
|
||||||
|
int SDL_RenderDrawLineF(SDL_Renderer*,float,float,float,float);
|
||||||
|
int SDL_RenderDrawLinesF(SDL_Renderer*,const(SDL_FPoint)*,int);
|
||||||
|
int SDL_RenderDrawRectF(SDL_Renderer*,const(SDL_FRect)*);
|
||||||
|
int SDL_RenderDrawRectsF(SDL_Renderer*,const(SDL_FRect)*,int);
|
||||||
|
int SDL_RenderFillRectF(SDL_Renderer*,const(SDL_FRect)*);
|
||||||
|
int SDL_RenderFillRectsF(SDL_Renderer*,const(SDL_FRect)*,int);
|
||||||
|
int SDL_RenderCopyF(SDL_Renderer*,SDL_Texture*,const(SDL_FRect)*,const(SDL_FRect)*);
|
||||||
|
int SDL_RenderCopyExF(SDL_Renderer*,SDL_Texture*,const(SDL_FRect)*,const(SDL_FRect)*,const(double),const(SDL_FPoint)*,const(SDL_RendererFlip));
|
||||||
|
int SDL_RenderFlush(SDL_Renderer*);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GetNumRenderDrivers = int function();
|
||||||
|
alias pSDL_GetRenderDriverInfo = int function(int,SDL_RendererInfo*);
|
||||||
|
alias pSDL_CreateWindowAndRenderer = int function(int,int,uint,SDL_Window**,SDL_Renderer**);
|
||||||
|
alias pSDL_CreateRenderer = SDL_Renderer* function(SDL_Window*,int,SDL_RendererFlags);
|
||||||
|
alias pSDL_CreateSoftwareRenderer = SDL_Renderer* function(SDL_Surface*);
|
||||||
|
alias pSDL_GetRenderer = SDL_Renderer* function(SDL_Window*);
|
||||||
|
alias pSDL_GetRendererInfo = int function(SDL_Renderer*,SDL_RendererInfo*);
|
||||||
|
alias pSDL_GetRendererOutputSize = int function(SDL_Renderer*,int*,int*);
|
||||||
|
alias pSDL_CreateTexture = SDL_Texture* function(SDL_Renderer*,uint,SDL_TextureAccess,int,int);
|
||||||
|
alias pSDL_CreateTextureFromSurface = SDL_Texture* function(SDL_Renderer*,SDL_Surface*);
|
||||||
|
alias pSDL_QueryTexture = int function(SDL_Texture*,uint*,int*,int*,int*);
|
||||||
|
alias pSDL_SetTextureColorMod = int function(SDL_Texture*,ubyte,ubyte,ubyte);
|
||||||
|
alias pSDL_GetTextureColorMod = int function(SDL_Texture*,ubyte*,ubyte*,ubyte*);
|
||||||
|
alias pSDL_SetTextureAlphaMod = int function(SDL_Texture*,ubyte);
|
||||||
|
alias pSDL_GetTextureAlphaMod = int function(SDL_Texture*,ubyte*);
|
||||||
|
alias pSDL_SetTextureBlendMode = int function(SDL_Texture*,SDL_BlendMode);
|
||||||
|
alias pSDL_GetTextureBlendMode = int function(SDL_Texture*,SDL_BlendMode*);
|
||||||
|
alias pSDL_UpdateTexture = int function(SDL_Texture*,const(SDL_Rect)*,const(void)*,int);
|
||||||
|
alias pSDL_LockTexture = int function(SDL_Texture*,const(SDL_Rect)*,void**,int*);
|
||||||
|
alias pSDL_UnlockTexture = void function(SDL_Texture*);
|
||||||
|
alias pSDL_RenderTargetSupported = SDL_bool function(SDL_Renderer*);
|
||||||
|
alias pSDL_SetRenderTarget = int function(SDL_Renderer*,SDL_Texture*);
|
||||||
|
alias pSDL_GetRenderTarget = SDL_Texture* function(SDL_Renderer*);
|
||||||
|
alias pSDL_RenderSetClipRect = int function(SDL_Renderer*,const(SDL_Rect)*);
|
||||||
|
alias pSDL_RenderGetClipRect = void function(SDL_Renderer* renderer,SDL_Rect*);
|
||||||
|
alias pSDL_RenderSetLogicalSize = int function(SDL_Renderer*,int,int);
|
||||||
|
alias pSDL_RenderGetLogicalSize = void function(SDL_Renderer*,int*,int*);
|
||||||
|
alias pSDL_RenderSetViewport = int function(SDL_Renderer*,const(SDL_Rect)*);
|
||||||
|
alias pSDL_RenderGetViewport = void function(SDL_Renderer*,SDL_Rect*);
|
||||||
|
alias pSDL_RenderSetScale = int function(SDL_Renderer*,float,float);
|
||||||
|
alias pSDL_RenderGetScale = int function(SDL_Renderer*,float*,float*);
|
||||||
|
alias pSDL_SetRenderDrawColor = int function(SDL_Renderer*,ubyte,ubyte,ubyte,ubyte);
|
||||||
|
alias pSDL_GetRenderDrawColor = int function(SDL_Renderer*,ubyte*,ubyte*,ubyte*,ubyte*);
|
||||||
|
alias pSDL_SetRenderDrawBlendMode = int function(SDL_Renderer*,SDL_BlendMode);
|
||||||
|
alias pSDL_GetRenderDrawBlendMode = int function(SDL_Renderer*,SDL_BlendMode*);
|
||||||
|
alias pSDL_RenderClear = int function(SDL_Renderer*);
|
||||||
|
alias pSDL_RenderDrawPoint = int function(SDL_Renderer*,int,int);
|
||||||
|
alias pSDL_RenderDrawPoints = int function(SDL_Renderer*,const(SDL_Point)*,int);
|
||||||
|
alias pSDL_RenderDrawLine = int function(SDL_Renderer*,int,int,int,int);
|
||||||
|
alias pSDL_RenderDrawLines = int function(SDL_Renderer*,const(SDL_Point)*,int);
|
||||||
|
alias pSDL_RenderDrawRect = int function(SDL_Renderer*,const(SDL_Rect)*);
|
||||||
|
alias pSDL_RenderDrawRects = int function(SDL_Renderer*,const(SDL_Rect)*,int);
|
||||||
|
alias pSDL_RenderFillRect = int function(SDL_Renderer*,const(SDL_Rect)*);
|
||||||
|
alias pSDL_RenderFillRects = int function(SDL_Renderer*,const(SDL_Rect)*,int);
|
||||||
|
alias pSDL_RenderCopy = int function(SDL_Renderer*,SDL_Texture*,const(SDL_Rect)*,const(SDL_Rect*));
|
||||||
|
alias pSDL_RenderCopyEx = int function(SDL_Renderer*,SDL_Texture*,const(SDL_Rect)*,const(SDL_Rect)*,const(double),const(SDL_Point)*,const(SDL_RendererFlip));
|
||||||
|
alias pSDL_RenderReadPixels = int function(SDL_Renderer*,const(SDL_Rect)*,uint,void*,int);
|
||||||
|
alias pSDL_RenderPresent = void function(SDL_Renderer*);
|
||||||
|
alias pSDL_DestroyTexture = void function(SDL_Texture*);
|
||||||
|
alias pSDL_DestroyRenderer = void function(SDL_Renderer*);
|
||||||
|
alias pSDL_GL_BindTexture = int function(SDL_Texture*,float*,float*);
|
||||||
|
alias pSDL_GL_UnbindTexture = int function(SDL_Texture*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GetNumRenderDrivers SDL_GetNumRenderDrivers;
|
||||||
|
pSDL_GetRenderDriverInfo SDL_GetRenderDriverInfo;
|
||||||
|
pSDL_CreateWindowAndRenderer SDL_CreateWindowAndRenderer;
|
||||||
|
pSDL_CreateRenderer SDL_CreateRenderer;
|
||||||
|
pSDL_CreateSoftwareRenderer SDL_CreateSoftwareRenderer;
|
||||||
|
pSDL_GetRenderer SDL_GetRenderer;
|
||||||
|
pSDL_GetRendererInfo SDL_GetRendererInfo;
|
||||||
|
pSDL_GetRendererOutputSize SDL_GetRendererOutputSize;
|
||||||
|
pSDL_CreateTexture SDL_CreateTexture;
|
||||||
|
pSDL_CreateTextureFromSurface SDL_CreateTextureFromSurface;
|
||||||
|
pSDL_QueryTexture SDL_QueryTexture;
|
||||||
|
pSDL_SetTextureColorMod SDL_SetTextureColorMod;
|
||||||
|
pSDL_GetTextureColorMod SDL_GetTextureColorMod;
|
||||||
|
pSDL_SetTextureAlphaMod SDL_SetTextureAlphaMod;
|
||||||
|
pSDL_GetTextureAlphaMod SDL_GetTextureAlphaMod;
|
||||||
|
pSDL_SetTextureBlendMode SDL_SetTextureBlendMode;
|
||||||
|
pSDL_GetTextureBlendMode SDL_GetTextureBlendMode;
|
||||||
|
pSDL_UpdateTexture SDL_UpdateTexture;
|
||||||
|
pSDL_LockTexture SDL_LockTexture;
|
||||||
|
pSDL_UnlockTexture SDL_UnlockTexture;
|
||||||
|
pSDL_RenderTargetSupported SDL_RenderTargetSupported;
|
||||||
|
pSDL_SetRenderTarget SDL_SetRenderTarget;
|
||||||
|
pSDL_GetRenderTarget SDL_GetRenderTarget;
|
||||||
|
pSDL_RenderSetClipRect SDL_RenderSetClipRect;
|
||||||
|
pSDL_RenderGetClipRect SDL_RenderGetClipRect;
|
||||||
|
pSDL_RenderSetLogicalSize SDL_RenderSetLogicalSize;
|
||||||
|
pSDL_RenderGetLogicalSize SDL_RenderGetLogicalSize;
|
||||||
|
pSDL_RenderSetViewport SDL_RenderSetViewport;
|
||||||
|
pSDL_RenderGetViewport SDL_RenderGetViewport;
|
||||||
|
pSDL_RenderSetScale SDL_RenderSetScale;
|
||||||
|
pSDL_RenderGetScale SDL_RenderGetScale;
|
||||||
|
pSDL_SetRenderDrawColor SDL_SetRenderDrawColor;
|
||||||
|
pSDL_GetRenderDrawColor SDL_GetRenderDrawColor;
|
||||||
|
pSDL_SetRenderDrawBlendMode SDL_SetRenderDrawBlendMode;
|
||||||
|
pSDL_GetRenderDrawBlendMode SDL_GetRenderDrawBlendMode;
|
||||||
|
pSDL_RenderClear SDL_RenderClear;
|
||||||
|
pSDL_RenderDrawPoint SDL_RenderDrawPoint;
|
||||||
|
pSDL_RenderDrawPoints SDL_RenderDrawPoints;
|
||||||
|
pSDL_RenderDrawLine SDL_RenderDrawLine;
|
||||||
|
pSDL_RenderDrawLines SDL_RenderDrawLines;
|
||||||
|
pSDL_RenderDrawRect SDL_RenderDrawRect;
|
||||||
|
pSDL_RenderDrawRects SDL_RenderDrawRects;
|
||||||
|
pSDL_RenderFillRect SDL_RenderFillRect;
|
||||||
|
pSDL_RenderFillRects SDL_RenderFillRects;
|
||||||
|
pSDL_RenderCopy SDL_RenderCopy;
|
||||||
|
pSDL_RenderCopyEx SDL_RenderCopyEx;
|
||||||
|
pSDL_RenderReadPixels SDL_RenderReadPixels;
|
||||||
|
pSDL_RenderPresent SDL_RenderPresent;
|
||||||
|
pSDL_DestroyTexture SDL_DestroyTexture;
|
||||||
|
pSDL_DestroyRenderer SDL_DestroyRenderer;
|
||||||
|
pSDL_GL_BindTexture SDL_GL_BindTexture;
|
||||||
|
pSDL_GL_UnbindTexture SDL_GL_UnbindTexture;
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl201) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_UpdateYUVTexture = int function(SDL_Texture*,const(SDL_Rect)*,const(ubyte)*,int,const(ubyte)*,int,const(ubyte)*,int);
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_UpdateYUVTexture SDL_UpdateYUVTexture;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_RenderIsClipEnabled = SDL_bool function(SDL_Renderer*);
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_RenderIsClipEnabled SDL_RenderIsClipEnabled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl205) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_RenderGetIntegerScale = SDL_bool function(SDL_Renderer*);
|
||||||
|
alias pSDL_RenderSetIntegerScale = int function(SDL_Renderer*,SDL_bool);
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_RenderGetIntegerScale SDL_RenderGetIntegerScale;
|
||||||
|
pSDL_RenderSetIntegerScale SDL_RenderSetIntegerScale;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl208) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_RenderGetMetalLayer = void* function(SDL_Renderer*);
|
||||||
|
alias pSDL_RenderGetMetalCommandEncoder = void* function(SDL_Renderer*);
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_RenderGetMetalLayer SDL_RenderGetMetalLayer;
|
||||||
|
pSDL_RenderGetMetalCommandEncoder SDL_RenderGetMetalCommandEncoder;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl2010) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_RenderDrawPointF = int function(SDL_Renderer*,float,float);
|
||||||
|
alias pSDL_RenderDrawPointsF = int function(SDL_Renderer*,const(SDL_FPoint)*,int);
|
||||||
|
alias pSDL_RenderDrawLineF = int function(SDL_Renderer*,float,float,float,float);
|
||||||
|
alias pSDL_RenderDrawLinesF = int function(SDL_Renderer*,const(SDL_FPoint)*,int);
|
||||||
|
alias pSDL_RenderDrawRectF = int function(SDL_Renderer*,const(SDL_FRect)*);
|
||||||
|
alias pSDL_RenderDrawRectsF = int function(SDL_Renderer*,const(SDL_FRect)*,int);
|
||||||
|
alias pSDL_RenderFillRectF = int function(SDL_Renderer*,const(SDL_FRect)*);
|
||||||
|
alias pSDL_RenderFillRectsF = int function(SDL_Renderer*,const(SDL_FRect)*,int);
|
||||||
|
alias pSDL_RenderCopyF = int function(SDL_Renderer*,SDL_Texture*,const(SDL_FRect)*,const(SDL_FRect)*);
|
||||||
|
alias pSDL_RenderCopyExF = int function(SDL_Renderer*,SDL_Texture*,const(SDL_FRect)*,const(SDL_FRect)*,const(double),const(SDL_FPoint)*,const(SDL_RendererFlip));
|
||||||
|
alias pSDL_RenderFlush = int function(SDL_Renderer*);
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_RenderDrawPointF SDL_RenderDrawPointF;
|
||||||
|
pSDL_RenderDrawPointsF SDL_RenderDrawPointsF;
|
||||||
|
pSDL_RenderDrawLineF SDL_RenderDrawLineF;
|
||||||
|
pSDL_RenderDrawLinesF SDL_RenderDrawLinesF;
|
||||||
|
pSDL_RenderDrawRectF SDL_RenderDrawRectF;
|
||||||
|
pSDL_RenderDrawRectsF SDL_RenderDrawRectsF;
|
||||||
|
pSDL_RenderFillRectF SDL_RenderFillRectF;
|
||||||
|
pSDL_RenderFillRectsF SDL_RenderFillRectsF;
|
||||||
|
pSDL_RenderCopyF SDL_RenderCopyF;
|
||||||
|
pSDL_RenderCopyExF SDL_RenderCopyExF;
|
||||||
|
pSDL_RenderFlush SDL_RenderFlush;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
208
demos/external/wasm_imports/bindbc/sdl/bind/sdlrwops.d
vendored
Normal file
208
demos/external/wasm_imports/bindbc/sdl/bind/sdlrwops.d
vendored
Normal file
|
|
@ -0,0 +1,208 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlrwops;
|
||||||
|
|
||||||
|
//import core.stdc.stdio : FILE;
|
||||||
|
|
||||||
|
struct FILE
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
import bindbc.sdl.bind.sdlstdinc : SDL_bool;
|
||||||
|
|
||||||
|
enum : uint {
|
||||||
|
SDL_RWOPS_UNKNOWN = 0,
|
||||||
|
SDL_RWOPS_WINFILE = 1,
|
||||||
|
SDL_RWOPS_STDFILE = 2,
|
||||||
|
SDL_RWOPS_JNIFILE = 3,
|
||||||
|
SDL_RWOPS_MEMORY = 4,
|
||||||
|
SDL_RWOPS_MEMORY_RO = 5,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_RWops {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
long function(SDL_RWops*) size;
|
||||||
|
long function(SDL_RWops*, long, int) seek;
|
||||||
|
size_t function(SDL_RWops*, void*, size_t, size_t) read;
|
||||||
|
size_t function(SDL_RWops*, const(void)*, size_t, size_t) write;
|
||||||
|
int function(SDL_RWops*) close;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint type;
|
||||||
|
|
||||||
|
union Hidden {
|
||||||
|
// version(Android)
|
||||||
|
version(Windows) {
|
||||||
|
struct Windowsio {
|
||||||
|
int append;
|
||||||
|
void* h;
|
||||||
|
struct Buffer {
|
||||||
|
void* data;
|
||||||
|
size_t size;
|
||||||
|
size_t left;
|
||||||
|
}
|
||||||
|
Buffer buffer;
|
||||||
|
}
|
||||||
|
Windowsio windowsio;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Stdio {
|
||||||
|
int autoclose;
|
||||||
|
FILE* fp;
|
||||||
|
}
|
||||||
|
Stdio stdio;
|
||||||
|
|
||||||
|
struct Mem {
|
||||||
|
ubyte* base;
|
||||||
|
ubyte* here;
|
||||||
|
ubyte* stop;
|
||||||
|
}
|
||||||
|
Mem mem;
|
||||||
|
|
||||||
|
struct Unknown {
|
||||||
|
void* data1;
|
||||||
|
void* data2;
|
||||||
|
}
|
||||||
|
Unknown unknown;
|
||||||
|
}
|
||||||
|
Hidden hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum {
|
||||||
|
RW_SEEK_SET = 0,
|
||||||
|
RW_SEEK_CUR = 1,
|
||||||
|
RW_SEEK_END = 2,
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport < SDLSupport.sdl2010) {
|
||||||
|
@nogc nothrow {
|
||||||
|
long SDL_RWsize(SDL_RWops* ctx) { return ctx.size(ctx); }
|
||||||
|
long SDL_RWseek(SDL_RWops* ctx, long offset, int whence) { return ctx.seek(ctx, offset, whence); }
|
||||||
|
long SDL_RWtell(SDL_RWops* ctx) { return ctx.seek(ctx, 0, RW_SEEK_CUR); }
|
||||||
|
size_t SDL_RWread(SDL_RWops* ctx, void* ptr, size_t size, size_t n) { return ctx.read(ctx, ptr, size, n); }
|
||||||
|
size_t SDL_RWwrite(SDL_RWops* ctx, const(void)* ptr, size_t size, size_t n) { return ctx.write(ctx, ptr, size, n); }
|
||||||
|
int SDL_RWclose(SDL_RWops* ctx) { return ctx.close(ctx); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) {
|
||||||
|
@nogc nothrow
|
||||||
|
void* SDL_LoadFile(const(char)* filename, size_t datasize) {
|
||||||
|
pragma(inline, true);
|
||||||
|
return SDL_LoadFile_RW(SDL_RWFromFile(filename, "rb"), datasize, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
SDL_RWops* SDL_RWFromFile(const(char)*,const(char)*);
|
||||||
|
SDL_RWops* SDL_RWFromFP(FILE*,SDL_bool);
|
||||||
|
SDL_RWops* SDL_RWFromMem(void*,int);
|
||||||
|
SDL_RWops* SDL_RWFromConstMem(const(void)*,int);
|
||||||
|
SDL_RWops* SDL_AllocRW();
|
||||||
|
void SDL_FreeRW(SDL_RWops*);
|
||||||
|
ubyte SDL_ReadU8(SDL_RWops*);
|
||||||
|
ushort SDL_ReadLE16(SDL_RWops*);
|
||||||
|
ushort SDL_ReadBE16(SDL_RWops*);
|
||||||
|
uint SDL_ReadLE32(SDL_RWops*);
|
||||||
|
uint SDL_ReadBE32(SDL_RWops*);
|
||||||
|
ulong SDL_ReadLE64(SDL_RWops*);
|
||||||
|
ulong SDL_ReadBE64(SDL_RWops*);
|
||||||
|
size_t SDL_WriteU8(SDL_RWops*,ubyte);
|
||||||
|
size_t SDL_WriteLE16(SDL_RWops*,ushort);
|
||||||
|
size_t SDL_WriteBE16(SDL_RWops*,ushort);
|
||||||
|
size_t SDL_WriteLE32(SDL_RWops*,uint);
|
||||||
|
size_t SDL_WriteBE32(SDL_RWops*,uint);
|
||||||
|
size_t SDL_WriteLE64(SDL_RWops*,ulong);
|
||||||
|
size_t SDL_WriteBE64(SDL_RWops*,ulong);
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) {
|
||||||
|
void* SDL_LoadFile_RW(SDL_RWops*,size_t,int);
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl2010) {
|
||||||
|
long SDL_RWsize(SDL_RWops*);
|
||||||
|
long SDL_RWseek(SDL_RWops*,long,int);
|
||||||
|
long SDL_RWtell(SDL_RWops*);
|
||||||
|
size_t SDL_RWread(SDL_RWops*,void*,size_t,size_t);
|
||||||
|
size_t SDL_RWwrite(SDL_RWops*,const(void)*,size_t,size_t);
|
||||||
|
int SDL_RWclose(SDL_RWops*);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_RWFromFile = SDL_RWops* function(const(char)*,const(char)*);
|
||||||
|
alias pSDL_RWFromFP = SDL_RWops* function(FILE*,SDL_bool);
|
||||||
|
alias pSDL_RWFromMem = SDL_RWops* function(void*,int);
|
||||||
|
alias pSDL_RWFromConstMem = SDL_RWops* function(const(void)*,int);
|
||||||
|
alias pSDL_AllocRW = SDL_RWops* function();
|
||||||
|
alias pSDL_FreeRW = void function(SDL_RWops*);
|
||||||
|
alias pSDL_ReadU8 = ubyte function(SDL_RWops*);
|
||||||
|
alias pSDL_ReadLE16 = ushort function(SDL_RWops*);
|
||||||
|
alias pSDL_ReadBE16 = ushort function(SDL_RWops*);
|
||||||
|
alias pSDL_ReadLE32 = uint function(SDL_RWops*);
|
||||||
|
alias pSDL_ReadBE32 = uint function(SDL_RWops*);
|
||||||
|
alias pSDL_ReadLE64 = ulong function(SDL_RWops*);
|
||||||
|
alias pSDL_ReadBE64 = ulong function(SDL_RWops*);
|
||||||
|
alias pSDL_WriteU8 = size_t function(SDL_RWops*,ubyte);
|
||||||
|
alias pSDL_WriteLE16 = size_t function(SDL_RWops*,ushort);
|
||||||
|
alias pSDL_WriteBE16 = size_t function(SDL_RWops*,ushort);
|
||||||
|
alias pSDL_WriteLE32 = size_t function(SDL_RWops*,uint);
|
||||||
|
alias pSDL_WriteBE32 = size_t function(SDL_RWops*,uint);
|
||||||
|
alias pSDL_WriteLE64 = size_t function(SDL_RWops*,ulong);
|
||||||
|
alias pSDL_WriteBE64 = size_t function(SDL_RWops*,ulong);
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_RWFromFile SDL_RWFromFile;
|
||||||
|
pSDL_RWFromFP SDL_RWFromFP;
|
||||||
|
pSDL_RWFromMem SDL_RWFromMem;
|
||||||
|
pSDL_RWFromConstMem SDL_RWFromConstMem;
|
||||||
|
pSDL_AllocRW SDL_AllocRW;
|
||||||
|
pSDL_FreeRW SDL_FreeRW;
|
||||||
|
pSDL_ReadU8 SDL_ReadU8;
|
||||||
|
pSDL_ReadLE16 SDL_ReadLE16;
|
||||||
|
pSDL_ReadBE16 SDL_ReadBE16;
|
||||||
|
pSDL_ReadLE32 SDL_ReadLE32;
|
||||||
|
pSDL_ReadBE32 SDL_ReadBE32;
|
||||||
|
pSDL_ReadLE64 SDL_ReadLE64;
|
||||||
|
pSDL_ReadBE64 SDL_ReadBE64;
|
||||||
|
pSDL_WriteU8 SDL_WriteU8;
|
||||||
|
pSDL_WriteLE16 SDL_WriteLE16;
|
||||||
|
pSDL_WriteBE16 SDL_WriteBE16;
|
||||||
|
pSDL_WriteLE32 SDL_WriteLE32;
|
||||||
|
pSDL_WriteBE32 SDL_WriteBE32;
|
||||||
|
pSDL_WriteLE64 SDL_WriteLE64;
|
||||||
|
pSDL_WriteBE64 SDL_WriteBE64;
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_LoadFile_RW = void* function(SDL_RWops*,size_t,int);
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_LoadFile_RW SDL_LoadFile_RW;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl2010) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_RWsize = long function(SDL_RWops*);
|
||||||
|
alias pSDL_RWseek = long function(SDL_RWops*,long,int);
|
||||||
|
alias pSDL_RWtell = long function(SDL_RWops*);
|
||||||
|
alias pSDL_RWread = size_t function(SDL_RWops*,void*,size_t,size_t);
|
||||||
|
alias pSDL_RWwrite = size_t function(SDL_RWops*,const(void)*,size_t,size_t);
|
||||||
|
alias pSDL_RWclose = int function(SDL_RWops*);
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_RWsize SDL_RWsize;
|
||||||
|
pSDL_RWseek SDL_RWseek;
|
||||||
|
pSDL_RWtell SDL_RWtell;
|
||||||
|
pSDL_RWread SDL_RWread;
|
||||||
|
pSDL_RWwrite SDL_RWwrite;
|
||||||
|
pSDL_RWclose SDL_RWclose;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
542
demos/external/wasm_imports/bindbc/sdl/bind/sdlscancode.d
vendored
Normal file
542
demos/external/wasm_imports/bindbc/sdl/bind/sdlscancode.d
vendored
Normal file
|
|
@ -0,0 +1,542 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlscancode;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) {
|
||||||
|
enum SDL_Scancode {
|
||||||
|
SDL_SCANCODE_UNKNOWN = 0,
|
||||||
|
|
||||||
|
SDL_SCANCODE_A = 4,
|
||||||
|
SDL_SCANCODE_B = 5,
|
||||||
|
SDL_SCANCODE_C = 6,
|
||||||
|
SDL_SCANCODE_D = 7,
|
||||||
|
SDL_SCANCODE_E = 8,
|
||||||
|
SDL_SCANCODE_F = 9,
|
||||||
|
SDL_SCANCODE_G = 10,
|
||||||
|
SDL_SCANCODE_H = 11,
|
||||||
|
SDL_SCANCODE_I = 12,
|
||||||
|
SDL_SCANCODE_J = 13,
|
||||||
|
SDL_SCANCODE_K = 14,
|
||||||
|
SDL_SCANCODE_L = 15,
|
||||||
|
SDL_SCANCODE_M = 16,
|
||||||
|
SDL_SCANCODE_N = 17,
|
||||||
|
SDL_SCANCODE_O = 18,
|
||||||
|
SDL_SCANCODE_P = 19,
|
||||||
|
SDL_SCANCODE_Q = 20,
|
||||||
|
SDL_SCANCODE_R = 21,
|
||||||
|
SDL_SCANCODE_S = 22,
|
||||||
|
SDL_SCANCODE_T = 23,
|
||||||
|
SDL_SCANCODE_U = 24,
|
||||||
|
SDL_SCANCODE_V = 25,
|
||||||
|
SDL_SCANCODE_W = 26,
|
||||||
|
SDL_SCANCODE_X = 27,
|
||||||
|
SDL_SCANCODE_Y = 28,
|
||||||
|
SDL_SCANCODE_Z = 29,
|
||||||
|
|
||||||
|
SDL_SCANCODE_1 = 30,
|
||||||
|
SDL_SCANCODE_2 = 31,
|
||||||
|
SDL_SCANCODE_3 = 32,
|
||||||
|
SDL_SCANCODE_4 = 33,
|
||||||
|
SDL_SCANCODE_5 = 34,
|
||||||
|
SDL_SCANCODE_6 = 35,
|
||||||
|
SDL_SCANCODE_7 = 36,
|
||||||
|
SDL_SCANCODE_8 = 37,
|
||||||
|
SDL_SCANCODE_9 = 38,
|
||||||
|
SDL_SCANCODE_0 = 39,
|
||||||
|
|
||||||
|
SDL_SCANCODE_RETURN = 40,
|
||||||
|
SDL_SCANCODE_ESCAPE = 41,
|
||||||
|
SDL_SCANCODE_BACKSPACE = 42,
|
||||||
|
SDL_SCANCODE_TAB = 43,
|
||||||
|
SDL_SCANCODE_SPACE = 44,
|
||||||
|
|
||||||
|
SDL_SCANCODE_MINUS = 45,
|
||||||
|
SDL_SCANCODE_EQUALS = 46,
|
||||||
|
SDL_SCANCODE_LEFTBRACKET = 47,
|
||||||
|
SDL_SCANCODE_RIGHTBRACKET = 48,
|
||||||
|
SDL_SCANCODE_BACKSLASH = 49,
|
||||||
|
SDL_SCANCODE_NONUSHASH = 50,
|
||||||
|
SDL_SCANCODE_SEMICOLON = 51,
|
||||||
|
SDL_SCANCODE_APOSTROPHE = 52,
|
||||||
|
SDL_SCANCODE_GRAVE = 53,
|
||||||
|
SDL_SCANCODE_COMMA = 54,
|
||||||
|
SDL_SCANCODE_PERIOD = 55,
|
||||||
|
SDL_SCANCODE_SLASH = 56,
|
||||||
|
|
||||||
|
SDL_SCANCODE_CAPSLOCK = 57,
|
||||||
|
|
||||||
|
SDL_SCANCODE_F1 = 58,
|
||||||
|
SDL_SCANCODE_F2 = 59,
|
||||||
|
SDL_SCANCODE_F3 = 60,
|
||||||
|
SDL_SCANCODE_F4 = 61,
|
||||||
|
SDL_SCANCODE_F5 = 62,
|
||||||
|
SDL_SCANCODE_F6 = 63,
|
||||||
|
SDL_SCANCODE_F7 = 64,
|
||||||
|
SDL_SCANCODE_F8 = 65,
|
||||||
|
SDL_SCANCODE_F9 = 66,
|
||||||
|
SDL_SCANCODE_F10 = 67,
|
||||||
|
SDL_SCANCODE_F11 = 68,
|
||||||
|
SDL_SCANCODE_F12 = 69,
|
||||||
|
|
||||||
|
SDL_SCANCODE_PRINTSCREEN = 70,
|
||||||
|
SDL_SCANCODE_SCROLLLOCK = 71,
|
||||||
|
SDL_SCANCODE_PAUSE = 72,
|
||||||
|
SDL_SCANCODE_INSERT = 73,
|
||||||
|
SDL_SCANCODE_HOME = 74,
|
||||||
|
SDL_SCANCODE_PAGEUP = 75,
|
||||||
|
SDL_SCANCODE_DELETE = 76,
|
||||||
|
SDL_SCANCODE_END = 77,
|
||||||
|
SDL_SCANCODE_PAGEDOWN = 78,
|
||||||
|
SDL_SCANCODE_RIGHT = 79,
|
||||||
|
SDL_SCANCODE_LEFT = 80,
|
||||||
|
SDL_SCANCODE_DOWN = 81,
|
||||||
|
SDL_SCANCODE_UP = 82,
|
||||||
|
|
||||||
|
SDL_SCANCODE_NUMLOCKCLEAR = 83,
|
||||||
|
SDL_SCANCODE_KP_DIVIDE = 84,
|
||||||
|
SDL_SCANCODE_KP_MULTIPLY = 85,
|
||||||
|
SDL_SCANCODE_KP_MINUS = 86,
|
||||||
|
SDL_SCANCODE_KP_PLUS = 87,
|
||||||
|
SDL_SCANCODE_KP_ENTER = 88,
|
||||||
|
SDL_SCANCODE_KP_1 = 89,
|
||||||
|
SDL_SCANCODE_KP_2 = 90,
|
||||||
|
SDL_SCANCODE_KP_3 = 91,
|
||||||
|
SDL_SCANCODE_KP_4 = 92,
|
||||||
|
SDL_SCANCODE_KP_5 = 93,
|
||||||
|
SDL_SCANCODE_KP_6 = 94,
|
||||||
|
SDL_SCANCODE_KP_7 = 95,
|
||||||
|
SDL_SCANCODE_KP_8 = 96,
|
||||||
|
SDL_SCANCODE_KP_9 = 97,
|
||||||
|
SDL_SCANCODE_KP_0 = 98,
|
||||||
|
SDL_SCANCODE_KP_PERIOD = 99,
|
||||||
|
|
||||||
|
SDL_SCANCODE_NONUSBACKSLASH = 100,
|
||||||
|
SDL_SCANCODE_APPLICATION = 101,
|
||||||
|
SDL_SCANCODE_POWER = 102,
|
||||||
|
SDL_SCANCODE_KP_EQUALS = 103,
|
||||||
|
SDL_SCANCODE_F13 = 104,
|
||||||
|
SDL_SCANCODE_F14 = 105,
|
||||||
|
SDL_SCANCODE_F15 = 106,
|
||||||
|
SDL_SCANCODE_F16 = 107,
|
||||||
|
SDL_SCANCODE_F17 = 108,
|
||||||
|
SDL_SCANCODE_F18 = 109,
|
||||||
|
SDL_SCANCODE_F19 = 110,
|
||||||
|
SDL_SCANCODE_F20 = 111,
|
||||||
|
SDL_SCANCODE_F21 = 112,
|
||||||
|
SDL_SCANCODE_F22 = 113,
|
||||||
|
SDL_SCANCODE_F23 = 114,
|
||||||
|
SDL_SCANCODE_F24 = 115,
|
||||||
|
SDL_SCANCODE_EXECUTE = 116,
|
||||||
|
SDL_SCANCODE_HELP = 117,
|
||||||
|
SDL_SCANCODE_MENU = 118,
|
||||||
|
SDL_SCANCODE_SELECT = 119,
|
||||||
|
SDL_SCANCODE_STOP = 120,
|
||||||
|
SDL_SCANCODE_AGAIN = 121,
|
||||||
|
SDL_SCANCODE_UNDO = 122,
|
||||||
|
SDL_SCANCODE_CUT = 123,
|
||||||
|
SDL_SCANCODE_COPY = 124,
|
||||||
|
SDL_SCANCODE_PASTE = 125,
|
||||||
|
SDL_SCANCODE_FIND = 126,
|
||||||
|
SDL_SCANCODE_MUTE = 127,
|
||||||
|
SDL_SCANCODE_VOLUMEUP = 128,
|
||||||
|
SDL_SCANCODE_VOLUMEDOWN = 129,
|
||||||
|
SDL_SCANCODE_KP_COMMA = 133,
|
||||||
|
SDL_SCANCODE_KP_EQUALSAS400 = 134,
|
||||||
|
|
||||||
|
SDL_SCANCODE_INTERNATIONAL1 = 135,
|
||||||
|
SDL_SCANCODE_INTERNATIONAL2 = 136,
|
||||||
|
SDL_SCANCODE_INTERNATIONAL3 = 137,
|
||||||
|
SDL_SCANCODE_INTERNATIONAL4 = 138,
|
||||||
|
SDL_SCANCODE_INTERNATIONAL5 = 139,
|
||||||
|
SDL_SCANCODE_INTERNATIONAL6 = 140,
|
||||||
|
SDL_SCANCODE_INTERNATIONAL7 = 141,
|
||||||
|
SDL_SCANCODE_INTERNATIONAL8 = 142,
|
||||||
|
SDL_SCANCODE_INTERNATIONAL9 = 143,
|
||||||
|
SDL_SCANCODE_LANG1 = 144,
|
||||||
|
SDL_SCANCODE_LANG2 = 145,
|
||||||
|
SDL_SCANCODE_LANG3 = 146,
|
||||||
|
SDL_SCANCODE_LANG4 = 147,
|
||||||
|
SDL_SCANCODE_LANG5 = 148,
|
||||||
|
SDL_SCANCODE_LANG6 = 149,
|
||||||
|
SDL_SCANCODE_LANG7 = 150,
|
||||||
|
SDL_SCANCODE_LANG8 = 151,
|
||||||
|
SDL_SCANCODE_LANG9 = 152,
|
||||||
|
|
||||||
|
SDL_SCANCODE_ALTERASE = 153,
|
||||||
|
SDL_SCANCODE_SYSREQ = 154,
|
||||||
|
SDL_SCANCODE_CANCEL = 155,
|
||||||
|
SDL_SCANCODE_CLEAR = 156,
|
||||||
|
SDL_SCANCODE_PRIOR = 157,
|
||||||
|
SDL_SCANCODE_RETURN2 = 158,
|
||||||
|
SDL_SCANCODE_SEPARATOR = 159,
|
||||||
|
SDL_SCANCODE_OUT = 160,
|
||||||
|
SDL_SCANCODE_OPER = 161,
|
||||||
|
SDL_SCANCODE_CLEARAGAIN = 162,
|
||||||
|
SDL_SCANCODE_CRSEL = 163,
|
||||||
|
SDL_SCANCODE_EXSEL = 164,
|
||||||
|
|
||||||
|
SDL_SCANCODE_KP_00 = 176,
|
||||||
|
SDL_SCANCODE_KP_000 = 177,
|
||||||
|
SDL_SCANCODE_THOUSANDSSEPARATOR = 178,
|
||||||
|
SDL_SCANCODE_DECIMALSEPARATOR = 179,
|
||||||
|
SDL_SCANCODE_CURRENCYUNIT = 180,
|
||||||
|
SDL_SCANCODE_CURRENCYSUBUNIT = 181,
|
||||||
|
SDL_SCANCODE_KP_LEFTPAREN = 182,
|
||||||
|
SDL_SCANCODE_KP_RIGHTPAREN = 183,
|
||||||
|
SDL_SCANCODE_KP_LEFTBRACE = 184,
|
||||||
|
SDL_SCANCODE_KP_RIGHTBRACE = 185,
|
||||||
|
SDL_SCANCODE_KP_TAB = 186,
|
||||||
|
SDL_SCANCODE_KP_BACKSPACE = 187,
|
||||||
|
SDL_SCANCODE_KP_A = 188,
|
||||||
|
SDL_SCANCODE_KP_B = 189,
|
||||||
|
SDL_SCANCODE_KP_C = 190,
|
||||||
|
SDL_SCANCODE_KP_D = 191,
|
||||||
|
SDL_SCANCODE_KP_E = 192,
|
||||||
|
SDL_SCANCODE_KP_F = 193,
|
||||||
|
SDL_SCANCODE_KP_XOR = 194,
|
||||||
|
SDL_SCANCODE_KP_POWER = 195,
|
||||||
|
SDL_SCANCODE_KP_PERCENT = 196,
|
||||||
|
SDL_SCANCODE_KP_LESS = 197,
|
||||||
|
SDL_SCANCODE_KP_GREATER = 198,
|
||||||
|
SDL_SCANCODE_KP_AMPERSAND = 199,
|
||||||
|
SDL_SCANCODE_KP_DBLAMPERSAND = 200,
|
||||||
|
SDL_SCANCODE_KP_VERTICALBAR = 201,
|
||||||
|
SDL_SCANCODE_KP_DBLVERTICALBAR = 202,
|
||||||
|
SDL_SCANCODE_KP_COLON = 203,
|
||||||
|
SDL_SCANCODE_KP_HASH = 204,
|
||||||
|
SDL_SCANCODE_KP_SPACE = 205,
|
||||||
|
SDL_SCANCODE_KP_AT = 206,
|
||||||
|
SDL_SCANCODE_KP_EXCLAM = 207,
|
||||||
|
SDL_SCANCODE_KP_MEMSTORE = 208,
|
||||||
|
SDL_SCANCODE_KP_MEMRECALL = 209,
|
||||||
|
SDL_SCANCODE_KP_MEMCLEAR = 210,
|
||||||
|
SDL_SCANCODE_KP_MEMADD = 211,
|
||||||
|
SDL_SCANCODE_KP_MEMSUBTRACT = 212,
|
||||||
|
SDL_SCANCODE_KP_MEMMULTIPLY = 213,
|
||||||
|
SDL_SCANCODE_KP_MEMDIVIDE = 214,
|
||||||
|
SDL_SCANCODE_KP_PLUSMINUS = 215,
|
||||||
|
SDL_SCANCODE_KP_CLEAR = 216,
|
||||||
|
SDL_SCANCODE_KP_CLEARENTRY = 217,
|
||||||
|
SDL_SCANCODE_KP_BINARY = 218,
|
||||||
|
SDL_SCANCODE_KP_OCTAL = 219,
|
||||||
|
SDL_SCANCODE_KP_DECIMAL = 220,
|
||||||
|
SDL_SCANCODE_KP_HEXADECIMAL = 221,
|
||||||
|
|
||||||
|
SDL_SCANCODE_LCTRL = 224,
|
||||||
|
SDL_SCANCODE_LSHIFT = 225,
|
||||||
|
SDL_SCANCODE_LALT = 226,
|
||||||
|
SDL_SCANCODE_LGUI = 227,
|
||||||
|
SDL_SCANCODE_RCTRL = 228,
|
||||||
|
SDL_SCANCODE_RSHIFT = 229,
|
||||||
|
SDL_SCANCODE_RALT = 230,
|
||||||
|
SDL_SCANCODE_RGUI = 231,
|
||||||
|
|
||||||
|
SDL_SCANCODE_MODE = 257,
|
||||||
|
|
||||||
|
SDL_SCANCODE_AUDIONEXT = 258,
|
||||||
|
SDL_SCANCODE_AUDIOPREV = 259,
|
||||||
|
SDL_SCANCODE_AUDIOSTOP = 260,
|
||||||
|
SDL_SCANCODE_AUDIOPLAY = 261,
|
||||||
|
SDL_SCANCODE_AUDIOMUTE = 262,
|
||||||
|
SDL_SCANCODE_MEDIASELECT = 263,
|
||||||
|
SDL_SCANCODE_WWW = 264,
|
||||||
|
SDL_SCANCODE_MAIL = 265,
|
||||||
|
SDL_SCANCODE_CALCULATOR = 266,
|
||||||
|
SDL_SCANCODE_COMPUTER = 267,
|
||||||
|
SDL_SCANCODE_AC_SEARCH = 268,
|
||||||
|
SDL_SCANCODE_AC_HOME = 269,
|
||||||
|
SDL_SCANCODE_AC_BACK = 270,
|
||||||
|
SDL_SCANCODE_AC_FORWARD = 271,
|
||||||
|
SDL_SCANCODE_AC_STOP = 272,
|
||||||
|
SDL_SCANCODE_AC_REFRESH = 273,
|
||||||
|
SDL_SCANCODE_AC_BOOKMARKS = 274,
|
||||||
|
|
||||||
|
SDL_SCANCODE_BRIGHTNESSDOWN = 275,
|
||||||
|
SDL_SCANCODE_BRIGHTNESSUP = 276,
|
||||||
|
SDL_SCANCODE_DISPLAYSWITCH = 277,
|
||||||
|
SDL_SCANCODE_KBDILLUMTOGGLE = 278,
|
||||||
|
SDL_SCANCODE_KBDILLUMDOWN = 279,
|
||||||
|
SDL_SCANCODE_KBDILLUMUP = 280,
|
||||||
|
SDL_SCANCODE_EJECT = 281,
|
||||||
|
SDL_SCANCODE_SLEEP = 282,
|
||||||
|
|
||||||
|
SDL_SCANCODE_APP1 = 283,
|
||||||
|
SDL_SCANCODE_APP2 = 284,
|
||||||
|
|
||||||
|
SDL_SCANCODE_AUDIOREWIND = 285,
|
||||||
|
SDL_SCANCODE_AUDIOFASTFORWARD = 286,
|
||||||
|
|
||||||
|
SDL_NUM_SCANCODES = 512
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
enum SDL_Scancode {
|
||||||
|
SDL_SCANCODE_UNKNOWN = 0,
|
||||||
|
|
||||||
|
SDL_SCANCODE_A = 4,
|
||||||
|
SDL_SCANCODE_B = 5,
|
||||||
|
SDL_SCANCODE_C = 6,
|
||||||
|
SDL_SCANCODE_D = 7,
|
||||||
|
SDL_SCANCODE_E = 8,
|
||||||
|
SDL_SCANCODE_F = 9,
|
||||||
|
SDL_SCANCODE_G = 10,
|
||||||
|
SDL_SCANCODE_H = 11,
|
||||||
|
SDL_SCANCODE_I = 12,
|
||||||
|
SDL_SCANCODE_J = 13,
|
||||||
|
SDL_SCANCODE_K = 14,
|
||||||
|
SDL_SCANCODE_L = 15,
|
||||||
|
SDL_SCANCODE_M = 16,
|
||||||
|
SDL_SCANCODE_N = 17,
|
||||||
|
SDL_SCANCODE_O = 18,
|
||||||
|
SDL_SCANCODE_P = 19,
|
||||||
|
SDL_SCANCODE_Q = 20,
|
||||||
|
SDL_SCANCODE_R = 21,
|
||||||
|
SDL_SCANCODE_S = 22,
|
||||||
|
SDL_SCANCODE_T = 23,
|
||||||
|
SDL_SCANCODE_U = 24,
|
||||||
|
SDL_SCANCODE_V = 25,
|
||||||
|
SDL_SCANCODE_W = 26,
|
||||||
|
SDL_SCANCODE_X = 27,
|
||||||
|
SDL_SCANCODE_Y = 28,
|
||||||
|
SDL_SCANCODE_Z = 29,
|
||||||
|
|
||||||
|
SDL_SCANCODE_1 = 30,
|
||||||
|
SDL_SCANCODE_2 = 31,
|
||||||
|
SDL_SCANCODE_3 = 32,
|
||||||
|
SDL_SCANCODE_4 = 33,
|
||||||
|
SDL_SCANCODE_5 = 34,
|
||||||
|
SDL_SCANCODE_6 = 35,
|
||||||
|
SDL_SCANCODE_7 = 36,
|
||||||
|
SDL_SCANCODE_8 = 37,
|
||||||
|
SDL_SCANCODE_9 = 38,
|
||||||
|
SDL_SCANCODE_0 = 39,
|
||||||
|
|
||||||
|
SDL_SCANCODE_RETURN = 40,
|
||||||
|
SDL_SCANCODE_ESCAPE = 41,
|
||||||
|
SDL_SCANCODE_BACKSPACE = 42,
|
||||||
|
SDL_SCANCODE_TAB = 43,
|
||||||
|
SDL_SCANCODE_SPACE = 44,
|
||||||
|
|
||||||
|
SDL_SCANCODE_MINUS = 45,
|
||||||
|
SDL_SCANCODE_EQUALS = 46,
|
||||||
|
SDL_SCANCODE_LEFTBRACKET = 47,
|
||||||
|
SDL_SCANCODE_RIGHTBRACKET = 48,
|
||||||
|
SDL_SCANCODE_BACKSLASH = 49,
|
||||||
|
SDL_SCANCODE_NONUSHASH = 50,
|
||||||
|
SDL_SCANCODE_SEMICOLON = 51,
|
||||||
|
SDL_SCANCODE_APOSTROPHE = 52,
|
||||||
|
SDL_SCANCODE_GRAVE = 53,
|
||||||
|
SDL_SCANCODE_COMMA = 54,
|
||||||
|
SDL_SCANCODE_PERIOD = 55,
|
||||||
|
SDL_SCANCODE_SLASH = 56,
|
||||||
|
|
||||||
|
SDL_SCANCODE_CAPSLOCK = 57,
|
||||||
|
|
||||||
|
SDL_SCANCODE_F1 = 58,
|
||||||
|
SDL_SCANCODE_F2 = 59,
|
||||||
|
SDL_SCANCODE_F3 = 60,
|
||||||
|
SDL_SCANCODE_F4 = 61,
|
||||||
|
SDL_SCANCODE_F5 = 62,
|
||||||
|
SDL_SCANCODE_F6 = 63,
|
||||||
|
SDL_SCANCODE_F7 = 64,
|
||||||
|
SDL_SCANCODE_F8 = 65,
|
||||||
|
SDL_SCANCODE_F9 = 66,
|
||||||
|
SDL_SCANCODE_F10 = 67,
|
||||||
|
SDL_SCANCODE_F11 = 68,
|
||||||
|
SDL_SCANCODE_F12 = 69,
|
||||||
|
|
||||||
|
SDL_SCANCODE_PRINTSCREEN = 70,
|
||||||
|
SDL_SCANCODE_SCROLLLOCK = 71,
|
||||||
|
SDL_SCANCODE_PAUSE = 72,
|
||||||
|
SDL_SCANCODE_INSERT = 73,
|
||||||
|
SDL_SCANCODE_HOME = 74,
|
||||||
|
SDL_SCANCODE_PAGEUP = 75,
|
||||||
|
SDL_SCANCODE_DELETE = 76,
|
||||||
|
SDL_SCANCODE_END = 77,
|
||||||
|
SDL_SCANCODE_PAGEDOWN = 78,
|
||||||
|
SDL_SCANCODE_RIGHT = 79,
|
||||||
|
SDL_SCANCODE_LEFT = 80,
|
||||||
|
SDL_SCANCODE_DOWN = 81,
|
||||||
|
SDL_SCANCODE_UP = 82,
|
||||||
|
|
||||||
|
SDL_SCANCODE_NUMLOCKCLEAR = 83,
|
||||||
|
SDL_SCANCODE_KP_DIVIDE = 84,
|
||||||
|
SDL_SCANCODE_KP_MULTIPLY = 85,
|
||||||
|
SDL_SCANCODE_KP_MINUS = 86,
|
||||||
|
SDL_SCANCODE_KP_PLUS = 87,
|
||||||
|
SDL_SCANCODE_KP_ENTER = 88,
|
||||||
|
SDL_SCANCODE_KP_1 = 89,
|
||||||
|
SDL_SCANCODE_KP_2 = 90,
|
||||||
|
SDL_SCANCODE_KP_3 = 91,
|
||||||
|
SDL_SCANCODE_KP_4 = 92,
|
||||||
|
SDL_SCANCODE_KP_5 = 93,
|
||||||
|
SDL_SCANCODE_KP_6 = 94,
|
||||||
|
SDL_SCANCODE_KP_7 = 95,
|
||||||
|
SDL_SCANCODE_KP_8 = 96,
|
||||||
|
SDL_SCANCODE_KP_9 = 97,
|
||||||
|
SDL_SCANCODE_KP_0 = 98,
|
||||||
|
SDL_SCANCODE_KP_PERIOD = 99,
|
||||||
|
|
||||||
|
SDL_SCANCODE_NONUSBACKSLASH = 100,
|
||||||
|
SDL_SCANCODE_APPLICATION = 101,
|
||||||
|
SDL_SCANCODE_POWER = 102,
|
||||||
|
SDL_SCANCODE_KP_EQUALS = 103,
|
||||||
|
SDL_SCANCODE_F13 = 104,
|
||||||
|
SDL_SCANCODE_F14 = 105,
|
||||||
|
SDL_SCANCODE_F15 = 106,
|
||||||
|
SDL_SCANCODE_F16 = 107,
|
||||||
|
SDL_SCANCODE_F17 = 108,
|
||||||
|
SDL_SCANCODE_F18 = 109,
|
||||||
|
SDL_SCANCODE_F19 = 110,
|
||||||
|
SDL_SCANCODE_F20 = 111,
|
||||||
|
SDL_SCANCODE_F21 = 112,
|
||||||
|
SDL_SCANCODE_F22 = 113,
|
||||||
|
SDL_SCANCODE_F23 = 114,
|
||||||
|
SDL_SCANCODE_F24 = 115,
|
||||||
|
SDL_SCANCODE_EXECUTE = 116,
|
||||||
|
SDL_SCANCODE_HELP = 117,
|
||||||
|
SDL_SCANCODE_MENU = 118,
|
||||||
|
SDL_SCANCODE_SELECT = 119,
|
||||||
|
SDL_SCANCODE_STOP = 120,
|
||||||
|
SDL_SCANCODE_AGAIN = 121,
|
||||||
|
SDL_SCANCODE_UNDO = 122,
|
||||||
|
SDL_SCANCODE_CUT = 123,
|
||||||
|
SDL_SCANCODE_COPY = 124,
|
||||||
|
SDL_SCANCODE_PASTE = 125,
|
||||||
|
SDL_SCANCODE_FIND = 126,
|
||||||
|
SDL_SCANCODE_MUTE = 127,
|
||||||
|
SDL_SCANCODE_VOLUMEUP = 128,
|
||||||
|
SDL_SCANCODE_VOLUMEDOWN = 129,
|
||||||
|
SDL_SCANCODE_KP_COMMA = 133,
|
||||||
|
SDL_SCANCODE_KP_EQUALSAS400 = 134,
|
||||||
|
|
||||||
|
SDL_SCANCODE_INTERNATIONAL1 = 135,
|
||||||
|
SDL_SCANCODE_INTERNATIONAL2 = 136,
|
||||||
|
SDL_SCANCODE_INTERNATIONAL3 = 137,
|
||||||
|
SDL_SCANCODE_INTERNATIONAL4 = 138,
|
||||||
|
SDL_SCANCODE_INTERNATIONAL5 = 139,
|
||||||
|
SDL_SCANCODE_INTERNATIONAL6 = 140,
|
||||||
|
SDL_SCANCODE_INTERNATIONAL7 = 141,
|
||||||
|
SDL_SCANCODE_INTERNATIONAL8 = 142,
|
||||||
|
SDL_SCANCODE_INTERNATIONAL9 = 143,
|
||||||
|
SDL_SCANCODE_LANG1 = 144,
|
||||||
|
SDL_SCANCODE_LANG2 = 145,
|
||||||
|
SDL_SCANCODE_LANG3 = 146,
|
||||||
|
SDL_SCANCODE_LANG4 = 147,
|
||||||
|
SDL_SCANCODE_LANG5 = 148,
|
||||||
|
SDL_SCANCODE_LANG6 = 149,
|
||||||
|
SDL_SCANCODE_LANG7 = 150,
|
||||||
|
SDL_SCANCODE_LANG8 = 151,
|
||||||
|
SDL_SCANCODE_LANG9 = 152,
|
||||||
|
|
||||||
|
SDL_SCANCODE_ALTERASE = 153,
|
||||||
|
SDL_SCANCODE_SYSREQ = 154,
|
||||||
|
SDL_SCANCODE_CANCEL = 155,
|
||||||
|
SDL_SCANCODE_CLEAR = 156,
|
||||||
|
SDL_SCANCODE_PRIOR = 157,
|
||||||
|
SDL_SCANCODE_RETURN2 = 158,
|
||||||
|
SDL_SCANCODE_SEPARATOR = 159,
|
||||||
|
SDL_SCANCODE_OUT = 160,
|
||||||
|
SDL_SCANCODE_OPER = 161,
|
||||||
|
SDL_SCANCODE_CLEARAGAIN = 162,
|
||||||
|
SDL_SCANCODE_CRSEL = 163,
|
||||||
|
SDL_SCANCODE_EXSEL = 164,
|
||||||
|
|
||||||
|
SDL_SCANCODE_KP_00 = 176,
|
||||||
|
SDL_SCANCODE_KP_000 = 177,
|
||||||
|
SDL_SCANCODE_THOUSANDSSEPARATOR = 178,
|
||||||
|
SDL_SCANCODE_DECIMALSEPARATOR = 179,
|
||||||
|
SDL_SCANCODE_CURRENCYUNIT = 180,
|
||||||
|
SDL_SCANCODE_CURRENCYSUBUNIT = 181,
|
||||||
|
SDL_SCANCODE_KP_LEFTPAREN = 182,
|
||||||
|
SDL_SCANCODE_KP_RIGHTPAREN = 183,
|
||||||
|
SDL_SCANCODE_KP_LEFTBRACE = 184,
|
||||||
|
SDL_SCANCODE_KP_RIGHTBRACE = 185,
|
||||||
|
SDL_SCANCODE_KP_TAB = 186,
|
||||||
|
SDL_SCANCODE_KP_BACKSPACE = 187,
|
||||||
|
SDL_SCANCODE_KP_A = 188,
|
||||||
|
SDL_SCANCODE_KP_B = 189,
|
||||||
|
SDL_SCANCODE_KP_C = 190,
|
||||||
|
SDL_SCANCODE_KP_D = 191,
|
||||||
|
SDL_SCANCODE_KP_E = 192,
|
||||||
|
SDL_SCANCODE_KP_F = 193,
|
||||||
|
SDL_SCANCODE_KP_XOR = 194,
|
||||||
|
SDL_SCANCODE_KP_POWER = 195,
|
||||||
|
SDL_SCANCODE_KP_PERCENT = 196,
|
||||||
|
SDL_SCANCODE_KP_LESS = 197,
|
||||||
|
SDL_SCANCODE_KP_GREATER = 198,
|
||||||
|
SDL_SCANCODE_KP_AMPERSAND = 199,
|
||||||
|
SDL_SCANCODE_KP_DBLAMPERSAND = 200,
|
||||||
|
SDL_SCANCODE_KP_VERTICALBAR = 201,
|
||||||
|
SDL_SCANCODE_KP_DBLVERTICALBAR = 202,
|
||||||
|
SDL_SCANCODE_KP_COLON = 203,
|
||||||
|
SDL_SCANCODE_KP_HASH = 204,
|
||||||
|
SDL_SCANCODE_KP_SPACE = 205,
|
||||||
|
SDL_SCANCODE_KP_AT = 206,
|
||||||
|
SDL_SCANCODE_KP_EXCLAM = 207,
|
||||||
|
SDL_SCANCODE_KP_MEMSTORE = 208,
|
||||||
|
SDL_SCANCODE_KP_MEMRECALL = 209,
|
||||||
|
SDL_SCANCODE_KP_MEMCLEAR = 210,
|
||||||
|
SDL_SCANCODE_KP_MEMADD = 211,
|
||||||
|
SDL_SCANCODE_KP_MEMSUBTRACT = 212,
|
||||||
|
SDL_SCANCODE_KP_MEMMULTIPLY = 213,
|
||||||
|
SDL_SCANCODE_KP_MEMDIVIDE = 214,
|
||||||
|
SDL_SCANCODE_KP_PLUSMINUS = 215,
|
||||||
|
SDL_SCANCODE_KP_CLEAR = 216,
|
||||||
|
SDL_SCANCODE_KP_CLEARENTRY = 217,
|
||||||
|
SDL_SCANCODE_KP_BINARY = 218,
|
||||||
|
SDL_SCANCODE_KP_OCTAL = 219,
|
||||||
|
SDL_SCANCODE_KP_DECIMAL = 220,
|
||||||
|
SDL_SCANCODE_KP_HEXADECIMAL = 221,
|
||||||
|
|
||||||
|
SDL_SCANCODE_LCTRL = 224,
|
||||||
|
SDL_SCANCODE_LSHIFT = 225,
|
||||||
|
SDL_SCANCODE_LALT = 226,
|
||||||
|
SDL_SCANCODE_LGUI = 227,
|
||||||
|
SDL_SCANCODE_RCTRL = 228,
|
||||||
|
SDL_SCANCODE_RSHIFT = 229,
|
||||||
|
SDL_SCANCODE_RALT = 230,
|
||||||
|
SDL_SCANCODE_RGUI = 231,
|
||||||
|
|
||||||
|
SDL_SCANCODE_MODE = 257,
|
||||||
|
|
||||||
|
SDL_SCANCODE_AUDIONEXT = 258,
|
||||||
|
SDL_SCANCODE_AUDIOPREV = 259,
|
||||||
|
SDL_SCANCODE_AUDIOSTOP = 260,
|
||||||
|
SDL_SCANCODE_AUDIOPLAY = 261,
|
||||||
|
SDL_SCANCODE_AUDIOMUTE = 262,
|
||||||
|
SDL_SCANCODE_MEDIASELECT = 263,
|
||||||
|
SDL_SCANCODE_WWW = 264,
|
||||||
|
SDL_SCANCODE_MAIL = 265,
|
||||||
|
SDL_SCANCODE_CALCULATOR = 266,
|
||||||
|
SDL_SCANCODE_COMPUTER = 267,
|
||||||
|
SDL_SCANCODE_AC_SEARCH = 268,
|
||||||
|
SDL_SCANCODE_AC_HOME = 269,
|
||||||
|
SDL_SCANCODE_AC_BACK = 270,
|
||||||
|
SDL_SCANCODE_AC_FORWARD = 271,
|
||||||
|
SDL_SCANCODE_AC_STOP = 272,
|
||||||
|
SDL_SCANCODE_AC_REFRESH = 273,
|
||||||
|
SDL_SCANCODE_AC_BOOKMARKS = 274,
|
||||||
|
|
||||||
|
SDL_SCANCODE_BRIGHTNESSDOWN = 275,
|
||||||
|
SDL_SCANCODE_BRIGHTNESSUP = 276,
|
||||||
|
SDL_SCANCODE_DISPLAYSWITCH = 277,
|
||||||
|
SDL_SCANCODE_KBDILLUMTOGGLE = 278,
|
||||||
|
SDL_SCANCODE_KBDILLUMDOWN = 279,
|
||||||
|
SDL_SCANCODE_KBDILLUMUP = 280,
|
||||||
|
SDL_SCANCODE_EJECT = 281,
|
||||||
|
SDL_SCANCODE_SLEEP = 282,
|
||||||
|
|
||||||
|
SDL_SCANCODE_APP1 = 283,
|
||||||
|
SDL_SCANCODE_APP2 = 284,
|
||||||
|
|
||||||
|
SDL_NUM_SCANCODES = 512
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_Scancode);
|
||||||
63
demos/external/wasm_imports/bindbc/sdl/bind/sdlshape.d
vendored
Normal file
63
demos/external/wasm_imports/bindbc/sdl/bind/sdlshape.d
vendored
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlshape;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
import bindbc.sdl.bind.sdlpixels : SDL_Color;
|
||||||
|
import bindbc.sdl.bind.sdlstdinc : SDL_bool;
|
||||||
|
import bindbc.sdl.bind.sdlsurface : SDL_Surface;
|
||||||
|
import bindbc.sdl.bind.sdlvideo : SDL_Window;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SDL_NONSHAPEABLE_WINDOW = -1,
|
||||||
|
SDL_INVALID_SHAPE_ARGUMENT = -2,
|
||||||
|
SDL_WINDOW_LACKS_SHAPE = -3,
|
||||||
|
}
|
||||||
|
|
||||||
|
enum WindowShapeMode {
|
||||||
|
ShapeModeDefault,
|
||||||
|
ShapeModeBinarizeAlpha,
|
||||||
|
ShapeModeReverseBinarizeAlpha,
|
||||||
|
ShapeModeColorKey
|
||||||
|
}
|
||||||
|
mixin(expandEnum!WindowShapeMode);
|
||||||
|
|
||||||
|
enum SDL_SHAPEMODEALPHA(WindowShapeMode mode) = (mode == ShapeModeDefault || mode == ShapeModeBinarizeAlpha || mode == ShapeModeReverseBinarizeAlpha);
|
||||||
|
|
||||||
|
union SDL_WindowShapeParams {
|
||||||
|
ubyte binarizationCutoff;
|
||||||
|
SDL_Color colorKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_WindowShapeMode {
|
||||||
|
WindowShapeMode mode;
|
||||||
|
SDL_WindowShapeParams parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
SDL_Window* SDL_CreateShapedWindow(const(char)*,uint,uint,uint,uint,uint);
|
||||||
|
SDL_bool SDL_IsShapedWindow(const(SDL_Window)*);
|
||||||
|
int SDL_SetWindowShape(SDL_Window*,SDL_Surface*,SDL_WindowShapeMode*);
|
||||||
|
int SDL_GetShapedWindowMode(SDL_Window*,SDL_WindowShapeMode*);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_CreateShapedWindow = SDL_Window* function(const(char)*,uint,uint,uint,uint,uint);
|
||||||
|
alias pSDL_IsShapedWindow = SDL_bool function(const(SDL_Window)*);
|
||||||
|
alias pSDL_SetWindowShape = int function(SDL_Window*,SDL_Surface*,SDL_WindowShapeMode*);
|
||||||
|
alias pSDL_GetShapedWindowMode = int function(SDL_Window*,SDL_WindowShapeMode*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_CreateShapedWindow SDL_CreateShapedWindow;
|
||||||
|
pSDL_IsShapedWindow SDL_IsShapedWindow;
|
||||||
|
pSDL_SetWindowShape SDL_SetWindowShape;
|
||||||
|
pSDL_GetShapedWindowMode SDL_GetShapedWindowMode;
|
||||||
|
}
|
||||||
|
}
|
||||||
42
demos/external/wasm_imports/bindbc/sdl/bind/sdlstdinc.d
vendored
Normal file
42
demos/external/wasm_imports/bindbc/sdl/bind/sdlstdinc.d
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlstdinc;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
|
||||||
|
enum SDL_bool {
|
||||||
|
SDL_FALSE = 0,
|
||||||
|
SDL_TRUE = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
mixin(expandEnum!SDL_bool);
|
||||||
|
|
||||||
|
alias Sint8 = byte;
|
||||||
|
alias Uint8 = ubyte;
|
||||||
|
alias Sint16 = short;
|
||||||
|
alias Uint16 = ushort;
|
||||||
|
alias Sint32 = int;
|
||||||
|
alias Uint32 = uint;
|
||||||
|
alias Sint64 = long;
|
||||||
|
alias Uint64 = ulong;
|
||||||
|
|
||||||
|
enum SDL_FOURCC(char A, char B, char C, char D) = ((A << 0) | (B << 8) | (C << 16) | (D << 24));
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
void SDL_free(void* mem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_free = void function(void* mem);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_free SDL_free;
|
||||||
|
}
|
||||||
|
}
|
||||||
230
demos/external/wasm_imports/bindbc/sdl/bind/sdlsurface.d
vendored
Normal file
230
demos/external/wasm_imports/bindbc/sdl/bind/sdlsurface.d
vendored
Normal file
|
|
@ -0,0 +1,230 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlsurface;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
import bindbc.sdl.bind.sdlblendmode : SDL_BlendMode;
|
||||||
|
import bindbc.sdl.bind.sdlrect : SDL_Rect;
|
||||||
|
import bindbc.sdl.bind.sdlrwops;
|
||||||
|
import bindbc.sdl.bind.sdlpixels : SDL_Palette, SDL_PixelFormat;
|
||||||
|
import bindbc.sdl.bind.sdlstdinc : SDL_bool;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SDL_SWSURFACE = 0,
|
||||||
|
SDL_PREALLOC = 0x00000001,
|
||||||
|
SDL_RLEACCEL = 0x00000002,
|
||||||
|
SDL_DONTFREE = 0x00000004,
|
||||||
|
}
|
||||||
|
|
||||||
|
@nogc nothrow pure
|
||||||
|
bool SDL_MUSTLOCK(const(SDL_Surface)* S)
|
||||||
|
{
|
||||||
|
pragma(inline, true);
|
||||||
|
return (S.flags & SDL_RLEACCEL) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_BlitMap;
|
||||||
|
struct SDL_Surface {
|
||||||
|
int flags;
|
||||||
|
SDL_PixelFormat* format;
|
||||||
|
int w, h;
|
||||||
|
int pitch;
|
||||||
|
void* pixels;
|
||||||
|
void* userdata;
|
||||||
|
int locked;
|
||||||
|
void* lock_data;
|
||||||
|
SDL_Rect clip_rect;
|
||||||
|
SDL_BlitMap* map;
|
||||||
|
int refcount;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern(C) nothrow alias SDL_blit = int function(SDL_Surface* src, SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect);
|
||||||
|
|
||||||
|
@nogc nothrow {
|
||||||
|
SDL_Surface* SDL_LoadBMP(const(char)* file) {
|
||||||
|
pragma(inline, true);
|
||||||
|
return SDL_LoadBMP_RW(SDL_RWFromFile(file,"rb"),1);
|
||||||
|
}
|
||||||
|
|
||||||
|
int SDL_SaveBMP(SDL_Surface* surface,const(char)* file) {
|
||||||
|
pragma(inline, true);
|
||||||
|
return SDL_SaveBMP_RW(surface,SDL_RWFromFile(file,"wb"),1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
alias SDL_BlitSurface = SDL_UpperBlit;
|
||||||
|
alias SDL_BlitScaled = SDL_UpperBlitScaled;
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl208) {
|
||||||
|
enum SDL_YUV_CONVERSION_MODE {
|
||||||
|
SDL_YUV_CONVERSION_JPEG,
|
||||||
|
SDL_YUV_CONVERSION_BT601,
|
||||||
|
SDL_YUV_CONVERSION_BT709,
|
||||||
|
SDL_YUV_CONVERSION_AUTOMATIC,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_YUV_CONVERSION_MODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
SDL_Surface* SDL_CreateRGBSurface(uint,int,int,int,uint,uint,uint,uint);
|
||||||
|
SDL_Surface* SDL_CreateRGBSurfaceFrom(void*,int,int,int,int,uint,uint,uint,uint);
|
||||||
|
void SDL_FreeSurface(SDL_Surface*);
|
||||||
|
int SDL_SetSurfacePalette(SDL_Surface*,SDL_Palette*);
|
||||||
|
int SDL_LockSurface(SDL_Surface*);
|
||||||
|
int SDL_UnlockSurface(SDL_Surface*);
|
||||||
|
SDL_Surface* SDL_LoadBMP_RW(SDL_RWops*,int);
|
||||||
|
int SDL_SaveBMP_RW(SDL_Surface*,SDL_RWops*,int);
|
||||||
|
int SDL_SetSurfaceRLE(SDL_Surface*,int);
|
||||||
|
int SDL_SetColorKey(SDL_Surface*,int,uint);
|
||||||
|
int SDL_GetColorKey(SDL_Surface*,uint*);
|
||||||
|
int SDL_SetSurfaceColorMod(SDL_Surface*,ubyte,ubyte,ubyte);
|
||||||
|
int SDL_GetSurfaceColorMod(SDL_Surface*,ubyte*,ubyte*,ubyte*);
|
||||||
|
int SDL_SetSurfaceAlphaMod(SDL_Surface*,ubyte);
|
||||||
|
int SDL_GetSurfaceAlphaMod(SDL_Surface*,ubyte*);
|
||||||
|
int SDL_SetSurfaceBlendMode(SDL_Surface*,SDL_BlendMode);
|
||||||
|
int SDL_GetSurfaceBlendMode(SDL_Surface*,SDL_BlendMode*);
|
||||||
|
SDL_bool SDL_SetClipRect(SDL_Surface*,const(SDL_Rect)*);
|
||||||
|
void SDL_GetClipRect(SDL_Surface*,SDL_Rect*);
|
||||||
|
SDL_Surface* SDL_ConvertSurface(SDL_Surface*,const(SDL_PixelFormat)*,uint);
|
||||||
|
SDL_Surface* SDL_ConvertSurfaceFormat(SDL_Surface*,uint,uint);
|
||||||
|
int SDL_ConvertPixels(int,int,uint,const(void)*,int,uint,void*,int);
|
||||||
|
int SDL_FillRect(SDL_Surface*,const(SDL_Rect)*,uint);
|
||||||
|
int SDL_FillRects(SDL_Surface*,const(SDL_Rect)*,int,uint);
|
||||||
|
int SDL_UpperBlit(SDL_Surface*,const(SDL_Rect)*,SDL_Surface*,SDL_Rect*);
|
||||||
|
int SDL_LowerBlit(SDL_Surface*,SDL_Rect*,SDL_Surface*,SDL_Rect*);
|
||||||
|
int SDL_SoftStretch(SDL_Surface*,const(SDL_Rect)*,SDL_Surface*,const(SDL_Rect)*);
|
||||||
|
int SDL_UpperBlitScaled(SDL_Surface*,const(SDL_Rect)*,SDL_Surface*,SDL_Rect*);
|
||||||
|
int SDL_LowerBlitScaled(SDL_Surface*,SDL_Rect*,SDL_Surface*,SDL_Rect*);
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl205) {
|
||||||
|
SDL_Surface* SDL_CreateRGBSurfaceWithFormat(uint,int,int,int,uint);
|
||||||
|
SDL_Surface* SDL_CreateRGBSurfaceWithFormatFrom(void*,int,int,int,int,uint);
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl205) {
|
||||||
|
SDL_Surface* SDL_DuplicateSurface(SDL_Surface*);
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl208) {
|
||||||
|
void SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE);
|
||||||
|
SDL_YUV_CONVERSION_MODE SDL_GetYUVConversionMode();
|
||||||
|
SDL_YUV_CONVERSION_MODE SDL_GetYUVConversionModeForResolution(int,int);
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
SDL_bool SDL_HasColorKey(SDL_Surface*);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {alias pSDL_CreateRGBSurface = SDL_Surface* function(uint,int,int,int,uint,uint,uint,uint);
|
||||||
|
alias pSDL_CreateRGBSurfaceFrom = SDL_Surface* function(void*,int,int,int,int,uint,uint,uint,uint);
|
||||||
|
alias pSDL_FreeSurface = void function(SDL_Surface*);
|
||||||
|
alias pSDL_SetSurfacePalette = int function(SDL_Surface*,SDL_Palette*);
|
||||||
|
alias pSDL_LockSurface = int function(SDL_Surface*);
|
||||||
|
alias pSDL_UnlockSurface = int function(SDL_Surface*);
|
||||||
|
alias pSDL_LoadBMP_RW = SDL_Surface* function(SDL_RWops*,int);
|
||||||
|
alias pSDL_SaveBMP_RW = int function(SDL_Surface*,SDL_RWops*,int);
|
||||||
|
alias pSDL_SetSurfaceRLE = int function(SDL_Surface*,int);
|
||||||
|
alias pSDL_SetColorKey = int function(SDL_Surface*,int,uint);
|
||||||
|
alias pSDL_GetColorKey = int function(SDL_Surface*,uint*);
|
||||||
|
alias pSDL_SetSurfaceColorMod = int function(SDL_Surface*,ubyte,ubyte,ubyte);
|
||||||
|
alias pSDL_GetSurfaceColorMod = int function(SDL_Surface*,ubyte*,ubyte*,ubyte*);
|
||||||
|
alias pSDL_SetSurfaceAlphaMod = int function(SDL_Surface*,ubyte);
|
||||||
|
alias pSDL_GetSurfaceAlphaMod = int function(SDL_Surface*,ubyte*);
|
||||||
|
alias pSDL_SetSurfaceBlendMode = int function(SDL_Surface*,SDL_BlendMode);
|
||||||
|
alias pSDL_GetSurfaceBlendMode = int function(SDL_Surface*,SDL_BlendMode*);
|
||||||
|
alias pSDL_SetClipRect = SDL_bool function(SDL_Surface*,const(SDL_Rect)*);
|
||||||
|
alias pSDL_GetClipRect = void function(SDL_Surface*,SDL_Rect*);
|
||||||
|
alias pSDL_ConvertSurface = SDL_Surface* function(SDL_Surface*,const(SDL_PixelFormat)*,uint);
|
||||||
|
alias pSDL_ConvertSurfaceFormat = SDL_Surface* function(SDL_Surface*,uint,uint);
|
||||||
|
alias pSDL_ConvertPixels = int function(int,int,uint,const(void)*,int,uint,void*,int);
|
||||||
|
alias pSDL_FillRect = int function(SDL_Surface*,const(SDL_Rect)*,uint);
|
||||||
|
alias pSDL_FillRects = int function(SDL_Surface*,const(SDL_Rect)*,int,uint);
|
||||||
|
alias pSDL_UpperBlit = int function(SDL_Surface*,const(SDL_Rect)*,SDL_Surface*,SDL_Rect*);
|
||||||
|
alias pSDL_LowerBlit = int function(SDL_Surface*,SDL_Rect*,SDL_Surface*,SDL_Rect*);
|
||||||
|
alias pSDL_SoftStretch = int function(SDL_Surface*,const(SDL_Rect)*,SDL_Surface*,const(SDL_Rect)*);
|
||||||
|
alias pSDL_UpperBlitScaled = int function(SDL_Surface*,const(SDL_Rect)*,SDL_Surface*,SDL_Rect*);
|
||||||
|
alias pSDL_LowerBlitScaled = int function(SDL_Surface*,SDL_Rect*,SDL_Surface*,SDL_Rect*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_CreateRGBSurface SDL_CreateRGBSurface;
|
||||||
|
pSDL_CreateRGBSurfaceFrom SDL_CreateRGBSurfaceFrom;
|
||||||
|
pSDL_FreeSurface SDL_FreeSurface;
|
||||||
|
pSDL_SetSurfacePalette SDL_SetSurfacePalette;
|
||||||
|
pSDL_LockSurface SDL_LockSurface;
|
||||||
|
pSDL_UnlockSurface SDL_UnlockSurface;
|
||||||
|
pSDL_LoadBMP_RW SDL_LoadBMP_RW;
|
||||||
|
pSDL_SaveBMP_RW SDL_SaveBMP_RW;
|
||||||
|
pSDL_SetSurfaceRLE SDL_SetSurfaceRLE;
|
||||||
|
pSDL_SetColorKey SDL_SetColorKey;
|
||||||
|
pSDL_GetColorKey SDL_GetColorKey;
|
||||||
|
pSDL_SetSurfaceColorMod SDL_SetSurfaceColorMod;
|
||||||
|
pSDL_GetSurfaceColorMod SDL_GetSurfaceColorMod;
|
||||||
|
pSDL_SetSurfaceAlphaMod SDL_SetSurfaceAlphaMod;
|
||||||
|
pSDL_GetSurfaceAlphaMod SDL_GetSurfaceAlphaMod;
|
||||||
|
pSDL_SetSurfaceBlendMode SDL_SetSurfaceBlendMode;
|
||||||
|
pSDL_GetSurfaceBlendMode SDL_GetSurfaceBlendMode;
|
||||||
|
pSDL_SetClipRect SDL_SetClipRect;
|
||||||
|
pSDL_GetClipRect SDL_GetClipRect;
|
||||||
|
pSDL_ConvertSurface SDL_ConvertSurface;
|
||||||
|
pSDL_ConvertSurfaceFormat SDL_ConvertSurfaceFormat;
|
||||||
|
pSDL_ConvertPixels SDL_ConvertPixels;
|
||||||
|
pSDL_FillRect SDL_FillRect;
|
||||||
|
pSDL_FillRects SDL_FillRects;
|
||||||
|
pSDL_UpperBlit SDL_UpperBlit;
|
||||||
|
pSDL_LowerBlit SDL_LowerBlit;
|
||||||
|
pSDL_SoftStretch SDL_SoftStretch;
|
||||||
|
pSDL_UpperBlitScaled SDL_UpperBlitScaled;
|
||||||
|
pSDL_LowerBlitScaled SDL_LowerBlitScaled;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl205) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_CreateRGBSurfaceWithFormat = SDL_Surface* function(uint,int,int,int,uint);
|
||||||
|
alias pSDL_CreateRGBSurfaceWithFormatFrom = SDL_Surface* function(void*,int,int,int,int,uint);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_CreateRGBSurfaceWithFormat SDL_CreateRGBSurfaceWithFormat;
|
||||||
|
pSDL_CreateRGBSurfaceWithFormatFrom SDL_CreateRGBSurfaceWithFormatFrom;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl205) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_DuplicateSurface = SDL_Surface* function(SDL_Surface*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_DuplicateSurface SDL_DuplicateSurface;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl208) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_SetYUVConversionMode = void function(SDL_YUV_CONVERSION_MODE);
|
||||||
|
alias pSDL_GetYUVConversionMode = SDL_YUV_CONVERSION_MODE function();
|
||||||
|
alias pSDL_GetYUVConversionModeForResolution = SDL_YUV_CONVERSION_MODE function(int,int);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_SetYUVConversionMode SDL_SetYUVConversionMode;
|
||||||
|
pSDL_GetYUVConversionMode SDL_GetYUVConversionMode;
|
||||||
|
pSDL_GetYUVConversionModeForResolution SDL_GetYUVConversionModeForResolution;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_HasColorKey = SDL_bool function(SDL_Surface*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_HasColorKey SDL_HasColorKey;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
152
demos/external/wasm_imports/bindbc/sdl/bind/sdlsystem.d
vendored
Normal file
152
demos/external/wasm_imports/bindbc/sdl/bind/sdlsystem.d
vendored
Normal file
|
|
@ -0,0 +1,152 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlsystem;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
import bindbc.sdl.bind.sdlrender : SDL_Renderer;
|
||||||
|
import bindbc.sdl.bind.sdlstdinc : SDL_bool;
|
||||||
|
|
||||||
|
version(Android) {
|
||||||
|
enum int SDL_ANDROID_EXTERNAL_STORAGE_READ = 0x01;
|
||||||
|
enum int SDL_ANDROID_EXTERNAL_STORAGE_WRITE = 0x02;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl201) {
|
||||||
|
version(Windows) struct IDirect3DDevice9;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
version(Windows) {
|
||||||
|
extern(C) nothrow alias SDL_WindowsMessageHook = void function(void*,void*,uint,ulong,long);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
version(Android) {
|
||||||
|
void* SDL_AndroidGetJNIEnv();
|
||||||
|
void* SDL_AndroidGetActivity();
|
||||||
|
const(char)* SDL_AndroidGetInternalStoragePath();
|
||||||
|
int SDL_AndroidGetInternalStorageState();
|
||||||
|
const(char)* SDL_AndroidGetExternalStoragePath();
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl208) {
|
||||||
|
SDL_bool SDL_IsAndroidTV();
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
SDL_bool SDL_IsChromebook();
|
||||||
|
SDL_bool SDL_IsDeXMode();
|
||||||
|
void SDL_AndroidBackButton();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else version(Windows) {
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl201) {
|
||||||
|
int SDL_Direct3D9GetAdapterIndex(int);
|
||||||
|
IDirect3DDevice9* SDL_RenderGetD3D9Device(SDL_Renderer*);
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl202) {
|
||||||
|
SDL_bool SDL_DXGIGetOutputInfo(int,int*,int*);
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
void SDL_SetWindowsMessageHook(SDL_WindowsMessageHook,void*);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else version(linux) {
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
int SDL_LinuxSetThreadPriority(long,int);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
version(Android) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_AndroidGetJNIEnv = void* function();
|
||||||
|
alias pSDL_AndroidGetActivity = void* function();
|
||||||
|
alias pSDL_AndroidGetInternalStoragePath = const(char)* function();
|
||||||
|
alias pSDL_AndroidGetInternalStorageState = int function();
|
||||||
|
alias pSDL_AndroidGetExternalStoragePath = const(char)* function();
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_AndroidGetJNIEnv SDL_AndroidGetJNIEnv;
|
||||||
|
pSDL_AndroidGetActivity SDL_AndroidGetActivity;
|
||||||
|
|
||||||
|
pSDL_AndroidGetInternalStoragePath SDL_AndroidGetInternalStoragePath;
|
||||||
|
pSDL_AndroidGetInternalStorageState SDL_AndroidGetInternalStorageState;
|
||||||
|
pSDL_AndroidGetExternalStoragePath SDL_AndroidGetExternalStoragePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl208) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_IsAndroidTV = SDL_bool function();
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_IsAndroidTV SDL_IsAndroidTV;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_IsChromebook = SDL_bool function();
|
||||||
|
alias pSDL_IsDeXMode = SDL_bool function();
|
||||||
|
alias pSDL_AndroidBackButton = void function();
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_IsChromebook SDL_IsChromebook;
|
||||||
|
pSDL_IsDeXMode SDL_IsDeXMode;
|
||||||
|
pSDL_AndroidBackButton SDL_AndroidBackButton;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else version(Windows) {
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl201) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_Direct3D9GetAdapterIndex = int function(int);
|
||||||
|
alias pSDL_RenderGetD3D9Device = IDirect3DDevice9* function(SDL_Renderer*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_Direct3D9GetAdapterIndex SDL_Direct3D9GetAdapterIndex ;
|
||||||
|
pSDL_RenderGetD3D9Device SDL_RenderGetD3D9Device;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl202) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_DXGIGetOutputInfo = SDL_bool function(int,int*,int*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_DXGIGetOutputInfo SDL_DXGIGetOutputInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_SetWindowsMessageHook = void function(SDL_WindowsMessageHook,void*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_SetWindowsMessageHook SDL_SetWindowsMessageHook;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else version(linux) {
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_LinuxSetThreadPriority = int function(long,int);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_LinuxSetThreadPriority SDL_LinuxSetThreadPriority;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
240
demos/external/wasm_imports/bindbc/sdl/bind/sdlsyswm.d
vendored
Normal file
240
demos/external/wasm_imports/bindbc/sdl/bind/sdlsyswm.d
vendored
Normal file
|
|
@ -0,0 +1,240 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlsyswm;
|
||||||
|
|
||||||
|
//import core.stdc.config : c_long;
|
||||||
|
alias int c_long;
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
import bindbc.sdl.bind.sdlstdinc : SDL_bool;
|
||||||
|
import bindbc.sdl.bind.sdlversion : SDL_version;
|
||||||
|
import bindbc.sdl.bind.sdlvideo : SDL_Window;
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl205) {
|
||||||
|
enum SDL_SYSWM_TYPE {
|
||||||
|
SDL_SYSWM_UNKNOWN,
|
||||||
|
SDL_SYSWM_WINDOWS,
|
||||||
|
SDL_SYSWM_X11,
|
||||||
|
SDL_SYSWM_DIRECTFB,
|
||||||
|
SDL_SYSWM_COCOA,
|
||||||
|
SDL_SYSWM_UIKIT,
|
||||||
|
SDL_SYSWM_WAYLAND,
|
||||||
|
SDL_SYSWM_MIR,
|
||||||
|
SDL_SYSWM_WINRT,
|
||||||
|
SDL_SYSWM_ANDROID,
|
||||||
|
SDL_SYSWM_VIVANTE,
|
||||||
|
SDL_SYSWM_OS2,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else static if(sdlSupport >= SDLSupport.sdl205) {
|
||||||
|
enum SDL_SYSWM_TYPE {
|
||||||
|
SDL_SYSWM_UNKNOWN,
|
||||||
|
SDL_SYSWM_WINDOWS,
|
||||||
|
SDL_SYSWM_X11,
|
||||||
|
SDL_SYSWM_DIRECTFB,
|
||||||
|
SDL_SYSWM_COCOA,
|
||||||
|
SDL_SYSWM_UIKIT,
|
||||||
|
SDL_SYSWM_WAYLAND,
|
||||||
|
SDL_SYSWM_MIR,
|
||||||
|
SDL_SYSWM_WINRT,
|
||||||
|
SDL_SYSWM_ANDROID,
|
||||||
|
SDL_SYSWM_VIVANTE,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
enum SDL_SYSWM_TYPE {
|
||||||
|
SDL_SYSWM_UNKNOWN,
|
||||||
|
SDL_SYSWM_WINDOWS,
|
||||||
|
SDL_SYSWM_X11,
|
||||||
|
SDL_SYSWM_DIRECTFB,
|
||||||
|
SDL_SYSWM_COCOA,
|
||||||
|
SDL_SYSWM_UIKIT,
|
||||||
|
SDL_SYSWM_WAYLAND,
|
||||||
|
SDL_SYSWM_MIR,
|
||||||
|
SDL_SYSWM_WINRT,
|
||||||
|
SDL_SYSWM_ANDROID,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else static if(sdlSupport >= SDLSupport.sdl203) {
|
||||||
|
enum SDL_SYSWM_TYPE {
|
||||||
|
SDL_SYSWM_UNKNOWN,
|
||||||
|
SDL_SYSWM_WINDOWS,
|
||||||
|
SDL_SYSWM_X11,
|
||||||
|
SDL_SYSWM_DIRECTFB,
|
||||||
|
SDL_SYSWM_COCOA,
|
||||||
|
SDL_SYSWM_UIKIT,
|
||||||
|
SDL_SYSWM_WAYLAND,
|
||||||
|
SDL_SYSWM_MIR,
|
||||||
|
SDL_SYSWM_WINRT,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else static if(sdlSupport >= SDLSupport.sdl202) {
|
||||||
|
enum SDL_SYSWM_TYPE {
|
||||||
|
SDL_SYSWM_UNKNOWN,
|
||||||
|
SDL_SYSWM_WINDOWS,
|
||||||
|
SDL_SYSWM_X11,
|
||||||
|
SDL_SYSWM_DIRECTFB,
|
||||||
|
SDL_SYSWM_COCOA,
|
||||||
|
SDL_SYSWM_UIKIT,
|
||||||
|
SDL_SYSWM_WAYLAND,
|
||||||
|
SDL_SYSWM_MIR,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
enum SDL_SYSWM_TYPE {
|
||||||
|
SDL_SYSWM_UNKNOWN,
|
||||||
|
SDL_SYSWM_WINDOWS,
|
||||||
|
SDL_SYSWM_X11,
|
||||||
|
SDL_SYSWM_DIRECTFB,
|
||||||
|
SDL_SYSWM_COCOA,
|
||||||
|
SDL_SYSWM_UIKIT,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_SYSWM_TYPE);
|
||||||
|
|
||||||
|
version(Windows) {
|
||||||
|
// I don't want to import core.sys.windows.windows just for these
|
||||||
|
version(Win64) {
|
||||||
|
alias wparam = ulong;
|
||||||
|
alias lparam = long;
|
||||||
|
}else {
|
||||||
|
alias wparam = uint;
|
||||||
|
alias lparam = int;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_SysWMmsg {
|
||||||
|
SDL_version version_;
|
||||||
|
SDL_SYSWM_TYPE subsystem;
|
||||||
|
union msg_ {
|
||||||
|
version(Windows) {
|
||||||
|
struct win_ {
|
||||||
|
void* hwnd;
|
||||||
|
uint msg;
|
||||||
|
wparam wParam;
|
||||||
|
lparam lParam;
|
||||||
|
}
|
||||||
|
win_ win;
|
||||||
|
}
|
||||||
|
else version(OSX) {
|
||||||
|
struct cocoa_ {
|
||||||
|
int dummy;
|
||||||
|
}
|
||||||
|
cocoa_ cocoa;
|
||||||
|
}
|
||||||
|
else version(linux) {
|
||||||
|
struct dfb_ {
|
||||||
|
void* event;
|
||||||
|
}
|
||||||
|
dfb_ dfb;
|
||||||
|
}
|
||||||
|
|
||||||
|
version(Posix) {
|
||||||
|
struct x11_ {
|
||||||
|
c_long[24] pad; // sufficient size for any X11 event
|
||||||
|
}
|
||||||
|
x11_ x11;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl205) {
|
||||||
|
struct vivante_ {
|
||||||
|
int dummy;
|
||||||
|
}
|
||||||
|
vivante_ vivante;
|
||||||
|
}
|
||||||
|
|
||||||
|
int dummy;
|
||||||
|
}
|
||||||
|
msg_ msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_SysWMinfo {
|
||||||
|
SDL_version version_;
|
||||||
|
SDL_SYSWM_TYPE subsystem;
|
||||||
|
|
||||||
|
union info_ {
|
||||||
|
version(Windows) {
|
||||||
|
struct win_ {
|
||||||
|
void* window;
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) void* hdc;
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) void* hinstance;
|
||||||
|
}
|
||||||
|
win_ win;
|
||||||
|
}
|
||||||
|
else version(OSX) {
|
||||||
|
struct cocoa_ {
|
||||||
|
void* window;
|
||||||
|
}
|
||||||
|
cocoa_ cocoa;
|
||||||
|
|
||||||
|
struct uikit_ {
|
||||||
|
void *window;
|
||||||
|
}
|
||||||
|
uikit_ uikit;
|
||||||
|
|
||||||
|
}
|
||||||
|
else version(linux) {
|
||||||
|
struct dfb_ {
|
||||||
|
void *dfb;
|
||||||
|
void *window;
|
||||||
|
void *surface;
|
||||||
|
}
|
||||||
|
dfb_ dfb;
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl202) {
|
||||||
|
struct wl_ {
|
||||||
|
void *display;
|
||||||
|
void *surface;
|
||||||
|
void *shell_surface;
|
||||||
|
}
|
||||||
|
wl_ wl;
|
||||||
|
|
||||||
|
struct mir_ {
|
||||||
|
void *connection;
|
||||||
|
void *surface;
|
||||||
|
}
|
||||||
|
mir_ mir;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
version(Posix) {
|
||||||
|
struct x11_ {
|
||||||
|
void* display;
|
||||||
|
uint window;
|
||||||
|
}
|
||||||
|
x11_ x11;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
version(Android) {
|
||||||
|
struct android_ {
|
||||||
|
void* window;
|
||||||
|
void* surface;
|
||||||
|
}
|
||||||
|
android_ android;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) ubyte[64] dummy;
|
||||||
|
else int dummy;
|
||||||
|
}
|
||||||
|
info_ info;
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
SDL_bool SDL_GetWindowWMInfo(SDL_Window*,SDL_SysWMinfo*);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GetWindowWMInfo = SDL_bool function(SDL_Window*,SDL_SysWMinfo*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GetWindowWMInfo SDL_GetWindowWMInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
51
demos/external/wasm_imports/bindbc/sdl/bind/sdltimer.d
vendored
Normal file
51
demos/external/wasm_imports/bindbc/sdl/bind/sdltimer.d
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdltimer;
|
||||||
|
|
||||||
|
import bindbc.sdl.bind.sdlstdinc : SDL_bool;
|
||||||
|
|
||||||
|
extern(C) nothrow alias SDL_TimerCallback = uint function(uint interval, void* param);
|
||||||
|
alias SDL_TimerID = int;
|
||||||
|
|
||||||
|
// This was added to SDL 2.0.1 as a macro, but it's
|
||||||
|
// useful & has no dependency on the library version,
|
||||||
|
// so it's here for 2.0.0 as well.
|
||||||
|
@nogc nothrow pure
|
||||||
|
bool SDL_TICKS_PASSED(uint A, uint B) {
|
||||||
|
pragma(inline, true);
|
||||||
|
return cast(int)(B - A) <= 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
uint SDL_GetTicks();
|
||||||
|
ulong SDL_GetPerformanceCounter();
|
||||||
|
ulong SDL_GetPerformanceFrequency();
|
||||||
|
void SDL_Delay(uint);
|
||||||
|
SDL_TimerID SDL_AddTimer(uint,SDL_TimerCallback,void*);
|
||||||
|
SDL_bool SDL_RemoveTimer(SDL_TimerID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GetTicks = uint function();
|
||||||
|
alias pSDL_GetPerformanceCounter = ulong function();
|
||||||
|
alias pSDL_GetPerformanceFrequency = ulong function();
|
||||||
|
alias pSDL_Delay = void function(uint);
|
||||||
|
alias pSDL_AddTimer = SDL_TimerID function(uint,SDL_TimerCallback,void*);
|
||||||
|
alias pSDL_RemoveTimer = SDL_bool function(SDL_TimerID);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GetTicks SDL_GetTicks;
|
||||||
|
pSDL_GetPerformanceCounter SDL_GetPerformanceCounter;
|
||||||
|
pSDL_GetPerformanceFrequency SDL_GetPerformanceFrequency;
|
||||||
|
pSDL_Delay SDL_Delay;
|
||||||
|
pSDL_AddTimer SDL_AddTimer;
|
||||||
|
pSDL_RemoveTimer SDL_RemoveTimer;
|
||||||
|
}
|
||||||
|
}
|
||||||
67
demos/external/wasm_imports/bindbc/sdl/bind/sdltouch.d
vendored
Normal file
67
demos/external/wasm_imports/bindbc/sdl/bind/sdltouch.d
vendored
Normal file
|
|
@ -0,0 +1,67 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdltouch;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
|
||||||
|
alias SDL_TouchID = long;
|
||||||
|
alias SDL_FingerID = long;
|
||||||
|
|
||||||
|
struct SDL_Finger {
|
||||||
|
SDL_FingerID id;
|
||||||
|
float x;
|
||||||
|
float y;
|
||||||
|
float pressure;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum DL_TOUCH_MOUSEID = cast(uint)-1;
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl2010) {
|
||||||
|
enum SDL_TouchDeviceType {
|
||||||
|
SDL_TOUCH_DEVICE_INVALID = -1,
|
||||||
|
SDL_TOUCH_DEVICE_DIRECT,
|
||||||
|
SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE,
|
||||||
|
SDL_TOUCH_DEVICE_INDIRECT_RELATIVE,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_TouchDeviceType);
|
||||||
|
|
||||||
|
enum SDL_MOUSE_TOUCHID = -1L;
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
int SDL_GetNumTouchDevices();
|
||||||
|
SDL_TouchID SDL_GetTouchDevice(int);
|
||||||
|
int SDL_GetNumTouchFingers(SDL_TouchID);
|
||||||
|
SDL_Finger* SDL_GetTouchFinger(SDL_TouchID,int);
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl2010) {
|
||||||
|
SDL_TouchDeviceType SDL_GetTouchDeviceType(SDL_TouchID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GetNumTouchDevices = int function();
|
||||||
|
alias pSDL_GetTouchDevice = SDL_TouchID function(int);
|
||||||
|
alias pSDL_GetNumTouchFingers = int function(SDL_TouchID);
|
||||||
|
alias pSDL_GetTouchFinger = SDL_Finger* function(SDL_TouchID,int);
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_GetNumTouchDevices SDL_GetNumTouchDevices;
|
||||||
|
pSDL_GetTouchDevice SDL_GetTouchDevice;
|
||||||
|
pSDL_GetNumTouchFingers SDL_GetNumTouchFingers;
|
||||||
|
pSDL_GetTouchFinger SDL_GetTouchFinger;
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl2010) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GetTouchDeviceType = SDL_TouchDeviceType function(SDL_TouchID);
|
||||||
|
}
|
||||||
|
__gshared {
|
||||||
|
pSDL_GetTouchDeviceType SDL_GetTouchDeviceType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
83
demos/external/wasm_imports/bindbc/sdl/bind/sdlversion.d
vendored
Normal file
83
demos/external/wasm_imports/bindbc/sdl/bind/sdlversion.d
vendored
Normal file
|
|
@ -0,0 +1,83 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlversion;
|
||||||
|
|
||||||
|
struct SDL_version {
|
||||||
|
ubyte major;
|
||||||
|
ubyte minor;
|
||||||
|
ubyte patch;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SDL_MAJOR_VERSION = 2;
|
||||||
|
enum SDL_MINOR_VERSION = 0;
|
||||||
|
|
||||||
|
version(SDL_201) {
|
||||||
|
enum ubyte SDL_PATCHLEVEL = 1;
|
||||||
|
}
|
||||||
|
else version(SDL_202) {
|
||||||
|
enum ubyte SDL_PATCHLEVEL = 2;
|
||||||
|
}
|
||||||
|
else version(SDL_203) {
|
||||||
|
enum ubyte SDL_PATCHLEVEL = 3;
|
||||||
|
}
|
||||||
|
else version(SDL_204) {
|
||||||
|
enum ubyte SDL_PATCHLEVEL = 4;
|
||||||
|
}
|
||||||
|
else version(SDL_205) {
|
||||||
|
enum ubyte SDL_PATCHLEVEL = 5;
|
||||||
|
}
|
||||||
|
else version(SDL_206) {
|
||||||
|
enum ubyte SDL_PATCHLEVEL = 6;
|
||||||
|
}
|
||||||
|
else version(SDL_207) {
|
||||||
|
enum ubyte SDL_PATCHLEVEL = 7;
|
||||||
|
}
|
||||||
|
else version(SDL_208) {
|
||||||
|
enum ubyte SDL_PATCHLEVEL = 8;
|
||||||
|
}
|
||||||
|
else version(SDL_209) {
|
||||||
|
enum ubyte SDL_PATCHLEVEL = 9;
|
||||||
|
}
|
||||||
|
else version(SDL_2010) {
|
||||||
|
enum ubyte SDL_PATCHLEVEL = 10;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
enum ubyte SDL_PATCHLEVEL = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@nogc nothrow pure
|
||||||
|
void SDL_VERSION(SDL_version* x) {
|
||||||
|
pragma(inline, true);
|
||||||
|
x.major = SDL_MAJOR_VERSION;
|
||||||
|
x.minor = SDL_MINOR_VERSION;
|
||||||
|
x.patch = SDL_PATCHLEVEL;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SDL_VERSIONNUM(ubyte X, ubyte Y, ubyte Z) = X*1000 + Y*100 + Z;
|
||||||
|
enum SDL_COMPILEDVERSION = SDL_VERSIONNUM!(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL);
|
||||||
|
enum SDL_VERSION_ATLEAST(ubyte X, ubyte Y, ubyte Z) = SDL_COMPILEDVERSION >= SDL_VERSIONNUM!(X, Y, Z);
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
void SDL_GetVersion(SDL_version*);
|
||||||
|
const(char)* SDL_GetRevision();
|
||||||
|
int SDL_GetRevisionNumber();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GetVersion = void function(SDL_version*);
|
||||||
|
alias pSDL_GetRevision = const(char)* function();
|
||||||
|
alias pSDL_GetRevisionNumber = int function();
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GetVersion SDL_GetVersion;
|
||||||
|
pSDL_GetRevision SDL_GetRevision;
|
||||||
|
pSDL_GetRevisionNumber SDL_GetRevisionNumber;
|
||||||
|
}
|
||||||
|
}
|
||||||
677
demos/external/wasm_imports/bindbc/sdl/bind/sdlvideo.d
vendored
Normal file
677
demos/external/wasm_imports/bindbc/sdl/bind/sdlvideo.d
vendored
Normal file
|
|
@ -0,0 +1,677 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlvideo;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
|
||||||
|
import bindbc.sdl.bind.sdlrect : SDL_Rect;
|
||||||
|
import bindbc.sdl.bind.sdlstdinc : SDL_bool;
|
||||||
|
import bindbc.sdl.bind.sdlsurface : SDL_Surface;
|
||||||
|
|
||||||
|
struct SDL_DisplayMode {
|
||||||
|
uint format;
|
||||||
|
int w;
|
||||||
|
int h;
|
||||||
|
int refresh_rate;
|
||||||
|
void* driverdata;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDL_Window;
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) {
|
||||||
|
enum SDL_WindowFlags {
|
||||||
|
SDL_WINDOW_FULLSCREEN = 0x00000001,
|
||||||
|
SDL_WINDOW_OPENGL = 0x00000002,
|
||||||
|
SDL_WINDOW_SHOWN = 0x00000004,
|
||||||
|
SDL_WINDOW_HIDDEN = 0x00000008,
|
||||||
|
SDL_WINDOW_BORDERLESS = 0x00000010,
|
||||||
|
SDL_WINDOW_RESIZABLE = 0x00000020,
|
||||||
|
SDL_WINDOW_MINIMIZED = 0x00000040,
|
||||||
|
SDL_WINDOW_MAXIMIZED = 0x00000080,
|
||||||
|
SDL_WINDOW_INPUT_GRABBED = 0x00000100,
|
||||||
|
SDL_WINDOW_INPUT_FOCUS = 0x00000200,
|
||||||
|
SDL_WINDOW_MOUSE_FOCUS = 0x00000400,
|
||||||
|
SDL_WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN | 0x00001000,
|
||||||
|
SDL_WINDOW_FOREIGN = 0x00000800,
|
||||||
|
SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000,
|
||||||
|
SDL_WINDOW_MOUSE_CAPTURE = 0x00004000,
|
||||||
|
SDL_WINDOW_ALWAYS_ON_TOP = 0x00008000,
|
||||||
|
SDL_WINDOW_SKIP_TASKBAR = 0x00010000,
|
||||||
|
SDL_WINDOW_UTILITY = 0x00020000,
|
||||||
|
SDL_WINDOW_TOOLTIP = 0x00040000,
|
||||||
|
SDL_WINDOW_POPUP_MENU = 0x00080000,
|
||||||
|
SDL_WINDOW_VULKAN = 0x10000000,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else static if(sdlSupport >= SDLSupport.sdl205) {
|
||||||
|
enum SDL_WindowFlags {
|
||||||
|
SDL_WINDOW_FULLSCREEN = 0x00000001,
|
||||||
|
SDL_WINDOW_OPENGL = 0x00000002,
|
||||||
|
SDL_WINDOW_SHOWN = 0x00000004,
|
||||||
|
SDL_WINDOW_HIDDEN = 0x00000008,
|
||||||
|
SDL_WINDOW_BORDERLESS = 0x00000010,
|
||||||
|
SDL_WINDOW_RESIZABLE = 0x00000020,
|
||||||
|
SDL_WINDOW_MINIMIZED = 0x00000040,
|
||||||
|
SDL_WINDOW_MAXIMIZED = 0x00000080,
|
||||||
|
SDL_WINDOW_INPUT_GRABBED = 0x00000100,
|
||||||
|
SDL_WINDOW_INPUT_FOCUS = 0x00000200,
|
||||||
|
SDL_WINDOW_MOUSE_FOCUS = 0x00000400,
|
||||||
|
SDL_WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN | 0x00001000,
|
||||||
|
SDL_WINDOW_FOREIGN = 0x00000800,
|
||||||
|
SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000,
|
||||||
|
SDL_WINDOW_MOUSE_CAPTURE = 0x00004000,
|
||||||
|
SDL_WINDOW_ALWAYS_ON_TOP = 0x00008000,
|
||||||
|
SDL_WINDOW_SKIP_TASKBAR = 0x00010000,
|
||||||
|
SDL_WINDOW_UTILITY = 0x00020000,
|
||||||
|
SDL_WINDOW_TOOLTIP = 0x00040000,
|
||||||
|
SDL_WINDOW_POPUP_MENU = 0x00080000,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
enum SDL_WindowFlags {
|
||||||
|
SDL_WINDOW_FULLSCREEN = 0x00000001,
|
||||||
|
SDL_WINDOW_OPENGL = 0x00000002,
|
||||||
|
SDL_WINDOW_SHOWN = 0x00000004,
|
||||||
|
SDL_WINDOW_HIDDEN = 0x00000008,
|
||||||
|
SDL_WINDOW_BORDERLESS = 0x00000010,
|
||||||
|
SDL_WINDOW_RESIZABLE = 0x00000020,
|
||||||
|
SDL_WINDOW_MINIMIZED = 0x00000040,
|
||||||
|
SDL_WINDOW_MAXIMIZED = 0x00000080,
|
||||||
|
SDL_WINDOW_INPUT_GRABBED = 0x00000100,
|
||||||
|
SDL_WINDOW_INPUT_FOCUS = 0x00000200,
|
||||||
|
SDL_WINDOW_MOUSE_FOCUS = 0x00000400,
|
||||||
|
SDL_WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN | 0x00001000,
|
||||||
|
SDL_WINDOW_FOREIGN = 0x00000800,
|
||||||
|
SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000,
|
||||||
|
SDL_WINDOW_MOUSE_CAPTURE = 0x00004000,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else static if(sdlSupport >= SDLSupport.sdl201) {
|
||||||
|
enum SDL_WindowFlags {
|
||||||
|
SDL_WINDOW_FULLSCREEN = 0x00000001,
|
||||||
|
SDL_WINDOW_OPENGL = 0x00000002,
|
||||||
|
SDL_WINDOW_SHOWN = 0x00000004,
|
||||||
|
SDL_WINDOW_HIDDEN = 0x00000008,
|
||||||
|
SDL_WINDOW_BORDERLESS = 0x00000010,
|
||||||
|
SDL_WINDOW_RESIZABLE = 0x00000020,
|
||||||
|
SDL_WINDOW_MINIMIZED = 0x00000040,
|
||||||
|
SDL_WINDOW_MAXIMIZED = 0x00000080,
|
||||||
|
SDL_WINDOW_INPUT_GRABBED = 0x00000100,
|
||||||
|
SDL_WINDOW_INPUT_FOCUS = 0x00000200,
|
||||||
|
SDL_WINDOW_MOUSE_FOCUS = 0x00000400,
|
||||||
|
SDL_WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN | 0x00001000,
|
||||||
|
SDL_WINDOW_FOREIGN = 0x00000800,
|
||||||
|
SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
enum SDL_WindowFlags {
|
||||||
|
SDL_WINDOW_FULLSCREEN = 0x00000001,
|
||||||
|
SDL_WINDOW_OPENGL = 0x00000002,
|
||||||
|
SDL_WINDOW_SHOWN = 0x00000004,
|
||||||
|
SDL_WINDOW_HIDDEN = 0x00000008,
|
||||||
|
SDL_WINDOW_BORDERLESS = 0x00000010,
|
||||||
|
SDL_WINDOW_RESIZABLE = 0x00000020,
|
||||||
|
SDL_WINDOW_MINIMIZED = 0x00000040,
|
||||||
|
SDL_WINDOW_MAXIMIZED = 0x00000080,
|
||||||
|
SDL_WINDOW_INPUT_GRABBED = 0x00000100,
|
||||||
|
SDL_WINDOW_INPUT_FOCUS = 0x00000200,
|
||||||
|
SDL_WINDOW_MOUSE_FOCUS = 0x00000400,
|
||||||
|
SDL_WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN | 0x00001000,
|
||||||
|
SDL_WINDOW_FOREIGN = 0x00000800,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_WindowFlags);
|
||||||
|
|
||||||
|
enum uint SDL_WINDOWPOS_UNDEFINED_MASK = 0x1FFF0000;
|
||||||
|
enum uint SDL_WINDOWPOS_UNDEFINED_DISPLAY(uint x) = SDL_WINDOWPOS_UNDEFINED_MASK | x;
|
||||||
|
enum uint SDL_WINDOWPOS_UNDEFINED = SDL_WINDOWPOS_UNDEFINED_DISPLAY!(0);
|
||||||
|
enum uint SDL_WINDOWPOS_ISUNDEFINED(uint x) = (x & 0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK;
|
||||||
|
|
||||||
|
enum uint SDL_WINDOWPOS_CENTERED_MASK = 0x2FFF0000;
|
||||||
|
enum uint SDL_WINDOWPOS_CENTERED_DISPLAY(uint x) = SDL_WINDOWPOS_CENTERED_MASK | x;
|
||||||
|
enum uint SDL_WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED_DISPLAY!(0);
|
||||||
|
enum uint SDL_WINDOWPOS_ISCENTERED(uint x) = (x & 0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK;
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl205) {
|
||||||
|
enum SDL_WindowEventID : ubyte {
|
||||||
|
SDL_WINDOWEVENT_NONE,
|
||||||
|
SDL_WINDOWEVENT_SHOWN,
|
||||||
|
SDL_WINDOWEVENT_HIDDEN,
|
||||||
|
SDL_WINDOWEVENT_EXPOSED,
|
||||||
|
SDL_WINDOWEVENT_MOVED,
|
||||||
|
SDL_WINDOWEVENT_RESIZED,
|
||||||
|
SDL_WINDOWEVENT_SIZE_CHANGED,
|
||||||
|
SDL_WINDOWEVENT_MINIMIZED,
|
||||||
|
SDL_WINDOWEVENT_MAXIMIZED,
|
||||||
|
SDL_WINDOWEVENT_RESTORED,
|
||||||
|
SDL_WINDOWEVENT_ENTER,
|
||||||
|
SDL_WINDOWEVENT_LEAVE,
|
||||||
|
SDL_WINDOWEVENT_FOCUS_GAINED,
|
||||||
|
SDL_WINDOWEVENT_FOCUS_LOST,
|
||||||
|
SDL_WINDOWEVENT_CLOSE,
|
||||||
|
SDL_WINDOWEVENT_TAKE_FOCUS,
|
||||||
|
SDL_WINDOWEVENT_HIT_TEST,
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
enum SDL_WindowEventID : ubyte {
|
||||||
|
SDL_WINDOWEVENT_NONE,
|
||||||
|
SDL_WINDOWEVENT_SHOWN,
|
||||||
|
SDL_WINDOWEVENT_HIDDEN,
|
||||||
|
SDL_WINDOWEVENT_EXPOSED,
|
||||||
|
SDL_WINDOWEVENT_MOVED,
|
||||||
|
SDL_WINDOWEVENT_RESIZED,
|
||||||
|
SDL_WINDOWEVENT_SIZE_CHANGED,
|
||||||
|
SDL_WINDOWEVENT_MINIMIZED,
|
||||||
|
SDL_WINDOWEVENT_MAXIMIZED,
|
||||||
|
SDL_WINDOWEVENT_RESTORED,
|
||||||
|
SDL_WINDOWEVENT_ENTER,
|
||||||
|
SDL_WINDOWEVENT_LEAVE,
|
||||||
|
SDL_WINDOWEVENT_FOCUS_GAINED,
|
||||||
|
SDL_WINDOWEVENT_FOCUS_LOST,
|
||||||
|
SDL_WINDOWEVENT_CLOSE,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_WindowEventID);
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
enum SDL_DisplayEventID {
|
||||||
|
SDL_DISPLAYEVENT_NONE,
|
||||||
|
SDL_DISPLAYEVENT_ORIENTATION,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_DisplayEventID);
|
||||||
|
|
||||||
|
enum SDL_DisplayOrientation {
|
||||||
|
SDL_ORIENTATION_UNKNOWN,
|
||||||
|
SDL_ORIENTATION_LANDSCAPE,
|
||||||
|
SDL_ORIENTATION_LANDSCAPE_FLIPPED,
|
||||||
|
SDL_ORIENTATION_PORTRAIT,
|
||||||
|
SDL_ORIENTATION_PORTRAIT_FLIPPED,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_DisplayOrientation);
|
||||||
|
}
|
||||||
|
|
||||||
|
alias SDL_GLContext = void*;
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) {
|
||||||
|
enum SDL_GLattr {
|
||||||
|
SDL_GL_RED_SIZE,
|
||||||
|
SDL_GL_GREEN_SIZE,
|
||||||
|
SDL_GL_BLUE_SIZE,
|
||||||
|
SDL_GL_ALPHA_SIZE,
|
||||||
|
SDL_GL_BUFFER_SIZE,
|
||||||
|
SDL_GL_DOUBLEBUFFER,
|
||||||
|
SDL_GL_DEPTH_SIZE,
|
||||||
|
SDL_GL_STENCIL_SIZE,
|
||||||
|
SDL_GL_ACCUM_RED_SIZE,
|
||||||
|
SDL_GL_ACCUM_GREEN_SIZE,
|
||||||
|
SDL_GL_ACCUM_BLUE_SIZE,
|
||||||
|
SDL_GL_ACCUM_ALPHA_SIZE,
|
||||||
|
SDL_GL_STEREO,
|
||||||
|
SDL_GL_MULTISAMPLEBUFFERS,
|
||||||
|
SDL_GL_MULTISAMPLESAMPLES,
|
||||||
|
SDL_GL_ACCELERATED_VISUAL,
|
||||||
|
SDL_GL_RETAINED_BACKING,
|
||||||
|
SDL_GL_CONTEXT_MAJOR_VERSION,
|
||||||
|
SDL_GL_CONTEXT_MINOR_VERSION,
|
||||||
|
SDL_GL_CONTEXT_EGL,
|
||||||
|
SDL_GL_CONTEXT_FLAGS,
|
||||||
|
SDL_GL_CONTEXT_PROFILE_MASK,
|
||||||
|
SDL_GL_SHARE_WITH_CURRENT_CONTEXT,
|
||||||
|
SDL_GL_FRAMEBUFFER_SRGB_CAPABLE,
|
||||||
|
SDL_GL_RELEASE_BEHAVIOR,
|
||||||
|
SDL_GL_CONTEXT_RESET_NOTIFICATION,
|
||||||
|
SDL_GL_CONTEXT_NO_ERROR,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
enum SDL_GLattr {
|
||||||
|
SDL_GL_RED_SIZE,
|
||||||
|
SDL_GL_GREEN_SIZE,
|
||||||
|
SDL_GL_BLUE_SIZE,
|
||||||
|
SDL_GL_ALPHA_SIZE,
|
||||||
|
SDL_GL_BUFFER_SIZE,
|
||||||
|
SDL_GL_DOUBLEBUFFER,
|
||||||
|
SDL_GL_DEPTH_SIZE,
|
||||||
|
SDL_GL_STENCIL_SIZE,
|
||||||
|
SDL_GL_ACCUM_RED_SIZE,
|
||||||
|
SDL_GL_ACCUM_GREEN_SIZE,
|
||||||
|
SDL_GL_ACCUM_BLUE_SIZE,
|
||||||
|
SDL_GL_ACCUM_ALPHA_SIZE,
|
||||||
|
SDL_GL_STEREO,
|
||||||
|
SDL_GL_MULTISAMPLEBUFFERS,
|
||||||
|
SDL_GL_MULTISAMPLESAMPLES,
|
||||||
|
SDL_GL_ACCELERATED_VISUAL,
|
||||||
|
SDL_GL_RETAINED_BACKING,
|
||||||
|
SDL_GL_CONTEXT_MAJOR_VERSION,
|
||||||
|
SDL_GL_CONTEXT_MINOR_VERSION,
|
||||||
|
SDL_GL_CONTEXT_EGL,
|
||||||
|
SDL_GL_CONTEXT_FLAGS,
|
||||||
|
SDL_GL_CONTEXT_PROFILE_MASK,
|
||||||
|
SDL_GL_SHARE_WITH_CURRENT_CONTEXT,
|
||||||
|
SDL_GL_FRAMEBUFFER_SRGB_CAPABLE,
|
||||||
|
SDL_GL_RELEASE_BEHAVIOR,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else static if(sdlSupport >= SDLSupport.sdl201) {
|
||||||
|
enum SDL_GLattr {
|
||||||
|
SDL_GL_RED_SIZE,
|
||||||
|
SDL_GL_GREEN_SIZE,
|
||||||
|
SDL_GL_BLUE_SIZE,
|
||||||
|
SDL_GL_ALPHA_SIZE,
|
||||||
|
SDL_GL_BUFFER_SIZE,
|
||||||
|
SDL_GL_DOUBLEBUFFER,
|
||||||
|
SDL_GL_DEPTH_SIZE,
|
||||||
|
SDL_GL_STENCIL_SIZE,
|
||||||
|
SDL_GL_ACCUM_RED_SIZE,
|
||||||
|
SDL_GL_ACCUM_GREEN_SIZE,
|
||||||
|
SDL_GL_ACCUM_BLUE_SIZE,
|
||||||
|
SDL_GL_ACCUM_ALPHA_SIZE,
|
||||||
|
SDL_GL_STEREO,
|
||||||
|
SDL_GL_MULTISAMPLEBUFFERS,
|
||||||
|
SDL_GL_MULTISAMPLESAMPLES,
|
||||||
|
SDL_GL_ACCELERATED_VISUAL,
|
||||||
|
SDL_GL_RETAINED_BACKING,
|
||||||
|
SDL_GL_CONTEXT_MAJOR_VERSION,
|
||||||
|
SDL_GL_CONTEXT_MINOR_VERSION,
|
||||||
|
SDL_GL_CONTEXT_EGL,
|
||||||
|
SDL_GL_CONTEXT_FLAGS,
|
||||||
|
SDL_GL_CONTEXT_PROFILE_MASK,
|
||||||
|
SDL_GL_SHARE_WITH_CURRENT_CONTEXT,
|
||||||
|
SDL_GL_FRAMEBUFFER_SRGB_CAPABLE,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
enum SDL_GLattr {
|
||||||
|
SDL_GL_RED_SIZE,
|
||||||
|
SDL_GL_GREEN_SIZE,
|
||||||
|
SDL_GL_BLUE_SIZE,
|
||||||
|
SDL_GL_ALPHA_SIZE,
|
||||||
|
SDL_GL_BUFFER_SIZE,
|
||||||
|
SDL_GL_DOUBLEBUFFER,
|
||||||
|
SDL_GL_DEPTH_SIZE,
|
||||||
|
SDL_GL_STENCIL_SIZE,
|
||||||
|
SDL_GL_ACCUM_RED_SIZE,
|
||||||
|
SDL_GL_ACCUM_GREEN_SIZE,
|
||||||
|
SDL_GL_ACCUM_BLUE_SIZE,
|
||||||
|
SDL_GL_ACCUM_ALPHA_SIZE,
|
||||||
|
SDL_GL_STEREO,
|
||||||
|
SDL_GL_MULTISAMPLEBUFFERS,
|
||||||
|
SDL_GL_MULTISAMPLESAMPLES,
|
||||||
|
SDL_GL_ACCELERATED_VISUAL,
|
||||||
|
SDL_GL_RETAINED_BACKING,
|
||||||
|
SDL_GL_CONTEXT_MAJOR_VERSION,
|
||||||
|
SDL_GL_CONTEXT_MINOR_VERSION,
|
||||||
|
SDL_GL_CONTEXT_EGL,
|
||||||
|
SDL_GL_CONTEXT_FLAGS,
|
||||||
|
SDL_GL_CONTEXT_PROFILE_MASK,
|
||||||
|
SDL_GL_SHARE_WITH_CURRENT_CONTEXT,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_GLattr);
|
||||||
|
|
||||||
|
enum SDL_GLprofile {
|
||||||
|
SDL_GL_CONTEXT_PROFILE_CORE = 0x0001,
|
||||||
|
SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002,
|
||||||
|
SDL_GL_CONTEXT_PROFILE_ES = 0x0004,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_GLprofile);
|
||||||
|
|
||||||
|
enum SDL_GLcontextFlag {
|
||||||
|
SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001,
|
||||||
|
SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002,
|
||||||
|
SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004,
|
||||||
|
SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_GLcontextFlag);
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
enum SDL_GLcontextReleaseFlag {
|
||||||
|
SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0x0000,
|
||||||
|
SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x0001,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_GLcontextReleaseFlag);
|
||||||
|
|
||||||
|
enum SDL_HitTestResult {
|
||||||
|
SDL_HITTEST_NORMAL,
|
||||||
|
SDL_HITTEST_DRAGGABLE,
|
||||||
|
SDL_HITTEST_RESIZE_TOPLEFT,
|
||||||
|
SDL_HITTEST_RESIZE_TOP,
|
||||||
|
SDL_HITTEST_RESIZE_TOPRIGHT,
|
||||||
|
SDL_HITTEST_RESIZE_RIGHT,
|
||||||
|
SDL_HITTEST_RESIZE_BOTTOMRIGHT,
|
||||||
|
SDL_HITTEST_RESIZE_BOTTOM,
|
||||||
|
SDL_HITTEST_RESIZE_BOTTOMLEFT,
|
||||||
|
SDL_HITTEST_RESIZE_LEFT,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_HitTestResult);
|
||||||
|
|
||||||
|
import bindbc.sdl.bind.sdlrect : SDL_Point;
|
||||||
|
extern(C) nothrow alias SDL_HitTest = SDL_HitTestResult function(SDL_Window*,const(SDL_Point)*,void*);
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) {
|
||||||
|
enum SDL_GLContextResetNotification {
|
||||||
|
SDL_GL_CONTEXT_RESET_NO_NOTIFICATION = 0x0000,
|
||||||
|
SDL_GL_CONTEXT_RESET_LOSE_CONTEXT = 0x0001,
|
||||||
|
}
|
||||||
|
mixin(expandEnum!SDL_GLContextResetNotification);
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
int SDL_GetNumVideoDrivers();
|
||||||
|
const(char)* SDL_GetVideoDriver(int);
|
||||||
|
int SDL_VideoInit(const(char)*);
|
||||||
|
void SDL_VideoQuit();
|
||||||
|
const(char)* SDL_GetCurrentVideoDriver();
|
||||||
|
int SDL_GetNumVideoDisplays();
|
||||||
|
const(char)* SDL_GetDisplayName(int);
|
||||||
|
int SDL_GetDisplayBounds(int,SDL_Rect*);
|
||||||
|
int SDL_GetNumDisplayModes(int);
|
||||||
|
int SDL_GetDisplayMode(int,int,SDL_DisplayMode*);
|
||||||
|
int SDL_GetDesktopDisplayMode(int,SDL_DisplayMode*);
|
||||||
|
int SDL_GetCurrentDisplayMode(int,SDL_DisplayMode*);
|
||||||
|
SDL_DisplayMode* SDL_GetClosestDisplayMode(int,const(SDL_DisplayMode)*,SDL_DisplayMode*);
|
||||||
|
int SDL_GetWindowDisplayIndex(SDL_Window*);
|
||||||
|
int SDL_SetWindowDisplayMode(SDL_Window*,const(SDL_DisplayMode)*);
|
||||||
|
int SDL_GetWindowDisplayMode(SDL_Window*,SDL_DisplayMode*);
|
||||||
|
uint SDL_GetWindowPixelFormat(SDL_Window*);
|
||||||
|
SDL_Window* SDL_CreateWindow(const(char)*,int,int,int,int,SDL_WindowFlags);
|
||||||
|
SDL_Window* SDL_CreateWindowFrom(const(void)*);
|
||||||
|
uint SDL_GetWindowID(SDL_Window*);
|
||||||
|
SDL_Window* SDL_GetWindowFromID(uint);
|
||||||
|
SDL_WindowFlags SDL_GetWindowFlags(SDL_Window*);
|
||||||
|
void SDL_SetWindowTitle(SDL_Window*,const(char)*);
|
||||||
|
const(char)* SDL_GetWindowTitle(SDL_Window*);
|
||||||
|
void SDL_SetWindowIcon(SDL_Window*,SDL_Surface*);
|
||||||
|
void* SDL_SetWindowData(SDL_Window*,const(char)*,void*);
|
||||||
|
void* SDL_GetWindowData(SDL_Window*,const(char)*);
|
||||||
|
void SDL_SetWindowPosition(SDL_Window*,int,int);
|
||||||
|
void SDL_GetWindowPosition(SDL_Window*,int*,int*);
|
||||||
|
void SDL_SetWindowSize(SDL_Window*,int,int);
|
||||||
|
void SDL_GetWindowSize(SDL_Window*,int*,int*);
|
||||||
|
void SDL_SetWindowMinimumSize(SDL_Window*,int,int);
|
||||||
|
void SDL_GetWindowMinimumSize(SDL_Window*,int*,int*);
|
||||||
|
void SDL_SetWindowMaximumSize(SDL_Window*,int,int);
|
||||||
|
void SDL_GetWindowMaximumSize(SDL_Window*,int*,int*);
|
||||||
|
void SDL_SetWindowBordered(SDL_Window*,SDL_bool);
|
||||||
|
void SDL_ShowWindow(SDL_Window*);
|
||||||
|
void SDL_HideWindow(SDL_Window*);
|
||||||
|
void SDL_RaiseWindow(SDL_Window*);
|
||||||
|
void SDL_MaximizeWindow(SDL_Window*);
|
||||||
|
void SDL_MinimizeWindow(SDL_Window*);
|
||||||
|
void SDL_RestoreWindow(SDL_Window*);
|
||||||
|
int SDL_SetWindowFullscreen(SDL_Window*,uint);
|
||||||
|
SDL_Surface* SDL_GetWindowSurface(SDL_Window*);
|
||||||
|
int SDL_UpdateWindowSurface(SDL_Window*);
|
||||||
|
int SDL_UpdateWindowSurfaceRects(SDL_Window*,SDL_Rect*,int);
|
||||||
|
void SDL_SetWindowGrab(SDL_Window*,SDL_bool);
|
||||||
|
SDL_bool SDL_GetWindowGrab(SDL_Window*);
|
||||||
|
int SDL_SetWindowBrightness(SDL_Window*,float);
|
||||||
|
float SDL_GetWindowBrightness(SDL_Window*);
|
||||||
|
int SDL_SetWindowGammaRamp(SDL_Window*,const(ushort)*,const(ushort)*,const(ushort)*);
|
||||||
|
int SDL_GetWindowGammaRamp(SDL_Window*,ushort*,ushort*,ushort*);
|
||||||
|
void SDL_DestroyWindow(SDL_Window*);
|
||||||
|
SDL_bool SDL_IsScreenSaverEnabled();
|
||||||
|
void SDL_EnableScreenSaver();
|
||||||
|
void SDL_DisableScreenSaver();
|
||||||
|
int SDL_GL_LoadLibrary(const(char)*);
|
||||||
|
void* SDL_GL_GetProcAddress(const(char)*);
|
||||||
|
void SDL_GL_UnloadLibrary();
|
||||||
|
SDL_bool SDL_GL_ExtensionSupported(const(char)*);
|
||||||
|
int SDL_GL_SetAttribute(SDL_GLattr,int);
|
||||||
|
int SDL_GL_GetAttribute(SDL_GLattr,int*);
|
||||||
|
SDL_GLContext SDL_GL_CreateContext(SDL_Window*);
|
||||||
|
int SDL_GL_MakeCurrent(SDL_Window*,SDL_GLContext);
|
||||||
|
SDL_Window* SDL_GL_GetCurrentWindow();
|
||||||
|
SDL_GLContext SDL_GL_GetCurrentContext();
|
||||||
|
int SDL_GL_SetSwapInterval(int);
|
||||||
|
int SDL_GL_GetSwapInterval();
|
||||||
|
void SDL_GL_SwapWindow(SDL_Window*);
|
||||||
|
void SDL_GL_DeleteContext(SDL_GLContext);
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl201) {
|
||||||
|
void SDL_GL_GetDrawableSize(SDL_Window*,int*,int*);
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl202) {
|
||||||
|
void SDL_GL_ResetAttributes();
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
int SDL_GetDisplayDPI(int,float*,float*,float*);
|
||||||
|
SDL_Window* SDL_GetGrabbedWindow();
|
||||||
|
int SDL_SetWindowHitTest(SDL_Window*,SDL_HitTest,void*);
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl205) {
|
||||||
|
int SDL_GetDisplayUsableBounds(int,SDL_Rect*);
|
||||||
|
int SDL_GetWindowBordersSize(SDL_Window*,int*,int*,int*,int*);
|
||||||
|
int SDL_GetWindowOpacity(SDL_Window*,float*);
|
||||||
|
int SDL_SetWindowInputFocus(SDL_Window*);
|
||||||
|
int SDL_SetWindowModalFor(SDL_Window*,SDL_Window*);
|
||||||
|
int SDL_SetWindowOpacity(SDL_Window*,float);
|
||||||
|
void SDL_SetWindowResizable(SDL_Window*,SDL_bool);
|
||||||
|
}
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
SDL_DisplayOrientation SDL_GetDisplayOrientation(int);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GetNumVideoDrivers = int function();
|
||||||
|
alias pSDL_GetVideoDriver = const(char)* function(int);
|
||||||
|
alias pSDL_VideoInit = int function(const(char)*);
|
||||||
|
alias pSDL_VideoQuit = void function();
|
||||||
|
alias pSDL_GetCurrentVideoDriver = const(char)* function();
|
||||||
|
alias pSDL_GetNumVideoDisplays = int function();
|
||||||
|
alias pSDL_GetDisplayName = const(char)* function(int);
|
||||||
|
alias pSDL_GetDisplayBounds = int function(int,SDL_Rect*);
|
||||||
|
alias pSDL_GetNumDisplayModes = int function(int);
|
||||||
|
alias pSDL_GetDisplayMode = int function(int,int,SDL_DisplayMode*);
|
||||||
|
alias pSDL_GetDesktopDisplayMode = int function(int,SDL_DisplayMode*);
|
||||||
|
alias pSDL_GetCurrentDisplayMode = int function(int,SDL_DisplayMode*);
|
||||||
|
alias pSDL_GetClosestDisplayMode = SDL_DisplayMode* function(int,const(SDL_DisplayMode)*,SDL_DisplayMode*);
|
||||||
|
alias pSDL_GetWindowDisplayIndex = int function(SDL_Window*);
|
||||||
|
alias pSDL_SetWindowDisplayMode = int function(SDL_Window*,const(SDL_DisplayMode)*);
|
||||||
|
alias pSDL_GetWindowDisplayMode = int function(SDL_Window*,SDL_DisplayMode*);
|
||||||
|
alias pSDL_GetWindowPixelFormat = uint function(SDL_Window*);
|
||||||
|
alias pSDL_CreateWindow = SDL_Window* function(const(char)*,int,int,int,int,SDL_WindowFlags);
|
||||||
|
alias pSDL_CreateWindowFrom = SDL_Window* function(const(void)*);
|
||||||
|
alias pSDL_GetWindowID = uint function(SDL_Window*);
|
||||||
|
alias pSDL_GetWindowFromID = SDL_Window* function(uint);
|
||||||
|
alias pSDL_GetWindowFlags = SDL_WindowFlags function(SDL_Window*);
|
||||||
|
alias pSDL_SetWindowTitle = void function(SDL_Window*,const(char)*);
|
||||||
|
alias pSDL_GetWindowTitle = const(char)* function(SDL_Window*);
|
||||||
|
alias pSDL_SetWindowIcon = void function(SDL_Window*,SDL_Surface*);
|
||||||
|
alias pSDL_SetWindowData = void* function(SDL_Window*,const(char)*,void*);
|
||||||
|
alias pSDL_GetWindowData = void* function(SDL_Window*,const(char)*);
|
||||||
|
alias pSDL_SetWindowPosition = void function(SDL_Window*,int,int);
|
||||||
|
alias pSDL_GetWindowPosition = void function(SDL_Window*,int*,int*);
|
||||||
|
alias pSDL_SetWindowSize = void function(SDL_Window*,int,int);
|
||||||
|
alias pSDL_GetWindowSize = void function(SDL_Window*,int*,int*);
|
||||||
|
alias pSDL_SetWindowMinimumSize = void function(SDL_Window*,int,int);
|
||||||
|
alias pSDL_GetWindowMinimumSize = void function(SDL_Window*,int*,int*);
|
||||||
|
alias pSDL_SetWindowMaximumSize = void function(SDL_Window*,int,int);
|
||||||
|
alias pSDL_GetWindowMaximumSize = void function(SDL_Window*,int*,int*);
|
||||||
|
alias pSDL_SetWindowBordered = void function(SDL_Window*,SDL_bool);
|
||||||
|
alias pSDL_ShowWindow = void function(SDL_Window*);
|
||||||
|
alias pSDL_HideWindow = void function(SDL_Window*);
|
||||||
|
alias pSDL_RaiseWindow = void function(SDL_Window*);
|
||||||
|
alias pSDL_MaximizeWindow = void function(SDL_Window*);
|
||||||
|
alias pSDL_MinimizeWindow = void function(SDL_Window*);
|
||||||
|
alias pSDL_RestoreWindow = void function(SDL_Window*);
|
||||||
|
alias pSDL_SetWindowFullscreen = int function(SDL_Window*,uint);
|
||||||
|
alias pSDL_GetWindowSurface = SDL_Surface* function(SDL_Window*);
|
||||||
|
alias pSDL_UpdateWindowSurface = int function(SDL_Window*);
|
||||||
|
alias pSDL_UpdateWindowSurfaceRects = int function(SDL_Window*,SDL_Rect*,int);
|
||||||
|
alias pSDL_SetWindowGrab = void function(SDL_Window*,SDL_bool);
|
||||||
|
alias pSDL_GetWindowGrab = SDL_bool function(SDL_Window*);
|
||||||
|
alias pSDL_SetWindowBrightness = int function(SDL_Window*,float);
|
||||||
|
alias pSDL_GetWindowBrightness = float function(SDL_Window*);
|
||||||
|
alias pSDL_SetWindowGammaRamp = int function(SDL_Window*,const(ushort)*,const(ushort)*,const(ushort)*);
|
||||||
|
alias pSDL_GetWindowGammaRamp = int function(SDL_Window*,ushort*,ushort*,ushort*);
|
||||||
|
alias pSDL_DestroyWindow = void function(SDL_Window*);
|
||||||
|
alias pSDL_IsScreenSaverEnabled = SDL_bool function();
|
||||||
|
alias pSDL_EnableScreenSaver = void function();
|
||||||
|
alias pSDL_DisableScreenSaver = void function();
|
||||||
|
alias pSDL_GL_LoadLibrary = int function(const(char)*);
|
||||||
|
alias pSDL_GL_GetProcAddress = void* function(const(char)*);
|
||||||
|
alias pSDL_GL_UnloadLibrary = void function();
|
||||||
|
alias pSDL_GL_ExtensionSupported = SDL_bool function(const(char)*);
|
||||||
|
alias pSDL_GL_SetAttribute = int function(SDL_GLattr,int);
|
||||||
|
alias pSDL_GL_GetAttribute = int function(SDL_GLattr,int*);
|
||||||
|
alias pSDL_GL_CreateContext = SDL_GLContext function(SDL_Window*);
|
||||||
|
alias pSDL_GL_MakeCurrent = int function(SDL_Window*,SDL_GLContext);
|
||||||
|
alias pSDL_GL_GetCurrentWindow = SDL_Window* function();
|
||||||
|
alias pSDL_GL_GetCurrentContext = SDL_GLContext function();
|
||||||
|
alias pSDL_GL_SetSwapInterval = int function(int);
|
||||||
|
alias pSDL_GL_GetSwapInterval = int function();
|
||||||
|
alias pSDL_GL_SwapWindow = void function(SDL_Window*);
|
||||||
|
alias pSDL_GL_DeleteContext = void function(SDL_GLContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GetNumVideoDrivers SDL_GetNumVideoDrivers;
|
||||||
|
pSDL_GetVideoDriver SDL_GetVideoDriver;
|
||||||
|
pSDL_VideoInit SDL_VideoInit;
|
||||||
|
pSDL_VideoQuit SDL_VideoQuit;
|
||||||
|
pSDL_GetCurrentVideoDriver SDL_GetCurrentVideoDriver;
|
||||||
|
pSDL_GetNumVideoDisplays SDL_GetNumVideoDisplays;
|
||||||
|
pSDL_GetDisplayName SDL_GetDisplayName;
|
||||||
|
pSDL_GetDisplayBounds SDL_GetDisplayBounds;
|
||||||
|
pSDL_GetNumDisplayModes SDL_GetNumDisplayModes;
|
||||||
|
pSDL_GetDisplayMode SDL_GetDisplayMode;
|
||||||
|
pSDL_GetDesktopDisplayMode SDL_GetDesktopDisplayMode;
|
||||||
|
pSDL_GetCurrentDisplayMode SDL_GetCurrentDisplayMode;
|
||||||
|
pSDL_GetClosestDisplayMode SDL_GetClosestDisplayMode;
|
||||||
|
pSDL_GetWindowDisplayIndex SDL_GetWindowDisplayIndex;
|
||||||
|
pSDL_SetWindowDisplayMode SDL_SetWindowDisplayMode;
|
||||||
|
pSDL_GetWindowDisplayMode SDL_GetWindowDisplayMode;
|
||||||
|
pSDL_GetWindowPixelFormat SDL_GetWindowPixelFormat;
|
||||||
|
pSDL_CreateWindow SDL_CreateWindow;
|
||||||
|
pSDL_CreateWindowFrom SDL_CreateWindowFrom;
|
||||||
|
pSDL_GetWindowID SDL_GetWindowID;
|
||||||
|
pSDL_GetWindowFromID SDL_GetWindowFromID;
|
||||||
|
pSDL_GetWindowFlags SDL_GetWindowFlags;
|
||||||
|
pSDL_SetWindowTitle SDL_SetWindowTitle;
|
||||||
|
pSDL_GetWindowTitle SDL_GetWindowTitle;
|
||||||
|
pSDL_SetWindowIcon SDL_SetWindowIcon;
|
||||||
|
pSDL_SetWindowData SDL_SetWindowData;
|
||||||
|
pSDL_GetWindowData SDL_GetWindowData;
|
||||||
|
pSDL_SetWindowPosition SDL_SetWindowPosition;
|
||||||
|
pSDL_GetWindowPosition SDL_GetWindowPosition;
|
||||||
|
pSDL_SetWindowSize SDL_SetWindowSize;
|
||||||
|
pSDL_GetWindowSize SDL_GetWindowSize;
|
||||||
|
pSDL_SetWindowMinimumSize SDL_SetWindowMinimumSize;
|
||||||
|
pSDL_GetWindowMinimumSize SDL_GetWindowMinimumSize;
|
||||||
|
pSDL_SetWindowMaximumSize SDL_SetWindowMaximumSize;
|
||||||
|
pSDL_GetWindowMaximumSize SDL_GetWindowMaximumSize;
|
||||||
|
pSDL_SetWindowBordered SDL_SetWindowBordered;
|
||||||
|
pSDL_ShowWindow SDL_ShowWindow;
|
||||||
|
pSDL_HideWindow SDL_HideWindow;
|
||||||
|
pSDL_RaiseWindow SDL_RaiseWindow;
|
||||||
|
pSDL_MaximizeWindow SDL_MaximizeWindow;
|
||||||
|
pSDL_MinimizeWindow SDL_MinimizeWindow;
|
||||||
|
pSDL_RestoreWindow SDL_RestoreWindow;
|
||||||
|
pSDL_SetWindowFullscreen SDL_SetWindowFullscreen;
|
||||||
|
pSDL_GetWindowSurface SDL_GetWindowSurface;
|
||||||
|
pSDL_UpdateWindowSurface SDL_UpdateWindowSurface;
|
||||||
|
pSDL_UpdateWindowSurfaceRects SDL_UpdateWindowSurfaceRects;
|
||||||
|
pSDL_SetWindowGrab SDL_SetWindowGrab;
|
||||||
|
pSDL_GetWindowGrab SDL_GetWindowGrab;
|
||||||
|
pSDL_SetWindowBrightness SDL_SetWindowBrightness;
|
||||||
|
pSDL_GetWindowBrightness SDL_GetWindowBrightness;
|
||||||
|
pSDL_SetWindowGammaRamp SDL_SetWindowGammaRamp;
|
||||||
|
pSDL_GetWindowGammaRamp SDL_GetWindowGammaRamp;
|
||||||
|
pSDL_DestroyWindow SDL_DestroyWindow;
|
||||||
|
pSDL_IsScreenSaverEnabled SDL_IsScreenSaverEnabled;
|
||||||
|
pSDL_EnableScreenSaver SDL_EnableScreenSaver;
|
||||||
|
pSDL_DisableScreenSaver SDL_DisableScreenSaver;
|
||||||
|
pSDL_GL_LoadLibrary SDL_GL_LoadLibrary;
|
||||||
|
pSDL_GL_GetProcAddress SDL_GL_GetProcAddress;
|
||||||
|
pSDL_GL_UnloadLibrary SDL_GL_UnloadLibrary;
|
||||||
|
pSDL_GL_ExtensionSupported SDL_GL_ExtensionSupported;
|
||||||
|
pSDL_GL_SetAttribute SDL_GL_SetAttribute;
|
||||||
|
pSDL_GL_GetAttribute SDL_GL_GetAttribute;
|
||||||
|
pSDL_GL_CreateContext SDL_GL_CreateContext;
|
||||||
|
pSDL_GL_MakeCurrent SDL_GL_MakeCurrent;
|
||||||
|
pSDL_GL_GetCurrentWindow SDL_GL_GetCurrentWindow;
|
||||||
|
pSDL_GL_GetCurrentContext SDL_GL_GetCurrentContext;
|
||||||
|
pSDL_GL_SetSwapInterval SDL_GL_SetSwapInterval;
|
||||||
|
pSDL_GL_GetSwapInterval SDL_GL_GetSwapInterval;
|
||||||
|
pSDL_GL_SwapWindow SDL_GL_SwapWindow;
|
||||||
|
pSDL_GL_DeleteContext SDL_GL_DeleteContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl201) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GL_GetDrawableSize = void function(SDL_Window*,int*,int*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GL_GetDrawableSize SDL_GL_GetDrawableSize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl202) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GL_ResetAttributes = void function();
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GL_ResetAttributes SDL_GL_ResetAttributes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GetDisplayDPI = int function(int,float*,float*,float*);
|
||||||
|
alias pSDL_GetGrabbedWindow = SDL_Window* function();
|
||||||
|
alias pSDL_SetWindowHitTest = int function(SDL_Window*,SDL_HitTest,void*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GetDisplayDPI SDL_GetDisplayDPI;
|
||||||
|
pSDL_GetGrabbedWindow SDL_GetGrabbedWindow;
|
||||||
|
pSDL_SetWindowHitTest SDL_SetWindowHitTest;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl205) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GetDisplayUsableBounds = int function(int,SDL_Rect*);
|
||||||
|
alias pSDL_GetWindowBordersSize = int function(SDL_Window*,int*,int*,int*,int*);
|
||||||
|
alias pSDL_GetWindowOpacity = int function(SDL_Window*,float*);
|
||||||
|
alias pSDL_SetWindowInputFocus = int function(SDL_Window*);
|
||||||
|
alias pSDL_SetWindowModalFor = int function(SDL_Window*,SDL_Window*);
|
||||||
|
alias pSDL_SetWindowOpacity = int function(SDL_Window*,float);
|
||||||
|
alias pSDL_SetWindowResizable = void function(SDL_Window*,SDL_bool);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GetDisplayUsableBounds SDL_GetDisplayUsableBounds;
|
||||||
|
pSDL_GetWindowBordersSize SDL_GetWindowBordersSize;
|
||||||
|
pSDL_GetWindowOpacity SDL_GetWindowOpacity;
|
||||||
|
pSDL_SetWindowInputFocus SDL_SetWindowInputFocus;
|
||||||
|
pSDL_SetWindowModalFor SDL_SetWindowModalFor;
|
||||||
|
pSDL_SetWindowOpacity SDL_SetWindowOpacity;
|
||||||
|
pSDL_SetWindowResizable SDL_SetWindowResizable;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_GetDisplayOrientation = SDL_DisplayOrientation function(int);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_GetDisplayOrientation SDL_GetDisplayOrientation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
45
demos/external/wasm_imports/bindbc/sdl/bind/sdlvulkan.d
vendored
Normal file
45
demos/external/wasm_imports/bindbc/sdl/bind/sdlvulkan.d
vendored
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.bind.sdlvulkan;
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
import bindbc.sdl.bind.sdlstdinc : SDL_bool;
|
||||||
|
import bindbc.sdl.bind.sdlvideo : SDL_Window;
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) {
|
||||||
|
SDL_bool SDL_Vulkan_CreateSurface(SDL_Window*,void*,void*);
|
||||||
|
void SDL_Vulkan_GetDrawableSize(SDL_Window*,int*,int*);
|
||||||
|
SDL_bool SDL_Vulkan_GetInstanceExtensions(SDL_Window*,uint*,const(char)**);
|
||||||
|
void* SDL_Vulkan_GetVkGetInstanceProcAddr();
|
||||||
|
int SDL_Vulkan_LoadLibrary(const(char)*);
|
||||||
|
void SDL_Vulkan_UnloadLibrary();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pSDL_Vulkan_CreateSurface = SDL_bool function(SDL_Window*,void*,void*);
|
||||||
|
alias pSDL_Vulkan_GetDrawableSize = void function(SDL_Window*,int*,int*);
|
||||||
|
alias pSDL_Vulkan_GetInstanceExtensions = SDL_bool function(SDL_Window*,uint*,const(char)**);
|
||||||
|
alias pSDL_Vulkan_GetVkGetInstanceProcAddr = void* function();
|
||||||
|
alias pSDL_Vulkan_LoadLibrary = int function(const(char)*);
|
||||||
|
alias pSDL_Vulkan_UnloadLibrary = void function();
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pSDL_Vulkan_CreateSurface SDL_Vulkan_CreateSurface;
|
||||||
|
pSDL_Vulkan_GetDrawableSize SDL_Vulkan_GetDrawableSize;
|
||||||
|
pSDL_Vulkan_GetInstanceExtensions SDL_Vulkan_GetInstanceExtensions;
|
||||||
|
pSDL_Vulkan_GetVkGetInstanceProcAddr SDL_Vulkan_GetVkGetInstanceProcAddr;
|
||||||
|
pSDL_Vulkan_LoadLibrary SDL_Vulkan_LoadLibrary;
|
||||||
|
pSDL_Vulkan_UnloadLibrary SDL_Vulkan_UnloadLibrary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
44
demos/external/wasm_imports/bindbc/sdl/config.d
vendored
Normal file
44
demos/external/wasm_imports/bindbc/sdl/config.d
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.config;
|
||||||
|
|
||||||
|
enum SDLSupport {
|
||||||
|
noLibrary,
|
||||||
|
badLibrary,
|
||||||
|
sdl200 = 200,
|
||||||
|
sdl201 = 201,
|
||||||
|
sdl202 = 202,
|
||||||
|
sdl203 = 203,
|
||||||
|
sdl204 = 204,
|
||||||
|
sdl205 = 205,
|
||||||
|
sdl206 = 206,
|
||||||
|
sdl207 = 207,
|
||||||
|
sdl208 = 208,
|
||||||
|
sdl209 = 209,
|
||||||
|
sdl2010 = 2010,
|
||||||
|
}
|
||||||
|
|
||||||
|
version(SDL_2010) enum sdlSupport = SDLSupport.sdl2010;
|
||||||
|
else version(SDL_209) enum sdlSupport = SDLSupport.sdl209;
|
||||||
|
else version(SDL_208) enum sdlSupport = SDLSupport.sdl208;
|
||||||
|
else version(SDL_207) enum sdlSupport = SDLSupport.sdl207;
|
||||||
|
else version(SDL_206) enum sdlSupport = SDLSupport.sdl206;
|
||||||
|
else version(SDL_205) enum sdlSupport = SDLSupport.sdl205;
|
||||||
|
else version(SDL_204) enum sdlSupport = SDLSupport.sdl204;
|
||||||
|
else version(SDL_203) enum sdlSupport = SDLSupport.sdl203;
|
||||||
|
else version(SDL_202) enum sdlSupport = SDLSupport.sdl202;
|
||||||
|
else version(SDL_201) enum sdlSupport = SDLSupport.sdl201;
|
||||||
|
else enum sdlSupport = SDLSupport.sdl200;
|
||||||
|
|
||||||
|
enum expandEnum(EnumType, string fqnEnumType = EnumType.stringof) = (){
|
||||||
|
string expandEnum = "enum {";
|
||||||
|
foreach(m;__traits(allMembers, EnumType)) {
|
||||||
|
expandEnum ~= m ~ " = " ~ fqnEnumType ~ "." ~ m ~ ",";
|
||||||
|
}
|
||||||
|
expandEnum ~= "}";
|
||||||
|
return expandEnum;
|
||||||
|
}();
|
||||||
712
demos/external/wasm_imports/bindbc/sdl/dynload.d
vendored
Normal file
712
demos/external/wasm_imports/bindbc/sdl/dynload.d
vendored
Normal file
|
|
@ -0,0 +1,712 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.dynload;
|
||||||
|
|
||||||
|
version(BindSDL_Static) {}
|
||||||
|
else:
|
||||||
|
|
||||||
|
import bindbc.loader;
|
||||||
|
import bindbc.sdl.config,
|
||||||
|
bindbc.sdl.bind;
|
||||||
|
|
||||||
|
private {
|
||||||
|
SharedLib lib;
|
||||||
|
SDLSupport loadedVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
void unloadSDL()
|
||||||
|
{
|
||||||
|
if(lib != invalidHandle) {
|
||||||
|
lib.unload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SDLSupport loadedSDLVersion() { return loadedVersion; }
|
||||||
|
|
||||||
|
bool isSDLLoaded()
|
||||||
|
{
|
||||||
|
return lib != invalidHandle;
|
||||||
|
}
|
||||||
|
|
||||||
|
SDLSupport loadSDL()
|
||||||
|
{
|
||||||
|
// #1778 prevents me from using static arrays here :(
|
||||||
|
version(Windows) {
|
||||||
|
const(char)[][1] libNames = ["SDL2.dll"];
|
||||||
|
}
|
||||||
|
else version(OSX) {
|
||||||
|
const(char)[][7] libNames = [
|
||||||
|
"libSDL2.dylib",
|
||||||
|
"/usr/local/lib/libSDL2.dylib",
|
||||||
|
"/usr/local/lib/libSDL2/libSDL2.dylib",
|
||||||
|
"../Frameworks/SDL2.framework/SDL2",
|
||||||
|
"/Library/Frameworks/SDL2.framework/SDL2",
|
||||||
|
"/System/Library/Frameworks/SDL2.framework/SDL2",
|
||||||
|
"/opt/local/lib/libSDL2.dylib"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
else version(Posix) {
|
||||||
|
const(char)[][6] libNames = [
|
||||||
|
"libSDL2.so",
|
||||||
|
"/usr/local/lib/libSDL2.so",
|
||||||
|
"libSDL2-2.0.so",
|
||||||
|
"/usr/local/lib/libSDL2-2.0.so",
|
||||||
|
"libSDL2-2.0.so.0",
|
||||||
|
"/usr/local/lib/libSDL2-2.0.so.0"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
else static assert(0, "bindbc-sdl is not yet supported on this platform.");
|
||||||
|
|
||||||
|
SDLSupport ret;
|
||||||
|
foreach(name; libNames) {
|
||||||
|
ret = loadSDL(name.ptr);
|
||||||
|
if(ret != SDLSupport.noLibrary) break;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
SDLSupport loadSDL(const(char)* libName)
|
||||||
|
{
|
||||||
|
lib = load(libName);
|
||||||
|
if(lib == invalidHandle) {
|
||||||
|
return SDLSupport.noLibrary;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto errCount = errorCount();
|
||||||
|
loadedVersion = SDLSupport.badLibrary;
|
||||||
|
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_Init, "SDL_Init");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_InitSubSystem, "SDL_InitSubSystem");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_QuitSubSystem, "SDL_QuitSubSystem");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_WasInit, "SDL_WasInit");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_Quit, "SDL_Quit");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetAssertionHandler, "SDL_SetAssertionHandler");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetAssertionReport, "SDL_GetAssertionReport");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_ResetAssertionReport, "SDL_ResetAssertionReport");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetNumAudioDrivers, "SDL_GetNumAudioDrivers");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetAudioDriver, "SDL_GetAudioDriver");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_AudioInit, "SDL_AudioInit");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_AudioQuit, "SDL_AudioQuit");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetCurrentAudioDriver, "SDL_GetCurrentAudioDriver");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_OpenAudio, "SDL_OpenAudio");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetNumAudioDevices, "SDL_GetNumAudioDevices");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetAudioDeviceName, "SDL_GetAudioDeviceName");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_OpenAudioDevice, "SDL_OpenAudioDevice");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetAudioStatus, "SDL_GetAudioStatus");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetAudioDeviceStatus, "SDL_GetAudioDeviceStatus");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_PauseAudio, "SDL_PauseAudio");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_PauseAudioDevice, "SDL_PauseAudioDevice");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LoadWAV_RW, "SDL_LoadWAV_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_FreeWAV, "SDL_FreeWAV");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_BuildAudioCVT, "SDL_BuildAudioCVT");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_ConvertAudio, "SDL_ConvertAudio");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_MixAudio, "SDL_MixAudio");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_MixAudioFormat, "SDL_MixAudioFormat");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LockAudio, "SDL_LockAudio");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LockAudioDevice, "SDL_LockAudioDevice");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_UnlockAudio, "SDL_UnlockAudio");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_UnlockAudioDevice, "SDL_UnlockAudioDevice");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_CloseAudio, "SDL_CloseAudio");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_CloseAudioDevice, "SDL_CloseAudioDevice");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetClipboardText, "SDL_SetClipboardText");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetClipboardText, "SDL_GetClipboardText");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HasClipboardText, "SDL_HasClipboardText");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetCPUCount, "SDL_GetCPUCount");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetCPUCacheLineSize, "SDL_GetCPUCacheLineSize");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HasRDTSC, "SDL_HasRDTSC");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HasAltiVec, "SDL_HasAltiVec");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HasMMX, "SDL_HasMMX");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_Has3DNow, "SDL_Has3DNow");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HasSSE, "SDL_HasSSE");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HasSSE2, "SDL_HasSSE2");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HasSSE3, "SDL_HasSSE3");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HasSSE41, "SDL_HasSSE41");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HasSSE42, "SDL_HasSSE42");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetError, "SDL_SetError");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetError, "SDL_GetError");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_ClearError, "SDL_ClearError");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_PumpEvents, "SDL_PumpEvents");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_PeepEvents, "SDL_PeepEvents");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HasEvent, "SDL_HasEvent");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HasEvents, "SDL_HasEvents");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_FlushEvent, "SDL_FlushEvent");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_FlushEvents, "SDL_FlushEvents");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_PollEvent, "SDL_PollEvent");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_WaitEvent, "SDL_WaitEvent");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_WaitEventTimeout, "SDL_WaitEventTimeout");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_PushEvent, "SDL_PushEvent");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetEventFilter, "SDL_SetEventFilter");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetEventFilter, "SDL_GetEventFilter");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_AddEventWatch, "SDL_AddEventWatch");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_DelEventWatch, "SDL_DelEventWatch");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_FilterEvents, "SDL_FilterEvents");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_EventState, "SDL_EventState");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RegisterEvents, "SDL_RegisterEvents");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerAddMapping, "SDL_GameControllerAddMapping");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerMappingForGUID, "SDL_GameControllerMappingForGUID");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerMapping, "SDL_GameControllerMapping");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_IsGameController, "SDL_IsGameController");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerNameForIndex, "SDL_GameControllerNameForIndex");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerOpen, "SDL_GameControllerOpen");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerName, "SDL_GameControllerName");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerGetAttached, "SDL_GameControllerGetAttached");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerGetJoystick, "SDL_GameControllerGetJoystick");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerEventState, "SDL_GameControllerEventState");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerUpdate, "SDL_GameControllerUpdate");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerGetAxisFromString, "SDL_GameControllerGetAxisFromString");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerGetStringForAxis, "SDL_GameControllerGetStringForAxis");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerGetBindForAxis, "SDL_GameControllerGetBindForAxis");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerGetAxis, "SDL_GameControllerGetAxis");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerGetButtonFromString, "SDL_GameControllerGetButtonFromString");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerGetStringForButton, "SDL_GameControllerGetStringForButton");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerGetBindForButton, "SDL_GameControllerGetBindForButton");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerGetButton, "SDL_GameControllerGetButton");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerClose, "SDL_GameControllerClose");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RecordGesture, "SDL_RecordGesture");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SaveAllDollarTemplates, "SDL_SaveAllDollarTemplates");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SaveDollarTemplate, "SDL_SaveDollarTemplate");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LoadDollarTemplates, "SDL_LoadDollarTemplates");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_NumHaptics, "SDL_NumHaptics");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticName, "SDL_HapticName");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticOpen, "SDL_HapticOpen");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticOpened, "SDL_HapticOpened");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticIndex, "SDL_HapticIndex");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_MouseIsHaptic, "SDL_MouseIsHaptic");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticOpenFromMouse, "SDL_HapticOpenFromMouse");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickIsHaptic, "SDL_JoystickIsHaptic");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticOpenFromJoystick, "SDL_HapticOpenFromJoystick");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticClose, "SDL_HapticClose");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticNumEffects, "SDL_HapticNumEffects");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticNumEffectsPlaying, "SDL_HapticNumEffectsPlaying");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticQuery, "SDL_HapticQuery");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticNumAxes, "SDL_HapticNumAxes");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticEffectSupported, "SDL_HapticEffectSupported");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticNewEffect, "SDL_HapticNewEffect");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticUpdateEffect, "SDL_HapticUpdateEffect");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticRunEffect, "SDL_HapticRunEffect");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticStopEffect, "SDL_HapticStopEffect");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticDestroyEffect, "SDL_HapticDestroyEffect");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticGetEffectStatus, "SDL_HapticGetEffectStatus");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticSetGain, "SDL_HapticSetGain");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticSetAutocenter, "SDL_HapticSetAutocenter");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticPause, "SDL_HapticPause");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticUnpause, "SDL_HapticUnpause");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticStopAll, "SDL_HapticStopAll");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticRumbleSupported, "SDL_HapticRumbleSupported");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticRumbleInit, "SDL_HapticRumbleInit");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticRumblePlay, "SDL_HapticRumblePlay");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HapticRumbleStop, "SDL_HapticRumbleStop");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetHintWithPriority, "SDL_SetHintWithPriority");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetHint, "SDL_SetHint");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetHint, "SDL_GetHint");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_AddHintCallback, "SDL_AddHintCallback");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_DelHintCallback, "SDL_DelHintCallback");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_ClearHints, "SDL_ClearHints");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_NumJoysticks, "SDL_NumJoysticks");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickNameForIndex, "SDL_JoystickNameForIndex");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickOpen, "SDL_JoystickOpen");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickName, "SDL_JoystickName");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetDeviceGUID, "SDL_JoystickGetDeviceGUID");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetGUID, "SDL_JoystickGetGUID");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetGUIDString, "SDL_JoystickGetGUIDString");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetGUIDFromString, "SDL_JoystickGetGUIDFromString");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetAttached, "SDL_JoystickGetAttached");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickInstanceID, "SDL_JoystickInstanceID");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickNumAxes, "SDL_JoystickNumAxes");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickNumBalls, "SDL_JoystickNumBalls");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickNumHats, "SDL_JoystickNumHats");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickNumButtons, "SDL_JoystickNumButtons");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickUpdate, "SDL_JoystickUpdate");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickEventState, "SDL_JoystickEventState");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetAxis, "SDL_JoystickGetAxis");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetHat, "SDL_JoystickGetHat");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetBall, "SDL_JoystickGetBall");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetButton, "SDL_JoystickGetButton");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickClose, "SDL_JoystickClose");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetKeyboardFocus, "SDL_GetKeyboardFocus");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetKeyboardState, "SDL_GetKeyboardState");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetModState, "SDL_GetModState");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetModState, "SDL_SetModState");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetKeyFromScancode, "SDL_GetKeyFromScancode");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetScancodeFromKey, "SDL_GetScancodeFromKey");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetScancodeName, "SDL_GetScancodeName");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetScancodeFromName, "SDL_GetScancodeFromName");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetKeyName, "SDL_GetKeyName");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetKeyFromName, "SDL_GetKeyFromName");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_StartTextInput, "SDL_StartTextInput");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_IsTextInputActive, "SDL_IsTextInputActive");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_StopTextInput, "SDL_StopTextInput");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetTextInputRect, "SDL_SetTextInputRect");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HasScreenKeyboardSupport, "SDL_HasScreenKeyboardSupport");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_IsScreenKeyboardShown, "SDL_IsScreenKeyboardShown");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LoadObject, "SDL_LoadObject");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LoadFunction, "SDL_LoadFunction");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_UnloadObject, "SDL_UnloadObject");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LogSetAllPriority, "SDL_LogSetAllPriority");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LogSetPriority, "SDL_LogSetPriority");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LogGetPriority, "SDL_LogGetPriority");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LogResetPriorities, "SDL_LogResetPriorities");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_Log, "SDL_Log");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LogVerbose, "SDL_LogVerbose");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LogDebug, "SDL_LogDebug");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LogInfo, "SDL_LogInfo");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LogWarn, "SDL_LogWarn");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LogError, "SDL_LogError");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LogCritical, "SDL_LogCritical");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LogMessage, "SDL_LogMessage");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LogMessageV, "SDL_LogMessageV");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LogGetOutputFunction, "SDL_LogGetOutputFunction");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LogSetOutputFunction, "SDL_LogSetOutputFunction");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_ShowMessageBox, "SDL_ShowMessageBox");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_ShowSimpleMessageBox, "SDL_ShowSimpleMessageBox");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetMouseFocus, "SDL_GetMouseFocus");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetMouseState, "SDL_GetMouseState");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetRelativeMouseState, "SDL_GetRelativeMouseState");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_WarpMouseInWindow, "SDL_WarpMouseInWindow");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetRelativeMouseMode, "SDL_SetRelativeMouseMode");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetRelativeMouseMode, "SDL_GetRelativeMouseMode");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_CreateCursor, "SDL_CreateCursor");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_CreateColorCursor, "SDL_CreateColorCursor");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_CreateSystemCursor, "SDL_CreateSystemCursor");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetCursor, "SDL_SetCursor");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetCursor, "SDL_GetCursor");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetDefaultCursor, "SDL_GetDefaultCursor");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_FreeCursor, "SDL_FreeCursor");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_ShowCursor, "SDL_ShowCursor");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetPixelFormatName, "SDL_GetPixelFormatName");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_PixelFormatEnumToMasks, "SDL_PixelFormatEnumToMasks");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_MasksToPixelFormatEnum, "SDL_MasksToPixelFormatEnum");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_AllocFormat, "SDL_AllocFormat");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_FreeFormat, "SDL_FreeFormat");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_AllocPalette, "SDL_AllocPalette");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetPixelFormatPalette, "SDL_SetPixelFormatPalette");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetPaletteColors, "SDL_SetPaletteColors");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_FreePalette, "SDL_FreePalette");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_MapRGB, "SDL_MapRGB");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_MapRGBA, "SDL_MapRGBA");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetRGB, "SDL_GetRGB");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetRGBA, "SDL_GetRGBA");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_CalculateGammaRamp, "SDL_CalculateGammaRamp");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetPlatform, "SDL_GetPlatform");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetPowerInfo, "SDL_GetPowerInfo");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HasIntersection, "SDL_HasIntersection");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_IntersectRect, "SDL_IntersectRect");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_UnionRect, "SDL_UnionRect");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_EnclosePoints, "SDL_EnclosePoints");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_IntersectRectAndLine, "SDL_IntersectRectAndLine");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetNumRenderDrivers, "SDL_GetNumRenderDrivers");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetRenderDriverInfo, "SDL_GetRenderDriverInfo");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_CreateWindowAndRenderer, "SDL_CreateWindowAndRenderer");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_CreateRenderer, "SDL_CreateRenderer");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_CreateSoftwareRenderer, "SDL_CreateSoftwareRenderer");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetRenderer, "SDL_GetRenderer");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetRendererInfo, "SDL_GetRendererInfo");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetRendererOutputSize, "SDL_GetRendererOutputSize");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_CreateTexture, "SDL_CreateTexture");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_CreateTextureFromSurface, "SDL_CreateTextureFromSurface");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_QueryTexture, "SDL_QueryTexture");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetTextureColorMod, "SDL_SetTextureColorMod");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetTextureColorMod, "SDL_GetTextureColorMod");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetTextureAlphaMod, "SDL_SetTextureAlphaMod");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetTextureAlphaMod, "SDL_GetTextureAlphaMod");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetTextureBlendMode, "SDL_SetTextureBlendMode");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetTextureBlendMode, "SDL_GetTextureBlendMode");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_UpdateTexture, "SDL_UpdateTexture");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LockTexture, "SDL_LockTexture");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_UnlockTexture, "SDL_UnlockTexture");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderTargetSupported, "SDL_RenderTargetSupported");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetRenderTarget, "SDL_SetRenderTarget");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetRenderTarget, "SDL_GetRenderTarget");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderSetClipRect, "SDL_RenderSetClipRect");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderGetClipRect, "SDL_RenderGetClipRect");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderSetLogicalSize, "SDL_RenderSetLogicalSize");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderGetLogicalSize, "SDL_RenderGetLogicalSize");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderSetViewport, "SDL_RenderSetViewport");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderGetViewport, "SDL_RenderGetViewport");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderSetScale, "SDL_RenderSetScale");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderGetScale, "SDL_RenderGetScale");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetRenderDrawColor, "SDL_SetRenderDrawColor");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetRenderDrawColor, "SDL_GetRenderDrawColor");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetRenderDrawBlendMode, "SDL_SetRenderDrawBlendMode");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetRenderDrawBlendMode, "SDL_GetRenderDrawBlendMode");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderClear, "SDL_RenderClear");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderDrawPoint, "SDL_RenderDrawPoint");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderDrawPoints, "SDL_RenderDrawPoints");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderDrawLine, "SDL_RenderDrawLine");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderDrawLines, "SDL_RenderDrawLines");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderDrawRect, "SDL_RenderDrawRect");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderDrawRects, "SDL_RenderDrawRects");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderFillRect, "SDL_RenderFillRect");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderFillRects, "SDL_RenderFillRects");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderCopy, "SDL_RenderCopy");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderCopyEx, "SDL_RenderCopyEx");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderReadPixels, "SDL_RenderReadPixels");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderPresent, "SDL_RenderPresent");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_DestroyTexture, "SDL_DestroyTexture");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_DestroyRenderer, "SDL_DestroyRenderer");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GL_BindTexture, "SDL_GL_BindTexture");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GL_UnbindTexture, "SDL_GL_UnbindTexture");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RWFromFile, "SDL_RWFromFile");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RWFromFP, "SDL_RWFromFP");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RWFromMem, "SDL_RWFromMem");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RWFromConstMem, "SDL_RWFromConstMem");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_AllocRW, "SDL_AllocRW");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_FreeRW, "SDL_FreeRW");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_ReadU8, "SDL_ReadU8");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_ReadLE16, "SDL_ReadLE16");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_ReadBE16, "SDL_ReadBE16");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_ReadLE32, "SDL_ReadLE32");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_ReadBE32, "SDL_ReadBE32");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_ReadLE64, "SDL_ReadLE64");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_ReadBE64, "SDL_ReadBE64");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_WriteU8, "SDL_WriteU8");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_WriteLE16, "SDL_WriteLE16");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_WriteBE16, "SDL_WriteBE16");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_WriteLE32, "SDL_WriteLE32");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_WriteBE32, "SDL_WriteBE32");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_WriteLE64, "SDL_WriteLE64");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_WriteBE64, "SDL_WriteBE64");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_CreateShapedWindow, "SDL_CreateShapedWindow");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_IsShapedWindow, "SDL_IsShapedWindow");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetWindowShape, "SDL_SetWindowShape");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetShapedWindowMode, "SDL_GetShapedWindowMode");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_free, "SDL_free");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_CreateRGBSurface, "SDL_CreateRGBSurface");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_CreateRGBSurfaceFrom, "SDL_CreateRGBSurfaceFrom");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_FreeSurface, "SDL_FreeSurface");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetSurfacePalette, "SDL_SetSurfacePalette");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LockSurface, "SDL_LockSurface");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_UnlockSurface, "SDL_UnlockSurface");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LoadBMP_RW, "SDL_LoadBMP_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SaveBMP_RW, "SDL_SaveBMP_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetSurfaceRLE, "SDL_SetSurfaceRLE");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetColorKey, "SDL_SetColorKey");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetColorKey, "SDL_GetColorKey");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetSurfaceColorMod, "SDL_SetSurfaceColorMod");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetSurfaceColorMod, "SDL_GetSurfaceColorMod");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetSurfaceAlphaMod, "SDL_SetSurfaceAlphaMod");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetSurfaceAlphaMod, "SDL_GetSurfaceAlphaMod");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetSurfaceBlendMode, "SDL_SetSurfaceBlendMode");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetSurfaceBlendMode, "SDL_GetSurfaceBlendMode");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetClipRect, "SDL_SetClipRect");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetClipRect, "SDL_GetClipRect");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_ConvertSurface, "SDL_ConvertSurface");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_ConvertSurfaceFormat, "SDL_ConvertSurfaceFormat");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_ConvertPixels, "SDL_ConvertPixels");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_FillRect, "SDL_FillRect");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_FillRects, "SDL_FillRects");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_UpperBlit, "SDL_UpperBlit");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LowerBlit, "SDL_LowerBlit");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SoftStretch, "SDL_SoftStretch");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_UpperBlitScaled, "SDL_UpperBlitScaled");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LowerBlitScaled, "SDL_LowerBlitScaled");
|
||||||
|
version(Android) {
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_AndroidGetJNIEnv, "SDL_AndroidGetJNIEnv");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_AndroidGetActivity, "SDL_AndroidGetActivity");
|
||||||
|
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_AndroidGetInternalStoragePath, "SDL_AndroidGetInternalStoragePath");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_AndroidGetInternalStorageState, "SDL_AndroidGetInternalStorageState");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_AndroidGetExternalStoragePath, "SDL_AndroidGetExternalStoragePath");
|
||||||
|
}
|
||||||
|
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetWindowWMInfo, "SDL_GetWindowWMInfo");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetTicks, "SDL_GetTicks");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetPerformanceCounter, "SDL_GetPerformanceCounter");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetPerformanceFrequency, "SDL_GetPerformanceFrequency");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_Delay, "SDL_Delay");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_AddTimer, "SDL_AddTimer");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RemoveTimer, "SDL_RemoveTimer");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetNumTouchDevices, "SDL_GetNumTouchDevices");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetTouchDevice, "SDL_GetTouchDevice");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetNumTouchFingers, "SDL_GetNumTouchFingers");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetTouchFinger, "SDL_GetTouchFinger");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetVersion, "SDL_GetVersion");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetRevision, "SDL_GetRevision");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetRevisionNumber, "SDL_GetRevisionNumber");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetNumVideoDrivers, "SDL_GetNumVideoDrivers");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetVideoDriver, "SDL_GetVideoDriver");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_VideoInit, "SDL_VideoInit");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_VideoQuit, "SDL_VideoQuit");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetCurrentVideoDriver, "SDL_GetCurrentVideoDriver");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetNumVideoDisplays, "SDL_GetNumVideoDisplays");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetDisplayName, "SDL_GetDisplayName");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetDisplayBounds, "SDL_GetDisplayBounds");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetNumDisplayModes, "SDL_GetNumDisplayModes");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetDisplayMode, "SDL_GetDisplayMode");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetDesktopDisplayMode, "SDL_GetDesktopDisplayMode");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetCurrentDisplayMode, "SDL_GetCurrentDisplayMode");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetClosestDisplayMode, "SDL_GetClosestDisplayMode");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetWindowDisplayIndex, "SDL_GetWindowDisplayIndex");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetWindowDisplayMode, "SDL_SetWindowDisplayMode");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetWindowDisplayMode, "SDL_GetWindowDisplayMode");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetWindowPixelFormat, "SDL_GetWindowPixelFormat");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_CreateWindow, "SDL_CreateWindow");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_CreateWindowFrom, "SDL_CreateWindowFrom");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetWindowID, "SDL_GetWindowID");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetWindowFromID, "SDL_GetWindowFromID");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetWindowFlags, "SDL_GetWindowFlags");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetWindowTitle, "SDL_SetWindowTitle");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetWindowTitle, "SDL_GetWindowTitle");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetWindowIcon, "SDL_SetWindowIcon");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetWindowData, "SDL_SetWindowData");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetWindowData, "SDL_GetWindowData");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetWindowPosition, "SDL_SetWindowPosition");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetWindowPosition, "SDL_GetWindowPosition");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetWindowSize, "SDL_SetWindowSize");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetWindowSize, "SDL_GetWindowSize");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetWindowMinimumSize, "SDL_SetWindowMinimumSize");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetWindowMinimumSize, "SDL_GetWindowMinimumSize");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetWindowMaximumSize, "SDL_SetWindowMaximumSize");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetWindowMaximumSize, "SDL_GetWindowMaximumSize");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetWindowBordered, "SDL_SetWindowBordered");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_ShowWindow, "SDL_ShowWindow");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HideWindow, "SDL_HideWindow");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RaiseWindow, "SDL_RaiseWindow");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_MaximizeWindow, "SDL_MaximizeWindow");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_MinimizeWindow, "SDL_MinimizeWindow");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RestoreWindow, "SDL_RestoreWindow");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetWindowFullscreen, "SDL_SetWindowFullscreen");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetWindowSurface, "SDL_GetWindowSurface");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_UpdateWindowSurface, "SDL_UpdateWindowSurface");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_UpdateWindowSurfaceRects, "SDL_UpdateWindowSurfaceRects");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetWindowGrab, "SDL_SetWindowGrab");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetWindowGrab, "SDL_GetWindowGrab");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetWindowBrightness, "SDL_SetWindowBrightness");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetWindowBrightness, "SDL_GetWindowBrightness");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetWindowGammaRamp, "SDL_SetWindowGammaRamp");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetWindowGammaRamp, "SDL_GetWindowGammaRamp");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_DestroyWindow, "SDL_DestroyWindow");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_IsScreenSaverEnabled, "SDL_IsScreenSaverEnabled");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_EnableScreenSaver, "SDL_EnableScreenSaver");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_DisableScreenSaver, "SDL_DisableScreenSaver");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GL_LoadLibrary, "SDL_GL_LoadLibrary");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GL_GetProcAddress, "SDL_GL_GetProcAddress");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GL_UnloadLibrary, "SDL_GL_UnloadLibrary");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GL_ExtensionSupported, "SDL_GL_ExtensionSupported");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GL_SetAttribute, "SDL_GL_SetAttribute");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GL_GetAttribute, "SDL_GL_GetAttribute");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GL_CreateContext, "SDL_GL_CreateContext");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GL_MakeCurrent, "SDL_GL_MakeCurrent");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GL_GetCurrentWindow, "SDL_GL_GetCurrentWindow");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GL_GetCurrentContext, "SDL_GL_GetCurrentContext");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GL_SetSwapInterval, "SDL_GL_SetSwapInterval");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GL_GetSwapInterval, "SDL_GL_GetSwapInterval");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GL_SwapWindow, "SDL_GL_SwapWindow");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GL_DeleteContext, "SDL_GL_DeleteContext");
|
||||||
|
|
||||||
|
if(errorCount() != errCount) return SDLSupport.badLibrary;
|
||||||
|
else loadedVersion = SDLSupport.sdl200;
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl201) {
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetSystemRAM, "SDL_GetSystemRAM");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetBasePath, "SDL_GetBasePath");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetPrefPath, "SDL_GetPrefPath");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_UpdateYUVTexture, "SDL_UpdateYUVTexture");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GL_GetDrawableSize, "SDL_GL_GetDrawableSize");
|
||||||
|
|
||||||
|
version(Windows) {
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_Direct3D9GetAdapterIndex, "SDL_Direct3D9GetAdapterIndex") ;
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderGetD3D9Device, "SDL_RenderGetD3D9Device");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(errorCount() != errCount) return SDLSupport.badLibrary;
|
||||||
|
else loadedVersion = SDLSupport.sdl201;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl202) {
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetDefaultAssertionHandler, "SDL_GetDefaultAssertionHandler");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetAssertionHandler, "SDL_GetAssertionHandler");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HasAVX, "SDL_HasAVX");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerAddMappingsFromRW, "SDL_GameControllerAddMappingsFromRW");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GL_ResetAttributes, "SDL_GL_ResetAttributes");
|
||||||
|
|
||||||
|
version(Windows) {
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_DXGIGetOutputInfo, "SDL_DXGIGetOutputInfo");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(errorCount() != errCount) return SDLSupport.badLibrary;
|
||||||
|
else loadedVersion = SDLSupport.sdl202;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl203) {
|
||||||
|
loadedVersion = SDLSupport.sdl203;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl204) {
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_ClearQueuedAudio, "SDL_ClearQueuedAudio");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetQueuedAudioSize, "SDL_GetQueuedAudioSize");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_QueueAudio, "SDL_QueueAudio");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HasAVX2, "SDL_HasAVX2");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerFromInstanceID, "SDL_GameControllerFromInstanceID");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickCurrentPowerLevel, "SDL_JoystickCurrentPowerLevel");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickFromInstanceID, "SDL_JoystickFromInstanceID");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_CaptureMouse, "SDL_CaptureMouse");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetGlobalMouseState, "SDL_GetGlobalMouseState");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_WarpMouseGlobal, "SDL_WarpMouseGlobal");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderIsClipEnabled, "SDL_RenderIsClipEnabled");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetDisplayDPI, "SDL_GetDisplayDPI");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetGrabbedWindow, "SDL_GetGrabbedWindow");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetWindowHitTest, "SDL_SetWindowHitTest");
|
||||||
|
|
||||||
|
version(Windows) {
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetWindowsMessageHook, "SDL_SetWindowsMessageHook");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(errorCount() != errCount) return SDLSupport.badLibrary;
|
||||||
|
else loadedVersion = SDLSupport.sdl204;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl205) {
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_DequeueAudio, "SDL_DequeueAudio");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetHintBoolean, "SDL_GetHintBoolean");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderGetIntegerScale, "SDL_RenderGetIntegerScale");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderSetIntegerScale, "SDL_RenderSetIntegerScale");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_CreateRGBSurfaceWithFormat, "SDL_CreateRGBSurfaceWithFormat");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_CreateRGBSurfaceWithFormatFrom, "SDL_CreateRGBSurfaceWithFormatFrom");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetDisplayUsableBounds, "SDL_GetDisplayUsableBounds");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetWindowBordersSize, "SDL_GetWindowBordersSize");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetWindowOpacity, "SDL_GetWindowOpacity");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetWindowInputFocus, "SDL_SetWindowInputFocus");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetWindowModalFor, "SDL_SetWindowModalFor");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetWindowOpacity, "SDL_SetWindowOpacity");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetWindowResizable, "SDL_SetWindowResizable");
|
||||||
|
|
||||||
|
if(errorCount() != errCount) return SDLSupport.badLibrary;
|
||||||
|
else loadedVersion = SDLSupport.sdl205;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl206) {
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_ComposeCustomBlendMode, "SDL_ComposeCustomBlendMode");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HasNEON, "SDL_HasNEON");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerGetVendor, "SDL_GameControllerGetVendor");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerGetProduct, "SDL_GameControllerGetProduct");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerGetProductVersion, "SDL_GameControllerGetProductVersion");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerMappingForIndex, "SDL_GameControllerMappingForIndex");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerNumMappings, "SDL_GameControllerNumMappings");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetAxisInitialState, "SDL_JoystickGetAxisInitialState");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetDeviceVendor, "SDL_JoystickGetDeviceVendor");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetDeviceProduct, "SDL_JoystickGetDeviceProduct");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetDeviceProductVersion, "SDL_JoystickGetDeviceProductVersion");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetDeviceInstanceID, "SDL_JoystickGetDeviceInstanceID");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetDeviceType, "SDL_JoystickGetDeviceType");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetProduct, "SDL_JoystickGetProduct");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetProductVersion, "SDL_JoystickGetProductVersion");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetType, "SDL_JoystickGetType");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetVendor, "SDL_JoystickGetVendor");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LoadFile_RW, "SDL_LoadFile_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_DuplicateSurface, "SDL_DuplicateSurface");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_Vulkan_CreateSurface, "SDL_Vulkan_CreateSurface");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_Vulkan_GetDrawableSize, "SDL_Vulkan_GetDrawableSize");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_Vulkan_GetInstanceExtensions, "SDL_Vulkan_GetInstanceExtensions");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_Vulkan_GetVkGetInstanceProcAddr, "SDL_Vulkan_GetVkGetInstanceProcAddr");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_Vulkan_LoadLibrary, "SDL_Vulkan_LoadLibrary");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_Vulkan_UnloadLibrary, "SDL_Vulkan_UnloadLibrary");
|
||||||
|
|
||||||
|
if(errorCount() != errCount) return SDLSupport.badLibrary;
|
||||||
|
else loadedVersion = SDLSupport.sdl206;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl207) {
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_NewAudioStream, "SDL_NewAudioStream");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_AudioStreamPut, "SDL_AudioStreamPut");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_AudioStreamGet, "SDL_AudioStreamGet");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_AudioStreamAvailable, "SDL_AudioStreamAvailable");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_AudioStreamFlush, "SDL_AudioStreamFlush");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_AudioStreamClear, "SDL_AudioStreamClear");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_FreeAudioStream, "SDL_FreeAudioStream");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LockJoysticks, "SDL_LockJoysticks");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_UnlockJoysticks, "SDL_UnlockJoysticks");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetDeviceProduct, "SDL_JoystickGetDeviceProduct");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetDeviceProductVersion, "SDL_JoystickGetDeviceProductVersion");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetDeviceInstanceID, "SDL_JoystickGetDeviceInstanceID");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetDeviceType, "SDL_JoystickGetDeviceType");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetProduct, "SDL_JoystickGetProduct");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetProductVersion, "SDL_JoystickGetProductVersion");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetType, "SDL_JoystickGetType");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetVendor, "SDL_JoystickGetVendor");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LoadFile_RW, "SDL_LoadFile_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_DuplicateSurface, "SDL_DuplicateSurface");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_Vulkan_CreateSurface, "SDL_Vulkan_CreateSurface");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_Vulkan_GetDrawableSize, "SDL_Vulkan_GetDrawableSize");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_Vulkan_GetInstanceExtensions, "SDL_Vulkan_GetInstanceExtensions");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_Vulkan_GetVkGetInstanceProcAddr, "SDL_Vulkan_GetVkGetInstanceProcAddr");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_Vulkan_LoadLibrary, "SDL_Vulkan_LoadLibrary");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_Vulkan_UnloadLibrary, "SDL_Vulkan_UnloadLibrary");
|
||||||
|
|
||||||
|
if(errorCount() != errCount) return SDLSupport.badLibrary;
|
||||||
|
else loadedVersion = SDLSupport.sdl207;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl208) {
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderGetMetalLayer, "SDL_RenderGetMetalLayer");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderGetMetalCommandEncoder, "SDL_RenderGetMetalCommandEncoder");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SetYUVConversionMode, "SDL_SetYUVConversionMode");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetYUVConversionMode, "SDL_GetYUVConversionMode");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetYUVConversionModeForResolution, "SDL_GetYUVConversionModeForResolution");
|
||||||
|
|
||||||
|
version(Android) {
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_IsAndroidTV, "SDL_IsAndroidTV");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(errorCount() != errCount) return SDLSupport.badLibrary;
|
||||||
|
else loadedVersion = SDLSupport.sdl208;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl209) {
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HasAVX512F, "SDL_HasAVX512F");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerMappingForDeviceIndex, "SDL_GameControllerMappingForDeviceIndex");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerRumble, "SDL_GameControllerRumble");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickRumble, "SDL_JoystickRumble");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_HasColorKey, "SDL_HasColorKey");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetDisplayOrientation, "SDL_GetDisplayOrientation");
|
||||||
|
|
||||||
|
version(linux) {
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_LinuxSetThreadPriority, "SDL_LinuxSetThreadPriority");
|
||||||
|
}
|
||||||
|
else version(Android) {
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_IsChromebook, "SDL_IsChromebook");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_IsDeXMode, "SDL_IsDeXMode");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_AndroidBackButton, "SDL_AndroidBackButton");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(errorCount() != errCount) return SDLSupport.badLibrary;
|
||||||
|
else loadedVersion = SDLSupport.sdl209;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlSupport >= SDLSupport.sdl2010) {
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SIMDGetAlignment, "SDL_SIMDGetAlignment");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SIMDAlloc, "SDL_SIMDAlloc");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_SIMDFree, "SDL_SIMDFree");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GameControllerGetPlayerIndex, "SDL_GameControllerGetPlayerIndex");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetDevicePlayerIndex, "SDL_JoystickGetDevicePlayerIndex");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_JoystickGetPlayerIndex, "SDL_JoystickGetPlayerIndex");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderDrawPointF, "SDL_RenderDrawPointF");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderDrawPointsF, "SDL_RenderDrawPointsF");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderDrawLineF, "SDL_RenderDrawLineF");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderDrawLinesF, "SDL_RenderDrawLinesF");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderDrawRectF, "SDL_RenderDrawRectF");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderDrawRectsF, "SDL_RenderDrawRectsF");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderFillRectF, "SDL_RenderFillRectF");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderFillRectsF, "SDL_RenderFillRectsF");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderCopyF, "SDL_RenderCopyF");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderCopyExF, "SDL_RenderCopyExF");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RenderFlush, "SDL_RenderFlush");lib.bindSymbol(cast(void**)&SDL_Vulkan_CreateSurface, "SDL_Vulkan_CreateSurface");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RWsize, "SDL_RWsize");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RWseek, "SDL_RWseek");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RWtell, "SDL_RWtell");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RWread, "SDL_RWread");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RWwrite, "SDL_RWwrite");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_RWclose, "SDL_RWclose");
|
||||||
|
lib.bindSymbol(cast(void**)&SDL_GetTouchDeviceType, "SDL_GetTouchDeviceType");
|
||||||
|
|
||||||
|
|
||||||
|
if(errorCount() != errCount) return SDLSupport.badLibrary;
|
||||||
|
else loadedVersion = SDLSupport.sdl2010;
|
||||||
|
}
|
||||||
|
|
||||||
|
return loadedVersion;
|
||||||
|
}
|
||||||
353
demos/external/wasm_imports/bindbc/sdl/image.d
vendored
Normal file
353
demos/external/wasm_imports/bindbc/sdl/image.d
vendored
Normal file
|
|
@ -0,0 +1,353 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.image;
|
||||||
|
|
||||||
|
version(BindSDL_Image):
|
||||||
|
|
||||||
|
import bindbc.sdl.bind.sdlerror : SDL_GetError, SDL_SetError;
|
||||||
|
import bindbc.sdl.bind.sdlrender : SDL_Renderer, SDL_Texture;
|
||||||
|
import bindbc.sdl.bind.sdlrwops : SDL_RWops;
|
||||||
|
import bindbc.sdl.bind.sdlsurface : SDL_Surface;
|
||||||
|
import bindbc.sdl.bind.sdlversion : SDL_version, SDL_VERSIONNUM;
|
||||||
|
|
||||||
|
alias IMG_SetError = SDL_SetError;
|
||||||
|
alias IMG_GetError = SDL_GetError;
|
||||||
|
|
||||||
|
enum SDLImageSupport {
|
||||||
|
noLibrary,
|
||||||
|
badLibrary,
|
||||||
|
sdlImage200 = 200,
|
||||||
|
sdlImage201,
|
||||||
|
sdlImage202,
|
||||||
|
}
|
||||||
|
|
||||||
|
enum ubyte SDL_IMAGE_MAJOR_VERSION = 2;
|
||||||
|
enum ubyte SDL_IMAGE_MINOR_VERSION = 0;
|
||||||
|
|
||||||
|
version(SDL_Image_202) {
|
||||||
|
enum sdlImageSupport = SDLImageSupport.sdlImage202;
|
||||||
|
enum ubyte SDL_IMAGE_PATCHLEVEL = 2;
|
||||||
|
}
|
||||||
|
else version(SDL_Image_201) {
|
||||||
|
enum sdlImageSupport = SDLImageSupport.sdlImage201;
|
||||||
|
enum ubyte SDL_IMAGE_PATCHLEVEL = 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
enum sdlImageSupport = SDLImageSupport.sdlImage200;
|
||||||
|
enum ubyte SDL_IMAGE_PATCHLEVEL = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@nogc nothrow void SDL_IMAGE_VERSION(SDL_version* X)
|
||||||
|
{
|
||||||
|
X.major = SDL_IMAGE_MAJOR_VERSION;
|
||||||
|
X.minor = SDL_IMAGE_MINOR_VERSION;
|
||||||
|
X.patch = SDL_IMAGE_PATCHLEVEL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// These were implemented in SDL_image 2.0.2, but are fine for all versions.
|
||||||
|
enum SDL_IMAGE_COMPILEDVERSION = SDL_VERSIONNUM!(SDL_IMAGE_MAJOR_VERSION, SDL_IMAGE_MINOR_VERSION, SDL_IMAGE_PATCHLEVEL);
|
||||||
|
enum SDL_IMAGE_VERSION_ATLEAST(ubyte X, ubyte Y, ubyte Z) = SDL_IMAGE_COMPILEDVERSION >= SDL_VERSIONNUM!(X, Y, Z);
|
||||||
|
|
||||||
|
enum {
|
||||||
|
IMG_INIT_JPG = 0x00000001,
|
||||||
|
IMG_INIT_PNG = 0x00000002,
|
||||||
|
IMG_INIT_TIF = 0x00000004,
|
||||||
|
IMG_INIT_WEBP = 0x00000008,
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
int IMG_Init(int);
|
||||||
|
int IMG_Quit();
|
||||||
|
const(SDL_version)* IMG_Linked_Version();
|
||||||
|
SDL_Surface* IMG_LoadTyped_RW(SDL_RWops*,int,const(char)*);
|
||||||
|
SDL_Surface* IMG_Load(const(char)*);
|
||||||
|
SDL_Surface* IMG_Load_RW(SDL_RWops*,int);
|
||||||
|
|
||||||
|
SDL_Texture* IMG_LoadTexture(SDL_Renderer*,const(char)*);
|
||||||
|
SDL_Texture* IMG_LoadTexture_RW(SDL_Renderer*,SDL_RWops*,int);
|
||||||
|
SDL_Texture* IMG_LoadTextureTyped_RW(SDL_Renderer*,SDL_RWops*,int,const(char)*);
|
||||||
|
|
||||||
|
int IMG_isICO(SDL_RWops*);
|
||||||
|
int IMG_isCUR(SDL_RWops*);
|
||||||
|
int IMG_isBMP(SDL_RWops*);
|
||||||
|
int IMG_isGIF(SDL_RWops*);
|
||||||
|
int IMG_isJPG(SDL_RWops*);
|
||||||
|
int IMG_isLBM(SDL_RWops*);
|
||||||
|
int IMG_isPCX(SDL_RWops*);
|
||||||
|
int IMG_isPNG(SDL_RWops*);
|
||||||
|
int IMG_isPNM(SDL_RWops*);
|
||||||
|
int IMG_isTIF(SDL_RWops*);
|
||||||
|
int IMG_isXCF(SDL_RWops*);
|
||||||
|
int IMG_isXPM(SDL_RWops*);
|
||||||
|
int IMG_isXV(SDL_RWops*);
|
||||||
|
int IMG_isWEBP(SDL_RWops*);
|
||||||
|
|
||||||
|
SDL_Surface* IMG_LoadICO_RW(SDL_RWops*);
|
||||||
|
SDL_Surface* IMG_LoadCUR_RW(SDL_RWops*);
|
||||||
|
SDL_Surface* IMG_LoadBMP_RW(SDL_RWops*);
|
||||||
|
SDL_Surface* IMG_LoadGIF_RW(SDL_RWops*);
|
||||||
|
SDL_Surface* IMG_LoadJPG_RW(SDL_RWops*);
|
||||||
|
SDL_Surface* IMG_LoadLBM_RW(SDL_RWops*);
|
||||||
|
SDL_Surface* IMG_LoadPCX_RW(SDL_RWops*);
|
||||||
|
SDL_Surface* IMG_LoadPNG_RW(SDL_RWops*);
|
||||||
|
SDL_Surface* IMG_LoadPNM_RW(SDL_RWops*);
|
||||||
|
SDL_Surface* IMG_LoadTGA_RW(SDL_RWops*);
|
||||||
|
SDL_Surface* IMG_LoadTIF_RW(SDL_RWops*);
|
||||||
|
SDL_Surface* IMG_LoadXCF_RW(SDL_RWops*);
|
||||||
|
SDL_Surface* IMG_LoadXPM_RW(SDL_RWops*);
|
||||||
|
SDL_Surface* IMG_LoadXV_RW(SDL_RWops*);
|
||||||
|
SDL_Surface* IMG_LoadWEBP_RW(SDL_RWops*);
|
||||||
|
|
||||||
|
SDL_Surface* IMG_ReadXPMFromArray(char**);
|
||||||
|
|
||||||
|
int IMG_SavePNG(SDL_Surface*,const(char)*);
|
||||||
|
int IMG_SavePNG_RW(SDL_Surface*,SDL_RWops*,int);
|
||||||
|
|
||||||
|
static if(sdlImageSupport >= SDLImageSupport.sdlImage202) {
|
||||||
|
int IMG_isSVG(SDL_RWops*);
|
||||||
|
SDL_Surface* IMG_LoadSVG(SDL_RWops*);
|
||||||
|
int IMG_SaveJPG(SDL_Surface*,const(char)*,int);
|
||||||
|
int IMG_SaveJPG_RW(SDL_Surface*,SDL_RWops*,int,int);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
import bindbc.loader;
|
||||||
|
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pIMG_Init = int function(int);
|
||||||
|
alias pIMG_Quit = int function();
|
||||||
|
alias pIMG_Linked_Version = const(SDL_version)* function();
|
||||||
|
alias pIMG_LoadTyped_RW = SDL_Surface* function(SDL_RWops*,int,const(char)*);
|
||||||
|
alias pIMG_Load = SDL_Surface* function(const(char)*);
|
||||||
|
alias pIMG_Load_RW = SDL_Surface* function(SDL_RWops*,int);
|
||||||
|
|
||||||
|
alias pIMG_LoadTexture = SDL_Texture* function(SDL_Renderer*,const(char)*);
|
||||||
|
alias pIMG_LoadTexture_RW = SDL_Texture* function(SDL_Renderer*,SDL_RWops*,int);
|
||||||
|
alias pIMG_LoadTextureTyped_RW = SDL_Texture* function(SDL_Renderer*,SDL_RWops*,int,const(char)*);
|
||||||
|
|
||||||
|
alias pIMG_isICO = int function(SDL_RWops*);
|
||||||
|
alias pIMG_isCUR = int function(SDL_RWops*);
|
||||||
|
alias pIMG_isBMP = int function(SDL_RWops*);
|
||||||
|
alias pIMG_isGIF = int function(SDL_RWops*);
|
||||||
|
alias pIMG_isJPG = int function(SDL_RWops*);
|
||||||
|
alias pIMG_isLBM = int function(SDL_RWops*);
|
||||||
|
alias pIMG_isPCX = int function(SDL_RWops*);
|
||||||
|
alias pIMG_isPNG = int function(SDL_RWops*);
|
||||||
|
alias pIMG_isPNM = int function(SDL_RWops*);
|
||||||
|
alias pIMG_isTIF = int function(SDL_RWops*);
|
||||||
|
alias pIMG_isXCF = int function(SDL_RWops*);
|
||||||
|
alias pIMG_isXPM = int function(SDL_RWops*);
|
||||||
|
alias pIMG_isXV = int function(SDL_RWops*);
|
||||||
|
alias pIMG_isWEBP = int function(SDL_RWops*);
|
||||||
|
|
||||||
|
alias pIMG_LoadICO_RW = SDL_Surface* function(SDL_RWops*);
|
||||||
|
alias pIMG_LoadCUR_RW = SDL_Surface* function(SDL_RWops*);
|
||||||
|
alias pIMG_LoadBMP_RW = SDL_Surface* function(SDL_RWops*);
|
||||||
|
alias pIMG_LoadGIF_RW = SDL_Surface* function(SDL_RWops*);
|
||||||
|
alias pIMG_LoadJPG_RW = SDL_Surface* function(SDL_RWops*);
|
||||||
|
alias pIMG_LoadLBM_RW = SDL_Surface* function(SDL_RWops*);
|
||||||
|
alias pIMG_LoadPCX_RW = SDL_Surface* function(SDL_RWops*);
|
||||||
|
alias pIMG_LoadPNG_RW = SDL_Surface* function(SDL_RWops*);
|
||||||
|
alias pIMG_LoadPNM_RW = SDL_Surface* function(SDL_RWops*);
|
||||||
|
alias pIMG_LoadTGA_RW = SDL_Surface* function(SDL_RWops*);
|
||||||
|
alias pIMG_LoadTIF_RW = SDL_Surface* function(SDL_RWops*);
|
||||||
|
alias pIMG_LoadXCF_RW = SDL_Surface* function(SDL_RWops*);
|
||||||
|
alias pIMG_LoadXPM_RW = SDL_Surface* function(SDL_RWops*);
|
||||||
|
alias pIMG_LoadXV_RW = SDL_Surface* function(SDL_RWops*);
|
||||||
|
alias pIMG_LoadWEBP_RW = SDL_Surface* function(SDL_RWops*);
|
||||||
|
|
||||||
|
alias pIMG_ReadXPMFromArray = SDL_Surface* function(char**);
|
||||||
|
|
||||||
|
alias pIMG_SavePNG = int function(SDL_Surface*,const(char)*);
|
||||||
|
alias pIMG_SavePNG_RW = int function(SDL_Surface*,SDL_RWops*,int);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pIMG_Init IMG_Init;
|
||||||
|
pIMG_Quit IMG_Quit;
|
||||||
|
pIMG_Linked_Version IMG_Linked_Version;
|
||||||
|
pIMG_LoadTyped_RW IMG_LoadTyped_RW;
|
||||||
|
pIMG_Load IMG_Load;
|
||||||
|
pIMG_Load_RW IMG_Load_RW;
|
||||||
|
pIMG_LoadTexture IMG_LoadTexture;
|
||||||
|
pIMG_LoadTexture_RW IMG_LoadTexture_RW;
|
||||||
|
pIMG_LoadTextureTyped_RW IMG_LoadTextureTyped_RW;
|
||||||
|
pIMG_isICO IMG_isICO;
|
||||||
|
pIMG_isCUR IMG_isCUR;
|
||||||
|
pIMG_isBMP IMG_isBMP;
|
||||||
|
pIMG_isGIF IMG_isGIF;
|
||||||
|
pIMG_isJPG IMG_isJPG;
|
||||||
|
pIMG_isLBM IMG_isLBM;
|
||||||
|
pIMG_isPCX IMG_isPCX;
|
||||||
|
pIMG_isPNG IMG_isPNG;
|
||||||
|
pIMG_isPNM IMG_isPNM;
|
||||||
|
pIMG_isTIF IMG_isTIF;
|
||||||
|
pIMG_isXCF IMG_isXCF;
|
||||||
|
pIMG_isXPM IMG_isXPM;
|
||||||
|
pIMG_isXV IMG_isXV;
|
||||||
|
pIMG_isWEBP IMG_isWEBP;
|
||||||
|
pIMG_LoadICO_RW IMG_LoadICO_RW;
|
||||||
|
pIMG_LoadCUR_RW IMG_LoadCUR_RW;
|
||||||
|
pIMG_LoadBMP_RW IMG_LoadBMP_RW;
|
||||||
|
pIMG_LoadGIF_RW IMG_LoadGIF_RW;
|
||||||
|
pIMG_LoadJPG_RW IMG_LoadJPG_RW;
|
||||||
|
pIMG_LoadLBM_RW IMG_LoadLBM_RW;
|
||||||
|
pIMG_LoadPCX_RW IMG_LoadPCX_RW;
|
||||||
|
pIMG_LoadPNG_RW IMG_LoadPNG_RW;
|
||||||
|
pIMG_LoadPNM_RW IMG_LoadPNM_RW;
|
||||||
|
pIMG_LoadTGA_RW IMG_LoadTGA_RW;
|
||||||
|
pIMG_LoadTIF_RW IMG_LoadTIF_RW;
|
||||||
|
pIMG_LoadXCF_RW IMG_LoadXCF_RW;
|
||||||
|
pIMG_LoadXPM_RW IMG_LoadXPM_RW;
|
||||||
|
pIMG_LoadXV_RW IMG_LoadXV_RW;
|
||||||
|
pIMG_LoadWEBP_RW IMG_LoadWEBP_RW;
|
||||||
|
pIMG_ReadXPMFromArray IMG_ReadXPMFromArray;
|
||||||
|
pIMG_SavePNG IMG_SavePNG;
|
||||||
|
pIMG_SavePNG_RW IMG_SavePNG_RW;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlImageSupport >= SDLImageSupport.sdlImage202) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pIMG_isSVG = int function(SDL_RWops*);
|
||||||
|
alias pIMG_LoadSVG_RW = SDL_Surface* function(SDL_RWops*);
|
||||||
|
alias pIMG_SaveJPG = int function(SDL_Surface*,const(char)*,int);
|
||||||
|
alias pIMG_SaveJPG_RW = int function(SDL_Surface*,SDL_RWops*,int,int);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pIMG_isSVG IMG_isSVG;
|
||||||
|
pIMG_LoadSVG_RW IMG_LoadSVG;
|
||||||
|
pIMG_SaveJPG IMG_SaveJPG;
|
||||||
|
pIMG_SaveJPG_RW IMG_SaveJPG_RW;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private {
|
||||||
|
SharedLib lib;
|
||||||
|
SDLImageSupport loadedVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
void unloadSDLImage()
|
||||||
|
{
|
||||||
|
if(lib != invalidHandle) {
|
||||||
|
lib.unload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SDLImageSupport loadedSDLImageVersion() { return loadedVersion; }
|
||||||
|
|
||||||
|
bool isSDLImageLoaded()
|
||||||
|
{
|
||||||
|
return lib != invalidHandle;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SDLImageSupport loadSDLImage()
|
||||||
|
{
|
||||||
|
version(Windows) {
|
||||||
|
const(char)[][1] libNames = ["SDL2_image.dll"];
|
||||||
|
}
|
||||||
|
else version(OSX) {
|
||||||
|
const(char)[][6] libNames = [
|
||||||
|
"libSDL2_image.dylib",
|
||||||
|
"/usr/local/lib/libSDL2_image.dylib",
|
||||||
|
"../Frameworks/SDL2_image.framework/SDL2_image",
|
||||||
|
"/Library/Frameworks/SDL2_image.framework/SDL2_image",
|
||||||
|
"/System/Library/Frameworks/SDL2_image.framework/SDL2_image",
|
||||||
|
"/opt/local/lib/libSDL2_image.dylib"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
else version(Posix) {
|
||||||
|
const(char)[][6] libNames = [
|
||||||
|
"libSDL2_image.so",
|
||||||
|
"/usr/local/lib/libSDL2_image.so",
|
||||||
|
"libSDL2_image-2.0.so",
|
||||||
|
"/usr/local/lib/libSDL2_image-2.0.so",
|
||||||
|
"libSDL2_image-2.0.so.0",
|
||||||
|
"/usr/local/lib/libSDL2_image-2.0.so.0"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
else static assert(0, "bindbc-sdl is not yet supported on this platform.");
|
||||||
|
|
||||||
|
SDLImageSupport ret;
|
||||||
|
foreach(name; libNames) {
|
||||||
|
ret = loadSDLImage(name.ptr);
|
||||||
|
if(ret != SDLImageSupport.noLibrary) break;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
SDLImageSupport loadSDLImage(const(char)* libName)
|
||||||
|
{
|
||||||
|
lib = load(libName);
|
||||||
|
if(lib == invalidHandle) {
|
||||||
|
return SDLImageSupport.noLibrary;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto errCount = errorCount();
|
||||||
|
loadedVersion = SDLImageSupport.badLibrary;
|
||||||
|
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_Init,"IMG_Init");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_Quit,"IMG_Quit");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_Linked_Version,"IMG_Linked_Version");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_LoadTyped_RW,"IMG_LoadTyped_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_Load,"IMG_Load");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_Load_RW,"IMG_Load_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_LoadTexture,"IMG_LoadTexture");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_LoadTexture_RW,"IMG_LoadTexture_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_LoadTextureTyped_RW,"IMG_LoadTextureTyped_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_isICO,"IMG_isICO");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_isCUR,"IMG_isCUR");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_isBMP,"IMG_isBMP");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_isGIF,"IMG_isGIF");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_isJPG,"IMG_isJPG");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_isLBM,"IMG_isLBM");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_isPCX,"IMG_isPCX");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_isPNG,"IMG_isPNG");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_isPNM,"IMG_isPNM");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_isTIF,"IMG_isTIF");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_isXCF,"IMG_isXCF");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_isXPM,"IMG_isXPM");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_isXV,"IMG_isXV");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_isWEBP,"IMG_isWEBP");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_LoadICO_RW,"IMG_LoadICO_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_LoadCUR_RW,"IMG_LoadCUR_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_LoadBMP_RW,"IMG_LoadBMP_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_LoadGIF_RW,"IMG_LoadGIF_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_LoadJPG_RW,"IMG_LoadJPG_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_LoadLBM_RW,"IMG_LoadLBM_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_LoadPCX_RW,"IMG_LoadPCX_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_LoadPNG_RW,"IMG_LoadPNG_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_LoadPNM_RW,"IMG_LoadPNM_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_LoadTGA_RW,"IMG_LoadTGA_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_LoadTIF_RW,"IMG_LoadTIF_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_LoadXCF_RW,"IMG_LoadXCF_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_LoadXPM_RW,"IMG_LoadXPM_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_LoadXV_RW,"IMG_LoadXV_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_isXV,"IMG_isXV");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_LoadWEBP_RW,"IMG_LoadWEBP_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_SavePNG,"IMG_SavePNG");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_SavePNG_RW,"IMG_SavePNG_RW");
|
||||||
|
|
||||||
|
if(errorCount() != errCount) return SDLImageSupport.badLibrary;
|
||||||
|
else loadedVersion = SDLImageSupport.sdlImage200;
|
||||||
|
|
||||||
|
static if(sdlImageSupport >= SDLImageSupport.sdlImage202) {
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_isSVG,"IMG_isSVG");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_LoadSVG,"IMG_LoadSVG_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_SaveJPG,"IMG_SaveJPG");
|
||||||
|
lib.bindSymbol(cast(void**)&IMG_SaveJPG_RW,"IMG_SaveJPG_RW");
|
||||||
|
|
||||||
|
if(errorCount() != errCount) return SDLImageSupport.badLibrary;
|
||||||
|
else loadedVersion = SDLImageSupport.sdlImage202;
|
||||||
|
}
|
||||||
|
|
||||||
|
return loadedVersion;
|
||||||
|
}
|
||||||
|
}
|
||||||
569
demos/external/wasm_imports/bindbc/sdl/mixer.d
vendored
Normal file
569
demos/external/wasm_imports/bindbc/sdl/mixer.d
vendored
Normal file
|
|
@ -0,0 +1,569 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.mixer;
|
||||||
|
|
||||||
|
version(BindSDL_Mixer):
|
||||||
|
|
||||||
|
import bindbc.sdl.config;
|
||||||
|
import bindbc.sdl.bind.sdlaudio : AUDIO_S16LSB, SDL_MIX_MAXVOLUME;
|
||||||
|
import bindbc.sdl.bind.sdlerror : SDL_GetError, SDL_SetError, SDL_ClearError;
|
||||||
|
import bindbc.sdl.bind.sdlrwops : SDL_RWops, SDL_RWFromFile;
|
||||||
|
import bindbc.sdl.bind.sdlstdinc : SDL_bool;
|
||||||
|
import bindbc.sdl.bind.sdlversion : SDL_version, SDL_VERSIONNUM;
|
||||||
|
|
||||||
|
alias Mix_SetError = SDL_SetError;
|
||||||
|
alias Mix_GetError = SDL_GetError;
|
||||||
|
alias Mix_ClearError = SDL_ClearError;
|
||||||
|
|
||||||
|
enum SDLMixerSupport {
|
||||||
|
noLibrary,
|
||||||
|
badLibrary,
|
||||||
|
sdlMixer200 = 200,
|
||||||
|
sdlMixer201 = 201,
|
||||||
|
sdlMixer202 = 202,
|
||||||
|
}
|
||||||
|
|
||||||
|
enum ubyte SDL_MIXER_MAJOR_VERSION = 2;
|
||||||
|
enum ubyte SDL_MIXER_MINOR_VERSION = 0;
|
||||||
|
|
||||||
|
version(SDL_Mixer_202) {
|
||||||
|
enum sdlMixerSupport = SDLMixerSupport.sdlMixer202;
|
||||||
|
enum ubyte SDL_MIXER_PATCHLEVEL = 2;
|
||||||
|
}
|
||||||
|
else version(SDL_Mixer_201) {
|
||||||
|
enum sdlMixerSupport = SDLMixerSupport.sdlMixer201;
|
||||||
|
enum ubyte SDL_MIXER_PATCHLEVEL = 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
enum sdlMixerSupport = SDLMixerSupport.sdlMixer200;
|
||||||
|
enum ubyte SDL_MIXER_PATCHLEVEL = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
alias MIX_MAJOR_VERSION = SDL_MIXER_MAJOR_VERSION;
|
||||||
|
alias MIX_MINOR_VERSION = SDL_MIXER_MINOR_VERSION;
|
||||||
|
alias MIX_PATCH_LEVEL = SDL_MIXER_PATCHLEVEL;
|
||||||
|
|
||||||
|
@nogc nothrow void SDL_MIXER_VERSION(SDL_version* X)
|
||||||
|
{
|
||||||
|
X.major = SDL_MIXER_MAJOR_VERSION;
|
||||||
|
X.minor = SDL_MIXER_MINOR_VERSION;
|
||||||
|
X.patch = SDL_MIXER_PATCHLEVEL;
|
||||||
|
}
|
||||||
|
alias SDL_MIX_VERSION = SDL_MIX_MAXVOLUME;
|
||||||
|
|
||||||
|
// These were implemented in SDL_mixer 2.0.2, but are fine for all versions.
|
||||||
|
enum SDL_MIXER_COMPILEDVERSION = SDL_VERSIONNUM!(SDL_MIXER_MAJOR_VERSION, SDL_MIXER_MINOR_VERSION, SDL_MIXER_PATCHLEVEL);
|
||||||
|
enum SDL_MIXER_VERSION_ATLEAST(ubyte X, ubyte Y, ubyte Z) = SDL_MIXER_COMPILEDVERSION >= SDL_VERSIONNUM!(X, Y, Z);
|
||||||
|
|
||||||
|
static if(sdlMixerSupport >= SDLMixerSupport.sdlMixer202) {
|
||||||
|
enum Mix_InitFlags {
|
||||||
|
MIX_INIT_FLAC = 0x00000001,
|
||||||
|
MIX_INIT_MOD = 0x00000002,
|
||||||
|
MIX_INIT_MP3 = 0x00000008,
|
||||||
|
MIX_INIT_OGG = 0x00000010,
|
||||||
|
MIX_INIT_MID = 0x00000020,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
enum Mix_InitFlags {
|
||||||
|
MIX_INIT_FLAC = 0x00000001,
|
||||||
|
MIX_INIT_MOD = 0x00000002,
|
||||||
|
MIX_INIT_MODPLUG = 0x00000004,
|
||||||
|
MIX_INIT_MP3 = 0x00000008,
|
||||||
|
MIX_INIT_OGG = 0x00000010,
|
||||||
|
MIX_INIT_FLUIDSYNTH = 0x00000020,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mixin(expandEnum!Mix_InitFlags);
|
||||||
|
|
||||||
|
enum {
|
||||||
|
MIX_CHANNELS = 8,
|
||||||
|
MIX_DEFAULT_FREQUENCY = 22050,
|
||||||
|
MIX_DEFAULT_CHANNELS = 2,
|
||||||
|
MIX_MAX_VOLUME = 128,
|
||||||
|
MIX_CHANNEL_POST = -2,
|
||||||
|
}
|
||||||
|
|
||||||
|
version(LittleEndian) {
|
||||||
|
enum MIX_DEFAULT_FORMAT = AUDIO_S16LSB;
|
||||||
|
} else {
|
||||||
|
enum MIX_DEFAULT_FORMAT = AUDIO_S16MSB;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Mix_Chunk {
|
||||||
|
int allocated;
|
||||||
|
ubyte* abuf;
|
||||||
|
uint alen;
|
||||||
|
ubyte volume;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Mix_Fading {
|
||||||
|
MIX_NO_FADING,
|
||||||
|
MIX_FADING_OUT,
|
||||||
|
MIX_FADING_IN
|
||||||
|
}
|
||||||
|
mixin(expandEnum!Mix_Fading);
|
||||||
|
|
||||||
|
static if(sdlMixerSupport >= SDLMixerSupport.sdlMixer202) {
|
||||||
|
enum Mix_MusicType {
|
||||||
|
MUS_NONE,
|
||||||
|
MUS_CMD,
|
||||||
|
MUS_WAV,
|
||||||
|
MUS_MOD,
|
||||||
|
MUS_MID,
|
||||||
|
MUS_OGG,
|
||||||
|
MUS_MP3,
|
||||||
|
MUS_MP3_MAD_UNUSED,
|
||||||
|
MUS_FLAC,
|
||||||
|
MUS_MODPLUG_UNUSED,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
enum Mix_MusicType {
|
||||||
|
MUS_NONE,
|
||||||
|
MUS_CMD,
|
||||||
|
MUS_WAV,
|
||||||
|
MUS_MOD,
|
||||||
|
MUS_MID,
|
||||||
|
MUS_OGG,
|
||||||
|
MUS_MP3,
|
||||||
|
MUS_MP3_MAD,
|
||||||
|
MUS_FLAC,
|
||||||
|
MUS_MODPLUG,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mixin(expandEnum!Mix_MusicType);
|
||||||
|
|
||||||
|
struct Mix_Music;
|
||||||
|
enum MIX_EFFECTSMAXSPEED = "MIX_EFFECTSMAXSPEED";
|
||||||
|
|
||||||
|
extern(C) nothrow {
|
||||||
|
alias Mix_EffectFunc_t = void function(int,void*,int,void*);
|
||||||
|
alias Mix_EffectDone_t = void function(int,void*);
|
||||||
|
|
||||||
|
// These aren't in SDL_mixer.h and are just here as a convenient and
|
||||||
|
// visible means to add the proper attributes these callbacks.
|
||||||
|
alias callbackI = void function(int);
|
||||||
|
alias callbackVUi8I = void function(void*,ubyte*,int);
|
||||||
|
alias callbackN = void function();
|
||||||
|
}
|
||||||
|
|
||||||
|
@nogc nothrow {
|
||||||
|
Mix_Chunk* Mix_LoadWAV(const(char)* file) {
|
||||||
|
pragma(inline, true);
|
||||||
|
return Mix_LoadWAV_RW(SDL_RWFromFile(file,"rb"),1);
|
||||||
|
}
|
||||||
|
|
||||||
|
int Mix_PlayChannel(int channel,Mix_Chunk* chunk,int loops) {
|
||||||
|
pragma(inline, true);
|
||||||
|
return Mix_PlayChannelTimed(channel,chunk,loops,-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
int Mix_FadeInChannel(int channel,Mix_Chunk* chunk,int loops,int ms) {
|
||||||
|
pragma(inline, true);
|
||||||
|
return Mix_FadeInChannelTimed(channel,chunk,loops,ms,-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
const(SDL_version)* Mix_Linked_Version();
|
||||||
|
int Mix_Init(int);
|
||||||
|
void Mix_Quit();
|
||||||
|
int Mix_OpenAudio(int,ushort,int,int);
|
||||||
|
int Mix_AllocateChannels(int);
|
||||||
|
int Mix_QuerySpec(int*,ushort*,int*);
|
||||||
|
Mix_Chunk* Mix_LoadWAV_RW(SDL_RWops*,int);
|
||||||
|
Mix_Music* Mix_LoadMUS(const(char)*);
|
||||||
|
Mix_Music* Mix_LoadMUS_RW(SDL_RWops*,int);
|
||||||
|
Mix_Music* Mix_LoadMUSType_RW(SDL_RWops*,Mix_MusicType,int);
|
||||||
|
Mix_Chunk* Mix_QuickLoad_WAV(ubyte*);
|
||||||
|
Mix_Chunk* Mix_QuickLoad_RAW(ubyte*,uint);
|
||||||
|
void Mix_FreeChunk(Mix_Chunk*);
|
||||||
|
void Mix_FreeMusic(Mix_Music*);
|
||||||
|
int Mix_GetNumChunkDecoders();
|
||||||
|
const(char)* Mix_GetChunkDecoder(int);
|
||||||
|
int Mix_GetNumMusicDecoders();
|
||||||
|
const(char)* Mix_GetMusicDecoder(int);
|
||||||
|
Mix_MusicType Mix_GetMusicType(const(Mix_Music)*);
|
||||||
|
void Mix_SetPostMix(callbackVUi8I,void*);
|
||||||
|
void Mix_HookMusic(callbackVUi8I,void*);
|
||||||
|
void Mix_HookMusicFinished(callbackN);
|
||||||
|
void* Mix_GetMusicHookData();
|
||||||
|
void Mix_ChannelFinished(callbackI);
|
||||||
|
int Mix_RegisterEffect(int,Mix_EffectFunc_t,Mix_EffectDone_t,void*);
|
||||||
|
int Mix_UnregisterEffect(int,Mix_EffectFunc_t);
|
||||||
|
int Mix_UnregisterAllEffects(int);
|
||||||
|
int Mix_SetPanning(int,ubyte,ubyte);
|
||||||
|
int Mix_SetPosition(int,short,ubyte);
|
||||||
|
int Mix_SetDistance(int,ubyte);
|
||||||
|
int Mix_SetReverseStereo(int,int);
|
||||||
|
int Mix_ReserveChannels(int);
|
||||||
|
int Mix_GroupChannel(int,int);
|
||||||
|
int Mix_GroupChannels(int,int,int);
|
||||||
|
int Mix_GroupAvailable(int);
|
||||||
|
int Mix_GroupCount(int);
|
||||||
|
int Mix_GroupOldest(int);
|
||||||
|
int Mix_GroupNewer(int);
|
||||||
|
int Mix_PlayChannelTimed(int,Mix_Chunk*,int,int);
|
||||||
|
int Mix_PlayMusic(Mix_Music*,int);
|
||||||
|
int Mix_FadeInMusic(Mix_Music*,int,int);
|
||||||
|
int Mix_FadeInMusicPos(Mix_Music*,int,int,double);
|
||||||
|
int Mix_FadeInChannelTimed(int,Mix_Chunk*,int,int,int);
|
||||||
|
int Mix_Volume(int,int);
|
||||||
|
int Mix_VolumeChunk(Mix_Chunk*,int);
|
||||||
|
int Mix_VolumeMusic(int);
|
||||||
|
int Mix_HaltChannel(int);
|
||||||
|
int Mix_HaltGroup(int);
|
||||||
|
int Mix_HaltMusic();
|
||||||
|
int Mix_ExpireChannel(int,int);
|
||||||
|
int Mix_FadeOutChannel(int,int);
|
||||||
|
int Mix_FadeOutGroup(int,int);
|
||||||
|
int Mix_FadeOutMusic(int);
|
||||||
|
Mix_Fading Mix_FadingMusic();
|
||||||
|
Mix_Fading Mix_FadingChannel(int);
|
||||||
|
void Mix_Pause(int);
|
||||||
|
void Mix_Resume(int);
|
||||||
|
int Mix_Paused(int);
|
||||||
|
void Mix_PauseMusic();
|
||||||
|
void Mix_ResumeMusic();
|
||||||
|
void Mix_RewindMusic();
|
||||||
|
int Mix_PausedMusic();
|
||||||
|
int Mix_SetMusicPosition(double);
|
||||||
|
int Mix_Playing(int);
|
||||||
|
int Mix_PlayingMusic();
|
||||||
|
int Mix_SetMusicCMD(in char*);
|
||||||
|
int Mix_SetSynchroValue(int);
|
||||||
|
int Mix_GetSynchroValue();
|
||||||
|
Mix_Chunk* Mix_GetChunk(int);
|
||||||
|
void Mix_CloseAudio();
|
||||||
|
|
||||||
|
static if(sdlMixerSupport >= SDLMixerSupport.sdlMixer202) {
|
||||||
|
int Mix_OpenAudioDevice(int,ushort,int,int,const(char)*,int);
|
||||||
|
SDL_bool Mix_HasChunkDecoder(const(char)*);
|
||||||
|
|
||||||
|
// Declared in SDL_mixer.h, but not implemented
|
||||||
|
// SDL_bool Mix_HasMusicDecoder(const(char)*);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
import bindbc.loader;
|
||||||
|
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pMix_Linked_Version = const(SDL_version)* function();
|
||||||
|
alias pMix_Init = int function(int);
|
||||||
|
alias pMix_Quit = void function();
|
||||||
|
alias pMix_OpenAudio = int function(int,ushort,int,int);
|
||||||
|
alias pMix_AllocateChannels = int function(int);
|
||||||
|
alias pMix_QuerySpec = int function(int*,ushort*,int*);
|
||||||
|
alias pMix_LoadWAV_RW = Mix_Chunk* function(SDL_RWops*,int);
|
||||||
|
alias pMix_LoadMUS = Mix_Music* function(const(char)*);
|
||||||
|
alias pMix_LoadMUS_RW = Mix_Music* function(SDL_RWops*,int);
|
||||||
|
alias pMix_LoadMUSType_RW = Mix_Music* function(SDL_RWops*,Mix_MusicType,int);
|
||||||
|
alias pMix_QuickLoad_WAV = Mix_Chunk* function(ubyte*);
|
||||||
|
alias pMix_QuickLoad_RAW = Mix_Chunk* function(ubyte*,uint);
|
||||||
|
alias pMix_FreeChunk = void function(Mix_Chunk*);
|
||||||
|
alias pMix_FreeMusic = void function(Mix_Music*);
|
||||||
|
alias pMix_GetNumChunkDecoders = int function();
|
||||||
|
alias pMix_GetChunkDecoder = const(char)* function(int);
|
||||||
|
alias pMix_GetNumMusicDecoders = int function();
|
||||||
|
alias pMix_GetMusicDecoder = const(char)* function(int);
|
||||||
|
alias pMix_GetMusicType = Mix_MusicType function(const(Mix_Music)*);
|
||||||
|
alias pMix_SetPostMix = void function(callbackVUi8I,void*);
|
||||||
|
alias pMix_HookMusic = void function(callbackVUi8I,void*);
|
||||||
|
alias pMix_HookMusicFinished = void function(callbackN);
|
||||||
|
alias pMix_GetMusicHookData = void* function();
|
||||||
|
alias pMix_ChannelFinished = void function(callbackI);
|
||||||
|
alias pMix_RegisterEffect = int function(int,Mix_EffectFunc_t,Mix_EffectDone_t,void*);
|
||||||
|
alias pMix_UnregisterEffect = int function(int,Mix_EffectFunc_t);
|
||||||
|
alias pMix_UnregisterAllEffects = int function(int);
|
||||||
|
alias pMix_SetPanning = int function(int,ubyte,ubyte);
|
||||||
|
alias pMix_SetPosition = int function(int,short,ubyte);
|
||||||
|
alias pMix_SetDistance = int function(int,ubyte);
|
||||||
|
alias pMix_SetReverseStereo = int function(int,int);
|
||||||
|
alias pMix_ReserveChannels = int function(int);
|
||||||
|
alias pMix_GroupChannel = int function(int,int);
|
||||||
|
alias pMix_GroupChannels = int function(int,int,int);
|
||||||
|
alias pMix_GroupAvailable = int function(int);
|
||||||
|
alias pMix_GroupCount = int function(int);
|
||||||
|
alias pMix_GroupOldest = int function(int);
|
||||||
|
alias pMix_GroupNewer = int function(int);
|
||||||
|
alias pMix_PlayChannelTimed = int function(int,Mix_Chunk*,int,int);
|
||||||
|
alias pMix_PlayMusic = int function(Mix_Music*,int);
|
||||||
|
alias pMix_FadeInMusic = int function(Mix_Music*,int,int);
|
||||||
|
alias pMix_FadeInMusicPos = int function(Mix_Music*,int,int,double);
|
||||||
|
alias pMix_FadeInChannelTimed = int function(int,Mix_Chunk*,int,int,int);
|
||||||
|
alias pMix_Volume = int function(int,int);
|
||||||
|
alias pMix_VolumeChunk = int function(Mix_Chunk*,int);
|
||||||
|
alias pMix_VolumeMusic = int function(int);
|
||||||
|
alias pMix_HaltChannel = int function(int);
|
||||||
|
alias pMix_HaltGroup = int function(int);
|
||||||
|
alias pMix_HaltMusic = int function();
|
||||||
|
alias pMix_ExpireChannel = int function(int,int);
|
||||||
|
alias pMix_FadeOutChannel = int function(int,int);
|
||||||
|
alias pMix_FadeOutGroup = int function(int,int);
|
||||||
|
alias pMix_FadeOutMusic = int function(int);
|
||||||
|
alias pMix_FadingMusic = Mix_Fading function();
|
||||||
|
alias pMix_FadingChannel = Mix_Fading function(int);
|
||||||
|
alias pMix_Pause = void function(int);
|
||||||
|
alias pMix_Resume = void function(int);
|
||||||
|
alias pMix_Paused = int function(int);
|
||||||
|
alias pMix_PauseMusic = void function();
|
||||||
|
alias pMix_ResumeMusic = void function();
|
||||||
|
alias pMix_RewindMusic = void function();
|
||||||
|
alias pMix_PausedMusic = int function();
|
||||||
|
alias pMix_SetMusicPosition = int function(double);
|
||||||
|
alias pMix_Playing = int function(int);
|
||||||
|
alias pMix_PlayingMusic = int function();
|
||||||
|
alias pMix_SetMusicCMD = int function(in char*);
|
||||||
|
alias pMix_SetSynchroValue = int function(int);
|
||||||
|
alias pMix_GetSynchroValue = int function();
|
||||||
|
alias pMix_GetChunk = Mix_Chunk* function(int);
|
||||||
|
alias pMix_CloseAudio = void function();
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pMix_Linked_Version Mix_Linked_Version;
|
||||||
|
pMix_Init Mix_Init;
|
||||||
|
pMix_Quit Mix_Quit;
|
||||||
|
pMix_OpenAudio Mix_OpenAudio;
|
||||||
|
pMix_AllocateChannels Mix_AllocateChannels;
|
||||||
|
pMix_QuerySpec Mix_QuerySpec;
|
||||||
|
pMix_LoadWAV_RW Mix_LoadWAV_RW;
|
||||||
|
pMix_LoadMUS Mix_LoadMUS;
|
||||||
|
pMix_LoadMUS_RW Mix_LoadMUS_RW;
|
||||||
|
pMix_LoadMUSType_RW Mix_LoadMUSType_RW;
|
||||||
|
pMix_QuickLoad_WAV Mix_QuickLoad_WAV;
|
||||||
|
pMix_QuickLoad_RAW Mix_QuickLoad_RAW;
|
||||||
|
pMix_FreeChunk Mix_FreeChunk;
|
||||||
|
pMix_FreeMusic Mix_FreeMusic;
|
||||||
|
pMix_GetNumChunkDecoders Mix_GetNumChunkDecoders;
|
||||||
|
pMix_GetChunkDecoder Mix_GetChunkDecoder;
|
||||||
|
pMix_GetNumMusicDecoders Mix_GetNumMusicDecoders;
|
||||||
|
pMix_GetMusicDecoder Mix_GetMusicDecoder;
|
||||||
|
pMix_GetMusicType Mix_GetMusicType;
|
||||||
|
pMix_SetPostMix Mix_SetPostMix;
|
||||||
|
pMix_HookMusic Mix_HookMusic;
|
||||||
|
pMix_HookMusicFinished Mix_HookMusicFinished;
|
||||||
|
pMix_GetMusicHookData Mix_GetMusicHookData;
|
||||||
|
pMix_ChannelFinished Mix_ChannelFinished;
|
||||||
|
pMix_RegisterEffect Mix_RegisterEffect;
|
||||||
|
pMix_UnregisterEffect Mix_UnregisterEffect;
|
||||||
|
pMix_UnregisterAllEffects Mix_UnregisterAllEffects;
|
||||||
|
pMix_SetPanning Mix_SetPanning;
|
||||||
|
pMix_SetPosition Mix_SetPosition;
|
||||||
|
pMix_SetDistance Mix_SetDistance;
|
||||||
|
pMix_SetReverseStereo Mix_SetReverseStereo;
|
||||||
|
pMix_ReserveChannels Mix_ReserveChannels;
|
||||||
|
pMix_GroupChannel Mix_GroupChannel;
|
||||||
|
pMix_GroupChannels Mix_GroupChannels;
|
||||||
|
pMix_GroupAvailable Mix_GroupAvailable;
|
||||||
|
pMix_GroupCount Mix_GroupCount;
|
||||||
|
pMix_GroupOldest Mix_GroupOldest;
|
||||||
|
pMix_GroupNewer Mix_GroupNewer;
|
||||||
|
pMix_PlayChannelTimed Mix_PlayChannelTimed;
|
||||||
|
pMix_PlayMusic Mix_PlayMusic;
|
||||||
|
pMix_FadeInMusic Mix_FadeInMusic;
|
||||||
|
pMix_FadeInMusicPos Mix_FadeInMusicPos;
|
||||||
|
pMix_FadeInChannelTimed Mix_FadeInChannelTimed;
|
||||||
|
pMix_Volume Mix_Volume;
|
||||||
|
pMix_VolumeChunk Mix_VolumeChunk;
|
||||||
|
pMix_VolumeMusic Mix_VolumeMusic;
|
||||||
|
pMix_HaltChannel Mix_HaltChannel;
|
||||||
|
pMix_HaltGroup Mix_HaltGroup;
|
||||||
|
pMix_HaltMusic Mix_HaltMusic;
|
||||||
|
pMix_ExpireChannel Mix_ExpireChannel;
|
||||||
|
pMix_FadeOutChannel Mix_FadeOutChannel;
|
||||||
|
pMix_FadeOutGroup Mix_FadeOutGroup;
|
||||||
|
pMix_FadeOutMusic Mix_FadeOutMusic;
|
||||||
|
pMix_FadingMusic Mix_FadingMusic;
|
||||||
|
pMix_FadingChannel Mix_FadingChannel;
|
||||||
|
pMix_Pause Mix_Pause;
|
||||||
|
pMix_Resume Mix_Resume;
|
||||||
|
pMix_Paused Mix_Paused;
|
||||||
|
pMix_PauseMusic Mix_PauseMusic;
|
||||||
|
pMix_ResumeMusic Mix_ResumeMusic;
|
||||||
|
pMix_RewindMusic Mix_RewindMusic;
|
||||||
|
pMix_PausedMusic Mix_PausedMusic;
|
||||||
|
pMix_SetMusicPosition Mix_SetMusicPosition;
|
||||||
|
pMix_Playing Mix_Playing;
|
||||||
|
pMix_PlayingMusic Mix_PlayingMusic;
|
||||||
|
pMix_SetMusicCMD Mix_SetMusicCMD;
|
||||||
|
pMix_SetSynchroValue Mix_SetSynchroValue;
|
||||||
|
pMix_GetSynchroValue Mix_GetSynchroValue;
|
||||||
|
pMix_GetChunk Mix_GetChunk;
|
||||||
|
pMix_CloseAudio Mix_CloseAudio;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static if(sdlMixerSupport >= SDLMixerSupport.sdlMixer202) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pMix_OpenAudioDevice = int function(int,ushort,int,int,const(char)*,int);
|
||||||
|
alias pMix_HasChunkDecoder = SDL_bool function(const(char)*);
|
||||||
|
|
||||||
|
// Declared in SDL_mixer.h, but not implemented
|
||||||
|
//alias pMix_HasMusicDecoder = SDL_bool function(const(char)*);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pMix_OpenAudioDevice Mix_OpenAudioDevice;
|
||||||
|
pMix_HasChunkDecoder Mix_HasChunkDecoder;
|
||||||
|
//pMix_HasMusicDecoder Mix_HasMusicDecoder;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private {
|
||||||
|
SharedLib lib;
|
||||||
|
SDLMixerSupport loadedVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
void unloadSDLMixer()
|
||||||
|
{
|
||||||
|
if(lib != invalidHandle) {
|
||||||
|
lib.unload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SDLMixerSupport loadedSDLMixerVersion() { return loadedVersion; }
|
||||||
|
|
||||||
|
bool isSDLMixerLoaded()
|
||||||
|
{
|
||||||
|
return lib != invalidHandle;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SDLMixerSupport loadSDLMixer()
|
||||||
|
{
|
||||||
|
version(Windows) {
|
||||||
|
const(char)[][1] libNames = ["SDL2_mixer.dll"];
|
||||||
|
}
|
||||||
|
else version(OSX) {
|
||||||
|
const(char)[][6] libNames = [
|
||||||
|
"libSDL2_mixer.dylib",
|
||||||
|
"/usr/local/lib/libSDL2_mixer.dylib",
|
||||||
|
"../Frameworks/SDL2_mixer.framework/SDL2_mixer",
|
||||||
|
"/Library/Frameworks/SDL2_mixer.framework/SDL2_mixer",
|
||||||
|
"/System/Library/Frameworks/SDL2_mixer.framework/SDL2_mixer",
|
||||||
|
"/opt/local/lib/libSDL2_mixer.dylib"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
else version(Posix) {
|
||||||
|
const(char)[][6] libNames = [
|
||||||
|
"libSDL2_mixer.so",
|
||||||
|
"/usr/local/lib/libSDL2_mixer.so",
|
||||||
|
"libSDL2-2.0_mixer.so",
|
||||||
|
"/usr/local/lib/libSDL2-2.0_mixer.so",
|
||||||
|
"libSDL2-2.0_mixer.so.0",
|
||||||
|
"/usr/local/lib/libSDL2-2.0_mixer.so.0"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
else static assert(0, "bindbc-sdl is not yet supported on this platform.");
|
||||||
|
|
||||||
|
SDLMixerSupport ret;
|
||||||
|
foreach(name; libNames) {
|
||||||
|
ret = loadSDLMixer(name.ptr);
|
||||||
|
if(ret != SDLMixerSupport.noLibrary) break;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
SDLMixerSupport loadSDLMixer(const(char)* libName)
|
||||||
|
{
|
||||||
|
lib = load(libName);
|
||||||
|
if(lib == invalidHandle) {
|
||||||
|
return SDLMixerSupport.noLibrary;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto errCount = errorCount();
|
||||||
|
loadedVersion = SDLMixerSupport.badLibrary;
|
||||||
|
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_Linked_Version,"Mix_Linked_Version");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_Init,"Mix_Init");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_Quit,"Mix_Quit");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_OpenAudio,"Mix_OpenAudio");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_AllocateChannels,"Mix_AllocateChannels");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_QuerySpec,"Mix_QuerySpec");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_LoadWAV_RW,"Mix_LoadWAV_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_LoadMUS,"Mix_LoadMUS");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_LoadMUS_RW,"Mix_LoadMUS_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_LoadMUSType_RW,"Mix_LoadMUSType_RW");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_QuickLoad_WAV,"Mix_QuickLoad_WAV");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_QuickLoad_RAW,"Mix_QuickLoad_RAW");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_FreeChunk,"Mix_FreeChunk");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_FreeMusic,"Mix_FreeMusic");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_GetNumChunkDecoders,"Mix_GetNumChunkDecoders");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_GetChunkDecoder,"Mix_GetChunkDecoder");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_GetNumMusicDecoders,"Mix_GetNumMusicDecoders");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_GetMusicDecoder,"Mix_GetMusicDecoder");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_GetMusicType,"Mix_GetMusicType");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_SetPostMix,"Mix_SetPostMix");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_HookMusic,"Mix_HookMusic");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_HookMusicFinished,"Mix_HookMusicFinished");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_GetMusicHookData,"Mix_GetMusicHookData");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_ChannelFinished,"Mix_ChannelFinished");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_RegisterEffect,"Mix_RegisterEffect");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_UnregisterEffect,"Mix_UnregisterEffect");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_UnregisterAllEffects,"Mix_UnregisterAllEffects");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_SetPanning,"Mix_SetPanning");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_SetPosition,"Mix_SetPosition");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_SetDistance,"Mix_SetDistance");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_SetReverseStereo,"Mix_SetReverseStereo");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_ReserveChannels,"Mix_ReserveChannels");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_GroupChannel,"Mix_GroupChannel");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_GroupChannels,"Mix_GroupChannels");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_GroupAvailable,"Mix_GroupAvailable");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_GroupCount,"Mix_GroupCount");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_GroupOldest,"Mix_GroupOldest");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_GroupNewer,"Mix_GroupNewer");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_PlayChannelTimed,"Mix_PlayChannelTimed");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_PlayMusic,"Mix_PlayMusic");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_FadeInMusic,"Mix_FadeInMusic");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_FadeInMusicPos,"Mix_FadeInMusicPos");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_FadeInChannelTimed,"Mix_FadeInChannelTimed");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_Volume,"Mix_Volume");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_VolumeChunk,"Mix_VolumeChunk");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_VolumeMusic,"Mix_VolumeMusic");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_HaltChannel,"Mix_HaltChannel");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_HaltGroup,"Mix_HaltGroup");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_HaltMusic,"Mix_HaltMusic");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_ExpireChannel,"Mix_ExpireChannel");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_FadeOutChannel,"Mix_FadeOutChannel");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_FadeOutGroup,"Mix_FadeOutGroup");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_FadeOutMusic,"Mix_FadeOutMusic");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_FadingMusic,"Mix_FadingMusic");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_FadingChannel,"Mix_FadingChannel");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_Pause,"Mix_Pause");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_Resume,"Mix_Resume");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_Paused,"Mix_Paused");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_PauseMusic,"Mix_PauseMusic");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_ResumeMusic,"Mix_ResumeMusic");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_RewindMusic,"Mix_RewindMusic");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_PausedMusic,"Mix_PausedMusic");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_SetMusicPosition,"Mix_SetMusicPosition");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_Playing,"Mix_Playing");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_PlayingMusic,"Mix_PlayingMusic");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_SetMusicCMD,"Mix_SetMusicCMD");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_SetSynchroValue,"Mix_SetSynchroValue");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_GetSynchroValue,"Mix_GetSynchroValue");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_GetChunk,"Mix_GetChunk");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_CloseAudio,"Mix_CloseAudio");
|
||||||
|
|
||||||
|
if(errorCount() != errCount) return SDLMixerSupport.badLibrary;
|
||||||
|
else loadedVersion = SDLMixerSupport.sdlMixer200;
|
||||||
|
|
||||||
|
static if(sdlMixerSupport >= SDLMixerSupport.sdlMixer202) {
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_OpenAudioDevice,"Mix_OpenAudioDevice");
|
||||||
|
lib.bindSymbol(cast(void**)&Mix_HasChunkDecoder,"Mix_HasChunkDecoder");
|
||||||
|
|
||||||
|
if(errorCount() != errCount) return SDLMixerSupport.badLibrary;
|
||||||
|
else loadedVersion = SDLMixerSupport.sdlMixer202;
|
||||||
|
}
|
||||||
|
|
||||||
|
return loadedVersion;
|
||||||
|
}
|
||||||
|
}
|
||||||
18
demos/external/wasm_imports/bindbc/sdl/package.d
vendored
Normal file
18
demos/external/wasm_imports/bindbc/sdl/package.d
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl;
|
||||||
|
|
||||||
|
public import bindbc.sdl.config,
|
||||||
|
bindbc.sdl.bind;
|
||||||
|
|
||||||
|
version(BindSDL_Static) {}
|
||||||
|
else public import bindbc.sdl.dynload;
|
||||||
|
|
||||||
|
version(BindSDL_Image) public import bindbc.sdl.image;
|
||||||
|
version(BindSDL_Mixer) public import bindbc.sdl.mixer;
|
||||||
|
version(BindSDL_TTF) public import bindbc.sdl.ttf;
|
||||||
|
|
||||||
368
demos/external/wasm_imports/bindbc/sdl/ttf.d
vendored
Normal file
368
demos/external/wasm_imports/bindbc/sdl/ttf.d
vendored
Normal file
|
|
@ -0,0 +1,368 @@
|
||||||
|
|
||||||
|
// Copyright Michael D. Parker 2018.
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
module bindbc.sdl.ttf;
|
||||||
|
|
||||||
|
version(BindSDL_TTF):
|
||||||
|
|
||||||
|
import core.stdc.config;
|
||||||
|
import bindbc.sdl.bind.sdlerror : SDL_GetError, SDL_SetError;
|
||||||
|
import bindbc.sdl.bind.sdlpixels : SDL_Color;
|
||||||
|
import bindbc.sdl.bind.sdlrwops : SDL_RWops;
|
||||||
|
import bindbc.sdl.bind.sdlsurface : SDL_Surface;
|
||||||
|
import bindbc.sdl.bind.sdlversion : SDL_version;
|
||||||
|
|
||||||
|
alias TTF_SetError = SDL_SetError;
|
||||||
|
alias TTF_GetError = SDL_GetError;
|
||||||
|
|
||||||
|
enum SDLTTFSupport {
|
||||||
|
noLibrary,
|
||||||
|
badLibrary,
|
||||||
|
sdlTTF2012 = 2012,
|
||||||
|
sdlTTF2013 = 2013,
|
||||||
|
sdlTTF2014 = 2014,
|
||||||
|
}
|
||||||
|
|
||||||
|
enum ubyte SDL_TTF_MAJOR_VERSION = 2;
|
||||||
|
enum ubyte SDL_TTF_MINOR_VERSION = 0;
|
||||||
|
|
||||||
|
version(SDL_TTF_2014) {
|
||||||
|
enum sdlTTFSupport = SDLTTFSupport.sdlTTF2014;
|
||||||
|
enum ubyte SDL_TTF_PATCHLEVEL = 14;
|
||||||
|
}
|
||||||
|
else version(SDL_TTF_2013) {
|
||||||
|
enum sdlTTFSupport = SDLTTFSupport.sdlTTF2013;
|
||||||
|
enum ubyte SDL_TTF_PATCHLEVEL = 13;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
enum sdlTTFSupport = SDLTTFSupport.sdlTTF2012;
|
||||||
|
enum ubyte SDL_TTF_PATCHLEVEL = 12;
|
||||||
|
}
|
||||||
|
|
||||||
|
alias TTF_MAJOR_VERSION = SDL_TTF_MAJOR_VERSION;
|
||||||
|
alias TTF_MINOR_VERSION = SDL_TTF_MINOR_VERSION;
|
||||||
|
alias TTF_PATCHLEVEL = SDL_TTF_PATCHLEVEL;
|
||||||
|
|
||||||
|
@nogc nothrow
|
||||||
|
void SDL_TTF_VERSION(SDL_version* X) {
|
||||||
|
X.major = SDL_TTF_MAJOR_VERSION;
|
||||||
|
X.minor = SDL_TTF_MINOR_VERSION;
|
||||||
|
X.patch = SDL_TTF_PATCHLEVEL;
|
||||||
|
}
|
||||||
|
alias TTF_VERSION = SDL_TTF_VERSION;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
UNICODE_BOM_NATIVE = 0xFEFF,
|
||||||
|
UNICODE_BOM_SWAPPED = 0xFFFE,
|
||||||
|
TTF_STYLE_NORMAL = 0x00,
|
||||||
|
TTF_STYLE_BOLD = 0x01,
|
||||||
|
TTF_STYLE_ITALIC = 0x02,
|
||||||
|
TTF_STYLE_UNDERLINE = 0x04,
|
||||||
|
TTF_STYLE_STRIKETHROUGH = 0x08,
|
||||||
|
}
|
||||||
|
|
||||||
|
enum {
|
||||||
|
TTF_HINTING_NORMAL = 0,
|
||||||
|
TTF_HINTING_LIGHT = 1,
|
||||||
|
TTF_HINTING_MONO = 2,
|
||||||
|
TTF_HINTING_NONE = 3,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct TTF_Font;
|
||||||
|
|
||||||
|
version(BindSDL_Static) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
SDL_version* TTF_Linked_Version();
|
||||||
|
void TTF_ByteSwappedUNICODE(int);
|
||||||
|
int TTF_Init();
|
||||||
|
TTF_Font * TTF_OpenFont(const(char)*,int);
|
||||||
|
TTF_Font * TTF_OpenFontIndex(const(char)*,int,c_long );
|
||||||
|
TTF_Font * TTF_OpenFontRW(SDL_RWops*,int,int);
|
||||||
|
TTF_Font * TTF_OpenFontIndexRW(SDL_RWops*,int,int,c_long);
|
||||||
|
int TTF_GetFontStyle(const(TTF_Font)*);
|
||||||
|
void TTF_SetFontStyle(const(TTF_Font)*,int style);
|
||||||
|
int TTF_GetFontOutline(const(TTF_Font)*);
|
||||||
|
void TTF_SetFontOutline(TTF_Font*,int);
|
||||||
|
int TTF_GetFontHinting(const(TTF_Font)*);
|
||||||
|
void TTF_SetFontHinting(TTF_Font*,int);
|
||||||
|
int TTF_FontHeight(const(TTF_Font)*);
|
||||||
|
int TTF_FontAscent(const(TTF_Font)*);
|
||||||
|
int TTF_FontDescent(const(TTF_Font)*);
|
||||||
|
int TTF_FontLineSkip(const(TTF_Font)*);
|
||||||
|
int TTF_GetFontKerning(const(TTF_Font)*);
|
||||||
|
void TTF_SetFontKerning(TTF_Font*,int);
|
||||||
|
int TTF_FontFaces(const(TTF_Font)*);
|
||||||
|
int TTF_FontFaceIsFixedWidth(const(TTF_Font)*);
|
||||||
|
char* TTF_FontFaceFamilyName(const(TTF_Font)*);
|
||||||
|
char* TTF_FontFaceStyleName(const(TTF_Font)*);
|
||||||
|
int TTF_GlyphIsProvided(const(TTF_Font)*,ushort);
|
||||||
|
int TTF_GlyphMetrics(TTF_Font*,ushort,int*,int*,int*,int*,int*);
|
||||||
|
int TTF_SizeText(TTF_Font*,const(char)*,int*,int*);
|
||||||
|
int TTF_SizeUTF8(TTF_Font*,const(char)*,int*,int*);
|
||||||
|
int TTF_SizeUNICODE(TTF_Font*,ushort*,int*,int*);
|
||||||
|
SDL_Surface* TTF_RenderText_Solid(TTF_Font*,const(char)*,SDL_Color);
|
||||||
|
SDL_Surface* TTF_RenderUTF8_Solid(TTF_Font*,const(char)*,SDL_Color);
|
||||||
|
SDL_Surface* TTF_RenderUNICODE_Solid(TTF_Font*,const(ushort)*,SDL_Color);
|
||||||
|
SDL_Surface* TTF_RenderGlyph_Solid(TTF_Font*,ushort,SDL_Color);
|
||||||
|
SDL_Surface* TTF_RenderText_Shaded(TTF_Font*,const(char)*,SDL_Color,SDL_Color);
|
||||||
|
SDL_Surface* TTF_RenderUTF8_Shaded(TTF_Font*,const(char)*,SDL_Color,SDL_Color);
|
||||||
|
SDL_Surface* TTF_RenderUNICODE_Shaded(TTF_Font*,const(ushort)*,SDL_Color,SDL_Color);
|
||||||
|
SDL_Surface* TTF_RenderGlyph_Shaded(TTF_Font*,ushort,SDL_Color,SDL_Color);
|
||||||
|
SDL_Surface* TTF_RenderText_Blended(TTF_Font*,const(char)*,SDL_Color);
|
||||||
|
SDL_Surface* TTF_RenderUTF8_Blended(TTF_Font*,const(char)*,SDL_Color);
|
||||||
|
SDL_Surface* TTF_RenderUNICODE_Blended(TTF_Font*,const(ushort)*,SDL_Color);
|
||||||
|
SDL_Surface* TTF_RenderText_Blended_Wrapped(TTF_Font*,const(char)*,SDL_Color,uint);
|
||||||
|
SDL_Surface* TTF_RenderUTF8_Blended_Wrapped(TTF_Font*,const(char)*,SDL_Color,uint);
|
||||||
|
SDL_Surface* TTF_RenderUNICODE_Blended_Wrapped(TTF_Font*,const(ushort)*,SDL_Color,uint);
|
||||||
|
SDL_Surface* TTF_RenderGlyph_Blended(TTF_Font*,ushort,SDL_Color);
|
||||||
|
void TTF_CloseFont(TTF_Font*);
|
||||||
|
void TTF_Quit();
|
||||||
|
int TTF_WasInit();
|
||||||
|
int TTF_GetFontKerningSize(TTF_Font*,int,int);
|
||||||
|
|
||||||
|
static if(sdlTTFSupport >= SDLTTFSupport.sdlTTF2014) {
|
||||||
|
int TTF_GetFontKerningSizeGlyphs(TTF_Font*,ushort,ushort);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
import bindbc.loader;
|
||||||
|
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pTTF_Linked_Version = SDL_version* function();
|
||||||
|
alias pTTF_ByteSwappedUNICODE = void function(int);
|
||||||
|
alias pTTF_Init = int function();
|
||||||
|
alias pTTF_OpenFont = TTF_Font * function(const(char)*,int);
|
||||||
|
alias pTTF_OpenFontIndex = TTF_Font * function(const(char)*,int,c_long );
|
||||||
|
alias pTTF_OpenFontRW = TTF_Font * function(SDL_RWops*,int,int);
|
||||||
|
alias pTTF_OpenFontIndexRW = TTF_Font * function(SDL_RWops*,int,int,c_long);
|
||||||
|
alias pTTF_GetFontStyle = int function(const(TTF_Font)*);
|
||||||
|
alias pTTF_SetFontStyle = void function(const(TTF_Font)*,int style);
|
||||||
|
alias pTTF_GetFontOutline = int function(const(TTF_Font)*);
|
||||||
|
alias pTTF_SetFontOutline = void function(TTF_Font*,int);
|
||||||
|
alias pTTF_GetFontHinting = int function(const(TTF_Font)*);
|
||||||
|
alias pTTF_SetFontHinting = void function(TTF_Font*,int);
|
||||||
|
alias pTTF_FontHeight = int function(const(TTF_Font)*);
|
||||||
|
alias pTTF_FontAscent = int function(const(TTF_Font)*);
|
||||||
|
alias pTTF_FontDescent = int function(const(TTF_Font)*);
|
||||||
|
alias pTTF_FontLineSkip = int function(const(TTF_Font)*);
|
||||||
|
alias pTTF_GetFontKerning = int function(const(TTF_Font)*);
|
||||||
|
alias pTTF_SetFontKerning = void function(TTF_Font*,int);
|
||||||
|
alias pTTF_FontFaces = int function(const(TTF_Font)*);
|
||||||
|
alias pTTF_FontFaceIsFixedWidth = int function(const(TTF_Font)*);
|
||||||
|
alias pTTF_FontFaceFamilyName = char* function(const(TTF_Font)*);
|
||||||
|
alias pTTF_FontFaceStyleName = char* function(const(TTF_Font)*);
|
||||||
|
alias pTTF_GlyphIsProvided = int function(const(TTF_Font)*,ushort);
|
||||||
|
alias pTTF_GlyphMetrics = int function(TTF_Font*,ushort,int*,int*,int*,int*,int*);
|
||||||
|
alias pTTF_SizeText = int function(TTF_Font*,const(char)*,int*,int*);
|
||||||
|
alias pTTF_SizeUTF8 = int function(TTF_Font*,const(char)*,int*,int*);
|
||||||
|
alias pTTF_SizeUNICODE = int function(TTF_Font*,ushort*,int*,int*);
|
||||||
|
alias pTTF_RenderText_Solid = SDL_Surface* function(TTF_Font*,const(char)*,SDL_Color);
|
||||||
|
alias pTTF_RenderUTF8_Solid = SDL_Surface* function(TTF_Font*,const(char)*,SDL_Color);
|
||||||
|
alias pTTF_RenderUNICODE_Solid = SDL_Surface* function(TTF_Font*,const(ushort)*,SDL_Color);
|
||||||
|
alias pTTF_RenderGlyph_Solid = SDL_Surface* function(TTF_Font*,ushort,SDL_Color);
|
||||||
|
alias pTTF_RenderText_Shaded = SDL_Surface* function(TTF_Font*,const(char)*,SDL_Color,SDL_Color);
|
||||||
|
alias pTTF_RenderUTF8_Shaded = SDL_Surface* function(TTF_Font*,const(char)*,SDL_Color,SDL_Color);
|
||||||
|
alias pTTF_RenderUNICODE_Shaded = SDL_Surface* function(TTF_Font*,const(ushort)*,SDL_Color,SDL_Color);
|
||||||
|
alias pTTF_RenderGlyph_Shaded = SDL_Surface* function(TTF_Font*,ushort,SDL_Color,SDL_Color);
|
||||||
|
alias pTTF_RenderText_Blended = SDL_Surface* function(TTF_Font*,const(char)*,SDL_Color);
|
||||||
|
alias pTTF_RenderUTF8_Blended = SDL_Surface* function(TTF_Font*,const(char)*,SDL_Color);
|
||||||
|
alias pTTF_RenderUNICODE_Blended = SDL_Surface* function(TTF_Font*,const(ushort)*,SDL_Color);
|
||||||
|
alias pTTF_RenderText_Blended_Wrapped = SDL_Surface* function(TTF_Font*,const(char)*,SDL_Color,uint);
|
||||||
|
alias pTTF_RenderUTF8_Blended_Wrapped = SDL_Surface* function(TTF_Font*,const(char)*,SDL_Color,uint);
|
||||||
|
alias pTTF_RenderUNICODE_Blended_Wrapped = SDL_Surface* function(TTF_Font*,const(ushort)*,SDL_Color,uint);
|
||||||
|
alias pTTF_RenderGlyph_Blended = SDL_Surface* function(TTF_Font*,ushort,SDL_Color);
|
||||||
|
alias pTTF_CloseFont = void function(TTF_Font*);
|
||||||
|
alias pTTF_Quit = void function();
|
||||||
|
alias pTTF_WasInit = int function();
|
||||||
|
alias pTTF_GetFontKerningSize = int function(TTF_Font*,int,int);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pTTF_Linked_Version TTF_Linked_Version;
|
||||||
|
pTTF_ByteSwappedUNICODE TTF_ByteSwappedUNICODE;
|
||||||
|
pTTF_Init TTF_Init;
|
||||||
|
pTTF_OpenFont TTF_OpenFont;
|
||||||
|
pTTF_OpenFontIndex TTF_OpenFontIndex;
|
||||||
|
pTTF_OpenFontRW TTF_OpenFontRW;
|
||||||
|
pTTF_OpenFontIndexRW TTF_OpenFontIndexRW;
|
||||||
|
pTTF_GetFontStyle TTF_GetFontStyle;
|
||||||
|
pTTF_SetFontStyle TTF_SetFontStyle;
|
||||||
|
pTTF_GetFontOutline TTF_GetFontOutline;
|
||||||
|
pTTF_SetFontOutline TTF_SetFontOutline;
|
||||||
|
pTTF_GetFontHinting TTF_GetFontHinting;
|
||||||
|
pTTF_SetFontHinting TTF_SetFontHinting;
|
||||||
|
pTTF_FontHeight TTF_FontHeight;
|
||||||
|
pTTF_FontAscent TTF_FontAscent;
|
||||||
|
pTTF_FontDescent TTF_FontDescent;
|
||||||
|
pTTF_FontLineSkip TTF_FontLineSkip;
|
||||||
|
pTTF_GetFontKerning TTF_GetFontKerning;
|
||||||
|
pTTF_SetFontKerning TTF_SetFontKerning;
|
||||||
|
pTTF_FontFaces TTF_FontFaces;
|
||||||
|
pTTF_FontFaceIsFixedWidth TTF_FontFaceIsFixedWidth;
|
||||||
|
pTTF_FontFaceFamilyName TTF_FontFaceFamilyName;
|
||||||
|
pTTF_FontFaceStyleName TTF_FontFaceStyleName;
|
||||||
|
pTTF_GlyphIsProvided TTF_GlyphIsProvided;
|
||||||
|
pTTF_GlyphMetrics TTF_GlyphMetrics;
|
||||||
|
pTTF_SizeText TTF_SizeText;
|
||||||
|
pTTF_SizeUTF8 TTF_SizeUTF8;
|
||||||
|
pTTF_SizeUNICODE TTF_SizeUNICODE;
|
||||||
|
pTTF_RenderText_Solid TTF_RenderText_Solid;
|
||||||
|
pTTF_RenderUTF8_Solid TTF_RenderUTF8_Solid;
|
||||||
|
pTTF_RenderUNICODE_Solid TTF_RenderUNICODE_Solid;
|
||||||
|
pTTF_RenderGlyph_Solid TTF_RenderGlyph_Solid;
|
||||||
|
pTTF_RenderText_Shaded TTF_RenderText_Shaded;
|
||||||
|
pTTF_RenderUTF8_Shaded TTF_RenderUTF8_Shaded;
|
||||||
|
pTTF_RenderUNICODE_Shaded TTF_RenderUNICODE_Shaded;
|
||||||
|
pTTF_RenderGlyph_Shaded TTF_RenderGlyph_Shaded;
|
||||||
|
pTTF_RenderText_Blended TTF_RenderText_Blended;
|
||||||
|
pTTF_RenderUTF8_Blended TTF_RenderUTF8_Blended;
|
||||||
|
pTTF_RenderUNICODE_Blended TTF_RenderUNICODE_Blended;
|
||||||
|
pTTF_RenderText_Blended_Wrapped TTF_RenderText_Blended_Wrapped;
|
||||||
|
pTTF_RenderUTF8_Blended_Wrapped TTF_RenderUTF8_Blended_Wrapped;
|
||||||
|
pTTF_RenderUNICODE_Blended_Wrapped TTF_RenderUNICODE_Blended_Wrapped;
|
||||||
|
pTTF_RenderGlyph_Blended TTF_RenderGlyph_Blended;
|
||||||
|
pTTF_CloseFont TTF_CloseFont;
|
||||||
|
pTTF_Quit TTF_Quit;
|
||||||
|
pTTF_WasInit TTF_WasInit;
|
||||||
|
pTTF_GetFontKerningSize TTF_GetFontKerningSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
static if(sdlTTFSupport >= SDLTTFSupport.sdlTTF2014) {
|
||||||
|
extern(C) @nogc nothrow {
|
||||||
|
alias pTTF_GetFontKerningSizeGlyphs = int function(TTF_Font*,ushort,ushort);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared {
|
||||||
|
pTTF_GetFontKerningSizeGlyphs TTF_GetFontKerningSizeGlyphs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private {
|
||||||
|
SharedLib lib;
|
||||||
|
SDLTTFSupport loadedVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
void unloadSDLTTF()
|
||||||
|
{
|
||||||
|
if(lib != invalidHandle) {
|
||||||
|
lib.unload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SDLTTFSupport loadedSDLTTFVersion() { return loadedVersion; }
|
||||||
|
|
||||||
|
bool isSDLTTFLoaded()
|
||||||
|
{
|
||||||
|
return lib != invalidHandle;
|
||||||
|
}
|
||||||
|
|
||||||
|
SDLTTFSupport loadSDLTTF()
|
||||||
|
{
|
||||||
|
version(Windows) {
|
||||||
|
const(char)[][1] libNames = ["SDL2_ttf.dll"];
|
||||||
|
}
|
||||||
|
else version(OSX) {
|
||||||
|
const(char)[][6] libNames = [
|
||||||
|
"libSDL2_ttf.dylib",
|
||||||
|
"/usr/local/lib/libSDL2_ttf.dylib",
|
||||||
|
"../Frameworks/SDL2_ttf.framework/SDL2_ttf",
|
||||||
|
"/Library/Frameworks/SDL2_ttf.framework/SDL2_ttf",
|
||||||
|
"/System/Library/Frameworks/SDL2_ttf.framework/SDL2_ttf",
|
||||||
|
"/opt/local/lib/libSDL2_ttf.dylib"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
else version(Posix) {
|
||||||
|
const(char)[][6] libNames = [
|
||||||
|
"libSDL2_ttf.so",
|
||||||
|
"/usr/local/lib/libSDL2_ttf.so",
|
||||||
|
"libSDL2-2.0_ttf.so",
|
||||||
|
"/usr/local/lib/libSDL2-2.0_ttf.so",
|
||||||
|
"libSDL2-2.0_ttf.so.0",
|
||||||
|
"/usr/local/lib/libSDL2-2.0_ttf.so.0"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
else static assert(0, "bindbc-sdl is not yet supported on this platform.");
|
||||||
|
|
||||||
|
SDLTTFSupport ret;
|
||||||
|
foreach(name; libNames) {
|
||||||
|
ret = loadSDLTTF(name.ptr);
|
||||||
|
if(ret != SDLTTFSupport.noLibrary) break;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
SDLTTFSupport loadSDLTTF(const(char)* libName)
|
||||||
|
{
|
||||||
|
lib = load(libName);
|
||||||
|
if(lib == invalidHandle) {
|
||||||
|
return SDLTTFSupport.noLibrary;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto errCount = errorCount();
|
||||||
|
loadedVersion = SDLTTFSupport.badLibrary;
|
||||||
|
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_Linked_Version,"TTF_Linked_Version");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_ByteSwappedUNICODE,"TTF_ByteSwappedUNICODE");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_Init,"TTF_Init");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_OpenFont,"TTF_OpenFont");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_OpenFontIndex,"TTF_OpenFontIndex");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_OpenFontRW,"TTF_OpenFontRW");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_OpenFontIndexRW,"TTF_OpenFontIndexRW");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_GetFontStyle,"TTF_GetFontStyle");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_SetFontStyle,"TTF_SetFontStyle");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_GetFontOutline,"TTF_GetFontOutline");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_SetFontOutline,"TTF_SetFontOutline");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_GetFontHinting,"TTF_GetFontHinting");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_SetFontHinting,"TTF_SetFontHinting");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_FontHeight,"TTF_FontHeight");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_FontAscent,"TTF_FontAscent");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_FontDescent,"TTF_FontDescent");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_FontLineSkip,"TTF_FontLineSkip");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_GetFontKerning,"TTF_GetFontKerning");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_SetFontKerning,"TTF_SetFontKerning");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_FontFaces,"TTF_FontFaces");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_FontFaceIsFixedWidth,"TTF_FontFaceIsFixedWidth");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_FontFaceFamilyName,"TTF_FontFaceFamilyName");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_FontFaceStyleName,"TTF_FontFaceStyleName");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_GlyphIsProvided,"TTF_GlyphIsProvided");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_GlyphMetrics,"TTF_GlyphMetrics");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_SizeText,"TTF_SizeText");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_SizeUTF8,"TTF_SizeUTF8");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_SizeUNICODE,"TTF_SizeUNICODE");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_RenderText_Solid,"TTF_RenderText_Solid");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_RenderUTF8_Solid,"TTF_RenderUTF8_Solid");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_RenderUNICODE_Solid,"TTF_RenderUNICODE_Solid");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_RenderGlyph_Solid,"TTF_RenderGlyph_Solid");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_RenderText_Shaded,"TTF_RenderText_Shaded");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_RenderUTF8_Shaded,"TTF_RenderUTF8_Shaded");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_RenderUNICODE_Shaded,"TTF_RenderUNICODE_Shaded");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_RenderGlyph_Shaded,"TTF_RenderGlyph_Shaded");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_RenderText_Blended,"TTF_RenderText_Blended");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_RenderUTF8_Blended,"TTF_RenderUTF8_Blended");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_RenderUNICODE_Blended,"TTF_RenderUNICODE_Blended");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_RenderText_Blended_Wrapped,"TTF_RenderText_Blended_Wrapped");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_RenderUTF8_Blended_Wrapped,"TTF_RenderUTF8_Blended_Wrapped");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_RenderUNICODE_Blended_Wrapped,"TTF_RenderUNICODE_Blended_Wrapped");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_RenderGlyph_Blended,"TTF_RenderGlyph_Blended");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_CloseFont,"TTF_CloseFont");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_Quit,"TTF_Quit");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_WasInit,"TTF_WasInit");
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_GetFontKerningSize,"TTF_GetFontKerningSize");
|
||||||
|
|
||||||
|
if(errorCount() != errCount) return SDLTTFSupport.badLibrary;
|
||||||
|
else loadedVersion = SDLTTFSupport.sdlTTF2012;
|
||||||
|
|
||||||
|
static if(sdlTTFSupport >= SDLTTFSupport.sdlTTF2014) {
|
||||||
|
lib.bindSymbol(cast(void**)&TTF_GetFontKerningSizeGlyphs,"TTF_GetFontKerningSizeGlyphs");
|
||||||
|
|
||||||
|
if(errorCount() != errCount) return SDLTTFSupport.badLibrary;
|
||||||
|
else loadedVersion = SDLTTFSupport.sdlTTF2014;
|
||||||
|
}
|
||||||
|
|
||||||
|
return loadedVersion;
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
demos/libpng16-16.dll
Normal file
BIN
demos/libpng16-16.dll
Normal file
Binary file not shown.
BIN
demos/libs/linux/x64/libcimgui.so
Executable file
BIN
demos/libs/linux/x64/libcimgui.so
Executable file
Binary file not shown.
BIN
demos/libs/windows/x64/SDL2.lib
Normal file
BIN
demos/libs/windows/x64/SDL2.lib
Normal file
Binary file not shown.
BIN
demos/libs/windows/x64/SDL2_image.lib
Normal file
BIN
demos/libs/windows/x64/SDL2_image.lib
Normal file
Binary file not shown.
BIN
demos/libs/windows/x64/SDL2main.lib
Normal file
BIN
demos/libs/windows/x64/SDL2main.lib
Normal file
Binary file not shown.
BIN
demos/libs/windows/x64/SDL2test.lib
Normal file
BIN
demos/libs/windows/x64/SDL2test.lib
Normal file
Binary file not shown.
BIN
demos/libs/windows/x64/cimgui.lib
Normal file
BIN
demos/libs/windows/x64/cimgui.lib
Normal file
Binary file not shown.
791
demos/source/app.d
Normal file
791
demos/source/app.d
Normal file
|
|
@ -0,0 +1,791 @@
|
||||||
|
module app;
|
||||||
|
|
||||||
|
import bindbc.sdl;
|
||||||
|
|
||||||
|
import cimgui.cimgui;
|
||||||
|
|
||||||
|
import game_core.job_updater;
|
||||||
|
|
||||||
|
import ecs.manager;
|
||||||
|
import ecs.core;
|
||||||
|
import ecs.std;
|
||||||
|
|
||||||
|
import ecs_utils.gfx.renderer;
|
||||||
|
import ecs_utils.imgui_bind;
|
||||||
|
import ecs_utils.imgui_styles;
|
||||||
|
import ecs_utils.math.vector;
|
||||||
|
import ecs_utils.utils;
|
||||||
|
|
||||||
|
import glad.gl.gl;
|
||||||
|
import glad.gl.gles2;
|
||||||
|
import glad.gl.loader;
|
||||||
|
|
||||||
|
import gui.manager;
|
||||||
|
|
||||||
|
extern (C) :
|
||||||
|
|
||||||
|
enum Tool
|
||||||
|
{
|
||||||
|
entity_spawner,
|
||||||
|
component_manipulator,
|
||||||
|
selector
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared const (char)*[3] tool_strings = ["Entity spawner", "Component manipulator", "Selector"];
|
||||||
|
|
||||||
|
struct Mouse
|
||||||
|
{
|
||||||
|
vec2 position;
|
||||||
|
bool left, right, middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Launcher
|
||||||
|
{
|
||||||
|
ECSJobUpdater* job_updater;
|
||||||
|
GUIManager* gui_manager;
|
||||||
|
ImGuiContext* context;
|
||||||
|
SDL_Window* window;
|
||||||
|
SDL_GLContext gl_context;
|
||||||
|
EntityManager* manager;
|
||||||
|
bool function() loop;
|
||||||
|
void function() end;
|
||||||
|
void function(SDL_Event*) event;
|
||||||
|
void function(vec2, Tool, int) tool;
|
||||||
|
ivec2 window_size = ivec2(1024,768);
|
||||||
|
Renderer renderer;
|
||||||
|
ubyte[] keys;
|
||||||
|
uint style = 3;
|
||||||
|
uint entities_count;
|
||||||
|
bool multithreading;
|
||||||
|
ulong timer_freq;
|
||||||
|
double delta_time;
|
||||||
|
uint fps;
|
||||||
|
|
||||||
|
Tool used_tool;
|
||||||
|
int tool_size = 0;
|
||||||
|
float tool_repeat = 0;
|
||||||
|
float repeat_time = 0;
|
||||||
|
|
||||||
|
bool swap_interval = true;
|
||||||
|
|
||||||
|
float windows_alpha = 0.75;
|
||||||
|
|
||||||
|
const (char)* tips;
|
||||||
|
|
||||||
|
bool show_stat_wnd = true;
|
||||||
|
bool show_tips = true;
|
||||||
|
bool show_demo_wnd = true;
|
||||||
|
bool show_virtual_keys_wnd = false;
|
||||||
|
bool show_profile_wnd = true;
|
||||||
|
|
||||||
|
int plot_index;
|
||||||
|
PlotStruct[] plot_values;
|
||||||
|
|
||||||
|
Mouse mouse;
|
||||||
|
|
||||||
|
struct PlotStruct
|
||||||
|
{
|
||||||
|
float delta_time = 0;
|
||||||
|
float loop_time = 0;
|
||||||
|
float draw_time = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void switchDemo(void function() start, bool function() loop, void function() end, void function(SDL_Event*) event, void function(vec2, Tool, int) tool, const (char)* tips)
|
||||||
|
{
|
||||||
|
gui_manager.clear();
|
||||||
|
|
||||||
|
if(this.end)this.end();
|
||||||
|
|
||||||
|
manager.begin();
|
||||||
|
manager.update("clean");
|
||||||
|
manager.end();
|
||||||
|
|
||||||
|
if(start)start();
|
||||||
|
this.loop = loop;
|
||||||
|
this.end = end;
|
||||||
|
this.event = event;
|
||||||
|
this.tips = tips;
|
||||||
|
this.tool = tool;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool getKeyState(SDL_Scancode key)
|
||||||
|
{
|
||||||
|
if(keys[key])return true;
|
||||||
|
else return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setStyle(uint index)
|
||||||
|
{
|
||||||
|
style = index;
|
||||||
|
.setStyle(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
double getTime()
|
||||||
|
{
|
||||||
|
ulong local_freq = timer_freq / 1000_000;
|
||||||
|
//return cast(double)(SDL_GetPerformanceCounter() & 0x00FFFFFF) / timer_freq;
|
||||||
|
if(local_freq == 0)return cast(double)(SDL_GetPerformanceCounter() / timer_freq * 1000);
|
||||||
|
else return cast(double)(SDL_GetPerformanceCounter() / local_freq) / 1000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared Launcher launcher;
|
||||||
|
|
||||||
|
struct CountSystem
|
||||||
|
{
|
||||||
|
mixin ECS.System!1;
|
||||||
|
|
||||||
|
struct EntitiesData
|
||||||
|
{
|
||||||
|
uint length;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool onBegin()
|
||||||
|
{
|
||||||
|
launcher.entities_count = 0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void onUpdate(EntitiesData data)
|
||||||
|
{
|
||||||
|
launcher.entities_count += data.length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CleanSystem
|
||||||
|
{
|
||||||
|
mixin ECS.System!64;
|
||||||
|
|
||||||
|
struct EntitiesData
|
||||||
|
{
|
||||||
|
uint length;
|
||||||
|
Entity[] entities;
|
||||||
|
}
|
||||||
|
|
||||||
|
void onUpdate(EntitiesData data)
|
||||||
|
{
|
||||||
|
foreach(i; 0..data.length)
|
||||||
|
{
|
||||||
|
launcher.manager.removeEntity(data.entities[i].id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void mainLoop(void* arg)
|
||||||
|
{
|
||||||
|
__gshared double time = 0;
|
||||||
|
launcher.delta_time = launcher.getTime() - time;
|
||||||
|
time = launcher.getTime();
|
||||||
|
|
||||||
|
if(launcher.delta_time > 1000)launcher.delta_time = 1000;
|
||||||
|
|
||||||
|
__gshared uint temp_fps = 0;
|
||||||
|
__gshared double fps_time = 0;
|
||||||
|
temp_fps++;
|
||||||
|
fps_time += launcher.delta_time;
|
||||||
|
while(fps_time > 1000)
|
||||||
|
{
|
||||||
|
fps_time -= 1000;
|
||||||
|
launcher.fps = temp_fps;
|
||||||
|
temp_fps = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SDL_Event event;
|
||||||
|
while (SDL_PollEvent(&event))
|
||||||
|
{
|
||||||
|
version(WebAssembly)ImGui_ImplSDL2_ProcessEvent(&event);
|
||||||
|
else ImGui_ImplSDL2_ProcessEvent(&event);
|
||||||
|
if(launcher.event)launcher.event(&event);
|
||||||
|
if (event.type == SDL_QUIT || (event.type == SDL_KEYDOWN && event.key.keysym.scancode == SDL_SCANCODE_ESCAPE)) {
|
||||||
|
quit();
|
||||||
|
*cast(bool*)arg = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if(event.type == SDL_WINDOWEVENT)
|
||||||
|
{
|
||||||
|
switch(event.window.event)
|
||||||
|
{
|
||||||
|
case SDL_WINDOWEVENT_RESIZED:
|
||||||
|
//launcher.renderer.resize(ivec2(event.window.data1,event.window.data2));
|
||||||
|
launcher.window_size = ivec2(event.window.data1,event.window.data2);
|
||||||
|
break;
|
||||||
|
case SDL_WINDOWEVENT_SIZE_CHANGED:
|
||||||
|
//launcher.renderer.resize(ivec2(event.window.data1,event.window.data2));
|
||||||
|
launcher.window_size = ivec2(event.window.data1,event.window.data2);
|
||||||
|
break;
|
||||||
|
default:break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(event.type == SDL_MOUSEBUTTONDOWN)
|
||||||
|
{
|
||||||
|
switch(event.button.button)
|
||||||
|
{
|
||||||
|
case SDL_BUTTON_LEFT:launcher.mouse.left = true;break;
|
||||||
|
case SDL_BUTTON_RIGHT:launcher.mouse.right = true;break;
|
||||||
|
case SDL_BUTTON_MIDDLE:launcher.mouse.middle = true;break;
|
||||||
|
default:break;
|
||||||
|
}
|
||||||
|
if(launcher.tool && event.button.button == SDL_BUTTON_LEFT && launcher.tool_repeat == 0 && !igIsWindowHovered(ImGuiHoveredFlags_AnyWindow))
|
||||||
|
{
|
||||||
|
launcher.tool(vec2(event.button.x, launcher.window_size.y - event.button.y), launcher.used_tool, launcher.tool_size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(event.type == SDL_MOUSEBUTTONUP)
|
||||||
|
{
|
||||||
|
switch(event.button.button)
|
||||||
|
{
|
||||||
|
case SDL_BUTTON_LEFT:launcher.mouse.left = false;break;
|
||||||
|
case SDL_BUTTON_RIGHT:launcher.mouse.right = false;break;
|
||||||
|
case SDL_BUTTON_MIDDLE:launcher.mouse.middle = false;break;
|
||||||
|
default:break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(event.type == SDL_MOUSEMOTION)
|
||||||
|
{
|
||||||
|
launcher.mouse.position = vec2(event.motion.x, launcher.window_size.y - event.motion.y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(launcher.tool && launcher.tool_repeat != 0 && launcher.mouse.left && !igIsWindowHovered(ImGuiHoveredFlags_AnyWindow) && !igIsWindowFocused(ImGuiFocusedFlags_AnyWindow))
|
||||||
|
{
|
||||||
|
float range = 500.0 / cast(float)launcher.tool_repeat;
|
||||||
|
launcher.repeat_time += launcher.delta_time;
|
||||||
|
while(launcher.repeat_time > range)
|
||||||
|
{
|
||||||
|
launcher.repeat_time -= range;
|
||||||
|
launcher.tool(launcher.mouse.position, launcher.used_tool, launcher.tool_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
version(WebAssembly)
|
||||||
|
{
|
||||||
|
ImGui_ImplOpenGL3_NewFrame();
|
||||||
|
ImGui_ImplSDL2_NewFrame(launcher.window);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ImGuiImplOpenGL2NewFrame();
|
||||||
|
ImGuiImplSDL2NewFrame(launcher.window);
|
||||||
|
}
|
||||||
|
|
||||||
|
igNewFrame();
|
||||||
|
|
||||||
|
if(igBeginMainMenuBar())
|
||||||
|
{
|
||||||
|
if(igBeginMenu("File",true))
|
||||||
|
{
|
||||||
|
if(igMenuItemBool("Close","esc",false,true))
|
||||||
|
{
|
||||||
|
quit();
|
||||||
|
*cast(bool*)arg = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
igEndMenu();
|
||||||
|
}
|
||||||
|
if(igBeginMenu("Demos",true))
|
||||||
|
{
|
||||||
|
if(igMenuItemBool("Simpe",null,false,true))
|
||||||
|
{
|
||||||
|
import demos.simple;
|
||||||
|
launcher.switchDemo(&simpleStart,&simpleLoop,&simpleEnd,&simpleEvent,&simpleTool,Simple.tips);
|
||||||
|
}
|
||||||
|
if(igMenuItemBool("Snake",null,false,true))
|
||||||
|
{
|
||||||
|
import demos.snake;
|
||||||
|
launcher.switchDemo(&snakeStart,&snakeLoop,&snakeEnd,&snakeEvent,&snakeTool,Snake.tips);
|
||||||
|
}
|
||||||
|
if(igMenuItemBool("Space invaders",null,false,true))
|
||||||
|
{
|
||||||
|
import demos.space_invaders;
|
||||||
|
launcher.switchDemo(&spaceInvadersStart,&spaceInvadersLoop,&spaceInvadersEnd,&spaceInvadersEvent,&spaceInvadersTool,SpaceInvaders.tips);
|
||||||
|
}
|
||||||
|
igEndMenu();
|
||||||
|
}
|
||||||
|
if(igBeginMenu("Options",true))
|
||||||
|
{
|
||||||
|
if(igMenuItemBool("VSync", null, launcher.swap_interval, true))
|
||||||
|
{
|
||||||
|
launcher.swap_interval = !launcher.swap_interval;
|
||||||
|
SDL_GL_SetSwapInterval(launcher.swap_interval);
|
||||||
|
}
|
||||||
|
if(igMenuItemBool("Multithreading", null, launcher.multithreading, true))
|
||||||
|
{
|
||||||
|
launcher.multithreading = !launcher.multithreading;
|
||||||
|
}
|
||||||
|
if(igBeginMenu("Show",true))
|
||||||
|
{
|
||||||
|
if(igMenuItemBool("Statistics",null,launcher.show_stat_wnd,true))
|
||||||
|
{
|
||||||
|
launcher.show_stat_wnd = !launcher.show_stat_wnd;
|
||||||
|
}
|
||||||
|
else if(igMenuItemBool("Demo",null,launcher.show_demo_wnd,true))
|
||||||
|
{
|
||||||
|
launcher.show_demo_wnd = !launcher.show_demo_wnd;
|
||||||
|
}
|
||||||
|
else if(igMenuItemBool("Tips",null,launcher.show_tips,true))
|
||||||
|
{
|
||||||
|
launcher.show_tips = !launcher.show_tips;
|
||||||
|
}
|
||||||
|
else if(igMenuItemBool("Virual keys",null,launcher.show_virtual_keys_wnd,true))
|
||||||
|
{
|
||||||
|
launcher.show_virtual_keys_wnd = !launcher.show_virtual_keys_wnd;
|
||||||
|
}
|
||||||
|
igEndMenu();
|
||||||
|
}
|
||||||
|
if(igBeginMenu("Style",true))
|
||||||
|
{
|
||||||
|
if(igMenuItemBool("Classic",null,launcher.style == 0,true))
|
||||||
|
{
|
||||||
|
launcher.setStyle(0);
|
||||||
|
}
|
||||||
|
else if(igMenuItemBool("Dark",null,launcher.style == 1,true))
|
||||||
|
{
|
||||||
|
launcher.setStyle(1);
|
||||||
|
}
|
||||||
|
else if(igMenuItemBool("Light",null,launcher.style == 2,true))
|
||||||
|
{
|
||||||
|
launcher.setStyle(2);
|
||||||
|
}
|
||||||
|
else if(igMenuItemBool("Default",null,launcher.style == 3,true))
|
||||||
|
{
|
||||||
|
launcher.setStyle(3);
|
||||||
|
}
|
||||||
|
igEndMenu();
|
||||||
|
}
|
||||||
|
igEndMenu();
|
||||||
|
}
|
||||||
|
igEndMainMenuBar();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(launcher.show_virtual_keys_wnd)
|
||||||
|
{
|
||||||
|
igSetNextWindowPos(ImVec2(launcher.window_size.x - 400, launcher.window_size.y - 200), ImGuiCond_Once, ImVec2(0,0));
|
||||||
|
igSetNextWindowSize(ImVec2(64*4+128, 168), ImGuiCond_Once);
|
||||||
|
igSetNextWindowBgAlpha(launcher.windows_alpha);
|
||||||
|
ImGuiStyle * style = igGetStyle();
|
||||||
|
style.Colors[ImGuiCol_Button].w = 0.8;
|
||||||
|
if(igBegin("Virtual keys",&launcher.show_virtual_keys_wnd, 0))
|
||||||
|
{
|
||||||
|
igColumns(2,null,0);
|
||||||
|
igSetColumnWidth(0,64*3+16);
|
||||||
|
igIndent(64+4);
|
||||||
|
if(igButton("W",ImVec2(64,64)) || igIsItemDeactivated())
|
||||||
|
{
|
||||||
|
launcher.keys[SDL_SCANCODE_W] = false;
|
||||||
|
}
|
||||||
|
else if(igIsItemActive())
|
||||||
|
{
|
||||||
|
launcher.keys[SDL_SCANCODE_W] = true;
|
||||||
|
}
|
||||||
|
igUnindent(64+4);
|
||||||
|
if(igButton("A",ImVec2(64,64)) || igIsItemDeactivated())
|
||||||
|
{
|
||||||
|
launcher.keys[SDL_SCANCODE_A] = false;
|
||||||
|
}
|
||||||
|
else if(igIsItemActive())
|
||||||
|
{
|
||||||
|
launcher.keys[SDL_SCANCODE_A] = true;
|
||||||
|
}
|
||||||
|
igSameLine(0,4);
|
||||||
|
if(igButton("S",ImVec2(64,64)) || igIsItemDeactivated())
|
||||||
|
{
|
||||||
|
launcher.keys[SDL_SCANCODE_S] = false;
|
||||||
|
}
|
||||||
|
else if(igIsItemActive())
|
||||||
|
{
|
||||||
|
launcher.keys[SDL_SCANCODE_S] = true;
|
||||||
|
}
|
||||||
|
igSameLine(0,4);
|
||||||
|
if(igButton("D",ImVec2(64,64)) || igIsItemDeactivated())
|
||||||
|
{
|
||||||
|
launcher.keys[SDL_SCANCODE_D] = false;
|
||||||
|
}
|
||||||
|
else if(igIsItemActive())
|
||||||
|
{
|
||||||
|
launcher.keys[SDL_SCANCODE_D] = true;
|
||||||
|
}
|
||||||
|
igNextColumn();
|
||||||
|
if(igButton("Space",ImVec2(-1,128)) || igIsItemDeactivated())
|
||||||
|
{
|
||||||
|
launcher.keys[SDL_SCANCODE_SPACE] = false;
|
||||||
|
}
|
||||||
|
else if(igIsItemActive())
|
||||||
|
{
|
||||||
|
launcher.keys[SDL_SCANCODE_SPACE] = true;
|
||||||
|
}
|
||||||
|
igColumns(1,null,0);
|
||||||
|
}
|
||||||
|
igEnd();
|
||||||
|
style.Colors[ImGuiCol_Button].w = 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(launcher.show_tips)
|
||||||
|
{
|
||||||
|
igSetNextWindowPos(ImVec2(launcher.window_size.x - 550, 80), ImGuiCond_Once, ImVec2(0,0));
|
||||||
|
igSetNextWindowSize(ImVec2(300, 0), ImGuiCond_Once);
|
||||||
|
igSetNextWindowBgAlpha(launcher.windows_alpha);
|
||||||
|
if(igBegin("Tips",&launcher.show_tips,ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings))
|
||||||
|
{
|
||||||
|
igTextWrapped(launcher.tips);
|
||||||
|
}
|
||||||
|
igEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(launcher.show_demo_wnd)
|
||||||
|
{
|
||||||
|
igSetNextWindowPos(ImVec2(launcher.window_size.x - 260, 30), ImGuiCond_Once, ImVec2(0,0));
|
||||||
|
igSetNextWindowSize(ImVec2(250, 250), ImGuiCond_Once);
|
||||||
|
if(igBegin("Demo",&launcher.show_demo_wnd,0))
|
||||||
|
{
|
||||||
|
ImDrawList* draw_list = igGetWindowDrawList();
|
||||||
|
//igBeginGroup();
|
||||||
|
launcher.gui_manager.gui();
|
||||||
|
//igEndGroup();
|
||||||
|
//ImDrawList_AddRect(draw_list, igGetItemRectMin(), igGetItemRectMax(), igColorConvertFloat4ToU32(ImVec4(0.4,0.4,0.4,0.4)), -1, 0, 1);
|
||||||
|
//igBeginChildFrame(1,ImVec2(0,-1),ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_ChildWindow);
|
||||||
|
//igBeginChild("Tool frame",ImVec2(-1,-1),true,0);
|
||||||
|
if(igCollapsingHeader("Tool##ToolHeader", ImGuiTreeNodeFlags_SpanAvailWidth))
|
||||||
|
{
|
||||||
|
igIndent(8);
|
||||||
|
igBeginGroup();
|
||||||
|
if(igBeginCombo("Tool",tool_strings[launcher.used_tool],0))
|
||||||
|
{
|
||||||
|
if(igSelectable("Entity spawner",false,0,ImVec2(0,0)))
|
||||||
|
{
|
||||||
|
launcher.used_tool = Tool.entity_spawner;
|
||||||
|
}
|
||||||
|
if(igSelectable("Component manipulator",false,0,ImVec2(0,0)))
|
||||||
|
{
|
||||||
|
launcher.used_tool = Tool.component_manipulator;
|
||||||
|
}
|
||||||
|
if(igSelectable("Selector",false,0,ImVec2(0,0)))
|
||||||
|
{
|
||||||
|
launcher.used_tool = Tool.selector;
|
||||||
|
}
|
||||||
|
igEndCombo();
|
||||||
|
}
|
||||||
|
|
||||||
|
igSliderInt("Tool size", &launcher.tool_size, 0, 256, null);
|
||||||
|
igSliderFloat("Tool repeat", &launcher.tool_repeat, 0, 1024, null, 4);
|
||||||
|
launcher.gui_manager.toolGui();
|
||||||
|
igEndGroup();
|
||||||
|
ImDrawList_AddRect(draw_list, igGetItemRectMin(), igGetItemRectMax(), igColorConvertFloat4ToU32(ImVec4(0.4,0.4,0.4,0.4)), 4, ImDrawCornerFlags_All, 1);
|
||||||
|
igUnindent(8);
|
||||||
|
}
|
||||||
|
|
||||||
|
//igEndChild();
|
||||||
|
//igEndChildFrame();
|
||||||
|
if(igButton("Clear",ImVec2(-1,0)))
|
||||||
|
{
|
||||||
|
launcher.manager.begin();
|
||||||
|
launcher.manager.update("clean");
|
||||||
|
launcher.manager.end();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
igEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(launcher.show_profile_wnd)
|
||||||
|
{
|
||||||
|
igSetNextWindowPos(ImVec2(launcher.window_size.x - 260, launcher.window_size.y - 280), ImGuiCond_Once, ImVec2(0,0));
|
||||||
|
igSetNextWindowSize(ImVec2(250, 250), ImGuiCond_Once);
|
||||||
|
if(igBegin("Profile",&launcher.show_profile_wnd,0))
|
||||||
|
{
|
||||||
|
if(igBeginTabBar("ProfileTabBar",ImGuiTabBarFlags_FittingPolicyScroll))
|
||||||
|
{
|
||||||
|
|
||||||
|
if(igBeginTabItem("Plots", null, 0))
|
||||||
|
{
|
||||||
|
if(igBeginChild("ProfileChild",ImVec2(-1,-1),0,0))
|
||||||
|
{
|
||||||
|
igPlotLines("Delta time",&launcher.plot_values[0].delta_time,100,launcher.plot_index,"Delta time",0,float.max,ImVec2(0,64),Launcher.PlotStruct.sizeof);
|
||||||
|
igPlotLines("Loop time",&launcher.plot_values[0].loop_time,100,launcher.plot_index,"Loop time",0,float.max,ImVec2(0,64),Launcher.PlotStruct.sizeof);
|
||||||
|
igPlotLines("Draw time",&launcher.plot_values[0].draw_time,100,launcher.plot_index,"Draw time",0,float.max,ImVec2(0,64),Launcher.PlotStruct.sizeof);
|
||||||
|
}
|
||||||
|
igEndChild();
|
||||||
|
igEndTabItem();
|
||||||
|
}
|
||||||
|
if(igBeginTabItem("Multithreading graph", null, 0))
|
||||||
|
{
|
||||||
|
if(igBeginChild("ProfileChild",ImVec2(-1,-1),0,0))
|
||||||
|
{
|
||||||
|
igText("Work in proggress");
|
||||||
|
}
|
||||||
|
igEndChild();
|
||||||
|
igEndTabItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
igEndTabBar();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
igEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
launcher.renderer.resize(launcher.window_size);
|
||||||
|
launcher.renderer.view(vec2(0,0),vec2(launcher.window_size.x,launcher.window_size.y));
|
||||||
|
//glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
launcher.renderer.clear();
|
||||||
|
|
||||||
|
double loop_time = launcher.getTime();
|
||||||
|
if(launcher.loop && !launcher.loop())
|
||||||
|
{
|
||||||
|
quit();
|
||||||
|
*cast(bool*)arg = false;
|
||||||
|
}
|
||||||
|
loop_time = launcher.getTime() - loop_time;
|
||||||
|
|
||||||
|
double draw_time = launcher.getTime();
|
||||||
|
launcher.renderer.present();
|
||||||
|
draw_time = launcher.getTime() - draw_time;
|
||||||
|
|
||||||
|
__gshared float plot_time = 0;
|
||||||
|
__gshared uint plot_samples = 0;
|
||||||
|
plot_time += launcher.delta_time;
|
||||||
|
plot_samples++;
|
||||||
|
launcher.plot_values[100].delta_time += launcher.delta_time;
|
||||||
|
launcher.plot_values[100].loop_time += loop_time;
|
||||||
|
launcher.plot_values[100].draw_time += draw_time;
|
||||||
|
if(plot_time > 100)
|
||||||
|
{
|
||||||
|
launcher.plot_values[launcher.plot_index].delta_time = launcher.plot_values[100].delta_time / cast(float)plot_samples;
|
||||||
|
launcher.plot_values[launcher.plot_index].loop_time = launcher.plot_values[100].loop_time / cast(float)plot_samples;
|
||||||
|
launcher.plot_values[launcher.plot_index].draw_time = launcher.plot_values[100].draw_time / cast(float)plot_samples;
|
||||||
|
launcher.plot_values[100].delta_time = 0;
|
||||||
|
launcher.plot_values[100].loop_time = 0;
|
||||||
|
launcher.plot_values[100].draw_time = 0;
|
||||||
|
|
||||||
|
plot_samples = 0;
|
||||||
|
plot_time -= 100;
|
||||||
|
launcher.plot_index++;
|
||||||
|
if(launcher.plot_index >= 100)launcher.plot_index = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(launcher.show_stat_wnd)
|
||||||
|
{
|
||||||
|
igSetNextWindowPos(ImVec2(10, 30), ImGuiCond_Appearing, ImVec2(0,0));
|
||||||
|
igSetNextWindowContentSize(ImVec2(150, 0.0f));
|
||||||
|
igSetNextWindowBgAlpha(launcher.windows_alpha);
|
||||||
|
if(igBegin("Statistics", &launcher.show_stat_wnd, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize))
|
||||||
|
{
|
||||||
|
igColumns(2,null,0);
|
||||||
|
igSetColumnWidth(0,100);
|
||||||
|
igText("FPS: ");
|
||||||
|
igText("Entities: ");
|
||||||
|
igText("Loop time: ");
|
||||||
|
igText("Draw time: ");
|
||||||
|
igText("Delta time: ");
|
||||||
|
igNextColumn();
|
||||||
|
igText("%u",launcher.fps);
|
||||||
|
igText("%u",launcher.entities_count);
|
||||||
|
igText("%2.2fms",loop_time);
|
||||||
|
igText("%2.2fms",draw_time);
|
||||||
|
igText("%2.2fms",launcher.delta_time);
|
||||||
|
igColumns(1,null,0);
|
||||||
|
}
|
||||||
|
igEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
glUseProgram(0);
|
||||||
|
import ecs_utils.gfx.buffer;
|
||||||
|
Buffer.unbind(Buffer.BindTarget.array);
|
||||||
|
Buffer.unbind(Buffer.BindTarget.element_array);
|
||||||
|
|
||||||
|
igRender();
|
||||||
|
version(WebAssembly)ImGui_ImplOpenGL3_RenderDrawData(igGetDrawData());
|
||||||
|
else ImGuiImplOpenGL2RenderDrawData(igGetDrawData());
|
||||||
|
|
||||||
|
//launcher.renderer.clear();
|
||||||
|
//launcher.renderer.present();
|
||||||
|
|
||||||
|
SDL_GL_SwapWindow(launcher.window);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void quit()
|
||||||
|
{
|
||||||
|
launcher.gui_manager.clear();
|
||||||
|
Mallocator.dispose(launcher.gui_manager);
|
||||||
|
|
||||||
|
launcher.manager.destroy();
|
||||||
|
launcher.manager = null;
|
||||||
|
|
||||||
|
version(WebAssembly)emscripten_cancel_main_loop();
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (SDL_Init(SDL_INIT_VIDEO) < 0)
|
||||||
|
{
|
||||||
|
printf("SDL could not initialize! SDL_Error: %s", SDL_GetError());
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
SDL_version sdl_version;
|
||||||
|
SDL_GetVersion(&sdl_version);
|
||||||
|
printf("SDL version: %u.%u.%u\n",cast(uint)sdl_version.major,cast(uint)sdl_version.minor,cast(uint)sdl_version.patch);
|
||||||
|
|
||||||
|
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
|
||||||
|
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
|
||||||
|
launcher.window = SDL_CreateWindow("Simple", SDL_WINDOWPOS_CENTERED,
|
||||||
|
SDL_WINDOWPOS_CENTERED, launcher.window_size.x, launcher.window_size.y, SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE);
|
||||||
|
|
||||||
|
launcher.gl_context = SDL_GL_CreateContext(launcher.window);
|
||||||
|
launcher.context = igCreateContext(null);
|
||||||
|
launcher.timer_freq = SDL_GetPerformanceFrequency();
|
||||||
|
|
||||||
|
launcher.plot_values = Mallocator.makeArray!(Launcher.PlotStruct)(101);
|
||||||
|
|
||||||
|
SDL_GetWindowSize(launcher.window, &launcher.window_size.x, &launcher.window_size.y);
|
||||||
|
|
||||||
|
version(WebAssembly)
|
||||||
|
{
|
||||||
|
gladLoadGLES2(x => SDL_GL_GetProcAddress(x));
|
||||||
|
if(!ImGui_ImplSDL2_InitForOpenGL(launcher.window,launcher.gl_context))
|
||||||
|
{
|
||||||
|
printf("ImGui initialization failed!");
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
if(!ImGui_ImplOpenGL3_Init())
|
||||||
|
{
|
||||||
|
printf("ImGui OpenGL initialization failed!");
|
||||||
|
return -3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gladLoadGL();
|
||||||
|
if(!ImGuiImplSDL2InitForOpenGL(launcher.window,launcher.gl_context))
|
||||||
|
{
|
||||||
|
printf("ImGui initialization failed!");
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
if(!ImGuiImplOpenGL2Init())
|
||||||
|
{
|
||||||
|
printf("ImGui OpenGL initialization failed!");
|
||||||
|
return -3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ImFontConfig* config = ImFontConfig_ImFontConfig();
|
||||||
|
ImGuiIO* io = igGetIO();
|
||||||
|
const ushort* font_ranges = ImFontAtlas_GetGlyphRangesDefault(io.Fonts);
|
||||||
|
ImFontAtlas_AddFontFromFileTTF(io.Fonts,"assets/fonts/Ruda-Bold.ttf", 15.0f, config, font_ranges);
|
||||||
|
|
||||||
|
setStyle(3);
|
||||||
|
|
||||||
|
launcher.job_updater = Mallocator.make!ECSJobUpdater(12);
|
||||||
|
//launcher.job_updater.onCreate();
|
||||||
|
|
||||||
|
EntityManager.initialize(12);
|
||||||
|
launcher.manager = EntityManager.instance;
|
||||||
|
|
||||||
|
//launcher.manager.m_thread_id_func = &launcher.job_updater.getThreadID;
|
||||||
|
//launcher.manager.setJobDispachFunc(&launcher.job_updater.dispatch);
|
||||||
|
launcher.manager.setMultithreadingCallbacks(&launcher.job_updater.dispatch, &launcher.job_updater.getThreadID);
|
||||||
|
|
||||||
|
launcher.manager.beginRegister();
|
||||||
|
|
||||||
|
launcher.manager.registerPass("clean");
|
||||||
|
|
||||||
|
launcher.manager.registerSystem!CountSystem(10000);
|
||||||
|
launcher.manager.registerSystem!CleanSystem(0,"clean");
|
||||||
|
|
||||||
|
launcher.manager.endRegister();
|
||||||
|
|
||||||
|
loadGFX();
|
||||||
|
|
||||||
|
launcher.renderer.initialize();
|
||||||
|
|
||||||
|
launcher.gui_manager = Mallocator.make!GUIManager();
|
||||||
|
|
||||||
|
{
|
||||||
|
import demos.simple;
|
||||||
|
launcher.switchDemo(&simpleStart,&simpleLoop,&simpleEnd,&simpleEvent,&simpleTool,Simple.tips);
|
||||||
|
}
|
||||||
|
|
||||||
|
int key_num;
|
||||||
|
ubyte* keys = SDL_GetKeyboardState(&key_num);
|
||||||
|
launcher.keys = keys[0..key_num];
|
||||||
|
|
||||||
|
version(WebAssembly)
|
||||||
|
{
|
||||||
|
/*EmscriptenFullscreenStrategy strategy;
|
||||||
|
strategy.scaleMode = EMSCRIPTEN_FULLSCREEN_SCALE_STRETCH;
|
||||||
|
strategy.canvasResolutionScaleMode = EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_STDDEF;
|
||||||
|
strategy.filteringMode = EMSCRIPTEN_FULLSCREEN_FILTERING_NEAREST;*/
|
||||||
|
|
||||||
|
//int result = emscripten_request_fullscreen_strategy(null, true, &strategy);
|
||||||
|
//emscripten_enter_soft_fullscreen(null, &strategy);
|
||||||
|
//printf("Fullscreen request: %s.\n", emscripten_result_to_string(result));
|
||||||
|
emscripten_set_main_loop_arg(&mainLoop, null, 0, 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bool arg = true;
|
||||||
|
while(arg == true)
|
||||||
|
{
|
||||||
|
mainLoop(&arg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void loadGFX()
|
||||||
|
{
|
||||||
|
import ecs_utils.gfx.texture;
|
||||||
|
import ecs_utils.gfx.vertex;
|
||||||
|
import ecs_utils.gfx.shader;
|
||||||
|
import ecs_utils.gfx.material;
|
||||||
|
import ecs_utils.gfx.config;
|
||||||
|
import ecs_utils.gfx.mesh;
|
||||||
|
|
||||||
|
Texture.__loadBackend();
|
||||||
|
Renderer.__loadBackend();
|
||||||
|
|
||||||
|
GfxConfig.materials = Mallocator.makeArray!Material(1);
|
||||||
|
GfxConfig.meshes = Mallocator.makeArray!Mesh(1);
|
||||||
|
|
||||||
|
float[16] vertices = [-0.5,-0.5, 0,0, -0.5,0.5, 0,1, 0.5,-0.5, 1,0, 0.5,0.5, 1,1];
|
||||||
|
GfxConfig.meshes[0].vertices = Mallocator.makeArray(vertices);
|
||||||
|
ushort[6] indices = [0,1,2,1,2,3];
|
||||||
|
GfxConfig.meshes[0].indices = Mallocator.makeArray(indices);
|
||||||
|
GfxConfig.meshes[0].uploadData();
|
||||||
|
|
||||||
|
Shader vsh;
|
||||||
|
vsh.create();
|
||||||
|
vsh.load("assets/shaders/base.vp");
|
||||||
|
vsh.compile();
|
||||||
|
|
||||||
|
Shader fsh;
|
||||||
|
fsh.create();
|
||||||
|
fsh.load("assets/shaders/base.fp");
|
||||||
|
fsh.compile();
|
||||||
|
|
||||||
|
GfxConfig.materials[0].create();
|
||||||
|
GfxConfig.materials[0].data.blend_mode = Material.BlendMode.opaque;
|
||||||
|
GfxConfig.materials[0].data.mode = Material.TransformMode.position;
|
||||||
|
Material.ShaderModule[1] modules = [Material.ShaderModule(vsh,fsh)];
|
||||||
|
GfxConfig.materials[0].attachModules(modules);
|
||||||
|
//GfxConfig.materials[0].
|
||||||
|
//GfxConfig.materials[0].load(load_data.materials[i].str);
|
||||||
|
GfxConfig.materials[0].compile();
|
||||||
|
GfxConfig.materials[0].bindAttribLocation("positions",0);
|
||||||
|
GfxConfig.materials[0].bindAttribLocation("tex_coords",1);
|
||||||
|
GfxConfig.materials[0].link();
|
||||||
|
|
||||||
|
GfxConfig.materials[0].data.uniforms = Mallocator.makeArray!(Material.Uniform)(3);
|
||||||
|
GfxConfig.materials[0].data.uniforms[0] = Material.Uniform(Material.Type.float4, GfxConfig.materials[0].getLocation("matrix_1"), 0);
|
||||||
|
GfxConfig.materials[0].data.uniforms[1] = Material.Uniform(Material.Type.float4, GfxConfig.materials[0].getLocation("matrix_2"), 16);
|
||||||
|
GfxConfig.materials[0].data.uniforms[2] = Material.Uniform(Material.Type.float4, GfxConfig.materials[0].getLocation("uv_transform"), 32);
|
||||||
|
GfxConfig.materials[0].data.bindings = Mallocator.makeArray!(int)(1);
|
||||||
|
GfxConfig.materials[0].data.bindings[0] = GfxConfig.materials[0].getLocation("tex");
|
||||||
|
|
||||||
|
|
||||||
|
/*glUseProgram(0);
|
||||||
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);*/
|
||||||
|
}
|
||||||
19
demos/source/demos/bullet_madnes.d
Normal file
19
demos/source/demos/bullet_madnes.d
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
module demos.bullet_madnes;
|
||||||
|
|
||||||
|
import app;
|
||||||
|
|
||||||
|
import bindbc.sdl;
|
||||||
|
|
||||||
|
import cimgui.cimgui;
|
||||||
|
|
||||||
|
import ecs.attributes;
|
||||||
|
import ecs.core;
|
||||||
|
import ecs.entity;
|
||||||
|
import ecs.manager;
|
||||||
|
import ecs.std;
|
||||||
|
|
||||||
|
import ecs_utils.gfx.texture;
|
||||||
|
import ecs_utils.math.vector;
|
||||||
|
import ecs_utils.utils;
|
||||||
|
|
||||||
|
extern(C):
|
||||||
19
demos/source/demos/chipmunk2d.d
Normal file
19
demos/source/demos/chipmunk2d.d
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
module demos.chipmunk2d;
|
||||||
|
|
||||||
|
import app;
|
||||||
|
|
||||||
|
import bindbc.sdl;
|
||||||
|
|
||||||
|
import cimgui.cimgui;
|
||||||
|
|
||||||
|
import ecs.attributes;
|
||||||
|
import ecs.core;
|
||||||
|
import ecs.entity;
|
||||||
|
import ecs.manager;
|
||||||
|
import ecs.std;
|
||||||
|
|
||||||
|
import ecs_utils.gfx.texture;
|
||||||
|
import ecs_utils.math.vector;
|
||||||
|
import ecs_utils.utils;
|
||||||
|
|
||||||
|
extern(C):
|
||||||
19
demos/source/demos/events.d
Normal file
19
demos/source/demos/events.d
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
module demos.events;
|
||||||
|
|
||||||
|
import app;
|
||||||
|
|
||||||
|
import bindbc.sdl;
|
||||||
|
|
||||||
|
import cimgui.cimgui;
|
||||||
|
|
||||||
|
import ecs.attributes;
|
||||||
|
import ecs.core;
|
||||||
|
import ecs.entity;
|
||||||
|
import ecs.manager;
|
||||||
|
import ecs.std;
|
||||||
|
|
||||||
|
import ecs_utils.gfx.texture;
|
||||||
|
import ecs_utils.math.vector;
|
||||||
|
import ecs_utils.utils;
|
||||||
|
|
||||||
|
extern(C):
|
||||||
19
demos/source/demos/flag_component.d
Normal file
19
demos/source/demos/flag_component.d
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
module demos.flag_component;
|
||||||
|
|
||||||
|
import app;
|
||||||
|
|
||||||
|
import bindbc.sdl;
|
||||||
|
|
||||||
|
import cimgui.cimgui;
|
||||||
|
|
||||||
|
import ecs.attributes;
|
||||||
|
import ecs.core;
|
||||||
|
import ecs.entity;
|
||||||
|
import ecs.manager;
|
||||||
|
import ecs.std;
|
||||||
|
|
||||||
|
import ecs_utils.gfx.texture;
|
||||||
|
import ecs_utils.math.vector;
|
||||||
|
import ecs_utils.utils;
|
||||||
|
|
||||||
|
extern(C):
|
||||||
19
demos/source/demos/physics.d
Normal file
19
demos/source/demos/physics.d
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
module demos.physics;
|
||||||
|
|
||||||
|
import app;
|
||||||
|
|
||||||
|
import bindbc.sdl;
|
||||||
|
|
||||||
|
import cimgui.cimgui;
|
||||||
|
|
||||||
|
import ecs.attributes;
|
||||||
|
import ecs.core;
|
||||||
|
import ecs.entity;
|
||||||
|
import ecs.manager;
|
||||||
|
import ecs.std;
|
||||||
|
|
||||||
|
import ecs_utils.gfx.texture;
|
||||||
|
import ecs_utils.math.vector;
|
||||||
|
import ecs_utils.utils;
|
||||||
|
|
||||||
|
extern(C):
|
||||||
198
demos/source/demos/simple.d
Normal file
198
demos/source/demos/simple.d
Normal file
|
|
@ -0,0 +1,198 @@
|
||||||
|
module demos.simple;
|
||||||
|
|
||||||
|
import app;
|
||||||
|
|
||||||
|
import bindbc.sdl;
|
||||||
|
|
||||||
|
import cimgui.cimgui;
|
||||||
|
|
||||||
|
import ecs.attributes;
|
||||||
|
import ecs.core;
|
||||||
|
import ecs.entity;
|
||||||
|
import ecs.manager;
|
||||||
|
import ecs.std;
|
||||||
|
|
||||||
|
import ecs_utils.gfx.texture;
|
||||||
|
import ecs_utils.math.vector;
|
||||||
|
import ecs_utils.utils;
|
||||||
|
|
||||||
|
extern(C):
|
||||||
|
|
||||||
|
struct Simple
|
||||||
|
{
|
||||||
|
__gshared const (char)* tips = "Use \"space\" to spwan entities.\n\nSystems can be enabled/disabled from \"Simple\" window.";
|
||||||
|
|
||||||
|
EntityTemplate* tmpl;
|
||||||
|
Texture texture;
|
||||||
|
|
||||||
|
bool move_system = true;
|
||||||
|
bool draw_system = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CLocation
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
|
||||||
|
alias location this;
|
||||||
|
|
||||||
|
vec2 location;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CTexture
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
|
||||||
|
Texture tex;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct DrawSystem
|
||||||
|
{
|
||||||
|
mixin ECS.System!1;
|
||||||
|
|
||||||
|
struct EntitiesData
|
||||||
|
{
|
||||||
|
uint length;
|
||||||
|
@readonly CTexture[] textures;
|
||||||
|
@readonly CLocation[] locations;
|
||||||
|
}
|
||||||
|
|
||||||
|
void onUpdate(EntitiesData data)
|
||||||
|
{
|
||||||
|
foreach(i; 0..data.length)
|
||||||
|
{
|
||||||
|
launcher.renderer.draw(data.textures[i].tex, data.locations[i].location, vec2(32,32), vec4(0,0,1,1), 0, 0 , 0);
|
||||||
|
//draw(renderer, data.textures[i].tex, data.locations[i], vec2(32,32), vec4(0,0,1,1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct MoveSystem
|
||||||
|
{
|
||||||
|
mixin ECS.System!64;
|
||||||
|
|
||||||
|
struct EntitiesData
|
||||||
|
{
|
||||||
|
uint length;
|
||||||
|
CLocation[] locations;
|
||||||
|
}
|
||||||
|
|
||||||
|
void onUpdate(EntitiesData data)
|
||||||
|
{
|
||||||
|
foreach(i; 0..data.length)
|
||||||
|
{
|
||||||
|
data.locations[i].location.y = data.locations[i].location.y + 1;
|
||||||
|
if(data.locations[i].location.y > 400)data.locations[i].location.y = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared Simple* simple;
|
||||||
|
|
||||||
|
void simpleStart()
|
||||||
|
{
|
||||||
|
simple = Mallocator.make!Simple;
|
||||||
|
|
||||||
|
simple.texture.create();
|
||||||
|
simple.texture.load("assets/textures/buckler.png");
|
||||||
|
|
||||||
|
launcher.manager.beginRegister();
|
||||||
|
|
||||||
|
launcher.manager.registerComponent!CLocation;
|
||||||
|
launcher.manager.registerComponent!CTexture;
|
||||||
|
|
||||||
|
launcher.manager.registerSystem!MoveSystem(0);
|
||||||
|
launcher.manager.registerSystem!DrawSystem(1);
|
||||||
|
|
||||||
|
launcher.manager.endRegister();
|
||||||
|
|
||||||
|
launcher.gui_manager.addSystem(MoveSystem.system_id,"Move System");
|
||||||
|
launcher.gui_manager.addSystem(DrawSystem.system_id,"Draw System");
|
||||||
|
|
||||||
|
ushort[2] components = [CLocation.component_id, CTexture.component_id];
|
||||||
|
simple.tmpl = launcher.manager.allocateTemplate(components);
|
||||||
|
CTexture* tex_comp = simple.tmpl.getComponent!CTexture;
|
||||||
|
tex_comp.tex = simple.texture;
|
||||||
|
CLocation* loc_comp = simple.tmpl.getComponent!CLocation;
|
||||||
|
|
||||||
|
launcher.gui_manager.addTemplate(simple.tmpl, "Basic");
|
||||||
|
|
||||||
|
foreach(i; 0..10)
|
||||||
|
foreach(j; 0..10)
|
||||||
|
{
|
||||||
|
loc_comp.location = vec2(i*32+64,j*32+64);
|
||||||
|
launcher.manager.addEntity(simple.tmpl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void simpleEnd()
|
||||||
|
{
|
||||||
|
launcher.manager.getSystem(MoveSystem.system_id).disable();
|
||||||
|
launcher.manager.getSystem(DrawSystem.system_id).disable();
|
||||||
|
|
||||||
|
simple.texture.destroy();
|
||||||
|
|
||||||
|
//launcher.manager.freeTemplate(simple.tmpl);
|
||||||
|
Mallocator.dispose(simple);
|
||||||
|
}
|
||||||
|
|
||||||
|
void simpleTool(vec2 position, Tool tool, int size)
|
||||||
|
{
|
||||||
|
switch(tool)
|
||||||
|
{
|
||||||
|
case Tool.entity_spawner:
|
||||||
|
{
|
||||||
|
EntityTemplate* tmpl = launcher.gui_manager.getSelectedTemplate();
|
||||||
|
CLocation* location = tmpl.getComponent!CLocation;
|
||||||
|
if(location)
|
||||||
|
{
|
||||||
|
position.x += (randomf - 0.5) * size;
|
||||||
|
position.y += (randomf - 0.5) * size;
|
||||||
|
*location = position;
|
||||||
|
}
|
||||||
|
launcher.manager.addEntity(tmpl);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void simpleEvent(SDL_Event* event)
|
||||||
|
{
|
||||||
|
/*if(event.type == event.button)
|
||||||
|
{
|
||||||
|
vec2 position = vec2(event.button.x, event.button.y);
|
||||||
|
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
void spawnEntity()
|
||||||
|
{
|
||||||
|
CLocation* loc_comp = simple.tmpl.getComponent!CLocation;
|
||||||
|
loc_comp.location = vec2(randomf() * 600,0);
|
||||||
|
launcher.manager.addEntity(simple.tmpl);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool simpleLoop()
|
||||||
|
{
|
||||||
|
if(launcher.getKeyState(SDL_SCANCODE_SPACE))
|
||||||
|
{
|
||||||
|
foreach(i;0..1)spawnEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
launcher.manager.begin();
|
||||||
|
if(launcher.multithreading)
|
||||||
|
{
|
||||||
|
launcher.job_updater.begin();
|
||||||
|
launcher.manager.updateMT();
|
||||||
|
launcher.job_updater.call();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
launcher.manager.update();
|
||||||
|
}
|
||||||
|
launcher.manager.end();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
588
demos/source/demos/snake.d
Normal file
588
demos/source/demos/snake.d
Normal file
|
|
@ -0,0 +1,588 @@
|
||||||
|
module demos.snake;
|
||||||
|
|
||||||
|
import app;
|
||||||
|
|
||||||
|
import bindbc.sdl;
|
||||||
|
|
||||||
|
import cimgui.cimgui;
|
||||||
|
|
||||||
|
import ecs.attributes;
|
||||||
|
import ecs.core;
|
||||||
|
import ecs.entity;
|
||||||
|
import ecs.manager;
|
||||||
|
import ecs.std;
|
||||||
|
import ecs.vector;
|
||||||
|
|
||||||
|
import ecs_utils.gfx.texture;
|
||||||
|
import ecs_utils.math.vector;
|
||||||
|
import ecs_utils.utils;
|
||||||
|
|
||||||
|
extern(C):
|
||||||
|
|
||||||
|
struct MapElement
|
||||||
|
{
|
||||||
|
enum Type
|
||||||
|
{
|
||||||
|
empty = 0,
|
||||||
|
snake = 1,
|
||||||
|
apple = 2,
|
||||||
|
wall = 3
|
||||||
|
}
|
||||||
|
Type type;
|
||||||
|
EntityID id;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Snake
|
||||||
|
{
|
||||||
|
__gshared const (char)* tips = "Use \"WASD\" keys to move.";
|
||||||
|
|
||||||
|
EntityTemplate* apple_tmpl;
|
||||||
|
EntityTemplate* snake_tmpl;
|
||||||
|
Texture snake_texture;
|
||||||
|
Texture wall_texture;
|
||||||
|
Texture apple_texture;
|
||||||
|
|
||||||
|
bool move_system = true;
|
||||||
|
bool draw_system = true;
|
||||||
|
|
||||||
|
const int map_size = 18;
|
||||||
|
|
||||||
|
MapElement[map_size * map_size] map;
|
||||||
|
|
||||||
|
MapElement element(ivec2 pos)
|
||||||
|
{
|
||||||
|
uint index = pos.x + pos.y * map_size;
|
||||||
|
if(index >= map.length)index = map.length - 1;
|
||||||
|
return map[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
void element(MapElement el, ivec2 pos)
|
||||||
|
{
|
||||||
|
uint index = pos.x + pos.y * map_size;
|
||||||
|
if(index >= map.length)index = map.length - 1;
|
||||||
|
map[index] = el;
|
||||||
|
}
|
||||||
|
|
||||||
|
void addApple()
|
||||||
|
{
|
||||||
|
ivec2 random_pos = ivec2(rand()%map_size,rand()%map_size);
|
||||||
|
ivec2 base_pos = random_pos;
|
||||||
|
while(element(random_pos).type != MapElement.Type.empty)
|
||||||
|
{
|
||||||
|
random_pos.x += 1;
|
||||||
|
if(random_pos.x > map_size)
|
||||||
|
{
|
||||||
|
random_pos.x = 0;
|
||||||
|
random_pos.y += 1;
|
||||||
|
if(random_pos.y > map_size)random_pos.y = 0;
|
||||||
|
}
|
||||||
|
if(base_pos.x == random_pos.x && base_pos.y == random_pos.y)return;
|
||||||
|
}
|
||||||
|
CILocation* location = apple_tmpl.getComponent!CILocation;
|
||||||
|
*location = random_pos;
|
||||||
|
Entity* apple = launcher.manager.addEntity(apple_tmpl);
|
||||||
|
}
|
||||||
|
|
||||||
|
void drawMap()
|
||||||
|
{
|
||||||
|
foreach(x; 0 .. map_size)
|
||||||
|
{
|
||||||
|
foreach(y; 0 .. map_size)
|
||||||
|
{
|
||||||
|
switch(element(ivec2(x,y)).type)
|
||||||
|
{
|
||||||
|
case MapElement.Type.apple:launcher.renderer.draw(apple_texture, vec2(x*32,y*32), vec2(32,32), vec4(0,0,1,1), 0, 0 , 0);break;
|
||||||
|
case MapElement.Type.snake:launcher.renderer.draw(snake_texture, vec2(x*32,y*32), vec2(32,32), vec4(0,0,1,1), 0, 0 , 0);break;
|
||||||
|
case MapElement.Type.wall:launcher.renderer.draw(wall_texture, vec2(x*32,y*32), vec2(32,32), vec4(0,0,1,1), 0, 0 , 0);break;
|
||||||
|
default:break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CILocation
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
|
||||||
|
alias location this;
|
||||||
|
|
||||||
|
ivec2 location;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CLocation
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
|
||||||
|
alias location this;
|
||||||
|
|
||||||
|
vec2 location;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CSnake
|
||||||
|
{
|
||||||
|
void onCreate()
|
||||||
|
{
|
||||||
|
parts.array = Mallocator.makeArray!ivec2(100);
|
||||||
|
}
|
||||||
|
|
||||||
|
void onDestroy()
|
||||||
|
{
|
||||||
|
Mallocator.dispose(parts.array);
|
||||||
|
}
|
||||||
|
|
||||||
|
mixin ECS.Component;
|
||||||
|
|
||||||
|
struct Parts
|
||||||
|
{
|
||||||
|
uint length = 0;
|
||||||
|
ivec2[] array;
|
||||||
|
|
||||||
|
ivec2 opIndex(size_t ind) const
|
||||||
|
{
|
||||||
|
return array[ind];
|
||||||
|
}
|
||||||
|
|
||||||
|
ivec2[] opSlice()
|
||||||
|
{
|
||||||
|
return array[0 .. length];
|
||||||
|
}
|
||||||
|
|
||||||
|
void opIndexAssign(ivec2 vec, size_t ind)
|
||||||
|
{
|
||||||
|
array[ind] = vec;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t opDollar() const
|
||||||
|
{
|
||||||
|
return length;
|
||||||
|
}
|
||||||
|
|
||||||
|
void add(ivec2 v)
|
||||||
|
{
|
||||||
|
length++;
|
||||||
|
array[length-1] = v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Parts parts;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CApple
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CParticle
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CParticleVector
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
|
||||||
|
vec2 velocity;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CMovement
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
|
||||||
|
enum Direction : byte
|
||||||
|
{
|
||||||
|
up,
|
||||||
|
down,
|
||||||
|
left,
|
||||||
|
right
|
||||||
|
}
|
||||||
|
|
||||||
|
Direction direction;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CInput
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct AppleSystem
|
||||||
|
{
|
||||||
|
mixin ECS.System!1;
|
||||||
|
|
||||||
|
struct EntitiesData
|
||||||
|
{
|
||||||
|
uint length;
|
||||||
|
@readonly Entity[] entities;
|
||||||
|
@readonly CApple[] movement;
|
||||||
|
@readonly CILocation[] location;
|
||||||
|
}
|
||||||
|
|
||||||
|
void onAddEntity(EntitiesData data)
|
||||||
|
{
|
||||||
|
foreach(i;0..data.length)
|
||||||
|
{
|
||||||
|
snake.element(MapElement(MapElement.Type.apple,data.entities[i].id),data.location[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct MoveSystem
|
||||||
|
{
|
||||||
|
mixin ECS.System!64;
|
||||||
|
|
||||||
|
struct EntitiesData
|
||||||
|
{
|
||||||
|
uint length;
|
||||||
|
@readonly Entity[] entities;
|
||||||
|
@readonly CMovement[] movement;
|
||||||
|
@optional CSnake[] snakes;
|
||||||
|
CILocation[] location;
|
||||||
|
}
|
||||||
|
|
||||||
|
void moveLocation(ref CILocation location, CMovement.Direction direction)
|
||||||
|
{
|
||||||
|
final switch(direction)
|
||||||
|
{
|
||||||
|
case CMovement.Direction.down:
|
||||||
|
location.y -= 1;
|
||||||
|
if(location.y < 0)location.y = snake.map_size - 1;
|
||||||
|
break;
|
||||||
|
case CMovement.Direction.up:
|
||||||
|
location.y += 1;
|
||||||
|
if(location.y >= snake.map_size)location.y = 0;
|
||||||
|
break;
|
||||||
|
case CMovement.Direction.left:
|
||||||
|
location.x -= 1;
|
||||||
|
if(location.x < 0)location.x = snake.map_size - 1;
|
||||||
|
break;
|
||||||
|
case CMovement.Direction.right:
|
||||||
|
location.x += 1;
|
||||||
|
if(location.x >= snake.map_size)location.x = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void moveSnake(ref CSnake snake, ivec2 location)
|
||||||
|
{
|
||||||
|
if(snake.parts.length)
|
||||||
|
{
|
||||||
|
.snake.element(MapElement(),snake.parts[0]);
|
||||||
|
foreach(j; 0 .. snake.parts.length - 1)
|
||||||
|
{
|
||||||
|
snake.parts[j] = snake.parts[j + 1];
|
||||||
|
}
|
||||||
|
snake.parts[$-1] = location;
|
||||||
|
}
|
||||||
|
else .snake.element(MapElement(),location);
|
||||||
|
}
|
||||||
|
|
||||||
|
void onUpdate(EntitiesData data)
|
||||||
|
{
|
||||||
|
if(data.snakes)
|
||||||
|
{
|
||||||
|
foreach(i; 0..data.length)
|
||||||
|
{
|
||||||
|
ivec2 new_location = data.location[i];
|
||||||
|
moveLocation(data.location[i], data.movement[i].direction);
|
||||||
|
final switch(snake.element(data.location[i].location).type)
|
||||||
|
{
|
||||||
|
case MapElement.Type.snake:
|
||||||
|
launcher.manager.removeEntity(data.entities[i].id);
|
||||||
|
break;
|
||||||
|
case MapElement.Type.wall:
|
||||||
|
launcher.manager.removeEntity(data.entities[i].id);
|
||||||
|
break;
|
||||||
|
case MapElement.Type.empty:
|
||||||
|
moveSnake(data.snakes[i], new_location);
|
||||||
|
snake.element(MapElement(MapElement.Type.snake, data.entities[i].id),data.location[i].location);
|
||||||
|
break;
|
||||||
|
case MapElement.Type.apple:
|
||||||
|
launcher.manager.removeEntity(snake.element(data.location[i].location).id);
|
||||||
|
data.snakes[i].parts.add(new_location);
|
||||||
|
snake.element(MapElement(MapElement.Type.snake, data.entities[i].id),new_location);
|
||||||
|
snake.element(MapElement(MapElement.Type.snake, data.entities[i].id),data.location[i].location);
|
||||||
|
snake.addApple();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach(i; 0..data.length)
|
||||||
|
{
|
||||||
|
final switch(data.movement[i].direction)
|
||||||
|
{
|
||||||
|
case CMovement.Direction.down:data.location[i].location.y -= 1;break;
|
||||||
|
case CMovement.Direction.up:data.location[i].location.y += 1;break;
|
||||||
|
case CMovement.Direction.left:data.location[i].location.x -= 1;break;
|
||||||
|
case CMovement.Direction.right:data.location[i].location.x += 1;break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct InputSystem
|
||||||
|
{
|
||||||
|
mixin ECS.System!64;
|
||||||
|
|
||||||
|
struct EntitiesData
|
||||||
|
{
|
||||||
|
uint length;
|
||||||
|
CMovement[] movement;
|
||||||
|
@readonly CInput[] input;
|
||||||
|
}
|
||||||
|
|
||||||
|
void onUpdate(EntitiesData data)
|
||||||
|
{
|
||||||
|
foreach(i; 0..data.length)
|
||||||
|
{
|
||||||
|
if(launcher.getKeyState(SDL_SCANCODE_W))
|
||||||
|
{
|
||||||
|
data.movement[i].direction = CMovement.Direction.up;
|
||||||
|
}
|
||||||
|
else if(launcher.getKeyState(SDL_SCANCODE_S))
|
||||||
|
{
|
||||||
|
data.movement[i].direction = CMovement.Direction.down;
|
||||||
|
}
|
||||||
|
else if(launcher.getKeyState(SDL_SCANCODE_A))
|
||||||
|
{
|
||||||
|
data.movement[i].direction = CMovement.Direction.left;
|
||||||
|
}
|
||||||
|
else if(launcher.getKeyState(SDL_SCANCODE_D))
|
||||||
|
{
|
||||||
|
data.movement[i].direction = CMovement.Direction.right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct FixSnakeDirectionSystem
|
||||||
|
{
|
||||||
|
mixin ECS.System!64;
|
||||||
|
|
||||||
|
struct EntitiesData
|
||||||
|
{
|
||||||
|
uint length;
|
||||||
|
CMovement[] movement;
|
||||||
|
@readonly CILocation[] location;
|
||||||
|
const (CSnake)[] snake;
|
||||||
|
}
|
||||||
|
|
||||||
|
void onUpdate(EntitiesData data)
|
||||||
|
{
|
||||||
|
foreach(i; 0..data.length)
|
||||||
|
{
|
||||||
|
ivec2 last_location;
|
||||||
|
if(data.snake[i].parts.length)last_location = data.snake[i].parts[$ - 1];
|
||||||
|
else continue;
|
||||||
|
ivec2 next_location = data.location[i];
|
||||||
|
|
||||||
|
final switch(data.movement[i].direction)
|
||||||
|
{
|
||||||
|
case CMovement.Direction.up:
|
||||||
|
next_location.y += 1;
|
||||||
|
if(next_location.y >= snake.map_size)next_location.y = 0;
|
||||||
|
if(next_location.x == last_location.x && next_location.y == last_location.y)
|
||||||
|
{
|
||||||
|
data.movement[i].direction = CMovement.Direction.down;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CMovement.Direction.down:
|
||||||
|
next_location.y -= 1;
|
||||||
|
if(next_location.y < 0)next_location.y = snake.map_size - 1;
|
||||||
|
if(next_location.x == last_location.x && next_location.y == last_location.y)
|
||||||
|
{
|
||||||
|
data.movement[i].direction = CMovement.Direction.up;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CMovement.Direction.left:
|
||||||
|
next_location.x -= 1;
|
||||||
|
if(next_location.x < 0)next_location.x = snake.map_size - 1;
|
||||||
|
if(next_location.x == last_location.x && next_location.y == last_location.y)
|
||||||
|
{
|
||||||
|
data.movement[i].direction = CMovement.Direction.right;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CMovement.Direction.right:
|
||||||
|
next_location.x += 1;
|
||||||
|
if(next_location.x >= snake.map_size)next_location.x = 0;
|
||||||
|
if(next_location.x == last_location.x && next_location.y == last_location.y)
|
||||||
|
{
|
||||||
|
data.movement[i].direction = CMovement.Direction.left;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CleanSystem
|
||||||
|
{
|
||||||
|
mixin ECS.System!64;
|
||||||
|
|
||||||
|
struct EntitiesData
|
||||||
|
{
|
||||||
|
uint length;
|
||||||
|
Entity[] entities;
|
||||||
|
}
|
||||||
|
|
||||||
|
void onUpdate(EntitiesData data)
|
||||||
|
{
|
||||||
|
foreach(i; 0..data.length)
|
||||||
|
{
|
||||||
|
launcher.manager.removeEntity(data.entities[i].id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared Snake* snake;
|
||||||
|
|
||||||
|
void snakeStart()
|
||||||
|
{
|
||||||
|
snake = Mallocator.make!Snake;
|
||||||
|
|
||||||
|
snake.snake_texture.create();
|
||||||
|
snake.snake_texture.load("assets/textures/buckler.png");
|
||||||
|
|
||||||
|
snake.apple_texture.create();
|
||||||
|
snake.apple_texture.load("assets/textures/buckler.png");
|
||||||
|
|
||||||
|
snake.wall_texture.create();
|
||||||
|
snake.wall_texture.load("assets/textures/buckler.png");
|
||||||
|
|
||||||
|
launcher.manager.beginRegister();
|
||||||
|
|
||||||
|
launcher.manager.registerPass("fixed");
|
||||||
|
|
||||||
|
launcher.manager.registerComponent!CLocation;
|
||||||
|
launcher.manager.registerComponent!CILocation;
|
||||||
|
launcher.manager.registerComponent!CSnake;
|
||||||
|
launcher.manager.registerComponent!CApple;
|
||||||
|
launcher.manager.registerComponent!CParticle;
|
||||||
|
launcher.manager.registerComponent!CMovement;
|
||||||
|
launcher.manager.registerComponent!CInput;
|
||||||
|
|
||||||
|
launcher.manager.registerSystem!MoveSystem(0,"fixed");
|
||||||
|
launcher.manager.registerSystem!InputSystem(-100);
|
||||||
|
launcher.manager.registerSystem!FixSnakeDirectionSystem(-1,"fixed");
|
||||||
|
launcher.manager.registerSystem!AppleSystem(-1,"fixed");
|
||||||
|
|
||||||
|
launcher.manager.endRegister();
|
||||||
|
|
||||||
|
launcher.gui_manager.addSystem(MoveSystem.system_id,"Move System");
|
||||||
|
launcher.gui_manager.addSystem(InputSystem.system_id,"Input System");
|
||||||
|
launcher.gui_manager.addSystem(FixSnakeDirectionSystem.system_id,"Fix Direction System");
|
||||||
|
|
||||||
|
{
|
||||||
|
ushort[4] components = [CILocation.component_id, CSnake.component_id, CMovement.component_id, CInput.component_id];
|
||||||
|
snake.snake_tmpl = launcher.manager.allocateTemplate(components);
|
||||||
|
CILocation* loc_comp = snake.snake_tmpl.getComponent!CILocation;
|
||||||
|
loc_comp.location = ivec2(2,2);
|
||||||
|
launcher.manager.addEntity(snake.snake_tmpl);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
ushort[2] components = [CILocation.component_id, CApple.component_id];
|
||||||
|
snake.apple_tmpl = launcher.manager.allocateTemplate(components);
|
||||||
|
snake.addApple();
|
||||||
|
}
|
||||||
|
|
||||||
|
launcher.gui_manager.addTemplate(snake.snake_tmpl, "Snake");
|
||||||
|
launcher.gui_manager.addTemplate(snake.apple_tmpl, "Apple");
|
||||||
|
|
||||||
|
/*foreach(i; 0..10)
|
||||||
|
foreach(j; 0..10)
|
||||||
|
{
|
||||||
|
loc_comp.location = vec2(i*32+64,j*32+64);
|
||||||
|
launcher.manager.addEntity(simple.tmpl);
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
void snakeEnd()
|
||||||
|
{
|
||||||
|
snake.wall_texture.destroy();
|
||||||
|
snake.apple_texture.destroy();
|
||||||
|
snake.snake_texture.destroy();
|
||||||
|
|
||||||
|
//launcher.manager.freeTemplate(simple.tmpl);
|
||||||
|
Mallocator.dispose(snake);
|
||||||
|
}
|
||||||
|
|
||||||
|
void snakeTool(vec2 position, Tool tool, int size)
|
||||||
|
{
|
||||||
|
switch(tool)
|
||||||
|
{
|
||||||
|
case Tool.entity_spawner:
|
||||||
|
{
|
||||||
|
EntityTemplate* tmpl = launcher.gui_manager.getSelectedTemplate();
|
||||||
|
CLocation* location = tmpl.getComponent!CLocation;
|
||||||
|
if(location)
|
||||||
|
{
|
||||||
|
position.x += (randomf - 0.5) * size;
|
||||||
|
position.y += (randomf - 0.5) * size;
|
||||||
|
*location = position;
|
||||||
|
}
|
||||||
|
CILocation* ilocation = tmpl.getComponent!CILocation;
|
||||||
|
if(ilocation)
|
||||||
|
{
|
||||||
|
position.x += (randomf - 0.5) * size;
|
||||||
|
position.y += (randomf - 0.5) * size;
|
||||||
|
ivec2 ipos;
|
||||||
|
ipos.x = cast(int)(position.x / 32);
|
||||||
|
ipos.y = cast(int)(position.y / 32);
|
||||||
|
*ilocation = ipos;
|
||||||
|
if(snake.element(ipos).type != MapElement.Type.empty)return;
|
||||||
|
}
|
||||||
|
launcher.manager.addEntity(tmpl);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void snakeEvent(SDL_Event* event)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool snakeLoop()
|
||||||
|
{
|
||||||
|
/*if(launcher.show_demo_wnd)
|
||||||
|
{
|
||||||
|
igSetNextWindowPos(ImVec2(800 - 260, 30), ImGuiCond_Once, ImVec2(0,0));
|
||||||
|
igSetNextWindowSize(ImVec2(250, 0), ImGuiCond_Once);
|
||||||
|
if(igBegin("Snake",&launcher.show_demo_wnd,0))
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
igEnd();
|
||||||
|
}*/
|
||||||
|
|
||||||
|
launcher.manager.begin();
|
||||||
|
|
||||||
|
float delta_time = launcher.delta_time;
|
||||||
|
if(delta_time > 2000)delta_time = 2000;
|
||||||
|
__gshared float time = 0;
|
||||||
|
|
||||||
|
if(launcher.getKeyState(SDL_SCANCODE_SPACE))time += delta_time * 3;
|
||||||
|
else time += delta_time;
|
||||||
|
|
||||||
|
while(time > 100)
|
||||||
|
{
|
||||||
|
time -= 100;
|
||||||
|
|
||||||
|
launcher.manager.update("fixed");
|
||||||
|
}
|
||||||
|
|
||||||
|
launcher.manager.update();
|
||||||
|
|
||||||
|
launcher.manager.end();
|
||||||
|
|
||||||
|
snake.drawMap();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
890
demos/source/demos/space_invaders.d
Normal file
890
demos/source/demos/space_invaders.d
Normal file
|
|
@ -0,0 +1,890 @@
|
||||||
|
module demos.space_invaders;
|
||||||
|
|
||||||
|
import app;
|
||||||
|
|
||||||
|
import bindbc.sdl;
|
||||||
|
|
||||||
|
import cimgui.cimgui;
|
||||||
|
|
||||||
|
import ecs.attributes;
|
||||||
|
import ecs.core;
|
||||||
|
import ecs.entity;
|
||||||
|
import ecs.manager;
|
||||||
|
import ecs.std;
|
||||||
|
|
||||||
|
import ecs_utils.gfx.texture;
|
||||||
|
import ecs_utils.math.vector;
|
||||||
|
import ecs_utils.utils;
|
||||||
|
|
||||||
|
extern(C):
|
||||||
|
|
||||||
|
/*#######################################################################################################################
|
||||||
|
------------------------------------------------ Types ------------------------------------------------------------------
|
||||||
|
#######################################################################################################################*/
|
||||||
|
|
||||||
|
struct SpaceInvaders
|
||||||
|
{
|
||||||
|
__gshared const (char)* tips = "Use \"WASD\" keys to move and \"Space\" for shooting.";
|
||||||
|
|
||||||
|
EntityTemplate* enemy_tmpl;
|
||||||
|
EntityTemplate* ship_tmpl;
|
||||||
|
EntityTemplate* laser_tmpl;
|
||||||
|
Texture enemy_tex;
|
||||||
|
Texture ship_tex;
|
||||||
|
Texture laser_tex;
|
||||||
|
|
||||||
|
bool move_system = true;
|
||||||
|
bool draw_system = true;
|
||||||
|
|
||||||
|
const vec2 map_size = vec2(600,600);
|
||||||
|
const float cell_size = 60;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SceneGrid
|
||||||
|
{
|
||||||
|
struct Element
|
||||||
|
{
|
||||||
|
EntityID entity;
|
||||||
|
int guild;
|
||||||
|
vec2 min;
|
||||||
|
vec2 max;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Cell
|
||||||
|
{
|
||||||
|
Element[20] elements;
|
||||||
|
}
|
||||||
|
|
||||||
|
void create()
|
||||||
|
{
|
||||||
|
cells_count.x = cast(int)((space_invaders.map_size.x - 0.01f) / space_invaders.cell_size) + 1;
|
||||||
|
cells_count.y = cast(int)((space_invaders.map_size.y - 0.01f) / space_invaders.cell_size) + 1;
|
||||||
|
cells = Mallocator.makeArray!Cell(cells_count.x * cells_count.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void destory()
|
||||||
|
{
|
||||||
|
if(cells)
|
||||||
|
{
|
||||||
|
Mallocator.dispose(cells);
|
||||||
|
cells = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ivec2 cells_count;
|
||||||
|
Cell[] cells;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Direction : byte
|
||||||
|
{
|
||||||
|
up,
|
||||||
|
down,
|
||||||
|
left,
|
||||||
|
right
|
||||||
|
}
|
||||||
|
|
||||||
|
/*#######################################################################################################################
|
||||||
|
------------------------------------------------ Components ------------------------------------------------------------------
|
||||||
|
#######################################################################################################################*/
|
||||||
|
|
||||||
|
struct CLocation
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
|
||||||
|
alias value this;
|
||||||
|
|
||||||
|
vec2 value;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CScale
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
|
||||||
|
///use component as it value
|
||||||
|
alias value this;
|
||||||
|
|
||||||
|
vec2 value = vec2(32,32);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CTexture
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
|
||||||
|
Texture tex;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CVelocity
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
|
||||||
|
alias value this;
|
||||||
|
|
||||||
|
vec2 value = vec2(0,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CInput
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CEnemy
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CShip
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CAutoShoot
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CGuild
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
|
||||||
|
int guild;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CLaser
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
|
||||||
|
float damage = 1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CLaserWeapon
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
|
||||||
|
ubyte level = 1;
|
||||||
|
float shoot_time = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CShootDirection
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
|
||||||
|
Direction direction;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CSideMove
|
||||||
|
{
|
||||||
|
mixin ECS.Component;
|
||||||
|
|
||||||
|
byte group = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*#######################################################################################################################
|
||||||
|
------------------------------------------------ Events ------------------------------------------------------------------
|
||||||
|
#######################################################################################################################*/
|
||||||
|
|
||||||
|
struct EChangeDirection
|
||||||
|
{
|
||||||
|
mixin ECS.Event;
|
||||||
|
|
||||||
|
this(Direction direction)
|
||||||
|
{
|
||||||
|
this.direction = direction;
|
||||||
|
}
|
||||||
|
|
||||||
|
Direction direction;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*#######################################################################################################################
|
||||||
|
------------------------------------------------ Systems ------------------------------------------------------------------
|
||||||
|
#######################################################################################################################*/
|
||||||
|
|
||||||
|
struct DrawSystem
|
||||||
|
{
|
||||||
|
mixin ECS.System!1;
|
||||||
|
|
||||||
|
struct EntitiesData
|
||||||
|
{
|
||||||
|
uint length;
|
||||||
|
@readonly CTexture[] textures;
|
||||||
|
@readonly CLocation[] locations;
|
||||||
|
@readonly CScale[] scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
void onUpdate(EntitiesData data)
|
||||||
|
{
|
||||||
|
foreach(i; 0..data.length)
|
||||||
|
{
|
||||||
|
launcher.renderer.draw(data.textures[i].tex, data.locations[i].value, data.scale[i], vec4(0,0,1,1), 0, 0 , 0);
|
||||||
|
//draw(renderer, data.textures[i].tex, data.locations[i], vec2(32,32), vec4(0,0,1,1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CollisionSystem
|
||||||
|
{
|
||||||
|
mixin ECS.System;
|
||||||
|
|
||||||
|
struct EntitiesData
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void onUpdate(EntitiesData data)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct LaserShootingSystem
|
||||||
|
{
|
||||||
|
mixin ECS.System!32;
|
||||||
|
|
||||||
|
bool shoot = false;
|
||||||
|
float[10] laser_shoot_times = [2000,1500,1000,700,500,300,100,50,10,1];
|
||||||
|
|
||||||
|
CLocation* laser_location;
|
||||||
|
CVelocity* laser_velocity;
|
||||||
|
|
||||||
|
struct EntitiesData
|
||||||
|
{
|
||||||
|
///variable named "length" contain entites count
|
||||||
|
uint length;
|
||||||
|
@readonly CShootDirection[] shoot_direction;
|
||||||
|
@readonly @optional CAutoShoot[] auto_shoot;
|
||||||
|
@readonly CLocation[] location;
|
||||||
|
CLaserWeapon[] laser;
|
||||||
|
}
|
||||||
|
|
||||||
|
///Called inside "registerSystem" function
|
||||||
|
/*void onCreate()
|
||||||
|
{
|
||||||
|
laser_location = space_invaders.laser_tmpl.getComponent!CLocation;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
bool onBegin()
|
||||||
|
{
|
||||||
|
laser_location = space_invaders.laser_tmpl.getComponent!CLocation;
|
||||||
|
laser_velocity = space_invaders.laser_tmpl.getComponent!CVelocity;
|
||||||
|
if(launcher.getKeyState(SDL_SCANCODE_SPACE))
|
||||||
|
{
|
||||||
|
shoot = true;
|
||||||
|
}
|
||||||
|
else shoot = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void onUpdate(EntitiesData data)
|
||||||
|
{
|
||||||
|
//conditional branch for whole entities block
|
||||||
|
if(shoot || data.auto_shoot)
|
||||||
|
{
|
||||||
|
foreach(i;0..data.length)
|
||||||
|
{
|
||||||
|
CLaserWeapon* laser = &data.laser[i];
|
||||||
|
laser.shoot_time += launcher.delta_time;
|
||||||
|
while(laser.shoot_time > laser_shoot_times[laser.level - 1])
|
||||||
|
{
|
||||||
|
laser.shoot_time -= laser_shoot_times[laser.level - 1];
|
||||||
|
laser_location.value = data.location[i];
|
||||||
|
laser_velocity.value = vec2(randomf()*0.5-0.25,data.shoot_direction[i].direction == Direction.up ? 1.0 : -1.0);
|
||||||
|
launcher.manager.addEntity(space_invaders.laser_tmpl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach(i;0..data.length)
|
||||||
|
{
|
||||||
|
CLaserWeapon* laser = &data.laser[i];
|
||||||
|
laser.shoot_time += launcher.delta_time;
|
||||||
|
if(laser.shoot_time > laser_shoot_times[laser.level - 1])laser.shoot_time = laser_shoot_times[laser.level - 1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct ChangeDirectionSystem
|
||||||
|
{
|
||||||
|
mixin ECS.System!32;
|
||||||
|
|
||||||
|
Direction[8] groups_directions;
|
||||||
|
bool has_changes;
|
||||||
|
|
||||||
|
struct EntitiesData
|
||||||
|
{
|
||||||
|
uint length;
|
||||||
|
const (Entity)[] entities;
|
||||||
|
const (CLocation)[] locations;
|
||||||
|
CVelocity[] velocity;
|
||||||
|
|
||||||
|
const(CSideMove)[] side_move;
|
||||||
|
}
|
||||||
|
|
||||||
|
void onCreate()
|
||||||
|
{
|
||||||
|
foreach(ref direction; groups_directions)
|
||||||
|
{
|
||||||
|
direction = cast(Direction)-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*bool onBegin()
|
||||||
|
{
|
||||||
|
foreach(direction; groups_directions)
|
||||||
|
{
|
||||||
|
if(direction != cast(Direction)-1)//return true;
|
||||||
|
{
|
||||||
|
has_changes = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
void onEnd()
|
||||||
|
{
|
||||||
|
if(has_changes)
|
||||||
|
{
|
||||||
|
foreach(ref direction; groups_directions)
|
||||||
|
{
|
||||||
|
direction = cast(Direction)-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
has_changes = false;
|
||||||
|
foreach(ref direction; groups_directions)
|
||||||
|
{
|
||||||
|
if(direction != cast(Direction)-1)
|
||||||
|
{
|
||||||
|
has_changes = true;
|
||||||
|
//direction = cast(Direction)-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*foreach(ref direction; groups_directions)
|
||||||
|
{
|
||||||
|
direction = cast(Direction)-1;
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
void onUpdate(EntitiesData data)
|
||||||
|
{
|
||||||
|
//if(!data.side_move)return;
|
||||||
|
if(has_changes)
|
||||||
|
foreach(i;0..data.length)
|
||||||
|
{
|
||||||
|
byte group = data.side_move[i].group;
|
||||||
|
if(group == -1)
|
||||||
|
{
|
||||||
|
if(data.locations[i].x < 0)
|
||||||
|
{
|
||||||
|
if(data.velocity[i].x < 0)data.velocity[i].x = -data.velocity[i].x;
|
||||||
|
}
|
||||||
|
else if(data.locations[i].x > space_invaders.map_size.x)
|
||||||
|
{
|
||||||
|
if(data.velocity[i].x > 0)data.velocity[i].x = -data.velocity[i].x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Direction direction = groups_directions[group];
|
||||||
|
if(direction != cast(Direction)-1)
|
||||||
|
{
|
||||||
|
CVelocity* velocity = &data.velocity[i];
|
||||||
|
final switch(direction)
|
||||||
|
{
|
||||||
|
case Direction.up:
|
||||||
|
if(velocity.value.y > 0)velocity.value.y = -velocity.value.y;
|
||||||
|
break;
|
||||||
|
case Direction.down:
|
||||||
|
if(velocity.value.y < 0)velocity.value.y = -velocity.value.y;
|
||||||
|
break;
|
||||||
|
case Direction.left:
|
||||||
|
if(velocity.value.x > 0)velocity.value.x = -velocity.value.x;
|
||||||
|
break;
|
||||||
|
case Direction.right:
|
||||||
|
if(velocity.value.x < 0)velocity.value.x = -velocity.value.x;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach(i;0..data.length)
|
||||||
|
{
|
||||||
|
if(data.locations[i].x < 0)
|
||||||
|
{
|
||||||
|
if(data.side_move[i].group == -1)
|
||||||
|
{
|
||||||
|
if(data.velocity[i].x < 0)data.velocity[i].x = -data.velocity[i].x;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
groups_directions[data.side_move[i].group] = Direction.right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(data.locations[i].x > space_invaders.map_size.x)
|
||||||
|
{
|
||||||
|
if(data.side_move[i].group == -1)
|
||||||
|
{
|
||||||
|
if(data.velocity[i].x > 0)data.velocity[i].x = -data.velocity[i].x;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
groups_directions[data.side_move[i].group] = Direction.left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//if(data.locations[i].y < 0) data.locations[i].y = 0;
|
||||||
|
//else if(data.locations[i].y > space_invaders.map_size.y)data.locations[i].y = space_invaders.map_size.y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void handleEvent(Entity* entity, EChangeDirection event)
|
||||||
|
{
|
||||||
|
CSideMove* side_move = entity.getComponent!CSideMove;
|
||||||
|
if(side_move && side_move.group != -1)
|
||||||
|
{
|
||||||
|
groups_directions[side_move.group] = event.direction;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//Entity* entity = launcher.manager.getEntity(event.entity_id);
|
||||||
|
CVelocity* velocity = entity.getComponent!CVelocity;
|
||||||
|
final switch(event.direction)
|
||||||
|
{
|
||||||
|
case Direction.up:
|
||||||
|
if(velocity.value.y > 0)velocity.value.y = -velocity.value.y;
|
||||||
|
break;
|
||||||
|
case Direction.down:
|
||||||
|
if(velocity.value.y < 0)velocity.value.y = -velocity.value.y;
|
||||||
|
break;
|
||||||
|
case Direction.left:
|
||||||
|
if(velocity.value.x > 0)velocity.value.x = -velocity.value.x;
|
||||||
|
break;
|
||||||
|
case Direction.right:
|
||||||
|
if(velocity.value.x < 0)velocity.value.x = -velocity.value.x;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct ClampPositionSystem
|
||||||
|
{
|
||||||
|
mixin ECS.System!32;
|
||||||
|
mixin ECS.ExcludedComponents!(CSideMove);
|
||||||
|
|
||||||
|
struct EntitiesData
|
||||||
|
{
|
||||||
|
uint length;
|
||||||
|
const (Entity)[] entities;
|
||||||
|
//components are treated as required by default
|
||||||
|
CLocation[] locations;
|
||||||
|
|
||||||
|
@optional const (CLaser)[] laser;
|
||||||
|
//@optional CVelocity[] velocity;
|
||||||
|
//@optional const (CSideMove)[] side_move;
|
||||||
|
}
|
||||||
|
|
||||||
|
//ChangeDirectionSystem change_direction_system;
|
||||||
|
|
||||||
|
void onUpdate(EntitiesData data)
|
||||||
|
{
|
||||||
|
if(data.laser)
|
||||||
|
{
|
||||||
|
foreach(i;0..data.length)
|
||||||
|
{
|
||||||
|
if(data.locations[i].x < 0 || data.locations[i].x > space_invaders.map_size.x ||
|
||||||
|
data.locations[i].y < 0 || data.locations[i].y > space_invaders.map_size.y)launcher.manager.removeEntity(data.entities[i].id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*else if(data.side_move)
|
||||||
|
{
|
||||||
|
foreach(i;0..data.length)
|
||||||
|
{
|
||||||
|
if(data.locations[i].x < 0)
|
||||||
|
{
|
||||||
|
//data.locations[i].x = 0;
|
||||||
|
//launcher.manager.sendEvent(data.entities[i].id,EChangeDirection(Direction.right));
|
||||||
|
if(data.side_move[i].group == -1)
|
||||||
|
{
|
||||||
|
if(data.velocity[i].x < 0)data.velocity[i].x = -data.velocity[i].x;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
change_direction_system.groups_directions[data.side_move[i].group] = Direction.left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(data.locations[i].x > space_invaders.map_size.x)
|
||||||
|
{
|
||||||
|
//data.locations[i].x = space_invaders.map_size.x;
|
||||||
|
//launcher.manager.sendEvent(data.entities[i].id,EChangeDirection(Direction.left));
|
||||||
|
if(data.side_move[i].group == -1)
|
||||||
|
{
|
||||||
|
if(data.velocity[i].x > 0)data.velocity[i].x = -data.velocity[i].x;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
change_direction_system.groups_directions[data.side_move[i].group] = Direction.right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(data.locations[i].y < 0) data.locations[i].y = 0;
|
||||||
|
else if(data.locations[i].y > space_invaders.map_size.y)data.locations[i].y = space_invaders.map_size.y;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach(i;0..data.length)
|
||||||
|
{
|
||||||
|
if(data.locations[i].x < 0)data.locations[i].x = 0;
|
||||||
|
else if(data.locations[i].x > space_invaders.map_size.x)data.locations[i].x = space_invaders.map_size.x;
|
||||||
|
if(data.locations[i].y < 0)data.locations[i].y = 0;
|
||||||
|
else if(data.locations[i].y > space_invaders.map_size.y)data.locations[i].y = space_invaders.map_size.y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct MovementSystem
|
||||||
|
{
|
||||||
|
mixin ECS.System!32;
|
||||||
|
|
||||||
|
struct EntitiesData
|
||||||
|
{
|
||||||
|
uint length;
|
||||||
|
//read only components can be marked with @readonly attribute or with const expression instead
|
||||||
|
const (CVelocity)[] velocity;
|
||||||
|
//components are treated as required by default
|
||||||
|
CLocation[] locations;
|
||||||
|
//@optional const (CLaser)[] laser;
|
||||||
|
const (Entity)[] entities;
|
||||||
|
|
||||||
|
@optional CSideMove[] side_move;
|
||||||
|
}
|
||||||
|
|
||||||
|
void onUpdate(EntitiesData data)
|
||||||
|
{
|
||||||
|
foreach(i;0..data.length)
|
||||||
|
{
|
||||||
|
data.locations[i].x += data.velocity[i].x * launcher.delta_time;
|
||||||
|
data.locations[i].y += data.velocity[i].y * launcher.delta_time;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*System is responsible for movement of objects with CInput component.
|
||||||
|
*In this example every entity has same speed when using movement system.
|
||||||
|
*/
|
||||||
|
struct InputMovementSystem
|
||||||
|
{
|
||||||
|
mixin ECS.System!32;
|
||||||
|
|
||||||
|
vec2 move_vector;
|
||||||
|
|
||||||
|
struct EntitiesData
|
||||||
|
{
|
||||||
|
uint length;
|
||||||
|
//read only components can be marked with @readonly attribute or with const expression instead
|
||||||
|
const (CInput)[] input;
|
||||||
|
//components are treated as required by default
|
||||||
|
CLocation[] locations;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*onBegin gives opportunity to check keys once and call update on entities only when
|
||||||
|
*one key is pressed.
|
||||||
|
*/
|
||||||
|
bool onBegin()
|
||||||
|
{
|
||||||
|
if(launcher.getKeyState(SDL_SCANCODE_W))
|
||||||
|
{
|
||||||
|
move_vector = vec2(0,1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if(launcher.getKeyState(SDL_SCANCODE_S))
|
||||||
|
{
|
||||||
|
move_vector = vec2(0,-1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if(launcher.getKeyState(SDL_SCANCODE_A))
|
||||||
|
{
|
||||||
|
move_vector = vec2(-1,0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if(launcher.getKeyState(SDL_SCANCODE_D))
|
||||||
|
{
|
||||||
|
move_vector = vec2(1,0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
//don't call system update because no key pressed
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*Update is called multiple times in one "manager.update()" call.
|
||||||
|
*Number of "onUpdate" calls is count of buffers which must be updated during pass.
|
||||||
|
*When multithreading is used, number of "onUpdate" calls can be greater due to fact that
|
||||||
|
*JobSystem can split buffers for better data packing.
|
||||||
|
*/
|
||||||
|
void onUpdate(EntitiesData data)
|
||||||
|
{
|
||||||
|
//move every entity using movement vector
|
||||||
|
foreach(i; 0..data.length)
|
||||||
|
{
|
||||||
|
data.locations[i].x += move_vector.x * launcher.delta_time * 0.5;
|
||||||
|
data.locations[i].y += move_vector.y * launcher.delta_time * 0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*#######################################################################################################################
|
||||||
|
------------------------------------------------ Functions ------------------------------------------------------------------
|
||||||
|
#######################################################################################################################*/
|
||||||
|
|
||||||
|
__gshared SpaceInvaders* space_invaders;
|
||||||
|
|
||||||
|
void spaceInvadersStart()
|
||||||
|
{
|
||||||
|
space_invaders = Mallocator.make!SpaceInvaders;
|
||||||
|
|
||||||
|
space_invaders.ship_tex.create();
|
||||||
|
space_invaders.ship_tex.load("assets/textures/buckler.png");
|
||||||
|
|
||||||
|
space_invaders.laser_tex.create();
|
||||||
|
space_invaders.laser_tex.load("assets/textures/buckler.png");
|
||||||
|
|
||||||
|
launcher.manager.beginRegister();
|
||||||
|
|
||||||
|
launcher.manager.registerComponent!CLocation;
|
||||||
|
launcher.manager.registerComponent!CTexture;
|
||||||
|
launcher.manager.registerComponent!CInput;
|
||||||
|
launcher.manager.registerComponent!CShip;
|
||||||
|
launcher.manager.registerComponent!CEnemy;
|
||||||
|
launcher.manager.registerComponent!CScale;
|
||||||
|
launcher.manager.registerComponent!CShootDirection;
|
||||||
|
launcher.manager.registerComponent!CAutoShoot;
|
||||||
|
launcher.manager.registerComponent!CLaserWeapon;
|
||||||
|
launcher.manager.registerComponent!CVelocity;
|
||||||
|
launcher.manager.registerComponent!CLaser;
|
||||||
|
launcher.manager.registerComponent!CSideMove;
|
||||||
|
|
||||||
|
launcher.manager.registerEvent!EChangeDirection;
|
||||||
|
|
||||||
|
//launcher.manager.registerSystem!MoveSystem(0);
|
||||||
|
launcher.manager.registerSystem!DrawSystem(100);
|
||||||
|
launcher.manager.registerSystem!InputMovementSystem(-100);
|
||||||
|
launcher.manager.registerSystem!LaserShootingSystem(0);
|
||||||
|
launcher.manager.registerSystem!MovementSystem(0);
|
||||||
|
launcher.manager.registerSystem!ClampPositionSystem(1);
|
||||||
|
launcher.manager.registerSystem!ChangeDirectionSystem(0);
|
||||||
|
|
||||||
|
launcher.manager.endRegister();
|
||||||
|
|
||||||
|
launcher.gui_manager.addSystem(DrawSystem.system_id,"Draw System");
|
||||||
|
launcher.gui_manager.addSystem(InputMovementSystem.system_id,"Input Movement");
|
||||||
|
launcher.gui_manager.addSystem(LaserShootingSystem.system_id,"Laser Shooting");
|
||||||
|
launcher.gui_manager.addSystem(MovementSystem.system_id,"Movement System");
|
||||||
|
launcher.gui_manager.addSystem(ClampPositionSystem.system_id,"Clamp Position System");
|
||||||
|
launcher.gui_manager.addSystem(ChangeDirectionSystem.system_id,"Change Direction System");
|
||||||
|
|
||||||
|
//launcher.manager.getSystem(CleanSystem.system_id).disable();
|
||||||
|
{
|
||||||
|
ushort[7] components = [CLocation.component_id, CTexture.component_id, CInput.component_id, CShip.component_id, CScale.component_id, CLaserWeapon.component_id, CShootDirection.component_id];
|
||||||
|
space_invaders.ship_tmpl = launcher.manager.allocateTemplate(components);
|
||||||
|
|
||||||
|
CTexture* tex_comp = space_invaders.ship_tmpl.getComponent!CTexture;
|
||||||
|
tex_comp.tex = space_invaders.ship_tex;
|
||||||
|
CLocation* loc_comp = space_invaders.ship_tmpl.getComponent!CLocation;
|
||||||
|
loc_comp.value = vec2(64,64);
|
||||||
|
CLaserWeapon* weapon = space_invaders.ship_tmpl.getComponent!CLaserWeapon;
|
||||||
|
weapon.level = 10;
|
||||||
|
|
||||||
|
launcher.manager.addEntity(space_invaders.ship_tmpl);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
ushort[5] components = [CLocation.component_id, CTexture.component_id, CVelocity.component_id, CScale.component_id, CLaser.component_id];
|
||||||
|
space_invaders.laser_tmpl = launcher.manager.allocateTemplate(components);
|
||||||
|
|
||||||
|
CTexture* tex_comp = space_invaders.laser_tmpl.getComponent!CTexture;
|
||||||
|
tex_comp.tex = space_invaders.laser_tex;
|
||||||
|
CScale* scale_comp = space_invaders.laser_tmpl.getComponent!CScale;
|
||||||
|
scale_comp.value = vec2(4,16);
|
||||||
|
CVelocity* vel_comp = space_invaders.laser_tmpl.getComponent!CVelocity;
|
||||||
|
vel_comp.value = vec2(0,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
EntityTemplate* enemy_tmpl;
|
||||||
|
EntityTemplate* grouped_tmpl;
|
||||||
|
EntityID enemy_id;
|
||||||
|
EntityID grouped_id;
|
||||||
|
|
||||||
|
{
|
||||||
|
ushort[8] components = [CVelocity.component_id, CAutoShoot.component_id, CLocation.component_id, CTexture.component_id, CScale.component_id, CLaserWeapon.component_id, CEnemy.component_id, CShootDirection.component_id];//, CVelocity.component_id];
|
||||||
|
space_invaders.enemy_tmpl = launcher.manager.allocateTemplate(components);
|
||||||
|
|
||||||
|
CTexture* tex_comp = space_invaders.enemy_tmpl.getComponent!CTexture;
|
||||||
|
tex_comp.tex = space_invaders.ship_tex;
|
||||||
|
CLocation* loc_comp = space_invaders.enemy_tmpl.getComponent!CLocation;
|
||||||
|
loc_comp.value = vec2(64,space_invaders.map_size.y - 64);
|
||||||
|
CShootDirection* shoot_dir_comp = space_invaders.enemy_tmpl.getComponent!CShootDirection;
|
||||||
|
shoot_dir_comp.direction = Direction.down;
|
||||||
|
CVelocity* vel_comp = space_invaders.enemy_tmpl.getComponent!CVelocity;
|
||||||
|
vel_comp.value = vec2(0.1,0);
|
||||||
|
|
||||||
|
Entity* current_entity;
|
||||||
|
|
||||||
|
current_entity = launcher.manager.addEntity(space_invaders.enemy_tmpl);
|
||||||
|
launcher.manager.addComponents(current_entity.id,CSideMove(0));
|
||||||
|
|
||||||
|
loc_comp.value = vec2(128,space_invaders.map_size.y - 64);
|
||||||
|
current_entity = launcher.manager.addEntity(space_invaders.enemy_tmpl);
|
||||||
|
launcher.manager.addComponents(current_entity.id,CSideMove(-1));
|
||||||
|
|
||||||
|
enemy_id = current_entity.id;
|
||||||
|
//enemy_tmpl = launcher.manager.allocateTemplate(current_entity.id);
|
||||||
|
|
||||||
|
loc_comp.value = vec2(256,space_invaders.map_size.y - 64);
|
||||||
|
launcher.manager.addEntity(space_invaders.enemy_tmpl);
|
||||||
|
|
||||||
|
loc_comp.value = vec2(0,space_invaders.map_size.y - 64);
|
||||||
|
current_entity = launcher.manager.addEntity(space_invaders.enemy_tmpl);
|
||||||
|
launcher.manager.addComponents(current_entity.id,CSideMove(0));
|
||||||
|
|
||||||
|
grouped_id = current_entity.id;
|
||||||
|
//grouped_tmpl = launcher.manager.allocateTemplate(current_entity.id);
|
||||||
|
}
|
||||||
|
launcher.manager.commit();
|
||||||
|
|
||||||
|
enemy_tmpl = launcher.manager.allocateTemplate(enemy_id);
|
||||||
|
grouped_tmpl = launcher.manager.allocateTemplate(grouped_id);
|
||||||
|
|
||||||
|
launcher.gui_manager.addTemplate(space_invaders.ship_tmpl,"Ship");
|
||||||
|
launcher.gui_manager.addTemplate(enemy_tmpl,"Enemy");
|
||||||
|
launcher.gui_manager.addTemplate(grouped_tmpl,"Grouped enemy");
|
||||||
|
launcher.gui_manager.addTemplate(space_invaders.laser_tmpl,"Laser");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void spaceInvadersEnd()
|
||||||
|
{
|
||||||
|
|
||||||
|
launcher.manager.getSystem(DrawSystem.system_id).disable();
|
||||||
|
launcher.manager.getSystem(InputMovementSystem.system_id).disable();
|
||||||
|
launcher.manager.getSystem(LaserShootingSystem.system_id).disable();
|
||||||
|
launcher.manager.getSystem(MovementSystem.system_id).disable();
|
||||||
|
launcher.manager.getSystem(ClampPositionSystem.system_id).disable();
|
||||||
|
|
||||||
|
space_invaders.ship_tex.destroy();
|
||||||
|
|
||||||
|
launcher.manager.freeTemplate(space_invaders.enemy_tmpl);
|
||||||
|
Mallocator.dispose(space_invaders);
|
||||||
|
}
|
||||||
|
|
||||||
|
void spaceInvadersTool(vec2 position, Tool tool, int size)
|
||||||
|
{
|
||||||
|
switch(tool)
|
||||||
|
{
|
||||||
|
case Tool.entity_spawner:
|
||||||
|
{
|
||||||
|
EntityTemplate* tmpl = launcher.gui_manager.getSelectedTemplate();
|
||||||
|
CLocation* location = tmpl.getComponent!CLocation;
|
||||||
|
if(location)
|
||||||
|
{
|
||||||
|
position.x += (randomf - 0.5) * size;
|
||||||
|
position.y += (randomf - 0.5) * size;
|
||||||
|
*location = position;
|
||||||
|
}
|
||||||
|
launcher.manager.addEntity(tmpl);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void spaceInvadersEvent(SDL_Event* event)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool spaceInvadersLoop()
|
||||||
|
{
|
||||||
|
|
||||||
|
/*if(launcher.show_demo_wnd)
|
||||||
|
{
|
||||||
|
igSetNextWindowPos(ImVec2(800 - 260, 30), ImGuiCond_Once, ImVec2(0,0));
|
||||||
|
igSetNextWindowSize(ImVec2(250, 0), ImGuiCond_Once);
|
||||||
|
if(igBegin("Simple",&launcher.show_demo_wnd,0))
|
||||||
|
{
|
||||||
|
if(igCheckbox("Move system",&simple.move_system))
|
||||||
|
{
|
||||||
|
if(simple.move_system)launcher.manager.getSystem(MoveSystem.system_id).enable();
|
||||||
|
else launcher.manager.getSystem(MoveSystem.system_id).disable();
|
||||||
|
}
|
||||||
|
if(igCheckbox("Draw system",&simple.draw_system))
|
||||||
|
{
|
||||||
|
if(simple.draw_system)launcher.manager.getSystem(DrawSystem.system_id).enable();
|
||||||
|
else launcher.manager.getSystem(DrawSystem.system_id).disable();
|
||||||
|
}
|
||||||
|
igPushButtonRepeat(true);
|
||||||
|
igColumns(3,null,0);
|
||||||
|
if(igButton("Spawn",ImVec2(-1,0)))
|
||||||
|
{
|
||||||
|
spawnEntity();
|
||||||
|
}
|
||||||
|
igNextColumn();
|
||||||
|
if(igButton("+10",ImVec2(-1,0)))
|
||||||
|
{
|
||||||
|
foreach(i;0..10)spawnEntity();
|
||||||
|
}
|
||||||
|
igNextColumn();
|
||||||
|
if(igButton("+100",ImVec2(-1,0)))
|
||||||
|
{
|
||||||
|
foreach(i;0..100)spawnEntity();
|
||||||
|
}
|
||||||
|
igPopButtonRepeat();
|
||||||
|
igColumns(1,null,0);
|
||||||
|
if(igButton("Clear",ImVec2(-1,0)))
|
||||||
|
{
|
||||||
|
launcher.manager.getSystem(CleanSystem.system_id).enable();
|
||||||
|
launcher.manager.begin();
|
||||||
|
launcher.manager.update();
|
||||||
|
launcher.manager.end();
|
||||||
|
launcher.manager.getSystem(CleanSystem.system_id).disable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
igEnd();
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/*if(launcher.show_tips)
|
||||||
|
{
|
||||||
|
igSetNextWindowPos(ImVec2(800 - 550, 80), ImGuiCond_Once, ImVec2(0,0));
|
||||||
|
igSetNextWindowSize(ImVec2(300, 0), ImGuiCond_Once);
|
||||||
|
if(igBegin("Tips",&launcher.show_tips,ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings))
|
||||||
|
{
|
||||||
|
igTextWrapped("Use \"space\" to spwan entities.\n\nSystems can be enabled/disabled from \"Simple\" window.");
|
||||||
|
}
|
||||||
|
igEnd();
|
||||||
|
}*/
|
||||||
|
|
||||||
|
launcher.manager.begin();
|
||||||
|
if(launcher.multithreading)
|
||||||
|
{
|
||||||
|
launcher.job_updater.begin();
|
||||||
|
launcher.manager.updateMT();
|
||||||
|
launcher.job_updater.call();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
launcher.manager.update();
|
||||||
|
}
|
||||||
|
launcher.manager.end();
|
||||||
|
|
||||||
|
/*foreach(i;0..1000)//13000)
|
||||||
|
{
|
||||||
|
launcher.renderer.draw(simple.texture,vec2(i%100*32,i/100*32),vec2(32,32),vec4(0,0,1,1),0.0);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
247
demos/source/game_core/job_updater.d
Normal file
247
demos/source/game_core/job_updater.d
Normal file
|
|
@ -0,0 +1,247 @@
|
||||||
|
module game_core.job_updater;
|
||||||
|
|
||||||
|
import ecs.std;
|
||||||
|
import ecs.vector;
|
||||||
|
import ecs.atomic;
|
||||||
|
|
||||||
|
import ecs_utils.utils;
|
||||||
|
|
||||||
|
//import core.time;
|
||||||
|
import ecs.manager;
|
||||||
|
import mmutils.thread_pool;
|
||||||
|
|
||||||
|
version(LDC)
|
||||||
|
{
|
||||||
|
import ldc.attributes;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
struct optStrategy {
|
||||||
|
string strategy;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//import supre.core.call_graph_generator;
|
||||||
|
|
||||||
|
struct ECSJobUpdater
|
||||||
|
{
|
||||||
|
|
||||||
|
this(uint threads)
|
||||||
|
{
|
||||||
|
onCreate(threads);
|
||||||
|
}
|
||||||
|
|
||||||
|
~this()
|
||||||
|
{
|
||||||
|
pool.waitThreads();
|
||||||
|
//pool.unregistExternalThread(thread_data);
|
||||||
|
if(jobs)Mallocator.dispose(jobs);
|
||||||
|
version(WebAssembly)pthread_key_delete(tls_key);
|
||||||
|
}
|
||||||
|
|
||||||
|
version(WebAssembly)
|
||||||
|
{
|
||||||
|
__gshared pthread_key_t tls_key;
|
||||||
|
}
|
||||||
|
else static uint thread_id = 0;
|
||||||
|
|
||||||
|
ThreadPool pool;
|
||||||
|
ThreadData* thread_data;
|
||||||
|
|
||||||
|
int job_id = 0;
|
||||||
|
int no_dep_count = 0;
|
||||||
|
//static uint thread_id = 0;
|
||||||
|
|
||||||
|
struct Group
|
||||||
|
{
|
||||||
|
~this() nothrow
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JobsGroup group;
|
||||||
|
JobData[1024] jobs;
|
||||||
|
JobCaller[1024] callers;
|
||||||
|
uint count = 0;
|
||||||
|
|
||||||
|
void dependantOn(Group* dependency)
|
||||||
|
{
|
||||||
|
group.dependantOn(&dependency.group);
|
||||||
|
}
|
||||||
|
|
||||||
|
void start()
|
||||||
|
{
|
||||||
|
group.thPool.addGroupAsynchronous(&group);
|
||||||
|
}
|
||||||
|
|
||||||
|
void build(ThreadPool* pool)
|
||||||
|
{
|
||||||
|
group.thPool = pool;
|
||||||
|
group.jobs = jobs[0..count];
|
||||||
|
}
|
||||||
|
|
||||||
|
void clear()
|
||||||
|
{
|
||||||
|
group = JobsGroup("name",null);
|
||||||
|
count = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void add(JobCaller caller)
|
||||||
|
{
|
||||||
|
callers[count] = caller;
|
||||||
|
jobs[count] = JobData(&callers[count].callJob,"hmm");
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Group[] jobs;
|
||||||
|
Vector!(Group*) call_jobs;
|
||||||
|
Group last_job;
|
||||||
|
JobData[1] groupEndJobs;
|
||||||
|
|
||||||
|
//TrackData[32] trackers;
|
||||||
|
|
||||||
|
void onCreate(uint threads_count)
|
||||||
|
{
|
||||||
|
version(WebAssembly)pthread_key_create(&tls_key, null);
|
||||||
|
|
||||||
|
pool.initialize();
|
||||||
|
thread_data = pool.registerExternalThread();
|
||||||
|
pool.setThreadsNum(threads_count);
|
||||||
|
|
||||||
|
jobs = Mallocator.makeArray!Group(256);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint getThreadID() @nogc nothrow
|
||||||
|
{
|
||||||
|
version(WebAssembly)return cast(int)pthread_getspecific(tls_key);
|
||||||
|
else return thread_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
void begin()
|
||||||
|
{
|
||||||
|
job_id = 0;
|
||||||
|
call_jobs.clear();
|
||||||
|
|
||||||
|
foreach(ref job;jobs)
|
||||||
|
{
|
||||||
|
job.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
last_job.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void clearTracker()
|
||||||
|
{
|
||||||
|
//foreach(ref tracker;trackers)tracker.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
@optStrategy("none")
|
||||||
|
void nop()
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//@optStrategy("none")
|
||||||
|
void call()
|
||||||
|
{
|
||||||
|
if(last_job.group.getDependenciesWaitCount() == 0)return;
|
||||||
|
if(call_jobs.length == 0)return;
|
||||||
|
|
||||||
|
//JobData[1] groupEndJobs;
|
||||||
|
groupEndJobs[0] = JobData(&releaseMainThread, "Stop Threads", null, null);
|
||||||
|
|
||||||
|
last_job.group.jobs = groupEndJobs;
|
||||||
|
last_job.group.thPool = &pool;
|
||||||
|
last_job.group.executeOnThreadNum = 0;
|
||||||
|
|
||||||
|
foreach(job;call_jobs)
|
||||||
|
{
|
||||||
|
job.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*while(atomicLoad(ret) == 1)//!cas(&ret,0,1))
|
||||||
|
{
|
||||||
|
nop();
|
||||||
|
version(WebAssembly)//emscripten_main_thread_process_queued_calls();
|
||||||
|
}//*/
|
||||||
|
|
||||||
|
thread_data.threadStartFunc();
|
||||||
|
}
|
||||||
|
|
||||||
|
void releaseMainThread(ThreadData* th_data, JobData* data)
|
||||||
|
{
|
||||||
|
//atomicStore(ret,0);
|
||||||
|
pool.releaseExternalThreads();
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct JobCaller
|
||||||
|
{
|
||||||
|
EntityManager.Job* job;
|
||||||
|
ECSJobUpdater* updater;
|
||||||
|
uint id;
|
||||||
|
|
||||||
|
void callJob(ThreadData* th_data, JobData* data)
|
||||||
|
{
|
||||||
|
|
||||||
|
//uint job_id = updater.getThreadID();
|
||||||
|
//updater.trackers[job_id].begin(id);
|
||||||
|
version(WebAssembly)
|
||||||
|
{
|
||||||
|
//updater.thread_id = th_data.threadId;
|
||||||
|
pthread_setspecific(tls_key, cast(void*)th_data.threadId);
|
||||||
|
if(th_data.threadId == 0)
|
||||||
|
{
|
||||||
|
emscripten_main_thread_process_queued_calls();
|
||||||
|
job.execute();
|
||||||
|
emscripten_main_thread_process_queued_calls();
|
||||||
|
}
|
||||||
|
else job.execute();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
updater.thread_id = th_data.threadId;
|
||||||
|
job.execute();
|
||||||
|
}
|
||||||
|
//atomicOp!"-="(updater.jobs_count,1);
|
||||||
|
//updater.trackers[job_id].end();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void dispatch(EntityManager.JobGroup group)
|
||||||
|
{
|
||||||
|
if(group.jobs.length == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach(ref job;group.jobs)
|
||||||
|
{
|
||||||
|
uint index = 0;
|
||||||
|
if(job.callers.length)index = job.callers[0].system_id;
|
||||||
|
JobCaller caller;
|
||||||
|
caller.updater = &this;
|
||||||
|
caller.job = &job;
|
||||||
|
caller.id = index;
|
||||||
|
jobs[group.id].add(caller);
|
||||||
|
}
|
||||||
|
|
||||||
|
jobs[group.id].build(&pool);
|
||||||
|
|
||||||
|
uint deps = cast(uint)group.dependencies.length;
|
||||||
|
|
||||||
|
foreach(dep;group.dependencies)
|
||||||
|
{
|
||||||
|
if(jobs[dep.id].count && dep.caller.system.execute && dep.caller.system.enabled)jobs[group.id].dependantOn(&jobs[dep.id]);
|
||||||
|
else deps--;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(deps == 0)
|
||||||
|
{
|
||||||
|
call_jobs.add(&jobs[group.id]);
|
||||||
|
}
|
||||||
|
|
||||||
|
last_job.dependantOn(&jobs[group.id]);
|
||||||
|
}
|
||||||
|
}
|
||||||
6
demos/source/gui/component.d
Normal file
6
demos/source/gui/component.d
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
module gui.components;
|
||||||
|
|
||||||
|
struct ComponentGUI
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
97
demos/source/gui/manager.d
Normal file
97
demos/source/gui/manager.d
Normal file
|
|
@ -0,0 +1,97 @@
|
||||||
|
module gui.manager;
|
||||||
|
|
||||||
|
import app;
|
||||||
|
|
||||||
|
import cimgui.cimgui;
|
||||||
|
|
||||||
|
import ecs.std;
|
||||||
|
import ecs.system;
|
||||||
|
import ecs.vector;
|
||||||
|
import ecs.entity;
|
||||||
|
|
||||||
|
import gui.system;
|
||||||
|
import gui.template_;
|
||||||
|
|
||||||
|
extern(C):
|
||||||
|
|
||||||
|
struct GUIManager
|
||||||
|
{
|
||||||
|
Vector!SystemGUI systems;
|
||||||
|
Vector!TemplateGUI templates;
|
||||||
|
|
||||||
|
uint selected_tempalte = 0;
|
||||||
|
|
||||||
|
void clear()
|
||||||
|
{
|
||||||
|
foreach(tmpl; templates)
|
||||||
|
{
|
||||||
|
launcher.manager.freeTemplate(tmpl.tmpl);
|
||||||
|
}
|
||||||
|
|
||||||
|
systems.clear();
|
||||||
|
templates.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
EntityTemplate* getSelectedTemplate()
|
||||||
|
{
|
||||||
|
if(templates.length > selected_tempalte)return templates[selected_tempalte].tmpl;
|
||||||
|
else return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
void addSystem(ushort id, const (char)* name, bool enabled = true)
|
||||||
|
{
|
||||||
|
System* system = launcher.manager.getSystem(id);
|
||||||
|
//const (char)* name =
|
||||||
|
systems.add(SystemGUI(name,system,enabled));
|
||||||
|
}
|
||||||
|
|
||||||
|
void addTemplate(ushort[] components, const (char)* name)
|
||||||
|
{
|
||||||
|
templates.add(TemplateGUI(name, launcher.manager.allocateTemplate(components)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void addTemplate(EntityTemplate* tmpl, const (char)* name)
|
||||||
|
{
|
||||||
|
templates.add(TemplateGUI(name, tmpl));
|
||||||
|
}
|
||||||
|
|
||||||
|
void gui()
|
||||||
|
{
|
||||||
|
if(igCollapsingHeader("Systems", ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_FramePadding))
|
||||||
|
{
|
||||||
|
bool true_ = true;
|
||||||
|
igIndent(8);
|
||||||
|
foreach(ref SystemGUI system;systems)
|
||||||
|
{
|
||||||
|
if(igCheckbox(system.name,&system.enabled))
|
||||||
|
{
|
||||||
|
if(system.enabled)system.system.enable();
|
||||||
|
else system.system.disable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
igUnindent(8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void toolGui()
|
||||||
|
{
|
||||||
|
if(templates.length)
|
||||||
|
{
|
||||||
|
if(igBeginCombo("Template",templates[selected_tempalte].name,0))
|
||||||
|
{
|
||||||
|
foreach(i, tmpl; templates)
|
||||||
|
{
|
||||||
|
if(igSelectable(tmpl.name,false,0,ImVec2(0,0)))
|
||||||
|
{
|
||||||
|
selected_tempalte = cast(uint)i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
igEndCombo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(igBeginCombo("Template",null,0))igEndCombo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
demos/source/gui/system.d
Normal file
11
demos/source/gui/system.d
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
module gui.system;
|
||||||
|
|
||||||
|
import ecs.system;
|
||||||
|
|
||||||
|
struct SystemGUI
|
||||||
|
{
|
||||||
|
const (char)* name;
|
||||||
|
System* system;
|
||||||
|
|
||||||
|
bool enabled = true;
|
||||||
|
}
|
||||||
9
demos/source/gui/template_.d
Normal file
9
demos/source/gui/template_.d
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
module gui.template_;
|
||||||
|
|
||||||
|
import ecs.entity;
|
||||||
|
|
||||||
|
struct TemplateGUI
|
||||||
|
{
|
||||||
|
const (char)* name;
|
||||||
|
EntityTemplate* tmpl;
|
||||||
|
}
|
||||||
49
demos/utils/dub.json
Normal file
49
demos/utils/dub.json
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
{
|
||||||
|
"name": "ecs_utils",
|
||||||
|
"authors": [
|
||||||
|
"Michał Masiukiewicz", "Dawid Masiukiewicz"
|
||||||
|
],
|
||||||
|
"description": "Dynamic Entity Component System examples utils",
|
||||||
|
"copyright": "Copyright © 2018-2019, Michał Masiukiewicz, Dawid Masiukiewicz",
|
||||||
|
"license": "BSD 3-clause",
|
||||||
|
"sourcePaths" : [
|
||||||
|
"source",
|
||||||
|
"../external/sources"
|
||||||
|
],
|
||||||
|
"importPaths": [
|
||||||
|
"source",
|
||||||
|
"../external/sources"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"bindbc-sdl":"0.13.0",
|
||||||
|
"ecs":{"path":"../../"}
|
||||||
|
},
|
||||||
|
"versions": [
|
||||||
|
"BindSDL_Image",
|
||||||
|
"SDL_2010"
|
||||||
|
],
|
||||||
|
|
||||||
|
"configurations" : [
|
||||||
|
{
|
||||||
|
"name" : "default",
|
||||||
|
"targetType" : "library",
|
||||||
|
"subConfigurations":
|
||||||
|
{
|
||||||
|
"bindbc-sdl": "static",
|
||||||
|
"ecs":"library"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "betterC",
|
||||||
|
"targetType" : "library",
|
||||||
|
"dflags": [
|
||||||
|
"-betterC"
|
||||||
|
],
|
||||||
|
"subConfigurations":
|
||||||
|
{
|
||||||
|
"bindbc-sdl": "staticBC",
|
||||||
|
"ecs":"library-betterC"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
134
demos/utils/source/ecs_utils/gfx/buffer.d
Normal file
134
demos/utils/source/ecs_utils/gfx/buffer.d
Normal file
|
|
@ -0,0 +1,134 @@
|
||||||
|
module ecs_utils.gfx.buffer;
|
||||||
|
|
||||||
|
import ecs.std;
|
||||||
|
|
||||||
|
import glad.gl.gl;
|
||||||
|
import glad.gl.gles2;
|
||||||
|
|
||||||
|
extern(C):
|
||||||
|
|
||||||
|
struct Buffer
|
||||||
|
{
|
||||||
|
|
||||||
|
void create() nothrow
|
||||||
|
{
|
||||||
|
data = Mallocator.make!Data;
|
||||||
|
data.gl_handle = 0;
|
||||||
|
glGenBuffers(1,&data.gl_handle);
|
||||||
|
data.elem_size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void destroy() nothrow
|
||||||
|
{
|
||||||
|
if(data.gl_handle)glDeleteBuffers(1,&data.gl_handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void bind(BindTarget target) nothrow
|
||||||
|
{
|
||||||
|
//if(vbo != this)glBindBuffer(GL_ARRAY_BUFFER,data.gl_handle);
|
||||||
|
//vbo = this;
|
||||||
|
glBindBuffer(target,data.gl_handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bindRange(BindTarget target, uint index, uint offset, uint size) nothrow
|
||||||
|
{
|
||||||
|
glBindBufferRange(target, index, data.gl_handle, offset, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void bufferData(BindTarget target, uint size, uint count, uint usage, void* data) nothrow
|
||||||
|
{
|
||||||
|
bind(target);
|
||||||
|
this.data.elem_size = size;
|
||||||
|
glBufferData(target,size*count,data,usage);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*void bufferStorage(uint size, uint count, void* data, uint flags = StorageFlagBits.write)
|
||||||
|
{
|
||||||
|
bind(BindTarget.array);
|
||||||
|
this.data.elem_size = size;
|
||||||
|
glBufferStorage(GL_ARRAY_BUFFER,size*count,data, flags);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
void bufferSubData(uint size, uint offset, void* data) nothrow
|
||||||
|
{
|
||||||
|
bind(BindTarget.array);
|
||||||
|
glBufferSubData(GL_ARRAY_BUFFER,offset,size,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
void map(BindTarget target) nothrow
|
||||||
|
{
|
||||||
|
bind(target);
|
||||||
|
data.map_ptr = glMapBuffer(target,GL_WRITE_ONLY);
|
||||||
|
}
|
||||||
|
|
||||||
|
void map(uint offset, uint size, BindTarget target, uint flags = MapFlagBits.write | MapFlagBits.flush_explict | MapFlagBits.invalidate_buffer) nothrow
|
||||||
|
{
|
||||||
|
bind(target);
|
||||||
|
data.map_ptr = glMapBufferRange(target,offset,size,flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
void flush(uint offset, uint size, BindTarget target) nothrow
|
||||||
|
{
|
||||||
|
glFlushMappedBufferRange(target, offset, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void unmap(BindTarget target) nothrow
|
||||||
|
{
|
||||||
|
bind(target);
|
||||||
|
glUnmapBuffer(target);
|
||||||
|
data.map_ptr = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* mappedPointer() nothrow
|
||||||
|
{
|
||||||
|
return data.map_ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
static void unbind(BindTarget target) nothrow
|
||||||
|
{
|
||||||
|
//vbo = 0;
|
||||||
|
glBindBuffer(target,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
enum BindTarget
|
||||||
|
{
|
||||||
|
array = GL_ARRAY_BUFFER,
|
||||||
|
element_array = GL_ELEMENT_ARRAY_BUFFER,
|
||||||
|
uniform = GL_UNIFORM_BUFFER,
|
||||||
|
//shader_storage = GL_SHADER_STORAGE_BUFFER,
|
||||||
|
//indirect = GL_DRAW_INDIRECT_BUFFER
|
||||||
|
}
|
||||||
|
|
||||||
|
enum MapFlagBits
|
||||||
|
{
|
||||||
|
write = GL_MAP_WRITE_BIT,
|
||||||
|
invalidate_buffer = GL_MAP_INVALIDATE_BUFFER_BIT,
|
||||||
|
flush_explict = GL_MAP_FLUSH_EXPLICIT_BIT,
|
||||||
|
//coherent = GL_MAP_COHERENT_BIT,
|
||||||
|
//persistent = GL_MAP_PERSISTENT_BIT
|
||||||
|
}
|
||||||
|
|
||||||
|
enum StorageFlagBits
|
||||||
|
{
|
||||||
|
write = GL_MAP_WRITE_BIT,
|
||||||
|
//coherent = GL_MAP_COHERENT_BIT,
|
||||||
|
//persistent = GL_MAP_PERSISTENT_BIT
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Data
|
||||||
|
{
|
||||||
|
uint elem_size;
|
||||||
|
uint gl_handle;
|
||||||
|
void* map_ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
Data* data;
|
||||||
|
}
|
||||||
102
demos/utils/source/ecs_utils/gfx/config.d
Normal file
102
demos/utils/source/ecs_utils/gfx/config.d
Normal file
|
|
@ -0,0 +1,102 @@
|
||||||
|
module ecs_utils.gfx.config;
|
||||||
|
|
||||||
|
import bindbc.sdl;
|
||||||
|
|
||||||
|
import ecs.std;
|
||||||
|
|
||||||
|
import ecs_utils.gfx.material;
|
||||||
|
import ecs_utils.gfx.mesh;
|
||||||
|
import ecs_utils.gfx.texture;
|
||||||
|
|
||||||
|
//import mutils.serializer.json;
|
||||||
|
|
||||||
|
extern(C):
|
||||||
|
|
||||||
|
enum LayerType
|
||||||
|
{
|
||||||
|
normal,
|
||||||
|
sorted
|
||||||
|
}
|
||||||
|
|
||||||
|
import ecs.vector;
|
||||||
|
|
||||||
|
static struct GfxConfig
|
||||||
|
{
|
||||||
|
extern(C):
|
||||||
|
__gshared:
|
||||||
|
Vector!LayerType layers;
|
||||||
|
//Vector!Mesh meshes;
|
||||||
|
//Vector!Material materials;
|
||||||
|
Mesh[] meshes;
|
||||||
|
Material[] materials;
|
||||||
|
|
||||||
|
static bool load(const (char)[] path) nothrow
|
||||||
|
{
|
||||||
|
struct LoadData
|
||||||
|
{
|
||||||
|
struct Str
|
||||||
|
{
|
||||||
|
@("malloc") string str;
|
||||||
|
}
|
||||||
|
|
||||||
|
@("malloc") Str[] materials;
|
||||||
|
@("malloc") Str[] meshes;
|
||||||
|
int inter;
|
||||||
|
|
||||||
|
void dispose() nothrow
|
||||||
|
{
|
||||||
|
/*if(blend_mode)Mallocator.instance.dispose(cast(char[])blend_mode);
|
||||||
|
if(vertex)Mallocator.instance.dispose(cast(char[])vertex);
|
||||||
|
if(fragment)Mallocator.instance.dispose(cast(char[])fragment);*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
char[] cpath = (cast(char*)alloca(path.length+1))[0..path.length+1];
|
||||||
|
cpath[0..$-1] = path[0..$];
|
||||||
|
cpath[$-1] = 0;
|
||||||
|
|
||||||
|
SDL_RWops* file = SDL_RWFromFile(cpath.ptr,"r");
|
||||||
|
if(file)
|
||||||
|
{
|
||||||
|
size_t size = cast(size_t)SDL_RWsize(file);
|
||||||
|
char[] buffer = Mallocator.makeArray!char(size);
|
||||||
|
SDL_RWread(file,buffer.ptr,size,1);
|
||||||
|
|
||||||
|
LoadData load_data;
|
||||||
|
scope(exit)load_data.dispose();
|
||||||
|
|
||||||
|
/*JSONSerializer serializer = Mallocator.make!JSONSerializer;
|
||||||
|
scope(exit)Mallocator.dispose(serializer);
|
||||||
|
serializer.serialize!(Load.yes, true)(load_data,buffer);*/
|
||||||
|
|
||||||
|
//if(__ecs_used_backend == Backend.opengl)
|
||||||
|
{
|
||||||
|
meshes = Mallocator.makeArray!Mesh(load_data.meshes.length);
|
||||||
|
foreach(i,ref mesh; meshes)
|
||||||
|
{
|
||||||
|
mesh.load(load_data.meshes[i].str);
|
||||||
|
mesh.uploadData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
materials = Mallocator.makeArray!Material(load_data.materials.length);
|
||||||
|
foreach(i,ref material; materials)
|
||||||
|
{
|
||||||
|
material.create();
|
||||||
|
material.load(load_data.materials[i].str);
|
||||||
|
material.compile();
|
||||||
|
}
|
||||||
|
|
||||||
|
SDL_RWclose(file);
|
||||||
|
load_data.dispose();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int addLayer(LayerType type)
|
||||||
|
{
|
||||||
|
layers.add(type);
|
||||||
|
return cast(int)(layers.length-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
198
demos/utils/source/ecs_utils/gfx/material.d
Normal file
198
demos/utils/source/ecs_utils/gfx/material.d
Normal file
|
|
@ -0,0 +1,198 @@
|
||||||
|
module ecs_utils.gfx.material;
|
||||||
|
|
||||||
|
import bindbc.sdl;
|
||||||
|
|
||||||
|
import ecs.std;
|
||||||
|
|
||||||
|
import ecs_utils.gfx.shader;
|
||||||
|
|
||||||
|
import glad.gl.gl;
|
||||||
|
|
||||||
|
//import mutils.serializer.json;
|
||||||
|
|
||||||
|
struct Material
|
||||||
|
{
|
||||||
|
|
||||||
|
void create() nothrow
|
||||||
|
{
|
||||||
|
data = Mallocator.make!Data;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool load(const char[] path) nothrow
|
||||||
|
{
|
||||||
|
struct LoadData
|
||||||
|
{
|
||||||
|
@("malloc") string blend_mode;
|
||||||
|
@("malloc") string vertex;
|
||||||
|
@("malloc") string fragment;
|
||||||
|
|
||||||
|
void dispose() nothrow
|
||||||
|
{
|
||||||
|
//if(blend_mode)Mallocator.instance.dispose(cast(char[])blend_mode);
|
||||||
|
//if(vertex)Mallocator.instance.dispose(cast(char[])vertex);
|
||||||
|
//if(fragment)Mallocator.instance.dispose(cast(char[])fragment);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
char[] cpath = (cast(char*)alloca(path.length+1))[0..path.length+1];
|
||||||
|
cpath[0..$-1] = path[0..$];
|
||||||
|
cpath[$-1] = 0;
|
||||||
|
|
||||||
|
SDL_RWops* file = SDL_RWFromFile(cpath.ptr,"r");
|
||||||
|
if(file)
|
||||||
|
{
|
||||||
|
size_t size = cast(size_t)SDL_RWsize(file);
|
||||||
|
char[] buffer = Mallocator.makeArray!char(size);
|
||||||
|
SDL_RWread(file,buffer.ptr,size,1);
|
||||||
|
|
||||||
|
LoadData load_data;
|
||||||
|
scope(exit)load_data.dispose();
|
||||||
|
|
||||||
|
/*JSONSerializer serializer = Mallocator.make!JSONSerializer;
|
||||||
|
scope(exit)Mallocator.dispose(serializer);
|
||||||
|
serializer.serialize!(Load.yes, true)(load_data,buffer);*/
|
||||||
|
|
||||||
|
//if(__ecs_used_backend == Backend.opengl)
|
||||||
|
{
|
||||||
|
Shader vsh;
|
||||||
|
vsh.load(load_data.vertex);
|
||||||
|
vsh.compile();
|
||||||
|
|
||||||
|
Shader fsh;
|
||||||
|
fsh.load(load_data.fragment);
|
||||||
|
fsh.compile();
|
||||||
|
|
||||||
|
Material.ShaderModule[1] modules = [Material.ShaderModule(vsh,fsh)];
|
||||||
|
|
||||||
|
attachModules(modules);
|
||||||
|
}
|
||||||
|
|
||||||
|
SDL_RWclose(file);
|
||||||
|
load_data.dispose();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void bind() nothrow
|
||||||
|
{
|
||||||
|
glUseProgram(data.modules[0].gl_handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
enum BlendMode
|
||||||
|
{
|
||||||
|
opaque,
|
||||||
|
additive,
|
||||||
|
mixed
|
||||||
|
}
|
||||||
|
|
||||||
|
enum TransformMode
|
||||||
|
{
|
||||||
|
position,
|
||||||
|
matrix
|
||||||
|
}
|
||||||
|
|
||||||
|
struct ShaderModule
|
||||||
|
{
|
||||||
|
Shader fragment_shader;
|
||||||
|
Shader vertex_shader;
|
||||||
|
uint gl_handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
void attachModules(scope ShaderModule[] modules) nothrow
|
||||||
|
{
|
||||||
|
data.modules = Mallocator.makeArray(modules);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool compile() nothrow
|
||||||
|
{
|
||||||
|
foreach(ref module_;data.modules)
|
||||||
|
{
|
||||||
|
module_.gl_handle = glCreateProgram();
|
||||||
|
glAttachShader(module_.gl_handle, module_.vertex_shader.data.gl_handle);
|
||||||
|
glAttachShader(module_.gl_handle, module_.fragment_shader.data.gl_handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void bindAttribLocation(const char* name, uint location) nothrow
|
||||||
|
{
|
||||||
|
foreach(ref module_;data.modules)
|
||||||
|
{
|
||||||
|
glBindAttribLocation(module_.gl_handle, location, name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool link() nothrow
|
||||||
|
{
|
||||||
|
foreach(ref module_;data.modules)
|
||||||
|
{
|
||||||
|
glLinkProgram(module_.gl_handle);
|
||||||
|
|
||||||
|
GLint ok = 0;
|
||||||
|
glGetProgramiv(module_.gl_handle, GL_LINK_STATUS, &ok);
|
||||||
|
if(!ok)
|
||||||
|
{
|
||||||
|
SDL_Log("Program link error!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int getLocation(const char* name)
|
||||||
|
{
|
||||||
|
foreach(ref module_;data.modules)
|
||||||
|
{
|
||||||
|
int location = glGetUniformLocation(module_.gl_handle,name);
|
||||||
|
if(location != -1)return location;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void pushBindings()
|
||||||
|
{
|
||||||
|
foreach(i;0..data.bindings.length)
|
||||||
|
{
|
||||||
|
glUniform1i(data.bindings[i],cast(int)i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void pushUniforms(void* ptr)
|
||||||
|
{
|
||||||
|
foreach(ref Uniform uniform; data.uniforms)
|
||||||
|
{
|
||||||
|
void* local_ptr = ptr + uniform.offset;
|
||||||
|
glUniform4fv(uniform.location,1,cast(float*)local_ptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Type
|
||||||
|
{
|
||||||
|
float_,
|
||||||
|
float4
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Uniform
|
||||||
|
{
|
||||||
|
Type type;
|
||||||
|
int location;
|
||||||
|
uint offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Data
|
||||||
|
{
|
||||||
|
BlendMode blend_mode = BlendMode.opaque;
|
||||||
|
|
||||||
|
ShaderModule[] modules;
|
||||||
|
|
||||||
|
TransformMode mode;
|
||||||
|
|
||||||
|
Uniform[] uniforms;
|
||||||
|
int[] bindings;
|
||||||
|
}
|
||||||
|
|
||||||
|
Data* data;
|
||||||
|
}
|
||||||
121
demos/utils/source/ecs_utils/gfx/mesh.d
Normal file
121
demos/utils/source/ecs_utils/gfx/mesh.d
Normal file
|
|
@ -0,0 +1,121 @@
|
||||||
|
module ecs_utils.gfx.mesh;
|
||||||
|
|
||||||
|
import bindbc.sdl;
|
||||||
|
|
||||||
|
import ecs.std;
|
||||||
|
|
||||||
|
import ecs_utils.gfx.buffer;
|
||||||
|
|
||||||
|
import glad.gl.gl;
|
||||||
|
//import mutils.serializer.json;
|
||||||
|
|
||||||
|
extern(C):
|
||||||
|
|
||||||
|
struct Mesh
|
||||||
|
{
|
||||||
|
bool load(const char[] path) nothrow
|
||||||
|
{
|
||||||
|
struct LoadData
|
||||||
|
{
|
||||||
|
/*struct Vertex
|
||||||
|
{
|
||||||
|
struct Binding
|
||||||
|
{
|
||||||
|
@("malloc") string type;
|
||||||
|
uint stride;
|
||||||
|
}
|
||||||
|
@("malloc") Binding[] bindings;
|
||||||
|
}
|
||||||
|
Vertex vertex;*/
|
||||||
|
@("malloc") ushort[] indices;
|
||||||
|
@("malloc") float[] vertices;
|
||||||
|
//int i;
|
||||||
|
|
||||||
|
void dispose() nothrow
|
||||||
|
{
|
||||||
|
if(indices)Mallocator.dispose(indices);
|
||||||
|
if(vertices)Mallocator.dispose(vertices);
|
||||||
|
|
||||||
|
/*foreach(binding; vertex.bindings)Mallocator.instance.dispose(cast(char[])binding.type);
|
||||||
|
|
||||||
|
if(vertex.bindings)Mallocator.instance.dispose(vertex.bindings);*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
char[] cpath = (cast(char*)alloca(path.length+1))[0..path.length+1];
|
||||||
|
cpath[0..$-1] = path[0..$];
|
||||||
|
cpath[$-1] = 0;
|
||||||
|
|
||||||
|
SDL_RWops* file = SDL_RWFromFile(cpath.ptr,"r");//SDL_LoadFile(cpath.ptr,);
|
||||||
|
if(file)
|
||||||
|
{
|
||||||
|
size_t size = cast(size_t)SDL_RWsize(file);
|
||||||
|
//data.code = Mallocator.instance.makeArray!char(size);
|
||||||
|
//data.code[$-1] = 0;
|
||||||
|
char[] buffer = Mallocator.makeArray!char(size);
|
||||||
|
SDL_RWread(file,buffer.ptr,size,1);
|
||||||
|
|
||||||
|
LoadData load_data;
|
||||||
|
scope(exit)load_data.dispose();
|
||||||
|
|
||||||
|
/*JSONSerializer serializer = Mallocator.make!JSONSerializer;
|
||||||
|
scope(exit)Mallocator.dispose(serializer);
|
||||||
|
serializer.serialize!(Load.yes, true)(load_data,buffer);*/
|
||||||
|
|
||||||
|
indices = Mallocator.makeArray(load_data.indices);
|
||||||
|
/*vertex.create();
|
||||||
|
Vertex.Binding[] bindings = (cast(Vertex.Binding*)alloca(Vertex.Binding.sizeof*load_data.vertex.bindings.length))[0..load_data.vertex.bindings.length];
|
||||||
|
uint vertex_size = 0;
|
||||||
|
uint alignment = 4;
|
||||||
|
foreach(i, binding;load_data.vertex.bindings)
|
||||||
|
{
|
||||||
|
uint new_size = binding.stride;
|
||||||
|
bindings[i].stride = binding.stride;
|
||||||
|
if(binding.type == "float_rg")
|
||||||
|
{
|
||||||
|
bindings[i].type = Vertex.Type.float_rg;
|
||||||
|
new_size += 8;
|
||||||
|
}
|
||||||
|
if(new_size > vertex_size)vertex_size = new_size;
|
||||||
|
//new_size = new_size + (3 - (new_size)%alignment)
|
||||||
|
}
|
||||||
|
vertex.data.size = vertex_size;
|
||||||
|
vertex.attachBindings(bindings);*/
|
||||||
|
|
||||||
|
vertices = Mallocator.makeArray(load_data.vertices);
|
||||||
|
/*vertices = Mallocator.instance.makeArray!ubyte(vertex_size * load_data.vertices.length);
|
||||||
|
{
|
||||||
|
foreach()
|
||||||
|
}*/
|
||||||
|
|
||||||
|
SDL_RWclose(file);
|
||||||
|
load_data.dispose();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void uploadData() nothrow
|
||||||
|
{
|
||||||
|
vbo.create();
|
||||||
|
vbo.bufferData(Buffer.BindTarget.array,16,cast(uint)vertices.length,GL_STATIC_DRAW,vertices.ptr);
|
||||||
|
|
||||||
|
ibo.create();
|
||||||
|
ibo.bufferData(Buffer.BindTarget.element_array,2,cast(uint)indices.length,GL_STATIC_DRAW,indices.ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bind() nothrow
|
||||||
|
{
|
||||||
|
vbo.bind(Buffer.BindTarget.array);
|
||||||
|
ibo.bind(Buffer.BindTarget.element_array);
|
||||||
|
|
||||||
|
glVertexAttribPointer(0,2,GL_FLOAT,false,16,null);
|
||||||
|
glVertexAttribPointer(1,2,GL_FLOAT,false,16,cast(void*)8);
|
||||||
|
}
|
||||||
|
|
||||||
|
float[] vertices;
|
||||||
|
ushort[] indices;
|
||||||
|
Buffer vbo;
|
||||||
|
Buffer ibo;
|
||||||
|
//Vertex vertex;
|
||||||
|
}
|
||||||
12
demos/utils/source/ecs_utils/gfx/mesh_module.d
Normal file
12
demos/utils/source/ecs_utils/gfx/mesh_module.d
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
module ecs_utils.gfx.mesh_module;
|
||||||
|
|
||||||
|
import ecs_utils.gfx.material;
|
||||||
|
import ecs_utils.gfx.texture;
|
||||||
|
import ecs_utils.gfx.mesh;
|
||||||
|
|
||||||
|
struct MeshModule
|
||||||
|
{
|
||||||
|
Mesh* mesh;
|
||||||
|
Material* material;
|
||||||
|
Texture texture;
|
||||||
|
}
|
||||||
29
demos/utils/source/ecs_utils/gfx/render_list.d
Normal file
29
demos/utils/source/ecs_utils/gfx/render_list.d
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
module ecs_utils.gfx.render_list;
|
||||||
|
|
||||||
|
import ecs_utils.gfx.mesh_module;
|
||||||
|
import ecs_utils.math.vector;
|
||||||
|
import ecs_utils.math.matrix;
|
||||||
|
import ecs_utils.gfx.config;
|
||||||
|
|
||||||
|
struct RenderList
|
||||||
|
{
|
||||||
|
struct Data
|
||||||
|
{
|
||||||
|
MeshModule* module_;
|
||||||
|
uint index;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct LocScale
|
||||||
|
{
|
||||||
|
vec2 location;
|
||||||
|
vec2 scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Layer
|
||||||
|
{
|
||||||
|
LayerType type;
|
||||||
|
Data[] list;
|
||||||
|
LocScale[] loc_scale;
|
||||||
|
mat3[] matrices;
|
||||||
|
}
|
||||||
|
}
|
||||||
817
demos/utils/source/ecs_utils/gfx/renderer.d
Normal file
817
demos/utils/source/ecs_utils/gfx/renderer.d
Normal file
|
|
@ -0,0 +1,817 @@
|
||||||
|
module ecs_utils.gfx.renderer;
|
||||||
|
|
||||||
|
import bindbc.sdl;
|
||||||
|
|
||||||
|
import ecs.std;
|
||||||
|
|
||||||
|
//import ecs_utils.core : Backend;
|
||||||
|
import ecs_utils.gfx.buffer;
|
||||||
|
import ecs_utils.gfx.texture;
|
||||||
|
import ecs_utils.math.vector;
|
||||||
|
|
||||||
|
import glad.gl.gl;
|
||||||
|
|
||||||
|
version = ver1;
|
||||||
|
/*version(ver5)version = vv2;
|
||||||
|
else version(ver6)version = vv2;*/
|
||||||
|
|
||||||
|
extern(C) float sinf(float);
|
||||||
|
extern(C) float cosf(float);
|
||||||
|
|
||||||
|
enum RenderTechnique
|
||||||
|
{
|
||||||
|
simple,//1
|
||||||
|
simple_array,//2
|
||||||
|
vbo_batch,//3
|
||||||
|
instanced_attrib_divisor,//4
|
||||||
|
uniform_buffer,//5
|
||||||
|
uniform_buffer_indexed,//6
|
||||||
|
uniform_buffer_multi_draw,//7
|
||||||
|
uniform_buffer_instanced,//8
|
||||||
|
uniform_buffer_instanced_mapped_gl2,//9
|
||||||
|
uniform_buffer_instanced_mapped,//10
|
||||||
|
uniform_buffer_instanced_persistent_mapped,//11
|
||||||
|
uniform_buffer_instanced_persistent_mapped_coherent,//12
|
||||||
|
ssbo_instanced,//13
|
||||||
|
uniform_buffer_draw_indirect,//14
|
||||||
|
uniform_buffer_multi_draw_indirect,//15
|
||||||
|
uniform_buffer_multi_draw_indirect_arb_draw_parameters//16
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Renderer
|
||||||
|
{
|
||||||
|
//static SDL_Renderer* main_sdl_renderer;
|
||||||
|
|
||||||
|
enum MaxObjects = 1024 * 64 * 4;
|
||||||
|
enum BufferUsage = GL_STATIC_DRAW;
|
||||||
|
|
||||||
|
//SDL_Window* sdl_window;
|
||||||
|
//SDL_Renderer* sdl_renderer;
|
||||||
|
ivec2 resolution;
|
||||||
|
vec2 dres;
|
||||||
|
vec4 sdl_transform;
|
||||||
|
vec2 view_pos = vec2(-1,-1);
|
||||||
|
vec2 view_size = vec2(1,1);
|
||||||
|
|
||||||
|
//uint[2] time_queries;
|
||||||
|
|
||||||
|
Buffer[2] ubos;
|
||||||
|
int block_alignment = 1;
|
||||||
|
int block_max_size = 16384;
|
||||||
|
|
||||||
|
struct IndirectDraw
|
||||||
|
{
|
||||||
|
uint count = 6;
|
||||||
|
uint instances = 1;
|
||||||
|
uint first_index = 0;
|
||||||
|
uint base_vertex = 0;
|
||||||
|
uint base_instance = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Buffer[2] batch_vbo;
|
||||||
|
Buffer[2] batch_ibo;
|
||||||
|
|
||||||
|
float[] batch_vertices;
|
||||||
|
ushort[] batch_indices;
|
||||||
|
|
||||||
|
Buffer indirect_buffer;
|
||||||
|
IndirectDraw[] indirect_block;
|
||||||
|
|
||||||
|
Buffer id_buffer;
|
||||||
|
|
||||||
|
int data_offset = 48;
|
||||||
|
int data_index;
|
||||||
|
ubyte[] uniform_block;
|
||||||
|
|
||||||
|
struct RenderData
|
||||||
|
{
|
||||||
|
Texture texture;
|
||||||
|
uint material_id;
|
||||||
|
uint mesh_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
RenderData[] render_list;
|
||||||
|
uint item_id;
|
||||||
|
|
||||||
|
uint[] multi_count;
|
||||||
|
uint[] multi_offset;
|
||||||
|
|
||||||
|
alias Technique = RenderTechnique;
|
||||||
|
|
||||||
|
__gshared Technique technique = Technique.simple;
|
||||||
|
void* data_ptr;
|
||||||
|
|
||||||
|
//import ecs_utils.core : RenderTechnique;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void initialize()
|
||||||
|
{
|
||||||
|
//this.technique = __ecs_used_technique;
|
||||||
|
__initialize(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void __initialize_gl(ref Renderer this_)
|
||||||
|
{
|
||||||
|
with(this_)
|
||||||
|
{
|
||||||
|
//glGenQueries(2, time_queries.ptr);
|
||||||
|
|
||||||
|
version(WebAssembly)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &block_max_size);
|
||||||
|
glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &block_alignment);
|
||||||
|
}
|
||||||
|
|
||||||
|
//ubos[0].bufferStorage(1,64*MaxObjects,null);
|
||||||
|
|
||||||
|
switch(technique)
|
||||||
|
{
|
||||||
|
case Technique.simple:
|
||||||
|
uniform_block = Mallocator.makeArray!ubyte(64*MaxObjects);
|
||||||
|
data_ptr = uniform_block.ptr;
|
||||||
|
data_offset = cast(ushort)((data_offset + block_alignment - 1) & (-cast(int) block_alignment));
|
||||||
|
break;
|
||||||
|
case Technique.simple_array:
|
||||||
|
goto case(Technique.simple);
|
||||||
|
case Technique.vbo_batch:
|
||||||
|
batch_vbo[0].create();
|
||||||
|
batch_ibo[0].create();
|
||||||
|
batch_vbo[0].bufferData(Buffer.BindTarget.array,16,4*MaxObjects,BufferUsage,null);
|
||||||
|
batch_ibo[0].bufferData(Buffer.BindTarget.element_array,2,6*MaxObjects,BufferUsage,null);
|
||||||
|
|
||||||
|
batch_vbo[1].create();
|
||||||
|
batch_ibo[1].create();
|
||||||
|
batch_vbo[1].bufferData(Buffer.BindTarget.array,16,4*MaxObjects,BufferUsage,null);
|
||||||
|
batch_ibo[1].bufferData(Buffer.BindTarget.element_array,2,6*MaxObjects,BufferUsage,null);
|
||||||
|
|
||||||
|
batch_vertices = Mallocator.makeArray!float(16*MaxObjects);
|
||||||
|
batch_indices = Mallocator.makeArray!ushort(6*MaxObjects);
|
||||||
|
break;
|
||||||
|
case Technique.instanced_attrib_divisor:
|
||||||
|
goto case(Technique.uniform_buffer_indexed);
|
||||||
|
case Technique.uniform_buffer:
|
||||||
|
ubos[0].create();
|
||||||
|
ubos[0].bufferData(Buffer.BindTarget.uniform,1,64*MaxObjects,BufferUsage,null);
|
||||||
|
ubos[1].create();
|
||||||
|
ubos[1].bufferData(Buffer.BindTarget.uniform,1,64*MaxObjects,BufferUsage,null);
|
||||||
|
goto case(Technique.simple);
|
||||||
|
case Technique.uniform_buffer_indexed:
|
||||||
|
ubos[0].create();
|
||||||
|
ubos[0].bufferData(Buffer.BindTarget.uniform,1,64*MaxObjects,BufferUsage,null);
|
||||||
|
ubos[1].create();
|
||||||
|
ubos[1].bufferData(Buffer.BindTarget.uniform,1,64*MaxObjects,BufferUsage,null);
|
||||||
|
uniform_block = Mallocator.makeArray!ubyte(64*MaxObjects);
|
||||||
|
data_ptr = uniform_block.ptr;
|
||||||
|
break;
|
||||||
|
/*case Technique.uniform_buffer_multi_draw:
|
||||||
|
multi_count = Mallocator.makeArray!uint(992,6);
|
||||||
|
multi_offset = Mallocator.makeArray!uint(992,0);
|
||||||
|
|
||||||
|
{
|
||||||
|
uint[] indices = Mallocator.makeArray!uint(992);
|
||||||
|
scope(exit)Mallocator.dispose(indices);
|
||||||
|
foreach(i;0..992)indices[i]=i;
|
||||||
|
id_buffer.create();
|
||||||
|
id_buffer.bufferData(uint.sizeof,992,BufferUsage,indices.ptr);
|
||||||
|
}
|
||||||
|
goto case(Technique.uniform_buffer_multi_draw_indirect_arb_draw_parameters);*/
|
||||||
|
case Technique.uniform_buffer_instanced:
|
||||||
|
goto case(Technique.uniform_buffer_indexed);
|
||||||
|
case Technique.uniform_buffer_instanced_mapped_gl2:
|
||||||
|
ubos[0].create();
|
||||||
|
ubos[0].bufferData(Buffer.BindTarget.uniform,1,512*MaxObjects,BufferUsage,null);
|
||||||
|
ubos[0].map(Buffer.BindTarget.uniform);
|
||||||
|
ubos[1].create();
|
||||||
|
ubos[1].bufferData(Buffer.BindTarget.uniform,1,512*MaxObjects,BufferUsage,null);
|
||||||
|
ubos[1].map(Buffer.BindTarget.uniform);
|
||||||
|
data_ptr = ubos[0].mappedPointer();
|
||||||
|
break;
|
||||||
|
case Technique.uniform_buffer_instanced_mapped:
|
||||||
|
ubos[0].create();
|
||||||
|
ubos[0].bufferData(Buffer.BindTarget.uniform,1,64*MaxObjects,BufferUsage,null);
|
||||||
|
ubos[0].map(0, 64*MaxObjects, Buffer.BindTarget.uniform);
|
||||||
|
ubos[1].create();
|
||||||
|
ubos[1].bufferData(Buffer.BindTarget.uniform,1,64*MaxObjects,BufferUsage,null);
|
||||||
|
ubos[1].map(0, 64*MaxObjects, Buffer.BindTarget.uniform);
|
||||||
|
data_ptr = ubos[0].mappedPointer();
|
||||||
|
break;
|
||||||
|
/*case Technique.uniform_buffer_instanced_persistent_mapped:
|
||||||
|
ubos[0].create();
|
||||||
|
ubos[0].bufferStorage(1,64*MaxObjects,null,Buffer.StorageFlagBits.write|Buffer.StorageFlagBits.persistent);
|
||||||
|
ubos[0].map(0, 64*MaxObjects, Buffer.BindTarget.uniform, Buffer.MapFlagBits.write | Buffer.MapFlagBits.persistent | Buffer.MapFlagBits.flush_explict);
|
||||||
|
data_ptr = ubos[0].mappedPointer();
|
||||||
|
break;
|
||||||
|
case Technique.uniform_buffer_instanced_persistent_mapped_coherent:
|
||||||
|
ubos[0].create();
|
||||||
|
ubos[0].bufferStorage(1,64*MaxObjects,null,Buffer.StorageFlagBits.write|Buffer.StorageFlagBits.persistent|Buffer.StorageFlagBits.coherent);
|
||||||
|
ubos[0].map(0, 64*MaxObjects, Buffer.BindTarget.uniform, Buffer.MapFlagBits.write | Buffer.MapFlagBits.persistent | Buffer.MapFlagBits.flush_explict | Buffer.MapFlagBits.coherent);
|
||||||
|
ubos[1].create();
|
||||||
|
ubos[1].bufferStorage(1,64*MaxObjects,null,Buffer.StorageFlagBits.write|Buffer.StorageFlagBits.persistent|Buffer.StorageFlagBits.coherent);
|
||||||
|
ubos[1].map(0, 64*MaxObjects, Buffer.BindTarget.uniform, Buffer.MapFlagBits.write | Buffer.MapFlagBits.persistent | Buffer.MapFlagBits.flush_explict | Buffer.MapFlagBits.coherent);
|
||||||
|
data_ptr = ubos[0].mappedPointer();
|
||||||
|
break;
|
||||||
|
case Technique.ssbo_instanced:
|
||||||
|
goto case(Technique.uniform_buffer_indexed);
|
||||||
|
case Technique.uniform_buffer_draw_indirect:
|
||||||
|
indirect_block = Mallocator.makeArray!IndirectDraw(1);
|
||||||
|
indirect_buffer.create();
|
||||||
|
indirect_buffer.bufferData(IndirectDraw.sizeof,1,BufferUsage,indirect_block.ptr);
|
||||||
|
indirect_buffer.bind(Buffer.BindTarget.indirect);
|
||||||
|
goto case(Technique.uniform_buffer);
|
||||||
|
case Technique.uniform_buffer_multi_draw_indirect:
|
||||||
|
goto case(Technique.uniform_buffer_multi_draw_indirect_arb_draw_parameters);
|
||||||
|
case Technique.uniform_buffer_multi_draw_indirect_arb_draw_parameters:
|
||||||
|
indirect_block = Mallocator.makeArray!IndirectDraw(992);
|
||||||
|
foreach(i;0..992)
|
||||||
|
{
|
||||||
|
IndirectDraw* idraw = &indirect_block[i];
|
||||||
|
idraw.base_instance = i;
|
||||||
|
}
|
||||||
|
indirect_buffer.create();
|
||||||
|
indirect_buffer.bufferData(IndirectDraw.sizeof,992,BufferUsage,indirect_block.ptr);
|
||||||
|
indirect_buffer.bind(Buffer.BindTarget.indirect);
|
||||||
|
goto case(Technique.uniform_buffer_indexed);*/
|
||||||
|
default:break;
|
||||||
|
}//*/
|
||||||
|
|
||||||
|
// if(batching)data_offset = cast(ushort)((data_offset + block_alignment - 1) & (-cast(int) block_alignment));
|
||||||
|
//data_offset = cast(ushort)((data_offset + block_alignment - 1) & (-cast(int) block_alignment));
|
||||||
|
|
||||||
|
/*version(ver4){}
|
||||||
|
else version(ver5){}
|
||||||
|
else version(ver6){}
|
||||||
|
else data_offset = cast(ushort)((data_offset + block_alignment - 1) & (-cast(int) block_alignment));//*/
|
||||||
|
//data_offset = (data_offset + block_alignment - 1) - data_offset % block_alignment;
|
||||||
|
|
||||||
|
render_list = Mallocator.makeArray!RenderData(MaxObjects);
|
||||||
|
|
||||||
|
SDL_Log("Uniform block alignment: %u",block_alignment);
|
||||||
|
SDL_Log("Uniform block max size: %u",block_max_size);
|
||||||
|
SDL_Log("Data offset: %u",data_offset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void __initialize_sdl(ref Renderer this_)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void draw(Texture tex, vec2 pos, vec2 size, vec4 coords, float angle = 0, uint material_id = 0, uint mesh_id = 0)
|
||||||
|
{
|
||||||
|
__draw(this,tex,pos,size,coords,angle,material_id,mesh_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void __draw_sdl(ref Renderer this_, Texture tex, vec2 pos, vec2 size, vec4 coords, float angle, uint material_id, uint mesh_id)
|
||||||
|
{
|
||||||
|
/*with(this_)
|
||||||
|
{
|
||||||
|
SDL_Rect rect = SDL_Rect(cast(int)(coords.x*tex.data.size.x),cast(int)(coords.y*tex.data.size.y),cast(int)(coords.z*tex.data.size.x),cast(int)(coords.w*tex.data.size.y));
|
||||||
|
SDL_Rect rect2 = SDL_Rect(cast(int)((pos.x-size.x*0.5)),
|
||||||
|
cast(int)(resolution.y - pos.y - size.y*0.5),
|
||||||
|
cast(int)(size.x),
|
||||||
|
cast(int)(size.y));
|
||||||
|
|
||||||
|
SDL_RenderCopyEx(sdl_renderer,
|
||||||
|
tex.data.texture,
|
||||||
|
&rect,
|
||||||
|
&rect2,
|
||||||
|
angle*360,
|
||||||
|
null,
|
||||||
|
SDL_FLIP_NONE);
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void __draw_gl(ref Renderer this_, Texture tex, vec2 pos, vec2 size, vec4 coords, float angle, uint material_id, uint mesh_id)
|
||||||
|
{
|
||||||
|
//import core.stdc.string;
|
||||||
|
with(this_)
|
||||||
|
{
|
||||||
|
//pos += view_pos;
|
||||||
|
size.x *= view_size.x;
|
||||||
|
size.y *= view_size.y;
|
||||||
|
pos.x = pos.x * view_size.x + view_pos.x;
|
||||||
|
pos.y = pos.y * view_size.y + view_pos.y;//*/
|
||||||
|
|
||||||
|
/*version(ver6)void* ptr = ubos[0].mappedPointer() + data_index;
|
||||||
|
else void* ptr = uniform_block.ptr + data_index;*/
|
||||||
|
if(data_ptr is null)return;
|
||||||
|
void* ptr = data_ptr + data_index;
|
||||||
|
if(angle == 0)
|
||||||
|
{
|
||||||
|
*cast(float*)ptr = size.x;
|
||||||
|
*cast(float*)(ptr+4) = 0;
|
||||||
|
*cast(float*)(ptr+8) = 0;
|
||||||
|
*cast(float*)(ptr+12) = size.y;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//import core.stdc.math;
|
||||||
|
float sinn = sinf(angle);
|
||||||
|
float coss = cosf(angle);
|
||||||
|
*cast(float*)ptr = coss * size.x;
|
||||||
|
*cast(float*)(ptr+4) = -sinn * size.y;
|
||||||
|
*cast(float*)(ptr+8) = sinn * size.x;
|
||||||
|
*cast(float*)(ptr+12) = coss * size.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
//memcpy(ptr,);
|
||||||
|
memcpy(ptr+16,pos.data.ptr,8);
|
||||||
|
memcpy(ptr+32,coords.data.ptr,16);
|
||||||
|
|
||||||
|
//render_list[item_id] = RenderData(tex,material_id,mesh_id);
|
||||||
|
render_list[item_id].texture = tex;
|
||||||
|
render_list[item_id].material_id = material_id;
|
||||||
|
render_list[item_id].mesh_id = mesh_id;
|
||||||
|
|
||||||
|
data_index += data_offset;
|
||||||
|
item_id++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void __draw_gl_vbo_batch(ref Renderer this_, Texture tex, vec2 pos, vec2 size, vec4 coords, float angle, uint material_id, uint mesh_id)
|
||||||
|
{
|
||||||
|
import ecs_utils.gfx.config;
|
||||||
|
//import core.stdc.string;
|
||||||
|
with(this_)
|
||||||
|
{
|
||||||
|
//pos += view_pos;
|
||||||
|
size.x *= view_size.x;
|
||||||
|
size.y *= view_size.y;
|
||||||
|
pos.x = pos.x * view_size.x + view_pos.x;
|
||||||
|
pos.y = pos.y * view_size.y + view_pos.y;//*/
|
||||||
|
|
||||||
|
/*void* ptr = data_ptr + data_index;
|
||||||
|
*cast(float*)ptr = size.x;
|
||||||
|
*cast(float*)(ptr+4) = 0;
|
||||||
|
*cast(float*)(ptr+8) = 0;
|
||||||
|
*cast(float*)(ptr+12) = size.y;
|
||||||
|
//memcpy(ptr,);
|
||||||
|
memcpy(ptr+16,pos.data.ptr,8);
|
||||||
|
memcpy(ptr+32,coords.data.ptr,16);*/
|
||||||
|
|
||||||
|
if(angle == 0)
|
||||||
|
{
|
||||||
|
batch_vertices[item_id*16] = GfxConfig.meshes[mesh_id].vertices[0] * size.x + pos.x;
|
||||||
|
batch_vertices[item_id*16+1] = GfxConfig.meshes[mesh_id].vertices[1] * size.y + pos.y;
|
||||||
|
batch_vertices[item_id*16+4] = GfxConfig.meshes[mesh_id].vertices[4] * size.x + pos.x;
|
||||||
|
batch_vertices[item_id*16+5] = GfxConfig.meshes[mesh_id].vertices[5] * size.y + pos.y;
|
||||||
|
batch_vertices[item_id*16+8] = GfxConfig.meshes[mesh_id].vertices[8] * size.x + pos.x;
|
||||||
|
batch_vertices[item_id*16+9] = GfxConfig.meshes[mesh_id].vertices[9] * size.y + pos.y;
|
||||||
|
batch_vertices[item_id*16+12] = GfxConfig.meshes[mesh_id].vertices[12] * size.x + pos.x;
|
||||||
|
batch_vertices[item_id*16+13] = GfxConfig.meshes[mesh_id].vertices[13] * size.y + pos.y;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//import core.stdc.math;
|
||||||
|
float sinn = sinf(angle);
|
||||||
|
float coss = cosf(angle);
|
||||||
|
|
||||||
|
/*batch_vertices[item_id*16] = GfxConfig.meshes[mesh_id].vertices[0] * size.x;
|
||||||
|
batch_vertices[item_id*16+1] = GfxConfig.meshes[mesh_id].vertices[1] * size.y;
|
||||||
|
batch_vertices[item_id*16+4] = GfxConfig.meshes[mesh_id].vertices[4] * size.x;
|
||||||
|
batch_vertices[item_id*16+5] = GfxConfig.meshes[mesh_id].vertices[5] * size.y;
|
||||||
|
batch_vertices[item_id*16+8] = GfxConfig.meshes[mesh_id].vertices[8] * size.x;
|
||||||
|
batch_vertices[item_id*16+9] = GfxConfig.meshes[mesh_id].vertices[9] * size.y;
|
||||||
|
batch_vertices[item_id*16+12] = GfxConfig.meshes[mesh_id].vertices[12] * size.x;
|
||||||
|
batch_vertices[item_id*16+13] = GfxConfig.meshes[mesh_id].vertices[13] * size.y;*/
|
||||||
|
|
||||||
|
batch_vertices[item_id*16] = (GfxConfig.meshes[mesh_id].vertices[0] * coss + GfxConfig.meshes[mesh_id].vertices[1] * sinn) * size.x + pos.x;
|
||||||
|
batch_vertices[item_id*16+1] = (GfxConfig.meshes[mesh_id].vertices[1] * coss - GfxConfig.meshes[mesh_id].vertices[0] * sinn) * size.y + pos.y;
|
||||||
|
batch_vertices[item_id*16+4] = (GfxConfig.meshes[mesh_id].vertices[4] * coss + GfxConfig.meshes[mesh_id].vertices[5] * sinn) * size.x + pos.x;
|
||||||
|
batch_vertices[item_id*16+5] = (GfxConfig.meshes[mesh_id].vertices[5] * coss - GfxConfig.meshes[mesh_id].vertices[4] * sinn) * size.y + pos.y;
|
||||||
|
batch_vertices[item_id*16+8] = (GfxConfig.meshes[mesh_id].vertices[8] * coss + GfxConfig.meshes[mesh_id].vertices[9] * sinn) * size.x + pos.x;
|
||||||
|
batch_vertices[item_id*16+9] = (GfxConfig.meshes[mesh_id].vertices[9] * coss - GfxConfig.meshes[mesh_id].vertices[8] * sinn) * size.y + pos.y;
|
||||||
|
batch_vertices[item_id*16+12] = (GfxConfig.meshes[mesh_id].vertices[12] * coss + GfxConfig.meshes[mesh_id].vertices[13] * sinn) * size.x + pos.x;
|
||||||
|
batch_vertices[item_id*16+13] = (GfxConfig.meshes[mesh_id].vertices[13] * coss - GfxConfig.meshes[mesh_id].vertices[12] * sinn) * size.y + pos.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
batch_vertices[item_id*16+2] = GfxConfig.meshes[mesh_id].vertices[2] * coords.z + coords.x;
|
||||||
|
batch_vertices[item_id*16+3] = GfxConfig.meshes[mesh_id].vertices[3] * coords.w + coords.y;
|
||||||
|
batch_vertices[item_id*16+6] = GfxConfig.meshes[mesh_id].vertices[6] * coords.z + coords.x;
|
||||||
|
batch_vertices[item_id*16+7] = GfxConfig.meshes[mesh_id].vertices[7] * coords.w + coords.y;
|
||||||
|
batch_vertices[item_id*16+10] = GfxConfig.meshes[mesh_id].vertices[10] * coords.z + coords.x;
|
||||||
|
batch_vertices[item_id*16+11] = GfxConfig.meshes[mesh_id].vertices[11] * coords.w + coords.y;
|
||||||
|
batch_vertices[item_id*16+14] = GfxConfig.meshes[mesh_id].vertices[14] * coords.z + coords.x;
|
||||||
|
batch_vertices[item_id*16+15] = GfxConfig.meshes[mesh_id].vertices[15] * coords.w + coords.y;
|
||||||
|
|
||||||
|
uint ind_id = item_id % 16_384;
|
||||||
|
|
||||||
|
batch_indices[item_id*6] = cast(ushort)(GfxConfig.meshes[mesh_id].indices[0] + ind_id*4);
|
||||||
|
batch_indices[item_id*6+1] = cast(ushort)(GfxConfig.meshes[mesh_id].indices[1] + ind_id*4);
|
||||||
|
batch_indices[item_id*6+2] = cast(ushort)(GfxConfig.meshes[mesh_id].indices[2] + ind_id*4);
|
||||||
|
batch_indices[item_id*6+3] = cast(ushort)(GfxConfig.meshes[mesh_id].indices[3] + ind_id*4);
|
||||||
|
batch_indices[item_id*6+4] = cast(ushort)(GfxConfig.meshes[mesh_id].indices[4] + ind_id*4);
|
||||||
|
batch_indices[item_id*6+5] = cast(ushort)(GfxConfig.meshes[mesh_id].indices[5] + ind_id*4);
|
||||||
|
|
||||||
|
//render_list[item_id] = RenderData(tex,material_id,mesh_id);
|
||||||
|
render_list[item_id].texture = tex;
|
||||||
|
render_list[item_id].material_id = material_id;
|
||||||
|
render_list[item_id].mesh_id = mesh_id;
|
||||||
|
|
||||||
|
//data_index += 1;//data_offset;
|
||||||
|
item_id++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void clear()
|
||||||
|
{
|
||||||
|
__clear(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void __clear_sdl(ref Renderer this_)
|
||||||
|
{
|
||||||
|
//SDL_RenderClear(this_.sdl_renderer);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void __clear_gl(ref Renderer this_)
|
||||||
|
{
|
||||||
|
glClearColor(0,0,0,0);
|
||||||
|
glViewport(0,0,this_.resolution.x,this_.resolution.y);
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT);// | GL_DEPTH_BUFFER_BIT);
|
||||||
|
glDisable(GL_DEPTH_TEST);
|
||||||
|
glDisable(GL_CULL_FACE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void present()
|
||||||
|
{
|
||||||
|
__present(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void __present_sdl(ref Renderer this_)
|
||||||
|
{
|
||||||
|
//+SDL_RenderPresent(this_.sdl_renderer);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void __present_gl(ref Renderer this_)
|
||||||
|
{
|
||||||
|
glViewport(0,0,this_.resolution.x,this_.resolution.y);
|
||||||
|
//glEnable(GL_ALPHA_TEST);
|
||||||
|
//glAlphaFunc(GL_GREATER, 0.01);
|
||||||
|
glEnableVertexAttribArray(0);
|
||||||
|
glEnableVertexAttribArray(1);
|
||||||
|
import ecs_utils.gfx.config;
|
||||||
|
with(this_)
|
||||||
|
{
|
||||||
|
bool instanced = false;
|
||||||
|
bool indirect = false;
|
||||||
|
bool multi_draw = false;
|
||||||
|
Buffer.BindTarget buffer_target = Buffer.BindTarget.uniform;
|
||||||
|
|
||||||
|
switch(technique)
|
||||||
|
{
|
||||||
|
case Technique.simple:
|
||||||
|
break;
|
||||||
|
case Technique.simple_array:
|
||||||
|
break;
|
||||||
|
case Technique.vbo_batch:
|
||||||
|
//if(data_index){
|
||||||
|
batch_vbo[0].bufferSubData(item_id*4*16,0,batch_vertices.ptr);
|
||||||
|
batch_ibo[0].bufferSubData(item_id*6*2,0,batch_indices.ptr);
|
||||||
|
|
||||||
|
batch_vbo[0].bind(Buffer.BindTarget.array);
|
||||||
|
batch_ibo[0].bind(Buffer.BindTarget.element_array);
|
||||||
|
|
||||||
|
glVertexAttribPointer(0,2,GL_FLOAT,false,16,null);
|
||||||
|
glVertexAttribPointer(1,2,GL_FLOAT,false,16,cast(void*)8);//}
|
||||||
|
break;
|
||||||
|
case Technique.instanced_attrib_divisor:
|
||||||
|
ubos[0].bufferSubData(data_index,0,uniform_block.ptr);
|
||||||
|
ubos[0].bind(Buffer.BindTarget.array);
|
||||||
|
glEnableVertexAttribArray(2);
|
||||||
|
glEnableVertexAttribArray(3);
|
||||||
|
glEnableVertexAttribArray(4);
|
||||||
|
|
||||||
|
glVertexAttribPointer(2,4,GL_FLOAT,false,48,null);
|
||||||
|
glVertexAttribPointer(3,4,GL_FLOAT,false,48,cast(void*)16);
|
||||||
|
glVertexAttribPointer(4,4,GL_FLOAT,false,48,cast(void*)32);
|
||||||
|
glVertexAttribDivisor(2,1);
|
||||||
|
glVertexAttribDivisor(3,1);
|
||||||
|
glVertexAttribDivisor(4,1);
|
||||||
|
//ubos[0].bindRange(Buffer.BindTarget.uniform,0,0,block_max_size);
|
||||||
|
break;
|
||||||
|
case Technique.uniform_buffer:
|
||||||
|
//ubos[0].bufferData(1,64*MaxObjects,BufferUsage,null);
|
||||||
|
/*if(data_index)*/ubos[0].bufferSubData(data_index,0,uniform_block.ptr);
|
||||||
|
break;
|
||||||
|
case Technique.uniform_buffer_indexed:
|
||||||
|
ubos[0].bindRange(Buffer.BindTarget.uniform,0,0,block_max_size);
|
||||||
|
goto case(Technique.uniform_buffer);
|
||||||
|
case Technique.uniform_buffer_multi_draw:
|
||||||
|
id_buffer.bind(Buffer.BindTarget.array);
|
||||||
|
glEnableVertexAttribArray(2);
|
||||||
|
|
||||||
|
glVertexAttribIPointer(2,1,GL_UNSIGNED_INT,cast(uint)uint.sizeof,cast(void*)0);
|
||||||
|
glVertexAttribDivisor(2,1);
|
||||||
|
multi_draw = true;
|
||||||
|
goto case(Technique.uniform_buffer_instanced);
|
||||||
|
case Technique.uniform_buffer_instanced:
|
||||||
|
instanced = true;
|
||||||
|
goto case(Technique.uniform_buffer);
|
||||||
|
case Technique.uniform_buffer_instanced_mapped_gl2:
|
||||||
|
instanced = true;
|
||||||
|
ubos[0].unmap(Buffer.BindTarget.uniform);
|
||||||
|
break;
|
||||||
|
case Technique.uniform_buffer_instanced_mapped:
|
||||||
|
instanced = true;
|
||||||
|
ubos[0].flush(0,data_index,Buffer.BindTarget.uniform);
|
||||||
|
ubos[0].unmap(Buffer.BindTarget.uniform);
|
||||||
|
break;
|
||||||
|
/*case Technique.uniform_buffer_instanced_persistent_mapped:
|
||||||
|
instanced = true;
|
||||||
|
ubos[0].flush(0,data_index,Buffer.BindTarget.uniform);
|
||||||
|
//glMemoryBarrier(GL_BUFFER_UPDATE_BARRIER_BIT);
|
||||||
|
break;
|
||||||
|
case Technique.uniform_buffer_instanced_persistent_mapped_coherent:
|
||||||
|
instanced = true;
|
||||||
|
break;
|
||||||
|
//ubos[0].flush(0,data_index,Buffer.BindTarget.uniform);
|
||||||
|
//goto case(Technique.uniform_buffer_instanced_mapped);
|
||||||
|
case Technique.ssbo_instanced:
|
||||||
|
//buffer_target = Buffer.BindTarget.shader_storage;
|
||||||
|
ubos[0].bindRange(Buffer.BindTarget.shader_storage,0,0,48*MaxObjects);
|
||||||
|
goto case(Technique.uniform_buffer_instanced);
|
||||||
|
case Technique.uniform_buffer_draw_indirect:
|
||||||
|
goto case(Technique.uniform_buffer);
|
||||||
|
case Technique.uniform_buffer_multi_draw_indirect:
|
||||||
|
indirect_buffer.bind(Buffer.BindTarget.array);
|
||||||
|
glEnableVertexAttribArray(2);
|
||||||
|
|
||||||
|
glVertexAttribIPointer(2,1,GL_UNSIGNED_INT,cast(uint)IndirectDraw.sizeof,cast(void*)(4*uint.sizeof));
|
||||||
|
glVertexAttribDivisor(2,1);
|
||||||
|
goto case(Technique.uniform_buffer_multi_draw_indirect_arb_draw_parameters);
|
||||||
|
case Technique.uniform_buffer_multi_draw_indirect_arb_draw_parameters:
|
||||||
|
indirect = true;
|
||||||
|
goto case(Technique.uniform_buffer_instanced);*/
|
||||||
|
default:break;
|
||||||
|
}
|
||||||
|
|
||||||
|
data_index = 0;
|
||||||
|
|
||||||
|
int mesh_id = -1;
|
||||||
|
int material_id = -1;
|
||||||
|
int ubo_start = -1;
|
||||||
|
Texture texture;
|
||||||
|
uint item_ubo_id = 0;
|
||||||
|
|
||||||
|
/*Buffer tmpb = ubos[0];
|
||||||
|
ubos[0] = ubos[1];
|
||||||
|
ubos[1] = tmpb;
|
||||||
|
|
||||||
|
tmpb = batch_vbo[0];
|
||||||
|
batch_vbo[0] = batch_vbo[1];
|
||||||
|
batch_vbo[1] = tmpb;
|
||||||
|
|
||||||
|
tmpb = batch_ibo[0];
|
||||||
|
batch_ibo[0] = batch_ibo[1];
|
||||||
|
batch_ibo[1] = tmpb;//*/
|
||||||
|
//glFinish();
|
||||||
|
|
||||||
|
//glBeginQuery(GL_TIME_ELAPSED, time_queries[0]);
|
||||||
|
if(technique == Technique.vbo_batch)
|
||||||
|
{
|
||||||
|
uint items = item_id/16_384+1;
|
||||||
|
foreach(i; 0..items)
|
||||||
|
{
|
||||||
|
if(material_id != render_list[i].material_id)
|
||||||
|
{
|
||||||
|
material_id = render_list[i].material_id;
|
||||||
|
GfxConfig.materials[material_id].bind();
|
||||||
|
}
|
||||||
|
if(texture.data != render_list[i].texture.data)
|
||||||
|
{
|
||||||
|
texture.data = render_list[i].texture.data;
|
||||||
|
render_list[i].texture.bind();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint instance_count = 16_384;
|
||||||
|
if(i*16_384 > item_id)
|
||||||
|
{
|
||||||
|
instance_count = i*16_384 - item_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*glVertexAttribPointer(0,2,GL_FLOAT,false,16,cast(void*)(i*16_384*4*16));
|
||||||
|
glVertexAttribPointer(1,2,GL_FLOAT,false,16,cast(void*)(i*16_384*4*16+8));
|
||||||
|
|
||||||
|
glDrawElements(GL_TRIANGLES,instance_count*6,GL_UNSIGNED_SHORT,cast(void*)(i*16_384*6*2));*/
|
||||||
|
|
||||||
|
glDrawElementsBaseVertex(GL_TRIANGLES,instance_count*6,GL_UNSIGNED_SHORT,cast(void*)(i*16_384*6*2),i*16_384*4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(technique == Technique.ssbo_instanced || technique == Technique.instanced_attrib_divisor)
|
||||||
|
{
|
||||||
|
if(mesh_id != render_list[0].mesh_id)
|
||||||
|
{
|
||||||
|
mesh_id = render_list[0].mesh_id;
|
||||||
|
GfxConfig.meshes[mesh_id].bind();
|
||||||
|
}
|
||||||
|
if(material_id != render_list[0].material_id)
|
||||||
|
{
|
||||||
|
material_id = render_list[0].material_id;
|
||||||
|
GfxConfig.materials[material_id].bind();
|
||||||
|
}
|
||||||
|
if(texture.data != render_list[0].texture.data)
|
||||||
|
{
|
||||||
|
texture.data = render_list[0].texture.data;
|
||||||
|
render_list[0].texture.bind();
|
||||||
|
}
|
||||||
|
glDrawArraysInstanced(GL_TRIANGLE_STRIP,0,4,item_id);
|
||||||
|
//glDrawElementsInstanced(GL_TRIANGLES,6,GL_UNSIGNED_SHORT,null,item_id);
|
||||||
|
}
|
||||||
|
else if(instanced)
|
||||||
|
{
|
||||||
|
uint items = item_id/992+1;
|
||||||
|
foreach(i; 0..items)
|
||||||
|
{
|
||||||
|
if(mesh_id != render_list[i].mesh_id)
|
||||||
|
{
|
||||||
|
mesh_id = render_list[i].mesh_id;
|
||||||
|
GfxConfig.meshes[mesh_id].bind();
|
||||||
|
}
|
||||||
|
if(material_id != render_list[i].material_id)
|
||||||
|
{
|
||||||
|
material_id = render_list[i].material_id;
|
||||||
|
GfxConfig.materials[material_id].bind();
|
||||||
|
}
|
||||||
|
if(texture.data != render_list[i].texture.data)
|
||||||
|
{
|
||||||
|
texture.data = render_list[0].texture.data;
|
||||||
|
render_list[i].texture.bind();
|
||||||
|
}
|
||||||
|
ubos[0].bindRange(buffer_target,0,data_index,block_max_size);
|
||||||
|
|
||||||
|
uint instance_count = 992;
|
||||||
|
if(i*992 > item_id)
|
||||||
|
{
|
||||||
|
instance_count = i*992 - item_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*if(indirect)glMultiDrawElementsIndirect(GL_TRIANGLES, GL_UNSIGNED_SHORT, cast(void*)0, instance_count, 0);
|
||||||
|
else if(multi_draw)glMultiDrawElements(GL_TRIANGLES,cast(int*)multi_count.ptr,GL_UNSIGNED_SHORT,cast(void**)multi_offset.ptr,instance_count);
|
||||||
|
//glMultiDrawElementsBaseVertex(GL_TRIANGLES,cast(int*)multi_count.ptr,GL_UNSIGNED_SHORT,cast(void**)multi_offset.ptr,instance_count,cast(int*)multi_offset.ptr);
|
||||||
|
else */glDrawElementsInstanced(GL_TRIANGLES,6,GL_UNSIGNED_SHORT,null,instance_count);
|
||||||
|
//glDrawArraysInstanced(GL_TRIANGLES,0,6,instance_count);
|
||||||
|
data_index += data_offset * 992;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
foreach(item; render_list[0..item_id])
|
||||||
|
{
|
||||||
|
if(mesh_id != item.mesh_id)
|
||||||
|
{
|
||||||
|
mesh_id = item.mesh_id;
|
||||||
|
GfxConfig.meshes[mesh_id].bind();
|
||||||
|
}
|
||||||
|
if(material_id != item.material_id)
|
||||||
|
{
|
||||||
|
material_id = item.material_id;
|
||||||
|
GfxConfig.materials[material_id].bind();
|
||||||
|
GfxConfig.materials[material_id].pushBindings();
|
||||||
|
}
|
||||||
|
if(texture.data != item.texture.data)
|
||||||
|
{
|
||||||
|
texture.data = render_list[0].texture.data;
|
||||||
|
item.texture.bind();
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(technique)
|
||||||
|
{
|
||||||
|
case Technique.simple:
|
||||||
|
/*glUniform4f(0, *cast(float*)&uniform_block[data_index], *cast(float*)&uniform_block[data_index+4], *cast(float*)&uniform_block[data_index+8], *cast(float*)&uniform_block[data_index+12]);
|
||||||
|
glUniform4f(1, *cast(float*)&uniform_block[data_index+16], *cast(float*)&uniform_block[data_index+20], *cast(float*)&uniform_block[data_index+24], *cast(float*)&uniform_block[data_index+28]);
|
||||||
|
glUniform4f(2, *cast(float*)&uniform_block[data_index+32], *cast(float*)&uniform_block[data_index+36], *cast(float*)&uniform_block[data_index+40], *cast(float*)&uniform_block[data_index+44]);
|
||||||
|
*/
|
||||||
|
GfxConfig.materials[material_id].pushUniforms(&uniform_block[data_index]);break;
|
||||||
|
case Technique.simple_array:
|
||||||
|
glUniform4fv(0,12,cast(float*)(uniform_block.ptr+data_index));
|
||||||
|
break;
|
||||||
|
case Technique.uniform_buffer:
|
||||||
|
ubos[0].bindRange(Buffer.BindTarget.uniform,0,data_index,data_offset);
|
||||||
|
break;
|
||||||
|
/*case Technique.uniform_buffer_draw_indirect:
|
||||||
|
ubos[0].bindRange(Buffer.BindTarget.uniform,0,data_index,data_offset);
|
||||||
|
glDrawElementsIndirect(GL_TRIANGLES,GL_UNSIGNED_SHORT,null);
|
||||||
|
data_index += data_offset;
|
||||||
|
continue;*/
|
||||||
|
case Technique.uniform_buffer_indexed:
|
||||||
|
if(item_ubo_id >= 992)
|
||||||
|
{
|
||||||
|
item_ubo_id = 0;
|
||||||
|
ubo_start = data_index;
|
||||||
|
ubos[0].bindRange(Buffer.BindTarget.uniform,0,ubo_start,block_max_size);
|
||||||
|
}
|
||||||
|
glUniform1i(0,item_ubo_id++);
|
||||||
|
break;
|
||||||
|
default:break;
|
||||||
|
}//*/
|
||||||
|
|
||||||
|
/*version(ver3)ubos[0].bindRange(Buffer.BindTarget.uniform,0,data_index,data_offset);
|
||||||
|
else version(ver1)
|
||||||
|
{
|
||||||
|
glUniform4f(0, *cast(float*)&uniform_block[data_index], *cast(float*)&uniform_block[data_index+4], *cast(float*)&uniform_block[data_index+8], *cast(float*)&uniform_block[data_index+12]);
|
||||||
|
glUniform4f(1, *cast(float*)&uniform_block[data_index+16], *cast(float*)&uniform_block[data_index+20], *cast(float*)&uniform_block[data_index+24], *cast(float*)&uniform_block[data_index+28]);
|
||||||
|
glUniform4f(2, *cast(float*)&uniform_block[data_index+32], *cast(float*)&uniform_block[data_index+36], *cast(float*)&uniform_block[data_index+40], *cast(float*)&uniform_block[data_index+44]);
|
||||||
|
}
|
||||||
|
else version(ver2)glUniform4fv(0,12,cast(float*)(uniform_block.ptr+data_index));
|
||||||
|
else version(ver4)
|
||||||
|
{
|
||||||
|
if(item_ubo_id >= 992)
|
||||||
|
{
|
||||||
|
item_ubo_id = 0;
|
||||||
|
ubo_start = data_index;
|
||||||
|
ubos[0].bindRange(Buffer.BindTarget.uniform,0,ubo_start,block_max_size);
|
||||||
|
}
|
||||||
|
glUniform1i(0,item_ubo_id++);
|
||||||
|
}//*/
|
||||||
|
|
||||||
|
glDrawElements(GL_TRIANGLES,6,GL_UNSIGNED_SHORT,null);
|
||||||
|
//glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||||
|
data_index += data_offset;
|
||||||
|
}
|
||||||
|
//glEndQuery(GL_TIME_ELAPSED);
|
||||||
|
//uint tmpq = time_queries[0];
|
||||||
|
//time_queries[0] = time_queries[1];
|
||||||
|
//time_queries[1] = tmpq;
|
||||||
|
/*Buffer tmpb = ubos[0];
|
||||||
|
ubos[0] = ubos[1];
|
||||||
|
ubos[1] = tmpb;//*/
|
||||||
|
|
||||||
|
data_index = 0;
|
||||||
|
//data_offset = 0;
|
||||||
|
item_id = 0;
|
||||||
|
//SDL_GL_SwapWindow(sdl_window);
|
||||||
|
//glMemoryBarrier(GL_BUFFER_UPDATE_BARRIER_BIT);
|
||||||
|
//version(ver6)ubos[0].map(0, 64*MaxObjects, Buffer.BindTarget.uniform);
|
||||||
|
//ubos[0].map(Buffer.BindTarget.uniform);
|
||||||
|
|
||||||
|
switch(technique)
|
||||||
|
{
|
||||||
|
case Technique.uniform_buffer_instanced_mapped_gl2:
|
||||||
|
ubos[0].map(Buffer.BindTarget.uniform);
|
||||||
|
//data_ptr = ubos[0].mappedPointer();
|
||||||
|
break;
|
||||||
|
case Technique.uniform_buffer_instanced_mapped:
|
||||||
|
ubos[0].map(0, 64*MaxObjects, Buffer.BindTarget.uniform);
|
||||||
|
//data_ptr = ubos[0].mappedPointer();
|
||||||
|
break;
|
||||||
|
default:break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ubos[0].data && ubos[0].mappedPointer)
|
||||||
|
{
|
||||||
|
data_ptr = ubos[0].mappedPointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*switch(technique)
|
||||||
|
{
|
||||||
|
case Technique.simple:
|
||||||
|
case Technique.simple_array:
|
||||||
|
case Technique.uniform_buffer:
|
||||||
|
case Technique.uniform_buffer_indexed:
|
||||||
|
case Technique.uniform_buffer_instanced:
|
||||||
|
case Technique.uniform_buffer_instanced_mapped:
|
||||||
|
case Technique.uniform_buffer_instanced_persistent_mapped:
|
||||||
|
default:break;
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
glDisableVertexAttribArray(0);
|
||||||
|
glDisableVertexAttribArray(1);
|
||||||
|
/*glUseProgram(0);
|
||||||
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);*/
|
||||||
|
//glDisable(GL_ALPHA_TEST);
|
||||||
|
}
|
||||||
|
|
||||||
|
void resize(ivec2 size)
|
||||||
|
{
|
||||||
|
resolution = size;
|
||||||
|
dres = vec2(1.0/cast(float)size.x,1.0/cast(float)size.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void view(vec2 pos, vec2 size)
|
||||||
|
{
|
||||||
|
view_pos = pos * size - 1;
|
||||||
|
view_size = vec2(2/size.x,2/size.y);
|
||||||
|
sdl_transform = vec4(0,0,1.0/size.x,1.0/size.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared void function(ref Renderer this_, Texture tex, vec2 pos, vec2 size, vec4 coords, float angle, uint material_id, uint mesh_id) __draw;
|
||||||
|
__gshared void function(ref Renderer this_) __present;
|
||||||
|
__gshared void function(ref Renderer this_) __clear;
|
||||||
|
__gshared void function(ref Renderer this_) __initialize;
|
||||||
|
|
||||||
|
static void __loadBackend()
|
||||||
|
{
|
||||||
|
//this.technique = __ecs_used_technique;
|
||||||
|
if(technique == Technique.vbo_batch)__draw = &__draw_gl_vbo_batch;
|
||||||
|
else __draw = &__draw_gl;
|
||||||
|
__present = &__present_gl;
|
||||||
|
__clear = &__clear_gl;
|
||||||
|
__initialize = &__initialize_gl;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
176
demos/utils/source/ecs_utils/gfx/shader.d
Normal file
176
demos/utils/source/ecs_utils/gfx/shader.d
Normal file
|
|
@ -0,0 +1,176 @@
|
||||||
|
module ecs_utils.gfx.shader;
|
||||||
|
|
||||||
|
import bindbc.sdl;
|
||||||
|
|
||||||
|
import ecs.std;
|
||||||
|
|
||||||
|
import glad.gl.gl;
|
||||||
|
|
||||||
|
//version = ver1;
|
||||||
|
|
||||||
|
struct Shader
|
||||||
|
{
|
||||||
|
|
||||||
|
void create() nothrow
|
||||||
|
{
|
||||||
|
data = Mallocator.make!Data;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool load(const char[] path) nothrow
|
||||||
|
{
|
||||||
|
if(data is null)data = Mallocator.make!Data;
|
||||||
|
|
||||||
|
char[] cpath = (cast(char*)alloca(path.length+1))[0..path.length+1];
|
||||||
|
cpath[0..$-1] = path[0..$];
|
||||||
|
cpath[$-1] = 0;
|
||||||
|
|
||||||
|
int ind = cast(int)path.length - 1;
|
||||||
|
for(;ind>0;ind--)
|
||||||
|
{
|
||||||
|
if(path[ind] == '.')break;
|
||||||
|
}
|
||||||
|
if(ind < 0)return false;
|
||||||
|
ind++;
|
||||||
|
if(ind + 2 > path.length)return false;
|
||||||
|
|
||||||
|
char[2] ext = path[ind .. ind + 2];
|
||||||
|
if(ext[0] == 'v' && ext[1] == 'p')data.type = Type.vertex;
|
||||||
|
else if(ext[0] == 'f' && ext[1] == 'p')data.type = Type.fragment;
|
||||||
|
else return false;
|
||||||
|
|
||||||
|
SDL_RWops* file = SDL_RWFromFile(cpath.ptr,"r");//SDL_LoadFile(cpath.ptr,);
|
||||||
|
if(file)
|
||||||
|
{
|
||||||
|
size_t size = cast(size_t)SDL_RWsize(file);
|
||||||
|
data.code = Mallocator.makeArray!char(size+1);
|
||||||
|
data.code[$-1] = 0;
|
||||||
|
SDL_RWread(file,data.code.ptr,size,1);
|
||||||
|
|
||||||
|
SDL_RWclose(file);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool compile() nothrow
|
||||||
|
{
|
||||||
|
switch(data.type)
|
||||||
|
{
|
||||||
|
case Type.vertex:
|
||||||
|
data.gl_handle = glCreateShader(GL_VERTEX_SHADER);
|
||||||
|
break;
|
||||||
|
case Type.fragment:
|
||||||
|
data.gl_handle = glCreateShader(GL_FRAGMENT_SHADER);
|
||||||
|
break;
|
||||||
|
default: return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
version(WebAssembly)const char* glsl = "#version 100\n";
|
||||||
|
else const char* glsl = "#version 330\n";
|
||||||
|
const char* buffer = data.code.ptr;
|
||||||
|
char* ver;
|
||||||
|
version(WebAssembly)ver = cast(char*)"#define ver1 1\n#define GLES\n".ptr;
|
||||||
|
else ver = cast(char*)"#define ver1 1\n".ptr;
|
||||||
|
/*switch(__ecs_used_technique)
|
||||||
|
{
|
||||||
|
case RenderTechnique.simple:
|
||||||
|
ver = cast(char*)"#define ver1 1\n".ptr;
|
||||||
|
break;
|
||||||
|
case RenderTechnique.simple_array:
|
||||||
|
ver = cast(char*)"#define ver2 1\n".ptr;
|
||||||
|
break;
|
||||||
|
case RenderTechnique.vbo_batch:
|
||||||
|
ver = cast(char*)"#define ver10 1\n".ptr;
|
||||||
|
break;
|
||||||
|
case RenderTechnique.instanced_attrib_divisor:
|
||||||
|
ver = cast(char*)"#define ver8 1\n".ptr;
|
||||||
|
break;
|
||||||
|
case RenderTechnique.uniform_buffer:
|
||||||
|
ver = cast(char*)"#define ver3 1\n".ptr;
|
||||||
|
break;
|
||||||
|
case RenderTechnique.uniform_buffer_indexed:
|
||||||
|
ver = cast(char*)"#define ver4 1\n".ptr;
|
||||||
|
break;
|
||||||
|
case RenderTechnique.uniform_buffer_multi_draw:
|
||||||
|
goto case(RenderTechnique.uniform_buffer_multi_draw_indirect);
|
||||||
|
case RenderTechnique.uniform_buffer_instanced:
|
||||||
|
ver = cast(char*)"#define ver5 1\n".ptr;
|
||||||
|
break;
|
||||||
|
case RenderTechnique.uniform_buffer_instanced_mapped_gl2:
|
||||||
|
goto case(RenderTechnique.uniform_buffer_instanced);
|
||||||
|
case RenderTechnique.uniform_buffer_instanced_mapped:
|
||||||
|
goto case(RenderTechnique.uniform_buffer_instanced);
|
||||||
|
case RenderTechnique.uniform_buffer_instanced_persistent_mapped:
|
||||||
|
goto case(RenderTechnique.uniform_buffer_instanced);
|
||||||
|
case RenderTechnique.uniform_buffer_instanced_persistent_mapped_coherent:
|
||||||
|
goto case(RenderTechnique.uniform_buffer_instanced);
|
||||||
|
case RenderTechnique.ssbo_instanced:
|
||||||
|
ver = cast(char*)"#define ver6 1\n".ptr;
|
||||||
|
break;
|
||||||
|
case RenderTechnique.uniform_buffer_draw_indirect:
|
||||||
|
goto case(RenderTechnique.uniform_buffer);
|
||||||
|
case RenderTechnique.uniform_buffer_multi_draw_indirect:
|
||||||
|
ver = cast(char*)"#define ver9 1\n".ptr;
|
||||||
|
break;
|
||||||
|
case RenderTechnique.uniform_buffer_multi_draw_indirect_arb_draw_parameters:
|
||||||
|
ver = cast(char*)"#define ver7 1\n".ptr;
|
||||||
|
break;
|
||||||
|
default:break;
|
||||||
|
}*/
|
||||||
|
/*version(ver1)const char* ver = "#define ver1 1\n";
|
||||||
|
version(ver2)const char* ver = "#define ver2 1\n";
|
||||||
|
version(ver3)const char* ver = "#define ver3 1\n";
|
||||||
|
version(ver4)const char* ver = "#define ver4 1\n";
|
||||||
|
version(ver5)const char* ver = "#define ver5 1\n";
|
||||||
|
version(ver6)const char* ver = "#define ver5 1\n";*/
|
||||||
|
|
||||||
|
const char*[3] input = [glsl,ver,buffer];
|
||||||
|
|
||||||
|
glShaderSource(data.gl_handle,3,input.ptr,null);
|
||||||
|
|
||||||
|
glCompileShader(data.gl_handle);
|
||||||
|
|
||||||
|
int compile;
|
||||||
|
glGetShaderiv(data.gl_handle,GL_COMPILE_STATUS,&compile);
|
||||||
|
if(compile == GL_FALSE)
|
||||||
|
{
|
||||||
|
SDL_Log("Shader compile error! %u %s",data.type,glsl);
|
||||||
|
char[256] log;
|
||||||
|
int log_len;
|
||||||
|
glGetShaderInfoLog(data.gl_handle, 256, &log_len, log.ptr);
|
||||||
|
import ecs_utils.utils;
|
||||||
|
if(log_len)printf("%s",log.ptr);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void destroy() nothrow
|
||||||
|
{
|
||||||
|
if(data)
|
||||||
|
{
|
||||||
|
if(data.gl_handle)glDeleteShader(data.gl_handle);
|
||||||
|
Mallocator.dispose(data);
|
||||||
|
data = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Type
|
||||||
|
{
|
||||||
|
vertex,
|
||||||
|
fragment,
|
||||||
|
geometry
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Data
|
||||||
|
{
|
||||||
|
char[] code;
|
||||||
|
Type type;
|
||||||
|
|
||||||
|
uint gl_handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
Data* data;
|
||||||
|
}
|
||||||
11
demos/utils/source/ecs_utils/gfx/sprite.d
Normal file
11
demos/utils/source/ecs_utils/gfx/sprite.d
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
module ecs_utils.gfx.sprite;
|
||||||
|
|
||||||
|
import ecs_utils.math.matrix;
|
||||||
|
import ecs_utils.gfx.mesh_module;
|
||||||
|
|
||||||
|
struct sprite
|
||||||
|
{
|
||||||
|
MeshModule* mesh;
|
||||||
|
|
||||||
|
mat3 matrix;
|
||||||
|
}
|
||||||
118
demos/utils/source/ecs_utils/gfx/texture.d
Normal file
118
demos/utils/source/ecs_utils/gfx/texture.d
Normal file
|
|
@ -0,0 +1,118 @@
|
||||||
|
module ecs_utils.gfx.texture;
|
||||||
|
|
||||||
|
import bindbc.sdl;
|
||||||
|
|
||||||
|
import ecs.std;
|
||||||
|
|
||||||
|
import ecs_utils.math.vector;
|
||||||
|
|
||||||
|
import glad.gl.gl;
|
||||||
|
|
||||||
|
extern(C):
|
||||||
|
|
||||||
|
struct Texture
|
||||||
|
{
|
||||||
|
|
||||||
|
void create()
|
||||||
|
{
|
||||||
|
data = Mallocator.make!Data;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool load(const char[] path)
|
||||||
|
{
|
||||||
|
char[] cpath = (cast(char*)alloca(path.length+1))[0..path.length+1];
|
||||||
|
cpath[0..$-1] = path[0..$];
|
||||||
|
cpath[$-1] = 0;
|
||||||
|
|
||||||
|
return __load(this, cpath);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*static bool __load_sdl(ref Texture this_, const char[] path)
|
||||||
|
{
|
||||||
|
import ecs_utils.gfx.renderer;
|
||||||
|
SDL_Surface* surf = IMG_Load(path.ptr);
|
||||||
|
if(!surf)return false;
|
||||||
|
|
||||||
|
this_.data.size = ivec2(surf.w,surf.h);
|
||||||
|
|
||||||
|
this_.data.texture = SDL_CreateTextureFromSurface(Renderer.main_sdl_renderer,surf);
|
||||||
|
if(!this_.data.texture)return false;
|
||||||
|
//this_.data.texture = surf;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
static bool __load_gl(ref Texture this_, const char[] path)
|
||||||
|
{
|
||||||
|
SDL_Surface* surf = IMG_Load(path.ptr);
|
||||||
|
if(!surf)return false;
|
||||||
|
|
||||||
|
with(this_)
|
||||||
|
{
|
||||||
|
data.size = ivec2(surf.w,surf.h);
|
||||||
|
data.bpp = surf.format.BytesPerPixel;
|
||||||
|
data.data = Mallocator.makeArray!ubyte(surf.w*surf.h*surf.format.BytesPerPixel);
|
||||||
|
data.data[0..$] = (cast(ubyte*)surf.pixels)[0..data.data.length];
|
||||||
|
|
||||||
|
glGenTextures(1, &data.gl_handle);
|
||||||
|
glBindTexture(GL_TEXTURE_2D,data.gl_handle);
|
||||||
|
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
|
||||||
|
if(data.bpp == 3)glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,surf.w,surf.h,0,GL_RGB,GL_UNSIGNED_BYTE,data.data.ptr);
|
||||||
|
else if(data.bpp == 4)glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,surf.w,surf.h,0,GL_RGBA,GL_UNSIGNED_BYTE,data.data.ptr);
|
||||||
|
else return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void bind()
|
||||||
|
{
|
||||||
|
glActiveTexture(GL_TEXTURE0);
|
||||||
|
glBindTexture(GL_TEXTURE_2D, data.gl_handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
void destory()
|
||||||
|
{
|
||||||
|
if(data)
|
||||||
|
{
|
||||||
|
glDeleteTextures(1, &data.gl_handle);
|
||||||
|
Mallocator.dispose(data);
|
||||||
|
data = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
__gshared bool function(ref Texture this_, const char[] path) __load;
|
||||||
|
|
||||||
|
struct Data
|
||||||
|
{
|
||||||
|
ubyte[] data;
|
||||||
|
|
||||||
|
ivec2 size;
|
||||||
|
uint bpp;
|
||||||
|
|
||||||
|
union
|
||||||
|
{
|
||||||
|
SDL_Texture* texture;
|
||||||
|
uint gl_handle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __loadBackend()
|
||||||
|
{
|
||||||
|
__load = &__load_gl;
|
||||||
|
/*switch(backend)
|
||||||
|
{
|
||||||
|
case Backend.opengl:__load = &__load_gl;break;
|
||||||
|
case Backend.sdl:__load = &__load_sdl;break;
|
||||||
|
default:goto case(Backend.opengl);
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
Data* data;
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue