Doxygen Source Code Documentation
glut.h File Reference
#include <GL/gl.h>
#include <GL/glu.h>
Go to the source code of this file.
Define Documentation
|
|
|
Definition at line 237 of file glut.h. Referenced by glutGetModifiers(). |
|
Definition at line 236 of file glut.h. Referenced by glutGetModifiers(). |
|
Definition at line 235 of file glut.h. Referenced by glutGetModifiers(). |
|
|
|
|
|
|
|
Definition at line 154 of file glut.h. Referenced by SUMA_AxisText(), and SUMA_DrawMesh(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 130 of file glut.h. Referenced by associateNewColormap(), glutCopyColormap(), and glutSetColor(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 269 of file glut.h. Referenced by glutSetCursor(). |
|
|
|
|
|
Definition at line 265 of file glut.h. Referenced by __glutCreateWindow(), and glutSetCursor(). |
|
|
|
|
|
|
|
Definition at line 267 of file glut.h. Referenced by glutSetCursor(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 197 of file glut.h. Referenced by glutGet(). |
|
Definition at line 67 of file glut.h. Referenced by __glutDetermineVisual(). |
|
Definition at line 86 of file glut.h. Referenced by __glutProcessDeviceEvents(), and processEvents(). |
|
Definition at line 204 of file glut.h. Referenced by glutGet(). |
|
Definition at line 117 of file glut.h. Referenced by processEvents(). |
|
Definition at line 129 of file glut.h. Referenced by associateNewColormap(), glutCopyColormap(), and glutSetColor(). |
|
Definition at line 212 of file glut.h. Referenced by glutDeviceGet(). |
|
Definition at line 209 of file glut.h. Referenced by glutDeviceGet(). |
|
Definition at line 210 of file glut.h. Referenced by glutDeviceGet(). |
|
Definition at line 225 of file glut.h. Referenced by glutLayerGet(). |
|
Definition at line 211 of file glut.h. Referenced by glutDeviceGet(). |
|
Definition at line 213 of file glut.h. Referenced by glutDeviceGet(). |
|
|
|
Definition at line 202 of file glut.h. Referenced by glutGet(). |
|
Definition at line 201 of file glut.h. Referenced by glutGet(). |
|
Definition at line 200 of file glut.h. Referenced by glutGet(). |
|
Definition at line 198 of file glut.h. Referenced by glutGet(). |
|
Definition at line 199 of file glut.h. Referenced by glutGet(). |
|
Definition at line 107 of file glut.h. Referenced by processEvents(). |
|
Definition at line 111 of file glut.h. Referenced by processEvents(). |
|
Definition at line 91 of file glut.h. Referenced by processEvents(). |
|
Definition at line 100 of file glut.h. Referenced by processEvents(). |
|
Definition at line 101 of file glut.h. Referenced by processEvents(). |
|
Definition at line 102 of file glut.h. Referenced by processEvents(). |
|
Definition at line 92 of file glut.h. Referenced by processEvents(). |
|
Definition at line 93 of file glut.h. Referenced by processEvents(). |
|
Definition at line 94 of file glut.h. Referenced by processEvents(). |
|
Definition at line 95 of file glut.h. Referenced by processEvents(). |
|
Definition at line 96 of file glut.h. Referenced by processEvents(). |
|
Definition at line 97 of file glut.h. Referenced by processEvents(). |
|
Definition at line 98 of file glut.h. Referenced by processEvents(). |
|
Definition at line 99 of file glut.h. Referenced by processEvents(). |
|
Definition at line 110 of file glut.h. Referenced by processEvents(). |
|
Definition at line 112 of file glut.h. Referenced by processEvents(). |
|
Definition at line 104 of file glut.h. Referenced by processEvents(). |
|
Definition at line 109 of file glut.h. Referenced by processEvents(). |
|
Definition at line 108 of file glut.h. Referenced by processEvents(). |
|
Definition at line 106 of file glut.h. Referenced by processEvents(). |
|
Definition at line 105 of file glut.h. Referenced by processEvents(). |
|
Definition at line 224 of file glut.h. Referenced by glutLayerGet(). |
|
Definition at line 116 of file glut.h. Referenced by processEvents(). |
|
|
|
|
|
Definition at line 121 of file glut.h. Referenced by __glutStartMenu(). |
|
Definition at line 120 of file glut.h. Referenced by __glutFinishMenu(). |
|
Definition at line 196 of file glut.h. Referenced by glutGet(). |
|
|
|
Definition at line 73 of file glut.h. Referenced by __glutDetermineVisual(). |
|
|
|
|
|
Definition at line 227 of file glut.h. Referenced by glutLayerGet(). |
|
Definition at line 124 of file glut.h. Referenced by processEvents(), and updateWindowVisibility(). |
|
Definition at line 216 of file glut.h. Referenced by glutDeviceGet(). |
|
Definition at line 217 of file glut.h. Referenced by glutDeviceGet(). |
|
Definition at line 214 of file glut.h. Referenced by glutDeviceGet(). |
|
Definition at line 215 of file glut.h. Referenced by glutDeviceGet(). |
|
Definition at line 218 of file glut.h. Referenced by glutDeviceGet(). |
|
|
|
|
|
Definition at line 228 of file glut.h. Referenced by glutLayerGet(). |
|
Definition at line 223 of file glut.h. Referenced by glutLayerGet(). |
|
Definition at line 128 of file glut.h. Referenced by associateNewColormap(), glutCopyColormap(), and glutSetColor(). |
|
|
|
|
|
|
|
Definition at line 193 of file glut.h. Referenced by glutGet(). |
|
Definition at line 195 of file glut.h. Referenced by glutGet(). |
|
Definition at line 192 of file glut.h. Referenced by glutGet(). |
|
Definition at line 194 of file glut.h. Referenced by glutGet(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 226 of file glut.h. Referenced by glutLayerGet(). |
|
Definition at line 87 of file glut.h. Referenced by __glutProcessDeviceEvents(), and processEvents(). |
|
Definition at line 125 of file glut.h. Referenced by processEvents(), and updateWindowVisibility(). |
|
Definition at line 179 of file glut.h. Referenced by glutGet(). |
|
Definition at line 178 of file glut.h. Referenced by glutGet(). |
|
Definition at line 177 of file glut.h. Referenced by glutGet(). |
|
Definition at line 176 of file glut.h. Referenced by glutGet(). |
|
Definition at line 175 of file glut.h. Referenced by glutGet(). |
|
Definition at line 174 of file glut.h. Referenced by glutGet(). |
|
Definition at line 169 of file glut.h. Referenced by glutGet(). |
|
Definition at line 184 of file glut.h. Referenced by glutGet(). |
|
Definition at line 190 of file glut.h. Referenced by glutGet(). |
|
Definition at line 171 of file glut.h. Referenced by glutGet(). |
|
Definition at line 180 of file glut.h. Referenced by glutGet(). |
|
Definition at line 173 of file glut.h. Referenced by glutGet(). |
|
Definition at line 168 of file glut.h. Referenced by glutGet(). |
|
Definition at line 183 of file glut.h. Referenced by glutGet(). |
|
Definition at line 186 of file glut.h. Referenced by glutGet(). |
|
Definition at line 182 of file glut.h. Referenced by glutGet(). |
|
Definition at line 172 of file glut.h. Referenced by glutGet(). |
|
Definition at line 181 of file glut.h. Referenced by glutGet(). |
|
Definition at line 170 of file glut.h. Referenced by glutGet(). |
|
Definition at line 187 of file glut.h. Referenced by glutGet(). |
|
Definition at line 167 of file glut.h. Referenced by glutGet(). |
|
Definition at line 165 of file glut.h. Referenced by glutGet(). |
|
Definition at line 166 of file glut.h. Referenced by glutGet(). |
|
|
Function Documentation
|
Definition at line 730 of file glut_menu.c. References __glutFatalError(), fontHeight, _GLUTmenu::list, malloc, _GLUTmenuItem::menu, MENU_GAP, menuModificationError(), _GLUTmenuItem::next, _GLUTmenu::num, _GLUTmenuItem::pixwidth, setMenuItem(), _GLUTmenuItem::win, and _GLUTmenu::win.
00731 { 00732 XSetWindowAttributes wa; 00733 GLUTmenuItem *entry; 00734 00735 if (__glutMappedMenu) 00736 menuModificationError(); 00737 entry = (GLUTmenuItem *) malloc(sizeof(GLUTmenuItem)); 00738 if (!entry) 00739 __glutFatalError("out of memory."); 00740 entry->menu = __glutCurrentMenu; 00741 setMenuItem(entry, label, value, False); 00742 wa.event_mask = EnterWindowMask | LeaveWindowMask; 00743 entry->win = XCreateWindow(__glutDisplay, 00744 __glutCurrentMenu->win, MENU_GAP, 00745 __glutCurrentMenu->num * fontHeight + MENU_GAP, /* x & y */ 00746 entry->pixwidth, fontHeight, /* width & height */ 00747 0, CopyFromParent, InputOnly, CopyFromParent, 00748 CWEventMask, &wa); 00749 XMapWindow(__glutDisplay, entry->win); 00750 __glutCurrentMenu->num++; 00751 entry->next = __glutCurrentMenu->list; 00752 __glutCurrentMenu->list = entry; 00753 } |
|
Definition at line 756 of file glut_menu.c. References __glutFatalError(), fontHeight, _GLUTmenu::list, malloc, _GLUTmenuItem::menu, MENU_GAP, menuModificationError(), _GLUTmenuItem::next, _GLUTmenu::num, _GLUTmenuItem::pixwidth, setMenuItem(), _GLUTmenu::submenus, _GLUTmenuItem::win, and _GLUTmenu::win.
00757 { 00758 XSetWindowAttributes wa; 00759 GLUTmenuItem *submenu; 00760 00761 if (__glutMappedMenu) 00762 menuModificationError(); 00763 submenu = (GLUTmenuItem *) malloc(sizeof(GLUTmenuItem)); 00764 if (!submenu) 00765 __glutFatalError("out of memory."); 00766 __glutCurrentMenu->submenus++; 00767 submenu->menu = __glutCurrentMenu; 00768 setMenuItem(submenu, label, /* base 0 */ menu - 1, True); 00769 wa.event_mask = EnterWindowMask | LeaveWindowMask; 00770 submenu->win = XCreateWindow(__glutDisplay, 00771 __glutCurrentMenu->win, MENU_GAP, 00772 __glutCurrentMenu->num * fontHeight + MENU_GAP, /* x & y */ 00773 submenu->pixwidth, fontHeight, /* width & height */ 00774 0, CopyFromParent, InputOnly, CopyFromParent, 00775 CWEventMask, &wa); 00776 XMapWindow(__glutDisplay, submenu->win); 00777 __glutCurrentMenu->num++; 00778 submenu->next = __glutCurrentMenu->list; 00779 __glutCurrentMenu->list = submenu; 00780 } |
|
Definition at line 888 of file glut_menu.c. References __glutChangeWindowEventMask(), _GLUTmenu::id, and menuModificationError().
00889 { 00890 if (__glutMappedMenu) 00891 menuModificationError(); 00892 if (__glutCurrentWindow->menu[button] < 1) { 00893 __glutCurrentWindow->buttonUses++; 00894 } 00895 __glutChangeWindowEventMask( 00896 ButtonPressMask | ButtonReleaseMask, True); 00897 __glutCurrentWindow->menu[button] = __glutCurrentMenu->id + 1; 00898 } |
|
|
|
|
|
|
|
Definition at line 783 of file glut_menu.c. References __glutWarning(), free, i, _GLUTmenuItem::isTrigger, _GLUTmenuItem::label, _GLUTmenu::list, _GLUTmenuItem::menu, menuModificationError(), _GLUTmenuItem::next, _GLUTmenu::num, setMenuItem(), and _GLUTmenu::submenus.
00784 { 00785 GLUTmenuItem *item; 00786 int i; 00787 00788 if (__glutMappedMenu) 00789 menuModificationError(); 00790 i = __glutCurrentMenu->num; 00791 item = __glutCurrentMenu->list; 00792 while (item) { 00793 if (i == num) { 00794 if (item->isTrigger) { 00795 /* If changing a submenu trigger to a menu entry, we 00796 need to account for submenus. */ 00797 item->menu->submenus--; 00798 } 00799 free(item->label); 00800 setMenuItem(item, label, value, False); 00801 return; 00802 } 00803 i--; 00804 item = item->next; 00805 } 00806 __glutWarning("Current menu has no %d item.", num); 00807 } |
|
Definition at line 810 of file glut_menu.c. References __glutWarning(), free, i, _GLUTmenuItem::isTrigger, _GLUTmenuItem::label, _GLUTmenu::list, _GLUTmenuItem::menu, menuModificationError(), _GLUTmenuItem::next, _GLUTmenu::num, setMenuItem(), and _GLUTmenu::submenus.
00811 { 00812 GLUTmenuItem *item; 00813 int i; 00814 00815 if (__glutMappedMenu) 00816 menuModificationError(); 00817 i = __glutCurrentMenu->num; 00818 item = __glutCurrentMenu->list; 00819 while (item) { 00820 if (i == num) { 00821 if (!item->isTrigger) { 00822 /* If changing a menu entry to as submenu trigger, we 00823 need to account for submenus. */ 00824 item->menu->submenus++; 00825 } 00826 free(item->label); 00827 setMenuItem(item, label, /* base 0 */ menu - 1, True); 00828 return; 00829 } 00830 i--; 00831 item = item->next; 00832 } 00833 __glutWarning("Current menu has no %d item.", num); 00834 } |
|
Definition at line 237 of file glut_cindex.c. References __glutFreeColormap(), __glutPutOnWorkList(), __glutToplevelOf(), __glutWarning(), associateNewColormap(), _GLUTcolormap::cells, _GLUTcolormap::cmap, color, _GLUTwindow::colormap, _GLUToverlay::colormap, GLUT_BLUE, GLUT_COLORMAP_WORK, GLUT_GREEN, GLUT_RED, i, _GLUTwindow::overlay, _GLUTcolormap::refcnt, _GLUTcolormap::size, and _GLUTcolormap::visual.
00238 { 00239 GLUTwindow *window = __glutWindowList[winnum - 1]; 00240 GLUTcolormap *oldcmap, *newcmap, *copycmap; 00241 XVisualInfo *dstvis; 00242 XColor color; 00243 int i, last; 00244 00245 if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { 00246 oldcmap = __glutCurrentWindow->colormap; 00247 dstvis = __glutCurrentWindow->vis; 00248 newcmap = window->colormap; 00249 } else { 00250 oldcmap = __glutCurrentWindow->overlay->colormap; 00251 dstvis = __glutCurrentWindow->overlay->vis; 00252 if (!window->overlay) { 00253 __glutWarning("glutCopyColormap: window %d has no overlay", winnum); 00254 return; 00255 } 00256 newcmap = window->overlay->colormap; 00257 } 00258 00259 if (!oldcmap) { 00260 __glutWarning("glutCopyColormap: destination colormap must be color index"); 00261 return; 00262 } 00263 if (!newcmap) { 00264 __glutWarning( 00265 "glutCopyColormap: source colormap of window %d must be color index", 00266 winnum); 00267 return; 00268 } 00269 if (newcmap == oldcmap) { 00270 /* Source and destination are the same; now copy needed. */ 00271 return; 00272 } 00273 /* Play safe: compare visual IDs, not Visual*'s */ 00274 if (newcmap->visual->visualid == oldcmap->visual->visualid) { 00275 /* Visuals match! "Copy" by reference... */ 00276 __glutFreeColormap(oldcmap); 00277 newcmap->refcnt++; 00278 if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { 00279 __glutCurrentWindow->colormap = newcmap; 00280 __glutCurrentWindow->cmap = newcmap->cmap; 00281 } else { 00282 __glutCurrentWindow->overlay->colormap = newcmap; 00283 __glutCurrentWindow->overlay->cmap = newcmap->cmap; 00284 } 00285 XSetWindowColormap(__glutDisplay, __glutCurrentWindow->renderWin, 00286 newcmap->cmap); 00287 __glutPutOnWorkList(__glutToplevelOf(window), GLUT_COLORMAP_WORK); 00288 } else { 00289 /* Visuals different - need a distinct X colormap! */ 00290 copycmap = associateNewColormap(dstvis); 00291 /* Wouldn't it be nice if XCopyColormapAndFree could be 00292 told not to free the old colormap's entries! */ 00293 last = newcmap->size; 00294 if (last > copycmap->size) { 00295 last = copycmap->size; 00296 } 00297 for (i = last - 1; i >= 0; i--) { 00298 if (newcmap->cells[i].component[GLUT_RED] >= 0.0) { 00299 color.pixel = i; 00300 copycmap->cells[i].component[GLUT_RED] = 00301 newcmap->cells[i].component[GLUT_RED]; 00302 color.red = (GLfloat) 0xffff * 00303 newcmap->cells[i].component[GLUT_RED]; 00304 copycmap->cells[i].component[GLUT_GREEN] = 00305 newcmap->cells[i].component[GLUT_GREEN]; 00306 color.green = (GLfloat) 0xffff * 00307 newcmap->cells[i].component[GLUT_GREEN]; 00308 copycmap->cells[i].component[GLUT_BLUE] = 00309 newcmap->cells[i].component[GLUT_BLUE]; 00310 color.blue = (GLfloat) 0xffff * 00311 newcmap->cells[i].component[GLUT_BLUE]; 00312 color.flags = DoRed | DoGreen | DoBlue; 00313 XStoreColor(__glutDisplay, copycmap->cmap, &color); 00314 } 00315 } 00316 } 00317 } |
|
|
|
Definition at line 722 of file glut_win.c. References __glutCreateWindow(), __glutPutOnWorkList(), __glutToplevelOf(), _GLUTwindow::cmap, GLUT_COLORMAP_WORK, _GLUTwindow::num, and win.
00723 { 00724 GLUTwindow *window, *toplevel; 00725 00726 window = __glutCreateWindow(__glutWindowList[win - 1], 00727 x, y, width, height); 00728 toplevel = __glutToplevelOf(window); 00729 if (toplevel->cmap != window->cmap) { 00730 __glutPutOnWorkList(toplevel, GLUT_COLORMAP_WORK); 00731 } 00732 return window->num + 1; 00733 } |
|
Definition at line 689 of file glut_win.c. References __glutCreateWindow(), _GLUTwindow::num, win, and _GLUTwindow::win.
00690 { 00691 static int firstWindow = 1; 00692 GLUTwindow *window; 00693 XWMHints *wmHints; 00694 Window win; 00695 XTextProperty textprop; 00696 00697 window = __glutCreateWindow(NULL, 00698 __glutSizeHints.x, __glutSizeHints.y, 00699 __glutInitWidth, __glutInitHeight); 00700 win = window->win; 00701 /* setup ICCCM properties */ 00702 textprop.value = (unsigned char *) title; 00703 textprop.encoding = XA_STRING; 00704 textprop.format = 8; 00705 textprop.nitems = strlen(title); 00706 wmHints = XAllocWMHints(); 00707 wmHints->initial_state = 00708 __glutIconic ? IconicState : NormalState; 00709 wmHints->flags = StateHint; 00710 XSetWMProperties(__glutDisplay, win, &textprop, &textprop, 00711 /* only put WM_COMMAND property on first window */ 00712 firstWindow ? __glutArgv : NULL, 00713 firstWindow ? __glutArgc : 0, 00714 &__glutSizeHints, wmHints, NULL); 00715 firstWindow = 0; 00716 XFree(wmHints); 00717 XSetWMProtocols(__glutDisplay, win, &__glutWMDeleteWindow, 1); 00718 return window->num + 1; 00719 } |
|
Definition at line 656 of file glut_menu.c. References __glutGetMenuByNum(), free, _GLUTmenu::id, _GLUTmenuItem::label, _GLUTmenu::list, _GLUTmenuItem::menu, menuModificationError(), _GLUTmenuItem::next, and _GLUTmenu::win.
00657 { 00658 GLUTmenu *menu = __glutGetMenuByNum(menunum); 00659 GLUTmenuItem *item, *next; 00660 00661 if (__glutMappedMenu) 00662 menuModificationError(); 00663 assert(menu->id == menunum - 1); 00664 XDestroySubwindows(__glutDisplay, menu->win); 00665 XDestroyWindow(__glutDisplay, menu->win); 00666 menuList[menunum - 1] = NULL; 00667 /* free all menu entries */ 00668 item = menu->list; 00669 while (item) { 00670 assert(item->menu == menu); 00671 next = item->next; 00672 free(item->label); 00673 free(item); 00674 item = next; 00675 } 00676 if (__glutCurrentMenu == menu) { 00677 __glutCurrentMenu = NULL; 00678 } 00679 free(menu); 00680 } |
|
Definition at line 794 of file glut_win.c. References __glutFatalUsage(), __glutPutOnWorkList(), __glutToplevelOf(), destroyWindow(), GLUT_COLORMAP_WORK, _GLUTwindow::parent, and win.
00795 { 00796 GLUTwindow *window = __glutWindowList[win - 1]; 00797 00798 if (__glutMappedMenu && __glutMenuWindow == window) { 00799 __glutFatalUsage("destroying menu window not allowed while menus in use"); 00800 } 00801 /* if not a toplevel window... */ 00802 if (window->parent) { 00803 /* destroying subwindows may change colormap requirements; 00804 recalculate toplevel window's WM_COLORMAP_WINDOWS 00805 property */ 00806 __glutPutOnWorkList(__glutToplevelOf(window->parent), 00807 GLUT_COLORMAP_WORK); 00808 } 00809 destroyWindow(window, window); 00810 } |
|
Definition at line 901 of file glut_menu.c. References __glutChangeWindowEventMask(), and menuModificationError().
00902 { 00903 if (__glutMappedMenu) 00904 menuModificationError(); 00905 if (__glutCurrentWindow->menu[button] > 0) { 00906 __glutCurrentWindow->buttonUses--; 00907 __glutChangeWindowEventMask(ButtonPressMask | ButtonReleaseMask, 00908 __glutCurrentWindow->buttonUses > 0); 00909 __glutCurrentWindow->menu[button] = 0; 00910 } 00911 } |
|
|
|
|
|
|
|
|
Definition at line 284 of file glut_overlay.c. References __glutDetermineVisual(), __glutFatalError(), __glutFreeOverlay(), __glutGetTransparentPixel(), __glutPutOnWorkList(), __glutSetupColormap(), __glutToplevelOf(), addStaleWindow(), _GLUTwindow::children, _GLUToverlay::cmap, _GLUToverlay::colormap, _GLUToverlay::ctx, _GLUToverlay::damaged, _GLUToverlay::display, _GLUTwindow::eventMask, _GLUToverlay::fakeSingle, _GLUTwindow::forceReshape, getOverlayVisualInfo(), GLUT_COLORMAP_WORK, GLUT_OVERLAY_EVENT_FILTER_MASK, glutUseLayer(), _GLUTwindow::height, _GLUToverlay::isDirect, malloc, overlay, _GLUTwindow::overlay, _GLUToverlay::shownState, _GLUToverlay::transparentPixel, _GLUToverlay::vis, _GLUTwindow::width, _GLUToverlay::win, and _GLUTwindow::win.
00285 { 00286 GLUToverlay *overlay; 00287 GLUTwindow *window; 00288 XSetWindowAttributes wa; 00289 00290 /* Register a routine to free an overlay with glut_win.c; 00291 this keeps glut_win.c from pulling in all of 00292 glut_overlay.c when no overlay functionality is used by 00293 the application. */ 00294 __glutFreeOverlayFunc = __glutFreeOverlay; 00295 00296 window = __glutCurrentWindow; 00297 00298 /* Allow for an existant overlay to be re-established perhaps 00299 if you wanted a different display mode. */ 00300 if (window->overlay) { 00301 addStaleWindow(window, window->overlay->win); 00302 __glutFreeOverlay(window->overlay); 00303 } 00304 overlay = (GLUToverlay *) malloc(sizeof(GLUToverlay)); 00305 if (!overlay) 00306 __glutFatalError("out of memory."); 00307 00308 overlay->vis = __glutDetermineVisual(__glutDisplayMode, 00309 &overlay->fakeSingle, getOverlayVisualInfo); 00310 if (!overlay->vis) { 00311 __glutFatalError("lacks overlay support."); 00312 } 00313 overlay->ctx = glXCreateContext(__glutDisplay, overlay->vis, 00314 None, __glutTryDirect); 00315 overlay->isDirect = glXIsDirect(__glutDisplay, overlay->ctx); 00316 if (__glutForceDirect) { 00317 if (!overlay->isDirect) { 00318 __glutFatalError("direct rendering not possible."); 00319 } 00320 } 00321 __glutSetupColormap(overlay->vis, &(overlay->colormap), &(overlay->cmap)); 00322 overlay->transparentPixel = __glutGetTransparentPixel(__glutDisplay, 00323 overlay->vis); 00324 00325 wa.colormap = overlay->cmap; 00326 wa.background_pixel = overlay->transparentPixel; 00327 wa.event_mask = window->eventMask & GLUT_OVERLAY_EVENT_FILTER_MASK; 00328 wa.border_pixel = 0; 00329 overlay->win = XCreateWindow(__glutDisplay, 00330 window->win, 00331 0, 0, window->width, window->height, 0, 00332 overlay->vis->depth, InputOutput, overlay->vis->visual, 00333 CWBackPixel | CWBorderPixel | CWEventMask | CWColormap, 00334 &wa); 00335 if (window->children) { 00336 /* Overlay window must be lowered below any GLUT 00337 subwindows. */ 00338 XLowerWindow(__glutDisplay, overlay->win); 00339 } 00340 XMapWindow(__glutDisplay, overlay->win); 00341 overlay->shownState = 1; 00342 00343 overlay->damaged = 0; 00344 overlay->display = NULL; 00345 00346 /* Make sure a reshape gets delivered. */ 00347 window->forceReshape = True; 00348 00349 __glutPutOnWorkList(__glutToplevelOf(window), GLUT_COLORMAP_WORK); 00350 00351 window->overlay = overlay; 00352 glutUseLayer(GLUT_OVERLAY); 00353 } |
|
Definition at line 14 of file glut_ext.c.
00015 { 00016 static const GLubyte *extensions = NULL; 00017 const GLubyte *start; 00018 GLubyte *where, *terminator; 00019 00020 /* Extension names should not have spaces. */ 00021 where = (GLubyte *) strchr(extension, ' '); 00022 if (where || *extension == '\0') 00023 return 0; 00024 00025 if (!extensions) 00026 extensions = glGetString(GL_EXTENSIONS); 00027 /* It takes a bit of care to be fool-proof about parsing the 00028 OpenGL extensions string. Don't be fooled by sub-strings, 00029 etc. */ 00030 start = extensions; 00031 for (;;) { 00032 where = (GLubyte *) strstr((const char *)start, extension); 00033 if (!where) 00034 break; 00035 terminator = where + strlen(extension); 00036 if (where == start || *(where - 1) == ' ') { 00037 if (*terminator == ' ' || *terminator == '\0') { 00038 return 1; 00039 } 00040 } 00041 start = terminator; 00042 } 00043 return 0; 00044 } |
|
Definition at line 13 of file glut_fullscrn.c. References __glutPutOnWorkList(), __glutWarning(), GLUT_CONFIGURE_WORK, and GLUT_FULL_SCREEN_WORK.
00014 { 00015 if (__glutMotifHints == None) { 00016 __glutMotifHints = XInternAtom(__glutDisplay, "_MOTIF_WM_HINTS", 0); 00017 if (__glutMotifHints == None) { 00018 __glutWarning("Could not intern X atom for WM_COLORMAP_WINDOWS."); 00019 } 00020 } 00021 __glutCurrentWindow->desiredX = 0; 00022 __glutCurrentWindow->desiredY = 0; 00023 __glutCurrentWindow->desiredWidth = __glutScreenWidth; 00024 __glutCurrentWindow->desiredHeight = __glutScreenHeight; 00025 __glutCurrentWindow->desiredConfMask |= CWX | CWY | CWWidth | CWHeight; 00026 __glutPutOnWorkList(__glutCurrentWindow, 00027 GLUT_CONFIGURE_WORK | GLUT_FULL_SCREEN_WORK); 00028 } |
|
Definition at line 12 of file glut_get.c. References __glutDetermineVisual(), __glutInitTime(), __glutIsSupportedByGLX(), __glutWarning(), Bool, border, dummy, GETTIMEOFDAY, GLUT_DISPLAY_MODE_POSSIBLE, GLUT_ELAPSED_TIME, GLUT_INIT_DISPLAY_MODE, GLUT_INIT_WINDOW_HEIGHT, GLUT_INIT_WINDOW_WIDTH, GLUT_INIT_WINDOW_X, GLUT_INIT_WINDOW_Y, GLUT_MENU_NUM_ITEMS, GLUT_SCREEN_HEIGHT, GLUT_SCREEN_HEIGHT_MM, GLUT_SCREEN_WIDTH, GLUT_SCREEN_WIDTH_MM, GLUT_WINDOW_ACCUM_ALPHA_SIZE, GLUT_WINDOW_ACCUM_BLUE_SIZE, GLUT_WINDOW_ACCUM_GREEN_SIZE, GLUT_WINDOW_ACCUM_RED_SIZE, GLUT_WINDOW_ALPHA_SIZE, GLUT_WINDOW_BLUE_SIZE, GLUT_WINDOW_BUFFER_SIZE, GLUT_WINDOW_COLORMAP_SIZE, GLUT_WINDOW_CURSOR, GLUT_WINDOW_DEPTH_SIZE, GLUT_WINDOW_DOUBLEBUFFER, GLUT_WINDOW_GREEN_SIZE, GLUT_WINDOW_HEIGHT, GLUT_WINDOW_NUM_CHILDREN, GLUT_WINDOW_NUM_SAMPLES, GLUT_WINDOW_PARENT, GLUT_WINDOW_RED_SIZE, GLUT_WINDOW_RGBA, GLUT_WINDOW_STENCIL_SIZE, GLUT_WINDOW_STEREO, GLUT_WINDOW_WIDTH, GLUT_WINDOW_X, GLUT_WINDOW_Y, param, _GLUTwindow::siblings, TIMEDELTA, and win.
00013 { 00014 Window win, root; 00015 int x, y, value; 00016 unsigned int width, height, border, depth; 00017 00018 switch (param) { 00019 case GLUT_INIT_WINDOW_X: 00020 return __glutInitX; 00021 case GLUT_INIT_WINDOW_Y: 00022 return __glutInitY; 00023 case GLUT_INIT_WINDOW_WIDTH: 00024 return __glutInitWidth; 00025 case GLUT_INIT_WINDOW_HEIGHT: 00026 return __glutInitHeight; 00027 case GLUT_INIT_DISPLAY_MODE: 00028 return __glutDisplayMode; 00029 case GLUT_WINDOW_X: 00030 XTranslateCoordinates(__glutDisplay, __glutCurrentWindow->win, 00031 __glutRoot, 0, 0, &x, &y, &win); 00032 return x; 00033 case GLUT_WINDOW_Y: 00034 XTranslateCoordinates(__glutDisplay, __glutCurrentWindow->win, 00035 __glutRoot, 0, 0, &x, &y, &win); 00036 return y; 00037 case GLUT_WINDOW_WIDTH: 00038 if (!__glutCurrentWindow->reshape) { 00039 XGetGeometry(__glutDisplay, __glutCurrentWindow->win, 00040 &root, &x, &y, 00041 &width, &height, &border, &depth); 00042 return width; 00043 } 00044 return __glutCurrentWindow->width; 00045 case GLUT_WINDOW_HEIGHT: 00046 if (!__glutCurrentWindow->reshape) { 00047 XGetGeometry(__glutDisplay, __glutCurrentWindow->win, 00048 &root, &x, &y, 00049 &width, &height, &border, &depth); 00050 return height; 00051 } 00052 return __glutCurrentWindow->height; 00053 00054 #define GET_CONFIG(attrib) { \ 00055 if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { \ 00056 glXGetConfig(__glutDisplay, __glutCurrentWindow->vis, \ 00057 attrib, &value); \ 00058 } else { \ 00059 glXGetConfig(__glutDisplay, __glutCurrentWindow->overlay->vis, \ 00060 attrib, &value); \ 00061 } \ 00062 } 00063 00064 case GLUT_WINDOW_BUFFER_SIZE: 00065 GET_CONFIG(GLX_BUFFER_SIZE); 00066 return value; 00067 case GLUT_WINDOW_STENCIL_SIZE: 00068 GET_CONFIG(GLX_STENCIL_SIZE); 00069 return value; 00070 case GLUT_WINDOW_DEPTH_SIZE: 00071 GET_CONFIG(GLX_DEPTH_SIZE); 00072 return value; 00073 case GLUT_WINDOW_RED_SIZE: 00074 GET_CONFIG(GLX_RED_SIZE); 00075 return value; 00076 case GLUT_WINDOW_GREEN_SIZE: 00077 GET_CONFIG(GLX_GREEN_SIZE); 00078 return value; 00079 case GLUT_WINDOW_BLUE_SIZE: 00080 GET_CONFIG(GLX_BLUE_SIZE); 00081 return value; 00082 case GLUT_WINDOW_ALPHA_SIZE: 00083 GET_CONFIG(GLX_ALPHA_SIZE); 00084 return value; 00085 case GLUT_WINDOW_ACCUM_RED_SIZE: 00086 GET_CONFIG(GLX_ACCUM_RED_SIZE); 00087 return value; 00088 case GLUT_WINDOW_ACCUM_GREEN_SIZE: 00089 GET_CONFIG(GLX_ACCUM_GREEN_SIZE); 00090 return value; 00091 case GLUT_WINDOW_ACCUM_BLUE_SIZE: 00092 GET_CONFIG(GLX_ACCUM_BLUE_SIZE); 00093 return value; 00094 case GLUT_WINDOW_ACCUM_ALPHA_SIZE: 00095 GET_CONFIG(GLX_ACCUM_ALPHA_SIZE); 00096 return value; 00097 case GLUT_WINDOW_DOUBLEBUFFER: 00098 GET_CONFIG(GLX_DOUBLEBUFFER); 00099 return value; 00100 case GLUT_WINDOW_RGBA: 00101 GET_CONFIG(GLX_RGBA); 00102 return value; 00103 case GLUT_WINDOW_COLORMAP_SIZE: 00104 GET_CONFIG(GLX_RGBA); 00105 if (value) { 00106 return 0; 00107 } else { 00108 return __glutCurrentWindow->vis->visual->map_entries; 00109 } 00110 case GLUT_WINDOW_PARENT: 00111 return __glutCurrentWindow->parent ? 00112 __glutCurrentWindow->parent->num + 1 : 0; 00113 case GLUT_WINDOW_NUM_CHILDREN: 00114 { 00115 int num = 0; 00116 GLUTwindow *children = __glutCurrentWindow->children; 00117 00118 while (children) { 00119 num++; 00120 children = children->siblings; 00121 } 00122 return num; 00123 } 00124 case GLUT_WINDOW_NUM_SAMPLES: 00125 #if defined(GLX_VERSION_1_1) && defined(GLX_SGIS_multisample) 00126 if (__glutIsSupportedByGLX("GLX_SGIS_multisample")) { 00127 GET_CONFIG(GLX_SAMPLES_SGIS); 00128 return value; 00129 } else { 00130 return 0; 00131 } 00132 #else 00133 /* Independent of GLX server support, multisampling not 00134 supported by GLX client-side. */ 00135 return 0; 00136 #endif 00137 case GLUT_WINDOW_STEREO: 00138 GET_CONFIG(GLX_STEREO); 00139 return value; 00140 case GLUT_WINDOW_CURSOR: 00141 return __glutCurrentWindow->cursor; 00142 case GLUT_SCREEN_WIDTH: 00143 return DisplayWidth(__glutDisplay, __glutScreen); 00144 case GLUT_SCREEN_HEIGHT: 00145 return DisplayHeight(__glutDisplay, __glutScreen); 00146 case GLUT_SCREEN_WIDTH_MM: 00147 return DisplayWidthMM(__glutDisplay, __glutScreen); 00148 case GLUT_SCREEN_HEIGHT_MM: 00149 return DisplayHeightMM(__glutDisplay, __glutScreen); 00150 case GLUT_MENU_NUM_ITEMS: 00151 return __glutCurrentMenu->num; 00152 case GLUT_DISPLAY_MODE_POSSIBLE: 00153 { 00154 XVisualInfo *vi; 00155 Bool dummy; 00156 00157 vi = __glutDetermineVisual(__glutDisplayMode, &dummy, __glutGetVisualInfo); 00158 if (vi) { 00159 XFree(vi); 00160 return 1; 00161 } 00162 return 0; 00163 } 00164 case GLUT_ELAPSED_TIME: 00165 { 00166 struct timeval elapsed, beginning, now; 00167 00168 __glutInitTime(&beginning); 00169 GETTIMEOFDAY(&now); 00170 TIMEDELTA(elapsed, now, beginning); 00171 /* Return elapsed milliseconds. */ 00172 #if defined(__vms) 00173 return (int) (elapsed.val / TICKS_PER_MILLISECOND); 00174 #else 00175 return (int) ((elapsed.tv_sec * 1000) + (elapsed.tv_usec / 1000)); 00176 #endif 00177 } 00178 default: 00179 __glutWarning("invalid glutGet parameter: %d", param); 00180 return -1; 00181 } 00182 } |
|
Definition at line 182 of file glut_cindex.c. References __glutWarning(), _GLUTcolormap::cells, and _GLUTcolorcell::component.
00183 { 00184 GLUTcolormap *colormap; 00185 XVisualInfo *vis; 00186 00187 if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { 00188 colormap = __glutCurrentWindow->colormap; 00189 vis = __glutCurrentWindow->vis; 00190 } else { 00191 colormap = __glutCurrentWindow->overlay->colormap; 00192 vis = __glutCurrentWindow->overlay->vis; 00193 if (ndx == __glutCurrentWindow->overlay->transparentPixel) { 00194 __glutWarning("glutGetColor: requesting overlay transparent index %d\n", 00195 ndx); 00196 return -1.0; 00197 } 00198 } 00199 00200 if (!colormap) { 00201 __glutWarning("glutGetColor: current window is RGBA"); 00202 return -1.0; 00203 } 00204 if (ndx >= vis->visual->map_entries || ndx < 0) { 00205 __glutWarning("glutGetColor: index %d out of range", ndx); 00206 return -1.0; 00207 } 00208 return colormap->cells[ndx].component[comp]; 00209 } |
|
Definition at line 683 of file glut_menu.c. References _GLUTmenu::id.
00684 { 00685 if (__glutCurrentMenu) { 00686 return __glutCurrentMenu->id + 1; 00687 } else { 00688 return 0; 00689 } 00690 } |
|
Definition at line 13 of file glut_modifier.c. References __glutWarning(), GLUT_ACTIVE_ALT, GLUT_ACTIVE_CTRL, and GLUT_ACTIVE_SHIFT.
00014 { 00015 int modifiers; 00016 00017 if(__glutModifierMask == (unsigned int) ~0) { 00018 __glutWarning( 00019 "glutCurrentModifiers: do not call outside core input callback."); 00020 return 0; 00021 } 00022 modifiers = 0; 00023 if(__glutModifierMask & (ShiftMask|LockMask)) 00024 modifiers |= GLUT_ACTIVE_SHIFT; 00025 if(__glutModifierMask & ControlMask) 00026 modifiers |= GLUT_ACTIVE_CTRL; 00027 if(__glutModifierMask & Mod1Mask) 00028 modifiers |= GLUT_ACTIVE_ALT; 00029 return modifiers; 00030 } |
|
Definition at line 111 of file glut_win.c. References _GLUTwindow::num.
00112 { 00113 if (__glutCurrentWindow) { 00114 return __glutCurrentWindow->num + 1; 00115 } else { 00116 return 0; 00117 } 00118 } |
|
Definition at line 412 of file glut_overlay.c. References __glutWarning().
00413 { 00414 if (!__glutCurrentWindow->overlay) { 00415 __glutWarning("glutHideOverlay: window has no overlay established"); 00416 return; 00417 } 00418 XUnmapWindow(__glutDisplay, __glutCurrentWindow->overlay->win); 00419 __glutCurrentWindow->overlay->shownState = 0; 00420 } |
|
Definition at line 102 of file glut_winmisc.c. References __glutPutOnWorkList(), and GLUT_MAP_WORK.
00103 { 00104 __glutCurrentWindow->desiredMapState = WithdrawnState; 00105 __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK); 00106 } |
|
Definition at line 87 of file glut_winmisc.c. References __glutPutOnWorkList(), and GLUT_MAP_WORK.
00088 { 00089 assert(!__glutCurrentWindow->parent); 00090 __glutCurrentWindow->desiredMapState = IconicState; 00091 __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK); 00092 } |
|
|
|
Definition at line 105 of file glut_init.c. References __glutArgc, __glutArgv, __glutDebug, __glutDisplay, __glutFatalError(), __glutForceDirect, __glutIconic, __glutInitHeight, __glutInitTime(), __glutInitWidth, __glutInitX, __glutInitY, __glutOpenXConnection(), __glutProgramName, __glutScreen, __glutSizeHints, __glutTryDirect, __glutWarning(), display, flags, glutInitWindowPosition(), glutInitWindowSize(), i, malloc, removeArgs(), and synchronize.
00106 { 00107 char *display = NULL; 00108 char *str; 00109 struct timeval unused; 00110 int i; 00111 00112 if (__glutDisplay) { 00113 __glutWarning("glutInit being called a second time."); 00114 return; 00115 } 00116 /* determine temporary program name */ 00117 str = strrchr(argv[0], '/'); 00118 if (str == NULL) { 00119 __glutProgramName = argv[0]; 00120 } else { 00121 __glutProgramName = str + 1; 00122 } 00123 00124 /* make private copy of command line arguments */ 00125 __glutArgc = *argcp; 00126 __glutArgv = (char **) malloc(__glutArgc * sizeof(char *)); 00127 if (!__glutArgv) 00128 __glutFatalError("out of memory."); 00129 for (i = 0; i < __glutArgc; i++) { 00130 __glutArgv[i] = strdup(argv[i]); 00131 if (!__glutArgv[i]) 00132 __glutFatalError("out of memory."); 00133 } 00134 00135 /* determine permanent program name */ 00136 str = strrchr(__glutArgv[0], '/'); 00137 if (str == NULL) { 00138 __glutProgramName = __glutArgv[0]; 00139 } else { 00140 __glutProgramName = str + 1; 00141 } 00142 00143 /* parse arguments for standard options */ 00144 for (i = 1; i < __glutArgc; i++) { 00145 if (!strcmp(__glutArgv[i], "-display")) { 00146 if (++i >= __glutArgc) { 00147 __glutFatalError( 00148 "follow -display option with X display name."); 00149 } 00150 display = __glutArgv[i]; 00151 removeArgs(argcp, &argv[1], 2); 00152 } else if (!strcmp(__glutArgv[i], "-geometry")) { 00153 int flags, x, y, width, height; 00154 00155 if (++i >= __glutArgc) { 00156 __glutFatalError( 00157 "follow -geometry option with geometry parameter."); 00158 } 00159 /* Fix bogus "{width|height} may be used before set" 00160 warning */ 00161 width = 0; 00162 height = 0; 00163 00164 flags = XParseGeometry(__glutArgv[i], &x, &y, 00165 (unsigned int *) &width, (unsigned int *) &height); 00166 if (WidthValue & flags) { 00167 /* Careful because X does not allow zero or negative 00168 width windows */ 00169 if (width > 0) 00170 __glutInitWidth = width; 00171 } 00172 if (HeightValue & flags) { 00173 /* Careful because X does not allow zero or negative 00174 height windows */ 00175 if (height > 0) 00176 __glutInitHeight = height; 00177 } 00178 glutInitWindowSize(__glutInitWidth, __glutInitHeight); 00179 if (XValue & flags) { 00180 if (XNegative & flags) 00181 x = DisplayWidth(__glutDisplay, __glutScreen) + 00182 x - __glutSizeHints.width; 00183 /* Play safe: reject negative X locations */ 00184 if (x >= 0) 00185 __glutInitX = x; 00186 } 00187 if (YValue & flags) { 00188 if (YNegative & flags) 00189 y = DisplayHeight(__glutDisplay, __glutScreen) + 00190 y - __glutSizeHints.height; 00191 /* Play safe: reject negative Y locations */ 00192 if (y >= 0) 00193 __glutInitY = y; 00194 } 00195 glutInitWindowPosition(__glutInitX, __glutInitY); 00196 removeArgs(argcp, &argv[1], 2); 00197 } else if (!strcmp(__glutArgv[i], "-direct")) { 00198 if (!__glutTryDirect) 00199 __glutFatalError( 00200 "cannot force both direct and indirect rendering."); 00201 __glutForceDirect = GL_TRUE; 00202 removeArgs(argcp, &argv[1], 1); 00203 } else if (!strcmp(__glutArgv[i], "-indirect")) { 00204 if (__glutForceDirect) 00205 __glutFatalError( 00206 "cannot force both direct and indirect rendering."); 00207 __glutTryDirect = GL_FALSE; 00208 removeArgs(argcp, &argv[1], 1); 00209 } else if (!strcmp(__glutArgv[i], "-iconic")) { 00210 __glutIconic = GL_TRUE; 00211 removeArgs(argcp, &argv[1], 1); 00212 } else if (!strcmp(__glutArgv[i], "-gldebug")) { 00213 __glutDebug = GL_TRUE; 00214 removeArgs(argcp, &argv[1], 1); 00215 } else if (!strcmp(__glutArgv[i], "-sync")) { 00216 synchronize = GL_TRUE; 00217 removeArgs(argcp, &argv[1], 1); 00218 } else { 00219 /* once unknown option encountered, stop command line 00220 processing */ 00221 break; 00222 } 00223 } 00224 __glutOpenXConnection(display); 00225 __glutInitTime(&unused); 00226 } |
|
Definition at line 257 of file glut_init.c. References __glutDisplayMode.
00258 { 00259 __glutDisplayMode = mask; 00260 } |
|
Definition at line 229 of file glut_init.c. References __glutInitX, __glutInitY, and __glutSizeHints. Referenced by glutInit().
00230 { 00231 __glutInitX = x; 00232 __glutInitY = y; 00233 if (x >= 0 && y >= 0) { 00234 __glutSizeHints.x = x; 00235 __glutSizeHints.y = y; 00236 __glutSizeHints.flags |= USPosition; 00237 } else { 00238 __glutSizeHints.flags &= ~USPosition; 00239 } 00240 } |
|
Definition at line 243 of file glut_init.c. References __glutInitHeight, __glutInitWidth, and __glutSizeHints. Referenced by glutInit().
00244 { 00245 __glutInitWidth = width; 00246 __glutInitHeight = height; 00247 if (width > 0 && height > 0) { 00248 __glutSizeHints.width = width; 00249 __glutSizeHints.height = height; 00250 __glutSizeHints.flags |= USSize; 00251 } else { 00252 __glutSizeHints.flags &= ~USSize; 00253 } 00254 } |
|
|
|
Definition at line 434 of file glut_overlay.c. References __glutDetermineVisual(), __glutWarning(), Bool, dummy, getOverlayVisualInfo(), GLUT_HAS_OVERLAY, GLUT_LAYER_IN_USE, GLUT_NORMAL_DAMAGED, GLUT_OVERLAY_DAMAGED, GLUT_OVERLAY_POSSIBLE, GLUT_TRANSPARENT_INDEX, and param.
00435 { 00436 switch (param) { 00437 case GLUT_OVERLAY_POSSIBLE: 00438 { 00439 XVisualInfo *vi; 00440 Bool dummy; 00441 00442 vi = __glutDetermineVisual(__glutDisplayMode, &dummy, getOverlayVisualInfo); 00443 if (vi) { 00444 XFree(vi); 00445 return 1; 00446 } 00447 return 0; 00448 } 00449 case GLUT_LAYER_IN_USE: 00450 return __glutCurrentWindow->renderWin != __glutCurrentWindow->win; 00451 case GLUT_HAS_OVERLAY: 00452 return __glutCurrentWindow->overlay != NULL; 00453 case GLUT_TRANSPARENT_INDEX: 00454 if (__glutCurrentWindow->overlay) { 00455 return __glutCurrentWindow->overlay->transparentPixel; 00456 } else { 00457 return -1; 00458 } 00459 case GLUT_NORMAL_DAMAGED: 00460 /* __glutWindowDamaged is used so the damage state within 00461 the window (or overlay belwo) can be cleared before 00462 calling a display callback so on return, the state does 00463 not have to be cleared (since upon return from the 00464 callback the window could be destroyed (or layer 00465 removed). */ 00466 return __glutCurrentWindow->damaged || __glutWindowDamaged; 00467 case GLUT_OVERLAY_DAMAGED: 00468 if (__glutCurrentWindow->overlay) { 00469 return __glutCurrentWindow->overlay->damaged || __glutWindowDamaged; 00470 } else { 00471 return -1; 00472 } 00473 default: 00474 __glutWarning("invalid glutLayerGet param: %d", param); 00475 return -1; 00476 } 00477 } |
|
Definition at line 945 of file glut_event.c. References __glutFatalUsage(), __glutIdleFunc, idleWait(), processEvents(), processWindowWorkList(), and waitForSomething().
00946 { 00947 if (!__glutDisplay) 00948 __glutFatalUsage("main loop entered with out X connection."); 00949 if (!__glutWindowListSize) 00950 __glutFatalUsage( 00951 "main loop entered with no windows created."); 00952 for (;;) { 00953 if (__glutWindowWorkList) { 00954 GLUTwindow *remainder, *work; 00955 00956 work = __glutWindowWorkList; 00957 __glutWindowWorkList = NULL; 00958 if (work) { 00959 remainder = processWindowWorkList(work); 00960 if (remainder) { 00961 *beforeEnd = __glutWindowWorkList; 00962 __glutWindowWorkList = remainder; 00963 } 00964 } 00965 } 00966 if (__glutIdleFunc || __glutWindowWorkList) { 00967 idleWait(); 00968 } else { 00969 if (__glutTimerList) { 00970 waitForSomething(); 00971 } else { 00972 processEvents(); 00973 } 00974 } 00975 } 00976 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 71 of file glut_winmisc.c. References __glutPutOnWorkList(), and GLUT_CONFIGURE_WORK.
00072 { 00073 __glutCurrentWindow->desiredStack = Above; 00074 __glutCurrentWindow->desiredConfMask |= CWStackMode; 00075 __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK); 00076 } |
|
Definition at line 50 of file glut_winmisc.c. References __glutPutOnWorkList(), and GLUT_CONFIGURE_WORK.
00051 { 00052 __glutCurrentWindow->desiredX = x; 00053 __glutCurrentWindow->desiredY = y; 00054 __glutCurrentWindow->desiredConfMask |= CWX | CWY; 00055 __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK); 00056 } |
|
Definition at line 396 of file glut_overlay.c. References __glutPostRedisplay(), and GLUT_OVERLAY_REDISPLAY_WORK.
00397 { 00398 __glutPostRedisplay(__glutCurrentWindow, GLUT_OVERLAY_REDISPLAY_WORK); 00399 } |
|
Definition at line 156 of file glut_event.c. References __glutPostRedisplay(), and GLUT_REDISPLAY_WORK.
00157 { 00158 __glutPostRedisplay(__glutCurrentWindow, GLUT_REDISPLAY_WORK); 00159 } |
|
Definition at line 79 of file glut_winmisc.c. References __glutPutOnWorkList(), and GLUT_CONFIGURE_WORK.
00080 { 00081 __glutCurrentWindow->desiredStack = Below; 00082 __glutCurrentWindow->desiredConfMask |= CWStackMode; 00083 __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK); 00084 } |
|
Definition at line 837 of file glut_menu.c. References __glutWarning(), free, i, _GLUTmenuItem::label, _GLUTmenu::list, _GLUTmenu::managed, menuModificationError(), _GLUTmenuItem::next, _GLUTmenu::num, _GLUTmenuItem::pixwidth, and _GLUTmenu::pixwidth.
00838 { 00839 GLUTmenuItem *item, **prev, *remaining; 00840 int pixwidth, i; 00841 00842 if (__glutMappedMenu) 00843 menuModificationError(); 00844 i = __glutCurrentMenu->num; 00845 prev = &__glutCurrentMenu->list; 00846 item = __glutCurrentMenu->list; 00847 /* If menu item is removed, the menu's pixwidth may need to 00848 be recomputed. */ 00849 pixwidth = 0; 00850 while (item) { 00851 if (i == num) { 00852 /* If this menu item's pixwidth is as wide as the menu's 00853 pixwidth, removing this menu item will necessitate 00854 shrinking the menu's pixwidth. */ 00855 if (item->pixwidth >= __glutCurrentMenu->pixwidth) { 00856 /* Continue recalculating menu pixwidth, first skipping 00857 the removed item. */ 00858 remaining = item->next; 00859 while (remaining) { 00860 if (remaining->pixwidth > pixwidth) { 00861 pixwidth = remaining->pixwidth; 00862 } 00863 remaining = remaining->next; 00864 } 00865 } 00866 __glutCurrentMenu->num--; 00867 __glutCurrentMenu->managed = False; 00868 __glutCurrentMenu->pixwidth = pixwidth; 00869 00870 /* Patch up menu's item list. */ 00871 *prev = item->next; 00872 00873 free(item->label); 00874 free(item); 00875 return; 00876 } 00877 if (item->pixwidth > pixwidth) { 00878 pixwidth = item->pixwidth; 00879 } 00880 i--; 00881 prev = &item->next; 00882 item = item->next; 00883 } 00884 __glutWarning("Current menu has no %d item.", num); 00885 } |
|
Definition at line 356 of file glut_overlay.c. References __glutFreeOverlay(), __glutPutOnWorkList(), __glutToplevelOf(), addStaleWindow(), GLUT_COLORMAP_WORK, glutUseLayer(), overlay, _GLUTwindow::overlay, _GLUTwindow::renderWin, and _GLUToverlay::win.
00357 { 00358 GLUTwindow *window = __glutCurrentWindow; 00359 GLUToverlay *overlay = __glutCurrentWindow->overlay; 00360 00361 if (!window->overlay) 00362 return; 00363 00364 /* If using overlay, switch to the normal layer. */ 00365 if (window->renderWin == overlay->win) { 00366 glutUseLayer(GLUT_NORMAL); 00367 } 00368 addStaleWindow(window, overlay->win); 00369 __glutFreeOverlay(overlay); 00370 window->overlay = NULL; 00371 __glutPutOnWorkList(__glutToplevelOf(window), GLUT_COLORMAP_WORK); 00372 } |
|
|
|
Definition at line 59 of file glut_winmisc.c. References __glutPutOnWorkList(), __glutWarning(), and GLUT_CONFIGURE_WORK.
00060 { 00061 if(w <= 0 || h <= 0) 00062 __glutWarning("glutReshapeWindow: non-positive width or height not allowed"); 00063 00064 __glutCurrentWindow->desiredWidth = w; 00065 __glutCurrentWindow->desiredHeight = h; 00066 __glutCurrentWindow->desiredConfMask |= CWWidth | CWHeight; 00067 __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK); 00068 } |
|
Definition at line 90 of file glut_cindex.c. References __glutPutOnWorkList(), __glutToplevelOf(), __glutWarning(), associateNewColormap(), _GLUTcolormap::cells, CLAMP, cmap, _GLUTcolormap::cmap, _GLUTwindow::cmap, color, _GLUTcolorcell::component, GLUT_BLUE, GLUT_COLORMAP_WORK, GLUT_GREEN, GLUT_RED, i, _GLUTcolormap::refcnt, and _GLUTcolormap::size.
00091 { 00092 GLUTcolormap *cmap, *newcmap; 00093 XVisualInfo *vis; 00094 XColor color; 00095 int i; 00096 00097 if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { 00098 cmap = __glutCurrentWindow->colormap; 00099 vis = __glutCurrentWindow->vis; 00100 } else { 00101 cmap = __glutCurrentWindow->overlay->colormap; 00102 vis = __glutCurrentWindow->overlay->vis; 00103 if (ndx == __glutCurrentWindow->overlay->transparentPixel) { 00104 __glutWarning( 00105 "glutSetColor: cannot set color of overlay transparent index %d\n", 00106 ndx); 00107 return; 00108 } 00109 } 00110 00111 if (!cmap) { 00112 __glutWarning("glutSetColor: current window is RGBA"); 00113 return; 00114 } 00115 if (ndx >= vis->visual->map_entries || 00116 ndx < 0) { 00117 __glutWarning("glutSetColor: index %d out of range", ndx); 00118 return; 00119 } 00120 if (cmap->refcnt > 1) { 00121 GLUTwindow *toplevel; 00122 00123 newcmap = associateNewColormap(vis); 00124 cmap->refcnt--; 00125 /* Wouldn't it be nice if XCopyColormapAndFree could be 00126 told not to free the old colormap's entries! */ 00127 for (i = cmap->size - 1; i >= 0; i--) { 00128 if (i == ndx) { 00129 /* We are going to set this cell shortly! */ 00130 continue; 00131 } 00132 if (cmap->cells[i].component[GLUT_RED] >= 0.0) { 00133 color.pixel = i; 00134 newcmap->cells[i].component[GLUT_RED] = 00135 cmap->cells[i].component[GLUT_RED]; 00136 color.red = (GLfloat) 0xffff * 00137 cmap->cells[i].component[GLUT_RED]; 00138 newcmap->cells[i].component[GLUT_GREEN] = 00139 cmap->cells[i].component[GLUT_GREEN]; 00140 color.green = (GLfloat) 0xffff * 00141 cmap->cells[i].component[GLUT_GREEN]; 00142 newcmap->cells[i].component[GLUT_BLUE] = 00143 cmap->cells[i].component[GLUT_BLUE]; 00144 color.blue = (GLfloat) 0xffff * 00145 cmap->cells[i].component[GLUT_BLUE]; 00146 color.flags = DoRed | DoGreen | DoBlue; 00147 XStoreColor(__glutDisplay, newcmap->cmap, &color); 00148 } else { 00149 /* leave unallocated entries unallocated */ 00150 } 00151 } 00152 cmap = newcmap; 00153 if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { 00154 __glutCurrentWindow->colormap = cmap; 00155 __glutCurrentWindow->cmap = cmap->cmap; 00156 } else { 00157 __glutCurrentWindow->overlay->colormap = cmap; 00158 __glutCurrentWindow->overlay->cmap = cmap->cmap; 00159 } 00160 XSetWindowColormap(__glutDisplay, __glutCurrentWindow->renderWin, cmap->cmap); 00161 00162 toplevel = __glutToplevelOf(__glutCurrentWindow); 00163 if (toplevel->cmap != cmap->cmap) { 00164 __glutPutOnWorkList(toplevel, GLUT_COLORMAP_WORK); 00165 } 00166 } 00167 color.pixel = ndx; 00168 red = CLAMP(red); 00169 cmap->cells[ndx].component[GLUT_RED] = red; 00170 color.red = (GLfloat) 0xffff *red; 00171 green = CLAMP(green); 00172 cmap->cells[ndx].component[GLUT_GREEN] = green; 00173 color.green = (GLfloat) 0xffff *green; 00174 blue = CLAMP(blue); 00175 cmap->cells[ndx].component[GLUT_BLUE] = blue; 00176 color.blue = (GLfloat) 0xffff *blue; 00177 color.flags = DoRed | DoGreen | DoBlue; 00178 XStoreColor(__glutDisplay, cmap->cmap, &color); 00179 } |
|
Definition at line 92 of file glut_cursor.c. References blankCursor, _CursorTable::cursor, fullCrosshairCusor, getFullCrosshairCursor(), GLUT_CURSOR_FULL_CROSSHAIR, GLUT_CURSOR_INHERIT, GLUT_CURSOR_NONE, and makeBlankCursor().
00093 { 00094 Cursor xcursor; 00095 00096 if (cursor >= 0 && 00097 cursor < sizeof(cursorTable) / sizeof(cursorTable[0])) { 00098 if (cursorTable[cursor].cursor == None) 00099 cursorTable[cursor].cursor = XCreateFontCursor(__glutDisplay, 00100 cursorTable[cursor].glyph); 00101 xcursor = cursorTable[cursor].cursor; 00102 } else { 00103 /* Special cases. */ 00104 switch (cursor) { 00105 case GLUT_CURSOR_INHERIT: 00106 xcursor = None; 00107 break; 00108 case GLUT_CURSOR_NONE: 00109 if (blankCursor == None) 00110 blankCursor = makeBlankCursor(); 00111 xcursor = blankCursor; 00112 break; 00113 case GLUT_CURSOR_FULL_CROSSHAIR: 00114 if (fullCrosshairCusor == None) 00115 fullCrosshairCusor = getFullCrosshairCursor(); 00116 xcursor = fullCrosshairCusor; 00117 break; 00118 } 00119 } 00120 __glutCurrentWindow->cursor = cursor; 00121 XDefineCursor(__glutDisplay, 00122 __glutCurrentWindow->win, xcursor); 00123 XFlush(__glutDisplay); 00124 } |
|
Definition at line 35 of file glut_winmisc.c.
00036 { 00037 XTextProperty textprop; 00038 00039 assert(!__glutCurrentWindow->parent); 00040 textprop.value = (unsigned char *) title; 00041 textprop.encoding = XA_STRING; 00042 textprop.format = 8; 00043 textprop.nitems = strlen(title); 00044 XSetWMIconName(__glutDisplay, 00045 __glutCurrentWindow->win, &textprop); 00046 XFlush(__glutDisplay); 00047 } |
|
Definition at line 693 of file glut_menu.c. References __glutSetMenu(), __glutWarning(), and menuListSize.
00694 { 00695 GLUTmenu *menu; 00696 00697 if (menuid < 1 || menuid > menuListSize) { 00698 __glutWarning("glutSetMenu attempted on bogus menu."); 00699 return; 00700 } 00701 menu = menuList[menuid - 1]; 00702 if (!menu) { 00703 __glutWarning("glutSetMenu attempted on bogus menu."); 00704 return; 00705 } 00706 __glutSetMenu(menu); 00707 } |
|
Definition at line 153 of file glut_win.c. References __glutSetWindow(), __glutWarning(), __glutWindowListSize, and win.
00154 { 00155 GLUTwindow *window; 00156 00157 if (win < 1 || win > __glutWindowListSize) { 00158 __glutWarning("glutWindowSet attempted on bogus window."); 00159 return; 00160 } 00161 window = __glutWindowList[win - 1]; 00162 if (!window) { 00163 __glutWarning("glutWindowSet attempted on bogus window."); 00164 return; 00165 } 00166 __glutSetWindow(window); 00167 } |
|
Definition at line 20 of file glut_winmisc.c.
00021 { 00022 XTextProperty textprop; 00023 00024 assert(!__glutCurrentWindow->parent); 00025 textprop.value = (unsigned char *) title; 00026 textprop.encoding = XA_STRING; 00027 textprop.format = 8; 00028 textprop.nitems = strlen(title); 00029 XSetWMName(__glutDisplay, 00030 __glutCurrentWindow->win, &textprop); 00031 XFlush(__glutDisplay); 00032 } |
|
Definition at line 423 of file glut_overlay.c. References __glutWarning().
00424 { 00425 if (!__glutCurrentWindow->overlay) { 00426 __glutWarning("glutShowOverlay: window has no overlay established"); 00427 return; 00428 } 00429 XMapWindow(__glutDisplay, __glutCurrentWindow->overlay->win); 00430 __glutCurrentWindow->overlay->shownState = 1; 00431 } |
|
Definition at line 95 of file glut_winmisc.c. References __glutPutOnWorkList(), and GLUT_MAP_WORK.
00096 { 00097 __glutCurrentWindow->desiredMapState = NormalState; 00098 __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK); 00099 } |
|
Definition at line 103 of file glut_shapes.c. References base, QUAD_OBJ_INIT, and quadObj.
00105 { 00106 QUAD_OBJ_INIT(); 00107 gluQuadricDrawStyle(quadObj, GLU_FILL); 00108 gluQuadricNormals(quadObj, GLU_SMOOTH); 00109 /* If we ever changed/used the texture or orientation state 00110 of quadObj, we'd need to change it to the defaults here 00111 with gluQuadricTexture and/or gluQuadricOrientation. */ 00112 gluCylinder(quadObj, base, 0.0, height, slices, stacks); 00113 } |
|
Definition at line 183 of file glut_shapes.c. References drawBox().
00184 { 00185 drawBox(-size / 2., size / 2., 00186 -size / 2., size / 2., 00187 -size / 2., size / 2., 00188 GL_QUADS); 00189 } |
|
Definition at line 385 of file glut_shapes.c. References dodecahedron().
00386 { 00387 dodecahedron(GL_TRIANGLE_FAN); 00388 } |
|
Definition at line 567 of file glut_shapes.c. References icosahedron().
00568 { 00569 icosahedron(GL_TRIANGLES); 00570 } |
|
Definition at line 499 of file glut_shapes.c. References octahedron().
00500 { 00501 octahedron(GL_TRIANGLES); 00502 } |
|
Definition at line 78 of file glut_shapes.c. References QUAD_OBJ_INIT, and quadObj.
00079 { 00080 QUAD_OBJ_INIT(); 00081 gluQuadricDrawStyle(quadObj, GLU_FILL); 00082 gluQuadricNormals(quadObj, GLU_SMOOTH); 00083 /* If we ever changed/used the texture or orientation state 00084 of quadObj, we'd need to change it to the defaults here 00085 with gluQuadricTexture and/or gluQuadricOrientation. */ 00086 gluSphere(quadObj, radius, slices, stacks); 00087 } |
|
Definition at line 196 of file glut_teapot.c. References scale, and teapot().
|
|
Definition at line 608 of file glut_shapes.c. References tetrahedron().
00609 { 00610 tetrahedron(GL_TRIANGLES); 00611 } |
|
Definition at line 262 of file glut_shapes.c. References doughnut().
00264 { 00265 doughnut(innerRadius, outerRadius, nsides, rings, GL_QUADS); 00266 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 813 of file glut_win.c. References _GLUTwindow::fakeSingle, _GLUToverlay::fakeSingle, _GLUTwindow::overlay, _GLUTwindow::renderWin, and _GLUTwindow::win.
00814 { 00815 GLUTwindow *window = __glutCurrentWindow; 00816 00817 if (window->renderWin == window->win) { 00818 if (__glutCurrentWindow->fakeSingle) { 00819 /* Pretend the double buffered window is single buffered, 00820 so treat glutSwapBuffers as a no-op */ 00821 return; 00822 } 00823 } else { 00824 if (__glutCurrentWindow->overlay->fakeSingle) { 00825 /* Pretend the double buffered overlay is single 00826 buffered, so treat glutSwapBuffers as a no-op. */ 00827 return; 00828 } 00829 } 00830 glXSwapBuffers(__glutDisplay, __glutCurrentWindow->renderWin); 00831 } |
|
|
|
|
|
|
|
Definition at line 375 of file glut_overlay.c. References __glutSetWindow(), __glutWarning(), _GLUTwindow::ctx, _GLUToverlay::ctx, _GLUTwindow::overlay, _GLUTwindow::renderCtx, _GLUTwindow::renderWin, _GLUTwindow::win, and _GLUToverlay::win. Referenced by glutEstablishOverlay(), and glutRemoveOverlay().
00376 { 00377 GLUTwindow *window = __glutCurrentWindow; 00378 00379 switch (layer) { 00380 case GLUT_NORMAL: 00381 window->renderWin = window->win; 00382 window->renderCtx = window->ctx; 00383 break; 00384 case GLUT_OVERLAY: 00385 window->renderWin = window->overlay->win; 00386 window->renderCtx = window->overlay->ctx; 00387 break; 00388 default: 00389 __glutWarning("glutUseLayer: unknown layer, %d.", layer); 00390 break; 00391 } 00392 __glutSetWindow(window); 00393 } |
|
|
|
Definition at line 90 of file glut_shapes.c. References base, QUAD_OBJ_INIT, and quadObj.
00092 { 00093 QUAD_OBJ_INIT(); 00094 gluQuadricDrawStyle(quadObj, GLU_LINE); 00095 gluQuadricNormals(quadObj, GLU_SMOOTH); 00096 /* If we ever changed/used the texture or orientation state 00097 of quadObj, we'd need to change it to the defaults here 00098 with gluQuadricTexture and/or gluQuadricOrientation. */ 00099 gluCylinder(quadObj, base, 0.0, height, slices, stacks); 00100 } |
|
Definition at line 174 of file glut_shapes.c. References drawBox().
00175 { 00176 drawBox(-size / 2., size / 2., 00177 -size / 2., size / 2., 00178 -size / 2., size / 2., 00179 GL_LINE_LOOP); 00180 } |
|
Definition at line 379 of file glut_shapes.c. References dodecahedron().
00380 { 00381 dodecahedron(GL_LINE_LOOP); 00382 } |
|
Definition at line 561 of file glut_shapes.c. References icosahedron().
00562 { 00563 icosahedron(GL_LINE_LOOP); 00564 } |
|
Definition at line 493 of file glut_shapes.c. References octahedron().
00494 { 00495 octahedron(GL_LINE_LOOP); 00496 } |
|
Definition at line 66 of file glut_shapes.c. References QUAD_OBJ_INIT, and quadObj.
00067 { 00068 QUAD_OBJ_INIT(); 00069 gluQuadricDrawStyle(quadObj, GLU_LINE); 00070 gluQuadricNormals(quadObj, GLU_SMOOTH); 00071 /* If we ever changed/used the texture or orientation state 00072 of quadObj, we'd need to change it to the defaults here 00073 with gluQuadricTexture and/or gluQuadricOrientation. */ 00074 gluSphere(quadObj, radius, slices, stacks); 00075 } |
|
Definition at line 202 of file glut_teapot.c. References scale, and teapot().
|
|
Definition at line 602 of file glut_shapes.c. References tetrahedron().
00603 { 00604 tetrahedron(GL_LINE_LOOP); 00605 } |
|
Definition at line 254 of file glut_shapes.c. References doughnut().
00256 { 00257 doughnut(innerRadius, outerRadius, 00258 nsides, rings, GL_LINE_LOOP); 00259 } |
Variable Documentation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|