[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pygame] Re: pygame + pyopengl



On Sat, Apr 07, 2001 at 11:53:08PM -0700, Pete Shinners wrote:
> i saw your message left on IRC about checking into the opengl
> stuff on pygame. sounds like this one might be a little tougher
> to solve than i'd hoped.

For those who weren't on #pygame today:

I'm new to SDL and GL (and pygame too), but I figured that since SDL
claims to handle GL, if I wanted to use GL then pygame would be a fine
choice.  Unfortunately, I was disappointed.  Pete says he's been aware
this doesn't quite work yet, but that somewhere a few notches down on
his to-do list was looking at the pyopengl code to see if he could find
anything out there...

So I decided to go and do the looking, and look I did through pygame,
pyopengl, libSDL, and a bit of GLUT, and as far as I can tell, the GL
set-up stuff is entirely encapsulated by SDL.  The video mode, the
creation and selection of the context, it's all done when you set the
video mode with SDL with the OPENGL flag.  As I said, I'm new to this
codebase, but it looks to me like it *should* work.

What happens though is you just get a blank screen, no matter how many
glBegin/End/Vertex/etc things you do.  None of the GL calls give you
error messages, and I believe the GL hardware is kicking in (my screen
does some funky things when any GL app starts), but there's a distinct
lack of pretty pictures.

> pyopengl seems to think everything is setup (or does it?), but
> nothing will draw into the SDL window.

> btw, what platform were you running your tests under?

Debian GNU/Linux, kernel 2.4.3, libSDL 1.1.8, python 2.0, GL provided by
XFree86 4.0.2, Voodoo Banshee 3Dfx video hardware, pygame 1.0,
python-opengl 1.5.6.

> another test i want to run is to put some C functions in
> the pygame library that print out all the information it
> can about the current opengl context and whatnot. and then
> put some code into the pyopengl library that does the same
> thing. then compare the gl state between the two libraries.
> 
> anyways, thanks for the testing, i was wondering if there was
> any last insight you might have picked up while looking at the
> stuff.

Unfortunately not.  =(  After eyeballing the SDL code and determining that
the code that set the GL *should* be getting run, I put some debugging
statements in just to make sure, and sure enough, the context-setting
stuff is being run and returning without error.  So I still see no
problems there.

What I *haven't* done is dug into GL itself, to try to find out the whys
and whens of the actual drawing business.  That can of worms seems just
a little too big for me at the moment.

Let me know if you have any more ideas about where the sticky spots
might be.

  - Kevin

-- 
Kevin Turner <acapnotic@users.sourceforge.net> | OpenPGP encryption welcome here
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org