MCPcopy Create free account
hub / github.com/StereoKit/StereoKit / platform_win_get_existing

Function platform_win_get_existing

StereoKitC/platforms/web.cpp:333–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331///////////////////////////////////////////
332
333platform_win_t platform_win_get_existing(platform_surface_ surface_type) {
334 const sk_settings_t* settings = sk_get_settings_ref();
335 window_t* win = &web_window;
336
337 // Not all windows need a swapchain, but here's where we make 'em for those
338 // that do.
339 if (surface_type == platform_surface_swapchain) {
340 skg_tex_fmt_ color_fmt = skg_tex_fmt_rgba32_linear;
341 skg_tex_fmt_ depth_fmt = (skg_tex_fmt_)render_preferred_depth_fmt();
342
343 win->swapchain = skg_swapchain_create(nullptr, color_fmt, depth_fmt, settings->flatscreen_width, settings->flatscreen_height);
344 win->has_swapchain = true;
345
346 log_diagf("Created swapchain: %dx%d color:%s depth:%s", win->swapchain.width, win->swapchain.height, render_fmt_name((tex_format_)color_fmt), render_fmt_name((tex_format_)depth_fmt));
347 }
348 return 1;
349}
350
351///////////////////////////////////////////
352

Callers 2

window_initFunction · 0.50
simulator_initFunction · 0.50

Calls 5

sk_get_settings_refFunction · 0.85
skg_swapchain_createFunction · 0.85
log_diagfFunction · 0.85
render_fmt_nameFunction · 0.85

Tested by

no test coverage detected