From 9a4a219d20127378793217da4c10ab865b96e477 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Fri, 26 Feb 2010 04:02:41 +0200 Subject: drop header files and demos for dropped window systems --- progs/xdemos/vgears.c | 281 -------------------------------------------------- progs/xdemos/vindex.c | 65 ------------ progs/xdemos/vtest.c | 82 --------------- 3 files changed, 428 deletions(-) delete mode 100644 progs/xdemos/vgears.c delete mode 100644 progs/xdemos/vindex.c delete mode 100644 progs/xdemos/vtest.c (limited to 'progs') diff --git a/progs/xdemos/vgears.c b/progs/xdemos/vgears.c deleted file mode 100644 index f579e8b421d..00000000000 --- a/progs/xdemos/vgears.c +++ /dev/null @@ -1,281 +0,0 @@ - -/* - * Spinning gears demo for Linux SVGA/Mesa interface in 32K color mode. - * - * Compile with: gcc vgears.c -I../include -L../lib -lMesaGL -lX11 -lXext - * -lvga -lm -o vgears - * - * This program is in the public domain. - * Brian Paul, January 1996 - */ - - -#include -#include -#include "GL/svgamesa.h" -#include "GL/gl.h" - - -int width = 800, height = 600; - -SVGAMesaContext vmc; - - - -/* - * Draw a gear wheel. You'll probably want to call this function when - * building a display list since we do a lot of trig here. - * - * Input: inner_radius - radius of hole at center - * outer_radius - radius at center of teeth - * width - width of gear - * teeth - number of teeth - * tooth_depth - depth of tooth - */ -static void gear( GLfloat inner_radius, GLfloat outer_radius, GLfloat width, - GLint teeth, GLfloat tooth_depth ) -{ - GLint i; - GLfloat r0, r1, r2; - GLfloat angle, da; - GLfloat u, v, len; - - r0 = inner_radius; - r1 = outer_radius - tooth_depth/2.0; - r2 = outer_radius + tooth_depth/2.0; - - da = 2.0*M_PI / teeth / 4.0; - - glShadeModel( GL_FLAT ); - - glNormal3f( 0.0, 0.0, 1.0 ); - - /* draw front face */ - glBegin( GL_QUAD_STRIP ); - for (i=0;i<=teeth;i++) { - angle = i * 2.0*M_PI / teeth; - glVertex3f( r0*cos(angle), r0*sin(angle), width*0.5 ); - glVertex3f( r1*cos(angle), r1*sin(angle), width*0.5 ); - glVertex3f( r0*cos(angle), r0*sin(angle), width*0.5 ); - glVertex3f( r1*cos(angle+3*da), r1*sin(angle+3*da), width*0.5 ); - } - glEnd(); - - /* draw front sides of teeth */ - glBegin( GL_QUADS ); - da = 2.0*M_PI / teeth / 4.0; - for (i=0;iheight) { - GLfloat w = (GLfloat) width / (GLfloat) height; - glFrustum( -w, w, -1.0, 1.0, 5.0, 60.0 ); - } - else { - GLfloat h = (GLfloat) height / (GLfloat) width; - glFrustum( -1.0, 1.0, -h, h, 5.0, 60.0 ); - } - - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -40.0 ); -} - -void setup( void ) -{ - vga_init(); - - vga_setmode(G800x600x32K); -/* gl_setcontextvga(G800x600x32K);*/ - - vmc = SVGAMesaCreateContext(GL_TRUE); - SVGAMesaMakeCurrent( vmc ); -} - - -void end( void ) -{ - SVGAMesaDestroyContext( vmc ); - - vga_setmode( TEXT ); -} - - -int main( int argc, char *argv[] ) -{ - int i; - - setup(); - init(); - for (i=0;i<4;i++) { - draw(); /*SVGAMesaSwapBuffers();*/ - } - end(); - return 0; -} diff --git a/progs/xdemos/vindex.c b/progs/xdemos/vindex.c deleted file mode 100644 index 991fce2a591..00000000000 --- a/progs/xdemos/vindex.c +++ /dev/null @@ -1,65 +0,0 @@ - -/* - * Test Linux 8-bit SVGA/Mesa color index mode - * - * Compile with: gcc vindex.c -I../include -L../lib -lMesaGL -lX11 -lXext - * -lvga -lm -o vindex - * - * This program is in the public domain. - * Brian Paul, January 1996 - */ - - - -#include -#include "GL/svgamesa.h" -#include "GL/gl.h" - - - -static GLint width = 640, height = 480; - - - -static void display( void ) -{ - int i, j; - int w, h; - - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glOrtho( 0.0, (GLfloat) width, 0.0, (GLfloat) height, -1.0, 1.0 ); - - glClear( GL_COLOR_BUFFER_BIT ); - - w = width / 16; - h = height / 16; - for (i=0;i<16;i++) { - for (j=0;j<16;j++) { - glIndexi( i*16+j ); - glRecti( i*w, j*h, i*w+w, j*h+h ); - } - } -} - - - -int main( int argc, char *argv[] ) -{ - SVGAMesaContext vmc; - int i; - - vga_init(); - vga_setmode( G640x480x256 ); - - vmc = SVGAMesaCreateContext( GL_FALSE ); - SVGAMesaMakeCurrent( vmc ); - - display(); - sleep(3); - - SVGAMesaDestroyContext( vmc ); - vga_setmode( TEXT ); - return 0; -} diff --git a/progs/xdemos/vtest.c b/progs/xdemos/vtest.c deleted file mode 100644 index e322fbc5c80..00000000000 --- a/progs/xdemos/vtest.c +++ /dev/null @@ -1,82 +0,0 @@ - -/* - * Test SVGA/Mesa interface in 32K color mode. - * - * Compile with: gcc vtest.c -I../include -L../lib -lMesaGL -lX11 -lXext - * -lvga -lm -o vtest - * - * This program is in the public domain. - * Brian Paul, January 1996 - */ - - - -#include -#include "GL/svgamesa.h" -#include "GL/gl.h" - - -SVGAMesaContext vmc; - - - -void setup( void ) -{ - vga_init(); - - vga_setmode(G800x600x32K); -/* gl_setcontextvga(G800x600x32K);*/ - - vmc = SVGAMesaCreateContext( GL_FALSE ); /* single buffered */ - SVGAMesaMakeCurrent( vmc ); -} - - -void test( void ) -{ - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho( -1.0, 1.0, -1.0, 1.0, -1.0, 1.0 ); - glMatrixMode(GL_MODELVIEW); - - glClear( GL_COLOR_BUFFER_BIT ); - - glBegin( GL_LINES ); - glColor3f( 1.0, 0.0, 0.0 ); - glVertex2f( -0.5, 0.5 ); - glVertex2f( 0.5, 0.5 ); - glColor3f( 0.0, 1.0, 0.0 ); - glVertex2f( -0.5, 0.25 ); - glVertex2f( 0.5, 0.25 ); - glColor3f( 0.0, 0.0, 1.0 ); - glVertex2f( -0.5, 0.0 ); - glVertex2f( 0.5, 0.0 ); - glEnd(); - - glBegin( GL_POLYGON ); - glColor3f( 1.0, 0.0, 0.0 ); - glVertex2f( 0.0, 0.7 ); - glColor3f( 0.0, 1.0, 0.0 ); - glVertex2f( -0.5, -0.5 ); - glColor3f( 0.0, 0.0, 1.0 ); - glVertex2f( 0.5, -0.5 ); - glEnd(); - - sleep(3); -} - -void end( void ) -{ - SVGAMesaDestroyContext( vmc ); - - vga_setmode( TEXT ); -} - - -int main( int argc, char *argv[] ) -{ - setup(); - test(); - end(); - return 0; -} -- cgit v1.2.3