From 68fc4b415e322f6744299e39864fbc377c6eff74 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 21 May 2010 09:32:38 -0700 Subject: Remove demos that have moved to git+ssh://git.freedesktop.org/git/mesa/demos. The remaining programs are ones I've had difficulty finding a build environment for to make the build system or are unit tests that should probably live next to their code instead. Hopefully people can bring over the build for remaining pieces they care about. --- progs/xdemos/pbdemo.c | 493 -------------------------------------------------- 1 file changed, 493 deletions(-) delete mode 100644 progs/xdemos/pbdemo.c (limited to 'progs/xdemos/pbdemo.c') diff --git a/progs/xdemos/pbdemo.c b/progs/xdemos/pbdemo.c deleted file mode 100644 index 277df72924..0000000000 --- a/progs/xdemos/pbdemo.c +++ /dev/null @@ -1,493 +0,0 @@ - -/* - * This program demonstrates how to do "off-screen" rendering using - * the GLX pixel buffer extension. - * - * Written by Brian Paul for the "OpenGL and Window System Integration" - * course presented at SIGGRAPH '97. Updated on 5 October 2002. - * - * Usage: - * pbuffers width height imgfile - * Where: - * width is the width, in pixels, of the image to generate. - * height is the height, in pixels, of the image to generate. - * imgfile is the name of the PPM image file to write. - * - * - * This demo draws 3-D boxes with random orientation. A pbuffer with - * a depth (Z) buffer is prefered but if such a pbuffer can't be created - * we use a non-depth-buffered config. - * - * On machines such as the SGI Indigo you may have to reconfigure your - * display/X server to enable pbuffers. Look in the /usr/gfx/ucode/MGRAS/vof/ - * directory for display configurationswith the _pbuf suffix. Use - * setmon -x to configure your X server and display for pbuffers. - * - * O2 systems seem to support pbuffers well. - * - * IR systems (at least 1RM systems) don't have single-buffered, RGBA, - * Z-buffered pbuffer configs. BUT, they DO have DOUBLE-buffered, RGBA, - * Z-buffered pbuffers. Note how we try four different fbconfig attribute - * lists below! - */ - - -#include -#include -#include -#include -#include -#include "pbutil.h" - - -/* Some ugly global vars */ -static Display *gDpy = NULL; -static int gScreen = 0; -static FBCONFIG gFBconfig = 0; -static PBUFFER gPBuffer = 0; -static int gWidth, gHeight; -static GLXContext glCtx; - - - -/* - * Create the pbuffer and return a GLXPbuffer handle. - * - * We loop over a list of fbconfigs trying to create - * a pixel buffer. We return the first pixel buffer which we successfully - * create. - */ -static PBUFFER -MakePbuffer( Display *dpy, int screen, int width, int height ) -{ -#define NUM_FB_CONFIGS 4 - const char fbString[NUM_FB_CONFIGS][100] = { - "Single Buffered, depth buffer", - "Double Buffered, depth buffer", - "Single Buffered, no depth buffer", - "Double Buffered, no depth buffer" - }; - int fbAttribs[NUM_FB_CONFIGS][100] = { - { - /* Single buffered, with depth buffer */ - GLX_RENDER_TYPE, GLX_RGBA_BIT, - GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT, - GLX_RED_SIZE, 1, - GLX_GREEN_SIZE, 1, - GLX_BLUE_SIZE, 1, - GLX_DEPTH_SIZE, 1, - GLX_DOUBLEBUFFER, 0, - GLX_STENCIL_SIZE, 0, - None - }, - { - /* Double buffered, with depth buffer */ - GLX_RENDER_TYPE, GLX_RGBA_BIT, - GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT, - GLX_RED_SIZE, 1, - GLX_GREEN_SIZE, 1, - GLX_BLUE_SIZE, 1, - GLX_DEPTH_SIZE, 1, - GLX_DOUBLEBUFFER, 1, - GLX_STENCIL_SIZE, 0, - None - }, - { - /* Single buffered, without depth buffer */ - GLX_RENDER_TYPE, GLX_RGBA_BIT, - GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT, - GLX_RED_SIZE, 1, - GLX_GREEN_SIZE, 1, - GLX_BLUE_SIZE, 1, - GLX_DEPTH_SIZE, 0, - GLX_DOUBLEBUFFER, 0, - GLX_STENCIL_SIZE, 0, - None - }, - { - /* Double buffered, without depth buffer */ - GLX_RENDER_TYPE, GLX_RGBA_BIT, - GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT, - GLX_RED_SIZE, 1, - GLX_GREEN_SIZE, 1, - GLX_BLUE_SIZE, 1, - GLX_DEPTH_SIZE, 0, - GLX_DOUBLEBUFFER, 1, - GLX_STENCIL_SIZE, 0, - None - } - }; - Bool largest = True; - Bool preserve = False; - FBCONFIG *fbConfigs; - PBUFFER pBuffer = None; - int nConfigs; - int i; - int attempt; - - for (attempt=0; attempt x1) { - tmp = x0; - x0 = x1; - x1 = tmp; - } - if (y0 > y1) { - tmp = y0; - y0 = y1; - y1 = tmp; - } - if (z0 > z1) { - tmp = z0; - z0 = z1; - z1 = tmp; - } - v[0][0] = v[1][0] = v[2][0] = v[3][0] = x0; - v[4][0] = v[5][0] = v[6][0] = v[7][0] = x1; - v[0][1] = v[1][1] = v[4][1] = v[5][1] = y0; - v[2][1] = v[3][1] = v[6][1] = v[7][1] = y1; - v[0][2] = v[3][2] = v[4][2] = v[7][2] = z0; - v[1][2] = v[2][2] = v[5][2] = v[6][2] = z1; - - for (i = 0; i < 6; i++) { - glBegin(type); - glNormal3fv(&n[i][0]); - glVertex3fv(&v[faces[i][0]][0]); - glVertex3fv(&v[faces[i][1]][0]); - glVertex3fv(&v[faces[i][2]][0]); - glVertex3fv(&v[faces[i][3]][0]); - glEnd(); - } -} - - - -/* Render a scene */ -static void -Render(void) -{ - int NumBoxes = 100; - int i; - - glClearColor(0.2, 0.2, 0.9, 0.0); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - for (i=0;i