matus-chochlik / oglplus

OGLplus is a collection of open-source, cross-platform libraries which implement an object-oriented facade over the OpenGL® (version 3 and higher) and also OpenAL® (version 1.1) and EGL (version 1.4) C-language APIs. It provides wrappers which automate resource and object management and make the use of these libraries in C++ safer and more convenient.
http://oglplus.org/
Boost Software License 1.0
491 stars 72 forks source link

PrimitiveType::Patches for ObjMesh #64

Closed ucacaxm closed 10 years ago

ucacaxm commented 10 years ago

Hi Matus,

I would like to use a shapes::ObjMesh in a Tessalation shader: so each triangle is a patch.

In our example of tesselation, you create a shape instruction like that: shapes::SimpleIcosahedron make_shape; shape_instr(make_shape.Instructions(PrimitiveType::Patches))

but if I try that on a ObjMesh: shapes::ObjMesh obj; obj.Instructions(PrimitiveType::Patches); The function does not exist and it I let the primitive type as Triangle, I get a GL error which is due (I guess) to the primitive type.

Thank a lot ... alex

matus-chochlik commented 10 years ago

Hi Alex, In commit 3085ca1 I've added the PrimitiveType parameter to the Instructions function of ObjMesh, so now it should work as with the SimpleIcosahedron shape builder. If it still throws an exception in DrawArrays then there is some other problem, but it's hard to tell without concrete code.

--Matus

ucacaxm commented 10 years ago

Hi Matus,

Yes it is ok for the update (many thanks) On my mobile yesterday night I did not see your post telling that you did the update in the code, I saw only the closed post. This morning I saw your post and then I removed my comment 10 minutes ago.

The tesselation is working perfectly with the ObjMesh

Many thank for your reactivity, alex

2014-04-19 6:11 GMT+02:00 Matus Chochlik notifications@github.com:

Hi Alex, In commit 3085ca1https://github.com/matus-chochlik/oglplus/commit/3085ca1I've added the PrimitiveType parameter to the Instructions function of ObjMesh, so now it should work as with the SimpleIcosahedron shape builder. If it still throws an exception in DrawArrays then there is some other problem, but it's hard to tell without concrete code.

--Matus

— Reply to this email directly or view it on GitHubhttps://github.com/matus-chochlik/oglplus/issues/64#issuecomment-40860200 .

matus-chochlik commented 10 years ago

NP, good to hear it works :)