tags:

views:

42

answers:

2

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?

A: 

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.

Matias Valdenegro
+1  A: 

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.

Trillian