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

Re: [pygame] Using Direct3D for graphics and PyGame for everythingelse...

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? 

a more natural use would be pyopengl. i'm not sure if there is a way to use
directx inside python? pyopengl is a full implementation of opengl. python
code using it looks very similar to C opengl code.

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

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

pygame mailing list