static WINDOW *win = NULL;
static Point2i winPos;
static Point2i winSize;
+int layer = 0;
void irndr_init()
{
void irndr_render()
{
wborder(win, '|', '|', '-', '-', '+', '+', '+', '+');
+ for(int i = 0; i < 20; ++i){
+ mvwprintw(win, 1, 1, "Viewing layer %d", layer);
+ }
wrefresh(win);
}
wborder(win, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ');
delwin(win);
}
+
+void irndr_set_layer(int l)
+{
+ layer = l;
+}
return true;
}
+void render()
+{
+ brndr_render();
+ irndr_render();
+}
+
int main()
{
int layer = 0;
brndr_set_board(board);
brndr_set_rendered_layer(layer);
- brndr_render();
- irndr_render();
+ render();
while(!quit){
switch(input_update()){
layer++;
}
brndr_set_rendered_layer(layer);
- brndr_render();
+ irndr_set_layer(layer);
+ render();
break;
case LAYER_DOWN:
if(layer > 0){
layer--;
}
brndr_set_rendered_layer(layer);
- brndr_render();
+ irndr_set_layer(layer);
+ render();
break;
case ERR_CLEAR:
err_clear();
break;
case MAP_LEFT:
brndr_move_draw_pos(point2i(-1,0));
- brndr_render();
+ render();
break;
case MAP_RIGHT:
brndr_move_draw_pos(point2i(1,0));
- brndr_render();
+ render();
break;
case MAP_UP:
brndr_move_draw_pos(point2i(0,-1));
- brndr_render();
+ render();
break;
case MAP_DOWN:
brndr_move_draw_pos(point2i(0,1));
- brndr_render();
+ render();
break;
}
}