wip
This commit is contained in:
parent
d63beb5152
commit
70d28b43f1
4 changed files with 12 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
||||||
pub trait Platform {
|
pub trait Platform {
|
||||||
fn create() -> Self;
|
fn init() {}
|
||||||
|
|
||||||
type GlslCompileContext;
|
type GlslCompileContext;
|
||||||
type GlslProgram;
|
type GlslProgram;
|
||||||
|
|
|
@ -5,6 +5,6 @@ use wedge_core::Platform;
|
||||||
use crate::platform::DesktopPlatform;
|
use crate::platform::DesktopPlatform;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let platform = DesktopPlatform::create();
|
let platform = DesktopPlatform::new();
|
||||||
wedge_core::run_with(platform);
|
wedge_core::run_with(platform);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
use glium::{Display, Program, ProgramCreationError};
|
use glium::{Display, Program, ProgramCreationError};
|
||||||
use wedge_core::Platform;
|
use wedge_core::Platform;
|
||||||
|
|
||||||
pub struct DesktopPlatform {}
|
pub struct DesktopPlatform {
|
||||||
|
|
||||||
impl Platform for DesktopPlatform {
|
|
||||||
fn create() -> Self {
|
|
||||||
DesktopPlatform {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl DesktopPlatform {
|
||||||
|
pub fn new() -> Self {
|
||||||
|
DesktopPlatform {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Platform for DesktopPlatform {
|
||||||
type GlslCompileContext = Display;
|
type GlslCompileContext = Display;
|
||||||
type GlslProgram = Program;
|
type GlslProgram = Program;
|
||||||
type GlslError = ProgramCreationError;
|
type GlslError = ProgramCreationError;
|
||||||
|
|
|
@ -5,11 +5,13 @@ use wedge_core::Platform;
|
||||||
|
|
||||||
pub struct WebPlatform {}
|
pub struct WebPlatform {}
|
||||||
|
|
||||||
impl Platform for WebPlatform {
|
impl WebPlatform {
|
||||||
fn create() -> Self {
|
pub fn new() -> Self {
|
||||||
WebPlatform {}
|
WebPlatform {}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Platform for WebPlatform {
|
||||||
// TODO: don't use strings lol
|
// TODO: don't use strings lol
|
||||||
type GlslCompileContext = WebGlRenderingContext;
|
type GlslCompileContext = WebGlRenderingContext;
|
||||||
type GlslProgram = WebGlProgram;
|
type GlslProgram = WebGlProgram;
|
||||||
|
|
Loading…
Reference in a new issue