Problem whith DirectX device creation under pythonnet
Hello, I want to create a Directx 9.0 application with Python and Managed Directx. Here is the code: import CLR.System.Windows.Forms as WinForms from CLR.System.Drawing import Size, Point import CLR.Microsoft.DirectX import CLR.Microsoft.DirectX.Direct3D from CLR.Microsoft.DirectX import Matrix from CLR.Microsoft.DirectX.Direct3D import Device, PresentParameters, SwapEffect, DeviceType, CreateFlags class DirectXWindow(WinForms.Form): """A simple hello world app that demonstrates the essentials of winforms programming and event-based programming in Python.""" def CreateDevice(self): presentParams = PresentParameters() presentParams.Windowed = True presentParams.SwapEffect = SwapEffect.Discard device = Device(0, DeviceType.Hardware, self, CreateFlags.SoftwareVertexProcessing, presentParams) def __init__(self): self.Text = "DirectX Window" self.AutoScaleBaseSize = Size(100, 100) self.ClientSize = Size(400, 300); h = WinForms.SystemInformation.CaptionHeight self.MinimumSize = Size(392, (117 + h)) self.CreateDevice() def run(self): WinForms.Application.Run(self) def main(): DirectXWindow().run() if __name__ == '__main__': main() I have the error:
File "Directx.py", line 18, in CreateDevice TypeError: no constructor matches given arguments
Form the DirectX documentation, there are 3 constructors available: public Device (Int32, DeviceType, IntPtr, CreateFlags, PresentParameters) public Device (Int32, DeviceType, Control, CreateFlags, PresentParameters) public Device (IntPtr) The Int32 is the DeviceNum (0). DeviceType and CreateFlags are 2 enum. PresentParameters is a Structure. The 'help(Device)' does'nt work. How can I display all the signature of all constructors ? What is the problem ? Thanks for the help.
Laurent Caumont wrote:
Form the DirectX documentation, there are 3 constructors available: public Device (Int32, DeviceType, IntPtr, CreateFlags, PresentParameters) public Device (Int32, DeviceType, Control, CreateFlags, PresentParameters) public Device (IntPtr)
My Summer 2003 Managed Documentation only gives: Device (Int32, DeviceType, Control, CreateFlags, PresentParameters) Are you using the latest SDK and documentation? Not that it's any good... Cheers, www.indiegamedesign.com Brandon Van Every Seattle, WA "We live in a world of very bright people building crappy software with total shit for tools and process." - Ed Mckenzie
participants (2)
-
Brandon J. Van Every
-
Laurent Caumont