Unlocks platform-specific attributes
This commit is contained in:
parent
86dd75f7e9
commit
ec76d991ad
13 changed files with 92 additions and 17 deletions
|
|
@ -22,6 +22,9 @@ use api::x11::XConnection;
|
|||
use api::x11::XError;
|
||||
use api::x11::XNotSupported;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct PlatformSpecificWindowBuilderAttributes;
|
||||
|
||||
enum Backend {
|
||||
X(Arc<XConnection>),
|
||||
Wayland,
|
||||
|
|
@ -172,7 +175,8 @@ impl<'a> Iterator for WaitEventsIterator<'a> {
|
|||
impl Window {
|
||||
#[inline]
|
||||
pub fn new(window: &WindowAttributes, pf_reqs: &PixelFormatRequirements,
|
||||
opengl: &GlAttributes<&Window>) -> Result<Window, CreationError>
|
||||
opengl: &GlAttributes<&Window>, _: &PlatformSpecificWindowBuilderAttributes)
|
||||
-> Result<Window, CreationError>
|
||||
{
|
||||
match *BACKEND {
|
||||
Backend::Wayland => {
|
||||
|
|
|
|||
|
|
@ -12,13 +12,19 @@ use api::osmesa::{self, OsMesaContext};
|
|||
|
||||
pub use self::api_dispatch::{Window, WindowProxy, MonitorId, get_available_monitors, get_primary_monitor};
|
||||
pub use self::api_dispatch::{WaitEventsIterator, PollEventsIterator};
|
||||
pub use self::api_dispatch::PlatformSpecificWindowBuilderAttributes;
|
||||
mod api_dispatch;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct PlatformSpecificHeadlessBuilderAttributes;
|
||||
|
||||
pub struct HeadlessContext(OsMesaContext);
|
||||
|
||||
impl HeadlessContext {
|
||||
pub fn new(dimensions: (u32, u32), pf_reqs: &PixelFormatRequirements,
|
||||
opengl: &GlAttributes<&HeadlessContext>) -> Result<HeadlessContext, CreationError>
|
||||
opengl: &GlAttributes<&HeadlessContext>,
|
||||
_: &PlatformSpecificHeadlessBuilderAttributes)
|
||||
-> Result<HeadlessContext, CreationError>
|
||||
{
|
||||
let opengl = opengl.clone().map_sharing(|c| &c.0);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue