Expand description
The purpose of this library is to provide an OpenGL context on as many platforms as possible.
§Building a window
There are two ways to create a window:
- Calling
Window::new()
. - Calling
let builder = WindowBuilder::new()
thenbuilder.build()
.
The first way is the simpliest way and will give you default values.
The second way allows you to customize the way your window and GL context will look and behave.
§Features
This crate has two Cargo features: window
and headless
.
window
allows you to create regular windows and enables theWindowBuilder
object.headless
allows you to do headless rendering, and enables theHeadlessRendererBuilder
object.
By default only window
is enabled.
Modules§
- os
- Contains traits with platform-specific methods in them.
Structs§
- Available
Monitors Iter - An iterator for the list of available monitors.
- GlAttributes
- Attributes to use when creating an OpenGL context.
- Headless
Context - Represents a headless OpenGL context.
- Headless
Renderer Builder - Object that allows you to build headless contexts.
- Monitor
Id - Identifier for a monitor.
- Pixel
Format - Describes a possible format. Unused.
- Pixel
Format Requirements - Describes how the backend should choose a pixel format.
- Poll
Events Iterator - An iterator for the
poll_events
function. - Touch
- Represents touch event
- Wait
Events Iterator - An iterator for the
wait_events
function. - Window
- Represents an OpenGL context and the Window or environment around it.
- Window
Attributes - Attributes to use when creating a window.
- Window
Builder - Object that allows you to build windows.
- WindowID
- A wrapper for a native window pointer.
- Window
Proxy - Represents a thread safe subset of operations that can be called on a window. This structure can be safely cloned and sent between threads.
Enums§
- Api
- All APIs related to OpenGL that you can possibly get while using glutin.
- Context
Error - Error that can happen when manipulating an OpenGL context.
- Creation
Error - Error that can happen while creating a window or a headless renderer.
- Cursor
State - Describes how glutin handles the cursor.
- Element
State - Event
- GlProfile
- Describes the requested OpenGL context profiles.
- GlRequest
- Describes the OpenGL API and version that are being requested when a context is created.
- Mouse
Button - Mouse
Cursor - Mouse
Scroll Delta - Native
Monitor Id - Native platform identifier for a monitor. Different platforms use fundamentally different types to represent a monitor ID.
- Release
Behavior - The behavior of the driver when you change the current context.
- Robustness
- Specifies the tolerance of the OpenGL context to faults. If you accept raw OpenGL commands and/or raw shader code from an untrusted source, you should definitely care about this.
- Touch
Phase - Virtual
KeyCode
Statics§
- GL_CORE
- The minimum core profile GL context. Useful for getting the minimum required GL version while still running on OSX, which often forbids the compatibility profile features.
Traits§
- GlContext
- Trait that describes objects that have access to an OpenGL context.
Functions§
- get_
available_ monitors - Returns the list of all available monitors.
- get_
primary_ monitor - Returns the primary monitor of the system.