Salut, j'ai imprimé la valeur de GL_SCISSOR_TEST, je ne l'active et la désactive uniquement dans cette classe :
Code cpp : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 void Panel::onDraw(RenderTarget& target, RenderStates states) { glCheck(glEnable(GL_SCISSOR_TEST)); glCheck(glScissor(getPosition().x, getWindow().getSize().y - (getPosition().y + getSize().y), getSize().x, getSize().y)); std::cout<<"enable scissor test"<<std::endl; rect.setPosition(getPosition()); rect.setSize(getSize()); target.draw(rect, states); for (unsigned int i = 0; i < sprites.size(); i++) { target.draw(sprites[i], states); } for (unsigned int i = 0; i < shapes.size(); i++) { target.draw(*shapes[i], states); } } void Panel::drawOn(RenderTarget& target, RenderStates states) { if (scrollX || scrollY) { target.draw(corner, states); } if (scrollX) { target.draw(vertScrollBar, states); } if (scrollY) { target.draw(horScrollBar, states); } std::cout<<"disable scissor test"<<std::endl; glCheck(glDisable(GL_SCISSOR_TEST)); }
Ca m'affiche bien disabled et pourtant lorsque je dessine sur ma sous fenêtre ce code ci :
Code cpp : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 if (getWindow().getName() == "WAPPLICATIONNEW") { GLboolean* params = new GLboolean[1]; glGetBooleanv(GL_SCISSOR_TEST, params); if (params[0] == GL_TRUE) std::cout<<getWindow().getName()<<" true"<<std::endl; else std::cout<<getWindow().getName()<<" false"<<std::endl; }
Parfois ça m'affiche true, parfois ça m'affiche false hors que ça devrait tout le temps m'afficher false car sur ma second fenêtre je ne dessine pas de panel et donc il doit rester désactivé. J'ai fais une recherche dans tout les fichiers du projets pour voir si je ne l'activais pas ailleurs mais non, il s'active et se désactive tout seul, c'est étrange.
Partager