sokol.app

Machine generated D bindings for Sokol library.

Generated on: 2025-06-15 12:55:08

Source header: sokol_app.h Module: sokol.app

Do not edit manually; regenerate using gen_d.py.

Members

Enums

AndroidTooltype
enum AndroidTooltype

Android specific 'tool type' enum for touch events. This lets the application check what type of input device was used for touch events.

EventType
enum EventType

sapp_event_type

Html5FetchError
enum Html5FetchError

HTML5 specific: request and response structs for asynchronously loading dropped-file content.

Keycode
enum Keycode

sapp_keycode

LogItem
enum LogItem
Undocumented in source.
MouseCursor
enum MouseCursor

sapp_mouse_cursor

Mousebutton
enum Mousebutton

sapp_mousebutton

Functions

androidGetNativeActivity
const(void)* androidGetNativeActivity()
Undocumented in source. Be warned that the author may not have intended to support it.
cancelQuit
void cancelQuit()
Undocumented in source. Be warned that the author may not have intended to support it.
colorFormat
int colorFormat()
Undocumented in source. Be warned that the author may not have intended to support it.
consumeEvent
void consumeEvent()
Undocumented in source. Be warned that the author may not have intended to support it.
d3d11GetDepthStencilView
const(void)* d3d11GetDepthStencilView()
Undocumented in source. Be warned that the author may not have intended to support it.
d3d11GetDevice
const(void)* d3d11GetDevice()
Undocumented in source. Be warned that the author may not have intended to support it.
d3d11GetDeviceContext
const(void)* d3d11GetDeviceContext()
Undocumented in source. Be warned that the author may not have intended to support it.
d3d11GetRenderView
const(void)* d3d11GetRenderView()
Undocumented in source. Be warned that the author may not have intended to support it.
d3d11GetResolveView
const(void)* d3d11GetResolveView()
Undocumented in source. Be warned that the author may not have intended to support it.
d3d11GetSwapChain
const(void)* d3d11GetSwapChain()
Undocumented in source. Be warned that the author may not have intended to support it.
depthFormat
int depthFormat()
Undocumented in source. Be warned that the author may not have intended to support it.
dpiScale
float dpiScale()
Undocumented in source. Be warned that the author may not have intended to support it.
eglGetContext
const(void)* eglGetContext()
Undocumented in source. Be warned that the author may not have intended to support it.
eglGetDisplay
const(void)* eglGetDisplay()
Undocumented in source. Be warned that the author may not have intended to support it.
frameCount
ulong frameCount()
Undocumented in source. Be warned that the author may not have intended to support it.
frameDuration
double frameDuration()
Undocumented in source. Be warned that the author may not have intended to support it.
getClipboardString
const(char)* getClipboardString()
Undocumented in source. Be warned that the author may not have intended to support it.
getDroppedFilePath
const(char)* getDroppedFilePath(int index)
Undocumented in source. Be warned that the author may not have intended to support it.
getMouseCursor
MouseCursor getMouseCursor()
Undocumented in source. Be warned that the author may not have intended to support it.
getNumDroppedFiles
int getNumDroppedFiles()
Undocumented in source. Be warned that the author may not have intended to support it.
glGetFramebuffer
uint glGetFramebuffer()
Undocumented in source. Be warned that the author may not have intended to support it.
glGetMajorVersion
int glGetMajorVersion()
Undocumented in source. Be warned that the author may not have intended to support it.
glGetMinorVersion
int glGetMinorVersion()
Undocumented in source. Be warned that the author may not have intended to support it.
glIsGles
bool glIsGles()
Undocumented in source. Be warned that the author may not have intended to support it.
height
int height()
Undocumented in source. Be warned that the author may not have intended to support it.
heightf
float heightf()
Undocumented in source. Be warned that the author may not have intended to support it.
highDpi
bool highDpi()
Undocumented in source. Be warned that the author may not have intended to support it.
html5AskLeaveSite
void html5AskLeaveSite(bool ask)
Undocumented in source. Be warned that the author may not have intended to support it.
html5FetchDroppedFile
void html5FetchDroppedFile(Html5FetchRequest request)
Undocumented in source. Be warned that the author may not have intended to support it.
html5GetDroppedFileSize
uint html5GetDroppedFileSize(int index)
Undocumented in source. Be warned that the author may not have intended to support it.
iosGetWindow
const(void)* iosGetWindow()
Undocumented in source. Be warned that the author may not have intended to support it.
isFullscreen
bool isFullscreen()
Undocumented in source. Be warned that the author may not have intended to support it.
isvalid
bool isvalid()
Undocumented in source. Be warned that the author may not have intended to support it.
keyboardShown
bool keyboardShown()
Undocumented in source. Be warned that the author may not have intended to support it.
lockMouse
void lockMouse(bool lock)
Undocumented in source. Be warned that the author may not have intended to support it.
macosGetWindow
const(void)* macosGetWindow()
Undocumented in source. Be warned that the author may not have intended to support it.
metalGetCurrentDrawable
const(void)* metalGetCurrentDrawable()
Undocumented in source. Be warned that the author may not have intended to support it.
metalGetDepthStencilTexture
const(void)* metalGetDepthStencilTexture()
Undocumented in source. Be warned that the author may not have intended to support it.
metalGetDevice
const(void)* metalGetDevice()
Undocumented in source. Be warned that the author may not have intended to support it.
metalGetMsaaColorTexture
const(void)* metalGetMsaaColorTexture()
Undocumented in source. Be warned that the author may not have intended to support it.
mouseLocked
bool mouseLocked()
Undocumented in source. Be warned that the author may not have intended to support it.
mouseShown
bool mouseShown()
Undocumented in source. Be warned that the author may not have intended to support it.
queryDesc
Desc queryDesc()
Undocumented in source. Be warned that the author may not have intended to support it.
quit
void quit()
Undocumented in source. Be warned that the author may not have intended to support it.
requestQuit
void requestQuit()
Undocumented in source. Be warned that the author may not have intended to support it.
run
void run(Desc desc)
Undocumented in source. Be warned that the author may not have intended to support it.
sampleCount
int sampleCount()
Undocumented in source. Be warned that the author may not have intended to support it.
sapp_android_get_native_activity
const(void)* sapp_android_get_native_activity()

