Hi, I've just downloaded the GPU PerfStudio and decided to give it a try too see where were the problems. Sorry long post, please don't get angry at me
Test #1 : Horde3D SVN rev250Horde3D is going to draw overlays : After finishing drawing the scene, switches from glUseProgram(30) to glUseProgram(0) then starts to draw the overlays after calling the glUseProgram(6). After drawing the overlays, Horde3D again switches back to glUseProgram(0). Then SFML loads the font textures and continues to draw them without any problem.
Horde3D isn't going to draw any overlays : Horde3D leaves the render state to glUseProgram(30) (and a texture that contains a cubemap of a depth buffer? is still visible in the active textures tab). Then SFML loads its font texture too and that render state (30) contains the previous texture (cubemap and font texture visible at active texture tab) and nothing will be displayed.
Test #2 Horde3D SVN rev277 :Horde3D is going to draw overlays : In the final parts of the rendering the scene, render states are switched from 27 to 30 and from 30 to 27 without calling glUsePrograms(?). Then Horde3D starts to draw the overlays (without calling glUseProgram(0) or (6)) and render state changes to 6 suddenly. Horde3D draws a few elements with render state still being at 6. In middles of the process glUseProgram(30) is called, but render state still remains at 6. Horde3D finishes drawing the overlays with render state still being 6. Suddenly render state changes to 0 (with out calling glUseProgram(0)) and Horde3D tries to draw a square (filled with pink color) on the screen without any textures (active textures tab is empty). I've noticed that square is placed at the position of first character that SFML is going to draw later (render state still being at 0). After drawing that square, glUseProgram(0) is called (with render state being 0). Now it's SFML's turn but the texture it was going to use for the fonts isn't loaded. SFML continues to draw a few other squares (filled with pink color; active texture tab is empty) at the exact location of the text characters.
Horde3D is not going to draw any overlays : After drawing the whole scene, a little pink square is placed at center of the scene and
tons of glBindTexture and glActiveTextures are called (with render state being 30). In the end glUseProgram(0) is called but render state is still 30 and two textures are left from previous in the active textures tab. Now it's SFML's turn, font texture isn't loaded, render state is 30 with previous textures. SFML calls a few glVertex2f and glTexCoord2f to draw the texts on the screen like always but this time no squares are going to be drawn on the screen nor GPU PerfStudio follows the vertex locations and that pink square remains in middle of the scene.
Excuse me if I'm not too much useful here, just wanted to let you know that still there is a few problems with render states, may be that's helpful for other people that they are trying to integrate other kind of GUI systems.
Best regards, Siavash.