sokol.app

Undocumented in source.

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()

Android: get native activity handle

cancelQuit
void cancelQuit()

cancel a pending quit (when SAPP_EVENTTYPE_QUIT_REQUESTED has been received)

colorFormat
int colorFormat()

get default framebuffer color pixel format

consumeEvent
void consumeEvent()

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

d3d11GetDepthStencilView
const(void)* d3d11GetDepthStencilView()

D3D11: get pointer ID3D11DepthStencilView

d3d11GetDevice
const(void)* d3d11GetDevice()

D3D11: get pointer to ID3D11Device object

d3d11GetDeviceContext
const(void)* d3d11GetDeviceContext()

D3D11: get pointer to ID3D11DeviceContext object

d3d11GetRenderView
const(void)* d3d11GetRenderView()

D3D11: get pointer to ID3D11RenderTargetView object for rendering

d3d11GetResolveView
const(void)* d3d11GetResolveView()

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

d3d11GetSwapChain
const(void)* d3d11GetSwapChain()

D3D11: get pointer to IDXGISwapChain object

depthFormat
int depthFormat()

get default framebuffer depth pixel format

dpiScale
float dpiScale()

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

eglGetContext
const(void)* eglGetContext()

EGL: get EGLContext object

eglGetDisplay
const(void)* eglGetDisplay()

EGL: get EGLDisplay object

frameCount
ulong frameCount()

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

frameDuration
double frameDuration()

get an averaged/smoothed frame duration in seconds

getClipboardString
const(char)* getClipboardString()

read string from clipboard (usually during SAPP_EVENTTYPE_CLIPBOARD_PASTED)

getDroppedFilePath
const(char)* getDroppedFilePath(int index)

gets the dropped file paths

getMouseCursor
MouseCursor getMouseCursor()

get current mouse cursor type

getNumDroppedFiles
int getNumDroppedFiles()

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

glGetFramebuffer
uint glGetFramebuffer()

GL: get framebuffer object

glGetMajorVersion
int glGetMajorVersion()

GL: get major version (only valid for desktop GL)

glGetMinorVersion
int glGetMinorVersion()

GL: get minor version (only valid for desktop GL)

height
int height()

returns the current framebuffer height in pixels

heightf
float heightf()

same as sapp_height(), but returns float

highDpi
bool highDpi()

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

html5AskLeaveSite
void html5AskLeaveSite(bool ask)

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

html5FetchDroppedFile
void html5FetchDroppedFile(Html5FetchRequest request)

HTML5: asynchronously load the content of a dropped file

html5GetDroppedFileSize
uint html5GetDroppedFileSize(int index)

HTML5: get byte size of a dropped file

iosGetWindow
const(void)* iosGetWindow()

iOS: get bridged pointer to iOS UIWindow

isFullscreen
bool isFullscreen()

query fullscreen mode

isvalid
bool isvalid()

returns true after sokol-app has been initialized

keyboardShown
bool keyboardShown()

return true if the mobile device onscreen keyboard is currently shown

lockMouse
void lockMouse(bool lock)

enable/disable mouse-pointer-lock mode

macosGetWindow
const(void)* macosGetWindow()

macOS: get bridged pointer to macOS NSWindow

metalGetCurrentDrawable
const(void)* metalGetCurrentDrawable()

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

metalGetDepthStencilTexture
const(void)* metalGetDepthStencilTexture()

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

metalGetDevice
const(void)* metalGetDevice()

Metal: get bridged pointer to Metal device object

metalGetMsaaColorTexture
const(void)* metalGetMsaaColorTexture()

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

mouseLocked
bool mouseLocked()

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

mouseShown
bool mouseShown()

show or hide the mouse cursor

queryDesc
Desc queryDesc()

return a copy of the sapp_desc structure

quit
void quit()

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

requestQuit
void requestQuit()

initiate a "soft quit" (sends SAPP_EVENTTYPE_QUIT_REQUESTED)

run
void run(Desc desc)

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

sampleCount
int sampleCount()

get default framebuffer sample count

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 )

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 (only valid for desktop GL)

sapp_gl_get_minor_version
int sapp_gl_get_minor_version()

GL: get minor version (only valid for desktop GL)

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 )

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

sapp_html5_fetch_dropped_file
void sapp_html5_fetch_dropped_file(Html5FetchRequest* )

HTML5: asynchronously load the content of a dropped file

sapp_html5_get_dropped_file_size
uint sapp_html5_get_dropped_file_size(int )

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 )

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* )

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)* )

write string into clipboard

sapp_set_icon
void sapp_set_icon(IconDesc* )

set the window icon (only on Windows and Linux)

sapp_set_mouse_cursor
void sapp_set_mouse_cursor(MouseCursor )

set mouse cursor type

sapp_set_window_title
void sapp_set_window_title(const(char)* )

set the window title (only on desktop platforms)

sapp_show_keyboard
void sapp_show_keyboard(bool )

show or hide the mobile device onscreen keyboard

sapp_show_mouse
void sapp_show_mouse(bool )

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

setClipboardString
void setClipboardString(const(char)* str)

write string into clipboard

setIcon
void setIcon(IconDesc icon_desc)

set the window icon (only on Windows and Linux)

setMouseCursor
void setMouseCursor(MouseCursor cursor)

set mouse cursor type

setWindowTitle
void setWindowTitle(const(char)* str)

set the window title (only on desktop platforms)

showKeyboard
void showKeyboard(bool show)

show or hide the mobile device onscreen keyboard

showMouse
void showMouse(bool show)

show or hide the mouse cursor

toggleFullscreen
void toggleFullscreen()

toggle fullscreen mode

userdata
void* userdata()

return the userdata pointer optionally provided in sapp_desc

wgpuGetDepthStencilView
const(void)* wgpuGetDepthStencilView()

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

wgpuGetDevice
const(void)* wgpuGetDevice()

WebGPU: get WGPUDevice handle

wgpuGetRenderView
const(void)* wgpuGetRenderView()

WebGPU: get swapchain's WGPUTextureView handle for rendering

wgpuGetResolveView
const(void)* wgpuGetResolveView()

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

width
int width()

returns the current framebuffer width in pixels

widthf
float widthf()

same as sapp_width(), but returns float

win32GetHwnd
const(void)* win32GetHwnd()

Win32: get the HWND window handle

Manifest constants

max_iconimages
enum max_iconimages;

misc constants

max_keycodes
enum max_keycodes;

misc constants

max_mousebuttons
enum max_mousebuttons;

misc constants

max_touchpoints
enum max_touchpoints;

misc constants misc constants

modifier_alt
enum modifier_alt;

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

modifier_ctrl
enum modifier_ctrl;

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

modifier_lmb
enum modifier_lmb;

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

modifier_mmb
enum modifier_mmb;

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

modifier_rmb
enum modifier_rmb;

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

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 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;

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

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