mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 04:22:05 +00:00
b86e330957
This copies the files for the GLU tesselator from Mesa. The Mesa code is based on the original SGI code and is released under a BSD license. The memalloc.h header has been replaced with one that forces the code to use g_malloc and friends. The rest of the files are not altered from the original so it should be possible to later upgrade the files by simply overwriting them. There is a tesselator.h header which is expected to be included by rest of Cogl to use the tesselator. This contains a trimmed down version of glu.h that only includes parts that pertain to the tesselator. There is also a stub glu.h in the GL directory which is just provided so that the tesselator code can include <GL/gl.h> without depending on the system header. It just redirects to tesselator.h
122 lines
5.3 KiB
C
122 lines
5.3 KiB
C
/*
|
|
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
|
|
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
|
|
* Copyright (C) 2010 Intel Corporation
|
|
*
|
|
* 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 including the dates of first publication and
|
|
* either this permission notice or a reference to
|
|
* http://oss.sgi.com/projects/FreeB/
|
|
* 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
|
|
* SILICON GRAPHICS, INC. 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.
|
|
*
|
|
* Except as contained in this notice, the name of Silicon Graphics, Inc.
|
|
* shall not be used in advertising or otherwise to promote the sale, use or
|
|
* other dealings in this Software without prior written authorization from
|
|
* Silicon Graphics, Inc.
|
|
*/
|
|
|
|
#ifndef __TESSELATOR_H__
|
|
#define __TESSELATOR_H__
|
|
|
|
/* This just includes the defines needed by the tesselator code */
|
|
|
|
#include "cogl/cogl-defines.h"
|
|
|
|
typedef struct GLUtesselator GLUtesselator;
|
|
|
|
#define GLU_TESS_MAX_COORD 1.0e150
|
|
|
|
GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess);
|
|
GLAPI void GLAPIENTRY gluDeleteTess (GLUtesselator* tess);
|
|
GLAPI void GLAPIENTRY gluEndPolygon (GLUtesselator* tess);
|
|
|
|
typedef void (GLAPIENTRYP _GLUfuncptr)();
|
|
|
|
GLAPI void GLAPIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data);
|
|
|
|
GLAPI GLUtesselator* GLAPIENTRY gluNewTess (void);
|
|
GLAPI void GLAPIENTRY gluNextContour (GLUtesselator* tess, GLenum type);
|
|
|
|
GLAPI void GLAPIENTRY gluTessBeginContour (GLUtesselator* tess);
|
|
GLAPI void GLAPIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);
|
|
GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
|
|
GLAPI void GLAPIENTRY gluTessEndContour (GLUtesselator* tess);
|
|
GLAPI void GLAPIENTRY gluTessEndPolygon (GLUtesselator* tess);
|
|
GLAPI void GLAPIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
|
|
GLAPI void GLAPIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data);
|
|
GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);
|
|
|
|
/* ErrorCode */
|
|
#define GLU_INVALID_ENUM 100900
|
|
#define GLU_INVALID_VALUE 100901
|
|
#define GLU_OUT_OF_MEMORY 100902
|
|
|
|
/* TessCallback */
|
|
#define GLU_TESS_BEGIN 100100
|
|
#define GLU_BEGIN 100100
|
|
#define GLU_TESS_VERTEX 100101
|
|
#define GLU_VERTEX 100101
|
|
#define GLU_TESS_END 100102
|
|
#define GLU_END 100102
|
|
#define GLU_TESS_ERROR 100103
|
|
#define GLU_TESS_EDGE_FLAG 100104
|
|
#define GLU_EDGE_FLAG 100104
|
|
#define GLU_TESS_COMBINE 100105
|
|
#define GLU_TESS_BEGIN_DATA 100106
|
|
#define GLU_TESS_VERTEX_DATA 100107
|
|
#define GLU_TESS_END_DATA 100108
|
|
#define GLU_TESS_ERROR_DATA 100109
|
|
#define GLU_TESS_EDGE_FLAG_DATA 100110
|
|
#define GLU_TESS_COMBINE_DATA 100111
|
|
|
|
/* TessContour */
|
|
#define GLU_CW 100120
|
|
#define GLU_CCW 100121
|
|
#define GLU_INTERIOR 100122
|
|
#define GLU_EXTERIOR 100123
|
|
#define GLU_UNKNOWN 100124
|
|
|
|
/* TessProperty */
|
|
#define GLU_TESS_WINDING_RULE 100140
|
|
#define GLU_TESS_BOUNDARY_ONLY 100141
|
|
#define GLU_TESS_TOLERANCE 100142
|
|
|
|
/* TessError */
|
|
#define GLU_TESS_ERROR1 100151
|
|
#define GLU_TESS_ERROR2 100152
|
|
#define GLU_TESS_ERROR3 100153
|
|
#define GLU_TESS_ERROR4 100154
|
|
#define GLU_TESS_ERROR5 100155
|
|
#define GLU_TESS_ERROR6 100156
|
|
#define GLU_TESS_ERROR7 100157
|
|
#define GLU_TESS_ERROR8 100158
|
|
#define GLU_TESS_MISSING_BEGIN_POLYGON 100151
|
|
#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152
|
|
#define GLU_TESS_MISSING_END_POLYGON 100153
|
|
#define GLU_TESS_MISSING_END_CONTOUR 100154
|
|
#define GLU_TESS_COORD_TOO_LARGE 100155
|
|
#define GLU_TESS_NEED_COMBINE_CALLBACK 100156
|
|
|
|
/* TessWinding */
|
|
#define GLU_TESS_WINDING_ODD 100130
|
|
#define GLU_TESS_WINDING_NONZERO 100131
|
|
#define GLU_TESS_WINDING_POSITIVE 100132
|
|
#define GLU_TESS_WINDING_NEGATIVE 100133
|
|
#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
|
|
|
|
#endif /* __TESSELATOR_H__ */
|