[gl2ps] [patch] Enable use without an OpenGL context
Christophe Geuzaine
cgeuzaine at ulg.ac.be
Wed Jan 13 08:46:14 CET 2016
Hi David,
This is a very good idea - I've merged the patch in SVN.
Do you think it would be doable to incorporate the parsing of the transform feedback buffers directly in GL2PS?
Cheers,
Christophe
> On 12 Jan 2016, at 22:08, David Lonie <david.lonie at kitware.com> wrote:
>
> Hi all,
>
> I maintain the GL2PS export implementation in VTK, and we recently
> revamped our rendering engine to use newer OpenGL APIs, and the
> versions we're targeting have deprecated the OpenGL feedback buffer.
>
> Not wanting to implement my own vector graphics export library, I've
> made a few modifications to GL2PS so that we may continue to use it,
> and would like to see about getting these merged upstream rather than
> make a fork of GL2PS. I've attached a diff made against the current
> (as of today) SVN repo.
>
> For the curious, newer OpenGL adds Transform Feedback buffers that can
> be used to capture varying GLSL variables from vertex/geometry
> shaders. These buffers can provide transformed coordinates, normals,
> colors etc that the old feedback buffer used to catch. The buffers are
> parsed manually and the vertex attributes are added manually into
> gl2ps using gl2psAddPolyPrimitive.
>
> Summary of changes:
> - Expose gl2psAddPolyPrimitive and required datatypes/defined values
> (the GL2PS_[...] primitive defines, GL2PSxyz, GL2PSrgba, and
> GL2PSvertex).
> - Allow gl2psBeginPage to accept a buffersize of 0 -- this indicates
> that the feedback buffer should not be parsed and that geometry will
> be supplied manually. This is a change in behavior -- the old
> implementation would allocate a default 4MB feedback buffer.
> - Add new gl2psForceRasterPos method, which allows the raster position
> to be set for text and image export without using OpenGL functions.
>
> Feedback, questions, suggestions are welcome.
>
> Cheers,
> Dave
> <gl2ps-nogl.diff>_______________________________________________
> gl2ps mailing list
> gl2ps at geuz.org
> http://www.geuz.org/mailman/listinfo/gl2ps
--
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine
Tetrahedron V, July 4-5 2016: http://tetrahedron.montefiore.ulg.ac.be
Free software: http://gmsh.info | http://getdp.info | http://onelab.info