1 | /* Copyright (c) 2001, Stanford University
|
---|
2 | * All rights reserved
|
---|
3 | *
|
---|
4 | * See the file LICENSE.txt for information on redistributing this software.
|
---|
5 | */
|
---|
6 |
|
---|
7 | #include <stdio.h>
|
---|
8 | #include "state.h"
|
---|
9 | #include "state/cr_statetypes.h"
|
---|
10 | #include "state_internals.h"
|
---|
11 |
|
---|
12 | void crStateMultisampleInit (CRContext *ctx)
|
---|
13 | {
|
---|
14 | CRMultisampleState *m = &ctx->multisample;
|
---|
15 | CRStateBits *sb = GetCurrentBits();
|
---|
16 | CRMultisampleBits *mb = &(sb->multisample);
|
---|
17 |
|
---|
18 | m->enabled = GL_FALSE; /* TRUE if the visual supports it */
|
---|
19 | m->sampleAlphaToCoverage = GL_FALSE;
|
---|
20 | m->sampleAlphaToOne = GL_FALSE;
|
---|
21 | m->sampleCoverage = GL_FALSE;
|
---|
22 | RESET(mb->enable, ctx->bitid);
|
---|
23 |
|
---|
24 | m->sampleCoverageValue = 1.0F;
|
---|
25 | m->sampleCoverageInvert = GL_FALSE;
|
---|
26 | RESET(mb->sampleCoverageValue, ctx->bitid);
|
---|
27 |
|
---|
28 | RESET(mb->dirty, ctx->bitid);
|
---|
29 | }
|
---|
30 |
|
---|
31 | void STATE_APIENTRY crStateSampleCoverageARB(GLclampf value, GLboolean invert)
|
---|
32 | {
|
---|
33 | CRContext *g = GetCurrentContext();
|
---|
34 | CRMultisampleState *m = &(g->multisample);
|
---|
35 | CRStateBits *sb = GetCurrentBits();
|
---|
36 | CRMultisampleBits *mb = &(sb->multisample);
|
---|
37 |
|
---|
38 | if (g->current.inBeginEnd)
|
---|
39 | {
|
---|
40 | crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION, "glStateSampleCoverageARB called in begin/end");
|
---|
41 | return;
|
---|
42 | }
|
---|
43 |
|
---|
44 | FLUSH();
|
---|
45 |
|
---|
46 | m->sampleCoverageValue = value;
|
---|
47 | m->sampleCoverageInvert = invert;
|
---|
48 | DIRTY(mb->dirty, g->neg_bitid);
|
---|
49 | DIRTY(mb->sampleCoverageValue, g->neg_bitid);
|
---|
50 | }
|
---|
51 |
|
---|