-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[luminance-examples] Add a fixture to demonstrate #360.
- Loading branch information
1 parent
62d69e7
commit 84f7e58
Showing
2 changed files
with
37 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
integration-tests/desktop/src/manually_drop_framebuffer.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//! <https://github.com/phaazon/luminance-rs/issues/360> | ||
//! | ||
//! When a framebuffer is created, dropped and a new one is created, the new framebuffer doesn’t | ||
//! seem to behave correctly. At the time of #360, it was detected on Windows. | ||
//! | ||
//! Because this example simply creates a framebuffer, drops it and creates another one, nothing is | ||
//! displayed and the window flashes on the screen. Run the application in a tool such as apitrace | ||
//! or renderdoc to analyze it. | ||
use luminance::context::GraphicsContext as _; | ||
use luminance::pixel::{Depth32F, RGBA32F}; | ||
use luminance::texture::{Dim2, Sampler}; | ||
use luminance_glfw::GlfwSurface; | ||
use luminance_windowing::WindowOpt; | ||
|
||
pub fn fixture() { | ||
let mut surface = | ||
GlfwSurface::new_gl33("fixture-360", WindowOpt::default()).expect("GLFW surface"); | ||
|
||
let framebuffer = | ||
surface.new_framebuffer::<Dim2, RGBA32F, Depth32F>([1024, 1024], 0, Sampler::default()); | ||
|
||
std::mem::drop(framebuffer); | ||
|
||
// #360 occurs here after the drop | ||
let _ = surface.new_framebuffer::<Dim2, RGBA32F, Depth32F>([1024, 1024], 0, Sampler::default()); | ||
} |