From 74377c8d1b750f04dcad12e5885af2d3178b3bad Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Thu, 25 Feb 2010 16:17:40 -0500 Subject: [PATCH] Remove windml progs --- progs/windml/Makefile.ugl | 68 ------ progs/windml/readtex.c | 365 ---------------------------- progs/windml/uglaccum.c | 250 ------------------- progs/windml/uglalldemos.c | 198 --------------- progs/windml/uglbounce.c | 272 --------------------- progs/windml/uglcube.c | 257 -------------------- progs/windml/ugldrawpix.c | 437 --------------------------------- progs/windml/uglflip.c | 224 ----------------- progs/windml/uglgears.c | 428 --------------------------------- progs/windml/uglicotorus.c | 315 ------------------------ progs/windml/uglline.c | 274 --------------------- progs/windml/uglolympic.c | 479 ------------------------------------- progs/windml/uglpoint.c | 277 --------------------- progs/windml/uglstencil.c | 242 ------------------- progs/windml/uglteapot.c | 295 ----------------------- progs/windml/ugltexcube.c | 379 ----------------------------- progs/windml/ugltexcyl.c | 406 ------------------------------- progs/windml/wrs_logo.bmp | Bin 196662 -> 0 bytes 18 files changed, 5166 deletions(-) delete mode 100644 progs/windml/Makefile.ugl delete mode 100644 progs/windml/readtex.c delete mode 100644 progs/windml/uglaccum.c delete mode 100644 progs/windml/uglalldemos.c delete mode 100644 progs/windml/uglbounce.c delete mode 100644 progs/windml/uglcube.c delete mode 100644 progs/windml/ugldrawpix.c delete mode 100644 progs/windml/uglflip.c delete mode 100644 progs/windml/uglgears.c delete mode 100644 progs/windml/uglicotorus.c delete mode 100644 progs/windml/uglline.c delete mode 100644 progs/windml/uglolympic.c delete mode 100644 progs/windml/uglpoint.c delete mode 100644 progs/windml/uglstencil.c delete mode 100644 progs/windml/uglteapot.c delete mode 100644 progs/windml/ugltexcube.c delete mode 100644 progs/windml/ugltexcyl.c delete mode 100644 progs/windml/wrs_logo.bmp diff --git a/progs/windml/Makefile.ugl b/progs/windml/Makefile.ugl deleted file mode 100644 index 90b0b29bc82..00000000000 --- a/progs/windml/Makefile.ugl +++ /dev/null @@ -1,68 +0,0 @@ -# Mesa 3-D graphics library -# Version: 3.5 -# -# Copyright (C) 2001 Wind River Systems, Inc - -# The MIT License -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -# Makefile for UGL/Mesa demos - -DEMO_SOURCES = readtex.c uglaccum.c uglalldemos.c uglbounce.c uglcube.c \ -ugldrawpix.c uglflip.c uglgears.c uglicotorus.c uglline.c uglolympic.c \ -uglpoint.c uglstencil.c uglteapot.c ugltexcube.c ugltexcyl.c -#win2d3d/winRoot.c win2d3d/winBall.c win2d3d/winPuzzle.c win2d3d/winHello.c \ -#win2d3d/winImage.c win2d3d/winGears.c - -DEMO_OBJECTS = $(DEMO_SOURCES:.c=.o) - -SOURCES = $(DEMO_SOURCES) - -include ../rules.windml - -##### TARGETS ##### - -all: depend.$(CPU)$(TOOL) $(DEMO_OBJECTS) - -depend.$(CPU)$(TOOL): -ifeq ($(WIND_HOST_TYPE),x86-win32) - @ $(RM) $@ - @ $(ECHO) Creating depend.$(CPU)$(TOOL) -ifneq ($(SOURCES),) - @ for %f in ($(SOURCES)) do \ - $(CC) -MM $(CFLAGS) %f >>$@ -endif -else -Makefile - @ $(RM) $@ - @ $(ECHO) "Creating depend.$(CPU)$(TOOL)" -ifneq ($(SOURCES),) - @ for FILE in $(filter-out $(NODEPENDOBJS), $(SOURCES)); \ - do \ - $(CC) -MM $(CFLAGS) $$FILE \ - | $(TCL) $(BIN_DIR)/depend.tcl $(TGT_DIR) >>$@; \ - done -endif -endif - -.PHONY = clean - -clean: - $(RM) $(DEMO_OBJECTS) - $(RM) depend.$(CPU)$(TOOL) diff --git a/progs/windml/readtex.c b/progs/windml/readtex.c deleted file mode 100644 index 659c49de8de..00000000000 --- a/progs/windml/readtex.c +++ /dev/null @@ -1,365 +0,0 @@ -/* readtex.c */ - -/* - * Read an SGI .rgb image file and generate a mipmap texture set. - * Much of this code was borrowed from SGI's tk OpenGL toolkit. - */ - -#include -#include -#include -#include -#include -#include "../util/readtex.h" - - -#ifndef SEEK_SET -# define SEEK_SET 0 -#endif - - -/* -** RGB Image Structure -*/ - -typedef struct _TK_RGBImageRec { - GLint sizeX, sizeY; - GLint components; - unsigned char *data; -} TK_RGBImageRec; - - - -/******************************************************************************/ - -typedef struct _rawImageRec { - unsigned short imagic; - unsigned short type; - unsigned short dim; - unsigned short sizeX, sizeY, sizeZ; - unsigned long min, max; - unsigned long wasteBytes; - char name[80]; - unsigned long colorMap; - FILE *file; - unsigned char *tmp, *tmpR, *tmpG, *tmpB, *tmpA; - unsigned long rleEnd; - GLuint *rowStart; - GLint *rowSize; -} rawImageRec; - -/******************************************************************************/ - -static void ConvertShort(unsigned short *array, long length) -{ - unsigned long b1, b2; - unsigned char *ptr; - - ptr = (unsigned char *)array; - while (length--) { - b1 = *ptr++; - b2 = *ptr++; - *array++ = (unsigned short) ((b1 << 8) | (b2)); - } -} - -static void ConvertLong(GLuint *array, long length) -{ - unsigned long b1, b2, b3, b4; - unsigned char *ptr; - - ptr = (unsigned char *)array; - while (length--) { - b1 = *ptr++; - b2 = *ptr++; - b3 = *ptr++; - b4 = *ptr++; - *array++ = (b1 << 24) | (b2 << 16) | (b3 << 8) | (b4); - } -} - -static rawImageRec *RawImageOpen(const char *fileName) -{ - union { - int testWord; - char testByte[4]; - } endianTest; - rawImageRec *raw; - GLenum swapFlag; - int x; - - endianTest.testWord = 1; - if (endianTest.testByte[0] == 1) { - swapFlag = GL_TRUE; - } else { - swapFlag = GL_FALSE; - } - - raw = (rawImageRec *)malloc(sizeof(rawImageRec)); - if (raw == NULL) { - fprintf(stderr, "Out of memory!\n"); - return NULL; - } - if ((raw->file = fopen(fileName, "rb")) == NULL) { - perror(fileName); - return NULL; - } - - fread(raw, 1, 12, raw->file); - - if (swapFlag) { - ConvertShort(&raw->imagic, 6); - } - - raw->tmp = (unsigned char *)malloc(raw->sizeX*256); - raw->tmpR = (unsigned char *)malloc(raw->sizeX*256); - raw->tmpG = (unsigned char *)malloc(raw->sizeX*256); - raw->tmpB = (unsigned char *)malloc(raw->sizeX*256); - if (raw->sizeZ==4) { - raw->tmpA = (unsigned char *)malloc(raw->sizeX*256); - } - if (raw->tmp == NULL || raw->tmpR == NULL || raw->tmpG == NULL || - raw->tmpB == NULL) { - fprintf(stderr, "Out of memory!\n"); - return NULL; - } - - if ((raw->type & 0xFF00) == 0x0100) { - x = raw->sizeY * raw->sizeZ * sizeof(GLuint); - raw->rowStart = (GLuint *)malloc(x); - raw->rowSize = (GLint *)malloc(x); - if (raw->rowStart == NULL || raw->rowSize == NULL) { - fprintf(stderr, "Out of memory!\n"); - return NULL; - } - raw->rleEnd = 512 + (2 * x); - fseek(raw->file, 512, SEEK_SET); - fread(raw->rowStart, 1, x, raw->file); - fread(raw->rowSize, 1, x, raw->file); - if (swapFlag) { - ConvertLong(raw->rowStart, (long) (x/sizeof(GLuint))); - ConvertLong((GLuint *)raw->rowSize, (long) (x/sizeof(GLint))); - } - } - return raw; -} - -static void RawImageClose(rawImageRec *raw) -{ - - fclose(raw->file); - free(raw->tmp); - free(raw->tmpR); - free(raw->tmpG); - free(raw->tmpB); - if (raw->sizeZ>3) { - free(raw->tmpA); - } - free(raw); -} - -static void RawImageGetRow(rawImageRec *raw, unsigned char *buf, int y, int z) -{ - unsigned char *iPtr, *oPtr, pixel; - int count, done = 0; - - if ((raw->type & 0xFF00) == 0x0100) { - fseek(raw->file, (long) raw->rowStart[y+z*raw->sizeY], SEEK_SET); - fread(raw->tmp, 1, (unsigned int)raw->rowSize[y+z*raw->sizeY], - raw->file); - - iPtr = raw->tmp; - oPtr = buf; - while (!done) { - pixel = *iPtr++; - count = (int)(pixel & 0x7F); - if (!count) { - done = 1; - return; - } - if (pixel & 0x80) { - while (count--) { - *oPtr++ = *iPtr++; - } - } else { - pixel = *iPtr++; - while (count--) { - *oPtr++ = pixel; - } - } - } - } else { - fseek(raw->file, 512+(y*raw->sizeX)+(z*raw->sizeX*raw->sizeY), - SEEK_SET); - fread(buf, 1, raw->sizeX, raw->file); - } -} - - -static void RawImageGetData(rawImageRec *raw, TK_RGBImageRec *final) -{ - unsigned char *ptr; - int i, j; - - final->data = (unsigned char *)malloc((raw->sizeX+1)*(raw->sizeY+1)*4); - if (final->data == NULL) { - fprintf(stderr, "Out of memory!\n"); - } - - ptr = final->data; - for (i = 0; i < (int)(raw->sizeY); i++) { - RawImageGetRow(raw, raw->tmpR, i, 0); - RawImageGetRow(raw, raw->tmpG, i, 1); - RawImageGetRow(raw, raw->tmpB, i, 2); - if (raw->sizeZ>3) { - RawImageGetRow(raw, raw->tmpA, i, 3); - } - for (j = 0; j < (int)(raw->sizeX); j++) { - *ptr++ = *(raw->tmpR + j); - *ptr++ = *(raw->tmpG + j); - *ptr++ = *(raw->tmpB + j); - if (raw->sizeZ>3) { - *ptr++ = *(raw->tmpA + j); - } - } - } -} - - -static TK_RGBImageRec *tkRGBImageLoad(const char *fileName) -{ - rawImageRec *raw; - TK_RGBImageRec *final; - - raw = RawImageOpen(fileName); - if (!raw) { - fprintf(stderr, "File not found\n"); - return NULL; - } - final = (TK_RGBImageRec *)malloc(sizeof(TK_RGBImageRec)); - if (final == NULL) { - fprintf(stderr, "Out of memory!\n"); - return NULL; - } - final->sizeX = raw->sizeX; - final->sizeY = raw->sizeY; - final->components = raw->sizeZ; - RawImageGetData(raw, final); - RawImageClose(raw); - return final; -} - - -static void FreeImage( TK_RGBImageRec *image ) -{ - free(image->data); - free(image); -} - - -/* - * Load an SGI .rgb file and generate a set of 2-D mipmaps from it. - * Input: imageFile - name of .rgb to read - * intFormat - internal texture format to use, or number of components - * Return: GL_TRUE if success, GL_FALSE if error. - */ -GLboolean LoadRGBMipmaps( const char *imageFile, GLint intFormat ) -{ - GLint w, h; - return LoadRGBMipmaps2( imageFile, GL_TEXTURE_2D, intFormat, &w, &h ); -} - - - -GLboolean LoadRGBMipmaps2( const char *imageFile, GLenum target, - GLint intFormat, GLint *width, GLint *height ) -{ - GLint error; - GLenum format; - TK_RGBImageRec *image; - - image = tkRGBImageLoad( imageFile ); - if (!image) { - return GL_FALSE; - } - - if (image->components==3) { - format = GL_RGB; - } - else if (image->components==4) { - format = GL_RGBA; - } - else { - /* not implemented */ - fprintf(stderr, - "Error in LoadRGBMipmaps %d-component images not implemented\n", - image->components ); - return GL_FALSE; - } - - error = gluBuild2DMipmaps( target, - intFormat, - image->sizeX, image->sizeY, - format, - GL_UNSIGNED_BYTE, - image->data ); - - *width = image->sizeX; - *height = image->sizeY; - - FreeImage(image); - - return error ? GL_FALSE : GL_TRUE; -} - - - -/* - * Load an SGI .rgb file and return a pointer to the image data. - * Input: imageFile - name of .rgb to read - * Output: width - width of image - * height - height of image - * format - format of image (GL_RGB or GL_RGBA) - * Return: pointer to image data or NULL if error - */ -GLubyte *LoadRGBImage( const char *imageFile, GLint *width, GLint *height, - GLenum *format ) -{ - TK_RGBImageRec *image; - GLint bytes; - GLubyte *buffer; - - image = tkRGBImageLoad( imageFile ); - if (!image) { - return NULL; - } - - if (image->components==3) { - *format = GL_RGB; - } - else if (image->components==4) { - *format = GL_RGBA; - } - else { - /* not implemented */ - fprintf(stderr, - "Error in LoadRGBImage %d-component images not implemented\n", - image->components ); - return NULL; - } - - *width = image->sizeX; - *height = image->sizeY; - - bytes = image->sizeX * image->sizeY * image->components; - buffer = (GLubyte *) malloc(bytes); - if (!buffer) - return NULL; - - memcpy( (void *) buffer, (void *) image->data, bytes ); - - FreeImage(image); - - return buffer; -} - diff --git a/progs/windml/uglaccum.c b/progs/windml/uglaccum.c deleted file mode 100644 index fd7cb3125c1..00000000000 --- a/progs/windml/uglaccum.c +++ /dev/null @@ -1,250 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994. */ - -/* - * (c) Copyright 1993, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ - -/* Original name: accanti.c - * - * Conversion to UGL/Mesa by Stephane Raimbault - */ - -#include -#include - -#include -#include -#include - -#include -#include - -#include "../book/jitter.h" - -UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; -UGL_LOCAL UGL_EVENT_Q_ID qId; -UGL_LOCAL UGL_MESA_CONTEXT umc; - -/* Initialize lighting and other values. - */ -UGL_LOCAL void initGL(GLsizei w, GLsizei h) - { - GLfloat mat_ambient[] = { 1.0, 1.0, 1.0, 1.0 }; - GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 }; - GLfloat light_position[] = { 0.0, 0.0, 10.0, 1.0 }; - GLfloat lm_ambient[] = { 0.2, 0.2, 0.2, 1.0 }; - - glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); - glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); - glMaterialf(GL_FRONT, GL_SHININESS, 50.0); - glLightfv(GL_LIGHT0, GL_POSITION, light_position); - glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lm_ambient); - - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glDepthFunc(GL_LESS); - glEnable(GL_DEPTH_TEST); - glShadeModel (GL_FLAT); - - glClearColor(0.0, 0.0, 0.0, 0.0); - glClearAccum(0.0, 0.0, 0.0, 0.0); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - if (w <= h) - glOrtho (-2.25, 2.25, -2.25*h/w, 2.25*h/w, -10.0, 10.0); - else - glOrtho (-2.25*w/h, 2.25*w/h, -2.25, 2.25, -10.0, 10.0); - glMatrixMode(GL_MODELVIEW); - } - -UGL_LOCAL void displayObjects(void) - { - GLfloat torus_diffuse[] = { 0.7, 0.7, 0.0, 1.0 }; - GLfloat cube_diffuse[] = { 0.0, 0.7, 0.7, 1.0 }; - GLfloat sphere_diffuse[] = { 0.7, 0.0, 0.7, 1.0 }; - GLfloat octa_diffuse[] = { 0.7, 0.4, 0.4, 1.0 }; - - glPushMatrix (); - glRotatef (30.0, 1.0, 0.0, 0.0); - - glPushMatrix (); - glTranslatef (-0.80, 0.35, 0.0); - glRotatef (100.0, 1.0, 0.0, 0.0); - glMaterialfv(GL_FRONT, GL_DIFFUSE, torus_diffuse); - glutSolidTorus (0.275, 0.85, 16, 16); - glPopMatrix (); - - glPushMatrix (); - glTranslatef (-0.75, -0.50, 0.0); - glRotatef (45.0, 0.0, 0.0, 1.0); - glRotatef (45.0, 1.0, 0.0, 0.0); - glMaterialfv(GL_FRONT, GL_DIFFUSE, cube_diffuse); - glutSolidCube (1.5); - glPopMatrix (); - - glPushMatrix (); - glTranslatef (0.75, 0.60, 0.0); - glRotatef (30.0, 1.0, 0.0, 0.0); - glMaterialfv(GL_FRONT, GL_DIFFUSE, sphere_diffuse); - glutSolidSphere (1.0, 16, 16); - glPopMatrix (); - - glPushMatrix (); - glTranslatef (0.70, -0.90, 0.25); - glMaterialfv(GL_FRONT, GL_DIFFUSE, octa_diffuse); - glutSolidOctahedron (); - glPopMatrix (); - - glPopMatrix (); - } - -#define ACSIZE 8 - -UGL_LOCAL void drawGL(void) - { - GLint viewport[4]; - int jitter; - - glGetIntegerv (GL_VIEWPORT, viewport); - - glClear(GL_ACCUM_BUFFER_BIT); - for (jitter = 0; jitter < ACSIZE; jitter++) - { - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glPushMatrix (); -/* Note that 4.5 is the distance in world space between - * left and right and bottom and top. - * This formula converts fractional pixel movement to - * world coordinates. - */ - glTranslatef (j8[jitter].x*4.5/viewport[2], - j8[jitter].y*4.5/viewport[3], 0.0); - displayObjects (); - glPopMatrix (); - glAccum(GL_ACCUM, 1.0/ACSIZE); - } - glAccum (GL_RETURN, 1.0); - glFlush(); - - uglMesaSwapBuffers(); - } - -UGL_LOCAL int getEvent(void) - { - UGL_EVENT event; - UGL_STATUS status; - int retVal = 0; - - status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); - - while (status != UGL_STATUS_Q_EMPTY) - { - UGL_INPUT_EVENT * pInputEvent = (UGL_INPUT_EVENT *)&event; - - if (pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) - retVal = 1; - - status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); - } - - return(retVal); - } - -void windMLAccum (UGL_BOOL windMLMode); - -void uglaccum (void) - { - taskSpawn("tAccum", 210, VX_FP_TASK, 100000, - (FUNCPTR)windMLAccum,UGL_FALSE,1,2,3,4,5,6,7,8,9); - } - -void windMLAccum (UGL_BOOL windMLMode) - { - UGL_INPUT_DEVICE_ID keyboardDevId; - GLsizei width, height; - - uglInitialize(); - - uglDriverFind (UGL_KEYBOARD_TYPE, 0, (UGL_UINT32 *)&keyboardDevId); - - uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); - - qId = uglEventQCreate (eventServiceId, 100); - - if (windMLMode) - umc = uglMesaCreateNewContextExt(UGL_MESA_DOUBLE - | UGL_MESA_WINDML_EXCLUSIVE, - 16, - 0, - 8,8,8,0, - NULL); - else - umc = uglMesaCreateNewContextExt(UGL_MESA_DOUBLE, - 16, - 0, - 8,8,8,0, - NULL); - - if (umc == NULL) - { - uglDeinitialize(); - return; - } - - /* Fullscreen */ - - uglMesaMakeCurrentContext(umc, 0, 0, - UGL_MESA_FULLSCREEN_WIDTH, - UGL_MESA_FULLSCREEN_HEIGHT); - - uglMesaGetIntegerv(UGL_MESA_WIDTH, &width); - uglMesaGetIntegerv(UGL_MESA_HEIGHT, &height); - - initGL(width, height); - - drawGL(); - - while (!getEvent()); - - uglEventQDestroy (eventServiceId, qId); - - uglMesaDestroyContext(); - uglDeinitialize(); - - return; - } diff --git a/progs/windml/uglalldemos.c b/progs/windml/uglalldemos.c deleted file mode 100644 index 283e4870740..00000000000 --- a/progs/windml/uglalldemos.c +++ /dev/null @@ -1,198 +0,0 @@ - -/* uglalldemos.c - WindML/Mesa example program */ - -/* Copyright (C) 2001 by Wind River Systems, Inc */ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * The MIT License - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -/* -modification history --------------------- -02a,29aug01,sra WindML mode added -01a,17jul01,sra written -*/ - -/* -DESCRIPTION -Show all the UGL/Mesa demos -*/ - -#include -#include -#include -#include -#include -#include -#include - -#define BLACK 0 -#define RED 1 - -struct _colorStruct - { - UGL_RGB rgbColor; - UGL_COLOR uglColor; - } -colorTable[] = - { - { UGL_MAKE_RGB(0, 0, 0), 0}, - { UGL_MAKE_RGB(255, 0, 0), 0}, - }; - -void windMLPoint (UGL_BOOL windMLMode); -void windMLLine (UGL_BOOL windMLMode); -void windMLFlip (UGL_BOOL windMLMode); -void windMLCube (UGL_BOOL windMLMode); -void windMLBounce (UGL_BOOL windMLMode); -void windMLGears (UGL_BOOL windMLMode); -void windMLIcoTorus (UGL_BOOL windMLMode); -void windMLOlympic (UGL_BOOL windMLMode); -void windMLTexCube (UGL_BOOL windMLMode); -void windMLTexCyl (UGL_BOOL windMLMode); -void windMLTeapot (UGL_BOOL windMLMode); -void windMLStencil (UGL_BOOL windMLMode); -void windMLDrawPix (UGL_BOOL windMLMode); -void windMLAccum (UGL_BOOL windMLMode); -void windMLAllDemos (void); - -void uglalldemos (void) - { - taskSpawn("tAllDemos", 210, VX_FP_TASK, 200000, - (FUNCPTR)windMLAllDemos, 0,1,2,3,4,5,6,7,8,9); - } - -void windMLAllDemos(void) - { - UGL_BOOL windMLFlag = UGL_FALSE; - UGL_FB_INFO fbInfo; - UGL_EVENT event; - UGL_EVENT_SERVICE_ID eventServiceId; - UGL_EVENT_Q_ID qId; - UGL_INPUT_EVENT * pInputEvent; - UGL_INPUT_DEVICE_ID keyboardDevId; - UGL_DEVICE_ID devId; - UGL_GC_ID gc; - UGL_FONT_ID fontId; - UGL_FONT_DEF fontDef; - UGL_FONT_DRIVER_ID fontDrvId; - UGL_ORD textOrigin = UGL_FONT_TEXT_UPPER_LEFT; - int displayHeight, displayWidth; - int textWidth, textHeight; - static UGL_CHAR * message = - "Do you want to use WindML exclusively ? (y/n) "; - - uglInitialize(); - - uglDriverFind (UGL_DISPLAY_TYPE, 0, (UGL_UINT32 *)&devId); - uglDriverFind (UGL_KEYBOARD_TYPE, 0, (UGL_UINT32 *)&keyboardDevId); - uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); - qId = uglEventQCreate (eventServiceId, 100); - - gc = uglGcCreate(devId); - - uglDriverFind (UGL_FONT_ENGINE_TYPE, 0, (UGL_UINT32 *)&fontDrvId); - uglFontDriverInfo(fontDrvId, UGL_FONT_TEXT_ORIGIN, &textOrigin); - - uglFontFindString(fontDrvId, "familyName=Helvetica; pixelSize = 18", - &fontDef); - - if ((fontId = uglFontCreate(fontDrvId, &fontDef)) == UGL_NULL) - { - printf("Font not found. Exiting.\n"); - return; - } - - uglInfo(devId, UGL_FB_INFO_REQ, &fbInfo); - displayWidth = fbInfo.width; - displayHeight = fbInfo.height; - - uglColorAlloc (devId, &colorTable[BLACK].rgbColor, UGL_NULL, - &colorTable[BLACK].uglColor, 1); - uglColorAlloc(devId, &colorTable[RED].rgbColor, UGL_NULL, - &colorTable[RED].uglColor, 1); - - uglBackgroundColorSet(gc, colorTable[BLACK].uglColor); - uglForegroundColorSet(gc, colorTable[RED].uglColor); - uglFontSet(gc, fontId); - uglTextSizeGet(fontId, &textWidth, &textHeight, -1, message); - uglTextDraw(gc, (displayWidth - textWidth) / 2, - (displayHeight - textHeight) / 2 - textHeight, -1, message); -/* flushQ(); - */ - if (uglEventGet (qId, &event, sizeof (event), UGL_WAIT_FOREVER) - != UGL_STATUS_Q_EMPTY) - { - pInputEvent = (UGL_INPUT_EVENT *)&event; - - if (pInputEvent->header.type == UGL_EVENT_TYPE_KEYBOARD && - pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) - { - switch(pInputEvent->type.keyboard.key) - { - case 'Y': - case 'y': - windMLFlag = UGL_TRUE; - break; - default: - windMLFlag = UGL_FALSE; - } - } - } - - uglFontDestroy (fontId); - uglGcDestroy (gc); - uglEventQDestroy (eventServiceId, qId); - uglDeinitialize(); - - windMLPoint(windMLFlag); - - windMLLine(windMLFlag); - - windMLFlip(windMLFlag); - - windMLCube(windMLFlag); - - windMLBounce(windMLFlag); - - windMLGears(windMLFlag); - - windMLIcoTorus(windMLFlag); - - windMLOlympic(windMLFlag); - - windMLTexCube(windMLFlag); - - windMLTexCyl(windMLFlag); - - windMLTeapot(windMLFlag); - - windMLStencil(windMLFlag); - - windMLDrawPix(windMLFlag); - - windMLAccum(windMLFlag); - - return; - } diff --git a/progs/windml/uglbounce.c b/progs/windml/uglbounce.c deleted file mode 100644 index 287015a4131..00000000000 --- a/progs/windml/uglbounce.c +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Bouncing ball demo. - * - * This program is in the public domain - * - * Brian Paul - * - * Conversion to GLUT by Mark J. Kilgard - * - * Conversion to UGL/Mesa by Stephane Raimbault - */ - -#include -#include -#include - -#include -#include -#include - -#include - -#define COS(X) cos( (X) * 3.14159/180.0 ) -#define SIN(X) sin( (X) * 3.14159/180.0 ) - -#define RED 1 -#define WHITE 2 -#define CYAN 3 - -UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; -UGL_LOCAL UGL_EVENT_Q_ID qId; -UGL_LOCAL UGL_MESA_CONTEXT umc; - -UGL_LOCAL GLuint Ball; -UGL_LOCAL GLfloat Zrot, Zstep; -UGL_LOCAL GLfloat Xpos, Ypos; -UGL_LOCAL GLfloat Xvel, Yvel; -UGL_LOCAL GLfloat Xmin, Xmax; -UGL_LOCAL GLfloat Ymin; -/* UGL_LOCAL GLfloat Ymax = 4.0; */ -UGL_LOCAL GLfloat G; - -UGL_LOCAL GLuint make_ball(void) - { - GLuint list; - GLfloat a, b; - GLfloat da = 18.0, db = 18.0; - GLfloat radius = 1.0; - GLuint color; - GLfloat x, y, z; - - list = glGenLists(1); - - glNewList(list, GL_COMPILE); - - color = 0; - for (a = -90.0; a + da <= 90.0; a += da) - { - glBegin(GL_QUAD_STRIP); - for (b = 0.0; b <= 360.0; b += db) - { - if (color) - { - glIndexi(RED); - glColor3f(1, 0, 0); - } - else - { - glIndexi(WHITE); - glColor3f(1, 1, 1); - } - - x = radius * COS(b) * COS(a); - y = radius * SIN(b) * COS(a); - z = radius * SIN(a); - glVertex3f(x, y, z); - - x = radius * COS(b) * COS(a + da); - y = radius * SIN(b) * COS(a + da); - z = radius * SIN(a + da); - glVertex3f(x, y, z); - - color = 1 - color; - } - glEnd(); - - } - - glEndList(); - - return list; - } - -UGL_LOCAL void initGL(GLsizei width, GLsizei height) - { - float aspect = (float) width / (float) height; - glViewport(0, 0, (GLint) width, (GLint) height); - - uglMesaSetColor(RED, 1.0, 0.0, 0.0); - uglMesaSetColor(WHITE, 1.0, 1.0, 1.0); - uglMesaSetColor(CYAN, 0.0, 1.0, 1.0); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-6.0 * aspect, 6.0 * aspect, -6.0, 6.0, -6.0, 6.0); - glMatrixMode(GL_MODELVIEW); - - } - -UGL_LOCAL void drawGL(void) - { - GLint i; - static float vel0 = -100.0; - - glClear(GL_COLOR_BUFFER_BIT); - - glIndexi(CYAN); - glColor3f(0, 1, 1); - glBegin(GL_LINES); - for (i = -5; i <= 5; i++) - { - glVertex2i(i, -5); - glVertex2i(i, 5); - } - for (i = -5; i <= 5; i++) - { - glVertex2i(-5, i); - glVertex2i(5, i); - } - for (i = -5; i <= 5; i++) - { - glVertex2i(i, -5); - glVertex2f(i * 1.15, -5.9); - } - glVertex2f(-5.3, -5.35); - glVertex2f(5.3, -5.35); - glVertex2f(-5.75, -5.9); - glVertex2f(5.75, -5.9); - glEnd(); - - glPushMatrix(); - glTranslatef(Xpos, Ypos, 0.0); - glScalef(2.0, 2.0, 2.0); - glRotatef(8.0, 0.0, 0.0, 1.0); - glRotatef(90.0, 1.0, 0.0, 0.0); - glRotatef(Zrot, 0.0, 0.0, 1.0); - - glCallList(Ball); - - glPopMatrix(); - - glFlush(); - - uglMesaSwapBuffers(); - - Zrot += Zstep; - - Xpos += Xvel; - if (Xpos >= Xmax) - { - Xpos = Xmax; - Xvel = -Xvel; - Zstep = -Zstep; - } - if (Xpos <= Xmin) - { - Xpos = Xmin; - Xvel = -Xvel; - Zstep = -Zstep; - } - Ypos += Yvel; - Yvel += G; - if (Ypos < Ymin) - { - Ypos = Ymin; - if (vel0 == -100.0) - vel0 = fabs(Yvel); - Yvel = vel0; - } - } - -UGL_LOCAL int getEvent(void) - { - UGL_EVENT event; - UGL_STATUS status; - int retVal = 0; - - status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); - - while (status != UGL_STATUS_Q_EMPTY) - { - UGL_INPUT_EVENT * pInputEvent = (UGL_INPUT_EVENT *)&event; - - if (pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) - retVal = 1; - - status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); - } - - return(retVal); - } - -void windMLBounce (UGL_BOOL windMLMode); - -void uglbounce (void) - { - taskSpawn("tBounce", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLBounce, - UGL_FALSE,1,2,3,4,5,6,7,8,9); - } - -void windMLBounce(UGL_BOOL windMLMode) - { - GLsizei width, height; - UGL_INPUT_DEVICE_ID keyboardDevId; - - Zrot = 0.0; - Zstep = 6.0; - Xpos = 0.0; - Ypos = 1.0; - Xvel = 0.2; - Yvel = 0.0; - Xmin = -4.0; - Xmax = 4.0; - Ymin = -3.8; - G = -0.1; - - uglInitialize(); - - uglDriverFind (UGL_KEYBOARD_TYPE, 0, (UGL_UINT32 *)&keyboardDevId); - - uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); - - qId = uglEventQCreate (eventServiceId, 100); - - if (windMLMode) - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE - | UGL_MESA_WINDML_EXCLUSIVE, NULL); - else - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); - - if (umc == NULL) - { - uglDeinitialize(); - return; - } - - /* Fullscreen */ - - uglMesaMakeCurrentContext(umc, 0, 0, UGL_MESA_FULLSCREEN_WIDTH, - UGL_MESA_FULLSCREEN_HEIGHT); - - Ball = make_ball(); - glCullFace(GL_BACK); - glEnable(GL_CULL_FACE); - glDisable(GL_DITHER); - glShadeModel(GL_FLAT); - - uglMesaGetIntegerv(UGL_MESA_WIDTH, &width); - uglMesaGetIntegerv(UGL_MESA_HEIGHT, &height); - - initGL(width, height); - - while(!getEvent()) - drawGL(); - - uglEventQDestroy (eventServiceId, qId); - - uglMesaDestroyContext(); - uglDeinitialize (); - - return; - } diff --git a/progs/windml/uglcube.c b/progs/windml/uglcube.c deleted file mode 100644 index e701d8db462..00000000000 --- a/progs/windml/uglcube.c +++ /dev/null @@ -1,257 +0,0 @@ -/* uglcube.c - WindML/Mesa example program */ - -/* Copyright (C) 2001 by Wind River Systems, Inc */ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * The MIT License - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -/* -DESCRIPTION -Draw a smooth cube. -*/ - -#include -#include - -#include -#include - -#include -#include - -UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; -UGL_LOCAL UGL_EVENT_Q_ID qId; -UGL_LOCAL UGL_MESA_CONTEXT umc; -UGL_LOCAL GLfloat rotx; -UGL_LOCAL GLfloat roty; -UGL_LOCAL GLuint theCube; - -UGL_LOCAL void cube() - { - - /* Front */ - glBegin(GL_QUADS); - glColor3f(0.0f, 0.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glColor3f(0.0f, 1.0f, 0.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glColor3f(1.0f, 0.0f, 0.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glColor3f(1.0f, 1.0f, 0.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glEnd(); - - - /* Back */ - glBegin(GL_QUADS); - glColor3f(0.0f, 0.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glColor3f(0.0f, 1.0f, 0.0f); - glVertex3f(1.0f, 1.0f, -1.0f); - glColor3f(1.0f, 0.0f, 0.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glColor3f(1.0f, 1.0f, 0.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glEnd(); - - - /* Right */ - glBegin(GL_QUADS); - glColor3f(0.0f, 1.0f, 0.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glColor3f(0.0f, 1.0f, 0.0f); - glVertex3f(1.0f, 1.0f, -1.0f); - glColor3f(1.0f, 0.0f, 0.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glColor3f(1.0f, 0.0f, 0.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glEnd(); - - /* Left */ - glBegin(GL_QUADS); - glColor3f(0.0f, 0.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glColor3f(0.0f, 0.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glColor3f(1.0f, 1.0f, 0.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glColor3f(1.0f, 1.0f, 0.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glEnd(); - - /* Top */ - glBegin(GL_QUADS); - glColor3f(0.0f, 0.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - glColor3f(0.0f, 1.0f, 0.0f); - glVertex3f(1.0f, 1.0f, -1.0f); - glColor3f(0.0f, 1.0f, 0.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - glColor3f(0.0f, 0.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - glEnd(); - - - /* Bottom */ - glBegin(GL_QUADS); - glColor3f(1.0f, 1.0f, 0.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - glColor3f(1.0f, 0.0f, 0.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - glColor3f(1.0f, 0.0f, 0.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - glColor3f(1.0f, 1.0f, 0.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - glEnd(); - } - -UGL_LOCAL void initGL - ( - int Width, - int Height - ) - { - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - glDepthFunc(GL_LESS); - glEnable(GL_DEPTH_TEST); - glShadeModel(GL_SMOOTH); - - theCube = glGenLists(1); - glNewList(theCube, GL_COMPILE); - cube(); - glEndList(); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(45.0f, (GLfloat) Width / (GLfloat) Height, 0.1f, 100.0f); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef(0.0f, 0.0f, -6.0f); - } - - -/* The main drawing function. */ - -UGL_LOCAL void drawGL() - { - - /* Clear The Screen And The Depth Buffer */ - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - /* Rotate the cube */ - - glRotatef(rotx, 1.0f, 0.0f, 0.0f); - glRotatef(roty, 0.0f, 1.0f, 0.0f); - - glCallList(theCube); - - glFlush(); - - uglMesaSwapBuffers(); - } - - -/* The function called whenever a key is pressed. */ - -UGL_LOCAL int getEvent(void) - { - UGL_EVENT event; - UGL_STATUS status; - int retVal = 0; - - status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); - - while (status != UGL_STATUS_Q_EMPTY) - { - UGL_INPUT_EVENT * pInputEvent = (UGL_INPUT_EVENT *)&event; - - if (pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) - retVal = 1; - - status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); - } - - return(retVal); - } - -void windMLCube (UGL_BOOL windMLMode); - -void uglcube (void) - { - taskSpawn("tCube", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLCube, - UGL_FALSE,1,2,3,4,5,6,7,8,9); - } - -void windMLCube (UGL_BOOL windMLMode) - { - GLsizei width, height; - UGL_INPUT_DEVICE_ID keyboardDevId; - - rotx = 2.5f; - roty = 1.0f; - - uglInitialize(); - - uglDriverFind (UGL_KEYBOARD_TYPE, 0, (UGL_UINT32 *)&keyboardDevId); - - if (uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, - (UGL_UINT32 *)&eventServiceId) == UGL_STATUS_OK) - { - qId = uglEventQCreate (eventServiceId, 100); - } - else - { - eventServiceId = UGL_NULL; - } - - if (windMLMode) - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE - | UGL_MESA_WINDML_EXCLUSIVE, NULL); - else - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); - - /* Fullscreen */ - - uglMesaMakeCurrentContext(umc, 0, 0, UGL_MESA_FULLSCREEN_WIDTH, - UGL_MESA_FULLSCREEN_HEIGHT); - - uglMesaGetIntegerv(UGL_MESA_WIDTH, &width); - uglMesaGetIntegerv(UGL_MESA_HEIGHT, &height); - - /* Initialize our window. */ - - initGL(width, height); - - while (!getEvent()) - drawGL(); - - if (eventServiceId != UGL_NULL) - uglEventQDestroy (eventServiceId, qId); - - uglMesaDestroyContext(); - uglDeinitialize(); - - return; - } diff --git a/progs/windml/ugldrawpix.c b/progs/windml/ugldrawpix.c deleted file mode 100644 index 154fe55970e..00000000000 --- a/progs/windml/ugldrawpix.c +++ /dev/null @@ -1,437 +0,0 @@ -/* - * glDrawPixels demo/test/benchmark - * - * Brian Paul September 25, 1997 This file is in the public domain. - * - * Conversion to UGL/Mesa by Stephane Raimbault july, 2001 - */ - -/* - * Revision 1.2 2001/09/10 19:21:13 brianp - * WindML updates (Stephane Raimbault) - * - * Revision 1.1 2001/08/20 16:07:11 brianp - * WindML driver (Stephane Raimbault) - * - * Revision 1.5 2000/12/24 22:53:54 pesco - * * demos/Makefile.am (INCLUDES): Added -I$(top_srcdir)/util. - * * demos/Makefile.X11, demos/Makefile.BeOS-R4, demos/Makefile.cygnus: - * Essentially the same. - * Program files updated to include "readtex.c", not "../util/readtex.c". - * * demos/reflect.c: Likewise for "showbuffer.c". - * - * - * * Makefile.am (EXTRA_DIST): Added top-level regular files. - * - * * include/GL/Makefile.am (INC_X11): Added glxext.h. - * - * - * * src/GGI/include/ggi/mesa/Makefile.am (EXTRA_HEADERS): Include - * Mesa GGI headers in dist even if HAVE_GGI is not given. - * - * * configure.in: Look for GLUT and demo source dirs in $srcdir. - * - * * src/swrast/Makefile.am (libMesaSwrast_la_SOURCES): Set to *.[ch]. - * More source list updates in various Makefile.am's. - * - * * Makefile.am (dist-hook): Remove CVS directory from distribution. - * (DIST_SUBDIRS): List all possible subdirs here. - * (SUBDIRS): Only list subdirs selected for build again. - * The above two applied to all subdir Makefile.am's also. - * - * Revision 1.4 2000/09/08 21:45:21 brianp - * added dither key option - * - * Revision 1.3 1999/10/28 18:23:29 brianp - * minor changes to Usage() function - * - * Revision 1.2 1999/10/21 22:13:58 brianp - * added f key to toggle front/back drawing - * - * Revision 1.1.1.1 1999/08/19 00:55:40 jtg - * Imported sources - * - * Revision 3.3 1999/03/28 18:18:33 brianp - * minor clean-up - * - * Revision 3.2 1998/11/05 04:34:04 brianp - * moved image files to ../images/ directory - * - * Revision 3.1 1998/02/22 16:43:17 brianp - * added a few casts to silence compiler warnings - * - * Revision 3.0 1998/02/14 18:42:29 brianp - * initial rev - * - */ - - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "../util/readtex.h" - -#define IMAGE_FILE "Mesa/images/wrs_logo.rgb" - -UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; -UGL_LOCAL UGL_EVENT_Q_ID qId; -UGL_LOCAL volatile UGL_BOOL stopWex; -UGL_LOCAL UGL_MESA_CONTEXT umc; - -UGL_LOCAL int ImgWidth, ImgHeight; -UGL_LOCAL GLenum ImgFormat; -UGL_LOCAL GLubyte *Image; - -UGL_LOCAL int Xpos, Ypos; -UGL_LOCAL int SkipPixels, SkipRows; -UGL_LOCAL int DrawWidth, DrawHeight; -UGL_LOCAL float Xzoom, Yzoom; -UGL_LOCAL GLboolean Scissor; -UGL_LOCAL GLboolean DrawFront; -UGL_LOCAL GLboolean Dither; - -UGL_LOCAL void cleanUp (void); - -UGL_LOCAL void reset(void) - { - Xpos = Ypos = 20; - DrawWidth = ImgWidth; - DrawHeight = ImgHeight; - SkipPixels = SkipRows = 0; - Scissor = GL_FALSE; - Xzoom = Yzoom = 1.0; - } - -UGL_LOCAL void initGL(GLboolean ciMode, GLsizei width, GLsizei height) - { - printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - - Image = LoadRGBImage(IMAGE_FILE, &ImgWidth, &ImgHeight, &ImgFormat); - if (!Image) - { - printf("Couldn't read %s\n", IMAGE_FILE); - cleanUp(); - exit(1); - } - - glScissor(width/4, height/4, width/2, height/2); - - if (ciMode) - { - /* Convert RGB image to grayscale */ - GLubyte *indexImage = malloc( ImgWidth * ImgHeight ); - GLint i; - for (i=0; i 0) - DrawWidth--; - break; - case 'W': - DrawWidth++; - break; - case 'h': - if (DrawHeight > 0) - DrawHeight--; - break; - case 'H': - DrawHeight++; - break; - case 'p': - if (SkipPixels > 0) - SkipPixels--; - break; - case 'P': - SkipPixels++; - break; - case 'r': - if (SkipRows > 0) - SkipRows--; - break; - case 'R': - SkipRows++; - break; - case 's': - Scissor = !Scissor; - break; - case 'x': - Xzoom -= 0.1; - break; - case 'X': - Xzoom += 0.1; - break; - case 'y': - Yzoom -= 0.1; - break; - case 'Y': - Yzoom += 0.1; - break; - case 'b': - benchmark(); - break; - case 'f': - DrawFront = !DrawFront; - if (DrawFront) - glDrawBuffer(GL_FRONT); - else - glDrawBuffer(GL_BACK); - printf("glDrawBuffer(%s)\n", DrawFront ? "GL_FRONT" : "GL_BACK"); - break; - case UGL_UNI_UP_ARROW: - Ypos += 1; - break; - case UGL_UNI_DOWN_ARROW: - Ypos -= 1; - break; - case UGL_UNI_LEFT_ARROW: - Xpos -= 1; - break; - case UGL_UNI_RIGHT_ARROW: - Xpos += 1; - break; - case UGL_UNI_ESCAPE: - stopWex = UGL_TRUE; - break; - } - } - -UGL_LOCAL void loopEvent(void) - { - UGL_EVENT event; - UGL_INPUT_EVENT * pInputEvent; - - UGL_FOREVER - { - if (uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT) - != UGL_STATUS_Q_EMPTY) - { - pInputEvent = (UGL_INPUT_EVENT *)&event; - - if (pInputEvent->header.type == UGL_EVENT_TYPE_KEYBOARD && - pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) - readKey(pInputEvent->type.keyboard.key); - } - - drawGL(); - if (stopWex) - break; - } - } - -UGL_LOCAL void cleanUp (void) - { - uglEventQDestroy (eventServiceId, qId); - - uglMesaDestroyContext(); - uglDeinitialize (); - } - -void windMLDrawPix (UGL_BOOL windMLMode); - -void ugldrawpix (void) - { - taskSpawn ("tDrawPix", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLDrawPix, - UGL_FALSE,1,2,3,4,5,6,7,8,9); - } - -void windMLDrawPix (UGL_BOOL windMLMode) - { - UGL_INPUT_DEVICE_ID keyboardDevId; - GLuint ciMode; - GLsizei width, height; - - Image = NULL; - Scissor = GL_FALSE; - DrawFront = GL_FALSE; - Dither = GL_TRUE; - - uglInitialize (); - - uglDriverFind (UGL_KEYBOARD_TYPE, 0, - (UGL_UINT32 *)&keyboardDevId); - - uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); - - qId = uglEventQCreate (eventServiceId, 100); - - /* Double buffering */ - if (windMLMode) - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE - | UGL_MESA_WINDML_EXCLUSIVE, NULL); - else - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); - - if (umc == NULL) - { - uglDeinitialize (); - return; - } - - uglMesaMakeCurrentContext(umc, 0, 0, UGL_MESA_FULLSCREEN_WIDTH, - UGL_MESA_FULLSCREEN_HEIGHT); - - uglMesaGetIntegerv(UGL_MESA_COLOR_INDEXED, &ciMode); - uglMesaGetIntegerv(UGL_MESA_WIDTH, &width); - uglMesaGetIntegerv(UGL_MESA_HEIGHT, &height); - - initGL(ciMode, width, height); - - echoUse(); - - stopWex = UGL_FALSE; - loopEvent(); - - cleanUp(); - free(Image); - - return; - } diff --git a/progs/windml/uglflip.c b/progs/windml/uglflip.c deleted file mode 100644 index 0ca068f417d..00000000000 --- a/progs/windml/uglflip.c +++ /dev/null @@ -1,224 +0,0 @@ - -/* uglflip.c - WindML/Mesa example program */ - -/* Copyright (C) 2001 by Wind River Systems, Inc */ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * The MIT License - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -/* - * Authors: - * Stephane Raimbault - */ - -/* -DESCRIPTION -Draw a triangle and flip the screen -*/ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#define BLACK (0) -#define RED (1) -#define GREEN (2) -#define BLUE (3) -#define CI_OFFSET 4 - -UGL_LOCAL GLuint rgb; -UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; -UGL_LOCAL UGL_EVENT_Q_ID qId; -UGL_LOCAL volatile UGL_BOOL stopWex; - -UGL_LOCAL UGL_MESA_CONTEXT umc; - -UGL_LOCAL void initGL (void) - { - uglMesaSetColor(BLACK, 0.0, 0.0, 0.0); - uglMesaSetColor(RED, 1.0, 0.3, 0.3); - uglMesaSetColor(GREEN, 0.3, 1.0, 0.3); - uglMesaSetColor(BLUE, 0.3, 0.3, 1.0); - - glClearColor(0.0, 0.0, 0.0, 0.0); - glClearIndex(BLACK); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); - } - -UGL_LOCAL void drawGL (void) - { - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - (rgb) ? glColor3f(1.0, 0.3, 0.3) : glIndexi(RED); - glVertex2f(0.75, -0.50); - (rgb) ? glColor3f(0.3, 1.0, 0.3) : glIndexi(GREEN); - glVertex2f(0.0, 0.75); - (rgb) ? glColor3f(0.3, 0.3, 1.0) : glIndexi(BLUE); - glVertex2f(-0.75, -0.50); - glEnd(); - - glBegin(GL_LINES); - (rgb) ? glColor3f(1.0, 0.3, 0.3) : glIndexi(RED); - glVertex2f(-1.0, 1.0); - (rgb) ? glColor3f(0.3, 0.3, 1.0) : glIndexi(BLUE); - glVertex2f(1.0, -1.0); - glEnd(); - - glFlush(); - - uglMesaSwapBuffers(); - } - -UGL_LOCAL void echoUse(void) - { - printf("tFlip keys:\n"); - printf(" d Toggle dithering\n"); - printf(" up Reduce the window\n"); - printf(" down Enlarge the window\n"); - printf(" page up Y==0 is the bottom line and increases upward\n"); - printf(" page down Y==0 is the bottom line and increases downward\n"); - printf(" ESC Exit\n"); - } - -UGL_LOCAL void readKey (UGL_WCHAR key) - { - - switch(key) - { - case UGL_UNI_UP_ARROW: - uglMesaResizeWindow(8, 8); - break; - case UGL_UNI_DOWN_ARROW: - glDrawBuffer(GL_FRONT_LEFT); - glClear(GL_COLOR_BUFFER_BIT); - glDrawBuffer(GL_BACK_LEFT); - uglMesaResizeWindow(-8, -8); - break; - case UGL_UNI_PAGE_UP: - uglMesaPixelStore(UGL_MESA_Y_UP, GL_TRUE); - break; - case UGL_UNI_PAGE_DOWN: - uglMesaPixelStore(UGL_MESA_Y_UP, GL_FALSE); - break; - case UGL_UNI_ESCAPE: - stopWex = UGL_TRUE; - break; - case 'd': - if (glIsEnabled(GL_DITHER)) - glDisable(GL_DITHER); - else - glEnable(GL_DITHER); - break; - } - } - -UGL_LOCAL void loopEvent(void) - { - UGL_EVENT event; - UGL_INPUT_EVENT * pInputEvent; - - drawGL(); - - UGL_FOREVER - { - if (uglEventGet (qId, &event, sizeof (event), UGL_WAIT_FOREVER) - != UGL_STATUS_Q_EMPTY) - { - pInputEvent = (UGL_INPUT_EVENT *)&event; - - if (pInputEvent->header.type == UGL_EVENT_TYPE_KEYBOARD && - pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) - { - readKey(pInputEvent->type.keyboard.key); - drawGL(); - } - } - - if (stopWex) - break; - } - } - -void windMLFlip (UGL_BOOL windMLMode); - -void uglflip (void) - { - taskSpawn ("tFlip", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLFlip, - UGL_FALSE,1,2,3,4,5,6,7,8,9); - } - -void windMLFlip (UGL_BOOL windMLMode) - { - - UGL_INPUT_DEVICE_ID keyboardDevId; - - uglInitialize(); - - uglDriverFind (UGL_KEYBOARD_TYPE, 0, (UGL_UINT32 *)&keyboardDevId); - - uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); - - qId = uglEventQCreate (eventServiceId, 100); - - if (windMLMode) - umc = uglMesaCreateNewContext(UGL_MESA_SINGLE - | UGL_MESA_WINDML_EXCLUSIVE, NULL); - else - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE_SOFTWARE, NULL); - - if (umc == NULL) - { - uglDeinitialize(); - return; - } - - uglMesaMakeCurrentContext(umc, 0, 0, UGL_MESA_FULLSCREEN_WIDTH, - UGL_MESA_FULLSCREEN_HEIGHT); - - uglMesaGetIntegerv(UGL_MESA_RGB, &rgb); - - initGL(); - - echoUse(); - stopWex = UGL_FALSE; - loopEvent(); - - uglEventQDestroy (eventServiceId, qId); - - uglMesaDestroyContext(); - uglDeinitialize(); - - return; - } diff --git a/progs/windml/uglgears.c b/progs/windml/uglgears.c deleted file mode 100644 index 468fe899806..00000000000 --- a/progs/windml/uglgears.c +++ /dev/null @@ -1,428 +0,0 @@ - -/* uglgears.c - WindML/Mesa example program */ - -/* - * 3-D gear wheels. This program is in the public domain. - * - * Brian Paul - * - * Conversion to GLUT by Mark J. Kilgard - * Conversion to UGL/Mesa from GLUT by Stephane Raimbault - */ - -/* -DESCRIPTION -Spinning gears demo -*/ - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - -#define COUNT_FRAMES - -UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; -UGL_LOCAL UGL_EVENT_Q_ID qId; -UGL_LOCAL volatile UGL_BOOL stopWex; -UGL_LOCAL UGL_MESA_CONTEXT umc; - -UGL_LOCAL GLfloat view_rotx, view_roty, view_rotz; -UGL_LOCAL GLint gear1, gear2, gear3; -UGL_LOCAL GLfloat angle; - -UGL_LOCAL GLuint limit; -UGL_LOCAL GLuint count; -UGL_LOCAL GLuint tickStart, tickStop, tickBySec; - - -/* -* 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 -*/ - -UGL_LOCAL 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; i limit) - { - tickStop = tickGet (); - time = (tickStop-tickStart)/tickBySec; - printf (" %i fps\n", count/time); - tickStart = tickStop; - count = 0; - } - else - count++; -#endif -} - - -UGL_LOCAL void initGL (GLsizei width, GLsizei height) - { - UGL_LOCAL GLfloat pos[4] = {5.0, 5.0, 10.0, 1.0 }; - UGL_LOCAL GLfloat red[4] = {0.8, 0.1, 0.0, 1.0 }; - UGL_LOCAL GLfloat green[4] = {0.0, 0.8, 0.2, 1.0 }; - UGL_LOCAL GLfloat blue[4] = {0.2, 0.2, 1.0, 1.0 }; - - glLightfv (GL_LIGHT0, GL_POSITION, pos); - glEnable (GL_CULL_FACE); - glEnable (GL_LIGHTING); - glEnable (GL_LIGHT0); - glEnable (GL_DEPTH_TEST); - - /* make the gears */ - gear1 = glGenLists (1); - glNewList (gear1, GL_COMPILE); - glMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red); - gear (1.0, 4.0, 1.0, 20, 0.7); - glEndList (); - - gear2 = glGenLists (1); - glNewList (gear2, GL_COMPILE); - glMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green); - gear (0.5, 2.0, 2.0, 10, 0.7); - glEndList (); - - gear3 = glGenLists (1); - glNewList (gear3, GL_COMPILE); - glMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue); - gear (1.3, 2.0, 0.5, 10, 0.7); - glEndList (); - - glEnable (GL_NORMALIZE); - - glViewport (0, 0, width, height); - - glMatrixMode (GL_PROJECTION); - glLoadIdentity (); - if (width>height) - { - 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); - -#ifdef COUNT_FRAMES - tickStart = tickGet (); - tickBySec = sysClkRateGet (); -#endif -} - -UGL_LOCAL void echoUse(void) - { - printf("tGears keys:\n"); - printf(" z Counter clockwise rotation (z-axis)\n"); - printf(" Z Clockwise rotation (z-axis)\n"); - printf(" Up Counter clockwise rotation (x-axis)\n"); - printf(" Down Clockwise rotation (x-axis)\n"); - printf(" Left Counter clockwise rotation (y-axis)\n"); - printf(" Right Clockwise rotation (y-axis)\n"); - printf(" ESC Exit\n"); - } - - -UGL_LOCAL void readKey (UGL_WCHAR key) - { - - switch(key) - { - case 'z': - view_rotz += 5.0; - break; - case 'Z': - view_rotz -= 5.0; - break; - case UGL_UNI_UP_ARROW: - view_rotx += 5.0; - break; - case UGL_UNI_DOWN_ARROW: - view_rotx -= 5.0; - break; - case UGL_UNI_LEFT_ARROW: - view_roty += 5.0; - break; - case UGL_UNI_RIGHT_ARROW: - view_roty -= 5.0; - break; - case UGL_UNI_ESCAPE: - stopWex = UGL_TRUE; - break; - } - } - -UGL_LOCAL void loopEvent(void) - { - UGL_EVENT event; - UGL_INPUT_EVENT * pInputEvent; - - UGL_FOREVER - { - if (uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT) - != UGL_STATUS_Q_EMPTY) - { - pInputEvent = (UGL_INPUT_EVENT *)&event; - - if (pInputEvent->header.type == UGL_EVENT_TYPE_KEYBOARD && - pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) - readKey(pInputEvent->type.keyboard.key); - } - - drawGL(); - if (stopWex) - break; - } - } - -void windMLGears (UGL_BOOL windMLMode); - -void uglgears (void) - { - taskSpawn ("tGears", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLGears, - UGL_FALSE,1,2,3,4,5,6,7,8,9); - } - -void windMLGears (UGL_BOOL windMLMode) - { - GLsizei width, height; - UGL_INPUT_DEVICE_ID keyboardDevId; - - view_rotx=20.0; - view_roty=30.0; - view_rotz=0.0; - angle = 0.0; - limit = 100; - count = 1; - - uglInitialize (); - - uglDriverFind (UGL_KEYBOARD_TYPE, 0, - (UGL_UINT32 *)&keyboardDevId); - - uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); - - qId = uglEventQCreate (eventServiceId, 100); - - /* Double buffering */ - if (windMLMode) - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE - | UGL_MESA_WINDML_EXCLUSIVE, NULL); - else - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); - - if (umc == NULL) - { - uglDeinitialize (); - return; - } - - /* Fullscreen */ - - uglMesaMakeCurrentContext (umc, 0, 0, UGL_MESA_FULLSCREEN_WIDTH, - UGL_MESA_FULLSCREEN_HEIGHT); - - uglMesaGetIntegerv(UGL_MESA_WIDTH, &width); - uglMesaGetIntegerv(UGL_MESA_HEIGHT, &height); - - initGL (width, height); - - echoUse(); - - stopWex = UGL_FALSE; - loopEvent(); - - uglEventQDestroy (eventServiceId, qId); - - uglMesaDestroyContext(); - uglDeinitialize (); - - return; - } diff --git a/progs/windml/uglicotorus.c b/progs/windml/uglicotorus.c deleted file mode 100644 index c09b6d1b520..00000000000 --- a/progs/windml/uglicotorus.c +++ /dev/null @@ -1,315 +0,0 @@ -/* uglicotorus.c - WindML/Mesa example program */ - -/* Copyright (C) 2001 by Wind River Systems, Inc */ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * The MIT License - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -/* -modification history --------------------- -01a,jun01,sra -*/ - -#include -#include - -#include -#include -#include - -#include -#include - -/* Need GLUT_SHAPES */ - -#include - -UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; -UGL_LOCAL UGL_EVENT_Q_ID qId; -UGL_LOCAL UGL_MESA_CONTEXT umc; -UGL_LOCAL volatile UGL_BOOL stopWex; - -UGL_LOCAL GLfloat angle; -UGL_LOCAL GLboolean chaos_on; -UGL_LOCAL GLboolean color_on; - -UGL_LOCAL GLuint theIco, theTorus, theSphere, theCube; - -UGL_LOCAL void initGL - ( - int w, - int h - ) - { - glViewport(0,0,(GLsizei)w,(GLsizei)h); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(60.0,(GLfloat)w/(GLfloat)h,1.0,60.0); - - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - gluLookAt(0.0,0.0,25.0,0.0,0.0,0.0,0.0,1.0,0.0); - - glClearColor(0.0,0.0,0.0,0.0); - - glEnable(GL_DEPTH_TEST); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - - glEnable(GL_COLOR_MATERIAL); - - theIco = glGenLists(1); - glNewList(theIco, GL_COMPILE); - glutSolidIcosahedron(); - glEndList(); - - theTorus = glGenLists(1); - glNewList(theTorus, GL_COMPILE); - glutSolidTorus(0.2,1.0,10,10); - glEndList(); - - theSphere = glGenLists(1); - glNewList(theSphere, GL_COMPILE); - glutSolidSphere(2.5,20,20); - glEndList(); - - theCube = glGenLists(1); - glNewList(theCube, GL_COMPILE); - glutSolidCube(4.0); - glEndList(); - - } - -UGL_LOCAL void createIcoToruses - ( - int i - ) - { - glPushMatrix(); - glRotatef(angle,1.0,1.0,1.0); - glCallList(theIco); - - switch (i) - { - case 9 : - glColor3f(1.0,0.0,0.0); - break; - case 0 : - glColor3f(1.0,0.1,0.7); - break; - case 1 : - glColor3f(1.0,0.0,1.0); - break; - case 2 : - glColor3f(0.0,0.0,1.0); - break; - case 3 : - glColor3f(0.0,0.5,1.0); - break; - case 4 : - glColor3f(0.0,1.0,0.7); - break; - case 5 : - glColor3f(0.0,1.0,0.0); - break; - case 6 : - glColor3f(0.5,1.0,0.0); - break; - case 7 : - glColor3f(1.0,1.0,0.0); - break; - case 8 : - glColor3f(1.0,0.5,0.0); - break; - } - - glRotatef(angle,1.0,1.0,1.0); - glCallList(theTorus); - glRotatef(-2*angle,1.0,1.0,1.0); - glCallList(theTorus); - glPopMatrix(); - } - -UGL_LOCAL void drawGL (void) - { - int i; - - if (color_on) - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - else - glClear(GL_DEPTH_BUFFER_BIT); - - glPushMatrix(); - - if (chaos_on) - glRotatef(angle,1.0,1.0,1.0); - - glPushMatrix(); - glRotatef(angle,1.0,1.0,1.0); - glColor3f(1.0,0.5,0.0); - glCallList(theSphere); - glColor3f(1.0,0.0,0.0); - glCallList(theCube); - glPopMatrix(); - - glRotatef(-angle,0.0,0.0,1.0); - glPushMatrix(); - /* draw ten icosahedrons */ - for (i = 0; i < 10; i++) - { - glPushMatrix(); - glRotatef(36*i,0.0,0.0,1.0); - glTranslatef(10.0,0.0,0.0); - glRotatef(2*angle,0.0,1.0,0.0); - glTranslatef(0.0,0.0,2.0); - - createIcoToruses(i); - glPopMatrix(); - } - glPopMatrix(); - - glPopMatrix(); - - uglMesaSwapBuffers(); - - angle += 1.0; - - } - -UGL_LOCAL void echoUse(void) - { - printf("tIcoTorus keys:\n"); - printf(" c Toggle color buffer clear\n"); - printf(" SPACE Toggle chaos mode\n"); - printf(" ESC Exit\n"); - } - -UGL_LOCAL void readKey (UGL_WCHAR key) - { - - switch(key) - { - case 'c': - color_on = !color_on; - break; - case UGL_UNI_SPACE: - chaos_on = !chaos_on; - break; - case UGL_UNI_ESCAPE: - stopWex = UGL_TRUE; - break; - } - } - -UGL_LOCAL void loopEvent(void) - { - UGL_EVENT event; - UGL_INPUT_EVENT * pInputEvent; - - UGL_FOREVER - { - if (uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT) - != UGL_STATUS_Q_EMPTY) - { - pInputEvent = (UGL_INPUT_EVENT *)&event; - - if (pInputEvent->header.type == UGL_EVENT_TYPE_KEYBOARD && - pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) - readKey(pInputEvent->type.keyboard.key); - } - - drawGL(); - if (stopWex) - break; - } - } - -void windMLIcoTorus (UGL_BOOL windMLMode); - -void uglicotorus (void) - { - taskSpawn ("tIcoTorus", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLIcoTorus, - UGL_FALSE,1,2,3,4,5,6,7,8,9); - } - -void windMLIcoTorus (UGL_BOOL windMLMode) - { - GLsizei width, height; - UGL_INPUT_DEVICE_ID keyboardDevId; - - angle = 0.0; - chaos_on = GL_TRUE; - color_on = GL_TRUE; - - uglInitialize (); - - uglDriverFind (UGL_KEYBOARD_TYPE, 0, - (UGL_UINT32 *)&keyboardDevId); - - if (uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, - (UGL_UINT32 *)&eventServiceId) == UGL_STATUS_OK) - { - qId = uglEventQCreate (eventServiceId, 100); - } - else - { - eventServiceId = UGL_NULL; - } - - /* Double buffering */ - if (windMLMode) - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE - | UGL_MESA_WINDML_EXCLUSIVE, NULL); - else - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); - - if (umc == NULL) - { - uglDeinitialize (); - return; - } - - uglMesaMakeCurrentContext (umc, 0, 0, UGL_MESA_FULLSCREEN_WIDTH, - UGL_MESA_FULLSCREEN_HEIGHT); - - uglMesaGetIntegerv(UGL_MESA_WIDTH, &width); - uglMesaGetIntegerv(UGL_MESA_HEIGHT, &height); - - initGL (width, height); - - echoUse(); - - stopWex = UGL_FALSE; - loopEvent(); - - if (eventServiceId != UGL_NULL) - uglEventQDestroy (eventServiceId, qId); - - uglMesaDestroyContext (); - uglDeinitialize (); - - return; - } - diff --git a/progs/windml/uglline.c b/progs/windml/uglline.c deleted file mode 100644 index e58f071ea4b..00000000000 --- a/progs/windml/uglline.c +++ /dev/null @@ -1,274 +0,0 @@ - -/* uglline.c - WindML/Mesa example program */ - -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* -modification history --------------------- -01a,jun01,sra Ported to UGL/Mesa and modifications -*/ - -/* -DESCRIPTION -Draw circular lines -*/ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#define BLACK (0) -#define YELLOW (1) -#define GREEN (2) -#define BLUE (3) -#define CI_OFFSET 4 - -UGL_LOCAL GLuint rgb; -UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; -UGL_LOCAL UGL_EVENT_Q_ID qId; -UGL_LOCAL volatile UGL_BOOL stopWex; -UGL_LOCAL UGL_MESA_CONTEXT umc; - -UGL_LOCAL GLboolean mode1, mode2; -UGL_LOCAL GLint size; - -UGL_LOCAL GLfloat pntA[3] = { - -10.0, 0.0, 0.0 -}; -UGL_LOCAL GLfloat pntB[3] = { - -5.0, 0.0, 0.0 -}; - -UGL_LOCAL GLint angleA; - -UGL_LOCAL void initGL (void) - { - GLint i; - - uglMesaSetColor(BLACK, 0.0, 0.0, 0.0); - uglMesaSetColor(YELLOW, 1.0, 1.0, 0.0); - uglMesaSetColor(GREEN, 0.0, 1.0, 0.0); - uglMesaSetColor(BLUE, 0.0, 0.0, 1.0); - - for (i = 0; i < 16; i++) - { - uglMesaSetColor(CI_OFFSET+i, i/15.0, i/15.0, 0.0); - } - - glClearColor(0.0, 0.0, 0.0, 0.0); - glClearIndex(BLACK); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-10, 10, -10, 10, -10.0, 10.0); - - glMatrixMode(GL_MODELVIEW); - - glLineStipple(1, 0xF0E0); - glBlendFunc(GL_SRC_ALPHA, GL_ONE); - - mode1 = GL_FALSE; - mode2 = GL_FALSE; - size = 1; - } - -UGL_LOCAL void drawGL (void) - { - - GLint ci, i; - - glClear(GL_COLOR_BUFFER_BIT); - - glLineWidth(size); - - if (mode1) { - glEnable(GL_LINE_STIPPLE); - } else { - glDisable(GL_LINE_STIPPLE); - } - - if (mode2) { - ci = CI_OFFSET; - glEnable(GL_LINE_SMOOTH); - glEnable(GL_BLEND); - } else { - ci = YELLOW; - glDisable(GL_LINE_SMOOTH); - glDisable(GL_BLEND); - } - - glPushMatrix(); - - glRotatef(angleA, 1, 0, 1); - angleA = angleA++ % 360; - - for (i = 0; i < 360; i += 5) { - glRotatef(5.0, 0, 0, 1); - - glColor3f(1.0, 1.0, 0.0); - glBegin(GL_LINE_STRIP); - glVertex3fv(pntA); - glVertex3fv(pntB); - glEnd(); - - glPointSize(1); - - glColor3f(0.0, 1.0, 0.0); - glBegin(GL_POINTS); - glVertex3fv(pntA); - glVertex3fv(pntB); - glEnd(); - } - - glPopMatrix(); - - glFlush(); - - uglMesaSwapBuffers(); - - } - -UGL_LOCAL void echoUse(void) - { - printf("tLine keys:\n"); - printf(" b Blending/antialiasing\n"); - printf(" n Line stipple\n"); - printf(" Up/Down Pixel size\n"); - printf(" ESC Exit\n"); - } - -UGL_LOCAL void readKey (UGL_WCHAR key) - { - switch(key) - { - case 'n': - mode1 = (mode1) ? GL_FALSE: GL_TRUE; - break; - case 'b': - mode2 = (mode2) ? GL_FALSE: GL_TRUE; - break; - case UGL_UNI_DOWN_ARROW: - if(size>0) - size--; - break; - case UGL_UNI_UP_ARROW: - size++; - break; - case UGL_UNI_ESCAPE: - stopWex = UGL_TRUE; - break; - } - } - -UGL_LOCAL void loopEvent(void) - { - UGL_EVENT event; - UGL_INPUT_EVENT * pInputEvent; - - UGL_FOREVER - { - if (uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT) - != UGL_STATUS_Q_EMPTY) - { - pInputEvent = (UGL_INPUT_EVENT *)&event; - - if (pInputEvent->header.type == UGL_EVENT_TYPE_KEYBOARD && - pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) - readKey(pInputEvent->type.keyboard.key); - } - - drawGL(); - if (stopWex) - break; - } - } - -void windMLLine (UGL_BOOL windMLMode); - -void uglline (void) - { - taskSpawn("tLine", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLLine, - UGL_FALSE,1,2,3,4,5,6,7,8,9); - } - - -void windMLLine(UGL_BOOL windMLMode) - { - - UGL_INPUT_DEVICE_ID keyboardDevId; - - angleA = 0; - - uglInitialize(); - - uglDriverFind (UGL_KEYBOARD_TYPE, 0, (UGL_UINT32 *)&keyboardDevId); - - uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); - - qId = uglEventQCreate (eventServiceId, 100); - - /* Double buffer */ - - if (windMLMode) - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE - | UGL_MESA_WINDML_EXCLUSIVE, NULL); - else - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); - - if (umc == NULL) - { - uglDeinitialize(); - return; - } - - /* Fullscreen */ - - uglMesaMakeCurrentContext(umc, 0, 0, UGL_MESA_FULLSCREEN_WIDTH, - UGL_MESA_FULLSCREEN_HEIGHT); - - uglMesaGetIntegerv(UGL_MESA_RGB, &rgb); - - initGL(); - - echoUse(); - - stopWex = UGL_FALSE; - loopEvent(); - - uglEventQDestroy(eventServiceId, qId); - - uglMesaDestroyContext(); - uglDeinitialize(); - - return; - } diff --git a/progs/windml/uglolympic.c b/progs/windml/uglolympic.c deleted file mode 100644 index 282558dacbd..00000000000 --- a/progs/windml/uglolympic.c +++ /dev/null @@ -1,479 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the name of - * Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF - * ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * Nov 20, 1995 use stdlib's rand()/srand() instead of random()/srand48(), etc. - */ - -/* - * Modified by Stephane Raimbault to be able to run in VxWorks 07/18/01 - * - * Modified by Li Wei(liwei@aiar.xjtu.edu.cn) to be able to run in Windows - * 6/13 - * - * Modified by Brian Paul to compile with Windows OR Unix. 7/23/97 - */ - - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -#ifndef RAND_MAX -# define RAND_MAX 32767 -#endif - -#define XSIZE 100 -#define YSIZE 75 - -#define RINGS 5 -#define BLUERING 0 -#define BLACKRING 1 -#define REDRING 2 -#define YELLOWRING 3 -#define GREENRING 4 - -#define BACKGROUND 8 - -UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; -UGL_LOCAL UGL_EVENT_Q_ID qId; -UGL_LOCAL UGL_MESA_CONTEXT umc; -UGL_LOCAL volatile UGL_BOOL stopWex; - -UGL_LOCAL int rgb; -UGL_LOCAL unsigned char rgb_colors[RINGS][3]; -UGL_LOCAL int mapped_colors[RINGS]; -UGL_LOCAL float dests[RINGS][3]; -UGL_LOCAL float offsets[RINGS][3]; -UGL_LOCAL float angs[RINGS]; -UGL_LOCAL float rotAxis[RINGS][3]; -UGL_LOCAL int iters[RINGS]; -UGL_LOCAL GLuint theTorus; - -enum { - COLOR_BLACK = 0, - COLOR_RED, - COLOR_GREEN, - COLOR_YELLOW, - COLOR_BLUE, - COLOR_MAGENTA, - COLOR_CYAN, - COLOR_WHITE -}; - -/* -UGL_LOCAL float RGBMap[9][3] = { - {0, 0, 0}, - {1, 0, 0}, - {0, 1, 0}, - {1, 1, 0}, - {0, 0, 1}, - {1, 0, 1}, - {0, 1, 1}, - {1, 1, 1}, - {0.5, 0.5, 0.5} -}; - -UGL_LOCAL void SetColor(int c) - { - (rgb) ? glColor3fv(RGBMap[c]): glIndexf(c); - } - -UGL_LOCAL void InitMap(void) - { - int i; - - if (rgb) - return; - - for (i = 0; i < 9; i++) - uglMesaSetColor(i, RGBMap[i][0], RGBMap[i][1], RGBMap[i][2]); - } - -UGL_LOCAL void SetFogRamp(int density, int startIndex) - { - int fogValues, colorValues; - int i, j, k; - float intensity; - - fogValues = 1 << density; - colorValues = 1 << startIndex; - for (i = 0; i < colorValues; i++) - { - for (j = 0; j < fogValues; j++) - { - k = i * fogValues + j; - intensity = (i * fogValues + j * colorValues) / 255.0; - uglMesaSetColor(k, intensity, intensity, intensity); - } - } - } - -UGL_LOCAL void SetGreyRamp(void) - { - int i; - float intensity; - - for (i = 0; i < 255; i++) - { - intensity = i / 255.0; - uglMesaSetColor(i, intensity, intensity, intensity); - } - } -*/ - -UGL_LOCAL void FillTorus(float rc, int numc, float rt, int numt) - { - int i, j, k; - double s, t; - double x, y, z; - double pi, twopi; - - pi = 3.14159265358979323846; - twopi = 2 * pi; - - for (i = 0; i < numc; i++) - { - glBegin(GL_QUAD_STRIP); - for (j = 0; j <= numt; j++) - { - for (k = 1; k >= 0; k--) - { - s = (i + k) % numc + 0.5; - t = j % numt; - - x = cos(t*twopi/numt) * cos(s*twopi/numc); - y = sin(t*twopi/numt) * cos(s*twopi/numc); - z = sin(s*twopi/numc); - glNormal3f(x, y, z); - - x = (rt + rc * cos(s*twopi/numc)) * cos(t*twopi/numt); - y = (rt + rc * cos(s*twopi/numc)) * sin(t*twopi/numt); - z = rc * sin(s*twopi/numc); - glVertex3f(x, y, z); - } - } - glEnd(); - } - } - -UGL_LOCAL float Clamp(int iters_left, float t) - { - if (iters_left < 3) - { - return 0.0; - } - return (iters_left-2)*t/iters_left; - } - -UGL_LOCAL void drawGL(void) - { - int i, j; - - for (i = 0; i < RINGS; i++) - { - if (iters[i]) { - for (j = 0; j < 3; j++) - { - offsets[i][j] = Clamp(iters[i], offsets[i][j]); - } - angs[i] = Clamp(iters[i], angs[i]); - iters[i]--; - } - } - - glPushMatrix(); - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - gluLookAt(0,0,10, 0,0,0, 0,1,0); - - for (i = 0; i < RINGS; i++) - { - if (rgb) - { - glColor3ubv(rgb_colors[i]); - } - else - { - glIndexi(mapped_colors[i]); - } - glPushMatrix(); - glTranslatef(dests[i][0]+offsets[i][0], dests[i][1]+offsets[i][1], - dests[i][2]+offsets[i][2]); - glRotatef(angs[i], rotAxis[i][0], rotAxis[i][1], rotAxis[i][2]); - glCallList(theTorus); - glPopMatrix(); - } - - glPopMatrix(); - - glFlush(); - - uglMesaSwapBuffers(); - } - -UGL_LOCAL float MyRand(void) - { - return 10.0 * ( (float) rand() / (float) RAND_MAX - 0.5 ); - } - -UGL_LOCAL void ReInit(void) - { - int i; - float deviation; - - deviation = MyRand() / 2; - deviation = deviation * deviation; - for (i = 0; i < RINGS; i++) - { - offsets[i][0] = MyRand(); - offsets[i][1] = MyRand(); - offsets[i][2] = MyRand(); - angs[i] = 260.0 * MyRand(); - rotAxis[i][0] = MyRand(); - rotAxis[i][1] = MyRand(); - rotAxis[i][2] = MyRand(); - iters[i] = (deviation * MyRand() + 60.0); - } - } - -UGL_LOCAL void initGL(void) - { - float base, height; - float aspect, x, y; - int i; - - float top_y = 1.0; - float bottom_y = 0.0; - float top_z = 0.15; - float bottom_z = 0.69; - float spacing = 2.5; - static float lmodel_ambient[] = {0.0, 0.0, 0.0, 0.0}; - static float lmodel_twoside[] = {GL_FALSE}; - static float lmodel_local[] = {GL_FALSE}; - static float light0_ambient[] = {0.1, 0.1, 0.1, 1.0}; - static float light0_diffuse[] = {1.0, 1.0, 1.0, 0.0}; - static float light0_position[] = {0.8660254, 0.5, 1, 0}; - static float light0_specular[] = {1.0, 1.0, 1.0, 0.0}; - static float bevel_mat_ambient[] = {0.0, 0.0, 0.0, 1.0}; - static float bevel_mat_shininess[] = {40.0}; - static float bevel_mat_specular[] = {1.0, 1.0, 1.0, 0.0}; - static float bevel_mat_diffuse[] = {1.0, 0.0, 0.0, 0.0}; - - ReInit(); - - for (i = 0; i < RINGS; i++) - { - rgb_colors[i][0] = rgb_colors[i][1] = rgb_colors[i][2] = 0; - } - rgb_colors[BLUERING][2] = 255; - rgb_colors[REDRING][0] = 255; - rgb_colors[GREENRING][1] = 255; - rgb_colors[YELLOWRING][0] = 255; - rgb_colors[YELLOWRING][1] = 255; - mapped_colors[BLUERING] = COLOR_BLUE; - mapped_colors[REDRING] = COLOR_RED; - mapped_colors[GREENRING] = COLOR_GREEN; - mapped_colors[YELLOWRING] = COLOR_YELLOW; - mapped_colors[BLACKRING] = COLOR_BLACK; - - dests[BLUERING][0] = -spacing; - dests[BLUERING][1] = top_y; - dests[BLUERING][2] = top_z; - - dests[BLACKRING][0] = 0.0; - dests[BLACKRING][1] = top_y; - dests[BLACKRING][2] = top_z; - - dests[REDRING][0] = spacing; - dests[REDRING][1] = top_y; - dests[REDRING][2] = top_z; - - dests[YELLOWRING][0] = -spacing / 2.0; - dests[YELLOWRING][1] = bottom_y; - dests[YELLOWRING][2] = bottom_z; - - dests[GREENRING][0] = spacing / 2.0; - dests[GREENRING][1] = bottom_y; - dests[GREENRING][2] = bottom_z; - - base = 2.0; - height = 2.0; - theTorus = glGenLists(1); - glNewList(theTorus, GL_COMPILE); - FillTorus(0.1, 8, 1.0, 25); - glEndList(); - - x = (float)XSIZE; - y = (float)YSIZE; - aspect = x / y; - glEnable(GL_CULL_FACE); - glCullFace(GL_BACK); - glEnable(GL_DEPTH_TEST); - glClearDepth(1.0); - - if (rgb) - { - glClearColor(0.5, 0.5, 0.5, 0.0); - glLightfv(GL_LIGHT0, GL_AMBIENT, light0_ambient); - glLightfv(GL_LIGHT0, GL_DIFFUSE, light0_diffuse); - glLightfv(GL_LIGHT0, GL_SPECULAR, light0_specular); - glLightfv(GL_LIGHT0, GL_POSITION, light0_position); - glEnable(GL_LIGHT0); - - glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, lmodel_local); - glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside); - glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); - glEnable(GL_LIGHTING); - - glMaterialfv(GL_FRONT, GL_AMBIENT, bevel_mat_ambient); - glMaterialfv(GL_FRONT, GL_SHININESS, bevel_mat_shininess); - glMaterialfv(GL_FRONT, GL_SPECULAR, bevel_mat_specular); - glMaterialfv(GL_FRONT, GL_DIFFUSE, bevel_mat_diffuse); - - glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); - glEnable(GL_COLOR_MATERIAL); - glShadeModel(GL_SMOOTH); - } - else - { - glClearIndex(BACKGROUND); - glShadeModel(GL_FLAT); - } - - glMatrixMode(GL_PROJECTION); - gluPerspective(45, 1.33, 0.1, 100.0); - glMatrixMode(GL_MODELVIEW); - } - -UGL_LOCAL void echoUse(void) - { - printf("tOlympic keys:\n"); - printf(" SPACE Reinitialize\n"); - printf(" ESC Exit\n"); - } - -UGL_LOCAL void readKey (UGL_WCHAR key) - { - switch(key) - { - case UGL_UNI_SPACE: - ReInit(); - break; - case UGL_UNI_ESCAPE: - stopWex = 1; - break; - } - } - -UGL_LOCAL void loopEvent(void) - { - UGL_EVENT event; - UGL_INPUT_EVENT * pInputEvent; - - UGL_FOREVER - { - if (uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT) - != UGL_STATUS_Q_EMPTY) - { - pInputEvent = (UGL_INPUT_EVENT *)&event; - - if (pInputEvent->header.type == UGL_EVENT_TYPE_KEYBOARD && - pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) - readKey(pInputEvent->type.keyboard.key); - } - - drawGL(); - if (stopWex) - break; - } - } - -void windMLOlympic (UGL_BOOL windMLMode); - -void uglolympic (void) - { - taskSpawn("tOlympic", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLOlympic, - 0,1,2,3,4,5,6,7,8,9); - } - -void windMLOlympic(UGL_BOOL windMLMode) - { - UGL_INPUT_DEVICE_ID keyboardDevId; - - uglInitialize(); - - uglDriverFind (UGL_KEYBOARD_TYPE, 0, (UGL_UINT32 *)&keyboardDevId); - - if (uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, - (UGL_UINT32 *)&eventServiceId) == UGL_STATUS_OK) - { - qId = uglEventQCreate (eventServiceId, 100); - } - else - { - eventServiceId = UGL_NULL; - } - - if (windMLMode) - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE - | UGL_MESA_WINDML_EXCLUSIVE, NULL); - else - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); - - if (umc == NULL) - { - uglDeinitialize(); - return; - } - - uglMesaMakeCurrentContext(umc, 0, 0, UGL_MESA_FULLSCREEN_WIDTH, - UGL_MESA_FULLSCREEN_HEIGHT); - - uglMesaGetIntegerv(UGL_MESA_RGB, &rgb); - - initGL(); - - echoUse(); - - stopWex = 0; - loopEvent(); - - if (eventServiceId != UGL_NULL) - uglEventQDestroy (eventServiceId, qId); - - uglMesaDestroyContext(); - uglDeinitialize(); - - return; - } diff --git a/progs/windml/uglpoint.c b/progs/windml/uglpoint.c deleted file mode 100644 index 49c432c3a41..00000000000 --- a/progs/windml/uglpoint.c +++ /dev/null @@ -1,277 +0,0 @@ - -/* uglpoint.c - WindML/Mesa example program */ - -/* Copyright (C) 2001 by Wind River Systems, Inc */ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * The MIT License - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -/* - * Authors: - * Stephane Raimbault - */ - -/* -DESCRIPTION -Draw a single point. -*/ - -#include -#include - -#include -#include -#include - -#include - -#define DOUBLE_BUFFER GL_TRUE - -enum { - BLACK = 0, - RED, - GREEN, - BLUE, - WHITE -}; - -UGL_LOCAL GLuint rgb; -UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; -UGL_LOCAL UGL_EVENT_Q_ID qId; -UGL_LOCAL UGL_MESA_CONTEXT umc; -UGL_LOCAL GLint angleT; - -UGL_LOCAL void initGL (void) - { - /* By passed in RGB mode */ - uglMesaSetColor(BLACK, 0.0, 0.0, 0.0); - uglMesaSetColor(RED, 1.0, 0.0, 0.0); - uglMesaSetColor(GREEN, 0.0, 1.0, 0.0); - uglMesaSetColor(BLUE, 0.0, 0.0, 1.0); - uglMesaSetColor(WHITE, 1.0, 1.0, 1.0); - - glOrtho(0.0, 1.0, 0.0, 1.0, -20.0, 20.0); - - glClearColor(0.0, 0.0, 0.0, 0.0); - glClearIndex(BLACK); - } - -UGL_LOCAL void drawGL (void) - { - GLint i; - GLfloat x, y; - - /* Avoid blinking in single buffer */ - - if (DOUBLE_BUFFER) - glClear(GL_COLOR_BUFFER_BIT); - - /* Random points */ - - glBegin(GL_POINTS); - (rgb) ? glColor3f(1.0, 0.0, 0.0): glIndexi(RED); - - for (i=0; i<150; i++) - { - x = rand() / (RAND_MAX+1.0); - y = rand() / (RAND_MAX+1.0); - glVertex2f(x, y); - } - - (rgb) ? glColor3f(0.0, 1.0, 0.0): glIndexi(GREEN); - - for (i=0; i<150; i++) - { - x = (rand() / (RAND_MAX+1.0)); - y = (rand() / (RAND_MAX+1.0)); - glVertex2f(x, y); - } - - (rgb) ? glColor3f(0.0, 0.0, 1.0): glIndexi(BLUE); - glVertex2f(0.5,0.5); - - for (i=0; i<150; i++) - { - x = rand() / (RAND_MAX+1.0); - y = rand() / (RAND_MAX+1.0); - glVertex2f(x, y); - } - - glEnd(); - - /* Smooth triangle */ - - glPushMatrix(); - glTranslatef(0.5, 0.5, 0); - glRotatef(angleT, 1.0, -1.0, 0.0); - angleT = angleT++ % 360; - glBegin(GL_TRIANGLES); - (rgb) ? glColor3f(1.0, 0.0, 0.0): glIndexi(RED); - glVertex2f(0.75, 0.25); - (rgb) ? glColor3f(0.0, 1.0, 0.0): glIndexi(GREEN); - glVertex2f(0.75, 0.75); - (rgb) ? glColor3f(0.0, 0.0, 1.0): glIndexi(BLUE); - glVertex2f(0.25, 0.75); - glEnd(); - glPopMatrix(); - - /* Flush and swap */ - - glFlush(); - - uglMesaSwapBuffers(); - } - -/************************************************************************ -* -* getEvent -* -* RETURNS: true or false -* -* NOMANUAL -* -*/ - -UGL_LOCAL int getEvent(void) - { - UGL_EVENT event; - UGL_STATUS status; - int retVal = 0; - - status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); - - while (status != UGL_STATUS_Q_EMPTY) - { - UGL_INPUT_EVENT * pInputEvent = (UGL_INPUT_EVENT *)&event; - - if (pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) - retVal = 1; - - status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); - } - - return(retVal); - } - -void windMLPoint (UGL_BOOL windMLMode); - -void uglpoint (void) - { - taskSpawn ("tPoint", 210, VX_FP_TASK, 100000, - (FUNCPTR)windMLPoint, UGL_FALSE,1,2,3,4,5,6,7,8,9); - } - -void windMLPoint (UGL_BOOL windMLMode) - { - GLubyte pPixels[4]; - GLsizei width, height; - UGL_INPUT_DEVICE_ID keyboardDevId; - - angleT = 0; - - uglInitialize(); - - uglDriverFind (UGL_KEYBOARD_TYPE, 0, (UGL_UINT32 *)&keyboardDevId); - - if (uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, - (UGL_UINT32 *)&eventServiceId) == UGL_STATUS_OK) - { - qId = uglEventQCreate (eventServiceId, 100); - } - else - { - eventServiceId = UGL_NULL; - } - - if (DOUBLE_BUFFER) - { - if (windMLMode) - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE - | UGL_MESA_WINDML_EXCLUSIVE, NULL); - else - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); - } - else - { - if (windMLMode) - umc = uglMesaCreateNewContext(UGL_MESA_SINGLE - | UGL_MESA_WINDML_EXCLUSIVE, NULL); - else - umc = uglMesaCreateNewContext(UGL_MESA_SINGLE, NULL); - } - - if (umc == NULL) - { - uglDeinitialize(); - return; - } - - /* Fullscreen */ - - uglMesaMakeCurrentContext(umc, 0, 0, UGL_MESA_FULLSCREEN_WIDTH, - UGL_MESA_FULLSCREEN_HEIGHT); - - /* RGB or CI ? */ - - uglMesaGetIntegerv(UGL_MESA_RGB, &rgb); - - initGL(); - - while (!getEvent()) - drawGL(); - - uglMesaGetIntegerv(UGL_MESA_WIDTH, &width); - uglMesaGetIntegerv(UGL_MESA_HEIGHT, &height); - - printf ("glReadPixel return "); - if (rgb) - { - glReadPixels(width/2, height/2, - 1, 1, GL_RGB, - GL_UNSIGNED_BYTE, pPixels); - glFlush(); - printf ("R:%i G:%i B:%i (RGB)", pPixels[0], pPixels[1], pPixels[2]); - } - else - { - glReadPixels(width/2, height/2, - 1, 1, GL_COLOR_INDEX, - GL_UNSIGNED_BYTE, pPixels); - glFlush(); - if (pPixels[0] == BLUE) - printf ("BLUE (CI)"); - else - printf ("%i (CI))", pPixels[0]); - } - - printf(" for %ix%i\n", width/2, height/2); - - if (eventServiceId != UGL_NULL) - uglEventQDestroy (eventServiceId, qId); - - uglMesaDestroyContext(); - uglDeinitialize(); - - return; - } diff --git a/progs/windml/uglstencil.c b/progs/windml/uglstencil.c deleted file mode 100644 index 07e8fc626f3..00000000000 --- a/progs/windml/uglstencil.c +++ /dev/null @@ -1,242 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994. */ - -/* - * (c) Copyright 1993, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ -/* stencil.c - * This program draws two rotated tori in a window. - * A diamond in the center of the window masks out part - * of the scene. Within this mask, a different model - * (a sphere) is drawn in a different color. - */ - -/* - * Conversion to UGL/Mesa by Stephane Raimbault, 2001 - */ - -#include -#include - -#include -#include -#include - -#include -#include -#include - -#define YELLOWMAT 1 -#define BLUEMAT 2 - -UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; -UGL_LOCAL UGL_EVENT_Q_ID qId; -UGL_LOCAL UGL_MESA_CONTEXT umc; - -UGL_LOCAL void initGL (GLsizei w, GLsizei h) - { - GLfloat yellow_diffuse[] = { 0.7, 0.7, 0.0, 1.0 }; - GLfloat yellow_specular[] = { 1.0, 1.0, 1.0, 1.0 }; - - GLfloat blue_diffuse[] = { 0.1, 0.1, 0.7, 1.0 }; - GLfloat blue_specular[] = { 0.1, 1.0, 1.0, 1.0 }; - - GLfloat position_one[] = { 1.0, 1.0, 1.0, 0.0 }; - - glNewList(YELLOWMAT, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_DIFFUSE, yellow_diffuse); - glMaterialfv(GL_FRONT, GL_SPECULAR, yellow_specular); - glMaterialf(GL_FRONT, GL_SHININESS, 64.0); - glEndList(); - - glNewList(BLUEMAT, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_DIFFUSE, blue_diffuse); - glMaterialfv(GL_FRONT, GL_SPECULAR, blue_specular); - glMaterialf(GL_FRONT, GL_SHININESS, 45.0); - glEndList(); - - glLightfv(GL_LIGHT0, GL_POSITION, position_one); - - glEnable(GL_LIGHT0); - glEnable(GL_LIGHTING); - glDepthFunc(GL_LESS); - glEnable(GL_DEPTH_TEST); - - glClearStencil(0x0); - glEnable(GL_STENCIL_TEST); - - glClear(GL_STENCIL_BUFFER_BIT); - -/* create a diamond shaped stencil area */ - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-3.0, 3.0, -3.0, 3.0, -1.0, 1.0); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - - glStencilFunc (GL_ALWAYS, 0x1, 0x1); - glStencilOp (GL_REPLACE, GL_REPLACE, GL_REPLACE); - glBegin(GL_QUADS); - glVertex3f (-1.0, 0.0, 0.0); - glVertex3f (0.0, 1.0, 0.0); - glVertex3f (1.0, 0.0, 0.0); - glVertex3f (0.0, -1.0, 0.0); - glEnd(); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(45.0, (GLfloat) w/(GLfloat) h, 3.0, 7.0); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef(0.0, 0.0, -5.0); - } - -/* Draw a sphere in a diamond-shaped section in the - * middle of a window with 2 tori. - */ -UGL_LOCAL void drawGL(void) - { - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glStencilOp (GL_KEEP, GL_KEEP, GL_KEEP); - -/* draw blue sphere where the stencil is 1 */ - glStencilFunc (GL_EQUAL, 0x1, 0x1); - glCallList (BLUEMAT); - glutSolidSphere (0.5, 15, 15); - -/* draw the tori where the stencil is not 1 */ - glStencilFunc (GL_NOTEQUAL, 0x1, 0x1); - glPushMatrix(); - glRotatef (45.0, 0.0, 0.0, 1.0); - glRotatef (45.0, 0.0, 1.0, 0.0); - glCallList (YELLOWMAT); - glutSolidTorus (0.275, 0.85, 15, 15); - glPushMatrix(); - glRotatef (90.0, 1.0, 0.0, 0.0); - glutSolidTorus (0.275, 0.85, 15, 15); - glPopMatrix(); - glPopMatrix(); - - glFlush(); - - uglMesaSwapBuffers(); - } - -UGL_LOCAL int getEvent(void) - { - UGL_EVENT event; - UGL_STATUS status; - int retVal = 0; - - status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); - - while (status != UGL_STATUS_Q_EMPTY) - { - UGL_INPUT_EVENT * pInputEvent = (UGL_INPUT_EVENT *)&event; - - if (pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) - retVal = 1; - - status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); - } - - return(retVal); - } - -void windMLStencil (UGL_BOOL windMLMode); - -void uglstencil (void) - { - taskSpawn("tStencil", 210, VX_FP_TASK, 100000, - (FUNCPTR)windMLStencil,UGL_FALSE,1,2,3,4,5,6,7,8,9); - } - -void windMLStencil(UGL_BOOL windMLMode) - { - UGL_INPUT_DEVICE_ID keyboardDevId; - GLsizei width, height; - - uglInitialize(); - - uglDriverFind (UGL_KEYBOARD_TYPE, 0, (UGL_UINT32 *)&keyboardDevId); - - uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); - - qId = uglEventQCreate (eventServiceId, 100); - - if (windMLMode) - umc = uglMesaCreateNewContextExt(UGL_MESA_SINGLE - | UGL_MESA_WINDML_EXCLUSIVE, - 16, - 8, - 0,0,0,0, - NULL); - else - umc = uglMesaCreateNewContextExt(UGL_MESA_SINGLE, - 16, - 8, - 0,0,0,0, - NULL); - - if (umc == NULL) - { - uglDeinitialize(); - return; - } - - /* Fullscreen */ - - uglMesaMakeCurrentContext(umc, 0, 0, UGL_MESA_FULLSCREEN_WIDTH, - UGL_MESA_FULLSCREEN_HEIGHT); - - uglMesaGetIntegerv(UGL_MESA_WIDTH, &width); - uglMesaGetIntegerv(UGL_MESA_HEIGHT, &height); - - initGL(width, height); - - drawGL(); - - while (!getEvent()); - - uglEventQDestroy (eventServiceId, qId); - - uglMesaDestroyContext(); - uglDeinitialize(); - - return; - } - diff --git a/progs/windml/uglteapot.c b/progs/windml/uglteapot.c deleted file mode 100644 index 651fe0990e1..00000000000 --- a/progs/windml/uglteapot.c +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * The MIT License - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -/* - * Linux Magazine July 2001 - * Conversion to UGL/Mesa from GLUT by Stephane Raimbault, 2001 - */ - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -/* Need GLUT_SHAPES */ - -#include - -#ifndef PI -#define PI 3.14159265 -#endif - -UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; -UGL_LOCAL UGL_EVENT_Q_ID qId; -UGL_LOCAL UGL_MESA_CONTEXT umc; -UGL_LOCAL volatile UGL_BOOL stopWex; - -UGL_LOCAL GLint angle; -UGL_LOCAL GLfloat Sin[360], Cos[360]; -UGL_LOCAL GLfloat L0pos[]={0.0, 2.0, -1.0}; -UGL_LOCAL GLfloat L0dif[]={0.3, 0.3, 0.8}; -UGL_LOCAL GLfloat L1pos[]={2.0, 2.0, 2.0}; -UGL_LOCAL GLfloat L1dif[]={0.5, 0.5, 0.5}; -UGL_LOCAL GLfloat Mspec[3]; -UGL_LOCAL GLfloat Mshiny; -UGL_LOCAL GLuint theTeapot; - -UGL_LOCAL void calcTableCosSin() -{ - int i; - for(i=0;i<360;i++) { - Cos[i] = cos(((float)i)/180.0*PI); - Sin[i] = sin(((float)i)/180.0*PI); - } -} - -UGL_LOCAL void initGL(void) - { - glClearColor(0.0, 0.0, 0.0, 0.0); - glColor3f(1.0, 0.0, 0.0); - glEnable(GL_DEPTH_TEST); - - glShadeModel(GL_SMOOTH); - glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glEnable(GL_LIGHT1); - glLightfv(GL_LIGHT0, GL_DIFFUSE, L0dif); - glLightfv(GL_LIGHT0, GL_SPECULAR, L0dif); - glLightfv(GL_LIGHT1, GL_DIFFUSE, L1dif); - glLightfv(GL_LIGHT1, GL_SPECULAR, L1dif); - - glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, Mspec); - glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, Mshiny); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(45.0, 1.0, 0.1, 10.0); - glMatrixMode(GL_MODELVIEW); - - theTeapot = glGenLists(1); - glNewList(theTeapot, GL_COMPILE); - glutSolidTeapot(1.0); - glEndList(); - - } - -UGL_LOCAL void drawGL() - { - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glLoadIdentity(); - - gluLookAt(4.5*Cos[angle], 2.0,4.5*Sin[angle],0.0,0.0,0.0,0.0, - 1.0,0.0); - glLightfv(GL_LIGHT0, GL_POSITION, L0pos); - glLightfv(GL_LIGHT1, GL_POSITION, L1pos); - - glCallList(theTeapot); - - glFlush(); - - uglMesaSwapBuffers(); - } - -UGL_LOCAL void echoUse(void) - { - printf("tTeapot keys:\n"); - printf(" Left Counter clockwise rotation (y-axis)\n"); - printf(" Right Clockwise rotation (y-axis)\n"); - printf(" j Enable/disable Light0\n"); - printf(" k Enable/disable Light1\n"); - printf(" m Add specular\n"); - printf(" l Remove specular\n"); - printf(" o Add shininess\n"); - printf(" p Remove shininess\n"); - printf(" ESC Exit\n"); - } - - -UGL_LOCAL void readKey (UGL_WCHAR key) - { - switch(key) - { - case UGL_UNI_RIGHT_ARROW: - angle +=2; - if (angle>= 360) - angle-=360; - break; - case UGL_UNI_LEFT_ARROW: - angle -=2; - if (angle<0) - angle+=360; - break; - case 'j': - glIsEnabled(GL_LIGHT0) ? - glDisable(GL_LIGHT0) : glEnable(GL_LIGHT0); - break; - case 'k': - glIsEnabled(GL_LIGHT1) ? - glDisable(GL_LIGHT1) : glEnable(GL_LIGHT1); - break; - case 'm': - Mspec[0]+=0.1; - if(Mspec[0]>1) - Mspec[0]=1; - Mspec[1]+=0.1; - if(Mspec[1]>1) - Mspec[1]=1; - Mspec[2]+=0.1; - if(Mspec[2]>1) - Mspec[2]=1; - glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, Mspec); - break; - case 'l': - Mspec[0]-=0.1; - if(Mspec[0]>1) - Mspec[0]=1; - Mspec[1]-=0.1; - if(Mspec[1]>1) - Mspec[1]=1; - Mspec[2]-=0.1; - if(Mspec[2]>1) - Mspec[2]=1; - glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, Mspec); - break; - case 'o': - Mshiny -= 1; - if (Mshiny<0) - Mshiny=0; - glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, Mshiny); - break; - case 'p': - Mshiny += 1; - if (Mshiny>128) - Mshiny=128; - glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, Mshiny); - break; - case UGL_UNI_ESCAPE: - stopWex = UGL_TRUE; - break; - } - } - -UGL_LOCAL void loopEvent(void) - { - UGL_EVENT event; - UGL_INPUT_EVENT * pInputEvent; - - UGL_FOREVER - { - if (uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT) - != UGL_STATUS_Q_EMPTY) - { - pInputEvent = (UGL_INPUT_EVENT *)&event; - - if (pInputEvent->header.type == UGL_EVENT_TYPE_KEYBOARD && - pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) - readKey(pInputEvent->type.keyboard.key); - } - - drawGL(); - if (stopWex) - break; - } - } - -void windMLTeapot (UGL_BOOL windMLMode); - -void uglteapot (void) - { - taskSpawn ("tTeapot", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLTeapot, - UGL_FALSE,1,2,3,4,5,6,7,8,9); - } - -void windMLTeapot (UGL_BOOL windMLMode) - { - UGL_INPUT_DEVICE_ID keyboardDevId; - GLsizei displayWidth, displayHeight; - GLsizei x, y, w, h; - - angle = 45; - Mspec[0] = 0.5; - Mspec[1] = 0.5; - Mspec[2] = 0.5; - Mshiny = 50; - - uglInitialize (); - - uglDriverFind (UGL_KEYBOARD_TYPE, 0, - (UGL_UINT32 *)&keyboardDevId); - - uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); - - qId = uglEventQCreate (eventServiceId, 100); - - /* Double buffering */ - if (windMLMode) - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE - | UGL_MESA_WINDML_EXCLUSIVE, NULL); - else - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); - - if (umc == NULL) - { - uglDeinitialize (); - return; - } - - uglMesaMakeCurrentContext (umc, 0, 0, 1, 1); - - uglMesaGetIntegerv(UGL_MESA_DISPLAY_WIDTH, &displayWidth); - uglMesaGetIntegerv(UGL_MESA_DISPLAY_HEIGHT, &displayHeight); - - h = (displayHeight*2)/3; - w = h; - x = (displayWidth-w)/2; - y = (displayHeight-h)/2; - - uglMesaMoveToWindow(x, y); - uglMesaResizeToWindow(w, h); - - calcTableCosSin(); - - initGL (); - - echoUse(); - - stopWex = UGL_FALSE; - loopEvent(); - - uglEventQDestroy (eventServiceId, qId); - - uglMesaDestroyContext(); - uglDeinitialize (); - - return; - } diff --git a/progs/windml/ugltexcube.c b/progs/windml/ugltexcube.c deleted file mode 100644 index 62b0306e647..00000000000 --- a/progs/windml/ugltexcube.c +++ /dev/null @@ -1,379 +0,0 @@ - -/* ugltexcube.c - WindML/Mesa example program */ - -/* Copyright (C) 2001 by Wind River Systems, Inc */ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * The MIT License - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -/* - * Authors: - * Stephane Raimbault - */ - -/* -DESCRIPTION -Draw a textured cube -*/ - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "../util/readtex.h" - -#define IMAGE_FILE "Mesa/images/wrs_logo.rgb" - -UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; -UGL_LOCAL UGL_EVENT_Q_ID qId; -UGL_LOCAL UGL_MESA_CONTEXT umc; - -UGL_LOCAL GLfloat xrot, yrot, zrot; -UGL_LOCAL GLuint texture[1]; -UGL_LOCAL GLuint theTexCube; - -typedef struct { - GLubyte *data; - int width, height; - GLenum format; - } TEX_IMAGE; - -UGL_LOCAL void cleanUp (void); - -UGL_LOCAL void loadGLTexture() - { - TEX_IMAGE * texImage=NULL; - - texImage = (TEX_IMAGE *) malloc(sizeof(TEX_IMAGE)); - - if (texImage == NULL) - { - printf("Error allocating space for image"); - cleanUp(); - exit(1); - } - - texImage->data = LoadRGBImage(IMAGE_FILE, &texImage->width, - &texImage->height, &texImage->format); - if (!texImage->data) - { - printf("Couldn't read %s\n", IMAGE_FILE); - free(texImage); - cleanUp(); - exit(1); - } - - /* Create Texture */ - glGenTextures(1, &texture[0]); - glBindTexture(GL_TEXTURE_2D, texture[0]); - glTexImage2D(GL_TEXTURE_2D, 0, 3, - texImage->width, texImage->height, - 0, GL_RGB, GL_UNSIGNED_BYTE, texImage->data); - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - - free(texImage->data); - free(texImage); - } - -UGL_LOCAL void initGL(int width, int height) - { - - /* Load the texture(s) */ - loadGLTexture(); - - /* Enable texture mapping */ - glEnable(GL_TEXTURE_2D); - - /* Clear the background color to black */ - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - - glEnable(GL_CULL_FACE); - - /* Enables smooth color shading */ - glShadeModel(GL_SMOOTH); - -/* glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); */ -/* glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); */ - - theTexCube = glGenLists(1); - glNewList(theTexCube, GL_COMPILE); - - /* Choose the texture to use */ - glBindTexture(GL_TEXTURE_2D, texture[0]); - - /* Begin drawing a cube */ - glBegin(GL_QUADS); - - /* Front face (note that the texture's corners have to match the - quad's corners) */ - - /* Bottom left of the texture and quad */ - glTexCoord2f(0.0f, 0.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - /* Bottom Right Of The Texture and Quad */ - glTexCoord2f(1.0f, 0.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - - /* Top Right Of The Texture and Quad */ - glTexCoord2f(1.0f, 1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - /* Top Left Of The Texture and Quad */ - glTexCoord2f(0.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - - /* Back Face */ - - /* Bottom Right Of The Texture and Quad */ - glTexCoord2f(1.0f, 0.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - - /* Top Right Of The Texture and Quad */ - glTexCoord2f(1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - - /* Top Left Of The Texture and Quad */ - glTexCoord2f(0.0f, 1.0f); - glVertex3f(1.0f, 1.0f, -1.0f); - - /* Bottom Left Of The Texture and Quad */ - glTexCoord2f(0.0f, 0.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - - - /* Top Face */ - - /* Top Left Of The Texture and Quad */ - glTexCoord2f(0.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - - /* Bottom Left Of The Texture and Quad */ - glTexCoord2f(0.0f, 0.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - - /* Bottom Right Of The Texture and Quad */ - glTexCoord2f(1.0f, 0.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - - /* Top Right Of The Texture and Quad */ - glTexCoord2f(1.0f, 1.0f); - glVertex3f(1.0f, 1.0f, -1.0f); - - /* Bottom Face */ - - /* Top Right Of The Texture and Quad */ - glTexCoord2f(1.0f, 1.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - - /* Top Left Of The Texture and Quad */ - glTexCoord2f(0.0f, 1.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - - /* Bottom Left Of The Texture and Quad */ - glTexCoord2f(0.0f, 0.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - - /* Bottom Right Of The Texture and Quad */ - glTexCoord2f(1.0f, 0.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - - /* Right face */ - /* Bottom Right Of The Texture and Quad */ - glTexCoord2f(1.0f, 0.0f); - glVertex3f(1.0f, -1.0f, -1.0f); - - /* Top Right Of The Texture and Quad */ - glTexCoord2f(1.0f, 1.0f); - glVertex3f(1.0f, 1.0f, -1.0f); - - /* Top Left Of The Texture and Quad */ - glTexCoord2f(0.0f, 1.0f); - glVertex3f(1.0f, 1.0f, 1.0f); - - /* Bottom Left Of The Texture and Quad */ - glTexCoord2f(0.0f, 0.0f); - glVertex3f(1.0f, -1.0f, 1.0f); - - - /* Left Face */ - /* Bottom Left Of The Texture and Quad */ - glTexCoord2f(0.0f, 0.0f); - glVertex3f(-1.0f, -1.0f, -1.0f); - - /* Bottom Right Of The Texture and Quad */ - glTexCoord2f(1.0f, 0.0f); - glVertex3f(-1.0f, -1.0f, 1.0f); - - /* Top Right Of The Texture and Quad */ - glTexCoord2f(1.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, 1.0f); - - /* Top Left Of The Texture and Quad */ - glTexCoord2f(0.0f, 1.0f); - glVertex3f(-1.0f, 1.0f, -1.0f); - - glEnd(); /* done with the polygon */ - glEndList(); - - glDisable(GL_DITHER); - glMatrixMode(GL_PROJECTION); - /* Reset the projection matrix */ - glLoadIdentity(); - /* Calculate the aspect ratio of the window */ - gluPerspective(45.0f, (GLfloat) width / (GLfloat) height, 0.1f, 100.0f); - - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - } - -UGL_LOCAL void drawGL() - { - glClear(GL_COLOR_BUFFER_BIT); - - /* Reset The View */ - glPushMatrix(); - - /* Move 8 units into the screen */ - glTranslatef(0.0f, 0.0f, -8.0f); - - /* Rotate on the X axis */ - glRotatef(xrot, 1.0f, 0.0f, 0.0f); - - /* Rotate on the Y axis */ - glRotatef(yrot, 0.0f, 1.0f, 0.0f); - - /* Rotate On The Z Axis */ - glRotatef(zrot, 0.0f, 0.0f, 1.0f); - - glCallList(theTexCube); - - glFlush(); - - uglMesaSwapBuffers(); - - glPopMatrix(); - - xrot += 1.6f; - yrot += 1.6f; - zrot += 1.6f; -} - -UGL_LOCAL int getEvent(void) - { - UGL_EVENT event; - UGL_STATUS status; - int retVal = 0; - - status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); - - while (status != UGL_STATUS_Q_EMPTY) - { - UGL_INPUT_EVENT * pInputEvent = (UGL_INPUT_EVENT *)&event; - - if (pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) - retVal = 1; - - status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); - } - - return(retVal); - } - -UGL_LOCAL void cleanUp (void) - { - if (eventServiceId != UGL_NULL) - uglEventQDestroy (eventServiceId, qId); - - uglMesaDestroyContext(); - uglDeinitialize(); - } - -void windMLTexCube (UGL_BOOL windMLMode); - -void ugltexcube (void) - { - taskSpawn("tTexCube", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLTexCube, - UGL_FALSE,1,2,3,4,5,6,7,8,9); - } - - -void windMLTexCube(UGL_BOOL windMLMode) - { - GLuint width, height; - UGL_INPUT_DEVICE_ID keyboardDevId; - - uglInitialize(); - - uglDriverFind (UGL_KEYBOARD_TYPE, 0, (UGL_UINT32 *)&keyboardDevId); - - if (uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, - (UGL_UINT32 *)&eventServiceId) == UGL_STATUS_OK) - { - qId = uglEventQCreate (eventServiceId, 100); - } - else - { - eventServiceId = UGL_NULL; - } - - if (windMLMode) - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE - | UGL_MESA_WINDML_EXCLUSIVE, NULL); - else - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); - - if (umc == NULL) - { - uglDeinitialize(); - return; - } - - uglMesaMakeCurrentContext(umc, 0, 0, - UGL_MESA_FULLSCREEN_WIDTH, - UGL_MESA_FULLSCREEN_HEIGHT); - - - uglMesaGetIntegerv(UGL_MESA_WIDTH, &width); - uglMesaGetIntegerv(UGL_MESA_HEIGHT, &height); - - initGL(width, height); - - while(!getEvent()) - drawGL(); - - cleanUp(); - - return; - } - - diff --git a/progs/windml/ugltexcyl.c b/progs/windml/ugltexcyl.c deleted file mode 100644 index db66d1ff67b..00000000000 --- a/progs/windml/ugltexcyl.c +++ /dev/null @@ -1,406 +0,0 @@ -/* - * Textured cylinder demo: lighting, texturing, reflection mapping. - * - * Brian Paul May 1997 This program is in the public domain. - * - * Conversion to UGL/Mesa by Stephane Raimbault - */ - -/* - * Revision 1.2 2001/09/10 19:21:13 brianp - * WindML updates (Stephane Raimbault) - * - * Revision 1.1 2001/08/20 16:07:11 brianp - * WindML driver (Stephane Raimbault) - * - * Revision 1.5 2001/03/27 17:35:26 brianp - * set initial window pos - * - * Revision 1.4 2000/12/24 22:53:54 pesco - * * demos/Makefile.am (INCLUDES): Added -I$(top_srcdir)/util. - * * demos/Makefile.X11, demos/Makefile.BeOS-R4, demos/Makefile.cygnus: - * Essentially the same. - * Program files updated to include "readtex.c", not "../util/readtex.c". - * * demos/reflect.c: Likewise for "showbuffer.c". - * - * - * * Makefile.am (EXTRA_DIST): Added top-level regular files. - * - * * include/GL/Makefile.am (INC_X11): Added glxext.h. - * - * - * * src/GGI/include/ggi/mesa/Makefile.am (EXTRA_HEADERS): Include - * Mesa GGI headers in dist even if HAVE_GGI is not given. - * - * * configure.in: Look for GLUT and demo source dirs in $srcdir. - * - * * src/swrast/Makefile.am (libMesaSwrast_la_SOURCES): Set to *.[ch]. - * More source list updates in various Makefile.am's. - * - * * Makefile.am (dist-hook): Remove CVS directory from distribution. - * (DIST_SUBDIRS): List all possible subdirs here. - * (SUBDIRS): Only list subdirs selected for build again. - * The above two applied to all subdir Makefile.am's also. - * - * Revision 1.3 2000/09/29 23:09:39 brianp - * added fps output - * - * Revision 1.2 1999/10/21 16:39:06 brianp - * added -info command line option - * - * Revision 1.1.1.1 1999/08/19 00:55:40 jtg - * Imported sources - * - * Revision 3.3 1999/03/28 18:24:37 brianp - * minor clean-up - * - * Revision 3.2 1998/11/05 04:34:04 brianp - * moved image files to ../images/ directory - * - * Revision 3.1 1998/06/23 03:16:51 brianp - * added Point/Linear sampling menu items - * - * Revision 3.0 1998/02/14 18:42:29 brianp - * initial rev - * - */ - - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "../util/readtex.h" - -#define TEXTURE_FILE "Mesa/images/reflect.rgb" - -#define LIT 1 -#define TEXTURED 2 -#define REFLECT 3 -#define ANIMATE 10 -#define POINT_FILTER 20 -#define LINEAR_FILTER 21 -#define QUIT 100 -#define COUNT_FRAMES - -UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; -UGL_LOCAL UGL_EVENT_Q_ID qId; -UGL_LOCAL volatile UGL_BOOL stopWex; -UGL_LOCAL UGL_MESA_CONTEXT umc; - -UGL_LOCAL GLuint CylinderObj; -UGL_LOCAL GLboolean Animate; -UGL_LOCAL GLboolean linearFilter; - -UGL_LOCAL GLfloat Xrot, Yrot, Zrot; -UGL_LOCAL GLfloat DXrot, DYrot; - -UGL_LOCAL GLuint limit; -UGL_LOCAL GLuint count; -UGL_LOCAL GLuint tickStart, tickStop, tickBySec; - -UGL_LOCAL void cleanUp (void); - -UGL_LOCAL void drawGL(void) - { -#ifdef COUNT_FRAMES - int time; -#endif - - glClear( GL_COLOR_BUFFER_BIT ); - - glPushMatrix(); - glRotatef(Xrot, 1.0, 0.0, 0.0); - glRotatef(Yrot, 0.0, 1.0, 0.0); - glRotatef(Zrot, 0.0, 0.0, 1.0); - glScalef(5.0, 5.0, 5.0); - glCallList(CylinderObj); - - glPopMatrix(); - - uglMesaSwapBuffers(); - - if (Animate) - { - Xrot += DXrot; - Yrot += DYrot; - } - -#ifdef COUNT_FRAMES - if (count > limit) - { - tickStop = tickGet (); - time = (tickStop-tickStart)/tickBySec; - printf (" %i fps\n", count/time); - tickStart = tickStop; - count = 0; - } - else - count++; -#endif - - } - -UGL_LOCAL void echoUse(void) - { - printf("Keys:\n"); - printf(" Up/Down Rotate on Y\n"); - printf(" Left/Right Rotate on X\n"); - printf(" a Toggle animation\n"); - printf(" f Toggle point/linear filtered\n"); - printf(" l Lit\n"); - printf(" t Textured\n"); - printf(" r Reflect\n"); - printf(" ESC Exit\n"); - } - -UGL_LOCAL void readKey(UGL_WCHAR key) - { - float step = 3.0; - switch (key) - { - case 'a': - Animate = !Animate; - break; - case 'f': - if(linearFilter) - { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, - GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, - GL_NEAREST); - } - else - { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, - GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, - GL_LINEAR); - } - linearFilter = !linearFilter; - break; - case 'l': - glEnable(GL_LIGHTING); - glDisable(GL_TEXTURE_2D); - glDisable(GL_TEXTURE_GEN_S); - glDisable(GL_TEXTURE_GEN_T); - break; - case 't': - glDisable(GL_LIGHTING); - glEnable(GL_TEXTURE_2D); - glDisable(GL_TEXTURE_GEN_S); - glDisable(GL_TEXTURE_GEN_T); - break; - case 'r': - glDisable(GL_LIGHTING); - glEnable(GL_TEXTURE_2D); - glEnable(GL_TEXTURE_GEN_S); - glEnable(GL_TEXTURE_GEN_T); - break; - case UGL_UNI_UP_ARROW: - Xrot += step; - break; - case UGL_UNI_DOWN_ARROW: - Xrot -= step; - break; - case UGL_UNI_LEFT_ARROW: - Yrot += step; - break; - case UGL_UNI_RIGHT_ARROW: - Yrot -= step; - break; - case UGL_UNI_ESCAPE: - stopWex = UGL_TRUE; - break; - } - } - -UGL_LOCAL void loopEvent(void) - { - UGL_EVENT event; - UGL_INPUT_EVENT * pInputEvent; - - UGL_FOREVER - { - if (uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT) - != UGL_STATUS_Q_EMPTY) - { - pInputEvent = (UGL_INPUT_EVENT *)&event; - - if (pInputEvent->header.type == UGL_EVENT_TYPE_KEYBOARD && - pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) - readKey(pInputEvent->type.keyboard.key); - } - - drawGL(); - if (stopWex) - break; - } - } - -UGL_LOCAL void initGL(void) - { - GLUquadricObj *q = gluNewQuadric(); - CylinderObj = glGenLists(1); - glNewList(CylinderObj, GL_COMPILE); - - glTranslatef(0.0, 0.0, -1.0); - - /* cylinder */ - gluQuadricNormals(q, GL_SMOOTH); - gluQuadricTexture(q, GL_TRUE); - gluCylinder(q, 0.6, 0.6, 2.0, 24, 1); - - /* end cap */ - glTranslatef(0.0, 0.0, 2.0); - gluDisk(q, 0.0, 0.6, 24, 1); - - /* other end cap */ - glTranslatef(0.0, 0.0, -2.0); - gluQuadricOrientation(q, GLU_INSIDE); - gluDisk(q, 0.0, 0.6, 24, 1); - - glEndList(); - gluDeleteQuadric(q); - - /* lighting */ - glEnable(GL_LIGHTING); - { - GLfloat gray[4] = {0.2, 0.2, 0.2, 1.0}; - GLfloat white[4] = {1.0, 1.0, 1.0, 1.0}; - GLfloat teal[4] = { 0.0, 1.0, 0.8, 1.0 }; - glMaterialfv(GL_FRONT, GL_DIFFUSE, teal); - glLightfv(GL_LIGHT0, GL_AMBIENT, gray); - glLightfv(GL_LIGHT0, GL_DIFFUSE, white); - glEnable(GL_LIGHT0); - } - - /* fitering = nearest, initially */ - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); - glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); - - glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); - glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); - - if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) - { - printf("Error: couldn't load texture image\n"); - cleanUp(); - exit(1); - } - - glEnable(GL_CULL_FACE); /* don't need Z testing for convex objects */ - - glEnable(GL_LIGHTING); - - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -1.0, 1.0, -1.0, 1.0, 10.0, 100.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -70.0 ); - - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS)); - -#ifdef COUNT_FRAMES - tickStart = tickGet (); - tickBySec = sysClkRateGet (); -#endif - - } - -UGL_LOCAL void cleanUp (void) - { - uglEventQDestroy (eventServiceId, qId); - - uglMesaDestroyContext(); - uglDeinitialize (); - } - -void windMLTexCyl (UGL_BOOL windMLMode); - -void ugltexcyl (void) - { - taskSpawn ("tTexCyl", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLTexCyl, - UGL_FALSE,1,2,3,4,5,6,7,8,9); - } - -void windMLTexCyl (UGL_BOOL windMLMode) - { - UGL_INPUT_DEVICE_ID keyboardDevId; - GLsizei displayWidth, displayHeight; - GLsizei x, y, w, h; - - CylinderObj = 0; - Animate = GL_TRUE; - linearFilter = GL_FALSE; - Xrot = 0.0; - Yrot = 0.0; - Zrot = 0.0; - DXrot = 1.0; - DYrot = 2.5; - limit = 100; - count = 1; - - uglInitialize (); - - uglDriverFind (UGL_KEYBOARD_TYPE, 0, - (UGL_UINT32 *)&keyboardDevId); - - uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); - - qId = uglEventQCreate (eventServiceId, 100); - - /* Double buffering */ - if (windMLMode) - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE - | UGL_MESA_WINDML_EXCLUSIVE, NULL); - else - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); - - if (umc == NULL) - { - uglDeinitialize (); - return; - } - - uglMesaMakeCurrentContext (umc, 0, 0, 1, 1); - - uglMesaGetIntegerv(UGL_MESA_DISPLAY_WIDTH, &displayWidth); - uglMesaGetIntegerv(UGL_MESA_DISPLAY_HEIGHT, &displayHeight); - - h = (displayHeight*3)/4; - w = h; - x = (displayWidth-w)/2; - y = (displayHeight-h)/2; - - uglMesaMoveToWindow(x, y); - uglMesaResizeToWindow(w, h); - - initGL (); - - echoUse(); - - stopWex = UGL_FALSE; - loopEvent(); - - cleanUp(); - - return; - } - diff --git a/progs/windml/wrs_logo.bmp b/progs/windml/wrs_logo.bmp deleted file mode 100644 index 9a9f04255bec7e0bfd057727910103031fcc92ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 196662 zcmeI531C&l)yD~-;=WYet)RHHT3c(Yb!lx~T5VlwtE~%KtJZ3@F8$QHRY=0Bpdt#m z018qtv$grwAwlihv@Z2q*%IfFhs> zC<2OrBA^H;0*Zhlpa>`eihv@Z2q*%IfFhs>C<2OrBA^H;0*Zhlpa>`eihv@Z2q*%I zfFhs>C<2OrBA^H;0*Zhlpa>`eihv@Z2q*%IfFhs>C<2OrBA^H;0*Zhlpa>`eihv@Z z2q*%IfFhs>C<2OrBA^H;0*Zhlpa>`eihv@Z2q*%IfFhs>C<2OrBA^H;0*Zhlpa>`e zihv@Z2q*%IfFhs>C<2OrBA^H;0*Zhlpa>`eihv@Z2q*%IfFhs>C<2OrBA^H;0*Zhl zpa>`eihv@Z2q*%IfFhs>C<2OrBA^H;0*Zhlpa>`eihv@Z2q*%IfFhs>C<2OrBA^H; z0*Zhlpa>`eihv@Z2q*%IfFhs>C<2OrBA^H;0*Zhl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