[gl2ps] gl2psBegin(End)Viewport usage

Christophe Geuzaine cgeuzaine at ulg.ac.be
Sat Oct 17 18:52:26 CEST 2015


> On 18 Apr 2015, at 21:33, Pantxo Diribarne <pantxo.diribarne at gmail.com> wrote:
> 
> Hi,
> 
> In GNU Octave we are trying to mimic the effect of "glClear (GL_DEPTH_BUFFER_BIT)", which is basically write subsequent primitives over previous ones disregarding their z depth,  using "gl2psEnd(Begin)Viewport" (see [1]). This works great on some machines but fails on others (some win7, see [2]) accompanied with a warning:
> "GL2PS warning: Unknown token in buffer"
> 
> Here is approximately what we do:
>  GLint ret = gl2psBeginPage (... | GL2PS_USE_CURRENT_VIEWPORT ...);
>  // draw
>  ...
>  // A new axes should be drawn over previous objects:
>  GLint vp[4];
>  gl2psEndViewport ();
>  glGetIntegerv(GL_VIEWPORT, vp);
>  gl2psBeginViewport (vp);
>  ...
>  glClear (GL_DEPTH_BUFFER_BIT);
>  // draw
>  ...
>  state = gl2psEndPage ();
> 
> Is it the way viewports are supposed to be used in gl2ps, or is there a better method to achieve what we want?
> 

A priori, yes. I have never personally used them for this purpose, though...

Christophe 

> Thanks in advance,
> 
> Pantxo
> 
> [1] https://savannah.gnu.org/bugs/?44806
> [2] https://savannah.gnu.org/bugs/?44765
> 
> 
> _______________________________________________
> 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