sokol.fetch

Undocumented in source.

Members

Enums

Error
enum Error

error codes

LogItem
enum LogItem
Undocumented in source.

Functions

bindBuffer
void bindBuffer(Handle h, Range buffer)

bind a data buffer to a request (request must not currently have a buffer bound, must be called from response callback

cancel
void cancel(Handle h)

cancel a request that's in flight (will call response callback with .cancelled + .finished)

continueFetching
void continueFetching(Handle h)

continue a paused request

desc
Desc desc()

get the desc struct that was passed to sfetch_setup()

dowork
void dowork()

do per-frame work, moves requests into and out of IO threads, and invokes response-callbacks

handleValid
bool handleValid(Handle h)

return true if a handle is valid *and* the request is alive

maxPath
int maxPath()

return the value of the SFETCH_MAX_PATH implementation config value

maxUserdataBytes
int maxUserdataBytes()

return the max userdata size in number of bytes (SFETCH_MAX_USERDATA_UINT64 * sizeof(uint64_t))

pause
void pause(Handle h)

pause a request (will call response callback each frame with .paused)

send
Handle send(Request request)

send a fetch-request, get handle to request back

setup
void setup(Desc desc)

setup sokol-fetch (can be called on multiple threads)

sfetch_bind_buffer
void sfetch_bind_buffer(Handle , Range )

bind a data buffer to a request (request must not currently have a buffer bound, must be called from response callback

sfetch_cancel
void sfetch_cancel(Handle )

cancel a request that's in flight (will call response callback with .cancelled + .finished)

sfetch_continue
void sfetch_continue(Handle )

continue a paused request

sfetch_desc
Desc sfetch_desc()

get the desc struct that was passed to sfetch_setup()

sfetch_dowork
void sfetch_dowork()

do per-frame work, moves requests into and out of IO threads, and invokes response-callbacks

sfetch_handle_valid
bool sfetch_handle_valid(Handle )

return true if a handle is valid *and* the request is alive

sfetch_max_path
int sfetch_max_path()

return the value of the SFETCH_MAX_PATH implementation config value

sfetch_max_userdata_bytes
int sfetch_max_userdata_bytes()

return the max userdata size in number of bytes (SFETCH_MAX_USERDATA_UINT64 * sizeof(uint64_t))

sfetch_pause
void sfetch_pause(Handle )

pause a request (will call response callback each frame with .paused)

sfetch_send
Handle sfetch_send(Request* )

send a fetch-request, get handle to request back

sfetch_setup
void sfetch_setup(Desc* )

setup sokol-fetch (can be called on multiple threads)

sfetch_shutdown
void sfetch_shutdown()

discard a sokol-fetch context

sfetch_unbind_buffer
void* sfetch_unbind_buffer(Handle )

clear the 'buffer binding' of a request, returns previous buffer pointer (can be 0), must be called from response callback

sfetch_valid
bool sfetch_valid()

return true if sokol-fetch has been setup

shutdown
void shutdown()

discard a sokol-fetch context

unbindBuffer
void* unbindBuffer(Handle h)

clear the 'buffer binding' of a request, returns previous buffer pointer (can be 0), must be called from response callback

valid
bool valid()

return true if sokol-fetch has been setup

Structs

Allocator
struct Allocator

sfetch_allocator_t

Desc
struct Desc

configuration values for sfetch_setup()

Handle
struct Handle

a request handle to identify an active fetch request, returned by sfetch_send()

Logger
struct Logger

sfetch_logger_t

Range
struct Range

sfetch_range_t

Request
struct Request

request parameters passed to sfetch_send()

Response
struct Response

the response struct passed to the response callback

Meta