Page 1 of 1

DrawWorldPreUnit OpenGL state.

Posted: 14 Jun 2009, 18:23
by zwzsg
What state are DrawWorldPreUnit callins supposed to leave OpenGL in?

gl.ResetState() makes water plane drawn over land and add this weird cylinder sporting some textures picked I don't know how at 0,0,0:

Image

Image

Edit: Tried with gl.PushAttrib(GL.ALL_ATTRIB_BITS) at the begining of the callin, gl.PopMatrix() at the end, it solves the water plane issue, so I think it does save the DepthTest state, but I still have the weird cylinder. Commented my gl.Texture and gl.BeginEnd, so I don't see how it could be my own code drawing it.

Re: DrawWorldPreUnit OpenGL state.

Posted: 22 Jun 2009, 11:29
by jK
zwzsg wrote:Edit: Tried with gl.PushAttrib(GL.ALL_ATTRIB_BITS) at the begining of the callin, gl.PopMatrix() at the end, it solves the water plane issue, so I think it does save the DepthTest state, but I still have the weird cylinder.
o_O

2. You know what states you touched, so you know what states you have to reset. The states' defaults depend on the used callin (and can change with spring releases). gl.ResetStates just reset the states to the one mentioned in the wiki and don't have to be the ones for the specific callin you are using! So either use gl.PushAttrib/PopAttrib or find the defaults yourself for the specific states (either just try&error or/and use glGet).