Re: [pygame] Working with Surfaces
Hi René, Tyler, I suggest we clean out the defunct movieext from Pygame trunk. Lenard Tyler Laing wrote: There we go, Branch is made, and it is updated with all the code I've done today Thanks :) -Tyler On Mon, May 18, 2009 at 3:40 PM, René Dudfield ren...@gmail.com mailto:ren...@gmail.com wrote: On Tue, May 19, 2009 at 8:40 AM, René Dudfield ren...@gmail.com mailto:ren...@gmail.com wrote: hi, svn copy svn://seul.org/svn/pygame/trunk http://seul.org/svn/pygame/trunk svn://seul.org/svn/pygame/branches/tylerthemovie http://seul.org/svn/pygame/branches/tylerthemovie ^ this is supposed to be on one line -- Visit my blog at http://oddco.ca/zeroth/zblog
Re: [pygame] Working with Surfaces
Lenard, Sounds good to me. If no one's using it, its not needed. -Tyler On Tue, May 19, 2009 at 7:34 AM, Lenard Lindstrom le...@telus.net wrote: Hi René, Tyler, I suggest we clean out the defunct movieext from Pygame trunk. Lenard Tyler Laing wrote: There we go, Branch is made, and it is updated with all the code I've done today Thanks :) -Tyler On Mon, May 18, 2009 at 3:40 PM, René Dudfield ren...@gmail.com mailto: ren...@gmail.com wrote: On Tue, May 19, 2009 at 8:40 AM, René Dudfield ren...@gmail.com mailto:ren...@gmail.com wrote: hi, svn copy svn://seul.org/svn/pygame/trunk http://seul.org/svn/pygame/trunk svn://seul.org/svn/pygame/branches/tylerthemovie http://seul.org/svn/pygame/branches/tylerthemovie ^ this is supposed to be on one line -- Visit my blog at http://oddco.ca/zeroth/zblog -- Visit my blog at http://oddco.ca/zeroth/zblog
Re: [pygame] Working with Surfaces
It's not built by default. If someone wants it, it can be restored. Lenard Tyler Laing wrote: Lenard, Sounds good to me. If no one's using it, its not needed. -Tyler On Tue, May 19, 2009 at 7:34 AM, Lenard Lindstrom le...@telus.net mailto:le...@telus.net wrote: Hi René, Tyler, I suggest we clean out the defunct movieext from Pygame trunk. Lenard Tyler Laing wrote: There we go, Branch is made, and it is updated with all the code I've done today Thanks :) -Tyler On Mon, May 18, 2009 at 3:40 PM, René Dudfield ren...@gmail.com mailto:ren...@gmail.com mailto:ren...@gmail.com mailto:ren...@gmail.com wrote: On Tue, May 19, 2009 at 8:40 AM, René Dudfield ren...@gmail.com mailto:ren...@gmail.com mailto:ren...@gmail.com mailto:ren...@gmail.com wrote: hi, svn copy svn://seul.org/svn/pygame/trunk http://seul.org/svn/pygame/trunk http://seul.org/svn/pygame/trunk svn://seul.org/svn/pygame/branches/tylerthemovie http://seul.org/svn/pygame/branches/tylerthemovie http://seul.org/svn/pygame/branches/tylerthemovie ^ this is supposed to be on one line -- Visit my blog at http://oddco.ca/zeroth/zblog -- Visit my blog at http://oddco.ca/zeroth/zblog
[pygame] Working with Surfaces
Hello all, I've got a bit of a brainteaser for you, maybe, and hopefully not. Right now, through judicious use of ffplay code, I've got a large portion of the code written for a first draft version of the movie module. I changed the code where appropriate for our needs. Of course, that doesn't mean its been tested, or has even compiled yet. ;) However, I'm wondering which way I should go: Whether I should write to a pygame surface(say one passed on initialization), via the PySurface C methods, or to extract the rect and surface from the PySurface struct, and write to those instead. Which way would be safer/better/whatever? -Tyler Visit my blog at http://oddco.ca/zeroth/zblog
Re: [pygame] Working with Surfaces
hello, it's generally good to keep out python code from the main logic of your functions, if you can. Then try and keep the python wrapping function to interacting with python. That is keep the SDL parts and the python parts as separate as possible. The python wrapper part will use a call like so... surf = PySurface_AsSurface(surfobj); to get the SDL_Surface* surf surface, which you can then pass to your function. Since the life time of the surface is done with python, through reference counting. Each time you access the surface you should probably first increment a reference count, and then modify it, then decrement the reference count. Otherwise you might want to store a reference at initialisation time, then it should be fairly safe to access the surface. However, the display surface can disappear, so perhaps passing in a surface each time might be better. I hope maybe that helps answer your question... ps. be good to start a branch in svn to dump your code as you go :) Then we can all look at your code specifically. On Tue, May 19, 2009 at 8:02 AM, Tyler Laing trinio...@gmail.com wrote: Hello all, I've got a bit of a brainteaser for you, maybe, and hopefully not. Right now, through judicious use of ffplay code, I've got a large portion of the code written for a first draft version of the movie module. I changed the code where appropriate for our needs. Of course, that doesn't mean its been tested, or has even compiled yet. ;) However, I'm wondering which way I should go: Whether I should write to a pygame surface(say one passed on initialization), via the PySurface C methods, or to extract the rect and surface from the PySurface struct, and write to those instead. Which way would be safer/better/whatever? -Tyler Visit my blog at http://oddco.ca/zeroth/zblog
Re: [pygame] Working with Surfaces
Okay, so if I understand you correctly, you say I should extract the SDL stuff from the object and use that instead of a Python object? I can do that. And... I do know how to use svn, but I've never made a branch in svn. How do I do that? -Tyler On Mon, May 18, 2009 at 3:18 PM, René Dudfield ren...@gmail.com wrote: hello, it's generally good to keep out python code from the main logic of your functions, if you can. Then try and keep the python wrapping function to interacting with python. That is keep the SDL parts and the python parts as separate as possible. The python wrapper part will use a call like so... surf = PySurface_AsSurface(surfobj); to get the SDL_Surface* surf surface, which you can then pass to your function. Since the life time of the surface is done with python, through reference counting. Each time you access the surface you should probably first increment a reference count, and then modify it, then decrement the reference count. Otherwise you might want to store a reference at initialisation time, then it should be fairly safe to access the surface. However, the display surface can disappear, so perhaps passing in a surface each time might be better. I hope maybe that helps answer your question... ps. be good to start a branch in svn to dump your code as you go :) Then we can all look at your code specifically. On Tue, May 19, 2009 at 8:02 AM, Tyler Laing trinio...@gmail.com wrote: Hello all, I've got a bit of a brainteaser for you, maybe, and hopefully not. Right now, through judicious use of ffplay code, I've got a large portion of the code written for a first draft version of the movie module. I changed the code where appropriate for our needs. Of course, that doesn't mean its been tested, or has even compiled yet. ;) However, I'm wondering which way I should go: Whether I should write to a pygame surface(say one passed on initialization), via the PySurface C methods, or to extract the rect and surface from the PySurface struct, and write to those instead. Which way would be safer/better/whatever? -Tyler Visit my blog at http://oddco.ca/zeroth/zblog -- Visit my blog at http://oddco.ca/zeroth/zblog
Re: [pygame] Working with Surfaces
hi, svn copy svn://seul.org/svn/pygame/trunk svn://seul.org/svn/pygame/branches/tylerthemovie the svn book is pretty cool for obscure svn functions... more details on creating branches here: http://svnbook.red-bean.com/en/1.1/ch04s02.html On Tue, May 19, 2009 at 8:22 AM, Tyler Laing trinio...@gmail.com wrote: Okay, so if I understand you correctly, you say I should extract the SDL stuff from the object and use that instead of a Python object? I can do that. And... I do know how to use svn, but I've never made a branch in svn. How do I do that? -Tyler On Mon, May 18, 2009 at 3:18 PM, René Dudfield ren...@gmail.com wrote: hello, it's generally good to keep out python code from the main logic of your functions, if you can. Then try and keep the python wrapping function to interacting with python. That is keep the SDL parts and the python parts as separate as possible. The python wrapper part will use a call like so... surf = PySurface_AsSurface(surfobj); to get the SDL_Surface* surf surface, which you can then pass to your function. Since the life time of the surface is done with python, through reference counting. Each time you access the surface you should probably first increment a reference count, and then modify it, then decrement the reference count. Otherwise you might want to store a reference at initialisation time, then it should be fairly safe to access the surface. However, the display surface can disappear, so perhaps passing in a surface each time might be better. I hope maybe that helps answer your question... ps. be good to start a branch in svn to dump your code as you go :) Then we can all look at your code specifically. On Tue, May 19, 2009 at 8:02 AM, Tyler Laing trinio...@gmail.com wrote: Hello all, I've got a bit of a brainteaser for you, maybe, and hopefully not. Right now, through judicious use of ffplay code, I've got a large portion of the code written for a first draft version of the movie module. I changed the code where appropriate for our needs. Of course, that doesn't mean its been tested, or has even compiled yet. ;) However, I'm wondering which way I should go: Whether I should write to a pygame surface(say one passed on initialization), via the PySurface C methods, or to extract the rect and surface from the PySurface struct, and write to those instead. Which way would be safer/better/whatever? -Tyler Visit my blog at http://oddco.ca/zeroth/zblog -- Visit my blog at http://oddco.ca/zeroth/zblog
Re: [pygame] Working with Surfaces
On Tue, May 19, 2009 at 8:40 AM, René Dudfield ren...@gmail.com wrote: hi, svn copy svn://seul.org/svn/pygame/trunk svn://seul.org/svn/pygame/branches/tylerthemovie ^ this is supposed to be on one line
Re: [pygame] Working with Surfaces
There we go, Branch is made, and it is updated with all the code I've done today Thanks :) -Tyler On Mon, May 18, 2009 at 3:40 PM, René Dudfield ren...@gmail.com wrote: On Tue, May 19, 2009 at 8:40 AM, René Dudfield ren...@gmail.com wrote: hi, svn copy svn://seul.org/svn/pygame/trunk svn://seul.org/svn/pygame/branches/tylerthemovie ^ this is supposed to be on one line -- Visit my blog at http://oddco.ca/zeroth/zblog