thanks Claudio,
I had already imported the ctypes but I still get:
src = (c_char_p * count)(*strings)
TypeError: bytes or integer address expected instead of str instance
and the next line of code looks awkward:
glShaderSource(shader, count, cast(pointer(src),
POINTER(POINTER(c_char))), None)
On 20/04/2020, claudio canepa <
ccan...@gmail.com> wrote:
> From a comment in the page:
>
> There’s a missing import in the shader module.
>
> File “/shader.py”, line 40, in createShader
> src = (c_char_p * count)(*strings)
> NameError: global name ‘c_char_p’ is not defined
>
> Resolved by adding
>
> from ctypes import *
>
> On Mon, Apr 20, 2020 at 12:22 PM Nicky Mac <
nmcel...@gmail.com> wrote:
>
>>
>>
>> On Monday, April 20, 2020 at 10:25:59 AM UTC+1, Nicky Mac wrote:
>>>
>>> the splendid glsl examples in
pythonstuff.org require the use of
>>> Tristan
>>> McDonald's Shader.py
>>> obtainable from :
>>>
https://swiftcoder.wordpress.com/2008/12/19/simple-glsl-wrapper-for-pyglet/
>>> <
https://www.google.com/url?q=https%3A%2F%2Fswiftcoder.wordpress.com%2F2008%2F12%2F19%2Fsimple-glsl-wrapper-for-pyglet%2F&sa=D&sntz=1&usg=AFQjCNGJa5x89HiGqIUhjEeI7eKC6QZizA>
>>>
>>> but the code there is badly formatted and after unscrambling it I can't
>>> get it to run.
>>> Is there somewhere else I can acquire this code?
>>>
>>
>> Ok I've now found it, but when used errors:
>>
>> File "C:/Python/Python36/Dhruve and me/Pyglet\shader.py", line 40, in
>> createShader
>> src = (c_char_p * count)(*strings)
>> NameError: name 'c_char_p' is not defined
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "pyglet-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to
pyglet-users...@googlegroups.com.
>> To view this discussion on the web visit
>>
https://groups.google.com/d/msgid/pyglet-users/3c81c9be-9a13-4d10-8aae-32b34a0275ae%40googlegroups.com
>> <
https://groups.google.com/d/msgid/pyglet-users/3c81c9be-9a13-4d10-8aae-32b34a0275ae%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "pyglet-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
pyglet-users...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/pyglet-users/CAP3BN9VAkymNHTqNBGxYWb-gob%3DGqgWLgZ%3DHQLp%3DKxFL5vUT%2Bg%40mail.gmail.com.
>
--
Nick "Mac" McElwaine