This patch adds a python method to get openGL bind code of material's texture according to the texture slot.
cont = bge.logic.getCurrentController()
own = cont.owner
bindId = own.meshes.materials.getTextureBindcode(0)
Test file: http://www.pasteall.org/blend/40679
This can be used to play with texture in openGL, for example, remove mipmap on the texture or play with all wrapping or filtering options.
And this can be used to learn openGL with Blender.