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

Re[2]: [pygame] Using Direct3D for graphics and PyGame for everything else...

Hello Pete,

Friday, November 1, 2002, 11:26:48 AM, you wrote:

PS> Kerim Borchaev wrote:
>> How hard is it to combine use of Direct3D and PyGame?
>> Like use PyGame for creating application window than passing its
>> HWND(somehow obtained...) to Direct3D8::CreateDevice as focus window.
>> Using Pygame for event polling and d3d for rendering and presenting
>> graphics? 

PS> a more natural use would be pyopengl. i'm not sure if there is a way to use
PS> directx inside python?
I heard it is hard. So we're using it with C++.

PS> pyopengl is a full implementation of opengl. python
PS> code using it looks very similar to C opengl code.
Yes PyOpenGL is nice. But DirectX SDK is nice too. It's X-File format
support(exporters and loaders) and other features are very helpful for
fast start-up development.

PS> pygame already has some functions to allow you to initialize your window as
PS> an opengl display. you pass the OPENGL flag to set_mode(), plus there are
PS> other calls to choose other than default zbuffer depths and such.

PS> i should be able to add a pygame function to return the window id/handle.
PS> hmm, but now that i think about it i'll need to dig into SDL, i can't
PS> remember where/how that works. hmm, it looks like SDL actually cannot
PS> return this information. this might be a little tricky then..

We implemented a dirty hack via win32gui.FinWindow('pygame', None).

Best regards,
 Kerim                            mailto:warkid@hotbox.ru

Get free mailbox 20 Mb at http://www.hotbox.ru