nuclear@3: #include nuclear@2: #include nuclear@1: #include nuclear@2: #include nuclear@0: #include nuclear@0: #ifndef __APPLE__ nuclear@0: #include nuclear@0: #else nuclear@0: #include nuclear@0: #endif nuclear@0: #include "imtk.h" nuclear@7: #include "state.h" nuclear@13: #include "draw.h" nuclear@1: nuclear@0: nuclear@13: void imtk_post_redisplay(void) nuclear@13: { nuclear@13: glutPostRedisplay(); nuclear@13: } nuclear@13: nuclear@0: void imtk_begin(void) nuclear@0: { nuclear@7: int width, height; nuclear@7: nuclear@7: imtk_get_viewport(&width, &height); nuclear@7: nuclear@0: glMatrixMode(GL_PROJECTION); nuclear@0: glPushMatrix(); nuclear@0: glLoadIdentity(); nuclear@0: glTranslatef(-1, 1, 0); nuclear@7: glScalef(2.0 / width, -2.0 / height, 1.0); nuclear@2: nuclear@2: glMatrixMode(GL_MODELVIEW); nuclear@2: glPushMatrix(); nuclear@2: glLoadIdentity(); nuclear@2: nuclear@2: glPushAttrib(GL_ENABLE_BIT); nuclear@2: glDisable(GL_DEPTH_TEST); nuclear@2: glDisable(GL_CULL_FACE); nuclear@2: glDisable(GL_LIGHTING); nuclear@13: glEnable(GL_BLEND); nuclear@13: nuclear@13: glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); nuclear@0: } nuclear@0: nuclear@0: void imtk_end(void) nuclear@0: { nuclear@2: glPopAttrib(); nuclear@2: nuclear@0: glMatrixMode(GL_PROJECTION); nuclear@0: glPopMatrix(); nuclear@2: glMatrixMode(GL_MODELVIEW); nuclear@2: glPopMatrix(); nuclear@0: } nuclear@0: nuclear@13: void imtk_label(const char *str, int x, int y) nuclear@0: { nuclear@13: glColor4fv(imtk_get_color(IMTK_TEXT_COLOR)); nuclear@13: imtk_draw_string(x, y, str); nuclear@0: } nuclear@0: nuclear@1: nuclear@13: /* nuclear@4: int imtk_combobox(int id, char *textbuf, size_t buf_sz, const char *list, int sel, int x, int y) nuclear@4: { nuclear@4: imtk_textbox(id + 1, textbuf, buf_sz, x, y); nuclear@4: imtk_button(id + 3, "V", x + TEXTBOX_SIZE, y); nuclear@4: nuclear@4: if(prev_active == id + 3) { nuclear@4: sel = imtk_listbox(id + 5, list, sel, x, y + 20); nuclear@4: } nuclear@4: return sel; nuclear@4: } nuclear@13: */