From ebc03fd33fb808db47e47c2426ee6f6879721d4a Mon Sep 17 00:00:00 2001 From: epoch Date: Sat, 7 Jan 2017 14:37:12 -0600 Subject: more crap that still doesn't work right. --- src/graphics_opengl.c | 157 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 102 insertions(+), 55 deletions(-) (limited to 'src') diff --git a/src/graphics_opengl.c b/src/graphics_opengl.c index 9e200de..fd079cf 100644 --- a/src/graphics_opengl.c +++ b/src/graphics_opengl.c @@ -1,96 +1,143 @@ - #include #include #include #include +#include + +#include "common.h" GLenum doubleBuffer; GLubyte ubImage[65536]; +void set_aspect_ratio(int w,int h) { + glViewport(0,0,w,h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(0,w,0,h,-1,1); +// glScalef(1,-1,1); +// glTranslatef(0,-h,0); +} + +void set_color_based_on_distance(real d) { + //scale this color based on distance... closer is lighter. +// float g; +// g=d/100.0 + glColor3f(0.0, 1.0, 0.0); +} + +void set_clipping_rectangle(int x,int y,int w,int h) { + +} + void draw_cs_line(cs_t p1,cs_t p2) { - + glBegin(GL_LINES); + glColor3f(0.0, 1.0, 0.0); + glVertex2i(p1.x,p1.y); + glVertex2i(p2.x,p2.y); + glEnd(); } void draw_cs_text() { + +} +void draw_cs_shape(cs_s_t s) { + int i; + for(i=0;i