Element 'pointerlockchange', 'pointerlockerror' Events
IRT
PPB_Audio
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
Create
x
SDL (partial)
GAP (partial) - AudioWorkletNode ROUGHLY equivalent
Still being standardized.
GetCurrentConfig
SDL
AudioContext.* (gets back settings passed in)
StartPlayback
SDL
AudioBufferSourceNode.start
StopPlayback
SDL
AudioBufferSourceNode.stop
PPB_AudioBuffer
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
GetTimestamp
SDL
AudioBufferSourceNode.start (parameter)
Passed in each time instead of attached to the buffer.
SetTimestamp
SDL
AudioBufferSourceNode.start (parameter)
GetSampleRate
SDL
AudioBuffer.sampleRate
GetSampleSize
GAP
GAP - WebAudio only uses 32-bit float, PPAPI does 16-bit int.
PPAPI theoretically supports multiple sampling sizes. In practice, it only supports 16-bit samples. Unfortunately, developers have requested 16-bit sample sizes to save on memory use.
GetNumberOfChannels
SDL
AudioBuffer.numberOfChannels
GetDataBuffer
SDL
AudioBuffer.getChannelData
GetBufferSize
SDL
AudioBuffer.length
PPB_AudioConfig
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
CreateStereo16Bit
GAP
GAP - Only 32-bit float samples supported
GetSampleRate
SDL
AudioContext.sampleRate
GetSampleFrameCount
SDL
AudioBuffer.length
RecommendSampleRate
SDL
AudioContext.sampleRate (from default construct)
An AudioContext will have the preferred sampling rate by default.
RecommendSampleFrameCount
GAP
GAP - No mechanism to get a recommended buffer size.
PPB_Console
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
Log
utime
console.log/warn/error/...
LogWithSource
GAP
GAP
PPAPI provides a way to override the source filename and line number in a console message. (Though JS API provides way to style text).
GAP - Canvas.getContext lets you set booleans requesting depth / stencil buffers of certain sizes, but does not have a way to query what's possible (or get anything other than on or off for each)
Create
SDL
Canvas.getContext
GetAttribs
SDL
WebGLRenderingContext.getContextAttributes
SetAttribs
SDL
Canvas.getContext(.., OPTIONS)
GetError
SDL
WebGLRenderingContext.getError
ResizeBuffers
SDL
Canvas.width = w; Canvas.height = h;
SwapBuffers
GAP
GAP - No way to explicitly flip a frame, must return to the event loop.
PPB_ImageData
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
GetNativeImageDataFormat
SDL
ImageData mandates RGBA order
IsImageDataFormatSupported
SDL
ImageData mandates RGBA order
Create
SDL
CanvasRenderingContext2d.createImageData
Describe
SDL
ImageData never has a stride
Map
SDL
ImageData.data
Unmap
SDL
ImageData.data
PPB_InputEvent
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
RequestInputEvents
SDL
No direct equivalent
The lack of this feature is probably less relevant as JS / Wasm runs on the main thread and can more cheaply filter events without incurring a cross process round-trip.
RequestFilteringInputEvents
SDL
mouse* key* wheel* touch* composition* Events
SDL
Element.addEventListener
ClearInputEventRequest
SDL
Element.removeEventListener
GetType
SDL
Event class descendants
GetTimeStamp
SDL
Event.timeStamp
GetModifiers
SDL
*Event.altKey/shiftKey/metaKey/ctrlKey
PPB_MouseInputEvent
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
Create
SDL
MouseEvent
GetButton
SDL
MouseEvent.button
GetPosition
SDL
MouseEvent.client*/page*/offset*
GetClickCount
SDL
dblclick' vs 'mousedown' Events
GetMovement
SDL
MouseEvent.movement*
PPB_WheelInputEvent
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
Create
SDL
WheelEvent
GetDelta
SDL
WheelEvent.delta*
GetTicks
GAP
GAP - deltaMode kinda of contains this info, but incompletely.
GetScrollByPage
GAP
GAP - deltaMode kinda of contains this info, but incompletely.
PPB_KeyboardInputEvent
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
Create
SDL
KeyboardEvent
GetKeyCode
SDL
KeyboardEvent.keyCode
GetCharacterText
SDL
KeyboardEvent.key
GetCode
SDL
KeyboardEvent.code
PPB_TouchInputEvent
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
Create
SDL
TouchEvent
AddTouchPoint
SDL
TouchEvent.touches.push
GetTouchCount
SDL
TouchEvent.touches.length
GetTouchByIndex
SDL
TouchEvent.touches[i]
GetTouchById
SDL
Touch.indentifer (to figure this out yourself)
PPB_IMEInputEvent
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
Create
GAP
CompositionEvent
GetText
GAP
CompositionEvent.data
GetSegmentNumber
GAP
GAP - No direct equivalent
GetSegmentOffset
GAP
GAP - No direct equivalent
GetTargetSegment
GAP
GAP - No direct equivalent
GetSelection
GAP
GAP - No direct equivalent
PPB_Instance
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
BindGraphics
SDL
Canvas.getContext (moot as binding is automatic).
IsFullFrame
GAP
GAP - No equivalent to mime type handlers.
NaCl apps can be registered to handle a particular mime type and own the whole document.
PPB_MediaStreamAudioTrack
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
Configure
GAP
GAP - No equivalent
GetAttrib
GAP
MediaStreamSettings.channelCount
GAP
MediaStreamSettings.sampleSize
GAP
MediaStreamSettings.sampleRate
GAP
GAP - no equivalent to PP_MEDIASTREAMAUDIOTRACK_ATTRIB_BUFFERS
GAP
GAP - no equivalent to PP_MEDIASTREAMAUDIOTRACK_ATTRIB_DURATION
GetId
GAP
MediaStream.id
HasEnded
GAP
MediaStream.ended
GetBuffer
GAP
GAP - No equivalent
RecycleBuffer
GAP
GAP - No equivalent
Close
GAP
GAP - No equivalent
PPB_MediaStreamVideoTrack
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
Create
GAP
GAP - No equivalent
Ability to create synthetic stream.
Configure
GAP
GAP - No equivalent
GetAttrib
GAP
MediaStreamSettings.width
GAP
MediaStreamSettings.height
GAP
GAP - no equivalent to PP_MEDIASTREAMVIDEOTRACK_ATTRIB_BUFFERED_FRAMES
GAP
GAP - no equivalent to PP_MEDIASTREAMVIDEOTRACK_ATTRIB_FORMAT
GetId
GAP
MediaStream.id
HasEnded
GAP
MediaStream.ended
GetFrame
GAP
GAP - No equivalent
RecycleFrame
GAP
GAP - No equivalent
Close
GAP
GAP - No equivalent
GetEmptyFrame
GAP
GAP - No equivalent
PutFrame
GAP
GAP - No equivalent
PPB_MessageLoop
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
Create
N/A
Mostly moot, workers get an implicit event loop.
GetForMainThread
N/A
Mostly moot, workers get an implicit event loop.
GetCurrent
N/A
Mostly moot, workers get an implicit event loop.
AttachToCurrentThread
N/A
Mostly moot, workers get an implicit event loop.
Run
N/A
Mostly moot, workers get an implicit event loop.
PostWork
N/A
Mostly moot, workers get an implicit event loop.
PostQuit
N/A
Mostly moot, workers get an implicit event loop.
PPB_Messaging
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
PostMessage
N/A
Window.postMessage
RegisterMessageHandler
N/A
Window.addEventListener
UnregisterMessageHandler
N/A
Window.removeEventListener
PPB_MouseCursor
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
SetCursor
SDL
Element.style.cursor
Same set of stock cursors are supported. Custom cursors can be done with url(..). Dynamic custom cursors can be done with data URIs. CSS3 supports specifying the hotspot.
PPB_MouseLock
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
LockMouse
SDL
Element.requestPointerLock
UnlockMouse
SDL
Element.exitPointerLock
PPB_OpenGLES2
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
Several Methods
OpenGLES
Close to WebGL 1.0 in functionality.
x
GAP - Without offscreen canvas, rendering must be done on the main thread.
PPB_TextInputController
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
SetTextInputType
GAP
GAP - No equivalent hints to browser about canvas containing input.
Some developers would like to either be able to hint in this fashion, or preferably the ability to intercept and display IME events / output inline inside a canvas.
UpdateCaretPosition
GAP
GAP - No equivalent hints to browser about canvas containing input.
CancelCompositionText
GAP
GAP - No equivalent hints to browser about canvas containing input.
UpdateSurroundingText
GAP
GAP - No equivalent hints to browser about canvas containing input.
PPB_URLLoader
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
Create
embind
new XMLHttpRequest();
Open
embind
XMLHttpRequest.open
FollowRedirect
embind
Request.redirect
GAP
GAP - No XMLHTTPRequest equivalent
GetUploadProgress
embind
XMLHttpRequest 'progress' Event
GAP
GAP - No Fetch API equivalent
GetDownloadProgress
embind
XMLHttpRequest 'progress' Event
GAP
GAP - No Fetch API equivalent
GetResponseInfo
embind
XMLHttpRequest.getAllResponseHeaders
embind
Fetch Response.*
ReadResponseBody
embind
XMLHttpRequest.response
embind
Body.* (Response is a Body)
FinishStreamingToFile
embind
GAP - No direct equivalent
XMLHttpRequest and Fetch both assume streaming to memory, rather than directly to a storage.
Close
embind
XMLHttpRequest.abort
GAP
GAP - No Fetch API equivalent
PPB_URLRequestInfo
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
Create
embind
XMLHttpRequest
embind
Fetch Request
No way to stream to a file.
SetProperty
GAP
GAP - No direct equivalent for XMLHttpRequest
XMLHttpRequest doesn't provide direct ways to per-request limit following redirects, stream to a file, set referrer or credentials policy.
embind
Request.*
AppendDataToBody
embind
XMLHttpRequest.send
GAP - Both must have the whole body, rather than a chunk.
embind
fetch(.., options:body)
AppendFileToBody
GAP
GAP - No direct equivalent
N/A
<form>
You can also read with FileReader and upload, but that's more like AppendDataToBody
PPB_URLResponseInfo
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
GetProperty
embind
XMLHttpRequest.getAllResponseHeaders + others
embind
Fetch Response.*
GetBodyAsFileRef
embind
Fetch Response (Body) .blob()
Assumes storage layer optimizes transfer.
PPB_Var
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
VarFromUtf8
embind
TextDecoder.decode
VarToUtf8
embind
TextEncoder.encode
VarFromResource
N/A
N/A
VarToResource
N/A
N/A
PPB_VarArray
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
Get
embind
Array[i]
Set
embind
Array[i] = x
GetLength
embind
Array.length
SetLength
embind
Array.length = n
PPB_VarArrayBuffer
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
Create
embind
new ArrayBuffer(n)
ByteLength
embind
ArrayBuffer.byteLength
Map
GAP
GAP - No direct equivalent
Asm.js / Wasm modules are unable to map regions of an ArrayBuffer other than their single linear memory heap. Future multiple memories or memory mapping might improve this.
Unmap
GAP
GAP - No direct equivalent
PPB_VarDictionary
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
Create
embind
{}
Get
embind
<Object>[i]
Set
embind
<Object>[i] = x
Delete
embind
delete <Object>[i]
HasKey
embind
x in <Object>
GetKeys
embind
for (k in <Object>) {}
No literal equivalent, but it can be built.
PPB_VideoDecoder
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
Create
GAP
GAP - No equivalent
Initialize
GAP
GAP - No equivalent
Decode
GAP
GAP - No equivalent
GetPicture
GAP
GAP - No equivalent
RecyclePicture
GAP
GAP - No equivalent
Flush
GAP
GAP - No equivalent
Reset
GAP
GAP - No equivalent
PPB_VideoEncoder
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
Create
GAP
GAP - No equivalent
Overlap with MediaRecorder API, but not exact.
GetSupportedProfiles
GAP
GAP - No equivalent
Initialize
GAP
GAP - No equivalent
GetFramesRequired
GAP
GAP - No equivalent
GetFrameCodedSize
GAP
GAP - No equivalent
GetVideoFrame
GAP
GAP - No equivalent
Encode
GAP
GAP - No equivalent
GetBitstreamBuffer
GAP
GAP - No equivalent
RecycleBitstreamBuffer
GAP
GAP - No equivalent
RequestEncodingParametersChange
GAP
GAP - No equivalent
Close
GAP
GAP - No equivalent
PPB_VideoFrame
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
GetTimestamp
GAP
GAP - No equivalent
SetTimestamp
GAP
GAP - No equivalent
GetFormat
GAP
GAP - No equivalent
GetSize
GAP
GAP - No equivalent
GetDataBuffer
GAP
GAP - No equivalent
GetDataBufferSize
GAP
GAP - No equivalent
PPB_View
PPAPI Method
Assumes Threads
Emscripten
Web API
Limitations
GetRect
embind
Element.getBoundingClientRect
IsFullscreen
embind
Document.fullScreenEnabled
Pertains to document instead of just single element.