Movatterモバイル変換


[0]ホーム

URL:


Docs.rs

Crateglutin

source ·
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 headlessContexts 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.
  • TheEvent enum and assorted supporting types.
  • TheEventLoop struct and assorted supporting types, includingControlFlow.
  • Types useful for interacting with a user’s monitors.
  • Contains traits with platform-specific methods in them.
  • TheWindow struct and associated types.

Structs

Enums

  • All APIs related to OpenGL that you can possibly get while using glutin.
  • Error that can happen when manipulating an OpenGLContext.
  • Error that can happen while creating a window or a headless renderer.
  • Describes the requested OpenGLContext profiles.
  • Describes the OpenGL API and version that are being requested when a contextis created.
  • A type thatContexts 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 OpenGLContext 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

Type Definitions


[8]ページ先頭

©2009-2025 Movatter.jp