imtk

changeset 12:17c9525b2e35

merged -lGLU fix with listbox patch
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 17 Apr 2011 18:20:23 +0300
parents eae09a1dca1d 467a520f5c00
children 9c7987064bb0
files
diffstat 3 files changed, 6 insertions(+), 8 deletions(-) [+]
line diff
     1.1 --- a/Makefile	Sat Apr 16 10:27:59 2011 +0300
     1.2 +++ b/Makefile	Sun Apr 17 18:20:23 2011 +0300
     1.3 @@ -9,7 +9,7 @@
     1.4  ifeq ($(shell uname -s), Darwin)
     1.5  	libgl = -framework OpenGL -framework GLUT
     1.6  else
     1.7 -	libgl = -lGL -lglut
     1.8 +	libgl = -lGL -lGLU -lglut
     1.9  endif
    1.10  
    1.11  $(bin): $(obj)
     2.1 --- a/src/imtk.h	Sat Apr 16 10:27:59 2011 +0300
     2.2 +++ b/src/imtk.h	Sun Apr 17 18:20:23 2011 +0300
     2.3 @@ -43,16 +43,14 @@
     2.4  void imtk_textbox(int id, char *textbuf, size_t buf_sz, int x, int y);
     2.5  float imtk_slider(int id, float pos, float min, float max, int x, int y);
     2.6  void imtk_progress(int id, float pos, int x, int y);
     2.7 +int imtk_listbox(int id, const char *list, int sel, int x, int y);
     2.8  /*
     2.9 -int imtk_listbox(int id, const char *list, int sel, int x, int y);
    2.10  int imtk_combobox(int id, char *textbuf, size_t buf_sz, const char *list, int sel, int x, int y);
    2.11  */
    2.12  
    2.13  /* helper functions to create and destroy item lists for listboxes and comboboxes */
    2.14 -/*
    2.15  char *imtk_create_list(const char *first, ...);
    2.16  void imtk_free_list(char *list);
    2.17 -*/
    2.18  
    2.19  #ifdef __cplusplus
    2.20  }
     3.1 --- a/test.c	Sat Apr 16 10:27:59 2011 +0300
     3.2 +++ b/test.c	Sun Apr 17 18:20:23 2011 +0300
     3.3 @@ -108,8 +108,8 @@
     3.4  	static char textbuf[256];
     3.5  	static char textbuf2[256];
     3.6  	static float val;
     3.7 -	/*static int prev_sel;
     3.8 -	char *itemlist;*/
     3.9 +	static int prev_sel = 0;
    3.10 +	char *itemlist;
    3.11  
    3.12  	imtk_begin();
    3.13  
    3.14 @@ -132,12 +132,12 @@
    3.15  		glutPostRedisplay();
    3.16  	}
    3.17  
    3.18 -	/*itemlist = imtk_create_list("teapot", "torus", "sphere", NULL);
    3.19 +	itemlist = imtk_create_list("teapot", "torus", "sphere", NULL);
    3.20  	if((objsel = imtk_listbox(IMUID, itemlist, prev_sel, 30, 120)) != prev_sel) {
    3.21  		prev_sel = objsel;
    3.22  		glutPostRedisplay();
    3.23  	}
    3.24 -	imtk_free_list(itemlist);*/
    3.25 +	imtk_free_list(itemlist);
    3.26  
    3.27  	imtk_textbox(IMUID, textbuf, sizeof textbuf, 30, 200);
    3.28  	imtk_textbox(IMUID, textbuf2, sizeof textbuf2, 30, 250);