예제 #1
0
        public static void Main(string[] args)
        {
            device = new IrrlichtDevice(DriverType.OpenGL, new Dimension2D(640, 480), 32, false, true, false, false);
            if (device == null)
            {
                System.Console.WriteLine("Device could not be created. Exiting.");
                return;
            }

            device.WindowCaption = "Hello World - 2D Graphics Demo";

            videoDriver = device.VideoDriver;
            sceneManager = device.SceneManager;
            guiEnvironment = device.GUIEnvironment;

            images = videoDriver.GetTexture("../../irrlicht/media/2ddemo.png");
            videoDriver.MakeColorKeyTexture(images, new Position2D(0, 0));

            font = guiEnvironment.BuiltInFont;
            font2 = guiEnvironment.GetFont("../../irrlicht/media/fonthaettenschweiler.bmp");

            device.OnEvent += new OnEventDelegate(device_OnEvent);

            while (device.Run())
            {
                RenderLoop();
            }

            device.Drop();
        }
        public TextSceneNode AddTextSceneNodeW(GUIFont font, string text, Color color, SceneNode parent)
        {
#if !LINUX
            return (TextSceneNode)
                NativeElement.GetObject(SceneManager_AddTextSceneNodeW(_raw, font.Raw, text, color.ToUnmanaged(), GetPtr(parent)),
                                        typeof(TextSceneNode));
#else
            return (TextSceneNode)
                NativeElement.GetObject(SceneManager_AddTextSceneNode(_raw, font.Raw, text, color.ToUnmanaged(), GetPtr(parent)),
                                        typeof(TextSceneNode));
#endif
        }
        public TextSceneNode AddBillboardTextSceneNodeW(GUIFont font, string text, SceneNode parent, Dimension2Df size, Vector3D position, int id, Color shade_top, Color shade_down)
        {
#if !LINUX
            return (TextSceneNode)
                NativeElement.GetObject(SceneManager_AddTextSceneNode2W(_raw, font.Raw, text, GetPtr(parent), size.ToUnmanaged(), position.ToUnmanaged(),
                                                                id, shade_top.ToUnmanaged(), shade_down.ToUnmanaged()),
                                        typeof(TextSceneNode));
#else
            return (TextSceneNode)
                NativeElement.GetObject(SceneManager_AddTextSceneNode2(_raw, font.Raw, text, GetPtr(parent), size.ToUnmanaged(), position.ToUnmanaged(),
                                                                id, shade_top.ToUnmanaged(), shade_down.ToUnmanaged()),
                                        typeof(TextSceneNode));
#endif
        }