# HG changeset patch # User John Tsiombikas # Date 1303053623 -10800 # Node ID 17c9525b2e35366449aec7539d1f85e0d2aa69a0 # Parent eae09a1dca1d6e7a5874dedb8e41113162663dd6# Parent 467a520f5c00fe632f2fef9329aaff986ef3316e merged -lGLU fix with listbox patch diff -r eae09a1dca1d -r 17c9525b2e35 Makefile --- a/Makefile Sat Apr 16 10:27:59 2011 +0300 +++ b/Makefile Sun Apr 17 18:20:23 2011 +0300 @@ -9,7 +9,7 @@ ifeq ($(shell uname -s), Darwin) libgl = -framework OpenGL -framework GLUT else - libgl = -lGL -lglut + libgl = -lGL -lGLU -lglut endif $(bin): $(obj) diff -r eae09a1dca1d -r 17c9525b2e35 src/imtk.h --- a/src/imtk.h Sat Apr 16 10:27:59 2011 +0300 +++ b/src/imtk.h Sun Apr 17 18:20:23 2011 +0300 @@ -43,16 +43,14 @@ void imtk_textbox(int id, char *textbuf, size_t buf_sz, int x, int y); float imtk_slider(int id, float pos, float min, float max, int x, int y); void imtk_progress(int id, float pos, int x, int y); +int imtk_listbox(int id, const char *list, int sel, int x, int y); /* -int imtk_listbox(int id, const char *list, int sel, int x, int y); int imtk_combobox(int id, char *textbuf, size_t buf_sz, const char *list, int sel, int x, int y); */ /* helper functions to create and destroy item lists for listboxes and comboboxes */ -/* char *imtk_create_list(const char *first, ...); void imtk_free_list(char *list); -*/ #ifdef __cplusplus } diff -r eae09a1dca1d -r 17c9525b2e35 test.c --- a/test.c Sat Apr 16 10:27:59 2011 +0300 +++ b/test.c Sun Apr 17 18:20:23 2011 +0300 @@ -108,8 +108,8 @@ static char textbuf[256]; static char textbuf2[256]; static float val; - /*static int prev_sel; - char *itemlist;*/ + static int prev_sel = 0; + char *itemlist; imtk_begin(); @@ -132,12 +132,12 @@ glutPostRedisplay(); } - /*itemlist = imtk_create_list("teapot", "torus", "sphere", NULL); + itemlist = imtk_create_list("teapot", "torus", "sphere", NULL); if((objsel = imtk_listbox(IMUID, itemlist, prev_sel, 30, 120)) != prev_sel) { prev_sel = objsel; glutPostRedisplay(); } - imtk_free_list(itemlist);*/ + imtk_free_list(itemlist); imtk_textbox(IMUID, textbuf, sizeof textbuf, 30, 200); imtk_textbox(IMUID, textbuf2, sizeof textbuf2, 30, 250);