• Welcome to Dark Bit Factory & Gravity.
 

2 sided stencil functions?

Started by Stonemonkey, November 19, 2006

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Stonemonkey

I'm trying to get the opengl 2 sided stencil function working in FB but can't work it out, it's maybe something like:


dim glActiveStencilFaceEXT as PFNGLACTIVESTENCILFACEEXTPROC
glActiveStencilFaceEXT=cptr(PFNGLACTIVESTENCILFACEEXTPROC,glfwGetProcAddress("glActiveStencilFaceEXT"))


but that returns 0

Anyone know how it should be?

ninogenio

might something like this work mate?

sorry untested so im not sure.


dim PFNGLACTIVESTENCILFACEEXTPROC as sub()
dim glActiveStencilFaceEXT as PFNGLACTIVESTENCILFACEEXTPROC
glActiveStencilFaceEXT=cast(PFNGLACTIVESTENCILFACEEXTPROC,glfwGetProcAddress("glActiveStencilFaceEXT"))


<edit do you have the code in c?>
Challenge Trophies Won:

Stonemonkey

:( nope, doesn't work and no c code either. Only thing i've found on it is this

http://oss.sgi.com/projects/ogl-sample/registry/EXT/stencil_two_side.txt

Thanks anyway.

Stonemonkey

just tried exactly what i was trying but with some different extensions to do with secondary colour and they worked so it seems like maybe something missing somewhere.

ninogenio

cool!,

so it looks like a glitch in freebasic im always fasanated by the gl extension range there huge.
Challenge Trophies Won:

Stonemonkey

found this in glext but still to find out how to set which face.

glenable(GL_STENCIL_TEST_TWO_SIDE_EXT)
GL_ACTIVE_STENCIL_FACE_EXT(...)

Stonemonkey

nevermind, turns out it's not supported on my machine but there is an ati alternative if i can figure it out.

Jim

I worked on this on MSN with Fryer.  The upshot is that his ATI card/driver don't support that extension.
You need to call


char *ext;
ext = glGetString(GL_EXTENSIONS);
printf("%s\n", ext);


to get a list of the supported extensions.
If "GL_EXT_stencil_two_side" is part of the string that gets returns, then it's supported.  Otherwise it isn't and glfwGetProcAddress will likely return NULL.

Turns out ATI have their own version of this extension called "GL_ATI_separate_stencil".  Don't be fooled by the name though.  My nVidia card happily supports a number of ATI extensions.  Sadly not this one though, so Fryer's going to be stuck coding two different versions of the code to cover most drivers.

Jim

Challenge Trophies Won:

ninogenio

wow very handy to know that,

cheers for the info guys here is some karma.
Challenge Trophies Won: