Go to the source code of this file.
◆ DemoKind
Enumerator |
---|
SOLID_COLOR | |
GRADIENT | |
RUNTIME_EFFECT | |
Definition at line 60 of file bindings.cpp.
◆ EMSCRIPTEN_BINDINGS()
EMSCRIPTEN_BINDINGS |
( |
Skia |
| ) |
|
Definition at line 194 of file bindings.cpp.
194 {
195 emscripten::enum_<DemoKind>("DemoKind")
199 emscripten::class_<Demo>("Demo")
200 .constructor()
204}
bool init(std::string canvasSelector, int width, int height)
void setKind(DemoKind kind)
◆ getSwapChainForCanvas()
static wgpu::SwapChain getSwapChainForCanvas |
( |
wgpu::Device |
device, |
|
|
std::string |
canvasSelector, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
|
static |
Definition at line 39 of file bindings.cpp.
42 {
43 wgpu::SurfaceDescriptorFromCanvasHTMLSelector surfaceSelector;
44 surfaceSelector.selector = canvasSelector.c_str();
45
46 wgpu::SurfaceDescriptor surface_desc;
47 surface_desc.nextInChain = &surfaceSelector;
50
51 wgpu::SwapChainDescriptor swap_chain_desc;
52 swap_chain_desc.format = wgpu::TextureFormat::BGRA8Unorm;
53 swap_chain_desc.usage = wgpu::TextureUsage::RenderAttachment;
54 swap_chain_desc.presentMode = wgpu::PresentMode::Fifo;
55 swap_chain_desc.width =
width;
56 swap_chain_desc.height =
height;
58}