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 {
|
||||
fn create() -> Self;
|
||||
fn init() {}
|
||||
|
||||
type GlslCompileContext;
|
||||
type GlslProgram;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
use glium::{Display, Program, ProgramCreationError};
|
||||
use wedge_core::Platform;
|
||||
|
||||
pub struct DesktopPlatform {}
|
||||
|
||||
impl Platform for DesktopPlatform {
|
||||
fn create() -> Self {
|
||||
DesktopPlatform {}
|
||||
pub struct DesktopPlatform {
|
||||
}
|
||||
|
||||
impl DesktopPlatform {
|
||||
pub fn new() -> Self {
|
||||
DesktopPlatform {}
|
||||
}
|
||||
}
|
||||
|
||||
impl Platform for DesktopPlatform {
|
||||
type GlslCompileContext = Display;
|
||||
type GlslProgram = Program;
|
||||
type GlslError = ProgramCreationError;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue