Ejemplo n.º 1
0
  public void Draw() {
    mCamera.Set();

    /*mShadowMaskObject.Begin();
    {
    	glPushAttrib(GL_COLOR_BUFFER_BIT);
    	{
    		mShadowMaskObject.Clear();

    		glPushMatrix();
    		{
    			glLoadIdentity();

    			glColor3f(0, 0, 0);
    			glBegin(GL_QUADS);
    			{
    				glVertex2f(0, 0);
    				glVertex2f(mGameWindow.Width(), 0);
    				glVertex2f(mGameWindow.Width(), mGameWindow.Height());
    				glVertex2f(0, mGameWindow.Height());
    			}
    			glEnd();
    		}
    		glPopMatrix();
    	}
    	glPopAttrib();
    }
    mShadowMaskObject.End();*/

    CalculateLighting();

    DrawScene();

    // draw mask over scene to occlude shadows
    glPushMatrix();
    {
      glLoadIdentity();

      glColor4f(1, 1, 1, 1);
      Texture.Begin();
      {
        mShadowMask.BindTexture();
        mShadowMask.Draw(0, 0, 1, -1);
      }
      Texture.End();
    }
    glPopMatrix();
  }
Ejemplo n.º 2
0
  public void UnLoad() {
    super.UnLoad();

    mShadowMaskObject.Delete();
    mShadowMask.Delete();

    Light.UnLoad();
    ComplexPolygon.UnLoad();
  }