Expand description
The purpose of this library is to provide an OpenGLContext
on as manyplatforms as possible.
Building aWindowedContext<T>
AWindowedContext<T>
is composed of aWindow
and an OpenGLContext
.
Due to some operating-system-specific quirks, glutin prefers control overthe order of creation of theContext
andWindow
. Here is an exampleof building aWindowedContext<T>
:
letel = glutin::event_loop::EventLoop::new();letwb = glutin::window::WindowBuilder::new() .with_title("Hello world!") .with_inner_size(glutin::dpi::LogicalSize::new(1024.0,768.0));letwindowed_context = glutin::ContextBuilder::new() .build_windowed(wb,&el) .unwrap();
You can, of course, create aRawContext<T>
separately from an existingwindow, however that may result in an suboptimal configuration of the windowon some platforms. In that case use the unsafe platform-specificRawContextExt
available on unix operating systems and Windows.
You can also produce headlessContext
s via theContextBuilder::build_headless
function.
Modules
- UI scaling is important, so read the docs for this module if you don’t want to be confused.
- The
Event
enum and assorted supporting types. - The
EventLoop
struct and assorted supporting types, includingControlFlow
. - Types useful for interacting with a user’s monitors.
- Contains traits with platform-specific methods in them.
- The
Window
struct and associated types.
Structs
- Represents an OpenGL
Context
. - A context which has an underlying window, which may or may not be storedseparately.
- Attributes to use when creating an OpenGL
Context
. - Describes a possible format.
- Describes how the backend should choose a pixel format.
- A type that
Context
s which might possibly be currently current on somethread take as a generic.
Enums
- All APIs related to OpenGL that you can possibly get while using glutin.
- Error that can happen when manipulating an OpenGL
Context
. - Error that can happen while creating a window or a headless renderer.
- Describes the requested OpenGL
Context
profiles. - Describes the OpenGL API and version that are being requested when a contextis created.
- A type that
Context
s which are not currently current on any thread takeas a generic. - The behavior of the driver when you change the current context.
- Specifies the tolerance of the OpenGL
Context
to faults. If you acceptraw OpenGL commands and/or raw shader code from an untrusted source, youshould definitely care about this.
Statics
- The minimum core profile GL context. Useful for getting the minimumrequired GL version while still running on OSX, which often forbidsthe compatibility profile features.
Traits
- A trait implemented on both
NotCurrent
andPossiblyCurrent
.
Type Definitions
- Represents an OpenGL
Context
which has an underlying window that isstored separately.