diff --git a/src/sokol/app.d b/src/sokol/app.d index 40183a4..b5948cc 100644 --- a/src/sokol/app.d +++ b/src/sokol/app.d @@ -407,226 +407,226 @@ enum MouseCursor { Num, } extern(C) bool sapp_isvalid() @system @nogc nothrow; -bool isvalid() @trusted nothrow @nogc { +bool isvalid() @trusted @nogc nothrow { return sapp_isvalid(); } extern(C) int sapp_width() @system @nogc nothrow; -int width() @trusted nothrow @nogc { +int width() @trusted @nogc nothrow { return sapp_width(); } extern(C) float sapp_widthf() @system @nogc nothrow; -float widthf() @trusted nothrow @nogc { +float widthf() @trusted @nogc nothrow { return sapp_widthf(); } extern(C) int sapp_height() @system @nogc nothrow; -int height() @trusted nothrow @nogc { +int height() @trusted @nogc nothrow { return sapp_height(); } extern(C) float sapp_heightf() @system @nogc nothrow; -float heightf() @trusted nothrow @nogc { +float heightf() @trusted @nogc nothrow { return sapp_heightf(); } extern(C) int sapp_color_format() @system @nogc nothrow; -int colorFormat() @trusted nothrow @nogc { +int colorFormat() @trusted @nogc nothrow { return sapp_color_format(); } extern(C) int sapp_depth_format() @system @nogc nothrow; -int depthFormat() @trusted nothrow @nogc { +int depthFormat() @trusted @nogc nothrow { return sapp_depth_format(); } extern(C) int sapp_sample_count() @system @nogc nothrow; -int sampleCount() @trusted nothrow @nogc { +int sampleCount() @trusted @nogc nothrow { return sapp_sample_count(); } extern(C) bool sapp_high_dpi() @system @nogc nothrow; -bool highDpi() @trusted nothrow @nogc { +bool highDpi() @trusted @nogc nothrow { return sapp_high_dpi(); } extern(C) float sapp_dpi_scale() @system @nogc nothrow; -float dpiScale() @trusted nothrow @nogc { +float dpiScale() @trusted @nogc nothrow { return sapp_dpi_scale(); } extern(C) void sapp_show_keyboard(bool) @system @nogc nothrow; -void showKeyboard(bool show) @trusted nothrow @nogc { +void showKeyboard(bool show) @trusted @nogc nothrow { sapp_show_keyboard(show); } extern(C) bool sapp_keyboard_shown() @system @nogc nothrow; -bool keyboardShown() @trusted nothrow @nogc { +bool keyboardShown() @trusted @nogc nothrow { return sapp_keyboard_shown(); } extern(C) bool sapp_is_fullscreen() @system @nogc nothrow; -bool isFullscreen() @trusted nothrow @nogc { +bool isFullscreen() @trusted @nogc nothrow { return sapp_is_fullscreen(); } extern(C) void sapp_toggle_fullscreen() @system @nogc nothrow; -void toggleFullscreen() @trusted nothrow @nogc { +void toggleFullscreen() @trusted @nogc nothrow { sapp_toggle_fullscreen(); } extern(C) void sapp_show_mouse(bool) @system @nogc nothrow; -void showMouse(bool show) @trusted nothrow @nogc { +void showMouse(bool show) @trusted @nogc nothrow { sapp_show_mouse(show); } extern(C) bool sapp_mouse_shown() @system @nogc nothrow; -bool mouseShown() @trusted nothrow @nogc { +bool mouseShown() @trusted @nogc nothrow { return sapp_mouse_shown(); } extern(C) void sapp_lock_mouse(bool) @system @nogc nothrow; -void lockMouse(bool lock) @trusted nothrow @nogc { +void lockMouse(bool lock) @trusted @nogc nothrow { sapp_lock_mouse(lock); } extern(C) bool sapp_mouse_locked() @system @nogc nothrow; -bool mouseLocked() @trusted nothrow @nogc { +bool mouseLocked() @trusted @nogc nothrow { return sapp_mouse_locked(); } extern(C) void sapp_set_mouse_cursor(MouseCursor) @system @nogc nothrow; -void setMouseCursor(MouseCursor cursor) @trusted nothrow @nogc { +void setMouseCursor(MouseCursor cursor) @trusted @nogc nothrow { sapp_set_mouse_cursor(cursor); } extern(C) MouseCursor sapp_get_mouse_cursor() @system @nogc nothrow; -MouseCursor getMouseCursor() @trusted nothrow @nogc { +MouseCursor getMouseCursor() @trusted @nogc nothrow { return sapp_get_mouse_cursor(); } extern(C) void* sapp_userdata() @system @nogc nothrow; -scope void* userdata() @trusted nothrow @nogc { +scope void* userdata() @trusted @nogc nothrow { return sapp_userdata(); } extern(C) Desc sapp_query_desc() @system @nogc nothrow; -Desc queryDesc() @trusted nothrow @nogc { +Desc queryDesc() @trusted @nogc nothrow { return sapp_query_desc(); } extern(C) void sapp_request_quit() @system @nogc nothrow; -void requestQuit() @trusted nothrow @nogc { +void requestQuit() @trusted @nogc nothrow { sapp_request_quit(); } extern(C) void sapp_cancel_quit() @system @nogc nothrow; -void cancelQuit() @trusted nothrow @nogc { +void cancelQuit() @trusted @nogc nothrow { sapp_cancel_quit(); } extern(C) void sapp_quit() @system @nogc nothrow; -void quit() @trusted nothrow @nogc { +void quit() @trusted @nogc nothrow { sapp_quit(); } extern(C) void sapp_consume_event() @system @nogc nothrow; -void consumeEvent() @trusted nothrow @nogc { +void consumeEvent() @trusted @nogc nothrow { sapp_consume_event(); } extern(C) ulong sapp_frame_count() @system @nogc nothrow; -ulong frameCount() @trusted nothrow @nogc { +ulong frameCount() @trusted @nogc nothrow { return sapp_frame_count(); } extern(C) double sapp_frame_duration() @system @nogc nothrow; -double frameDuration() @trusted nothrow @nogc { +double frameDuration() @trusted @nogc nothrow { return sapp_frame_duration(); } extern(C) void sapp_set_clipboard_string(scope const(char)*) @system @nogc nothrow; -void setClipboardString(scope const(char)* str) @trusted nothrow @nogc { +void setClipboardString(scope const(char)* str) @trusted @nogc nothrow { sapp_set_clipboard_string(str); } extern(C) scope const(char)* sapp_get_clipboard_string() @system @nogc nothrow; -scope const(char)* getClipboardString() @trusted nothrow @nogc { +scope const(char)* getClipboardString() @trusted @nogc nothrow { return sapp_get_clipboard_string(); } extern(C) void sapp_set_window_title(scope const(char)*) @system @nogc nothrow; -void setWindowTitle(scope const(char)* str) @trusted nothrow @nogc { +void setWindowTitle(scope const(char)* str) @trusted @nogc nothrow { sapp_set_window_title(str); } extern(C) void sapp_set_icon(const IconDesc *) @system @nogc nothrow; -void setIcon(ref IconDesc icon_desc) @trusted nothrow @nogc { +void setIcon(ref IconDesc icon_desc) @trusted @nogc nothrow { sapp_set_icon(&icon_desc); } extern(C) int sapp_get_num_dropped_files() @system @nogc nothrow; -int getNumDroppedFiles() @trusted nothrow @nogc { +int getNumDroppedFiles() @trusted @nogc nothrow { return sapp_get_num_dropped_files(); } extern(C) scope const(char)* sapp_get_dropped_file_path(int) @system @nogc nothrow; -scope const(char)* getDroppedFilePath(int index) @trusted nothrow @nogc { +scope const(char)* getDroppedFilePath(int index) @trusted @nogc nothrow { return sapp_get_dropped_file_path(index); } extern(C) void sapp_run(const Desc *) @system @nogc nothrow; -void run(ref Desc desc) @trusted nothrow @nogc { +void run(ref Desc desc) @trusted @nogc nothrow { sapp_run(&desc); } extern(C) scope const(void)* sapp_egl_get_display() @system @nogc nothrow; -scope const(void)* eglGetDisplay() @trusted nothrow @nogc { +scope const(void)* eglGetDisplay() @trusted @nogc nothrow { return sapp_egl_get_display(); } extern(C) scope const(void)* sapp_egl_get_context() @system @nogc nothrow; -scope const(void)* eglGetContext() @trusted nothrow @nogc { +scope const(void)* eglGetContext() @trusted @nogc nothrow { return sapp_egl_get_context(); } extern(C) void sapp_html5_ask_leave_site(bool) @system @nogc nothrow; -void html5AskLeaveSite(bool ask) @trusted nothrow @nogc { +void html5AskLeaveSite(bool ask) @trusted @nogc nothrow { sapp_html5_ask_leave_site(ask); } extern(C) uint sapp_html5_get_dropped_file_size(int) @system @nogc nothrow; -uint html5GetDroppedFileSize(int index) @trusted nothrow @nogc { +uint html5GetDroppedFileSize(int index) @trusted @nogc nothrow { return sapp_html5_get_dropped_file_size(index); } extern(C) void sapp_html5_fetch_dropped_file(const Html5FetchRequest *) @system @nogc nothrow; -void html5FetchDroppedFile(ref Html5FetchRequest request) @trusted nothrow @nogc { +void html5FetchDroppedFile(ref Html5FetchRequest request) @trusted @nogc nothrow { sapp_html5_fetch_dropped_file(&request); } extern(C) scope const(void)* sapp_metal_get_device() @system @nogc nothrow; -scope const(void)* metalGetDevice() @trusted nothrow @nogc { +scope const(void)* metalGetDevice() @trusted @nogc nothrow { return sapp_metal_get_device(); } extern(C) scope const(void)* sapp_metal_get_renderpass_descriptor() @system @nogc nothrow; -scope const(void)* metalGetRenderpassDescriptor() @trusted nothrow @nogc { +scope const(void)* metalGetRenderpassDescriptor() @trusted @nogc nothrow { return sapp_metal_get_renderpass_descriptor(); } extern(C) scope const(void)* sapp_metal_get_drawable() @system @nogc nothrow; -scope const(void)* metalGetDrawable() @trusted nothrow @nogc { +scope const(void)* metalGetDrawable() @trusted @nogc nothrow { return sapp_metal_get_drawable(); } extern(C) scope const(void)* sapp_macos_get_window() @system @nogc nothrow; -scope const(void)* macosGetWindow() @trusted nothrow @nogc { +scope const(void)* macosGetWindow() @trusted @nogc nothrow { return sapp_macos_get_window(); } extern(C) scope const(void)* sapp_ios_get_window() @system @nogc nothrow; -scope const(void)* iosGetWindow() @trusted nothrow @nogc { +scope const(void)* iosGetWindow() @trusted @nogc nothrow { return sapp_ios_get_window(); } extern(C) scope const(void)* sapp_d3d11_get_device() @system @nogc nothrow; -scope const(void)* d3d11GetDevice() @trusted nothrow @nogc { +scope const(void)* d3d11GetDevice() @trusted @nogc nothrow { return sapp_d3d11_get_device(); } extern(C) scope const(void)* sapp_d3d11_get_device_context() @system @nogc nothrow; -scope const(void)* d3d11GetDeviceContext() @trusted nothrow @nogc { +scope const(void)* d3d11GetDeviceContext() @trusted @nogc nothrow { return sapp_d3d11_get_device_context(); } extern(C) scope const(void)* sapp_d3d11_get_swap_chain() @system @nogc nothrow; -scope const(void)* d3d11GetSwapChain() @trusted nothrow @nogc { +scope const(void)* d3d11GetSwapChain() @trusted @nogc nothrow { return sapp_d3d11_get_swap_chain(); } extern(C) scope const(void)* sapp_d3d11_get_render_target_view() @system @nogc nothrow; -scope const(void)* d3d11GetRenderTargetView() @trusted nothrow @nogc { +scope const(void)* d3d11GetRenderTargetView() @trusted @nogc nothrow { return sapp_d3d11_get_render_target_view(); } extern(C) scope const(void)* sapp_d3d11_get_depth_stencil_view() @system @nogc nothrow; -scope const(void)* d3d11GetDepthStencilView() @trusted nothrow @nogc { +scope const(void)* d3d11GetDepthStencilView() @trusted @nogc nothrow { return sapp_d3d11_get_depth_stencil_view(); } extern(C) scope const(void)* sapp_win32_get_hwnd() @system @nogc nothrow; -scope const(void)* win32GetHwnd() @trusted nothrow @nogc { +scope const(void)* win32GetHwnd() @trusted @nogc nothrow { return sapp_win32_get_hwnd(); } extern(C) scope const(void)* sapp_wgpu_get_device() @system @nogc nothrow; -scope const(void)* wgpuGetDevice() @trusted nothrow @nogc { +scope const(void)* wgpuGetDevice() @trusted @nogc nothrow { return sapp_wgpu_get_device(); } extern(C) scope const(void)* sapp_wgpu_get_render_view() @system @nogc nothrow; -scope const(void)* wgpuGetRenderView() @trusted nothrow @nogc { +scope const(void)* wgpuGetRenderView() @trusted @nogc nothrow { return sapp_wgpu_get_render_view(); } extern(C) scope const(void)* sapp_wgpu_get_resolve_view() @system @nogc nothrow; -scope const(void)* wgpuGetResolveView() @trusted nothrow @nogc { +scope const(void)* wgpuGetResolveView() @trusted @nogc nothrow { return sapp_wgpu_get_resolve_view(); } extern(C) scope const(void)* sapp_wgpu_get_depth_stencil_view() @system @nogc nothrow; -scope const(void)* wgpuGetDepthStencilView() @trusted nothrow @nogc { +scope const(void)* wgpuGetDepthStencilView() @trusted @nogc nothrow { return sapp_wgpu_get_depth_stencil_view(); } extern(C) scope const(void)* sapp_android_get_native_activity() @system @nogc nothrow; -scope const(void)* androidGetNativeActivity() @trusted nothrow @nogc { +scope const(void)* androidGetNativeActivity() @trusted @nogc nothrow { return sapp_android_get_native_activity(); } diff --git a/src/sokol/audio.d b/src/sokol/audio.d index 31454eb..adfd1a2 100644 --- a/src/sokol/audio.d +++ b/src/sokol/audio.d @@ -65,46 +65,46 @@ struct Desc { Logger logger; } extern(C) void saudio_setup(const Desc *) @system @nogc nothrow; -void setup(ref Desc desc) @trusted nothrow @nogc { +void setup(ref Desc desc) @trusted @nogc nothrow { saudio_setup(&desc); } extern(C) void saudio_shutdown() @system @nogc nothrow; -void shutdown() @trusted nothrow @nogc { +void shutdown() @trusted @nogc nothrow { saudio_shutdown(); } extern(C) bool saudio_isvalid() @system @nogc nothrow; -bool isvalid() @trusted nothrow @nogc { +bool isvalid() @trusted @nogc nothrow { return saudio_isvalid(); } extern(C) void* saudio_userdata() @system @nogc nothrow; -scope void* userdata() @trusted nothrow @nogc { +scope void* userdata() @trusted @nogc nothrow { return saudio_userdata(); } extern(C) Desc saudio_query_desc() @system @nogc nothrow; -Desc queryDesc() @trusted nothrow @nogc { +Desc queryDesc() @trusted @nogc nothrow { return saudio_query_desc(); } extern(C) int saudio_sample_rate() @system @nogc nothrow; -int sampleRate() @trusted nothrow @nogc { +int sampleRate() @trusted @nogc nothrow { return saudio_sample_rate(); } extern(C) int saudio_buffer_frames() @system @nogc nothrow; -int bufferFrames() @trusted nothrow @nogc { +int bufferFrames() @trusted @nogc nothrow { return saudio_buffer_frames(); } extern(C) int saudio_channels() @system @nogc nothrow; -int channels() @trusted nothrow @nogc { +int channels() @trusted @nogc nothrow { return saudio_channels(); } extern(C) bool saudio_suspended() @system @nogc nothrow; -bool suspended() @trusted nothrow @nogc { +bool suspended() @trusted @nogc nothrow { return saudio_suspended(); } extern(C) int saudio_expect() @system @nogc nothrow; -int expect() @trusted nothrow @nogc { +int expect() @trusted @nogc nothrow { return saudio_expect(); } extern(C) int saudio_push(const float *, int) @system @nogc nothrow; -int push(const float * frames, int num_frames) @trusted nothrow @nogc { +int push(const float * frames, int num_frames) @trusted @nogc nothrow { return saudio_push(frames, num_frames); } diff --git a/src/sokol/c/sokol_app.h b/src/sokol/c/sokol_app.h index 14c0457..ea8320a 100644 --- a/src/sokol/c/sokol_app.h +++ b/src/sokol/c/sokol_app.h @@ -537,7 +537,7 @@ Like clipboard support, drag'n'drop support must be explicitly enabled at startup in the sapp_desc struct. - sapp_desc sokol_main() { + sapp_desc sokol_main(void) { return (sapp_desc) { .enable_dragndrop = true, // default is false ... @@ -547,7 +547,7 @@ You can also adjust the maximum number of files that are accepted in a drop operation, and the maximum path length in bytes if needed: - sapp_desc sokol_main() { + sapp_desc sokol_main(void) { return (sapp_desc) { .enable_dragndrop = true, // default is false .max_dropped_files = 8, // default is 1 @@ -687,7 +687,7 @@ For instance on a Retina Mac, returning the following sapp_desc struct from sokol_main(): - sapp_desc sokol_main() { + sapp_desc sokol_main(void) { return (sapp_desc) { .width = 640, .height = 480, @@ -4046,7 +4046,7 @@ _SOKOL_PRIVATE void _sapp_macos_frame(void) { } #endif -_SOKOL_PRIVATE void _sapp_macos_poll_input_events() { +_SOKOL_PRIVATE void _sapp_macos_poll_input_events(void) { /* NOTE: late event polling temporarily out-commented to check if this @@ -5722,7 +5722,7 @@ _SOKOL_PRIVATE void _sapp_emsc_wgpu_request_adapter_cb(WGPURequestAdapterStatus WGPUDeviceDescriptor dev_desc; _sapp_clear(&dev_desc, sizeof(dev_desc)); - dev_desc.requiredFeaturesCount = cur_feature_index; + dev_desc.requiredFeatureCount = cur_feature_index; dev_desc.requiredFeatures = requiredFeatures, wgpuAdapterRequestDevice(adapter, &dev_desc, _sapp_emsc_wgpu_request_device_cb, 0); } @@ -5782,7 +5782,7 @@ _SOKOL_PRIVATE void _sapp_emsc_register_eventhandlers(void) { #endif } -_SOKOL_PRIVATE void _sapp_emsc_unregister_eventhandlers() { +_SOKOL_PRIVATE void _sapp_emsc_unregister_eventhandlers(void) { emscripten_set_mousedown_callback(_sapp.html5_canvas_selector, 0, true, 0); emscripten_set_mouseup_callback(_sapp.html5_canvas_selector, 0, true, 0); emscripten_set_mousemove_callback(_sapp.html5_canvas_selector, 0, true, 0); @@ -9640,7 +9640,7 @@ _SOKOL_PRIVATE void* _sapp_glx_getprocaddr(const char* procname) } } -_SOKOL_PRIVATE void _sapp_glx_init() { +_SOKOL_PRIVATE void _sapp_glx_init(void) { const char* sonames[] = { "libGL.so.1", "libGL.so", 0 }; for (int i = 0; sonames[i]; i++) { _sapp.glx.libgl = dlopen(sonames[i], RTLD_LAZY|RTLD_GLOBAL); @@ -9715,7 +9715,7 @@ _SOKOL_PRIVATE int _sapp_glx_attrib(GLXFBConfig fbconfig, int attrib) { return value; } -_SOKOL_PRIVATE GLXFBConfig _sapp_glx_choosefbconfig() { +_SOKOL_PRIVATE GLXFBConfig _sapp_glx_choosefbconfig(void) { GLXFBConfig* native_configs; _sapp_gl_fbconfig* usable_configs; const _sapp_gl_fbconfig* closest; diff --git a/src/sokol/c/sokol_gfx.h b/src/sokol/c/sokol_gfx.h index 6802e18..740de5c 100644 --- a/src/sokol/c/sokol_gfx.h +++ b/src/sokol/c/sokol_gfx.h @@ -1631,6 +1631,7 @@ typedef enum sg_pixel_format { SG_PIXELFORMAT_BC1_RGBA, SG_PIXELFORMAT_BC2_RGBA, SG_PIXELFORMAT_BC3_RGBA, + SG_PIXELFORMAT_BC3_SRGBA, SG_PIXELFORMAT_BC4_R, SG_PIXELFORMAT_BC4_RSN, SG_PIXELFORMAT_BC5_RG, @@ -1638,16 +1639,22 @@ typedef enum sg_pixel_format { SG_PIXELFORMAT_BC6H_RGBF, SG_PIXELFORMAT_BC6H_RGBUF, SG_PIXELFORMAT_BC7_RGBA, + SG_PIXELFORMAT_BC7_SRGBA, SG_PIXELFORMAT_PVRTC_RGB_2BPP, SG_PIXELFORMAT_PVRTC_RGB_4BPP, SG_PIXELFORMAT_PVRTC_RGBA_2BPP, SG_PIXELFORMAT_PVRTC_RGBA_4BPP, SG_PIXELFORMAT_ETC2_RGB8, + SG_PIXELFORMAT_ETC2_SRGB8, SG_PIXELFORMAT_ETC2_RGB8A1, SG_PIXELFORMAT_ETC2_RGBA8, + SG_PIXELFORMAT_ETC2_SRGB8A8, SG_PIXELFORMAT_ETC2_RG11, SG_PIXELFORMAT_ETC2_RG11SN, + SG_PIXELFORMAT_ASTC_4x4_RGBA, + SG_PIXELFORMAT_ASTC_4x4_SRGBA, + _SG_PIXELFORMAT_NUM, _SG_PIXELFORMAT_FORCE_U32 = 0x7FFFFFFF } sg_pixel_format; @@ -4508,6 +4515,9 @@ inline int sg_append_buffer(sg_buffer buf_id, const sg_range& data) { return sg_ #ifndef GL_COMPRESSED_RGBA_S3TC_DXT5_EXT #define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 #endif + #ifndef GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT + #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F + #endif #ifndef GL_COMPRESSED_RED_RGTC1 #define GL_COMPRESSED_RED_RGTC1 0x8DBB #endif @@ -4547,9 +4557,15 @@ inline int sg_append_buffer(sg_buffer buf_id, const sg_range& data) { return sg_ #ifndef GL_COMPRESSED_RGB8_ETC2 #define GL_COMPRESSED_RGB8_ETC2 0x9274 #endif + #ifndef GL_COMPRESSED_SRGB8_ETC2 + #define GL_COMPRESSED_SRGB8_ETC2 0x9275 + #endif #ifndef GL_COMPRESSED_RGBA8_ETC2_EAC #define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 #endif + #ifndef GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC + #define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 + #endif #ifndef GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 #define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 #endif @@ -4559,6 +4575,12 @@ inline int sg_append_buffer(sg_buffer buf_id, const sg_range& data) { return sg_ #ifndef GL_COMPRESSED_SIGNED_RG11_EAC #define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 #endif + #ifndef GL_COMPRESSED_RGBA_ASTC_4x4_KHR + #define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 + #endif + #ifndef GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR + #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 + #endif #ifndef GL_DEPTH24_STENCIL8 #define GL_DEPTH24_STENCIL8 0x88F0 #endif @@ -5922,6 +5944,7 @@ _SOKOL_PRIVATE bool _sg_is_compressed_pixel_format(sg_pixel_format fmt) { case SG_PIXELFORMAT_BC1_RGBA: case SG_PIXELFORMAT_BC2_RGBA: case SG_PIXELFORMAT_BC3_RGBA: + case SG_PIXELFORMAT_BC3_SRGBA: case SG_PIXELFORMAT_BC4_R: case SG_PIXELFORMAT_BC4_RSN: case SG_PIXELFORMAT_BC5_RG: @@ -5929,15 +5952,20 @@ _SOKOL_PRIVATE bool _sg_is_compressed_pixel_format(sg_pixel_format fmt) { case SG_PIXELFORMAT_BC6H_RGBF: case SG_PIXELFORMAT_BC6H_RGBUF: case SG_PIXELFORMAT_BC7_RGBA: + case SG_PIXELFORMAT_BC7_SRGBA: case SG_PIXELFORMAT_PVRTC_RGB_2BPP: case SG_PIXELFORMAT_PVRTC_RGB_4BPP: case SG_PIXELFORMAT_PVRTC_RGBA_2BPP: case SG_PIXELFORMAT_PVRTC_RGBA_4BPP: case SG_PIXELFORMAT_ETC2_RGB8: + case SG_PIXELFORMAT_ETC2_SRGB8: case SG_PIXELFORMAT_ETC2_RGB8A1: case SG_PIXELFORMAT_ETC2_RGBA8: + case SG_PIXELFORMAT_ETC2_SRGB8A8: case SG_PIXELFORMAT_ETC2_RG11: case SG_PIXELFORMAT_ETC2_RG11SN: + case SG_PIXELFORMAT_ASTC_4x4_RGBA: + case SG_PIXELFORMAT_ASTC_4x4_SRGBA: return true; default: return false; @@ -6061,20 +6089,26 @@ _SOKOL_PRIVATE int _sg_row_pitch(sg_pixel_format fmt, int width, int row_align) case SG_PIXELFORMAT_BC4_R: case SG_PIXELFORMAT_BC4_RSN: case SG_PIXELFORMAT_ETC2_RGB8: + case SG_PIXELFORMAT_ETC2_SRGB8: case SG_PIXELFORMAT_ETC2_RGB8A1: pitch = ((width + 3) / 4) * 8; pitch = pitch < 8 ? 8 : pitch; break; case SG_PIXELFORMAT_BC2_RGBA: case SG_PIXELFORMAT_BC3_RGBA: + case SG_PIXELFORMAT_BC3_SRGBA: case SG_PIXELFORMAT_BC5_RG: case SG_PIXELFORMAT_BC5_RGSN: case SG_PIXELFORMAT_BC6H_RGBF: case SG_PIXELFORMAT_BC6H_RGBUF: case SG_PIXELFORMAT_BC7_RGBA: + case SG_PIXELFORMAT_BC7_SRGBA: case SG_PIXELFORMAT_ETC2_RGBA8: + case SG_PIXELFORMAT_ETC2_SRGB8A8: case SG_PIXELFORMAT_ETC2_RG11: case SG_PIXELFORMAT_ETC2_RG11SN: + case SG_PIXELFORMAT_ASTC_4x4_RGBA: + case SG_PIXELFORMAT_ASTC_4x4_SRGBA: pitch = ((width + 3) / 4) * 16; pitch = pitch < 16 ? 16 : pitch; break; @@ -6102,17 +6136,23 @@ _SOKOL_PRIVATE int _sg_num_rows(sg_pixel_format fmt, int height) { case SG_PIXELFORMAT_BC4_R: case SG_PIXELFORMAT_BC4_RSN: case SG_PIXELFORMAT_ETC2_RGB8: + case SG_PIXELFORMAT_ETC2_SRGB8: case SG_PIXELFORMAT_ETC2_RGB8A1: case SG_PIXELFORMAT_ETC2_RGBA8: + case SG_PIXELFORMAT_ETC2_SRGB8A8: case SG_PIXELFORMAT_ETC2_RG11: case SG_PIXELFORMAT_ETC2_RG11SN: case SG_PIXELFORMAT_BC2_RGBA: case SG_PIXELFORMAT_BC3_RGBA: + case SG_PIXELFORMAT_BC3_SRGBA: case SG_PIXELFORMAT_BC5_RG: case SG_PIXELFORMAT_BC5_RGSN: case SG_PIXELFORMAT_BC6H_RGBF: case SG_PIXELFORMAT_BC6H_RGBUF: case SG_PIXELFORMAT_BC7_RGBA: + case SG_PIXELFORMAT_BC7_SRGBA: + case SG_PIXELFORMAT_ASTC_4x4_RGBA: + case SG_PIXELFORMAT_ASTC_4x4_SRGBA: num_rows = ((height + 3) / 4); break; case SG_PIXELFORMAT_PVRTC_RGB_4BPP: @@ -6998,6 +7038,8 @@ _SOKOL_PRIVATE GLenum _sg_gl_teximage_format(sg_pixel_format fmt) { return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; case SG_PIXELFORMAT_BC3_RGBA: return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; + case SG_PIXELFORMAT_BC3_SRGBA: + return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; case SG_PIXELFORMAT_BC4_R: return GL_COMPRESSED_RED_RGTC1; case SG_PIXELFORMAT_BC4_RSN: @@ -7012,6 +7054,8 @@ _SOKOL_PRIVATE GLenum _sg_gl_teximage_format(sg_pixel_format fmt) { return GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB; case SG_PIXELFORMAT_BC7_RGBA: return GL_COMPRESSED_RGBA_BPTC_UNORM_ARB; + case SG_PIXELFORMAT_BC7_SRGBA: + return GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB; case SG_PIXELFORMAT_PVRTC_RGB_2BPP: return GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; case SG_PIXELFORMAT_PVRTC_RGB_4BPP: @@ -7022,14 +7066,22 @@ _SOKOL_PRIVATE GLenum _sg_gl_teximage_format(sg_pixel_format fmt) { return GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; case SG_PIXELFORMAT_ETC2_RGB8: return GL_COMPRESSED_RGB8_ETC2; + case SG_PIXELFORMAT_ETC2_SRGB8: + return GL_COMPRESSED_SRGB8_ETC2; case SG_PIXELFORMAT_ETC2_RGB8A1: return GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2; case SG_PIXELFORMAT_ETC2_RGBA8: return GL_COMPRESSED_RGBA8_ETC2_EAC; + case SG_PIXELFORMAT_ETC2_SRGB8A8: + return GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC; case SG_PIXELFORMAT_ETC2_RG11: return GL_COMPRESSED_RG11_EAC; case SG_PIXELFORMAT_ETC2_RG11SN: return GL_COMPRESSED_SIGNED_RG11_EAC; + case SG_PIXELFORMAT_ASTC_4x4_RGBA: + return GL_COMPRESSED_RGBA_ASTC_4x4_KHR; + case SG_PIXELFORMAT_ASTC_4x4_SRGBA: + return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR; default: SOKOL_UNREACHABLE; return 0; } @@ -7088,6 +7140,7 @@ _SOKOL_PRIVATE GLenum _sg_gl_teximage_internal_format(sg_pixel_format fmt) { case SG_PIXELFORMAT_BC1_RGBA: return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; case SG_PIXELFORMAT_BC2_RGBA: return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; case SG_PIXELFORMAT_BC3_RGBA: return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; + case SG_PIXELFORMAT_BC3_SRGBA: return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; case SG_PIXELFORMAT_BC4_R: return GL_COMPRESSED_RED_RGTC1; case SG_PIXELFORMAT_BC4_RSN: return GL_COMPRESSED_SIGNED_RED_RGTC1; case SG_PIXELFORMAT_BC5_RG: return GL_COMPRESSED_RED_GREEN_RGTC2; @@ -7095,15 +7148,20 @@ _SOKOL_PRIVATE GLenum _sg_gl_teximage_internal_format(sg_pixel_format fmt) { case SG_PIXELFORMAT_BC6H_RGBF: return GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB; case SG_PIXELFORMAT_BC6H_RGBUF: return GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB; case SG_PIXELFORMAT_BC7_RGBA: return GL_COMPRESSED_RGBA_BPTC_UNORM_ARB; + case SG_PIXELFORMAT_BC7_SRGBA: return GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB; case SG_PIXELFORMAT_PVRTC_RGB_2BPP: return GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; case SG_PIXELFORMAT_PVRTC_RGB_4BPP: return GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; case SG_PIXELFORMAT_PVRTC_RGBA_2BPP: return GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; case SG_PIXELFORMAT_PVRTC_RGBA_4BPP: return GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; case SG_PIXELFORMAT_ETC2_RGB8: return GL_COMPRESSED_RGB8_ETC2; + case SG_PIXELFORMAT_ETC2_SRGB8: return GL_COMPRESSED_SRGB8_ETC2; case SG_PIXELFORMAT_ETC2_RGB8A1: return GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2; case SG_PIXELFORMAT_ETC2_RGBA8: return GL_COMPRESSED_RGBA8_ETC2_EAC; + case SG_PIXELFORMAT_ETC2_SRGB8A8: return GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC; case SG_PIXELFORMAT_ETC2_RG11: return GL_COMPRESSED_RG11_EAC; case SG_PIXELFORMAT_ETC2_RG11SN: return GL_COMPRESSED_SIGNED_RG11_EAC; + case SG_PIXELFORMAT_ASTC_4x4_RGBA: return GL_COMPRESSED_RGBA_ASTC_4x4_KHR; + case SG_PIXELFORMAT_ASTC_4x4_SRGBA: return GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR; default: SOKOL_UNREACHABLE; return 0; } } @@ -7216,6 +7274,7 @@ _SOKOL_PRIVATE void _sg_gl_init_pixelformats_s3tc(void) { _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC1_RGBA]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC2_RGBA]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC3_RGBA]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC3_SRGBA]); } _SOKOL_PRIVATE void _sg_gl_init_pixelformats_rgtc(void) { @@ -7229,6 +7288,7 @@ _SOKOL_PRIVATE void _sg_gl_init_pixelformats_bptc(void) { _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC6H_RGBF]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC6H_RGBUF]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC7_RGBA]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC7_SRGBA]); } _SOKOL_PRIVATE void _sg_gl_init_pixelformats_pvrtc(void) { @@ -7240,12 +7300,19 @@ _SOKOL_PRIVATE void _sg_gl_init_pixelformats_pvrtc(void) { _SOKOL_PRIVATE void _sg_gl_init_pixelformats_etc2(void) { _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RGB8]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_SRGB8]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RGB8A1]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RGBA8]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_SRGB8A8]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RG11]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RG11SN]); } +_SOKOL_PRIVATE void _sg_gl_init_pixelformats_astc(void) { + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ASTC_4x4_RGBA]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ASTC_4x4_SRGBA]); + } + _SOKOL_PRIVATE void _sg_gl_init_limits(void) { _SG_GL_CHECK_ERROR(); GLint gl_int; @@ -7298,6 +7365,7 @@ _SOKOL_PRIVATE void _sg_gl_init_caps_glcore33(void) { bool has_bptc = false; // BC6H and BC7 bool has_pvrtc = false; bool has_etc2 = false; + bool has_astc = false; GLint num_ext = 0; glGetIntegerv(GL_NUM_EXTENSIONS, &num_ext); for (int i = 0; i < num_ext; i++) { @@ -7315,6 +7383,8 @@ _SOKOL_PRIVATE void _sg_gl_init_caps_glcore33(void) { has_etc2 = true; } else if (strstr(ext, "_texture_filter_anisotropic")) { _sg.gl.ext_anisotropic = true; + } else if (strstr(ext, "_texture_compression_astc_ldr")) { + has_astc = true; } } } @@ -7346,6 +7416,9 @@ _SOKOL_PRIVATE void _sg_gl_init_caps_glcore33(void) { if (has_etc2) { _sg_gl_init_pixelformats_etc2(); } + if (has_astc) { + _sg_gl_init_pixelformats_astc(); + } } #endif @@ -7367,6 +7440,7 @@ _SOKOL_PRIVATE void _sg_gl_init_caps_gles3(void) { #else bool has_etc2 = true; #endif + bool has_astc = false; bool has_colorbuffer_float = false; bool has_colorbuffer_half_float = false; bool has_texture_float_linear = false; @@ -7390,6 +7464,8 @@ _SOKOL_PRIVATE void _sg_gl_init_caps_gles3(void) { has_pvrtc = true; } else if (strstr(ext, "_compressed_texture_etc")) { has_etc2 = true; + } else if (strstr(ext, "_compressed_texture_astc")) { + has_astc = true; } else if (strstr(ext, "_color_buffer_float")) { has_colorbuffer_float = true; } else if (strstr(ext, "_color_buffer_half_float")) { @@ -7436,6 +7512,9 @@ _SOKOL_PRIVATE void _sg_gl_init_caps_gles3(void) { if (has_etc2) { _sg_gl_init_pixelformats_etc2(); } + if (has_astc) { + _sg_gl_init_pixelformats_astc(); + } } #endif @@ -9584,6 +9663,7 @@ _SOKOL_PRIVATE DXGI_FORMAT _sg_d3d11_texture_pixel_format(sg_pixel_format fmt) { case SG_PIXELFORMAT_BC1_RGBA: return DXGI_FORMAT_BC1_UNORM; case SG_PIXELFORMAT_BC2_RGBA: return DXGI_FORMAT_BC2_UNORM; case SG_PIXELFORMAT_BC3_RGBA: return DXGI_FORMAT_BC3_UNORM; + case SG_PIXELFORMAT_BC3_SRGBA: return DXGI_FORMAT_BC3_UNORM_SRGB; case SG_PIXELFORMAT_BC4_R: return DXGI_FORMAT_BC4_UNORM; case SG_PIXELFORMAT_BC4_RSN: return DXGI_FORMAT_BC4_SNORM; case SG_PIXELFORMAT_BC5_RG: return DXGI_FORMAT_BC5_UNORM; @@ -9591,6 +9671,7 @@ _SOKOL_PRIVATE DXGI_FORMAT _sg_d3d11_texture_pixel_format(sg_pixel_format fmt) { case SG_PIXELFORMAT_BC6H_RGBF: return DXGI_FORMAT_BC6H_SF16; case SG_PIXELFORMAT_BC6H_RGBUF: return DXGI_FORMAT_BC6H_UF16; case SG_PIXELFORMAT_BC7_RGBA: return DXGI_FORMAT_BC7_UNORM; + case SG_PIXELFORMAT_BC7_SRGBA: return DXGI_FORMAT_BC7_UNORM_SRGB; default: return DXGI_FORMAT_UNKNOWN; }; } @@ -11164,6 +11245,7 @@ _SOKOL_PRIVATE MTLPixelFormat _sg_mtl_pixel_format(sg_pixel_format fmt) { case SG_PIXELFORMAT_BC1_RGBA: return MTLPixelFormatBC1_RGBA; case SG_PIXELFORMAT_BC2_RGBA: return MTLPixelFormatBC2_RGBA; case SG_PIXELFORMAT_BC3_RGBA: return MTLPixelFormatBC3_RGBA; + case SG_PIXELFORMAT_BC3_SRGBA: return MTLPixelFormatBC3_RGBA_sRGB; case SG_PIXELFORMAT_BC4_R: return MTLPixelFormatBC4_RUnorm; case SG_PIXELFORMAT_BC4_RSN: return MTLPixelFormatBC4_RSnorm; case SG_PIXELFORMAT_BC5_RG: return MTLPixelFormatBC5_RGUnorm; @@ -11171,16 +11253,21 @@ _SOKOL_PRIVATE MTLPixelFormat _sg_mtl_pixel_format(sg_pixel_format fmt) { case SG_PIXELFORMAT_BC6H_RGBF: return MTLPixelFormatBC6H_RGBFloat; case SG_PIXELFORMAT_BC6H_RGBUF: return MTLPixelFormatBC6H_RGBUfloat; case SG_PIXELFORMAT_BC7_RGBA: return MTLPixelFormatBC7_RGBAUnorm; + case SG_PIXELFORMAT_BC7_SRGBA: return MTLPixelFormatBC7_RGBAUnorm_sRGB; #else case SG_PIXELFORMAT_PVRTC_RGB_2BPP: return MTLPixelFormatPVRTC_RGB_2BPP; case SG_PIXELFORMAT_PVRTC_RGB_4BPP: return MTLPixelFormatPVRTC_RGB_4BPP; case SG_PIXELFORMAT_PVRTC_RGBA_2BPP: return MTLPixelFormatPVRTC_RGBA_2BPP; case SG_PIXELFORMAT_PVRTC_RGBA_4BPP: return MTLPixelFormatPVRTC_RGBA_4BPP; case SG_PIXELFORMAT_ETC2_RGB8: return MTLPixelFormatETC2_RGB8; + case SG_PIXELFORMAT_ETC2_SRGB8: return MTLPixelFormatETC2_RGB8_sRGB; case SG_PIXELFORMAT_ETC2_RGB8A1: return MTLPixelFormatETC2_RGB8A1; case SG_PIXELFORMAT_ETC2_RGBA8: return MTLPixelFormatEAC_RGBA8; + case SG_PIXELFORMAT_ETC2_SRGB8A8: return MTLPixelFormatEAC_RGBA8_sRGB; case SG_PIXELFORMAT_ETC2_RG11: return MTLPixelFormatEAC_RG11Unorm; case SG_PIXELFORMAT_ETC2_RG11SN: return MTLPixelFormatEAC_RG11Snorm; + case SG_PIXELFORMAT_ASTC_4x4_RGBA: return MTLPixelFormatASTC_4x4_LDR; + case SG_PIXELFORMAT_ASTC_4x4_SRGBA: return MTLPixelFormatASTC_4x4_sRGB; #endif default: return MTLPixelFormatInvalid; } @@ -11632,6 +11719,7 @@ _SOKOL_PRIVATE void _sg_mtl_init_caps(void) { _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC1_RGBA]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC2_RGBA]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC3_RGBA]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC3_SRGBA]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC4_R]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC4_RSN]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC5_RG]); @@ -11639,16 +11727,22 @@ _SOKOL_PRIVATE void _sg_mtl_init_caps(void) { _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC6H_RGBF]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC6H_RGBUF]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC7_RGBA]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC7_SRGBA]); #else _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_PVRTC_RGB_2BPP]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_PVRTC_RGB_4BPP]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_PVRTC_RGBA_2BPP]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_PVRTC_RGBA_4BPP]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RGB8]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_SRGB8]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RGB8A1]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RGBA8]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_SRGB8A8]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RG11]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RG11SN]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ASTC_4x4_RGBA]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ASTC_4x4_SRGBA]); + #endif } @@ -13034,6 +13128,7 @@ _SOKOL_PRIVATE WGPUTextureFormat _sg_wgpu_textureformat(sg_pixel_format p) { case SG_PIXELFORMAT_BC1_RGBA: return WGPUTextureFormat_BC1RGBAUnorm; case SG_PIXELFORMAT_BC2_RGBA: return WGPUTextureFormat_BC2RGBAUnorm; case SG_PIXELFORMAT_BC3_RGBA: return WGPUTextureFormat_BC3RGBAUnorm; + case SG_PIXELFORMAT_BC3_SRGBA: return WGPUTextureFormat_BC3RGBAUnormSrgb; case SG_PIXELFORMAT_BC4_R: return WGPUTextureFormat_BC4RUnorm; case SG_PIXELFORMAT_BC4_RSN: return WGPUTextureFormat_BC4RSnorm; case SG_PIXELFORMAT_BC5_RG: return WGPUTextureFormat_BC5RGUnorm; @@ -13041,13 +13136,17 @@ _SOKOL_PRIVATE WGPUTextureFormat _sg_wgpu_textureformat(sg_pixel_format p) { case SG_PIXELFORMAT_BC6H_RGBF: return WGPUTextureFormat_BC6HRGBFloat; case SG_PIXELFORMAT_BC6H_RGBUF: return WGPUTextureFormat_BC6HRGBUfloat; case SG_PIXELFORMAT_BC7_RGBA: return WGPUTextureFormat_BC7RGBAUnorm; + case SG_PIXELFORMAT_BC7_SRGBA: return WGPUTextureFormat_BC7RGBAUnormSrgb; case SG_PIXELFORMAT_ETC2_RGB8: return WGPUTextureFormat_ETC2RGB8Unorm; case SG_PIXELFORMAT_ETC2_RGB8A1: return WGPUTextureFormat_ETC2RGB8A1Unorm; case SG_PIXELFORMAT_ETC2_RGBA8: return WGPUTextureFormat_ETC2RGBA8Unorm; + case SG_PIXELFORMAT_ETC2_SRGB8: return WGPUTextureFormat_ETC2RGB8UnormSrgb; + case SG_PIXELFORMAT_ETC2_SRGB8A8: return WGPUTextureFormat_ETC2RGBA8UnormSrgb; case SG_PIXELFORMAT_ETC2_RG11: return WGPUTextureFormat_EACR11Unorm; case SG_PIXELFORMAT_ETC2_RG11SN: return WGPUTextureFormat_EACR11Snorm; case SG_PIXELFORMAT_RGB9E5: return WGPUTextureFormat_RGB9E5Ufloat; - + case SG_PIXELFORMAT_ASTC_4x4_RGBA: return WGPUTextureFormat_ASTC4x4Unorm; + case SG_PIXELFORMAT_ASTC_4x4_SRGBA: return WGPUTextureFormat_ASTC4x4UnormSrgb; // NOT SUPPORTED case SG_PIXELFORMAT_R16: case SG_PIXELFORMAT_R16SN: @@ -13258,6 +13357,7 @@ _SOKOL_PRIVATE void _sg_wgpu_init_caps(void) { _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC1_RGBA]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC2_RGBA]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC3_RGBA]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC3_SRGBA]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC4_R]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC4_RSN]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC5_RG]); @@ -13265,14 +13365,22 @@ _SOKOL_PRIVATE void _sg_wgpu_init_caps(void) { _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC6H_RGBF]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC6H_RGBUF]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC7_RGBA]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC7_SRGBA]); } if (wgpuDeviceHasFeature(_sg.wgpu.dev, WGPUFeatureName_TextureCompressionETC2)) { _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RGB8]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_SRGB8]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RGB8A1]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RGBA8]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_SRGB8A8]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RG11]); _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RG11SN]); } + + if (wgpuDeviceHasFeature(_sg.wgpu.dev, WGPUFeatureName_TextureCompressionASTC)) { + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ASTC_4x4_RGBA]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ASTC_4x4_SRGBA]); + } } _SOKOL_PRIVATE void _sg_wgpu_uniform_buffer_init(const sg_desc* desc) { diff --git a/src/sokol/c/sokol_gl.h b/src/sokol/c/sokol_gl.h index d1a3c4e..88a62ba 100644 --- a/src/sokol/c/sokol_gl.h +++ b/src/sokol/c/sokol_gl.h @@ -833,7 +833,7 @@ SOKOL_GL_API_DECL sgl_context sgl_get_context(void); SOKOL_GL_API_DECL sgl_context sgl_default_context(void); /* draw recorded commands (call inside a sokol-gfx render pass) */ -SOKOL_GL_API_DECL void sgl_draw(); +SOKOL_GL_API_DECL void sgl_draw(void); SOKOL_GL_API_DECL void sgl_context_draw(sgl_context ctx); SOKOL_GL_API_DECL void sgl_draw_layer(int layer_id); SOKOL_GL_API_DECL void sgl_context_draw_layer(sgl_context ctx, int layer_id); diff --git a/src/sokol/debugtext.d b/src/sokol/debugtext.d index cd8835f..5ebbdf7 100644 --- a/src/sokol/debugtext.d +++ b/src/sokol/debugtext.d @@ -58,150 +58,150 @@ struct Desc { Logger logger; } extern(C) void sdtx_setup(const Desc *) @system @nogc nothrow; -void setup(ref Desc desc) @trusted nothrow @nogc { +void setup(ref Desc desc) @trusted @nogc nothrow { sdtx_setup(&desc); } extern(C) void sdtx_shutdown() @system @nogc nothrow; -void shutdown() @trusted nothrow @nogc { +void shutdown() @trusted @nogc nothrow { sdtx_shutdown(); } extern(C) FontDesc sdtx_font_kc853() @system @nogc nothrow; -FontDesc fontKc853() @trusted nothrow @nogc { +FontDesc fontKc853() @trusted @nogc nothrow { return sdtx_font_kc853(); } extern(C) FontDesc sdtx_font_kc854() @system @nogc nothrow; -FontDesc fontKc854() @trusted nothrow @nogc { +FontDesc fontKc854() @trusted @nogc nothrow { return sdtx_font_kc854(); } extern(C) FontDesc sdtx_font_z1013() @system @nogc nothrow; -FontDesc fontZ1013() @trusted nothrow @nogc { +FontDesc fontZ1013() @trusted @nogc nothrow { return sdtx_font_z1013(); } extern(C) FontDesc sdtx_font_cpc() @system @nogc nothrow; -FontDesc fontCpc() @trusted nothrow @nogc { +FontDesc fontCpc() @trusted @nogc nothrow { return sdtx_font_cpc(); } extern(C) FontDesc sdtx_font_c64() @system @nogc nothrow; -FontDesc fontC64() @trusted nothrow @nogc { +FontDesc fontC64() @trusted @nogc nothrow { return sdtx_font_c64(); } extern(C) FontDesc sdtx_font_oric() @system @nogc nothrow; -FontDesc fontOric() @trusted nothrow @nogc { +FontDesc fontOric() @trusted @nogc nothrow { return sdtx_font_oric(); } extern(C) Context sdtx_make_context(const ContextDesc *) @system @nogc nothrow; -Context makeContext(ref ContextDesc desc) @trusted nothrow @nogc { +Context makeContext(ref ContextDesc desc) @trusted @nogc nothrow { return sdtx_make_context(&desc); } extern(C) void sdtx_destroy_context(Context) @system @nogc nothrow; -void destroyContext(Context ctx) @trusted nothrow @nogc { +void destroyContext(Context ctx) @trusted @nogc nothrow { sdtx_destroy_context(ctx); } extern(C) void sdtx_set_context(Context) @system @nogc nothrow; -void setContext(Context ctx) @trusted nothrow @nogc { +void setContext(Context ctx) @trusted @nogc nothrow { sdtx_set_context(ctx); } extern(C) Context sdtx_get_context() @system @nogc nothrow; -Context getContext() @trusted nothrow @nogc { +Context getContext() @trusted @nogc nothrow { return sdtx_get_context(); } extern(C) Context sdtx_default_context() @system @nogc nothrow; -Context defaultContext() @trusted nothrow @nogc { +Context defaultContext() @trusted @nogc nothrow { return sdtx_default_context(); } extern(C) void sdtx_draw() @system @nogc nothrow; -void draw() @trusted nothrow @nogc { +void draw() @trusted @nogc nothrow { sdtx_draw(); } extern(C) void sdtx_context_draw(Context) @system @nogc nothrow; -void contextDraw(Context ctx) @trusted nothrow @nogc { +void contextDraw(Context ctx) @trusted @nogc nothrow { sdtx_context_draw(ctx); } extern(C) void sdtx_draw_layer(int) @system @nogc nothrow; -void drawLayer(int layer_id) @trusted nothrow @nogc { +void drawLayer(int layer_id) @trusted @nogc nothrow { sdtx_draw_layer(layer_id); } extern(C) void sdtx_context_draw_layer(Context, int) @system @nogc nothrow; -void contextDrawLayer(Context ctx, int layer_id) @trusted nothrow @nogc { +void contextDrawLayer(Context ctx, int layer_id) @trusted @nogc nothrow { sdtx_context_draw_layer(ctx, layer_id); } extern(C) void sdtx_layer(int) @system @nogc nothrow; -void layer(int layer_id) @trusted nothrow @nogc { +void layer(int layer_id) @trusted @nogc nothrow { sdtx_layer(layer_id); } extern(C) void sdtx_font(uint) @system @nogc nothrow; -void font(uint font_index) @trusted nothrow @nogc { +void font(uint font_index) @trusted @nogc nothrow { sdtx_font(font_index); } extern(C) void sdtx_canvas(float, float) @system @nogc nothrow; -void canvas(float w, float h) @trusted nothrow @nogc { +void canvas(float w, float h) @trusted @nogc nothrow { sdtx_canvas(w, h); } extern(C) void sdtx_origin(float, float) @system @nogc nothrow; -void origin(float x, float y) @trusted nothrow @nogc { +void origin(float x, float y) @trusted @nogc nothrow { sdtx_origin(x, y); } extern(C) void sdtx_home() @system @nogc nothrow; -void home() @trusted nothrow @nogc { +void home() @trusted @nogc nothrow { sdtx_home(); } extern(C) void sdtx_pos(float, float) @system @nogc nothrow; -void pos(float x, float y) @trusted nothrow @nogc { +void pos(float x, float y) @trusted @nogc nothrow { sdtx_pos(x, y); } extern(C) void sdtx_pos_x(float) @system @nogc nothrow; -void posX(float x) @trusted nothrow @nogc { +void posX(float x) @trusted @nogc nothrow { sdtx_pos_x(x); } extern(C) void sdtx_pos_y(float) @system @nogc nothrow; -void posY(float y) @trusted nothrow @nogc { +void posY(float y) @trusted @nogc nothrow { sdtx_pos_y(y); } extern(C) void sdtx_move(float, float) @system @nogc nothrow; -void move(float dx, float dy) @trusted nothrow @nogc { +void move(float dx, float dy) @trusted @nogc nothrow { sdtx_move(dx, dy); } extern(C) void sdtx_move_x(float) @system @nogc nothrow; -void moveX(float dx) @trusted nothrow @nogc { +void moveX(float dx) @trusted @nogc nothrow { sdtx_move_x(dx); } extern(C) void sdtx_move_y(float) @system @nogc nothrow; -void moveY(float dy) @trusted nothrow @nogc { +void moveY(float dy) @trusted @nogc nothrow { sdtx_move_y(dy); } extern(C) void sdtx_crlf() @system @nogc nothrow; -void crlf() @trusted nothrow @nogc { +void crlf() @trusted @nogc nothrow { sdtx_crlf(); } extern(C) void sdtx_color3b(ubyte, ubyte, ubyte) @system @nogc nothrow; -void color3b(ubyte r, ubyte g, ubyte b) @trusted nothrow @nogc { +void color3b(ubyte r, ubyte g, ubyte b) @trusted @nogc nothrow { sdtx_color3b(r, g, b); } extern(C) void sdtx_color3f(float, float, float) @system @nogc nothrow; -void color3f(float r, float g, float b) @trusted nothrow @nogc { +void color3f(float r, float g, float b) @trusted @nogc nothrow { sdtx_color3f(r, g, b); } extern(C) void sdtx_color4b(ubyte, ubyte, ubyte, ubyte) @system @nogc nothrow; -void color4b(ubyte r, ubyte g, ubyte b, ubyte a) @trusted nothrow @nogc { +void color4b(ubyte r, ubyte g, ubyte b, ubyte a) @trusted @nogc nothrow { sdtx_color4b(r, g, b, a); } extern(C) void sdtx_color4f(float, float, float, float) @system @nogc nothrow; -void color4f(float r, float g, float b, float a) @trusted nothrow @nogc { +void color4f(float r, float g, float b, float a) @trusted @nogc nothrow { sdtx_color4f(r, g, b, a); } extern(C) void sdtx_color1i(uint) @system @nogc nothrow; -void color1i(uint rgba) @trusted nothrow @nogc { +void color1i(uint rgba) @trusted @nogc nothrow { sdtx_color1i(rgba); } extern(C) void sdtx_putc(char) @system @nogc nothrow; -void putc(char c) @trusted nothrow @nogc { +void putc(char c) @trusted @nogc nothrow { sdtx_putc(c); } extern(C) void sdtx_puts(scope const(char)*) @system @nogc nothrow; -void puts(scope const(char)* str) @trusted nothrow @nogc { +void puts(scope const(char)* str) @trusted @nogc nothrow { sdtx_puts(str); } extern(C) void sdtx_putr(scope const(char)*, int) @system @nogc nothrow; -void putr(scope const(char)* str, int len) @trusted nothrow @nogc { +void putr(scope const(char)* str, int len) @trusted @nogc nothrow { sdtx_putr(str, len); } diff --git a/src/sokol/gfx.d b/src/sokol/gfx.d index e5f02da..d04dff8 100644 --- a/src/sokol/gfx.d +++ b/src/sokol/gfx.d @@ -114,6 +114,7 @@ enum PixelFormat { Bc1_rgba, Bc2_rgba, Bc3_rgba, + Bc3_srgba, Bc4_r, Bc4_rsn, Bc5_rg, @@ -121,15 +122,20 @@ enum PixelFormat { Bc6h_rgbf, Bc6h_rgbuf, Bc7_rgba, + Bc7_srgba, Pvrtc_rgb_2bpp, Pvrtc_rgb_4bpp, Pvrtc_rgba_2bpp, Pvrtc_rgba_4bpp, Etc2_rgb8, + Etc2_srgb8, Etc2_rgb8a1, Etc2_rgba8, + Etc2_srgb8a8, Etc2_rg11, Etc2_rg11sn, + Astc_4x4_rgba, + Astc_4x4_srgba, Num, } extern(C) @@ -1240,431 +1246,431 @@ struct Desc { uint _end_canary; } extern(C) void sg_setup(const Desc *) @system @nogc nothrow; -void setup(ref Desc desc) @trusted nothrow @nogc { +void setup(ref Desc desc) @trusted @nogc nothrow { sg_setup(&desc); } extern(C) void sg_shutdown() @system @nogc nothrow; -void shutdown() @trusted nothrow @nogc { +void shutdown() @trusted @nogc nothrow { sg_shutdown(); } extern(C) bool sg_isvalid() @system @nogc nothrow; -bool isvalid() @trusted nothrow @nogc { +bool isvalid() @trusted @nogc nothrow { return sg_isvalid(); } extern(C) void sg_reset_state_cache() @system @nogc nothrow; -void resetStateCache() @trusted nothrow @nogc { +void resetStateCache() @trusted @nogc nothrow { sg_reset_state_cache(); } extern(C) TraceHooks sg_install_trace_hooks(const TraceHooks *) @system @nogc nothrow; -TraceHooks installTraceHooks(ref TraceHooks trace_hooks) @trusted nothrow @nogc { +TraceHooks installTraceHooks(ref TraceHooks trace_hooks) @trusted @nogc nothrow { return sg_install_trace_hooks(&trace_hooks); } extern(C) void sg_push_debug_group(scope const(char)*) @system @nogc nothrow; -void pushDebugGroup(scope const(char)* name) @trusted nothrow @nogc { +void pushDebugGroup(scope const(char)* name) @trusted @nogc nothrow { sg_push_debug_group(name); } extern(C) void sg_pop_debug_group() @system @nogc nothrow; -void popDebugGroup() @trusted nothrow @nogc { +void popDebugGroup() @trusted @nogc nothrow { sg_pop_debug_group(); } extern(C) bool sg_add_commit_listener(CommitListener) @system @nogc nothrow; -bool addCommitListener(CommitListener listener) @trusted nothrow @nogc { +bool addCommitListener(CommitListener listener) @trusted @nogc nothrow { return sg_add_commit_listener(listener); } extern(C) bool sg_remove_commit_listener(CommitListener) @system @nogc nothrow; -bool removeCommitListener(CommitListener listener) @trusted nothrow @nogc { +bool removeCommitListener(CommitListener listener) @trusted @nogc nothrow { return sg_remove_commit_listener(listener); } extern(C) Buffer sg_make_buffer(const BufferDesc *) @system @nogc nothrow; -Buffer makeBuffer(ref BufferDesc desc) @trusted nothrow @nogc { +Buffer makeBuffer(ref BufferDesc desc) @trusted @nogc nothrow { return sg_make_buffer(&desc); } extern(C) Image sg_make_image(const ImageDesc *) @system @nogc nothrow; -Image makeImage(ref ImageDesc desc) @trusted nothrow @nogc { +Image makeImage(ref ImageDesc desc) @trusted @nogc nothrow { return sg_make_image(&desc); } extern(C) Sampler sg_make_sampler(const SamplerDesc *) @system @nogc nothrow; -Sampler makeSampler(ref SamplerDesc desc) @trusted nothrow @nogc { +Sampler makeSampler(ref SamplerDesc desc) @trusted @nogc nothrow { return sg_make_sampler(&desc); } extern(C) Shader sg_make_shader(const ShaderDesc *) @system @nogc nothrow; -Shader makeShader(ref ShaderDesc desc) @trusted nothrow @nogc { +Shader makeShader(ref ShaderDesc desc) @trusted @nogc nothrow { return sg_make_shader(&desc); } extern(C) Pipeline sg_make_pipeline(const PipelineDesc *) @system @nogc nothrow; -Pipeline makePipeline(ref PipelineDesc desc) @trusted nothrow @nogc { +Pipeline makePipeline(ref PipelineDesc desc) @trusted @nogc nothrow { return sg_make_pipeline(&desc); } extern(C) Pass sg_make_pass(const PassDesc *) @system @nogc nothrow; -Pass makePass(ref PassDesc desc) @trusted nothrow @nogc { +Pass makePass(ref PassDesc desc) @trusted @nogc nothrow { return sg_make_pass(&desc); } extern(C) void sg_destroy_buffer(Buffer) @system @nogc nothrow; -void destroyBuffer(Buffer buf) @trusted nothrow @nogc { +void destroyBuffer(Buffer buf) @trusted @nogc nothrow { sg_destroy_buffer(buf); } extern(C) void sg_destroy_image(Image) @system @nogc nothrow; -void destroyImage(Image img) @trusted nothrow @nogc { +void destroyImage(Image img) @trusted @nogc nothrow { sg_destroy_image(img); } extern(C) void sg_destroy_sampler(Sampler) @system @nogc nothrow; -void destroySampler(Sampler smp) @trusted nothrow @nogc { +void destroySampler(Sampler smp) @trusted @nogc nothrow { sg_destroy_sampler(smp); } extern(C) void sg_destroy_shader(Shader) @system @nogc nothrow; -void destroyShader(Shader shd) @trusted nothrow @nogc { +void destroyShader(Shader shd) @trusted @nogc nothrow { sg_destroy_shader(shd); } extern(C) void sg_destroy_pipeline(Pipeline) @system @nogc nothrow; -void destroyPipeline(Pipeline pip) @trusted nothrow @nogc { +void destroyPipeline(Pipeline pip) @trusted @nogc nothrow { sg_destroy_pipeline(pip); } extern(C) void sg_destroy_pass(Pass) @system @nogc nothrow; -void destroyPass(Pass pass) @trusted nothrow @nogc { +void destroyPass(Pass pass) @trusted @nogc nothrow { sg_destroy_pass(pass); } extern(C) void sg_update_buffer(Buffer, const Range *) @system @nogc nothrow; -void updateBuffer(Buffer buf, ref Range data) @trusted nothrow @nogc { +void updateBuffer(Buffer buf, ref Range data) @trusted @nogc nothrow { sg_update_buffer(buf, &data); } extern(C) void sg_update_image(Image, const ImageData *) @system @nogc nothrow; -void updateImage(Image img, ref ImageData data) @trusted nothrow @nogc { +void updateImage(Image img, ref ImageData data) @trusted @nogc nothrow { sg_update_image(img, &data); } extern(C) int sg_append_buffer(Buffer, const Range *) @system @nogc nothrow; -int appendBuffer(Buffer buf, ref Range data) @trusted nothrow @nogc { +int appendBuffer(Buffer buf, ref Range data) @trusted @nogc nothrow { return sg_append_buffer(buf, &data); } extern(C) bool sg_query_buffer_overflow(Buffer) @system @nogc nothrow; -bool queryBufferOverflow(Buffer buf) @trusted nothrow @nogc { +bool queryBufferOverflow(Buffer buf) @trusted @nogc nothrow { return sg_query_buffer_overflow(buf); } extern(C) bool sg_query_buffer_will_overflow(Buffer, size_t) @system @nogc nothrow; -bool queryBufferWillOverflow(Buffer buf, size_t size) @trusted nothrow @nogc { +bool queryBufferWillOverflow(Buffer buf, size_t size) @trusted @nogc nothrow { return sg_query_buffer_will_overflow(buf, size); } extern(C) void sg_begin_default_pass(const PassAction *, int, int) @system @nogc nothrow; -void beginDefaultPass(ref PassAction pass_action, int width, int height) @trusted nothrow @nogc { +void beginDefaultPass(ref PassAction pass_action, int width, int height) @trusted @nogc nothrow { sg_begin_default_pass(&pass_action, width, height); } extern(C) void sg_begin_default_passf(const PassAction *, float, float) @system @nogc nothrow; -void beginDefaultPassf(ref PassAction pass_action, float width, float height) @trusted nothrow @nogc { +void beginDefaultPassf(ref PassAction pass_action, float width, float height) @trusted @nogc nothrow { sg_begin_default_passf(&pass_action, width, height); } extern(C) void sg_begin_pass(Pass, const PassAction *) @system @nogc nothrow; -void beginPass(Pass pass, ref PassAction pass_action) @trusted nothrow @nogc { +void beginPass(Pass pass, ref PassAction pass_action) @trusted @nogc nothrow { sg_begin_pass(pass, &pass_action); } extern(C) void sg_apply_viewport(int, int, int, int, bool) @system @nogc nothrow; -void applyViewport(int x, int y, int width, int height, bool origin_top_left) @trusted nothrow @nogc { +void applyViewport(int x, int y, int width, int height, bool origin_top_left) @trusted @nogc nothrow { sg_apply_viewport(x, y, width, height, origin_top_left); } extern(C) void sg_apply_viewportf(float, float, float, float, bool) @system @nogc nothrow; -void applyViewportf(float x, float y, float width, float height, bool origin_top_left) @trusted nothrow @nogc { +void applyViewportf(float x, float y, float width, float height, bool origin_top_left) @trusted @nogc nothrow { sg_apply_viewportf(x, y, width, height, origin_top_left); } extern(C) void sg_apply_scissor_rect(int, int, int, int, bool) @system @nogc nothrow; -void applyScissorRect(int x, int y, int width, int height, bool origin_top_left) @trusted nothrow @nogc { +void applyScissorRect(int x, int y, int width, int height, bool origin_top_left) @trusted @nogc nothrow { sg_apply_scissor_rect(x, y, width, height, origin_top_left); } extern(C) void sg_apply_scissor_rectf(float, float, float, float, bool) @system @nogc nothrow; -void applyScissorRectf(float x, float y, float width, float height, bool origin_top_left) @trusted nothrow @nogc { +void applyScissorRectf(float x, float y, float width, float height, bool origin_top_left) @trusted @nogc nothrow { sg_apply_scissor_rectf(x, y, width, height, origin_top_left); } extern(C) void sg_apply_pipeline(Pipeline) @system @nogc nothrow; -void applyPipeline(Pipeline pip) @trusted nothrow @nogc { +void applyPipeline(Pipeline pip) @trusted @nogc nothrow { sg_apply_pipeline(pip); } extern(C) void sg_apply_bindings(const Bindings *) @system @nogc nothrow; -void applyBindings(ref Bindings bindings) @trusted nothrow @nogc { +void applyBindings(ref Bindings bindings) @trusted @nogc nothrow { sg_apply_bindings(&bindings); } extern(C) void sg_apply_uniforms(ShaderStage, uint, const Range *) @system @nogc nothrow; -void applyUniforms(ShaderStage stage, uint ub_index, ref Range data) @trusted nothrow @nogc { +void applyUniforms(ShaderStage stage, uint ub_index, ref Range data) @trusted @nogc nothrow { sg_apply_uniforms(stage, ub_index, &data); } extern(C) void sg_draw(uint, uint, uint) @system @nogc nothrow; -void draw(uint base_element, uint num_elements, uint num_instances) @trusted nothrow @nogc { +void draw(uint base_element, uint num_elements, uint num_instances) @trusted @nogc nothrow { sg_draw(base_element, num_elements, num_instances); } extern(C) void sg_end_pass() @system @nogc nothrow; -void endPass() @trusted nothrow @nogc { +void endPass() @trusted @nogc nothrow { sg_end_pass(); } extern(C) void sg_commit() @system @nogc nothrow; -void commit() @trusted nothrow @nogc { +void commit() @trusted @nogc nothrow { sg_commit(); } extern(C) Desc sg_query_desc() @system @nogc nothrow; -Desc queryDesc() @trusted nothrow @nogc { +Desc queryDesc() @trusted @nogc nothrow { return sg_query_desc(); } extern(C) Backend sg_query_backend() @system @nogc nothrow; -Backend queryBackend() @trusted nothrow @nogc { +Backend queryBackend() @trusted @nogc nothrow { return sg_query_backend(); } extern(C) Features sg_query_features() @system @nogc nothrow; -Features queryFeatures() @trusted nothrow @nogc { +Features queryFeatures() @trusted @nogc nothrow { return sg_query_features(); } extern(C) Limits sg_query_limits() @system @nogc nothrow; -Limits queryLimits() @trusted nothrow @nogc { +Limits queryLimits() @trusted @nogc nothrow { return sg_query_limits(); } extern(C) PixelformatInfo sg_query_pixelformat(PixelFormat) @system @nogc nothrow; -PixelformatInfo queryPixelformat(PixelFormat fmt) @trusted nothrow @nogc { +PixelformatInfo queryPixelformat(PixelFormat fmt) @trusted @nogc nothrow { return sg_query_pixelformat(fmt); } extern(C) int sg_query_row_pitch(PixelFormat, int, int) @system @nogc nothrow; -int queryRowPitch(PixelFormat fmt, int width, int row_align_bytes) @trusted nothrow @nogc { +int queryRowPitch(PixelFormat fmt, int width, int row_align_bytes) @trusted @nogc nothrow { return sg_query_row_pitch(fmt, width, row_align_bytes); } extern(C) int sg_query_surface_pitch(PixelFormat, int, int, int) @system @nogc nothrow; -int querySurfacePitch(PixelFormat fmt, int width, int height, int row_align_bytes) @trusted nothrow @nogc { +int querySurfacePitch(PixelFormat fmt, int width, int height, int row_align_bytes) @trusted @nogc nothrow { return sg_query_surface_pitch(fmt, width, height, row_align_bytes); } extern(C) ResourceState sg_query_buffer_state(Buffer) @system @nogc nothrow; -ResourceState queryBufferState(Buffer buf) @trusted nothrow @nogc { +ResourceState queryBufferState(Buffer buf) @trusted @nogc nothrow { return sg_query_buffer_state(buf); } extern(C) ResourceState sg_query_image_state(Image) @system @nogc nothrow; -ResourceState queryImageState(Image img) @trusted nothrow @nogc { +ResourceState queryImageState(Image img) @trusted @nogc nothrow { return sg_query_image_state(img); } extern(C) ResourceState sg_query_sampler_state(Sampler) @system @nogc nothrow; -ResourceState querySamplerState(Sampler smp) @trusted nothrow @nogc { +ResourceState querySamplerState(Sampler smp) @trusted @nogc nothrow { return sg_query_sampler_state(smp); } extern(C) ResourceState sg_query_shader_state(Shader) @system @nogc nothrow; -ResourceState queryShaderState(Shader shd) @trusted nothrow @nogc { +ResourceState queryShaderState(Shader shd) @trusted @nogc nothrow { return sg_query_shader_state(shd); } extern(C) ResourceState sg_query_pipeline_state(Pipeline) @system @nogc nothrow; -ResourceState queryPipelineState(Pipeline pip) @trusted nothrow @nogc { +ResourceState queryPipelineState(Pipeline pip) @trusted @nogc nothrow { return sg_query_pipeline_state(pip); } extern(C) ResourceState sg_query_pass_state(Pass) @system @nogc nothrow; -ResourceState queryPassState(Pass pass) @trusted nothrow @nogc { +ResourceState queryPassState(Pass pass) @trusted @nogc nothrow { return sg_query_pass_state(pass); } extern(C) BufferInfo sg_query_buffer_info(Buffer) @system @nogc nothrow; -BufferInfo queryBufferInfo(Buffer buf) @trusted nothrow @nogc { +BufferInfo queryBufferInfo(Buffer buf) @trusted @nogc nothrow { return sg_query_buffer_info(buf); } extern(C) ImageInfo sg_query_image_info(Image) @system @nogc nothrow; -ImageInfo queryImageInfo(Image img) @trusted nothrow @nogc { +ImageInfo queryImageInfo(Image img) @trusted @nogc nothrow { return sg_query_image_info(img); } extern(C) SamplerInfo sg_query_sampler_info(Sampler) @system @nogc nothrow; -SamplerInfo querySamplerInfo(Sampler smp) @trusted nothrow @nogc { +SamplerInfo querySamplerInfo(Sampler smp) @trusted @nogc nothrow { return sg_query_sampler_info(smp); } extern(C) ShaderInfo sg_query_shader_info(Shader) @system @nogc nothrow; -ShaderInfo queryShaderInfo(Shader shd) @trusted nothrow @nogc { +ShaderInfo queryShaderInfo(Shader shd) @trusted @nogc nothrow { return sg_query_shader_info(shd); } extern(C) PipelineInfo sg_query_pipeline_info(Pipeline) @system @nogc nothrow; -PipelineInfo queryPipelineInfo(Pipeline pip) @trusted nothrow @nogc { +PipelineInfo queryPipelineInfo(Pipeline pip) @trusted @nogc nothrow { return sg_query_pipeline_info(pip); } extern(C) PassInfo sg_query_pass_info(Pass) @system @nogc nothrow; -PassInfo queryPassInfo(Pass pass) @trusted nothrow @nogc { +PassInfo queryPassInfo(Pass pass) @trusted @nogc nothrow { return sg_query_pass_info(pass); } extern(C) BufferDesc sg_query_buffer_desc(Buffer) @system @nogc nothrow; -BufferDesc queryBufferDesc(Buffer buf) @trusted nothrow @nogc { +BufferDesc queryBufferDesc(Buffer buf) @trusted @nogc nothrow { return sg_query_buffer_desc(buf); } extern(C) ImageDesc sg_query_image_desc(Image) @system @nogc nothrow; -ImageDesc queryImageDesc(Image img) @trusted nothrow @nogc { +ImageDesc queryImageDesc(Image img) @trusted @nogc nothrow { return sg_query_image_desc(img); } extern(C) SamplerDesc sg_query_sampler_desc(Sampler) @system @nogc nothrow; -SamplerDesc querySamplerDesc(Sampler smp) @trusted nothrow @nogc { +SamplerDesc querySamplerDesc(Sampler smp) @trusted @nogc nothrow { return sg_query_sampler_desc(smp); } extern(C) ShaderDesc sg_query_shader_desc(Shader) @system @nogc nothrow; -ShaderDesc queryShaderDesc(Shader shd) @trusted nothrow @nogc { +ShaderDesc queryShaderDesc(Shader shd) @trusted @nogc nothrow { return sg_query_shader_desc(shd); } extern(C) PipelineDesc sg_query_pipeline_desc(Pipeline) @system @nogc nothrow; -PipelineDesc queryPipelineDesc(Pipeline pip) @trusted nothrow @nogc { +PipelineDesc queryPipelineDesc(Pipeline pip) @trusted @nogc nothrow { return sg_query_pipeline_desc(pip); } extern(C) PassDesc sg_query_pass_desc(Pass) @system @nogc nothrow; -PassDesc queryPassDesc(Pass pass) @trusted nothrow @nogc { +PassDesc queryPassDesc(Pass pass) @trusted @nogc nothrow { return sg_query_pass_desc(pass); } extern(C) BufferDesc sg_query_buffer_defaults(const BufferDesc *) @system @nogc nothrow; -BufferDesc queryBufferDefaults(ref BufferDesc desc) @trusted nothrow @nogc { +BufferDesc queryBufferDefaults(ref BufferDesc desc) @trusted @nogc nothrow { return sg_query_buffer_defaults(&desc); } extern(C) ImageDesc sg_query_image_defaults(const ImageDesc *) @system @nogc nothrow; -ImageDesc queryImageDefaults(ref ImageDesc desc) @trusted nothrow @nogc { +ImageDesc queryImageDefaults(ref ImageDesc desc) @trusted @nogc nothrow { return sg_query_image_defaults(&desc); } extern(C) SamplerDesc sg_query_sampler_defaults(const SamplerDesc *) @system @nogc nothrow; -SamplerDesc querySamplerDefaults(ref SamplerDesc desc) @trusted nothrow @nogc { +SamplerDesc querySamplerDefaults(ref SamplerDesc desc) @trusted @nogc nothrow { return sg_query_sampler_defaults(&desc); } extern(C) ShaderDesc sg_query_shader_defaults(const ShaderDesc *) @system @nogc nothrow; -ShaderDesc queryShaderDefaults(ref ShaderDesc desc) @trusted nothrow @nogc { +ShaderDesc queryShaderDefaults(ref ShaderDesc desc) @trusted @nogc nothrow { return sg_query_shader_defaults(&desc); } extern(C) PipelineDesc sg_query_pipeline_defaults(const PipelineDesc *) @system @nogc nothrow; -PipelineDesc queryPipelineDefaults(ref PipelineDesc desc) @trusted nothrow @nogc { +PipelineDesc queryPipelineDefaults(ref PipelineDesc desc) @trusted @nogc nothrow { return sg_query_pipeline_defaults(&desc); } extern(C) PassDesc sg_query_pass_defaults(const PassDesc *) @system @nogc nothrow; -PassDesc queryPassDefaults(ref PassDesc desc) @trusted nothrow @nogc { +PassDesc queryPassDefaults(ref PassDesc desc) @trusted @nogc nothrow { return sg_query_pass_defaults(&desc); } extern(C) Buffer sg_alloc_buffer() @system @nogc nothrow; -Buffer allocBuffer() @trusted nothrow @nogc { +Buffer allocBuffer() @trusted @nogc nothrow { return sg_alloc_buffer(); } extern(C) Image sg_alloc_image() @system @nogc nothrow; -Image allocImage() @trusted nothrow @nogc { +Image allocImage() @trusted @nogc nothrow { return sg_alloc_image(); } extern(C) Sampler sg_alloc_sampler() @system @nogc nothrow; -Sampler allocSampler() @trusted nothrow @nogc { +Sampler allocSampler() @trusted @nogc nothrow { return sg_alloc_sampler(); } extern(C) Shader sg_alloc_shader() @system @nogc nothrow; -Shader allocShader() @trusted nothrow @nogc { +Shader allocShader() @trusted @nogc nothrow { return sg_alloc_shader(); } extern(C) Pipeline sg_alloc_pipeline() @system @nogc nothrow; -Pipeline allocPipeline() @trusted nothrow @nogc { +Pipeline allocPipeline() @trusted @nogc nothrow { return sg_alloc_pipeline(); } extern(C) Pass sg_alloc_pass() @system @nogc nothrow; -Pass allocPass() @trusted nothrow @nogc { +Pass allocPass() @trusted @nogc nothrow { return sg_alloc_pass(); } extern(C) void sg_dealloc_buffer(Buffer) @system @nogc nothrow; -void deallocBuffer(Buffer buf) @trusted nothrow @nogc { +void deallocBuffer(Buffer buf) @trusted @nogc nothrow { sg_dealloc_buffer(buf); } extern(C) void sg_dealloc_image(Image) @system @nogc nothrow; -void deallocImage(Image img) @trusted nothrow @nogc { +void deallocImage(Image img) @trusted @nogc nothrow { sg_dealloc_image(img); } extern(C) void sg_dealloc_sampler(Sampler) @system @nogc nothrow; -void deallocSampler(Sampler smp) @trusted nothrow @nogc { +void deallocSampler(Sampler smp) @trusted @nogc nothrow { sg_dealloc_sampler(smp); } extern(C) void sg_dealloc_shader(Shader) @system @nogc nothrow; -void deallocShader(Shader shd) @trusted nothrow @nogc { +void deallocShader(Shader shd) @trusted @nogc nothrow { sg_dealloc_shader(shd); } extern(C) void sg_dealloc_pipeline(Pipeline) @system @nogc nothrow; -void deallocPipeline(Pipeline pip) @trusted nothrow @nogc { +void deallocPipeline(Pipeline pip) @trusted @nogc nothrow { sg_dealloc_pipeline(pip); } extern(C) void sg_dealloc_pass(Pass) @system @nogc nothrow; -void deallocPass(Pass pass) @trusted nothrow @nogc { +void deallocPass(Pass pass) @trusted @nogc nothrow { sg_dealloc_pass(pass); } extern(C) void sg_init_buffer(Buffer, const BufferDesc *) @system @nogc nothrow; -void initBuffer(Buffer buf, ref BufferDesc desc) @trusted nothrow @nogc { +void initBuffer(Buffer buf, ref BufferDesc desc) @trusted @nogc nothrow { sg_init_buffer(buf, &desc); } extern(C) void sg_init_image(Image, const ImageDesc *) @system @nogc nothrow; -void initImage(Image img, ref ImageDesc desc) @trusted nothrow @nogc { +void initImage(Image img, ref ImageDesc desc) @trusted @nogc nothrow { sg_init_image(img, &desc); } extern(C) void sg_init_sampler(Sampler, const SamplerDesc *) @system @nogc nothrow; -void initSampler(Sampler smg, ref SamplerDesc desc) @trusted nothrow @nogc { +void initSampler(Sampler smg, ref SamplerDesc desc) @trusted @nogc nothrow { sg_init_sampler(smg, &desc); } extern(C) void sg_init_shader(Shader, const ShaderDesc *) @system @nogc nothrow; -void initShader(Shader shd, ref ShaderDesc desc) @trusted nothrow @nogc { +void initShader(Shader shd, ref ShaderDesc desc) @trusted @nogc nothrow { sg_init_shader(shd, &desc); } extern(C) void sg_init_pipeline(Pipeline, const PipelineDesc *) @system @nogc nothrow; -void initPipeline(Pipeline pip, ref PipelineDesc desc) @trusted nothrow @nogc { +void initPipeline(Pipeline pip, ref PipelineDesc desc) @trusted @nogc nothrow { sg_init_pipeline(pip, &desc); } extern(C) void sg_init_pass(Pass, const PassDesc *) @system @nogc nothrow; -void initPass(Pass pass, ref PassDesc desc) @trusted nothrow @nogc { +void initPass(Pass pass, ref PassDesc desc) @trusted @nogc nothrow { sg_init_pass(pass, &desc); } extern(C) void sg_uninit_buffer(Buffer) @system @nogc nothrow; -void uninitBuffer(Buffer buf) @trusted nothrow @nogc { +void uninitBuffer(Buffer buf) @trusted @nogc nothrow { sg_uninit_buffer(buf); } extern(C) void sg_uninit_image(Image) @system @nogc nothrow; -void uninitImage(Image img) @trusted nothrow @nogc { +void uninitImage(Image img) @trusted @nogc nothrow { sg_uninit_image(img); } extern(C) void sg_uninit_sampler(Sampler) @system @nogc nothrow; -void uninitSampler(Sampler smp) @trusted nothrow @nogc { +void uninitSampler(Sampler smp) @trusted @nogc nothrow { sg_uninit_sampler(smp); } extern(C) void sg_uninit_shader(Shader) @system @nogc nothrow; -void uninitShader(Shader shd) @trusted nothrow @nogc { +void uninitShader(Shader shd) @trusted @nogc nothrow { sg_uninit_shader(shd); } extern(C) void sg_uninit_pipeline(Pipeline) @system @nogc nothrow; -void uninitPipeline(Pipeline pip) @trusted nothrow @nogc { +void uninitPipeline(Pipeline pip) @trusted @nogc nothrow { sg_uninit_pipeline(pip); } extern(C) void sg_uninit_pass(Pass) @system @nogc nothrow; -void uninitPass(Pass pass) @trusted nothrow @nogc { +void uninitPass(Pass pass) @trusted @nogc nothrow { sg_uninit_pass(pass); } extern(C) void sg_fail_buffer(Buffer) @system @nogc nothrow; -void failBuffer(Buffer buf) @trusted nothrow @nogc { +void failBuffer(Buffer buf) @trusted @nogc nothrow { sg_fail_buffer(buf); } extern(C) void sg_fail_image(Image) @system @nogc nothrow; -void failImage(Image img) @trusted nothrow @nogc { +void failImage(Image img) @trusted @nogc nothrow { sg_fail_image(img); } extern(C) void sg_fail_sampler(Sampler) @system @nogc nothrow; -void failSampler(Sampler smp) @trusted nothrow @nogc { +void failSampler(Sampler smp) @trusted @nogc nothrow { sg_fail_sampler(smp); } extern(C) void sg_fail_shader(Shader) @system @nogc nothrow; -void failShader(Shader shd) @trusted nothrow @nogc { +void failShader(Shader shd) @trusted @nogc nothrow { sg_fail_shader(shd); } extern(C) void sg_fail_pipeline(Pipeline) @system @nogc nothrow; -void failPipeline(Pipeline pip) @trusted nothrow @nogc { +void failPipeline(Pipeline pip) @trusted @nogc nothrow { sg_fail_pipeline(pip); } extern(C) void sg_fail_pass(Pass) @system @nogc nothrow; -void failPass(Pass pass) @trusted nothrow @nogc { +void failPass(Pass pass) @trusted @nogc nothrow { sg_fail_pass(pass); } extern(C) void sg_enable_frame_stats() @system @nogc nothrow; -void enableFrameStats() @trusted nothrow @nogc { +void enableFrameStats() @trusted @nogc nothrow { sg_enable_frame_stats(); } extern(C) void sg_disable_frame_stats() @system @nogc nothrow; -void disableFrameStats() @trusted nothrow @nogc { +void disableFrameStats() @trusted @nogc nothrow { sg_disable_frame_stats(); } extern(C) bool sg_frame_stats_enabled() @system @nogc nothrow; -bool frameStatsEnabled() @trusted nothrow @nogc { +bool frameStatsEnabled() @trusted @nogc nothrow { return sg_frame_stats_enabled(); } extern(C) FrameStats sg_query_frame_stats() @system @nogc nothrow; -FrameStats queryFrameStats() @trusted nothrow @nogc { +FrameStats queryFrameStats() @trusted @nogc nothrow { return sg_query_frame_stats(); } extern(C) Context sg_setup_context() @system @nogc nothrow; -Context setupContext() @trusted nothrow @nogc { +Context setupContext() @trusted @nogc nothrow { return sg_setup_context(); } extern(C) void sg_activate_context(Context) @system @nogc nothrow; -void activateContext(Context ctx_id) @trusted nothrow @nogc { +void activateContext(Context ctx_id) @trusted @nogc nothrow { sg_activate_context(ctx_id); } extern(C) void sg_discard_context(Context) @system @nogc nothrow; -void discardContext(Context ctx_id) @trusted nothrow @nogc { +void discardContext(Context ctx_id) @trusted @nogc nothrow { sg_discard_context(ctx_id); } extern(C) @@ -1783,122 +1789,122 @@ struct GlPassInfo { uint[4] msaa_resolve_framebuffer; } extern(C) scope const(void)* sg_d3d11_device() @system @nogc nothrow; -scope const(void)* d3d11Device() @trusted nothrow @nogc { +scope const(void)* d3d11Device() @trusted @nogc nothrow { return sg_d3d11_device(); } extern(C) scope const(void)* sg_d3d11_device_context() @system @nogc nothrow; -scope const(void)* d3d11DeviceContext() @trusted nothrow @nogc { +scope const(void)* d3d11DeviceContext() @trusted @nogc nothrow { return sg_d3d11_device_context(); } extern(C) D3d11BufferInfo sg_d3d11_query_buffer_info(Buffer) @system @nogc nothrow; -D3d11BufferInfo d3d11QueryBufferInfo(Buffer buf) @trusted nothrow @nogc { +D3d11BufferInfo d3d11QueryBufferInfo(Buffer buf) @trusted @nogc nothrow { return sg_d3d11_query_buffer_info(buf); } extern(C) D3d11ImageInfo sg_d3d11_query_image_info(Image) @system @nogc nothrow; -D3d11ImageInfo d3d11QueryImageInfo(Image img) @trusted nothrow @nogc { +D3d11ImageInfo d3d11QueryImageInfo(Image img) @trusted @nogc nothrow { return sg_d3d11_query_image_info(img); } extern(C) D3d11SamplerInfo sg_d3d11_query_sampler_info(Sampler) @system @nogc nothrow; -D3d11SamplerInfo d3d11QuerySamplerInfo(Sampler smp) @trusted nothrow @nogc { +D3d11SamplerInfo d3d11QuerySamplerInfo(Sampler smp) @trusted @nogc nothrow { return sg_d3d11_query_sampler_info(smp); } extern(C) D3d11ShaderInfo sg_d3d11_query_shader_info(Shader) @system @nogc nothrow; -D3d11ShaderInfo d3d11QueryShaderInfo(Shader shd) @trusted nothrow @nogc { +D3d11ShaderInfo d3d11QueryShaderInfo(Shader shd) @trusted @nogc nothrow { return sg_d3d11_query_shader_info(shd); } extern(C) D3d11PipelineInfo sg_d3d11_query_pipeline_info(Pipeline) @system @nogc nothrow; -D3d11PipelineInfo d3d11QueryPipelineInfo(Pipeline pip) @trusted nothrow @nogc { +D3d11PipelineInfo d3d11QueryPipelineInfo(Pipeline pip) @trusted @nogc nothrow { return sg_d3d11_query_pipeline_info(pip); } extern(C) D3d11PassInfo sg_d3d11_query_pass_info(Pass) @system @nogc nothrow; -D3d11PassInfo d3d11QueryPassInfo(Pass pass) @trusted nothrow @nogc { +D3d11PassInfo d3d11QueryPassInfo(Pass pass) @trusted @nogc nothrow { return sg_d3d11_query_pass_info(pass); } extern(C) scope const(void)* sg_mtl_device() @system @nogc nothrow; -scope const(void)* mtlDevice() @trusted nothrow @nogc { +scope const(void)* mtlDevice() @trusted @nogc nothrow { return sg_mtl_device(); } extern(C) scope const(void)* sg_mtl_render_command_encoder() @system @nogc nothrow; -scope const(void)* mtlRenderCommandEncoder() @trusted nothrow @nogc { +scope const(void)* mtlRenderCommandEncoder() @trusted @nogc nothrow { return sg_mtl_render_command_encoder(); } extern(C) MtlBufferInfo sg_mtl_query_buffer_info(Buffer) @system @nogc nothrow; -MtlBufferInfo mtlQueryBufferInfo(Buffer buf) @trusted nothrow @nogc { +MtlBufferInfo mtlQueryBufferInfo(Buffer buf) @trusted @nogc nothrow { return sg_mtl_query_buffer_info(buf); } extern(C) MtlImageInfo sg_mtl_query_image_info(Image) @system @nogc nothrow; -MtlImageInfo mtlQueryImageInfo(Image img) @trusted nothrow @nogc { +MtlImageInfo mtlQueryImageInfo(Image img) @trusted @nogc nothrow { return sg_mtl_query_image_info(img); } extern(C) MtlSamplerInfo sg_mtl_query_sampler_info(Sampler) @system @nogc nothrow; -MtlSamplerInfo mtlQuerySamplerInfo(Sampler smp) @trusted nothrow @nogc { +MtlSamplerInfo mtlQuerySamplerInfo(Sampler smp) @trusted @nogc nothrow { return sg_mtl_query_sampler_info(smp); } extern(C) MtlShaderInfo sg_mtl_query_shader_info(Shader) @system @nogc nothrow; -MtlShaderInfo mtlQueryShaderInfo(Shader shd) @trusted nothrow @nogc { +MtlShaderInfo mtlQueryShaderInfo(Shader shd) @trusted @nogc nothrow { return sg_mtl_query_shader_info(shd); } extern(C) MtlPipelineInfo sg_mtl_query_pipeline_info(Pipeline) @system @nogc nothrow; -MtlPipelineInfo mtlQueryPipelineInfo(Pipeline pip) @trusted nothrow @nogc { +MtlPipelineInfo mtlQueryPipelineInfo(Pipeline pip) @trusted @nogc nothrow { return sg_mtl_query_pipeline_info(pip); } extern(C) scope const(void)* sg_wgpu_device() @system @nogc nothrow; -scope const(void)* wgpuDevice() @trusted nothrow @nogc { +scope const(void)* wgpuDevice() @trusted @nogc nothrow { return sg_wgpu_device(); } extern(C) scope const(void)* sg_wgpu_queue() @system @nogc nothrow; -scope const(void)* wgpuQueue() @trusted nothrow @nogc { +scope const(void)* wgpuQueue() @trusted @nogc nothrow { return sg_wgpu_queue(); } extern(C) scope const(void)* sg_wgpu_command_encoder() @system @nogc nothrow; -scope const(void)* wgpuCommandEncoder() @trusted nothrow @nogc { +scope const(void)* wgpuCommandEncoder() @trusted @nogc nothrow { return sg_wgpu_command_encoder(); } extern(C) scope const(void)* sg_wgpu_render_pass_encoder() @system @nogc nothrow; -scope const(void)* wgpuRenderPassEncoder() @trusted nothrow @nogc { +scope const(void)* wgpuRenderPassEncoder() @trusted @nogc nothrow { return sg_wgpu_render_pass_encoder(); } extern(C) WgpuBufferInfo sg_wgpu_query_buffer_info(Buffer) @system @nogc nothrow; -WgpuBufferInfo wgpuQueryBufferInfo(Buffer buf) @trusted nothrow @nogc { +WgpuBufferInfo wgpuQueryBufferInfo(Buffer buf) @trusted @nogc nothrow { return sg_wgpu_query_buffer_info(buf); } extern(C) WgpuImageInfo sg_wgpu_query_image_info(Image) @system @nogc nothrow; -WgpuImageInfo wgpuQueryImageInfo(Image img) @trusted nothrow @nogc { +WgpuImageInfo wgpuQueryImageInfo(Image img) @trusted @nogc nothrow { return sg_wgpu_query_image_info(img); } extern(C) WgpuSamplerInfo sg_wgpu_query_sampler_info(Sampler) @system @nogc nothrow; -WgpuSamplerInfo wgpuQuerySamplerInfo(Sampler smp) @trusted nothrow @nogc { +WgpuSamplerInfo wgpuQuerySamplerInfo(Sampler smp) @trusted @nogc nothrow { return sg_wgpu_query_sampler_info(smp); } extern(C) WgpuShaderInfo sg_wgpu_query_shader_info(Shader) @system @nogc nothrow; -WgpuShaderInfo wgpuQueryShaderInfo(Shader shd) @trusted nothrow @nogc { +WgpuShaderInfo wgpuQueryShaderInfo(Shader shd) @trusted @nogc nothrow { return sg_wgpu_query_shader_info(shd); } extern(C) WgpuPipelineInfo sg_wgpu_query_pipeline_info(Pipeline) @system @nogc nothrow; -WgpuPipelineInfo wgpuQueryPipelineInfo(Pipeline pip) @trusted nothrow @nogc { +WgpuPipelineInfo wgpuQueryPipelineInfo(Pipeline pip) @trusted @nogc nothrow { return sg_wgpu_query_pipeline_info(pip); } extern(C) WgpuPassInfo sg_wgpu_query_pass_info(Pass) @system @nogc nothrow; -WgpuPassInfo wgpuQueryPassInfo(Pass pass) @trusted nothrow @nogc { +WgpuPassInfo wgpuQueryPassInfo(Pass pass) @trusted @nogc nothrow { return sg_wgpu_query_pass_info(pass); } extern(C) GlBufferInfo sg_gl_query_buffer_info(Buffer) @system @nogc nothrow; -GlBufferInfo glQueryBufferInfo(Buffer buf) @trusted nothrow @nogc { +GlBufferInfo glQueryBufferInfo(Buffer buf) @trusted @nogc nothrow { return sg_gl_query_buffer_info(buf); } extern(C) GlImageInfo sg_gl_query_image_info(Image) @system @nogc nothrow; -GlImageInfo glQueryImageInfo(Image img) @trusted nothrow @nogc { +GlImageInfo glQueryImageInfo(Image img) @trusted @nogc nothrow { return sg_gl_query_image_info(img); } extern(C) GlSamplerInfo sg_gl_query_sampler_info(Sampler) @system @nogc nothrow; -GlSamplerInfo glQuerySamplerInfo(Sampler smp) @trusted nothrow @nogc { +GlSamplerInfo glQuerySamplerInfo(Sampler smp) @trusted @nogc nothrow { return sg_gl_query_sampler_info(smp); } extern(C) GlShaderInfo sg_gl_query_shader_info(Shader) @system @nogc nothrow; -GlShaderInfo glQueryShaderInfo(Shader shd) @trusted nothrow @nogc { +GlShaderInfo glQueryShaderInfo(Shader shd) @trusted @nogc nothrow { return sg_gl_query_shader_info(shd); } extern(C) GlPassInfo sg_gl_query_pass_info(Pass) @system @nogc nothrow; -GlPassInfo glQueryPassInfo(Pass pass) @trusted nothrow @nogc { +GlPassInfo glQueryPassInfo(Pass pass) @trusted @nogc nothrow { return sg_gl_query_pass_info(pass); } diff --git a/src/sokol/gl.d b/src/sokol/gl.d index b482b3b..28d7856 100644 --- a/src/sokol/gl.d +++ b/src/sokol/gl.d @@ -62,346 +62,346 @@ struct Desc { Logger logger; } extern(C) void sgl_setup(const Desc *) @system @nogc nothrow; -void setup(ref Desc desc) @trusted nothrow @nogc { +void setup(ref Desc desc) @trusted @nogc nothrow { sgl_setup(&desc); } extern(C) void sgl_shutdown() @system @nogc nothrow; -void shutdown() @trusted nothrow @nogc { +void shutdown() @trusted @nogc nothrow { sgl_shutdown(); } extern(C) float sgl_rad(float) @system @nogc nothrow; -float asRadians(float deg) @trusted nothrow @nogc { +float asRadians(float deg) @trusted @nogc nothrow { return sgl_rad(deg); } extern(C) float sgl_deg(float) @system @nogc nothrow; -float asDegrees(float rad) @trusted nothrow @nogc { +float asDegrees(float rad) @trusted @nogc nothrow { return sgl_deg(rad); } extern(C) Error sgl_error() @system @nogc nothrow; -Error getError() @trusted nothrow @nogc { +Error getError() @trusted @nogc nothrow { return sgl_error(); } extern(C) Error sgl_context_error(Context) @system @nogc nothrow; -Error contextError(Context ctx) @trusted nothrow @nogc { +Error contextError(Context ctx) @trusted @nogc nothrow { return sgl_context_error(ctx); } extern(C) Context sgl_make_context(const ContextDesc *) @system @nogc nothrow; -Context makeContext(ref ContextDesc desc) @trusted nothrow @nogc { +Context makeContext(ref ContextDesc desc) @trusted @nogc nothrow { return sgl_make_context(&desc); } extern(C) void sgl_destroy_context(Context) @system @nogc nothrow; -void destroyContext(Context ctx) @trusted nothrow @nogc { +void destroyContext(Context ctx) @trusted @nogc nothrow { sgl_destroy_context(ctx); } extern(C) void sgl_set_context(Context) @system @nogc nothrow; -void setContext(Context ctx) @trusted nothrow @nogc { +void setContext(Context ctx) @trusted @nogc nothrow { sgl_set_context(ctx); } extern(C) Context sgl_get_context() @system @nogc nothrow; -Context getContext() @trusted nothrow @nogc { +Context getContext() @trusted @nogc nothrow { return sgl_get_context(); } extern(C) Context sgl_default_context() @system @nogc nothrow; -Context defaultContext() @trusted nothrow @nogc { +Context defaultContext() @trusted @nogc nothrow { return sgl_default_context(); } extern(C) void sgl_draw() @system @nogc nothrow; -void draw() @trusted nothrow @nogc { +void draw() @trusted @nogc nothrow { sgl_draw(); } extern(C) void sgl_context_draw(Context) @system @nogc nothrow; -void contextDraw(Context ctx) @trusted nothrow @nogc { +void contextDraw(Context ctx) @trusted @nogc nothrow { sgl_context_draw(ctx); } extern(C) void sgl_draw_layer(int) @system @nogc nothrow; -void drawLayer(int layer_id) @trusted nothrow @nogc { +void drawLayer(int layer_id) @trusted @nogc nothrow { sgl_draw_layer(layer_id); } extern(C) void sgl_context_draw_layer(Context, int) @system @nogc nothrow; -void contextDrawLayer(Context ctx, int layer_id) @trusted nothrow @nogc { +void contextDrawLayer(Context ctx, int layer_id) @trusted @nogc nothrow { sgl_context_draw_layer(ctx, layer_id); } extern(C) Pipeline sgl_make_pipeline(const sg.PipelineDesc *) @system @nogc nothrow; -Pipeline makePipeline(ref sg.PipelineDesc desc) @trusted nothrow @nogc { +Pipeline makePipeline(ref sg.PipelineDesc desc) @trusted @nogc nothrow { return sgl_make_pipeline(&desc); } extern(C) Pipeline sgl_context_make_pipeline(Context, const sg.PipelineDesc *) @system @nogc nothrow; -Pipeline contextMakePipeline(Context ctx, ref sg.PipelineDesc desc) @trusted nothrow @nogc { +Pipeline contextMakePipeline(Context ctx, ref sg.PipelineDesc desc) @trusted @nogc nothrow { return sgl_context_make_pipeline(ctx, &desc); } extern(C) void sgl_destroy_pipeline(Pipeline) @system @nogc nothrow; -void destroyPipeline(Pipeline pip) @trusted nothrow @nogc { +void destroyPipeline(Pipeline pip) @trusted @nogc nothrow { sgl_destroy_pipeline(pip); } extern(C) void sgl_defaults() @system @nogc nothrow; -void defaults() @trusted nothrow @nogc { +void defaults() @trusted @nogc nothrow { sgl_defaults(); } extern(C) void sgl_viewport(int, int, int, int, bool) @system @nogc nothrow; -void viewport(int x, int y, int w, int h, bool origin_top_left) @trusted nothrow @nogc { +void viewport(int x, int y, int w, int h, bool origin_top_left) @trusted @nogc nothrow { sgl_viewport(x, y, w, h, origin_top_left); } extern(C) void sgl_viewportf(float, float, float, float, bool) @system @nogc nothrow; -void viewportf(float x, float y, float w, float h, bool origin_top_left) @trusted nothrow @nogc { +void viewportf(float x, float y, float w, float h, bool origin_top_left) @trusted @nogc nothrow { sgl_viewportf(x, y, w, h, origin_top_left); } extern(C) void sgl_scissor_rect(int, int, int, int, bool) @system @nogc nothrow; -void scissorRect(int x, int y, int w, int h, bool origin_top_left) @trusted nothrow @nogc { +void scissorRect(int x, int y, int w, int h, bool origin_top_left) @trusted @nogc nothrow { sgl_scissor_rect(x, y, w, h, origin_top_left); } extern(C) void sgl_scissor_rectf(float, float, float, float, bool) @system @nogc nothrow; -void scissorRectf(float x, float y, float w, float h, bool origin_top_left) @trusted nothrow @nogc { +void scissorRectf(float x, float y, float w, float h, bool origin_top_left) @trusted @nogc nothrow { sgl_scissor_rectf(x, y, w, h, origin_top_left); } extern(C) void sgl_enable_texture() @system @nogc nothrow; -void enableTexture() @trusted nothrow @nogc { +void enableTexture() @trusted @nogc nothrow { sgl_enable_texture(); } extern(C) void sgl_disable_texture() @system @nogc nothrow; -void disableTexture() @trusted nothrow @nogc { +void disableTexture() @trusted @nogc nothrow { sgl_disable_texture(); } extern(C) void sgl_texture(sg.Image, sg.Sampler) @system @nogc nothrow; -void texture(sg.Image img, sg.Sampler smp) @trusted nothrow @nogc { +void texture(sg.Image img, sg.Sampler smp) @trusted @nogc nothrow { sgl_texture(img, smp); } extern(C) void sgl_layer(int) @system @nogc nothrow; -void layer(int layer_id) @trusted nothrow @nogc { +void layer(int layer_id) @trusted @nogc nothrow { sgl_layer(layer_id); } extern(C) void sgl_load_default_pipeline() @system @nogc nothrow; -void loadDefaultPipeline() @trusted nothrow @nogc { +void loadDefaultPipeline() @trusted @nogc nothrow { sgl_load_default_pipeline(); } extern(C) void sgl_load_pipeline(Pipeline) @system @nogc nothrow; -void loadPipeline(Pipeline pip) @trusted nothrow @nogc { +void loadPipeline(Pipeline pip) @trusted @nogc nothrow { sgl_load_pipeline(pip); } extern(C) void sgl_push_pipeline() @system @nogc nothrow; -void pushPipeline() @trusted nothrow @nogc { +void pushPipeline() @trusted @nogc nothrow { sgl_push_pipeline(); } extern(C) void sgl_pop_pipeline() @system @nogc nothrow; -void popPipeline() @trusted nothrow @nogc { +void popPipeline() @trusted @nogc nothrow { sgl_pop_pipeline(); } extern(C) void sgl_matrix_mode_modelview() @system @nogc nothrow; -void matrixModeModelview() @trusted nothrow @nogc { +void matrixModeModelview() @trusted @nogc nothrow { sgl_matrix_mode_modelview(); } extern(C) void sgl_matrix_mode_projection() @system @nogc nothrow; -void matrixModeProjection() @trusted nothrow @nogc { +void matrixModeProjection() @trusted @nogc nothrow { sgl_matrix_mode_projection(); } extern(C) void sgl_matrix_mode_texture() @system @nogc nothrow; -void matrixModeTexture() @trusted nothrow @nogc { +void matrixModeTexture() @trusted @nogc nothrow { sgl_matrix_mode_texture(); } extern(C) void sgl_load_identity() @system @nogc nothrow; -void loadIdentity() @trusted nothrow @nogc { +void loadIdentity() @trusted @nogc nothrow { sgl_load_identity(); } extern(C) void sgl_load_matrix(const float *) @system @nogc nothrow; -void loadMatrix(const float * m) @trusted nothrow @nogc { +void loadMatrix(const float * m) @trusted @nogc nothrow { sgl_load_matrix(m); } extern(C) void sgl_load_transpose_matrix(const float *) @system @nogc nothrow; -void loadTransposeMatrix(const float * m) @trusted nothrow @nogc { +void loadTransposeMatrix(const float * m) @trusted @nogc nothrow { sgl_load_transpose_matrix(m); } extern(C) void sgl_mult_matrix(const float *) @system @nogc nothrow; -void multMatrix(const float * m) @trusted nothrow @nogc { +void multMatrix(const float * m) @trusted @nogc nothrow { sgl_mult_matrix(m); } extern(C) void sgl_mult_transpose_matrix(const float *) @system @nogc nothrow; -void multTransposeMatrix(const float * m) @trusted nothrow @nogc { +void multTransposeMatrix(const float * m) @trusted @nogc nothrow { sgl_mult_transpose_matrix(m); } extern(C) void sgl_rotate(float, float, float, float) @system @nogc nothrow; -void rotate(float angle_rad, float x, float y, float z) @trusted nothrow @nogc { +void rotate(float angle_rad, float x, float y, float z) @trusted @nogc nothrow { sgl_rotate(angle_rad, x, y, z); } extern(C) void sgl_scale(float, float, float) @system @nogc nothrow; -void scale(float x, float y, float z) @trusted nothrow @nogc { +void scale(float x, float y, float z) @trusted @nogc nothrow { sgl_scale(x, y, z); } extern(C) void sgl_translate(float, float, float) @system @nogc nothrow; -void translate(float x, float y, float z) @trusted nothrow @nogc { +void translate(float x, float y, float z) @trusted @nogc nothrow { sgl_translate(x, y, z); } extern(C) void sgl_frustum(float, float, float, float, float, float) @system @nogc nothrow; -void frustum(float l, float r, float b, float t, float n, float f) @trusted nothrow @nogc { +void frustum(float l, float r, float b, float t, float n, float f) @trusted @nogc nothrow { sgl_frustum(l, r, b, t, n, f); } extern(C) void sgl_ortho(float, float, float, float, float, float) @system @nogc nothrow; -void ortho(float l, float r, float b, float t, float n, float f) @trusted nothrow @nogc { +void ortho(float l, float r, float b, float t, float n, float f) @trusted @nogc nothrow { sgl_ortho(l, r, b, t, n, f); } extern(C) void sgl_perspective(float, float, float, float) @system @nogc nothrow; -void perspective(float fov_y, float aspect, float z_near, float z_far) @trusted nothrow @nogc { +void perspective(float fov_y, float aspect, float z_near, float z_far) @trusted @nogc nothrow { sgl_perspective(fov_y, aspect, z_near, z_far); } extern(C) void sgl_lookat(float, float, float, float, float, float, float, float, float) @system @nogc nothrow; -void lookat(float eye_x, float eye_y, float eye_z, float center_x, float center_y, float center_z, float up_x, float up_y, float up_z) @trusted nothrow @nogc { +void lookat(float eye_x, float eye_y, float eye_z, float center_x, float center_y, float center_z, float up_x, float up_y, float up_z) @trusted @nogc nothrow { sgl_lookat(eye_x, eye_y, eye_z, center_x, center_y, center_z, up_x, up_y, up_z); } extern(C) void sgl_push_matrix() @system @nogc nothrow; -void pushMatrix() @trusted nothrow @nogc { +void pushMatrix() @trusted @nogc nothrow { sgl_push_matrix(); } extern(C) void sgl_pop_matrix() @system @nogc nothrow; -void popMatrix() @trusted nothrow @nogc { +void popMatrix() @trusted @nogc nothrow { sgl_pop_matrix(); } extern(C) void sgl_t2f(float, float) @system @nogc nothrow; -void t2f(float u, float v) @trusted nothrow @nogc { +void t2f(float u, float v) @trusted @nogc nothrow { sgl_t2f(u, v); } extern(C) void sgl_c3f(float, float, float) @system @nogc nothrow; -void c3f(float r, float g, float b) @trusted nothrow @nogc { +void c3f(float r, float g, float b) @trusted @nogc nothrow { sgl_c3f(r, g, b); } extern(C) void sgl_c4f(float, float, float, float) @system @nogc nothrow; -void c4f(float r, float g, float b, float a) @trusted nothrow @nogc { +void c4f(float r, float g, float b, float a) @trusted @nogc nothrow { sgl_c4f(r, g, b, a); } extern(C) void sgl_c3b(ubyte, ubyte, ubyte) @system @nogc nothrow; -void c3b(ubyte r, ubyte g, ubyte b) @trusted nothrow @nogc { +void c3b(ubyte r, ubyte g, ubyte b) @trusted @nogc nothrow { sgl_c3b(r, g, b); } extern(C) void sgl_c4b(ubyte, ubyte, ubyte, ubyte) @system @nogc nothrow; -void c4b(ubyte r, ubyte g, ubyte b, ubyte a) @trusted nothrow @nogc { +void c4b(ubyte r, ubyte g, ubyte b, ubyte a) @trusted @nogc nothrow { sgl_c4b(r, g, b, a); } extern(C) void sgl_c1i(uint) @system @nogc nothrow; -void c1i(uint rgba) @trusted nothrow @nogc { +void c1i(uint rgba) @trusted @nogc nothrow { sgl_c1i(rgba); } extern(C) void sgl_point_size(float) @system @nogc nothrow; -void pointSize(float s) @trusted nothrow @nogc { +void pointSize(float s) @trusted @nogc nothrow { sgl_point_size(s); } extern(C) void sgl_begin_points() @system @nogc nothrow; -void beginPoints() @trusted nothrow @nogc { +void beginPoints() @trusted @nogc nothrow { sgl_begin_points(); } extern(C) void sgl_begin_lines() @system @nogc nothrow; -void beginLines() @trusted nothrow @nogc { +void beginLines() @trusted @nogc nothrow { sgl_begin_lines(); } extern(C) void sgl_begin_line_strip() @system @nogc nothrow; -void beginLineStrip() @trusted nothrow @nogc { +void beginLineStrip() @trusted @nogc nothrow { sgl_begin_line_strip(); } extern(C) void sgl_begin_triangles() @system @nogc nothrow; -void beginTriangles() @trusted nothrow @nogc { +void beginTriangles() @trusted @nogc nothrow { sgl_begin_triangles(); } extern(C) void sgl_begin_triangle_strip() @system @nogc nothrow; -void beginTriangleStrip() @trusted nothrow @nogc { +void beginTriangleStrip() @trusted @nogc nothrow { sgl_begin_triangle_strip(); } extern(C) void sgl_begin_quads() @system @nogc nothrow; -void beginQuads() @trusted nothrow @nogc { +void beginQuads() @trusted @nogc nothrow { sgl_begin_quads(); } extern(C) void sgl_v2f(float, float) @system @nogc nothrow; -void v2f(float x, float y) @trusted nothrow @nogc { +void v2f(float x, float y) @trusted @nogc nothrow { sgl_v2f(x, y); } extern(C) void sgl_v3f(float, float, float) @system @nogc nothrow; -void v3f(float x, float y, float z) @trusted nothrow @nogc { +void v3f(float x, float y, float z) @trusted @nogc nothrow { sgl_v3f(x, y, z); } extern(C) void sgl_v2f_t2f(float, float, float, float) @system @nogc nothrow; -void v2fT2f(float x, float y, float u, float v) @trusted nothrow @nogc { +void v2fT2f(float x, float y, float u, float v) @trusted @nogc nothrow { sgl_v2f_t2f(x, y, u, v); } extern(C) void sgl_v3f_t2f(float, float, float, float, float) @system @nogc nothrow; -void v3fT2f(float x, float y, float z, float u, float v) @trusted nothrow @nogc { +void v3fT2f(float x, float y, float z, float u, float v) @trusted @nogc nothrow { sgl_v3f_t2f(x, y, z, u, v); } extern(C) void sgl_v2f_c3f(float, float, float, float, float) @system @nogc nothrow; -void v2fC3f(float x, float y, float r, float g, float b) @trusted nothrow @nogc { +void v2fC3f(float x, float y, float r, float g, float b) @trusted @nogc nothrow { sgl_v2f_c3f(x, y, r, g, b); } extern(C) void sgl_v2f_c3b(float, float, ubyte, ubyte, ubyte) @system @nogc nothrow; -void v2fC3b(float x, float y, ubyte r, ubyte g, ubyte b) @trusted nothrow @nogc { +void v2fC3b(float x, float y, ubyte r, ubyte g, ubyte b) @trusted @nogc nothrow { sgl_v2f_c3b(x, y, r, g, b); } extern(C) void sgl_v2f_c4f(float, float, float, float, float, float) @system @nogc nothrow; -void v2fC4f(float x, float y, float r, float g, float b, float a) @trusted nothrow @nogc { +void v2fC4f(float x, float y, float r, float g, float b, float a) @trusted @nogc nothrow { sgl_v2f_c4f(x, y, r, g, b, a); } extern(C) void sgl_v2f_c4b(float, float, ubyte, ubyte, ubyte, ubyte) @system @nogc nothrow; -void v2fC4b(float x, float y, ubyte r, ubyte g, ubyte b, ubyte a) @trusted nothrow @nogc { +void v2fC4b(float x, float y, ubyte r, ubyte g, ubyte b, ubyte a) @trusted @nogc nothrow { sgl_v2f_c4b(x, y, r, g, b, a); } extern(C) void sgl_v2f_c1i(float, float, uint) @system @nogc nothrow; -void v2fC1i(float x, float y, uint rgba) @trusted nothrow @nogc { +void v2fC1i(float x, float y, uint rgba) @trusted @nogc nothrow { sgl_v2f_c1i(x, y, rgba); } extern(C) void sgl_v3f_c3f(float, float, float, float, float, float) @system @nogc nothrow; -void v3fC3f(float x, float y, float z, float r, float g, float b) @trusted nothrow @nogc { +void v3fC3f(float x, float y, float z, float r, float g, float b) @trusted @nogc nothrow { sgl_v3f_c3f(x, y, z, r, g, b); } extern(C) void sgl_v3f_c3b(float, float, float, ubyte, ubyte, ubyte) @system @nogc nothrow; -void v3fC3b(float x, float y, float z, ubyte r, ubyte g, ubyte b) @trusted nothrow @nogc { +void v3fC3b(float x, float y, float z, ubyte r, ubyte g, ubyte b) @trusted @nogc nothrow { sgl_v3f_c3b(x, y, z, r, g, b); } extern(C) void sgl_v3f_c4f(float, float, float, float, float, float, float) @system @nogc nothrow; -void v3fC4f(float x, float y, float z, float r, float g, float b, float a) @trusted nothrow @nogc { +void v3fC4f(float x, float y, float z, float r, float g, float b, float a) @trusted @nogc nothrow { sgl_v3f_c4f(x, y, z, r, g, b, a); } extern(C) void sgl_v3f_c4b(float, float, float, ubyte, ubyte, ubyte, ubyte) @system @nogc nothrow; -void v3fC4b(float x, float y, float z, ubyte r, ubyte g, ubyte b, ubyte a) @trusted nothrow @nogc { +void v3fC4b(float x, float y, float z, ubyte r, ubyte g, ubyte b, ubyte a) @trusted @nogc nothrow { sgl_v3f_c4b(x, y, z, r, g, b, a); } extern(C) void sgl_v3f_c1i(float, float, float, uint) @system @nogc nothrow; -void v3fC1i(float x, float y, float z, uint rgba) @trusted nothrow @nogc { +void v3fC1i(float x, float y, float z, uint rgba) @trusted @nogc nothrow { sgl_v3f_c1i(x, y, z, rgba); } extern(C) void sgl_v2f_t2f_c3f(float, float, float, float, float, float, float) @system @nogc nothrow; -void v2fT2fC3f(float x, float y, float u, float v, float r, float g, float b) @trusted nothrow @nogc { +void v2fT2fC3f(float x, float y, float u, float v, float r, float g, float b) @trusted @nogc nothrow { sgl_v2f_t2f_c3f(x, y, u, v, r, g, b); } extern(C) void sgl_v2f_t2f_c3b(float, float, float, float, ubyte, ubyte, ubyte) @system @nogc nothrow; -void v2fT2fC3b(float x, float y, float u, float v, ubyte r, ubyte g, ubyte b) @trusted nothrow @nogc { +void v2fT2fC3b(float x, float y, float u, float v, ubyte r, ubyte g, ubyte b) @trusted @nogc nothrow { sgl_v2f_t2f_c3b(x, y, u, v, r, g, b); } extern(C) void sgl_v2f_t2f_c4f(float, float, float, float, float, float, float, float) @system @nogc nothrow; -void v2fT2fC4f(float x, float y, float u, float v, float r, float g, float b, float a) @trusted nothrow @nogc { +void v2fT2fC4f(float x, float y, float u, float v, float r, float g, float b, float a) @trusted @nogc nothrow { sgl_v2f_t2f_c4f(x, y, u, v, r, g, b, a); } extern(C) void sgl_v2f_t2f_c4b(float, float, float, float, ubyte, ubyte, ubyte, ubyte) @system @nogc nothrow; -void v2fT2fC4b(float x, float y, float u, float v, ubyte r, ubyte g, ubyte b, ubyte a) @trusted nothrow @nogc { +void v2fT2fC4b(float x, float y, float u, float v, ubyte r, ubyte g, ubyte b, ubyte a) @trusted @nogc nothrow { sgl_v2f_t2f_c4b(x, y, u, v, r, g, b, a); } extern(C) void sgl_v2f_t2f_c1i(float, float, float, float, uint) @system @nogc nothrow; -void v2fT2fC1i(float x, float y, float u, float v, uint rgba) @trusted nothrow @nogc { +void v2fT2fC1i(float x, float y, float u, float v, uint rgba) @trusted @nogc nothrow { sgl_v2f_t2f_c1i(x, y, u, v, rgba); } extern(C) void sgl_v3f_t2f_c3f(float, float, float, float, float, float, float, float) @system @nogc nothrow; -void v3fT2fC3f(float x, float y, float z, float u, float v, float r, float g, float b) @trusted nothrow @nogc { +void v3fT2fC3f(float x, float y, float z, float u, float v, float r, float g, float b) @trusted @nogc nothrow { sgl_v3f_t2f_c3f(x, y, z, u, v, r, g, b); } extern(C) void sgl_v3f_t2f_c3b(float, float, float, float, float, ubyte, ubyte, ubyte) @system @nogc nothrow; -void v3fT2fC3b(float x, float y, float z, float u, float v, ubyte r, ubyte g, ubyte b) @trusted nothrow @nogc { +void v3fT2fC3b(float x, float y, float z, float u, float v, ubyte r, ubyte g, ubyte b) @trusted @nogc nothrow { sgl_v3f_t2f_c3b(x, y, z, u, v, r, g, b); } extern(C) void sgl_v3f_t2f_c4f(float, float, float, float, float, float, float, float, float) @system @nogc nothrow; -void v3fT2fC4f(float x, float y, float z, float u, float v, float r, float g, float b, float a) @trusted nothrow @nogc { +void v3fT2fC4f(float x, float y, float z, float u, float v, float r, float g, float b, float a) @trusted @nogc nothrow { sgl_v3f_t2f_c4f(x, y, z, u, v, r, g, b, a); } extern(C) void sgl_v3f_t2f_c4b(float, float, float, float, float, ubyte, ubyte, ubyte, ubyte) @system @nogc nothrow; -void v3fT2fC4b(float x, float y, float z, float u, float v, ubyte r, ubyte g, ubyte b, ubyte a) @trusted nothrow @nogc { +void v3fT2fC4b(float x, float y, float z, float u, float v, ubyte r, ubyte g, ubyte b, ubyte a) @trusted @nogc nothrow { sgl_v3f_t2f_c4b(x, y, z, u, v, r, g, b, a); } extern(C) void sgl_v3f_t2f_c1i(float, float, float, float, float, uint) @system @nogc nothrow; -void v3fT2fC1i(float x, float y, float z, float u, float v, uint rgba) @trusted nothrow @nogc { +void v3fT2fC1i(float x, float y, float z, float u, float v, uint rgba) @trusted @nogc nothrow { sgl_v3f_t2f_c1i(x, y, z, u, v, rgba); } extern(C) void sgl_end() @system @nogc nothrow; -void end() @trusted nothrow @nogc { +void end() @trusted @nogc nothrow { sgl_end(); } diff --git a/src/sokol/glue.d b/src/sokol/glue.d index 8c920d4..5adecde 100644 --- a/src/sokol/glue.d +++ b/src/sokol/glue.d @@ -4,6 +4,6 @@ module sokol.glue; import sg = sokol.gfx; extern(C) sg.ContextDesc sapp_sgcontext() @system @nogc nothrow; -sg.ContextDesc context() @trusted nothrow @nogc { +sg.ContextDesc context() @trusted @nogc nothrow { return sapp_sgcontext(); } diff --git a/src/sokol/shape.d b/src/sokol/shape.d index 2905081..adde6cc 100644 --- a/src/sokol/shape.d +++ b/src/sokol/shape.d @@ -103,98 +103,98 @@ struct Torus { Mat4 transform; } extern(C) Buffer sshape_build_plane(const Buffer *, const Plane *) @system @nogc nothrow; -Buffer buildPlane(ref Buffer buf, ref Plane params) @trusted nothrow @nogc { +Buffer buildPlane(ref Buffer buf, ref Plane params) @trusted @nogc nothrow { return sshape_build_plane(&buf, ¶ms); } extern(C) Buffer sshape_build_box(const Buffer *, const Box *) @system @nogc nothrow; -Buffer buildBox(ref Buffer buf, ref Box params) @trusted nothrow @nogc { +Buffer buildBox(ref Buffer buf, ref Box params) @trusted @nogc nothrow { return sshape_build_box(&buf, ¶ms); } extern(C) Buffer sshape_build_sphere(const Buffer *, const Sphere *) @system @nogc nothrow; -Buffer buildSphere(ref Buffer buf, ref Sphere params) @trusted nothrow @nogc { +Buffer buildSphere(ref Buffer buf, ref Sphere params) @trusted @nogc nothrow { return sshape_build_sphere(&buf, ¶ms); } extern(C) Buffer sshape_build_cylinder(const Buffer *, const Cylinder *) @system @nogc nothrow; -Buffer buildCylinder(ref Buffer buf, ref Cylinder params) @trusted nothrow @nogc { +Buffer buildCylinder(ref Buffer buf, ref Cylinder params) @trusted @nogc nothrow { return sshape_build_cylinder(&buf, ¶ms); } extern(C) Buffer sshape_build_torus(const Buffer *, const Torus *) @system @nogc nothrow; -Buffer buildTorus(ref Buffer buf, ref Torus params) @trusted nothrow @nogc { +Buffer buildTorus(ref Buffer buf, ref Torus params) @trusted @nogc nothrow { return sshape_build_torus(&buf, ¶ms); } extern(C) Sizes sshape_plane_sizes(uint) @system @nogc nothrow; -Sizes planeSizes(uint tiles) @trusted nothrow @nogc { +Sizes planeSizes(uint tiles) @trusted @nogc nothrow { return sshape_plane_sizes(tiles); } extern(C) Sizes sshape_box_sizes(uint) @system @nogc nothrow; -Sizes boxSizes(uint tiles) @trusted nothrow @nogc { +Sizes boxSizes(uint tiles) @trusted @nogc nothrow { return sshape_box_sizes(tiles); } extern(C) Sizes sshape_sphere_sizes(uint, uint) @system @nogc nothrow; -Sizes sphereSizes(uint slices, uint stacks) @trusted nothrow @nogc { +Sizes sphereSizes(uint slices, uint stacks) @trusted @nogc nothrow { return sshape_sphere_sizes(slices, stacks); } extern(C) Sizes sshape_cylinder_sizes(uint, uint) @system @nogc nothrow; -Sizes cylinderSizes(uint slices, uint stacks) @trusted nothrow @nogc { +Sizes cylinderSizes(uint slices, uint stacks) @trusted @nogc nothrow { return sshape_cylinder_sizes(slices, stacks); } extern(C) Sizes sshape_torus_sizes(uint, uint) @system @nogc nothrow; -Sizes torusSizes(uint sides, uint rings) @trusted nothrow @nogc { +Sizes torusSizes(uint sides, uint rings) @trusted @nogc nothrow { return sshape_torus_sizes(sides, rings); } extern(C) ElementRange sshape_element_range(const Buffer *) @system @nogc nothrow; -ElementRange elementRange(ref Buffer buf) @trusted nothrow @nogc { +ElementRange elementRange(ref Buffer buf) @trusted @nogc nothrow { return sshape_element_range(&buf); } extern(C) sg.BufferDesc sshape_vertex_buffer_desc(const Buffer *) @system @nogc nothrow; -sg.BufferDesc vertexBufferDesc(ref Buffer buf) @trusted nothrow @nogc { +sg.BufferDesc vertexBufferDesc(ref Buffer buf) @trusted @nogc nothrow { return sshape_vertex_buffer_desc(&buf); } extern(C) sg.BufferDesc sshape_index_buffer_desc(const Buffer *) @system @nogc nothrow; -sg.BufferDesc indexBufferDesc(ref Buffer buf) @trusted nothrow @nogc { +sg.BufferDesc indexBufferDesc(ref Buffer buf) @trusted @nogc nothrow { return sshape_index_buffer_desc(&buf); } extern(C) sg.VertexBufferLayoutState sshape_vertex_buffer_layout_state() @system @nogc nothrow; -sg.VertexBufferLayoutState vertexBufferLayoutState() @trusted nothrow @nogc { +sg.VertexBufferLayoutState vertexBufferLayoutState() @trusted @nogc nothrow { return sshape_vertex_buffer_layout_state(); } extern(C) sg.VertexAttrState sshape_position_vertex_attr_state() @system @nogc nothrow; -sg.VertexAttrState positionVertexAttrState() @trusted nothrow @nogc { +sg.VertexAttrState positionVertexAttrState() @trusted @nogc nothrow { return sshape_position_vertex_attr_state(); } extern(C) sg.VertexAttrState sshape_normal_vertex_attr_state() @system @nogc nothrow; -sg.VertexAttrState normalVertexAttrState() @trusted nothrow @nogc { +sg.VertexAttrState normalVertexAttrState() @trusted @nogc nothrow { return sshape_normal_vertex_attr_state(); } extern(C) sg.VertexAttrState sshape_texcoord_vertex_attr_state() @system @nogc nothrow; -sg.VertexAttrState texcoordVertexAttrState() @trusted nothrow @nogc { +sg.VertexAttrState texcoordVertexAttrState() @trusted @nogc nothrow { return sshape_texcoord_vertex_attr_state(); } extern(C) sg.VertexAttrState sshape_color_vertex_attr_state() @system @nogc nothrow; -sg.VertexAttrState colorVertexAttrState() @trusted nothrow @nogc { +sg.VertexAttrState colorVertexAttrState() @trusted @nogc nothrow { return sshape_color_vertex_attr_state(); } extern(C) uint sshape_color_4f(float, float, float, float) @system @nogc nothrow; -uint color4f(float r, float g, float b, float a) @trusted nothrow @nogc { +uint color4f(float r, float g, float b, float a) @trusted @nogc nothrow { return sshape_color_4f(r, g, b, a); } extern(C) uint sshape_color_3f(float, float, float) @system @nogc nothrow; -uint color3f(float r, float g, float b) @trusted nothrow @nogc { +uint color3f(float r, float g, float b) @trusted @nogc nothrow { return sshape_color_3f(r, g, b); } extern(C) uint sshape_color_4b(ubyte, ubyte, ubyte, ubyte) @system @nogc nothrow; -uint color4b(ubyte r, ubyte g, ubyte b, ubyte a) @trusted nothrow @nogc { +uint color4b(ubyte r, ubyte g, ubyte b, ubyte a) @trusted @nogc nothrow { return sshape_color_4b(r, g, b, a); } extern(C) uint sshape_color_3b(ubyte, ubyte, ubyte) @system @nogc nothrow; -uint color3b(ubyte r, ubyte g, ubyte b) @trusted nothrow @nogc { +uint color3b(ubyte r, ubyte g, ubyte b) @trusted @nogc nothrow { return sshape_color_3b(r, g, b); } extern(C) Mat4 sshape_mat4(const float *) @system @nogc nothrow; -Mat4 mat4(const float * m) @trusted nothrow @nogc { +Mat4 mat4(const float * m) @trusted @nogc nothrow { return sshape_mat4(m); } extern(C) Mat4 sshape_mat4_transpose(const float *) @system @nogc nothrow; -Mat4 mat4Transpose(const float * m) @trusted nothrow @nogc { +Mat4 mat4Transpose(const float * m) @trusted @nogc nothrow { return sshape_mat4_transpose(m); } diff --git a/src/sokol/time.d b/src/sokol/time.d index 8944010..a2f8e18 100644 --- a/src/sokol/time.d +++ b/src/sokol/time.d @@ -3,42 +3,42 @@ module sokol.time; extern(C) void stm_setup() @system @nogc nothrow; -void setup() @trusted nothrow @nogc { +void setup() @trusted @nogc nothrow { stm_setup(); } extern(C) ulong stm_now() @system @nogc nothrow; -ulong now() @trusted nothrow @nogc { +ulong now() @trusted @nogc nothrow { return stm_now(); } extern(C) ulong stm_diff(ulong, ulong) @system @nogc nothrow; -ulong diff(ulong new_ticks, ulong old_ticks) @trusted nothrow @nogc { +ulong diff(ulong new_ticks, ulong old_ticks) @trusted @nogc nothrow { return stm_diff(new_ticks, old_ticks); } extern(C) ulong stm_since(ulong) @system @nogc nothrow; -ulong since(ulong start_ticks) @trusted nothrow @nogc { +ulong since(ulong start_ticks) @trusted @nogc nothrow { return stm_since(start_ticks); } extern(C) ulong stm_laptime(ulong *) @system @nogc nothrow; -ulong laptime(ulong * last_time) @trusted nothrow @nogc { +ulong laptime(ulong * last_time) @trusted @nogc nothrow { return stm_laptime(last_time); } extern(C) ulong stm_round_to_common_refresh_rate(ulong) @system @nogc nothrow; -ulong roundToCommonRefreshRate(ulong frame_ticks) @trusted nothrow @nogc { +ulong roundToCommonRefreshRate(ulong frame_ticks) @trusted @nogc nothrow { return stm_round_to_common_refresh_rate(frame_ticks); } extern(C) double stm_sec(ulong) @system @nogc nothrow; -double sec(ulong ticks) @trusted nothrow @nogc { +double sec(ulong ticks) @trusted @nogc nothrow { return stm_sec(ticks); } extern(C) double stm_ms(ulong) @system @nogc nothrow; -double ms(ulong ticks) @trusted nothrow @nogc { +double ms(ulong ticks) @trusted @nogc nothrow { return stm_ms(ticks); } extern(C) double stm_us(ulong) @system @nogc nothrow; -double us(ulong ticks) @trusted nothrow @nogc { +double us(ulong ticks) @trusted @nogc nothrow { return stm_us(ticks); } extern(C) double stm_ns(ulong) @system @nogc nothrow; -double ns(ulong ticks) @trusted nothrow @nogc { +double ns(ulong ticks) @trusted @nogc nothrow { return stm_ns(ticks); }