The pyglet.graphics module uses glMultiDrawArrays for some vertex
arrays (where the allocator has had to split allocations).
There really shouldn't be any difference between the pyglet version
and the more bare-bones version you showed - except that in the second
case there's no type information attached to the ctypes proxy.
The decoration in pyglet is:
glMultiDrawArrays = _link_function('glMultiDrawArrays', None, [GLenum,
POINTER(GLint), POINTER(GLsizei), GLsizei], 'VERSION_1_4')
_link_function is link_GL in this case:
def link_GL(name, restype, argtypes, requires=None, suggestions=None):
try:
func = getattr(gl_lib, name)
func.restype = restype
func.argtypes = argtypes
decorate_function(func, name)
return func
except AttributeError:
return missing_function(name, requires, suggestions)
(and decorate_function just adds error GL checking when in the default
debugging mode)
Richard
On 8 November 2011 08:39, Eleftherios Garyfallidis
<[email protected]> wrote:
> ...
>
> and when I read the library using ctypes
>
> from pyglet.lib import load_library
>
> glib=load_library('GL')
>
> and try
> glib.glMultiDrawArrays(GL_LINE_STRIP, firstptr,countptr, items)
>
> it works again with no problem.
>
> Best regards,
> Eleftherios
>
>
> On Mon, Nov 7, 2011 at 6:36 PM, Eleftherios Garyfallidis
> <[email protected]> wrote:
>>
>> Hello,
>>
>> Is there any known issue with glMultiDrawArrays in pyglet?
>>
>> count=np.array([3,3,3],dtype=np.int32)
>> first=np.array([0,3,6],dtype=np.int32)
>> items=3
>>
>> firstptr=firts.ctypes.data
>> countptr=count.ctypes.data
>>
>> This gives segmentation fault
>> glMultiDrawArrays(GL_LINE_STRIP, firstptr,countptr, items)
>>
>> And this works just fine
>> glDrawArrays(GL_LINE_STRIP,0,3)
>> glDrawArrays(GL_LINE_STRIP,3,3)
>> glDrawArrays(GL_LINE_STRIP,6,3)
>>
>> However these two should have identical results according to the Red
>> bible.
>>
>> Best wishes,
>> Eleftherios
>
> --
> 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.
>
--
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.