Example #1
0
 public IrrlichtDevice(DriverType type, Dimension2D dim, int bits, bool fullscreen, bool stencil, bool vsync, bool antialias, IntPtr windowHandle)
 {
     Console.WriteLine("Irrlicht.NET CP v" + CPVersion + " running");
     Initialize(CreateDeviceA(type, dim.ToUnmanaged(), bits, fullscreen, stencil, vsync, antialias, windowHandle));
     AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
     MainNativeEvent = OnNativeEvent;
     Device_SetCallback(_raw, MainNativeEvent);
 }
        public override void OnRegisterSceneNode()
        {
            if (Visible)
            {
                Position2D pm = smgr.CollisionManager.GetScreenCoordinatesFrom3DPosition(AbsolutePosition,
                                                        smgr.ActiveCamera);

                if (!ign_geom)
                {
                    SceneNode node = smgr.CollisionManager.GetSceneNodeFromScreenCoordinates(pm, 0, true);

                    if (node != this && node != this.Parent && node != null)
                    {
                        draw_flare = false;
                    }
                    else
                    {
                        draw_flare = true;
                    }
                }
                else
                {
                    draw_flare = true;
                }
                if (draw_flare)
                {
                screensize = smgr.VideoDriver.ScreenSize;
                    if (Rect.From(Position2D.From(0, 0), Position2D.FromUnmanaged(screensize.ToUnmanaged())).IsPointInside(pm))
                    {
                        smgr.RegisterNodeForRendering(this, SceneNodeRenderPass.Transparent);
                        base.OnRegisterSceneNode();

                    }
                }
            }
        }
Example #3
0
 public virtual void SetMinSize(Dimension2D size)
 {
     GuiElem_SetMinSize(_raw, size.ToUnmanaged());
 }
		public override void SetMinSize (Dimension2D size)
		{
			CGE_PVOID_METHODS(_raw, CGE_VOID_METHOD.SET_MIN_SIZE, IntPtr.Zero, 0, 0, size.ToUnmanaged());
		}
Example #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));
 }
Example #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));
 }
Example #7
0
 public Texture CreateRenderTargetTexture(Dimension2D size)
 {
     return (Texture)
         NativeElement.GetObject(VideoDriver_CreateRenderTargetTexture(_raw, size.ToUnmanaged()),
                                 typeof(Texture));
 }
Example #8
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));
 }