----Message d'origine----
>Date: Sat, 08 Mar 2008 16:40:13 +0100
>De: Giel van Schijndel 
>A: Development list 
>Copie à: [EMAIL PROTECTED]
>Sujet: Re: [Warzone-dev] warzone2100, quesoglc dependency
>       <mailto:[EMAIL PROTECTED]>
>       <mailto:[EMAIL PROTECTED]>
>
>
>I'm just wondering if it wouldn't be better for this particular case to
>use glIsEnabled(GL_TEXTURE_2D) to check whether texturing is enabled (in
>GLC I mean) then enable it if disabled (and disable it again when
>finishing drawing). As I assume GLC binds its own texture this would
>cause us to use GLC's texture in later drawing commands if we would
>happen to need texture page 0 (as WZ thinks texpage 0 is still bound).
>
>I'm not sure what the best place to fix this would be: enable texturing
>in GLC by checking whether it's enabled first, or to add yet another
>negative constant to pie_SetTexturePage() which tells it that a texture
>rebind is necessary but doesn't disable texturing altogether.
>

First, QuesoGLC restore the GL state in the very same state than it was before 
executing the GLC command. So you do not have to worry about using QuesoGLC 
textures in places where it is not intended to. If the GL state is still 
modified by QuesoGLC in one way or another after a GLC command has been 
executed then it is a bug which should be reported to the QuesoGLC bug tracker 
on SourceForge.

Second, what you suggested is exactly what QuesoGLC did before 0.7.0. But one 
more time, I see no point in doing that since most of the time the call to 
glIsEnabled() will be executed just to see that GL_TEXTURE_2D is already 
enabled. I think the choice made in 0.7.0 allows for more control of the client 
on the GL state and may prevent useless GL calls.

Finally, the patch #961 kept the call to pie_SetTexturePage() in order to 
enable GL_TEXTURE_2D but not to bind the texture 0. Indeed, if you have some 
concerns about the texture which is bound at the end of iV_DrawTextRotated(), 
you should replace the call to pie_SetTexturePage(0) by a call to 
glEnable(GL_TEXTURE_2D). You may as well optimize the calls to 
glEnable(GL_TEXTURE_2D) by making sure that iV_DrawTextRotated is called in 
places where GL_TEXTURE_2D is enabled, in which case you could remove the call
to pie_SetTexturePage() as well as the call to glEnable(GL_TEXTURE_2D).

As you can see, the decision not to enable GL_TEXTURE_2D in QuesoGLC allows to 
make a bit of optimization if required. If optimization is not a concern then 
you just have to call glEnable(GL_TEXTURE_2D) before calling glcRenderxxx(). 
This looks as a fair trade-off to me.

>> ...
>> As a conclusion, the second issue is not the only one which may justify to 
>> not to use QuesoGLC 0.7.0 along with Warzone.
>
>Ok, so I assume compiling QuesoGLC 0.7.0 with VBOs disabled could be a
>possible fix as well

Yes but I would prefer a fix for the VBOs rather than a workaround which would 
consist in disabling VBOs.

Regards,

Bertrand.


_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev

Reply via email to