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::Context
and an associatedglutin::Window
which are constructed fromglutin::ContextBuilder
s andglutin::WindowBuilder
s, respectively -
glutin::HeadlessContext
-- simply implements theglutin::GlContext
trait; constructed fromglutin::HeadlessRendererBuilder
s -
glutin::Context
-- an OpenGL context associated with a singleWindow
or shared between multiple windows; implementsglutin::GlContext
and is constructed byglutin::ContextBuilder
-
glutin::Window
-- represents a window with associatedEventsLoop
; can be built directly from a newglutin::EventsLoop
or by passing it toglutin::WindowBuilder::build
, or by passing theglutin::WindowBuilder
itself (which configures aglutin::WindowAttributes
struct) 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 newContext
that is not yet shared can be only be acquired by passing aglutin::ContextBuilder
(which configures aglutin::GlAttributes
struct) 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::GlWindow
and aglium::backend::Context
-
glium::HeadlessRenderer
-- (re-export ofglium::backend::glutin::headless::Headless
) aglium::backend::Context
without an associated window
Traits:
glium::backend::Facade
-- a trait providing safe access for glium functions, implemented byglium::backend::Context
and indirectly (via deref to a context) forglium::Display
andglium::Headlessrenderer
[Traits ] Facade CapabilitiesSource Surface
/\ \ /\ /\
|| \------\\\\|| ||
[Structs] GlWindow ==> Display ====> Context =======> Frame
HeadlessContext ==> Headless ====> \\\\==========> DefaultFramebuffer
\\\==========> EmptyFramebuffer,
\\==========> SimpleFramebuffer,
\==========> MultiOutputFramebuffer