CoglOnscreenTemplate * cogl_onscreen_template_new (CoglSwapChain *swap_chain) { CoglOnscreenTemplate *onscreen_template = g_slice_new0 (CoglOnscreenTemplate); char *user_config; onscreen_template->config.swap_chain = swap_chain; if (swap_chain) cogl_object_ref (swap_chain); else onscreen_template->config.swap_chain = cogl_swap_chain_new (); onscreen_template->config.swap_throttled = TRUE; onscreen_template->config.need_stencil = TRUE; onscreen_template->config.samples_per_pixel = 0; user_config = getenv ("COGL_POINT_SAMPLES_PER_PIXEL"); if (user_config) { unsigned long samples_per_pixel = strtoul (user_config, NULL, 10); if (samples_per_pixel != ULONG_MAX) onscreen_template->config.samples_per_pixel = samples_per_pixel; } return _cogl_onscreen_template_object_new (onscreen_template); }
CoglOnscreenTemplate * cogl_onscreen_template_new (CoglSwapChain *swap_chain) { CoglOnscreenTemplate *onscreen_template = g_slice_new0 (CoglOnscreenTemplate); onscreen_template->swap_chain = swap_chain; if (swap_chain) cogl_object_ref (swap_chain); return _cogl_onscreen_template_object_new (onscreen_template); }