@@ -10,19 +10,14 @@ use crate::ecs::components::base::C_Spatial2D;
10
10
use crate :: ecs:: components:: gfx:: C_Renderable ;
11
11
use crate :: ecs:: components:: transform:: C_Transform2D ;
12
12
use crate :: gfx;
13
- use crate :: gfx:: ui:: UI_Request ;
13
+ use crate :: gfx:: ui:: { UI_Request , UI_System } ;
14
14
use crate :: resources;
15
15
use std:: cell:: Ref ;
16
16
use std:: sync:: mpsc:: { Receiver , Sender } ;
17
17
use std:: sync:: { Arc , Mutex } ;
18
18
use std:: thread:: { self , JoinHandle } ;
19
19
use std:: time:: Duration ;
20
20
21
- pub struct Render_System {
22
- config : Render_System_Config ,
23
- pub camera : C_Spatial2D , // TODO figure out where to put this
24
- }
25
-
26
21
pub struct Render_System_Config {
27
22
pub clear_color : Color ,
28
23
}
@@ -56,7 +51,7 @@ fn render_loop(
56
51
let mut time = Time :: new ( ) ;
57
52
let mut gres = resources:: gfx:: Gfx_Resources :: new ( ) ;
58
53
let mut input_system = Input_System :: new ( input_actions_tx) ;
59
- let mut ui_system = gfx :: ui :: UI_System :: new ( ui_req_rx) ;
54
+ let mut ui_system = UI_System :: new ( ui_req_rx) ;
60
55
61
56
ui_system. init ( & env, & mut gres) . unwrap ( ) ;
62
57
@@ -88,6 +83,11 @@ fn render_loop(
88
83
}
89
84
}
90
85
86
+ pub struct Render_System {
87
+ config : Render_System_Config ,
88
+ pub camera : C_Spatial2D ,
89
+ }
90
+
91
91
impl Render_System {
92
92
pub fn new ( ) -> Self {
93
93
Render_System {
@@ -102,6 +102,12 @@ impl Render_System {
102
102
}
103
103
}
104
104
105
+ pub fn init ( & mut self , cfg : Render_System_Config ) -> Maybe_Error {
106
+ self . config = cfg;
107
+ self . camera . transform . translate ( 150.0 , 100.0 ) ;
108
+ Ok ( ( ) )
109
+ }
110
+
105
111
pub fn update (
106
112
& mut self ,
107
113
window : & mut gfx:: window:: Window_Handle ,
0 commit comments