From 70d28b43f174f81dd9fdc679b8adce24601f779a Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Mon, 8 Jun 2020 02:40:49 -0500 Subject: [PATCH] wip --- core/src/platform.rs | 2 +- desktop/src/main.rs | 2 +- desktop/src/platform.rs | 9 ++++++--- web/src/platform.rs | 6 ++++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/core/src/platform.rs b/core/src/platform.rs index 73d58e6..9e233c0 100644 --- a/core/src/platform.rs +++ b/core/src/platform.rs @@ -1,5 +1,5 @@ pub trait Platform { - fn create() -> Self; + fn init() {} type GlslCompileContext; type GlslProgram; diff --git a/desktop/src/main.rs b/desktop/src/main.rs index f53d841..0f48f55 100644 --- a/desktop/src/main.rs +++ b/desktop/src/main.rs @@ -5,6 +5,6 @@ use wedge_core::Platform; use crate::platform::DesktopPlatform; fn main() { - let platform = DesktopPlatform::create(); + let platform = DesktopPlatform::new(); wedge_core::run_with(platform); } diff --git a/desktop/src/platform.rs b/desktop/src/platform.rs index 3dc7fd5..1fe7ccf 100644 --- a/desktop/src/platform.rs +++ b/desktop/src/platform.rs @@ -1,13 +1,16 @@ use glium::{Display, Program, ProgramCreationError}; use wedge_core::Platform; -pub struct DesktopPlatform {} +pub struct DesktopPlatform { +} -impl Platform for DesktopPlatform { - fn create() -> Self { +impl DesktopPlatform { + pub fn new() -> Self { DesktopPlatform {} } +} +impl Platform for DesktopPlatform { type GlslCompileContext = Display; type GlslProgram = Program; type GlslError = ProgramCreationError; diff --git a/web/src/platform.rs b/web/src/platform.rs index 26e4c65..30bf12d 100644 --- a/web/src/platform.rs +++ b/web/src/platform.rs @@ -5,11 +5,13 @@ use wedge_core::Platform; pub struct WebPlatform {} -impl Platform for WebPlatform { - fn create() -> Self { +impl WebPlatform { + pub fn new() -> Self { WebPlatform {} } +} +impl Platform for WebPlatform { // TODO: don't use strings lol type GlslCompileContext = WebGlRenderingContext; type GlslProgram = WebGlProgram;