Results 1 to 3 of 3

Thread: glColorMask() question

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2011
    Posts
    17

    glColorMask() question

    Hi, I have one problem.
    In description of void glClear(GLbitfield mask); I have read this "Masking operations, such as glColorMask() and glIndexMask(), are also effective". So I do this:
    Code :
    glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_TRUE);
    glClearColor(0,0,0,0.5); // unsigned byte (0,0,0,127) right?
    glClear(GL_COLOR_BUFFER_BIT);
    glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE);
    glCopyTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,0,0,WindowWidth,WindowHeight,0); // my window is 1024x768
    glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, pTextureData); // its rectangular texture, same resolution 1024x768, belive me :)
    And then I try to look alpha component, for example, pTextureData[3] its not equal to 127. Help me plz?

  2. #2
    Guest

    Re: glColorMask() question

    if it's not 127, then what is it?

    does your pixelformat have alphaBits?

  3. #3
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: glColorMask() question

    Do not crosspost please. There are answers in the advanced forum.

Similar Threads

  1. Anaglyphs without glColorMask?
    By Cris000 in forum OpenGL: Basic Coding
    Replies: 13
    Last Post: 03-10-2011, 01:42 AM
  2. glColorMask() question
    By uelkfr in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 10-15-2006, 03:46 AM
  3. glColorMask
    By Aeluned in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 01-08-2005, 08:44 AM
  4. Depthbuffer & glColorMask
    By ml in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 01-06-2004, 12:15 PM
  5. glColorMask very very slow...!
    By Mr.Freeze in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 04-07-2002, 04:22 PM

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