The integral $$ I(m)=\frac{1}{4\pi}\int_{-\pi}^{\pi}\mathrm{d}x\int_{-\pi}^\pi\mathrm{d}y \frac{m\cos(x)\cos(y)-\cos x-\cos y}{\left( \sin^2x+\sin^2y +(m-\cos x-\cos y)^2\right)^{3/2}} $$ gives the Chern number of a certain vector bundle [1] over a torus. It can be shown using the theory of characteristic classes that $$ I(m) = \frac{\mathrm{sign}(m-2)+\mathrm{sign}(m+2)}{2}-\mathrm{sign}(m) = \begin{cases}1 & -2< m < 0 \\ -1 & 0 < m < 2 \\0 & \text{otherwise}\end{cases}. $$ Is there any way to evaluate this integral directly (i.e. without making use of methods from differential geometry) to obtain the above result?
I should mention that the above integral can be written as ($1/4\pi$ times) the solid angle subtended from the origin of the unit vector $\hat{\mathbf{n}}$, $$ I(m)=\frac{1}{4\pi}\int_{-\pi}^{\pi}\mathrm{d}x\int_{-\pi}^\pi\mathrm{d}y\, \hat{\mathbf{n}}\cdot\left(\partial_x \hat{\mathbf{n}}\times \partial_y \hat{\mathbf{n}}\right), $$ where $\mathbf{n}(m)=(\sin x, \sin y, m- \cos x-\cos y)$. While this form makes it very straightforward to evaluate $I(m)$, I am interested in whether there is a way to compute this integral using more standard techniques.
[1] B. Bernevig Topological Insulators and Topological Superconductors Chapter 8