示例#1
0
        public IrrlichtDevice(DriverType type, Dimension2D dim, int bits, bool fullscreen, bool stencil, bool vsync, bool antialias, IntPtr windowHandle)
        {
#if !QUIET
            Console.WriteLine("Irrlicht.NET v" + CPVersion + " running");
#endif
            Initialize(CreateDeviceA(type, dim.ToUnmanaged(), bits, fullscreen, stencil, vsync, antialias, windowHandle));
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
            MainNativeEvent = OnNativeEvent;
            Device_SetCallback(_raw, MainNativeEvent);
        }
示例#2
0
 /// <summary>
 /// Creates an empty texture
 /// </summary>
 /// <param name="size">Size of the teture</param>
 /// <param name="name">Name of the texture on the texture pool</param>
 /// <param name="fmt">Pixel format</param>
 /// <returns>The created texture</returns>
 public Texture AddTexture(Dimension2D size, string name, ColorFormat fmt)
 {
     return (Texture)
         NativeElement.GetObject(VideoDriver_AddTexture(_raw, size.ToUnmanaged(), name, fmt),
                                 typeof(Texture));
 }
示例#3
0
 public Texture CreateRenderTargetTexture(Dimension2D size)
 {
     return (Texture)
         NativeElement.GetObject(VideoDriver_CreateRenderTargetTexture(_raw, size.ToUnmanaged()),
                                 typeof(Texture));
 }
示例#4
0
 public virtual void SetMinSize(Dimension2D size)
 {
     GuiElem_SetMinSize(_raw, size.ToUnmanaged());
 }
示例#5
0
 /// <summary>
 /// Adds a static terrain mesh
 /// </summary>
 /// <returns>The static mesh</returns>
 /// <param name="name">Name of this mesh</param>
 /// <param name="texture">Image of the texture. Please notice that it is an Image, not a Texture, and it is supposed to be hardware-created</param>
 /// <param name="heightmap">Image of the heigthmap</param>
 /// <param name="stretchSize">How big a pixel on the image is rendered on the terrain</param>
 /// <param name="maxHeight">Maximal height</param>
 /// <param name="defaultVertexBlockSize">Should be (64,64)</param>
 public Mesh AddTerrainMesh(string name, Image texture, Image heightmap, Dimension2D stretchSize, float maxHeight, Dimension2D defaultVertexBlockSize)
 {
     return (Mesh)
         NativeElement.GetObject(SceneManager_AddTerrainMesh(_raw, name, texture.Raw, heightmap.Raw, stretchSize.ToUnmanaged(), maxHeight, defaultVertexBlockSize.ToUnmanaged()),
                                 typeof(Mesh));
 }
示例#6
0
 /// <summary>
 /// Creates a hill plane mesh (used for instance for any water)
 /// </summary>
 /// <returns>The mesh</returns>
 /// <param name="name">Name of this mesh</param>
 /// <param name="tileSize">Size of each tile from the mesh</param>
 /// <param name="tileCount">Number of tiles</param>
 /// <param name="hillHeight">Height of each hills</param>
 /// <param name="countHills">Number of hills</param>
 /// <param name="textureRepeatCount">Texture repeatition count</param>
 public AnimatedMesh AddHillPlaneMesh(string name, Dimension2Df tileSize, Dimension2D tileCount, float hillHeight, Dimension2Df countHills, Dimension2Df textureRepeatCount)
 {
     return (AnimatedMesh)
         NativeElement.GetObject(SceneManager_AddHillPlaneMesh(_raw, name, tileSize.ToUnmanaged(), tileCount.ToUnmanaged(), hillHeight, countHills.ToUnmanaged(), textureRepeatCount.ToUnmanaged()),
                                 typeof(AnimatedMesh));
 }