Hi Robert,

About GL_PATCH_DEFAULT_INNER_LEVEL  and GL_PATCH_DEFAULT_OUTER_LEVEL : I also 
think that a dedicated StateAttribute is the best way to implement this and let 
users do what they want with it.

Maybe a default value ("1.0" is probably the best one) should be set at top of 
the scene graph (just like some other StateAttribute) ?

About the enum problem : I understand that a direct mapping between OSG and 
OpenGL enums is very convenient. But perhaps we can use here some kind of 
"magic value" :


{
POINTS = GL_POINTS
LINES = GL_LINES 
LINE_STRIP = GL_LINE_STRIP 
LINE_LOOP = GL_LINE_LOOP 
TRIANGLES = GL_TRIANGLES
TRIANGLE_STRIP = GL_TRIANGLE_STRIP 
TRIANGLE_FAN = GL_TRIANGLE_FAN
QUADS = GL_QUADS 
QUAD_STRIP = GL_QUAD_STRIP 
POLYGON = GL_POLYGON 
LINES_ADJACENCY = GL_LINES_ADJACENCY 
LINE_STRIP_ADJACENCY = GL_LINE_STRIP_ADJACENCY 
TRIANGLES_ADJACENCY = GL_TRIANGLES_ADJACENCY 
TRIANGLE_STRIP_ADJACENCY = GL_TRIANGLE_STRIP_ADJACENCY 
PATCHES_0 = SOME_KIND_OF_MAGIC_VALUE
PATCHES_1 = PATCHES_0 + 1
PATCHES_2 = PATCHES_0 + 2
PATCHES_3 = PATCHES_0 + 3
...
PATCHES_N = PATCHES_0 + N
};

So in the code, the test could be like :


Code:
if (mode >= PATCHES_0)
{
    use "GL_PATCH" draw mode
    set "GL_PATCH_SIZE" = (mode-PATCHES_0)
}
else
{
    use "mode" draw mode
}



Thank you!

Cheers,
Aurelien

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=54527#54527





_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to