Re: [PyOpenGL-Users] glGet issues
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@vr...> - 2013-02-14 16:04:43
|
On 13-02-07 09:29 AM, Tomasz Wesołowski wrote: > Hello, > > I've noticed that this call: > > out = GL.glGetTexParameteriv(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_SWIZZLE_B) ... > This is probably because the list of parameter sizes hardcoded in > glget.h is a bit out-of-date: > > TEX_PARAMETER_SIZES = { > simple.GL_TEXTURE_MAG_FILTER: (1,), > simple.GL_TEXTURE_MIN_FILTER: (1,), > simple.GL_TEXTURE_WRAP_S: (1,), > simple.GL_TEXTURE_WRAP_T: (1,), > simple.GL_TEXTURE_BORDER_COLOR: (4,), > simple.GL_TEXTURE_PRIORITY: (1,), > simple.GL_TEXTURE_RESIDENT: (1,) > } Yes, basically all of the image manipulation code is a hand-coded wrapper around the raw operations. What needs to happen is parsing the various spec files looking for: New Tokens Accepted by the <...> parameter of ... GetTexParameteriv and generating a line like this: glget.addGLGetTexParameterConstant(GL_TEXTURE_SWIZZLE_B,(1,)) in the wrapper (currently these are added to the hand-coded wrappers). Currently I do those by hand, but that just isn't keeping pace with the various extensions (or even core, really). Each of those calls actually needs review to see what size the result should be, too. Lastly, the image wrapping code likely needs to be more robust to be able to handle un-declared constants. > Sadly, I aparrently can't call this function "normally", without the > ctypes enhancement: > > out = ctypes.c_int() > GL.glGetTexParameteriv(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_SWIZZLE_B, > ctypes.byref(out)) If you need the raw operation: GL.glGetTexParameteriv.wrappedOperation which is still ctypes, but doesn't have the wrapper code applied. Hope that helps, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |