Drawing with GL on top of a GUI DrawTexture()

I’m trying to draw a simple radar with a background in Unity. The stuff inside the radar is being drawn with the GL.* methods using lines. The radar’s background is being drawn with GUI.DrawTexture(). All rendering is happening in OnGUI(), since that’s the only place where DrawTexture() seems to work. Whenever I do this, the background draws on top of the lines. Is this impossible or is there something I’m doing wrong?

Well, first of all, make sure you’re calling the background draw before the rest of the graphics.

If that’s already the case, you can try drawing the background with Graphics.DrawTexture instead… although it should make no difference if you’re drawing all of it from the same OnGUI loop.

Cheers

Yeah I’m doing the GUI.DrawTexture() call before the GL calls. I also tried Graphics.DrawTexture() to no avail