Results 1 to 7 of 7

Thread: SDL and Stencil Buffer

  1. #1

    SDL and Stencil Buffer

    I'm using SDL to get an OpenGL-Handle. I told SDL to set the stencil buffer size to 8.

    My problem is, that it seems like the stencil buffer is ignored: I fill it by drawing a quad and then setting glStencilFunc(GL_EQUAL, 1, 1) but OpenGL still renders the complete "mirror world". If I set glStencilFunc(GL_NEVER, 1, 1), it still renders the same, which means everything.

    Is there anything important with SDL and the stencil buffer I might have forgotten or I might not know?

  2. #2

    SDL and Stencil Buffer

    Can you clarify how you set the stencil buffer to 8 using SDL? Code please.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  3. #3

    SDL and Stencil Buffer

    Quote Originally Posted by Bob Pendleton
    Run glxinfo and look at the visuals listed at the bottom of all that
    data it dumps out. Check to see if you have a visual that supports a 8
    bit stencil buffer along with all the other buffers you are asking for.
    You might find that your card does not have a mode that supports a 8
    bit stencil buffer.

    To fix the problem you either have to use a mode your video card
    supports or buy a video card that supports the mode you need.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  4. #4

    SDL and Stencil Buffer

    Like that:
    Code:
      SDL_GL_SetAttribute&#40;SDL_GL_STENCIL_SIZE, 8&#41;;
    I'll take a look at that later.

  5. #5

    SDL and Stencil Buffer

    It works just fine with the stencil buffer/mirror demo of Sascha Willems which does not use SDL. My code is quite the same as his one. So I suppose it's just some problem with SDL. Not with my graphics card.

  6. #6

    SDL and Stencil Buffer

    Alright, that one's fixed.

    Next time I got problems with the stencil buffer, could anyone slap me and tell me to set the buffer sizes BEFORE I initialize the video mode?

  7. #7

    SDL and Stencil Buffer

    You should ahve checked out

    http://www.cerebral-bicycle.co.uk/vi...doc=307&date=Y

    Tells you all you need to know
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •