Re: [pygame] Resolution for a 2d game

2011-05-15 Thread Forrest Voight
Then query the monitor sizes using pygame.display.list_modes or make it a configurable option, and use math that works independently of the resolution. On Sun, May 15, 2011 at 3:37 PM, BIAGINI wrote: > So my game will run in 640*480... I m not sure to understand. I really want > to make my game

Re: [pygame] converting "object position" to "view position" in (py)opengl

2009-07-03 Thread Forrest Voight
ure which one is rows and cols from c++ to python. > Also, when I draw the quad at the object's center, do I need to do a > glTranslatef? I'm guessing I do, right? > Thanks again. > Astan > > Forrest Voight wrote: > > I meant after the modelview matrix was tr

Re: [pygame] converting "object position" to "view position" in (py)opengl

2009-07-02 Thread Forrest Voight
; also, you lost me at your last sentence...I have no idea what that means but > I'll google around. > thanks again > > Forrest Voight wrote: > > When are you doing the gluProject? It should be after the matrices are > set for the frame. Can you paste the code for that? &g

Re: [pygame] converting "object position" to "view position" in (py)opengl

2009-07-02 Thread Forrest Voight
When are you doing the gluProject? It should be after the matrices are set for the frame. Can you paste the code for that? To billboard text, you'd render it to a texture. Something like: surface = self.font.render(s, True, (255, 255, 255)) gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, surface.get_w

Re: [pygame] converting "object position" to "view position" in (py)opengl

2009-07-01 Thread Forrest Voight
The Python syntax defaults to the current matrices, so you only need the 3 coordinates. On 7/1/09, Ian Mallett wrote: > Er, the last three arguments return the data in C. In Python, the syntax is > different: > > C: gluProject(objx,objy,objz,model,proj,view,winx,winy,winz) > Python: winx,winy,wi

Re: [pygame] converting "object position" to "view position" in (py)opengl

2009-07-01 Thread Forrest Voight
The z doesn't matter, but the x and y are pixel coordinates like pygame.mouse.get_pos(). Also, gluProject has defaults for the last 3 params, so they aren't needed. On Wed, Jul 1, 2009 at 3:10 AM, Astan Chee wrote: > Thanks for that. How do I convert x,y,z to the x,y coordinates of a pygame > sur

Re: [pygame] converting "object position" to "view position" in (py)opengl

2009-06-30 Thread Forrest Voight
g would be easiest. On Wed, Jul 1, 2009 at 1:19 AM, Astan Chee wrote: > Also, I'm trying not to use glu or glut functions. > > Forrest Voight wrote: > > Why does the cross-section matter? > > Just display it at the object's center... > > On Wed, Jul 1, 2009 at 1:0

Re: [pygame] converting "object position" to "view position" in (py)opengl

2009-06-30 Thread Forrest Voight
Why does the cross-section matter? Just display it at the object's center... On Wed, Jul 1, 2009 at 1:01 AM, Astan Chee wrote: > Yes, this is what I'm trying to do but how do I calculate cross-section of > the object at a given distance? > Thanks again > > Tyler Laing wrote: > > Hmm, I'm not 100%

Re: [pygame] converting "object position" to "view position" in (py)opengl

2009-06-30 Thread Forrest Voight
I would just billboard a texture with the text at the object's center with DEPTH_TEST disabled, so it draws over it. See http://www.lighthouse3d.com/opengl/billboarding/index.php3?billCheat Alternatively, you could use gluProject to get the window coordinates of the object's center, but I think i

Re: [pygame] VideoCapture, PIL, and PyGame

2009-06-14 Thread Forrest Voight
Why not just reverse the string in order to do the BGR->RGB conversion? This will also vertically and horizontally flip it, so you'll just need to horizontally flip it. On Sun, Jun 14, 2009 at 2:25 AM, René Dudfield wrote: > hi, > > take a look at svn pygame.  There is an implementation of > pygam

Re: [pygame] vector type: mutable or immutable

2009-05-05 Thread Forrest Voight
I'm for immutable. I used numpy arrays as vectors for a while but had all kinds of bugs. I can't think of any use case for mutable vectors. In reference to sharing a mutable vector to syncronize objects, there are much better ways to do that. What happens if each object's update method changes pos

Re: [pygame] A* module using surfaces for walkability data

2009-03-27 Thread Forrest Voight
> I guess in pygame.pathfinding ? It'd probably be part of the AI module. > I guess you'd want a way of determining which pixels are path, and > which are not.  Either a color key, or color range.  In a lot of maps, > there are multiple colors which are path... and multiple colors which > are bloc

Re: [pygame] Re: weird problem with pygame.mouse.get_pos() and print

2009-03-26 Thread Forrest Voight
Then why'd he have that effect in the original message? On Thu, Mar 26, 2009 at 6:51 PM, Ian Mallett wrote: > On Thu, Mar 26, 2009 at 3:40 PM, Forrest Voight wrote: >> >> print pumps the queue? Why would it do that? > > It doesn't.  pygame.event.get() empties the list, returning the events. > >

Re: [pygame] Re: weird problem with pygame.mouse.get_pos() and print

2009-03-26 Thread Forrest Voight
print pumps the queue? Why would it do that? On Fri, Mar 6, 2009 at 11:39 PM, Ian Mallett wrote: > Cool--yeah I'd recommend looking into events and event processing. > > As I understand it, when things happen (mouse moves, press button, etc.), > they're added to the event queue.  If you don't ret

Re: [pygame] multi-width aalines and aacircles

2009-03-23 Thread Forrest Voight
One idea was to bind SDL_gfx ... there's a patch for a binding a few months back on this list. On Mon, Mar 23, 2009 at 12:41 PM, Thiago Chaves wrote: > I'd be very happy to see those too, specially because I've been doing > lots of drawing with primitives on SSoF. =D > > -Thiago > > On Mon, Mar 2

Re: [pygame] Re: a gsoc idea: networking

2009-03-21 Thread Forrest Voight
You need a centralized server ... even if all it does is provide the addresses of several hosts. How else would you find even one host? On Thu, Mar 19, 2009 at 7:27 PM, Michael George wrote: > Tyler Laing wrote: >> >> Haha, point taken. Sorry about that. As a student, I think that one or >> the o

Re: [pygame] Python - Pygame - PyOpenGL performance

2009-03-16 Thread Forrest Voight
ry sprite. It > makes a lot of sense to me that this would be the case in other languages as > well. > > -Zack > > On Mar 16, 2009, at 1:00 PM, Forrest Voight wrote: > >> Would writing a replacement for PyOpenGL in C instead of in Python >> with ctypes help? I think

Re: [pygame] Python - Pygame - PyOpenGL performance

2009-03-16 Thread Forrest Voight
Would writing a replacement for PyOpenGL in C instead of in Python with ctypes help? I think it really would ... PyOpenGL is internally pretty complex, sometimes when I get tracebacks the error is 5 or 6 levels into PyOpenGL. Even a C library that only implemented the common functions and relied on

Re: [pygame] SDL_gfx integration

2008-11-17 Thread Forrest Voight
hon.org/c-api/sequence.html) and I do > that if there is an error before returning the exception. > > If I'm missing something about the refcounting and I DO have a memory leak > then doesn't the same memory leak apply to the original implementation in > case the very first >

Re: [pygame] SDL_gfx integration

2008-11-01 Thread Forrest Voight
so think that vert/horiz lines could be dropped. > > //Lorenz > > > > On Mon, 27 Oct 2008 23:03:32 -0400, "Forrest Voight" <[EMAIL PROTECTED]> > wrote: >> Lorenz: the polygon function is almost a direct copy from draw.c and >> your way creates a

Re: [pygame] Patch - Re-add music support for file-like objects

2008-10-30 Thread Forrest Voight
! > > Committed revision 1524. > > cu, > > On Mon, Jul 21, 2008 at 12:26 PM, Forrest Voight <[EMAIL PROTECTED]> wrote: >> Fixed both Brian and I's deadlocking problem. >> >> Biran's program works all the way up to the last music (house_lo.mp3)

Re: [pygame] SDL_gfx integration

2008-10-27 Thread Forrest Voight
) >>> respectively >>> I find this grouping not very intuitive. normally we group a pair of x >>> and y >>> coordinates which makes sense because they represent one point but I >>> can't see >>> such an interpretation here. one could argue t

Re: [pygame] SDL_gfx integration

2008-10-25 Thread Forrest Voight
Hi! I'm posting the patch at http://im.forre.st/pygame-sdl_gfx.diff , so that won't happen again. It's pretty much a full binding of the shape drawing functions, but there's some other stuff in SDL_gfx. I think there is some kind of licensing problem, I'm not sure. There was talk about putting

Re: [pygame] pygame on iPhone

2008-10-04 Thread Forrest Voight
It seems the NDA was dropped, just a little while ago, FYI. On Fri, Oct 3, 2008 at 7:22 AM, Greg Ewing <[EMAIL PROTECTED]> wrote: > Jack Nutting wrote: > >> However, the fact is that what you *can* write with, Objective-C, is >> not too shabby at all. > > You can write it, and maybe run it on your

Re: [pygame] surfarray.pixels3d() bug?

2008-09-30 Thread Forrest Voight
You're probably doing something wrong. It helps a lot to post code samples. :) On Tue, Sep 30, 2008 at 3:18 PM, Mark S <[EMAIL PROTECTED]> wrote: > Hi all, > > I am trying to use surfarray.pixels3d() to copy a surface to an array but it > doesn't seem to be working properly. If I call that functi

[pygame] Proposal - Improved Version Checks

2008-09-29 Thread Forrest Voight
Version checks like this are very bad: #if MIX_MAJOR_VERSION>=1 && MIX_MINOR_VERSION>=2 && MIX_PATCHLEVEL>=3 (line 98 src/music.c) This is a proposal to fix them. They would be changed to something like this: #if MIX_VERSION_ATLEAST(1, 2, 3) All that needs to be done to implement this is to ad

Re: [pygame] pygame web plugin

2008-09-10 Thread Forrest Voight
> also, i frogot to suggest that we build ClamAV into PWS for virus scanning of > the python program Umm... I'm really not sure how to respond to this.

Re: [pygame] pygame web plugin

2008-09-08 Thread Forrest Voight
PyGame isn't really built for untrusted code... there are many ways to crash PyGame if you are intent on it... PyGame and Python weren't meant at all for web apps. On Mon, Sep 8, 2008 at 2:22 AM, Bob Ippolito <[EMAIL PROTECTED]> wrote: > On Sun, Sep 7, 2008 at 1:56 PM, Ron Dippold <[EMAIL PROTECT

Re: [pygame] problem - movie in pygame

2008-09-03 Thread Forrest Voight
I think PyGame could use a new movie module... a binding of libavcodec probably. For one of my games, I gave up and decided to write my own video codec in Cython instead of messing with PyMedia. On Wed, Sep 3, 2008 at 8:16 PM, bhaaluu <[EMAIL PROTECTED]> wrote: > I run a Debian GNU/Linux system,

Re: SDL_gfx todo. Re: [pygame] Transparency and pygame.draw

2008-08-27 Thread Forrest Voight
PM, René Dudfield <[EMAIL PROTECTED]> wrote: > On Wed, Aug 27, 2008 at 12:16 PM, Forrest Voight <[EMAIL PROTECTED]> wrote: >> Thanks, I'll help with that soon... >> > > cool. > >> You're planning on including the SDL_gfx codebase in pygame?

Re: SDL_gfx todo. Re: [pygame] Transparency and pygame.draw

2008-08-26 Thread Forrest Voight
sing the gfx module. > - any bugfixes in the pygame draw/transform code should go into gfx module. > - a review by other developers of code, and docs. > > > cheers, > > > > On Tue, Aug 19, 2008 at 2:08 PM, Forrest Voight <[EMAIL PROTECTED]> wrote: >> I might hav

Re: [pygame] The Giant - 'cool project I'm working on now' - thread.

2008-08-08 Thread Forrest Voight
Opencraft, a Starcraft clone. http://forre.st/opencraft Still pretty simple, but all of the graphics are done. Just lots of logic and networking left :( On Fri, Aug 8, 2008 at 12:27 PM, Dan Krol <[EMAIL PROTECTED]> wrote: > My friends commissioned me to write a 2D engine for a platforming game >

Re: [pygame] Old pygame tutorial not working

2008-08-04 Thread Forrest Voight
Here is a decorator that speeds up a function using screen lists: def screen_list(func): func.sl = None def x(): if not func.sl: func.sl = glGenLists(1) glNewList(func.sl, GL_COMPILE) func() glEndList() glCallList(func.sl)

Re: [pygame] No pygame.mixer.Sound.get_current()?

2008-07-30 Thread Forrest Voight
There is no function that does this, but if there was it would be in pygame.mixer.Channel. Sounds are immutable. They each just the data of the sound. Also, pygame.mixer.music has functions for getting the position and seeking. On Tue, Jul 29, 2008 at 10:51 PM, Tyler Distad <[EMAIL PROTECTED]> w

Re: [pygame] problem - out of frequency

2008-07-22 Thread Forrest Voight
You can't change the frequency, but that should not be even related to pygame. What kind of problem are you having? Changing the frequency is not going to help (unless it is something weird like aliasing). On Tue, Jul 22, 2008 at 11:50 AM, pesvieira <[EMAIL PROTECTED]> wrote: > Hi. > > I have a p

Re: [pygame] Patch - Re-add music support for file-like objects

2008-07-20 Thread Forrest Voight
xer. On Sun, Jul 20, 2008 at 9:55 PM, Forrest Voight <[EMAIL PROTECTED]> wrote: > For the deadlock on reloading a sound, I'm working on it, I earlier > discovered the problem (threaded rwops deadlocks on exception in > file-like due to bug). > > For the mp3 not loading,

Re: [pygame] Patch - Re-add music support for file-like objects

2008-07-20 Thread Forrest Voight
For the deadlock on reloading a sound, I'm working on it, I earlier discovered the problem (threaded rwops deadlocks on exception in file-like due to bug). For the mp3 not loading, it is another magic problem. It is not an ID3 tag but some other weird header not caught. The MID file doesn't play

Re: [pygame] Patch - Re-add music support for file-like objects

2008-07-16 Thread Forrest Voight
. On Wed, Jul 16, 2008 at 9:55 PM, Forrest Voight <[EMAIL PROTECTED]> wrote: > I installed 1.2.8 and confirm OGG, MP3, MID and MOD are working. > > On Wed, Jul 16, 2008 at 9:09 PM, Brian Fisher <[EMAIL PROTECTED]> wrote: >> I've tested loading MP3 and OGG as music fro

Re: [pygame] Patch - Re-add music support for file-like objects

2008-07-16 Thread Forrest Voight
ave successfully loaded MP3, OGG & MID from > a file using pygame over SDL_Mixer 1.2.8? If so, what platforms and what > specific music files? > > > On Wed, Jul 16, 2008 at 5:36 PM, Forrest Voight <[EMAIL PROTECTED]> wrote: >> >> I think it should be >=1.2.8. >> There is support for MP3, OGG, MID, and MOD in 1.2.8. All 1.2.9 will add >> is WAV. >> > >

Re: [pygame] Patch - Re-add music support for file-like objects

2008-07-16 Thread Forrest Voight
ion checks are > in... there's that pygame.movie bug report to check out too. > > > cu, > > > On Thu, Jul 17, 2008 at 6:16 AM, Forrest Voight <[EMAIL PROTECTED]> wrote: >> Rene: Why'd you change the version check and why did you change it like this? >&g

Re: [pygame] Patch - Re-add music support for file-like objects

2008-07-16 Thread Forrest Voight
en when SDL_mixer 1.3.0 comes out? On Tue, Jul 15, 2008 at 12:35 AM, Brian Fisher <[EMAIL PROTECTED]> wrote: > sweet, you rock. > > > On Mon, Jul 14, 2008 at 9:27 PM, Forrest Voight <[EMAIL PROTECTED]> wrote: >> >> I submitted a patch to SDL_mixer to fix the mp3

Re: [pygame] Obtain actual volume of sample being played

2008-07-15 Thread Forrest Voight
und object from a .wav file, or > from a sndarray object, but I don't see how you can access the backing > sndarray from a .wav Sound... > > Sorry if I am missing something obvious. > > Cheers > > Forrest Voight wrote: >> >> You could access a sndarray and av

Re: [pygame] Obtain actual volume of sample being played

2008-07-15 Thread Forrest Voight
You could access a sndarray and average the current portion of it. You could probably even use numpy to do a fourier transform on it. On Tue, Jul 15, 2008 at 12:26 PM, Wyatt Olson <[EMAIL PROTECTED]> wrote: > Hello, > > Does anyone know if it is possible to obtain the actual volume of the sample

Re: [pygame] Patch - Re-add music support for file-like objects

2008-07-14 Thread Forrest Voight
ed for loading from file-likes -- so all tests > pass again (at least they do here). > > cheers, > > > > On Sun, Jul 13, 2008 at 6:58 AM, Forrest Voight <[EMAIL PROTECTED]> wrote: >> I'm also able to play FLAC audio. >> >> I think the problem is that SD

Re: [pygame] image-loading path

2008-07-14 Thread Forrest Voight
Yes, but the path is relative to where you are running the script from, not where the script is. On Mon, Jul 14, 2008 at 11:43 AM, Olaf Nowacki <[EMAIL PROTECTED]> wrote: > hi everyone, > is it possible to load an image with pygame.image.load() that is not in the > same folder (or a subfolder), bu

Re: [pygame] Patch - Re-add music support for file-like objects

2008-07-12 Thread Forrest Voight
on my Mac though, and it just seemed to hang :( I don't have a > mod file to try at the moment. > > So Forrest, what formats were you able to load when you were testing the > patch? > > > On Sat, Jul 12, 2008 at 12:13 PM, Forrest Voight <[EMAIL PROTECTED]> wrote: >

Re: [pygame] Patch - Re-add music support for file-like objects

2008-07-12 Thread Forrest Voight
some MP3 files work and some don't. I was able to find an MP3 file without tags and it worked. This is an SDL_mixer bug. On Sat, Jul 12, 2008 at 4:44 PM, Forrest Voight <[EMAIL PROTECTED]> wrote: > Using SDL_mixer SVN, I'm able to load & play WAV and OGG. > > MP3 gives

Re: [pygame] Patch - Re-add music support for file-like objects

2008-07-12 Thread Forrest Voight
se of 1.2? > > > On Sat, Jul 12, 2008 at 9:27 AM, Forrest Voight <[EMAIL PROTECTED]> wrote: >> >> The current sdl_mixer svn only supports mikmod. The svn version >> supports all of those formats. >> >> On Sat, Jul 12, 2008 at 4:55 AM, René Dudfield <[E

Re: [pygame] Patch - Re-add music support for file-like objects

2008-07-12 Thread Forrest Voight
;[EMAIL PROTECTED]> wrote: >> Cool, thanks. >> >> Committed revision 1482. >> >> On Wed, Jul 9, 2008 at 12:39 PM, Forrest Voight <[EMAIL PROTECTED]> wrote: >>> All we need to do is make RwopsFromPythonThreaded not try to make a >>> standar

Re: [pygame] Patch - Re-add music support for file-like objects

2008-07-08 Thread Forrest Voight
om it. With _file-like_ objects, the rwops does keep a reference to the object, and everything is fine. This issue is fixed in the above patch. Anyway, this patch will help enormously, making things like streaming music and movie players possible. On Tue, Jul 8, 2008 at 10:39 PM, Forrest Voight &l

Re: [pygame] Patch - Re-add music support for file-like objects

2008-07-08 Thread Forrest Voight
er than it takes for the load function to return. >> >> >> >> On Tue, Jul 8, 2008 at 3:20 PM, René Dudfield <[EMAIL PROTECTED]> wrote: >>> >>> Cool, thanks. I'll try and patch it tonight (+ 9 hours). >>> >>> cu, >>> >&

Re: [pygame] Patch - Re-add music support for file-like objects

2008-07-08 Thread Forrest Voight
, Jul 8, 2008 at 11:09 AM, Forrest Voight <[EMAIL PROTECTED]> wrote: > I did the version checks. > > There are currently no tests for pygame.mixer.music, but I'll try to > make a test for this. > > Also, I found a bug in rwobject. It makes a standard SDL_RWops from >

Re: [pygame] Patch - Re-add music support for file-like objects

2008-07-08 Thread Forrest Voight
thing like: pygame.mixer.music.load(open('x.mp3')) Then playing it, and pygame crashes. This is not my patch's fault, it just exposes it. Forrest Voight On Tue, Jul 8, 2008 at 2:08 AM, René Dudfield <[EMAIL PROTECTED]> wrote: > hi, > > I think this will have to wait until we put th

Re: [pygame] 1.8.1rc1 coming soon... any last minute patches?

2008-07-02 Thread Forrest Voight
Any chance the music from python file-like objects can go in? See conversation "Patch - Re-add music support for file-like objects" for it. Forrest On Wed, Jun 25, 2008 at 8:41 PM, Lamonte(Scheols/Demonic) <[EMAIL PROTECTED]> wrote: > pygame 1.9 pff I'm waiting for Pygame 2.0 B-) > > On Wed, Jun

Re: [pygame] Re: Patch to add SDL_gfx support to pygame

2008-06-26 Thread Forrest Voight
esome!" as well. > > Lenard > > > René Dudfield wrote: >> >> awesome! >> >> I haven't seen this before... Maybe the other email didn't make it to >> the mailing list? >> >> Can you please resend the patch? >> >> cheers,

Re: [pygame] Patch - Re-add music support for file-like objects

2008-06-17 Thread Forrest Voight
= os.path.join('..', 'examples', 'data') >> #note, I just added house_lo.ogg to svn. >> oggfn = os.path.join(data_fname, 'house_lo.ogg') >> >> pygame.mixer.music.load(oggfn) >> pygame.mixer.music.load(open(oggfn)) >> o

[pygame] Re: Patch to add SDL_gfx support to pygame

2008-06-17 Thread Forrest Voight
Any interest in this? Shapes with alpha blending would be very nice for simple games. On Sat, Jun 14, 2008 at 10:22 PM, Forrest Voight <[EMAIL PROTECTED]> wrote: > This patch adds complete support for SDL_gfx primitive drawing to > pygame. It adds a new module named gfx which has ma

Re: [pygame] Patch - Re-add music support for file-like objects

2008-06-13 Thread Forrest Voight
Thanks! On Fri, Jun 13, 2008 at 7:31 PM, Lenard Lindstrom <[EMAIL PROTECTED]> wrote: > This is interesting. I am having a look at it. No promise it can go into > 1.8.1 though as this is supposed to be a bug fix. > > Lenard > > > Forrest Voight wrote: >> >>

[pygame] Patch - Re-add music support for file-like objects

2008-06-12 Thread Forrest Voight
This patch re-adds support for playing (and queueing) music from python file-like objects. While support for WAV music streams is still in SDL_mixer svn, there is support for mp3, mikmod and other formats already. Cheers, Forrest music.diff Description: Binary data