Dark Bit Factory & Gravity
PROGRAMMING => Freebasic => Topic started by: Stonemonkey on November 19, 2006
-
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?
-
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?>
-
:( 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.
-
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.
-
cool!,
so it looks like a glitch in freebasic im always fasanated by the gl extension range there huge.
-
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(...)
-
nevermind, turns out it's not supported on my machine but there is an ati alternative if i can figure it out.
-
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
-
wow very handy to know that,
cheers for the info guys here is some karma.