foobarfuzzbizz
foobarfuzzbizz

Reputation: 58637

In OpenGL, how can I determine the current drawing position?

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

Answers (2)

Trillian
Trillian

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

Dr. Snoopy
Dr. Snoopy

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

Related Questions