1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 22:30:03 -04:00

Fix wrong gamma in WebkitGTK (#888)

Closes https://github.com/emilk/egui/issues/794

Also refactor and improve VAO support detection

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This commit is contained in:
triangle drawer
2021-11-13 11:32:01 +00:00
committed by GitHub
parent 4d4c75c6f1
commit 008a971e73
11 changed files with 115 additions and 22 deletions

View File

@@ -184,7 +184,8 @@ impl VAO {
}
}
pub(crate) unsafe fn need_to_emulate_vao(gl: &glow::Context) -> bool {
/// If returned true no need to emulate vao
pub(crate) unsafe fn support_vao(gl: &glow::Context) -> bool {
let web_sig = "WebGL ";
let es_sig = "OpenGL ES ";
let version_string = gl.get_parameter_string(glow::VERSION);
@@ -200,7 +201,7 @@ pub(crate) unsafe fn need_to_emulate_vao(gl: &glow::Context) -> bool {
gl.supported_extensions()
.contains("OES_vertex_array_object")
} else {
false
true
}
} else if let Some(pos) = version_string.rfind(es_sig) {
//glow targets es2.0+ so we don't concern about OpenGL ES-CM,OpenGL ES-CL
@@ -214,7 +215,7 @@ pub(crate) unsafe fn need_to_emulate_vao(gl: &glow::Context) -> bool {
gl.supported_extensions()
.contains("OES_vertex_array_object")
} else {
false
true
}
} else {
glow_debug_print(format!("detected OpenGL:{}", version_string));
@@ -225,7 +226,7 @@ pub(crate) unsafe fn need_to_emulate_vao(gl: &glow::Context) -> bool {
gl.supported_extensions()
.contains("ARB_vertex_array_object")
} else {
false
true
}
}
}