Results 1 to 3 of 3

Thread: glBlendFunc help please....

  1. #1
    Member Newbie
    Join Date
    May 2006
    Location
    New Zealand
    Posts
    38

    glBlendFunc help please....

    Hi guys,

    I am trying to use a white and black image to make a cookie cutter type
    effect - where white is clear and black is black.


    I am using glBlendFunc with Gl_DST_COLOR and GL_ZERO.


    My two images are at homepages.ihug.co.nz/~acgrant/mask.bmp and
    homepages.ihug.co.nz/~acgrant/Untitled-1.bmp


    My code is at :
    http://www.gamedev.net/community/for...opic_id=393462


    But for some reason I am getting a blank window.


    Both images draw fine on their own.


    Can anyone PLEASE help?


    Thanks


    -Al

    PS: I am in VC++ Express.

  2. #2
    Senior Member OpenGL Pro sqrt[-1]'s Avatar
    Join Date
    Jun 2002
    Location
    Australia
    Posts
    1,000

    Re: glBlendFunc help please....

    Add a glDisable(GL_BLEND); to the end of your DrawGLScene.

    What is happening is that it works correctly the first frame, but each frame onwards still has blending enabled so it gets progressively darker each render until it goes black.

    It is typical for an app to designate a "known" OpenGL starting state. So you typically you disable anything that you enable. (or enable anything you disable) that is different from your "default" state.

  3. #3
    Member Newbie
    Join Date
    May 2006
    Location
    New Zealand
    Posts
    38

    Re: glBlendFunc help please....

    sqrt[-1] you are a genius. That fixed it. I had a bunch of people look at that code and couldnt see what was wrong so congrats to you and THANKS.

    -Al

Similar Threads

  1. glBlendFunc
    By MasTrO in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 08-13-2004, 11:07 AM
  2. glBlendFunc ?!
    By Jnz86 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-29-2004, 06:53 AM
  3. glBlendFunc
    By HairyFotr in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 11-22-2003, 12:30 AM
  4. glBlendFunc
    By alark in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 07-10-2003, 11:41 PM
  5. glBlendFunc?
    By Kondrat in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-28-2000, 04:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean