Thread: [PyOpenGL-Users] RE: Profiling PyOpenGL
Brought to you by:
mcfletch
|
From: Mike F. <mcf...@ho...> - 2001-10-12 01:21:01
|
Profiling the GLUT mainloop is rather difficult, as it's a C loop that only returns by executing a sys.exit (as mentioned by Georg). You can, however, profile a PyGame-hosted PyOpenGL project fairly readily (PyGame doesn't have a native-code mainloop and it's Python one(s) can easily return as a normal function would). I tested by forcing a request for a PyGame context in one of the OpenGLContext tests and then using profile.run to call MainLoop. Of course, swapping contexts is sometimes not an option, but if you're early in the project and PyGame is available on your platforms, using it might work for you. HTH, Mike BTW, posting to the SourceForge PyOpenGL list is probably the fastest way to get a response on PyOpenGL-specific questions like this. -----Original Message----- From: pyt...@py... [mailto:pyt...@py...]On Behalf Of Kerim Borchaev ( WarKiD ) Sent: October 11, 2001 04:03 To: pyt...@py... Subject: Profiling PyOpenGL Hello python-list, why can't I profile PyOpenGL application using profile module? ... but it prints nothing unless I remove glutMainLoop call. Best regards, Kerim mailto:wa...@st... -- http://mail.python.org/mailman/listinfo/python-list |
|
From: Mike F. <mcf...@ho...> - 2001-10-12 16:23:58
|
Sorry about the confusion:
OpenGLContext -> My little testing/demo project that tries to simplify
creating PyOpenGL projects. It supports a number of GUI libraries, with the
ability to choose which library is being used (== forcing the request, as
opposed to using the user's preferred GUI). It's available off the PyOpenGL
homepage.
PyGame -> A cross-platform game-development library which includes a basic
GUI environment. It can display an OpenGL context and is one of the GUI
libraries supported by OpenGLContext.
Here's what the phrase amounted to in real code:
from OpenGLContext import testingcontext
BaseContext, MainFunction = testingcontext.getInteractive( ('pygame',) )
# stuff that's the same as any of the
# OpenGLContext tests
...
# the other changed section
if __name__ == "__main__":
import profile
profile.run( "MainFunction ( TestContext)")
HTH,
Mike
-----Original Message-----
From: Kerim Borchaev ( WarKiD ) [mailto:wa...@st...]
Sent: October 12, 2001 04:19
To: Mike Fletcher
Cc: pyt...@py...; PyOpenGL (E-mail)
Subject: Re[2]: Profiling PyOpenGL
Thanks you (and Georg) for clarifying this glutMainLoop thing.
But I didn't quite understand this phrase:
> forcing a request for a PyGame context in one of the OpenGLContext
> tests
(sorry for sounding dumb but I'm just starting to learn (Py)OpenGl )
Best regards,
Kerim mailto:wa...@st...
...
|
|
From: K. B. ( W. ) <wa...@st...> - 2001-10-12 17:10:08
|
Hello Mike,
thanks a lot - it works for me. And now I know much more...
Best regards,
Kerim mailto:wa...@st...
Friday, October 12, 2001, 8:26:38 PM, you wrote:
MF> Sorry about the confusion:
MF> OpenGLContext -> My little testing/demo project that tries to simplify
MF> creating PyOpenGL projects. It supports a number of GUI libraries, with the
MF> ability to choose which library is being used (== forcing the request, as
MF> opposed to using the user's preferred GUI). It's available off the PyOpenGL
MF> homepage.
MF> PyGame -> A cross-platform game-development library which includes a basic
MF> GUI environment. It can display an OpenGL context and is one of the GUI
MF> libraries supported by OpenGLContext.
MF> Here's what the phrase amounted to in real code:
MF> from OpenGLContext import testingcontext
MF> BaseContext, MainFunction = testingcontext.getInteractive( ('pygame',) )
MF> # stuff that's the same as any of the
MF> # OpenGLContext tests
MF> ...
MF> # the other changed section
MF> if __name__ == "__main__":
MF> import profile
MF> profile.run( "MainFunction ( TestContext)")
MF> HTH,
MF> Mike
MF> -----Original Message-----
MF> From: Kerim Borchaev ( WarKiD ) [mailto:wa...@st...]
MF> Sent: October 12, 2001 04:19
MF> To: Mike Fletcher
MF> Cc: pyt...@py...; PyOpenGL (E-mail)
MF> Subject: Re[2]: Profiling PyOpenGL
MF> Thanks you (and Georg) for clarifying this glutMainLoop thing.
MF> But I didn't quite understand this phrase:
>> forcing a request for a PyGame context in one of the OpenGLContext
>> tests
MF> (sorry for sounding dumb but I'm just starting to learn (Py)OpenGl )
MF> Best regards,
MF> Kerim mailto:wa...@st...
MF> ...
|
|
From: K. B. ( W. ) <wa...@st...> - 2001-10-12 08:20:08
|
Thanks you (and Georg) for clarifying this glutMainLoop thing. But I didn't quite understand this phrase: > forcing a request for a PyGame context in one of the OpenGLContext > tests (sorry for sounding dumb but I'm just starting to learn (Py)OpenGl ) Best regards, Kerim mailto:wa...@st... Friday, October 12, 2001, 5:23:38 AM, you wrote: MF> Profiling the GLUT mainloop is rather difficult, as it's a C loop that only MF> returns by executing a sys.exit (as mentioned by Georg). You can, however, MF> profile a PyGame-hosted PyOpenGL project fairly readily (PyGame doesn't have MF> a native-code mainloop and it's Python one(s) can easily return as a normal MF> function would). I tested by forcing a request for a PyGame context in one MF> of the OpenGLContext tests and then using profile.run to call MainLoop. MF> Of course, swapping contexts is sometimes not an option, but if you're early MF> in the project and PyGame is available on your platforms, using it might MF> work for you. MF> HTH, MF> Mike MF> BTW, posting to the SourceForge PyOpenGL list is probably the fastest way to MF> get a response on PyOpenGL-specific questions like this. MF> -----Original Message----- MF> From: pyt...@py... MF> [mailto:pyt...@py...]On Behalf Of Kerim Borchaev ( MF> WarKiD ) MF> Sent: October 11, 2001 04:03 MF> To: pyt...@py... MF> Subject: Profiling PyOpenGL MF> Hello python-list, MF> why can't I profile PyOpenGL application using profile module? MF> ... MF> but it prints nothing unless I remove glutMainLoop call. MF> Best regards, MF> Kerim mailto:wa...@st... MF> -- MF> http://mail.python.org/mailman/listinfo/python-list |