From reading Display's source I found out, that I can simply call
if ( Display.isVisible() || Display.isDirty() )
{
Display.swapBuffers();
}
instead of
Display.update();
This will result in the input devices not being polled, which I can do, when I need it. My test has become faster now
. And the pollMessages() method is not needed to be called, since it does nothing else than
display_impl.update();
which is already done by the isVisible() and isDirty() calls. I suggest to change that in the source, since it just costs performance.
And is it really necessary to call display_impl from within each method. I would like to have methods like isVisible() and isDirty(), that don't call display_impl.update() (maybe an additional boolean parameter), since it costs me 1% for each of these calls. And as far as I understand it, this display_impl.update() method should only be necessary to be called once per frame. Is this correct?
My initial question stays though. Is it possible to do input polling in a cheaper way?
Marvin