From 718d9ea67196aa7e56c84261e0a8c134492023ad Mon Sep 17 00:00:00 2001 From: epoch Date: Tue, 24 Jan 2017 01:23:45 -0600 Subject: changed a couple things about how graphics stuff is abstracted and separated into different files. --- src/graphics.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'src/graphics.c') diff --git a/src/graphics.c b/src/graphics.c index b5f05c2..49da7d4 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -7,7 +7,6 @@ #include #include #include -//#include //code to use select instead of non-blocking is commented out. might decide to use it later. #include #define __USE_GNU //for longer math constants #include @@ -15,8 +14,7 @@ #include "config.h" #include "common.h" -//choose which graphic's end you want here I guess? -#include "graphics_x11.h" +#include "graphics_backend.h" //this header includes all the functions you'll need to implement if you want to port hackvr to something else #include "graphics.h" //typedef float real; //think this conflicts? @@ -452,22 +450,21 @@ void draw_screen() { //now we pick the color of this triangle! if(gra_global.red_and_blue) { if(cn==0) { -// XSetForeground(global.dpy,global.backgc,global.red.pixel);//??? + set_color_red(); } else { -// XSetForeground(global.dpy,global.backgc,global.blue.pixel);//??? + set_color_blue(); } //tests of blending grayscale with red and blue // draw_c3_triangle(*(zs[i].t)); } else { - if(!strcmp(global.selected_object,zs[i].s->id)) { +// if(!strcmp(global.selected_object,zs[i].s->id)) { //XSetForeground(global.dpy,global.backgc,global.green.pixel); - } else { -// set_color_based_on_distance(zs[i].d); - } +// } else { +// } + set_color_based_on_distance(zs[i].d); } -// set_color(); //if(between_angles(points_to_angle((c2_t){zs[i].s->p[0].x,zs[i].s->p[0].z},(c2_t){camera.p.x,camera.p.z}),d2r(camera.yr+45),d2r(camera.yr+135))) { - set_color_based_on_distance(zs[i].d); +// set_color_based_on_distance(zs[i].d); draw_c3_shape(*(zs[i].s)); //} } -- cgit v1.2.3