[gl2ps] gl2psBeginViewportNoBackground

Christophe Geuzaine cgeuzaine at ulg.ac.be
Tue May 1 17:06:51 CEST 2007


barrand wrote:
>     Hello
> 
>    In my software, I have to handle multiple regions / viewports  
> within the
>   same page. For the moment, in the gl2psBeginViewport, drawing
>   the background or not is controlled over a global "page" option
>   GL2PS_DRAW_BACKGROUND passed in the gl2psBeginPage.
>    I have now situations where I want that some of the regions /  
> viewports
>   within a page, visualize their background whilst others do not.
>   And with the today API, I can't do that (right ?).
> 
>    To bypass the problem, I have introduced the below function.
>   Then I ask "DRAW_BACKGROUND" in the glBeginPage and use
>   the below in case of visualizing a region/viewport without background.
> 
>     Will it be possible to include it a further version ? Or, else, some
>   mechanism to control the back/no-back per viewport would be  
> welcome....


You should be able to do what you want by calling gl2psSetOptions() with 
the right options before calling gl2psBeginViewport().

Ch.



> 
>      Regards
> 
>        Guy Barrand
> 
> 
> /*G.Barrand*/
> GL2PSDLL_API GLint gl2psBeginViewportNoBackground(GLint viewport[4])
> {
>    GLint opts;
>    if(!gl2ps) return GL2PS_UNINITIALIZED;
> 
>    opts = gl2ps->options;
>    gl2ps->options = 0; //No GL2PS_DRAW_BACKGROUND
> 
>    (gl2psbackends[gl2ps->format]->beginViewport)(viewport);
> 
>    gl2ps->options = opts;
> 
>    return GL2PS_SUCCESS;
> }
> 
> 
> _______________________________________________
> 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