Here is the very minimal table I use (note that I don't handle exotic types
such as GL_UNSIGNED_SHORT_5_6_5_REV, etc.):
from pyglet.gl import *
gl_type_mappings = {
GL_BYTE: GLbyte,
GL_2_BYTES: GLbyte,
GL_3_BYTES: GLbyte,
GL_4_BYTES: GLbyte,
GL_UNSIGNED_BYTE: GLubyte,
GL_SHORT: GLshort,
GL_UNSIGNED_SHORT: GLushort,
GL_INT: GLint,
GL_UNSIGNED_INT: GLuint,
GL_FLOAT: GLfloat,
GL_DOUBLE: GLdouble
}
On Fri, Jan 9, 2009 at 10:59 AM, Alex Holkner <[email protected]>wrote:
>
> On Sat, Jan 10, 2009 at 1:18 AM, Stéfan van der Walt <[email protected]>
> wrote:
> >
> > Hi all,
> >
> > I am extending the Pyglet Texture class to support numeric types other
> > than unsigned bytes. To do that, I need a mapping of all numeric
> > types, such as GL_UNSIGNED_BYTE, GL_FLOAT, GL_INT, etc. to their
> > ctypes counterparts, GLubyte, GLfloat, GLint, etc. Does such a
> > mapping already exist in Pyglet? If not, should I simply construct a
> > table by hand, or is there a more appropriate way?
> >
>
> There isn't one in pyglet that I can recall. There are only a handful
> of types, it should be reasonable to hand-code a table.
>
> Alex.
>
> >
>
--
Tristam MacDonald
http://swiftcoder.wordpress.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---