Except that python is compatible with multi threading. It just make it
single threading practically.
As for the opengl, have you tried making sharing context? I am not sure if
drawing objects is allowed in other threads,
but if it is, it must be done with shared context.


2013/2/5 Tristam MacDonald <[email protected]>

> On Mon, Feb 4, 2013 at 6:15 PM, Lord Anton Hvornum 
> <[email protected]>wrote:
>
>> I have a scenario where:
>>
>>     class main(pyglet.window):
>>        ...
>>        generates a lot of objects
>>
>>        sends a label to another thread
>>
>>     class the_thread(Thread):
>>        ...
>>        tries to:
>>            self.lable.text = 'New string'
>>            self.lable.draw()
>>
>> Which causes:
>>
>> > GLException: invalid operation
>>
>>
>> Even keeping the .draw() part in the main thread and just update the text
>> causes the error.
>> Using the "lock" function via  self.lable.being_update() and then calling
>> .end_update() causes the error.
>>
>> The code i've got works fine if i take away the Threading part, which, i
>> don't because the whole idea with the thread is to have a socket and some
>> processing operations being performed at X times / minute under different
>> circumstances.
>>
>>
>> Any idea if it's possible to solve at all?
>> Can i hook the thread objects to the main window resorce somehow or blit
>> it into the main instance? I **think** i've solved this once back in the
>> days when i was programming at a helpdesk by blitting the object into a
>> "scene" or something but i can't find my code, and it might not even have
>> been based on Pyglet to begin with.
>>
>
> In general, OpenGL is not compatible with multi-threading.
>
> In general, Python is not compatible with multi-threading either.
>
> --
> Tristam MacDonald
> Software Development Engineer, Amazon.com
> http://swiftcoder.wordpress.com/
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/pyglet-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Bc. Peter Vaňušanik
http://www.bishojo.tk

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyglet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to