Reputation: 58637
I am trying to apply a scissor transformation over a specific part of my application. The problem is, I don't know the window coordinates, so I don't know exactly where to place the scissor.
Is there an OpenGL state variable that would tell me where the current drawing position is?
Upvotes: 1
Views: 644
Reputation: 6437
The "current drawing position" in OpenGL is somewhat undefined. I'll assume you are referring to the projection and model-view matrices, which transform the drawn vertices. If you are using simple 2D transformations, you can get those matrices using glGetFloatv
and GL_MODELVIEW_MATRIX
or GL_PROJECTION_MATRIX
, and then attempt to extract the transformation that was applied from the resulting matrix.
Upvotes: 1
Reputation: 56357
You mean, the current raster position? You can get it using glGetIntegerv, but it's applied to a very limited set of commands. Normal drawing using glDrawArrays or immediate mode is unaffected by the raster position.
Upvotes: 0