[gl2ps] gl2psBeginViewportNoBackground

barrand barrand at lal.in2p3.fr
Tue May 1 18:33:44 CEST 2007


On May 1, 2007, at 5:06 PM, Christophe Geuzaine wrote:

   Hello Christophe

> 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().

   I have introduced the below gl2psGetOptions, and with it  and  
gl2psSetOptions, I can
  do what I want.

    Guy

GL2PSDLL_API GLint gl2psGetOptions(GLint* options)
{
   if(!gl2ps) {
     *options = 0;
     return GL2PS_UNINITIALIZED;
   }

   *options = gl2ps->options;

   return GL2PS_SUCCESS;
}


>
> 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