Open johannes-adr opened 1 year ago
Thanks for the question! Here's an example from the test framework using Glutin on Linux:
let context_builder = glutin::ContextBuilder::new()
.with_gl_debug_flag(true)
.with_multisampling(0)
.with_gl(glutin::GlRequest::Specific(glutin::Api::OpenGl, (2, 0)));
let context = context_builder
.with_vsync(false)
.build_headless(&event_loop, PhysicalSize::new(width, height))
.unwrap();
let context = unsafe { context.make_current().unwrap() };
let mut renderer = unsafe {
GLRenderer::new_for_gl_context((width, height), |name| {
context.get_proc_address(name) as *const _
})
.unwrap()
};
I think this only works on Linux, so you may need to use something other than build_headless
on Mac and Windows.
Hello people,
I need a way to get a Graphics2D object without windows for my application. I want to further process the image buffer itself using the built-in caputer function. Is this possible? If yes, how would it work?
To be precise with my needs, i want to implement a hardware accelerated drawing backend for my plotting library. It should draw (with help of this library) and save the result to a bitmap file.