mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
5f2bebf7a5
With this commit, we now use a forked version of MESA which only supports OpenGL 1.1, like the windows implementation does. It exposes : - The same pixel formats - The same set of extensions - Nothing more All of this without taking 10% of your build time. If you need a more modern option, look at the MESA package from Rapps, which is (and must be) maintained outside of this code tree. CORE-7499
101 lines
2.4 KiB
C
101 lines
2.4 KiB
C
/* $Id: quads.c,v 1.5 1997/08/19 02:44:18 brianp Exp $ */
|
|
|
|
/*
|
|
* Mesa 3-D graphics library
|
|
* Version: 2.4
|
|
* Copyright (C) 1995-1997 Brian Paul
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Library General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Library General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Library General Public
|
|
* License along with this library; if not, write to the Free
|
|
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
*/
|
|
|
|
|
|
/*
|
|
* $Log: quads.c,v $
|
|
* Revision 1.5 1997/08/19 02:44:18 brianp
|
|
* added null_quad() and re-implemented gl_set_quad_function()
|
|
*
|
|
* Revision 1.4 1997/07/24 01:23:44 brianp
|
|
* changed precompiled header symbol from PCH to PC_HEADER
|
|
*
|
|
* Revision 1.3 1997/05/28 03:26:18 brianp
|
|
* added precompiled header (PCH) support
|
|
*
|
|
* Revision 1.2 1997/04/20 19:45:46 brianp
|
|
* added a comment
|
|
*
|
|
* Revision 1.1 1997/04/12 12:24:07 brianp
|
|
* Initial revision
|
|
*
|
|
*/
|
|
|
|
|
|
/*
|
|
* Quadrilateral rendering functions.
|
|
*/
|
|
|
|
|
|
#ifdef PC_HEADER
|
|
#include "all.h"
|
|
#else
|
|
#include "types.h"
|
|
#include "quads.h"
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
* At this time there is no quadrilateral optimization. Just call the
|
|
* triangle function twice.
|
|
* v0, v1, v2, v3 in CCW order = front facing.
|
|
*/
|
|
static void quad( GLcontext *ctx,
|
|
GLuint v0, GLuint v1, GLuint v2, GLuint v3, GLuint pv )
|
|
{
|
|
(*ctx->Driver.TriangleFunc)( ctx, v0, v1, v3, pv );
|
|
(*ctx->Driver.TriangleFunc)( ctx, v1, v2, v3, pv );
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
* Draw nothing (NULL raster mode)
|
|
*/
|
|
static void null_quad( GLcontext *ctx,
|
|
GLuint v0, GLuint v1, GLuint v2, GLuint v3, GLuint pv )
|
|
{
|
|
}
|
|
|
|
|
|
|
|
void gl_set_quad_function( GLcontext *ctx )
|
|
{
|
|
if (ctx->RenderMode==GL_RENDER) {
|
|
if (ctx->NoRaster) {
|
|
ctx->Driver.QuadFunc = null_quad;
|
|
}
|
|
else if (ctx->Driver.QuadFunc) {
|
|
/* Device driver will draw quads. */
|
|
}
|
|
else {
|
|
ctx->Driver.QuadFunc = quad;
|
|
}
|
|
}
|
|
else {
|
|
/* if in feedback or selection mode we can fall back to triangle code */
|
|
ctx->Driver.QuadFunc = quad;
|
|
}
|
|
}
|
|
|
|
|