/* Copyright (c) 2001, Stanford University
* All rights reserved
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#include "cr_mem.h"
#include "state.h"
#include "state/cr_statetypes.h"
#include "state_internals.h"
#include "cr_pixeldata.h"
{
int i;
p->polygonSmooth = GL_FALSE;
p->polygonOffsetFill = GL_FALSE;
p->polygonOffsetLine = GL_FALSE;
p->polygonOffsetPoint = GL_FALSE;
p->polygonStipple = GL_FALSE;
p->offsetFactor = 0;
p->offsetUnits = 0;
p->cullFaceMode = GL_BACK;
for (i=0; i<32; i++)
p->stipple[i] = 0xFFFFFFFF;
}
{
CRContext *g = GetCurrentContext();
CRPolygonState *p = &(g->polygon);
if (g->current.inBeginEnd)
{
return;
}
FLUSH();
{
"glCullFace called with bogus mode: 0x%x", mode);
return;
}
p->cullFaceMode = mode;
}
{
CRContext *g = GetCurrentContext();
CRPolygonState *p = &(g->polygon);
if (g->current.inBeginEnd)
{
return;
}
FLUSH();
{
"glFrontFace called with bogus mode: 0x%x", mode);
return;
}
}
{
CRContext *g = GetCurrentContext();
CRPolygonState *p = &(g->polygon);
if (g->current.inBeginEnd)
{
return;
}
FLUSH();
{
"glPolygonMode called with bogus mode: 0x%x", mode);
return;
}
switch (face) {
case GL_FRONT:
break;
case GL_FRONT_AND_BACK:
case GL_BACK:
break;
default:
"glPolygonMode called with bogus face: 0x%x", face);
return;
}
}
{
CRContext *g = GetCurrentContext();
CRPolygonState *p = &(g->polygon);
if (g->current.inBeginEnd)
{
return;
}
FLUSH();
p->offsetFactor = factor;
p->offsetUnits = units;
}
{
CRContext *g = GetCurrentContext();
if (g->current.inBeginEnd)
{
return;
}
FLUSH();
if (!p && !crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB))
{
crDebug("Void pointer passed to PolygonStipple");
return;
}
/*@todo track mask if buffer is bound?*/
{
}
}
{
CRContext *g = GetCurrentContext();
if (g->current.inBeginEnd)
{
return;
}
}