Module gl_utils::info [−][src]
Functions for writing various glium and glutin context info to a file
handle.
glutin
The main datatypes in glutin are the glutin::GlWindow and
glutin::HeadlessContext, both of which implement the glutin::GlContext
trait:
-
glutin::GlWindow-- aglutin::Contextand an associatedglutin::Windowwhich are constructed fromglutin::ContextBuilders andglutin::WindowBuilders, respectively -
glutin::HeadlessContext-- simply implements theglutin::GlContexttrait; constructed fromglutin::HeadlessRendererBuilders -
glutin::Context-- an OpenGL context associated with a singleWindowor shared between multiple windows; implementsglutin::GlContextand is constructed byglutin::ContextBuilder -
glutin::Window-- represents a window with associatedEventsLoop; can be built directly from a newglutin::EventsLoopor by passing it toglutin::WindowBuilder::build, or by passing theglutin::WindowBuilderitself (which configures aglutin::WindowAttributesstruct) toglutin::GlWindow::new -
glutin::EventsLoop-- retrieves events from the system and from the windows that were registered to the events loop
Traits:
glutin::GlContext-- represents an OpenGL context that can be shared between multiple windows; a newContextthat is not yet shared can be only be acquired by passing aglutin::ContextBuilder(which configures aglutin::GlAttributesstruct) toglutin::GlWindow::new
[Traits ] GlContext
/\
||
[Structs] GlAttributes ==> HeadlessContext
GlAttributes ==> Context
+ WindowAttributes ==> GlWindow
GlContext --> PixelFormat
--> Api
--> is_current(), make_current()
--> get_proc_address()
--> resize()
--> swap_buffers()
glutin::PixelFormat -- of a GlContext is the pixel format of the main
framebuffer.
glutin::Api -- indicates whether OpenGl, OpenGlEs, or WebGl is
being used
is_current, make_current -- queries and sets whether this context is
the current one in this thread
get_proc_address -- required method for getting addresses of OpenGL
functions used internally
resize -- required for contexts on some platforms (macOS, Wayland) to be
manually updated when their window or surface is resized, i.e. it
resize should be called for each Resized window event that is received
swap_buffers -- according to the documentation for glutin 0.12.0
(https://docs.rs/glutin/0.12.0/glutin/trait.GlContext.html#tymethod.swap_buffers),
drivers may choose to override vsync settings to it is not possible to know
in advance whether swap_buffers() will block or not.
glium
Glium extends the glutin::GlWindow and glutin::HeadlessContext datatypes
with the glium::Display and glium::HeadlessRenderer datatypes, both of
which dereference to a glium::backend::Context which is an implementor of
glium::backend::Facade:
-
glium::Display-- (re-export ofglium::backend::glutin::Display) a combination of aglutin::GlWindowand aglium::backend::Context -
glium::HeadlessRenderer-- (re-export ofglium::backend::glutin::headless::Headless) aglium::backend::Contextwithout an associated window
Traits:
glium::backend::Facade-- a trait providing safe access for glium functions, implemented byglium::backend::Contextand indirectly (via deref to a context) forglium::Displayandglium::Headlessrenderer
[Traits ] Facade CapabilitiesSource Surface
/\ \ /\ /\
|| \------\\\\|| ||
[Structs] GlWindow ==> Display ====> Context =======> Frame
HeadlessContext ==> Headless ====> \\\\==========> DefaultFramebuffer
\\\==========> EmptyFramebuffer,
\\==========> SimpleFramebuffer,
\==========> MultiOutputFramebuffer