diff options
| author | Andre Weissflog <floooh@gmail.com> | 2023-10-26 19:58:05 +0200 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2023-10-26 19:58:05 +0200 |
| commit | 85d65418c145b2b809498122d0d2bb75e4a96573 (patch) | |
| tree | 4f25c1bd3810eb847afc8c39bbd1b0fa33773811 | |
| parent | 4eb208b2d9a0eb87567f0817551ecea2934d7bcb (diff) | |
sokol_gfx.h gl win32: important regression fix in GL context setup
| -rw-r--r-- | CHANGELOG.md | 8 | ||||
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | sokol_app.h | 9 |
3 files changed, 12 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b0c3fa5..d920f373 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ ## Updates +#### 26-Oct-2023 + +- sokol_app.h gl: fix a regression introduced in https://github.com/floooh/sokol/pull/916 + which could select the wrong framebuffer pixel format and break rendering + on some GL drivers (in my case: an older Intel GPU). + + If you are using the GL backend on Windows, please make sure to upgrade! + #### 23-Oct-2023 - sokol_app.h gl: some further startup optimizations in the WGL code path @@ -4,7 +4,7 @@ Simple [STB-style](https://github.com/nothings/stb/blob/master/docs/stb_howto.txt) cross-platform libraries for C and C++, written in C. -[**See what's new**](https://github.com/floooh/sokol/blob/master/CHANGELOG.md) (**21-Oct-2023** WebGPU!) +[**See what's new**](https://github.com/floooh/sokol/blob/master/CHANGELOG.md) (**26-Oct-2023** IMPORTANT REGRESSION FIX FOR GL ON WINDOWS!) [](/../../actions/workflows/main.yml) [](/../../actions/workflows/gen_bindings.yml) [](https://github.com/floooh/sokol-zig/actions/workflows/main.yml) [](https://github.com/floooh/sokol-nim/actions/workflows/main.yml) [](https://github.com/floooh/sokol-odin/actions/workflows/main.yml)[](https://github.com/floooh/sokol-rust/actions/workflows/main.yml) diff --git a/sokol_app.h b/sokol_app.h index 3b6602b0..3b811607 100644 --- a/sokol_app.h +++ b/sokol_app.h @@ -6799,8 +6799,6 @@ _SOKOL_PRIVATE int _sapp_wgl_find_pixel_format(void) { desired.samples = (_sapp.sample_count > 1) ? _sapp.sample_count : 0; int pixel_format = 0; - _sapp_gl_fbconfig u; - _sapp_gl_init_fbconfig(&u); _sapp_gl_fbselect fbselect; _sapp_gl_init_fbselect(&fbselect); @@ -6816,16 +6814,15 @@ _SOKOL_PRIVATE int _sapp_wgl_find_pixel_format(void) { continue; } + _sapp_gl_fbconfig u; + _sapp_clear(&u, sizeof(u)); u.red_bits = query_results[result_red_bits_index]; u.green_bits = query_results[result_green_bits_index]; u.blue_bits = query_results[result_blue_bits_index]; u.alpha_bits = query_results[result_alpha_bits_index]; u.depth_bits = query_results[result_depth_bits_index]; u.stencil_bits = query_results[result_stencil_bits_index]; - if (query_results[result_double_buffer_index]) { - u.doublebuffer = true; - } - + u.doublebuffer = 0 != query_results[result_double_buffer_index]; u.samples = query_results[result_samples_index]; // NOTE: If arb_multisample is not supported - just takes the default 0 // Test if this pixel format is better than the previous one |