demos: Set the depth mask correctly to get the desired blending
This commit is contained in:
@@ -194,11 +194,11 @@ redraw(void)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
glDepthMask(GL_TRUE);
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
if (newModel)
|
if (newModel)
|
||||||
recalcModelView();
|
recalcModelView();
|
||||||
|
|
||||||
glDepthMask(GL_FALSE);
|
|
||||||
|
|
||||||
/* Draw the floor. */
|
/* Draw the floor. */
|
||||||
/* glEnable(GL_TEXTURE_2D);*/
|
/* glEnable(GL_TEXTURE_2D);*/
|
||||||
@@ -215,7 +215,7 @@ redraw(void)
|
|||||||
glEnd();
|
glEnd();
|
||||||
|
|
||||||
/* Allow particles to blend with each other. */
|
/* Allow particles to blend with each other. */
|
||||||
glDepthMask(GL_TRUE);
|
glDepthMask(GL_FALSE);
|
||||||
|
|
||||||
if (blend)
|
if (blend)
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
|
@@ -209,13 +209,13 @@ redraw(void)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
glDepthMask(GL_TRUE);
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glRotatef(15.0, 1.0, 0.0, 0.0);
|
glRotatef(15.0, 1.0, 0.0, 0.0);
|
||||||
glRotatef(angle, 0.0, 1.0, 0.0);
|
glRotatef(angle, 0.0, 1.0, 0.0);
|
||||||
|
|
||||||
glDepthMask(GL_FALSE);
|
|
||||||
|
|
||||||
/* Draw the floor. */
|
/* Draw the floor. */
|
||||||
/* glEnable(GL_TEXTURE_2D);*/
|
/* glEnable(GL_TEXTURE_2D);*/
|
||||||
@@ -232,7 +232,7 @@ redraw(void)
|
|||||||
glEnd();
|
glEnd();
|
||||||
|
|
||||||
/* Allow particles to blend with each other. */
|
/* Allow particles to blend with each other. */
|
||||||
glDepthMask(GL_TRUE);
|
glDepthMask(GL_FALSE);
|
||||||
|
|
||||||
if (blend)
|
if (blend)
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
|
Reference in New Issue
Block a user