Load doesn not equal push, So in the two cases your not doing the same thing, you also have a pop in there, i think that might be significant.
Look it up on the reference pages
The difference between the two.
push - Specifies a name that will be pushed onto the name stack.
load - Specifies a name that will replace the top value on the name stack.
clearly it is not doing the same thing… as indicated by not writing the same code, and by the different results…
I did look it up - clearly I am not quite understanding the name stack. If I push the name “1” onto the stack, draw something, and then pop it off, that something got drawn with name “1”. If I “load” the name “1” onto the stack and then draw something, it sounds to me like that something should also be drawn with the name “1”. How is this not correct?
I see, I had to push SOMETHING onto the stack first, because glLoadName() replaces the top item on the stack, so if the stack is empty an error occurs.
Ie.
glPushName(1); //or any junk value
glLoadName(1);
DrawTriangle();
glLoadName(2)
DrawSomethingElse();