imtk

diff src/imtk.c @ 7:6d35e6c7b2ca

reorganization finished
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 14 Apr 2011 23:04:07 +0300
parents 09b6e8a5dc14
children 9c7987064bb0
line diff
     1.1 --- a/src/imtk.c	Thu Apr 14 14:22:42 2011 +0300
     1.2 +++ b/src/imtk.c	Thu Apr 14 23:04:07 2011 +0300
     1.3 @@ -10,18 +10,20 @@
     1.4  #include <GLUT/glut.h>
     1.5  #endif
     1.6  #include "imtk.h"
     1.7 -
     1.8 -
     1.9 -static void draw_progress(int id, float pos, int x, int y);
    1.10 +#include "state.h"
    1.11  
    1.12  
    1.13  void imtk_begin(void)
    1.14  {
    1.15 +	int width, height;
    1.16 +
    1.17 +	imtk_get_viewport(&width, &height);
    1.18 +
    1.19  	glMatrixMode(GL_PROJECTION);
    1.20  	glPushMatrix();
    1.21  	glLoadIdentity();
    1.22  	glTranslatef(-1, 1, 0);
    1.23 -	glScalef(2.0 / scr_width, -2.0 / scr_height, 1.0);
    1.24 +	glScalef(2.0 / width, -2.0 / height, 1.0);
    1.25  
    1.26  	glMatrixMode(GL_MODELVIEW);
    1.27  	glPushMatrix();
    1.28 @@ -50,13 +52,7 @@
    1.29  }
    1.30  
    1.31  
    1.32 -
    1.33 -void imtk_progress(int id, float pos, int x, int y)
    1.34 -{
    1.35 -	draw_progress(id, pos, x, y);
    1.36 -}
    1.37 -
    1.38 -int imtk_listbox(int id, const char *list, int sel, int x, int y)
    1.39 +/*int imtk_listbox(int id, const char *list, int sel, int x, int y)
    1.40  {
    1.41  	int i;
    1.42  	assert(id >= 0);
    1.43 @@ -128,35 +124,4 @@
    1.44  void imtk_free_list(char *list)
    1.45  {
    1.46  	free(list);
    1.47 -}
    1.48 -
    1.49 -
    1.50 -static void draw_progress(int id, float pos, int x, int y)
    1.51 -{
    1.52 -	int bar_size = SLIDER_SIZE * pos;
    1.53 -
    1.54 -	if(pos < 0.0) pos = 0.0;
    1.55 -	if(pos > 1.0) pos = 1.0;
    1.56 -
    1.57 -	/* through */
    1.58 -	glBegin(GL_QUADS);
    1.59 -	glColor3fv(colors[IMTK_BASE_COLOR]);
    1.60 -	glVertex2f(x - 1, y - 1);
    1.61 -	glVertex2f(x + SLIDER_SIZE + 1, y - 1);
    1.62 -	glVertex2f(x + SLIDER_SIZE + 1, y + 17);
    1.63 -	glVertex2f(x - 1, y + 17);
    1.64 -	glEnd();
    1.65 -	draw_frame(x - 1, y - 1, SLIDER_SIZE + 2, 17, FRAME_INSET);
    1.66 -
    1.67 -	if(pos > 0.0) {
    1.68 -		/* bar */
    1.69 -		glBegin(GL_QUADS);
    1.70 -		glColor3fv(colors[IMTK_BASE_COLOR]);
    1.71 -		glVertex2f(x, y);
    1.72 -		glVertex2f(x + bar_size, y);
    1.73 -		glVertex2f(x + bar_size, y + 15);
    1.74 -		glVertex2f(x, y + 15);
    1.75 -		glEnd();
    1.76 -		draw_frame(x, y, bar_size, 15, FRAME_OUTSET);
    1.77 -	}
    1.78 -}
    1.79 +}*/