From 7d2a9db300f1cd8d53643d1ed7dfeebc2cfe5c36 Mon Sep 17 00:00:00 2001 From: mantasarm <34283640+mantasarm@users.noreply.github.com> Date: Tue, 10 Oct 2023 19:39:11 +0300 Subject: [PATCH 1/2] Fix for "extension to create ES context with wgl is not present" --- crates/notan_winit/src/gl_manager.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/notan_winit/src/gl_manager.rs b/crates/notan_winit/src/gl_manager.rs index da4ac8de..884b5cf1 100644 --- a/crates/notan_winit/src/gl_manager.rs +++ b/crates/notan_winit/src/gl_manager.rs @@ -205,7 +205,7 @@ struct InnerSupport { } fn check_support(required_samples: u8, needs_transparency: bool, conf: &GConfig) -> InnerSupport { - let req_samples = conf.num_samples() == required_samples; + let req_samples = conf.num_samples() == required_samples && required_samples != 0; let srgb = conf.srgb_capable(); let supports_transparency = conf.supports_transparency().unwrap_or(false); let transparency = if needs_transparency { From 00bb7960b24eb9fb2e742cb141a9747860d0a7ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nazari=CC=81=20Gonza=CC=81lez?= Date: Thu, 12 Oct 2023 20:21:02 +0100 Subject: [PATCH 2/2] changelog && clippy fixes --- CHANGELOG.md | 1 + crates/notan_macro/src/handlers.rs | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4201e46..39597572 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. ## UNRELEASED - Added traits `Serialize` and `Deserialize` to `Color` with the feature `serde` enabled. +- Fixed an error acquiring the GL Context due required samples configuration. ## v0.10.0 - 11/09/2023 diff --git a/crates/notan_macro/src/handlers.rs b/crates/notan_macro/src/handlers.rs index ed55051e..7f6cca43 100644 --- a/crates/notan_macro/src/handlers.rs +++ b/crates/notan_macro/src/handlers.rs @@ -124,7 +124,7 @@ fn enum_impl_generator(tokens: &Tokens, once: bool) -> String { .ret .as_ref() .map(|v| format!(" -> {v}")) - .unwrap_or_else(|| "".to_string()); + .unwrap_or_default(); let callback = enum_callback_generics(&combo(&tokens.params), &tokens.params); let reference = if once { "" } else { "&" }; @@ -171,7 +171,7 @@ fn trait_impl_generator(tokens: &Tokens, gen_type: GenericType, fn_literal: &str .ret .as_ref() .map(|v| format!(" -> {v}")) - .unwrap_or_else(|| "".to_string()); + .unwrap_or_default(); let s_type = match gen_type { GenericType::Plugin => "Plugin + 'static", @@ -252,8 +252,7 @@ fn enum_generics(g: &[Vec], r: Option<&String>, fn_literal: &str) -> Str "_{}(Box)", i, gen, - r.map(|v| format!(" -> {v}")) - .unwrap_or_else(|| "".to_string()) + r.map(|v| format!(" -> {v}")).unwrap_or_default() ) }) .collect::>()