Struct dmc::display::Display
[−]
[src]
pub struct Display(_);
A handle to the platform-specific display backend.
On X11, for instance, it wraps a connection to the X server.
Methods
impl<'dpy> Display
[src]
fn open() -> Result<Self, Error>
Attempts to get one handle to the platform-specific display backend.
You should need only one.
fn open_x11_display_name(name: Option<&CStr>) -> Result<Self, Error>
X11-only specialization of open()
where you can specify
the name given to XOpenDisplay()
.
fn create_window(&'dpy self, settings: &Settings) -> Result<Window<'dpy>, Error>
Attempts to create a Window
with the given settings.
fn create_window_and_show(
&'dpy self,
settings: &Settings
) -> Result<Window<'dpy>, Error>
&'dpy self,
settings: &Settings
) -> Result<Window<'dpy>, Error>
Same as create_window()
, but immediately shows the window afterwards
if it succeeds.
fn create_gl_context(
&'dpy self,
settings: &GLContextSettings
) -> Result<GLContext<'dpy>, Error>
&'dpy self,
settings: &GLContextSettings
) -> Result<GLContext<'dpy>, Error>
Attempts to create a backend-specific OpenGL context.
fn create_software_gl_context(
&'dpy self,
settings: &GLContextSettings
) -> Result<GLContext<'dpy>, Error>
&'dpy self,
settings: &GLContextSettings
) -> Result<GLContext<'dpy>, Error>
Sames as create_gl_context()
, but attempts to get a
context that is not hardware-accelerated (on some platforms, this
might try to load the Mesa driver).
The use case for this is simple apps that don't specifically need a
lot of perf, and would rather prefer saving battery power.
This won't attempt to fall back to the default implementation - in other words, this will succeed only if it is certain that there is a software implementation available AND a context could be created out of it.
fn create_gl_context_from_lib<P: AsRef<Path>>(
&'dpy self,
_settings: &GLContextSettings,
_path: P
) -> Result<GLContext<'dpy>, Error>
&'dpy self,
_settings: &GLContextSettings,
_path: P
) -> Result<GLContext<'dpy>, Error>
Attempts to create an OpenGL context from a dynamically-loaded library.