Android: get native activity handle

sapp_cancel_quit
void sapp_cancel_quit()

cancel a pending quit (when SAPP_EVENTTYPE_QUIT_REQUESTED has been received)

sapp_color_format
int sapp_color_format()

get default framebuffer color pixel format

sapp_consume_event
void sapp_consume_event()

call from inside event callback to consume the current event (don't forward to platform)

sapp_d3d11_get_depth_stencil_view
const(void)* sapp_d3d11_get_depth_stencil_view()

D3D11: get pointer ID3D11DepthStencilView

sapp_d3d11_get_device
const(void)* sapp_d3d11_get_device()

D3D11: get pointer to ID3D11Device object

sapp_d3d11_get_device_context
const(void)* sapp_d3d11_get_device_context()

D3D11: get pointer to ID3D11DeviceContext object

sapp_d3d11_get_render_view
const(void)* sapp_d3d11_get_render_view()

D3D11: get pointer to ID3D11RenderTargetView object for rendering

sapp_d3d11_get_resolve_view
const(void)* sapp_d3d11_get_resolve_view()

D3D11: get pointer ID3D11RenderTargetView object for msaa-resolve (may return null)

sapp_d3d11_get_swap_chain
const(void)* sapp_d3d11_get_swap_chain()

D3D11: get pointer to IDXGISwapChain object

sapp_depth_format
int sapp_depth_format()

get default framebuffer depth pixel format

sapp_dpi_scale
float sapp_dpi_scale()

returns the dpi scaling factor (window pixels to framebuffer pixels)

sapp_egl_get_context
const(void)* sapp_egl_get_context()

EGL: get EGLContext object

sapp_egl_get_display
const(void)* sapp_egl_get_display()

EGL: get EGLDisplay object

sapp_frame_count
ulong sapp_frame_count()

get the current frame counter (for comparison with sapp_event.frame_count)

sapp_frame_duration
double sapp_frame_duration()

get an averaged/smoothed frame duration in seconds

sapp_get_clipboard_string
const(char)* sapp_get_clipboard_string()

read string from clipboard (usually during SAPP_EVENTTYPE_CLIPBOARD_PASTED)

sapp_get_dropped_file_path
const(char)* sapp_get_dropped_file_path(int index)

gets the dropped file paths

sapp_get_mouse_cursor
MouseCursor sapp_get_mouse_cursor()

get current mouse cursor type

sapp_get_num_dropped_files
int sapp_get_num_dropped_files()

gets the total number of dropped files (after an SAPP_EVENTTYPE_FILES_DROPPED event)

sapp_gl_get_framebuffer
uint sapp_gl_get_framebuffer()

GL: get framebuffer object

sapp_gl_get_major_version
int sapp_gl_get_major_version()

GL: get major version

sapp_gl_get_minor_version
int sapp_gl_get_minor_version()

GL: get minor version

sapp_gl_is_gles
bool sapp_gl_is_gles()

GL: return true if the context is GLES

sapp_height
int sapp_height()

returns the current framebuffer height in pixels

sapp_heightf
float sapp_heightf()

same as sapp_height(), but returns float

sapp_high_dpi
bool sapp_high_dpi()

returns true when high_dpi was requested and actually running in a high-dpi scenario

sapp_html5_ask_leave_site
void sapp_html5_ask_leave_site(bool ask)

HTML5: enable or disable the hardwired "Leave Site?" dialog box

sapp_html5_fetch_dropped_file
void sapp_html5_fetch_dropped_file(Html5FetchRequest* request)

HTML5: asynchronously load the content of a dropped file

sapp_html5_get_dropped_file_size
uint sapp_html5_get_dropped_file_size(int index)

HTML5: get byte size of a dropped file

sapp_ios_get_window
const(void)* sapp_ios_get_window()

iOS: get bridged pointer to iOS UIWindow

sapp_is_fullscreen
bool sapp_is_fullscreen()

query fullscreen mode

sapp_isvalid
bool sapp_isvalid()

returns true after sokol-app has been initialized

sapp_keyboard_shown
bool sapp_keyboard_shown()

return true if the mobile device onscreen keyboard is currently shown

sapp_lock_mouse
void sapp_lock_mouse(bool lock)

enable/disable mouse-pointer-lock mode

sapp_macos_get_window
const(void)* sapp_macos_get_window()

macOS: get bridged pointer to macOS NSWindow

sapp_metal_get_current_drawable
const(void)* sapp_metal_get_current_drawable()

Metal: get bridged pointer to MTKView's current drawable of type CAMetalDrawable

sapp_metal_get_depth_stencil_texture
const(void)* sapp_metal_get_depth_stencil_texture()

Metal: get bridged pointer to MTKView's depth-stencil texture of type MTLTexture

sapp_metal_get_device
const(void)* sapp_metal_get_device()

Metal: get bridged pointer to Metal device object

sapp_metal_get_msaa_color_texture
const(void)* sapp_metal_get_msaa_color_texture()

Metal: get bridged pointer to MTKView's msaa-color-texture of type MTLTexture (may be null)

sapp_mouse_locked
bool sapp_mouse_locked()

return true if in mouse-pointer-lock mode (this may toggle a few frames later)

sapp_mouse_shown
bool sapp_mouse_shown()

show or hide the mouse cursor

sapp_query_desc
Desc sapp_query_desc()

return a copy of the sapp_desc structure

sapp_quit
void sapp_quit()

initiate a "hard quit" (quit application without sending SAPP_EVENTTYPE_QUIT_REQUESTED)

sapp_request_quit
void sapp_request_quit()

initiate a "soft quit" (sends SAPP_EVENTTYPE_QUIT_REQUESTED)

sapp_run
void sapp_run(Desc* desc)

special run-function for SOKOL_NO_ENTRY (in standard mode this is an empty stub)

sapp_sample_count
int sapp_sample_count()

get default framebuffer sample count

sapp_set_clipboard_string
void sapp_set_clipboard_string(const(char)* str)

write string into clipboard

sapp_set_icon
void sapp_set_icon(IconDesc* icon_desc)

set the window icon (only on Windows and Linux)

sapp_set_mouse_cursor
void sapp_set_mouse_cursor(MouseCursor cursor)

set mouse cursor type

sapp_set_window_title
void sapp_set_window_title(const(char)* str)

set the window title (only on desktop platforms)

sapp_show_keyboard
void sapp_show_keyboard(bool show)

show or hide the mobile device onscreen keyboard

sapp_show_mouse
void sapp_show_mouse(bool show)

show or hide the mouse cursor

sapp_toggle_fullscreen
void sapp_toggle_fullscreen()

toggle fullscreen mode

sapp_userdata
void* sapp_userdata()

return the userdata pointer optionally provided in sapp_desc

sapp_wgpu_get_depth_stencil_view
const(void)* sapp_wgpu_get_depth_stencil_view()

WebGPU: get swapchain's WGPUTextureView for the depth-stencil surface

sapp_wgpu_get_device
const(void)* sapp_wgpu_get_device()

WebGPU: get WGPUDevice handle

sapp_wgpu_get_render_view
const(void)* sapp_wgpu_get_render_view()

WebGPU: get swapchain's WGPUTextureView handle for rendering

sapp_wgpu_get_resolve_view
const(void)* sapp_wgpu_get_resolve_view()

WebGPU: get swapchain's MSAA-resolve WGPUTextureView (may return null)

sapp_width
int sapp_width()

returns the current framebuffer width in pixels

sapp_widthf
float sapp_widthf()

same as sapp_width(), but returns float

sapp_win32_get_hwnd
const(void)* sapp_win32_get_hwnd()

Win32: get the HWND window handle

sapp_x11_get_display
const(void)* sapp_x11_get_display()

X11: get Display

sapp_x11_get_window
const(void)* sapp_x11_get_window()

X11: get Window

setClipboardString
void setClipboardString(const(char)* str)
Undocumented in source. Be warned that the author may not have intended to support it.
setIcon
void setIcon(IconDesc icon_desc)
Undocumented in source. Be warned that the author may not have intended to support it.
setMouseCursor
void setMouseCursor(MouseCursor cursor)
Undocumented in source. Be warned that the author may not have intended to support it.
setWindowTitle
void setWindowTitle(const(char)* str)
Undocumented in source. Be warned that the author may not have intended to support it.
showKeyboard
void showKeyboard(bool show)
Undocumented in source. Be warned that the author may not have intended to support it.
showMouse
void showMouse(bool show)
Undocumented in source. Be warned that the author may not have intended to support it.
toggleFullscreen
void toggleFullscreen()
Undocumented in source. Be warned that the author may not have intended to support it.
userdata
void* userdata()
Undocumented in source. Be warned that the author may not have intended to support it.
wgpuGetDepthStencilView
const(void)* wgpuGetDepthStencilView()
Undocumented in source. Be warned that the author may not have intended to support it.
wgpuGetDevice
const(void)* wgpuGetDevice()
Undocumented in source. Be warned that the author may not have intended to support it.
wgpuGetRenderView
const(void)* wgpuGetRenderView()
Undocumented in source. Be warned that the author may not have intended to support it.
wgpuGetResolveView
const(void)* wgpuGetResolveView()
Undocumented in source. Be warned that the author may not have intended to support it.
width
int width()
Undocumented in source. Be warned that the author may not have intended to support it.
widthf
float widthf()
Undocumented in source. Be warned that the author may not have intended to support it.
win32GetHwnd
const(void)* win32GetHwnd()
Undocumented in source. Be warned that the author may not have intended to support it.
x11GetDisplay
const(void)* x11GetDisplay()
Undocumented in source. Be warned that the author may not have intended to support it.
x11GetWindow
const(void)* x11GetWindow()
Undocumented in source. Be warned that the author may not have intended to support it.

Manifest constants

max_iconimages
enum max_iconimages;
Undocumented in source.
max_keycodes
enum max_keycodes;
Undocumented in source.
max_mousebuttons
enum max_mousebuttons;
Undocumented in source.
max_touchpoints
enum max_touchpoints;

misc constants

modifier_alt
enum modifier_alt;
Undocumented in source.
modifier_ctrl
enum modifier_ctrl;
Undocumented in source.
modifier_lmb
enum modifier_lmb;
Undocumented in source.
modifier_mmb
enum modifier_mmb;
Undocumented in source.
modifier_rmb
enum modifier_rmb;
Undocumented in source.
modifier_shift
enum modifier_shift;

These are currently pressed modifier keys (and mouse buttons) which are passed in the event struct field sapp_event.modifiers.

modifier_super
enum modifier_super;
Undocumented in source.

Structs

Allocator
struct Allocator

sapp_allocator

Desc
struct Desc

sokol-app initialization options, used as return value of sokol_main() or sapp_run() argument.

Event
struct Event

sapp_event

Html5FetchRequest
struct Html5FetchRequest
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
Html5FetchResponse
struct Html5FetchResponse
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
IconDesc
struct IconDesc

sapp_icon_desc

ImageDesc
struct ImageDesc

sapp_image_desc

Logger
struct Logger

sapp_logger

Range
struct Range

sg_range

Touchpoint
struct Touchpoint

sapp_touchpoint

Meta