FullScreen with Forms

Irrlicht.Net is no longer developed or supported, Irrlicht.Net Cross Platform is a much more complete wrapper. Please ask your C# related questions on their forums first.
Locked
Firgor
Posts: 5
Joined: Mon Jan 02, 2006 8:31 pm
Location: Germany :)
Contact:

FullScreen with Forms

Post by Firgor »

Hey,

i have a question about fullscreen. Can i switch to a fullscreen mode with a form as a render screen and irrlicht .net? Only solution i found is the console application what is not nice. When i used a form and give the handle to Irrlicht i have always a small window. I can set maximize and hide the border of the form, but nothing helps... In Managed DirectX you can switch to a fullscreen mode, why not in irrlicht?
Ros
Posts: 30
Joined: Thu Jul 13, 2006 11:30 am
Contact:

Post by Ros »

it seams to me here possible to change fullscreen to windowscreen:

Code: Select all

IrrlichtDevice device = new IrrlichtDevice( 
				driverType, new Dimension2D(640, 480), 32, false, true, true); 
			if (device == null) 
			{ 
				tOut.Write("Device creation failed."); 
				return; 
			} 
Where is false make true.But!!! I don't now how possible use C# WinForm control here.I can advice some book for you if you use VS2005 C# Express Edition.With registration you can download this "Microsoft Visual C# 2005 Express Edition - Build a Program Now!"there is some examples about WinForms, buttons and chekboxes.


Maybe This will be helpfull? :lol:
Firgor
Posts: 5
Joined: Mon Jan 02, 2006 8:31 pm
Location: Germany :)
Contact:

Post by Firgor »

Thx for the answer, but i mean how can i switch Irrlicht to fullscreen?
When I set the form to fullscreen i have a normal maximized window. But in combination with Irrlicht i have also a normal maximized window, not a fullscreen DirectX screen.
The problem is that i can see the taskbar at the bottem in maximized window mode.

Have no one the same problems? Or lunched all peoples irrlicht as a console application with a dos box?
Ros
Posts: 30
Joined: Thu Jul 13, 2006 11:30 am
Contact:

Post by Ros »

hey man i understud u.!!!

i am bisy with tutorials of irrlicht.

And i have idea here tutorial 8:

http://www.irrforge.org/index.php/CS_Tutorial_14


here i think must came some changes and connect with maximize button.

Code: Select all


private void Form1_Load(object sender, EventArgs e)
        {
            // this is not necessarily the best place to load and 
            // initialise Irrlicht, however, it does work. 
            this.Show();
            runIrrlichtInWindowsFormTest(pictureBox1);
        }

        void runIrrlichtInWindowsFormTest(Control c)
        {
            device = new IrrlichtDevice(Irrlicht.Video.DriverType.DIRECT3D9,
               new Dimension2D(c.Width, c.Height),
               32, false, false, false, true, c.Handle);
actualy i'm now bisy with that do u have any idea?
Firgor
Posts: 5
Joined: Mon Jan 02, 2006 8:31 pm
Location: Germany :)
Contact:

Post by Firgor »

Thx again,

i test all parameters at

new IrrlichtDevice(...), but when i maximized the form and show the device i have no fullscreen window :(

I test it again, perhaps i make something wrong. Thanks for help.
Ros
Posts: 30
Joined: Thu Jul 13, 2006 11:30 am
Contact:

in window

Post by Ros »

I have some code for you
You mast make a windows aplication in visual c# 2005
then in program.cs set this one.

Code: Select all

using System;
using System.Xml;

using System.Collections.Generic;
using System.Windows.Forms;


using Irrlicht;
using Irrlicht.Video;
using Irrlicht.Core;
using Irrlicht.Scene;
using Irrlicht.GUI;

namespace game
{
    public partial class Engine : Form
    {     
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
           ////////////////////////Device///////////////////////////////////////////////////////
            
            IrrlichtDevice device = new IrrlichtDevice(DriverType.DIRECT3D, new Dimension2D(800, 600), 32, false
, false, true);
            device.ResizeAble = true;
            
            ISceneManager smgr = device.SceneManager;
            IVideoDriver driver = device.VideoDriver;
            IGUIEnvironment env = device.GUIEnvironment;

           // driver.SetTextureCreationFlag(TextureCreationFlag.ALWAYS_32_BIT, true);

 /////////////////////// add irrlicht logo //////////////////////////////////////////////
            env.AddImage(driver.GetTexture(logos + "irrlichtlogo.jpg"),
                new Position2D(10, 10), true, null, 0, ""); 
/////////////////////////camera////////////////////
            ICameraSceneNode camera = device.SceneManager.AddCameraSceneNodeFPS();
            camera.Position = new Vector3D(-50, 50, -150);

//////////////////////////////////// disable mouse cursor /////////////////////////////
            device.CursorControl.Visible = false; 
            
/////////////we add the skybox which we already used in lots of Irrlicht examples. 
            smgr.AddSkyBoxSceneNode(
                driver.GetTexture(maps + "irrlicht2_up.jpg"),
                driver.GetTexture(maps + "irrlicht2_dn.jpg"),
                driver.GetTexture(maps + "irrlicht2_lf.jpg"),
                driver.GetTexture(maps + "irrlicht2_rt.jpg"),
                driver.GetTexture(maps + "irrlicht2_ft.jpg"),
                driver.GetTexture(maps + "irrlicht2_bk.jpg"), null, 0);

            driver.SetTextureCreationFlag(TextureCreationFlag.CREATE_MIP_MAPS, true);  
            
//////////////model loading//////////////////////////////////////////////////////
            Irrlicht.Scene.IAnimatedMesh
            mesh = smgr.GetMesh(models + "sydney.md2");
            IAnimatedMeshSceneNode anode = smgr.AddAnimatedMeshSceneNode(mesh, null, 0);
            anode.Position = new Vector3D(-50, 50, -60);
            anode.Scale = new Vector3D(2, 2, 2);
            anode.SetMD2Animation(MD2AnimationType.STAND);
            anode.SetMaterialFlag(MaterialFlag.LIGHTING, false); 
            anode.SetMaterialTexture(0, driver.GetTexture(models + "sydney.BMP"));

            // add shadow 
            //anode.AddShadowVolumeSceneNode();
            //smgr.ShadowColor = new Color(220, 0, 0, 0);

            // make the model a little bit bigger and normalize its normals 
            // because of this for correct lighting 
            
            //anode.SetMaterialFlag(MaterialFlag.NORMALIZE_NORMALS, true); 
/////////////////////////////////////////////////////////////////////////////////            
           
            
            
            
////////////////////////////Window properties/////////////////////////////////////////////////////////////////////////
            int lastFPS = -1;

            while (device.Run())
            {
                if (device.WindowActive)
                {
                    device.VideoDriver.BeginScene(true, true, new Color(0, 200, 200, 250));
                    device.SceneManager.DrawAll();
                    device.VideoDriver.EndScene();

                    int fps = device.VideoDriver.FPS;
                    if (lastFPS != fps)
                    {
                        device.WindowCaption = "Loading... [" +
                            device.VideoDriver.Name + "] FPS:" + fps.ToString();
                        lastFPS = fps;
                    }
                }
            }


        }
    }
}
And rename Program.cs to Engine.cs :)
Ros
Posts: 30
Joined: Thu Jul 13, 2006 11:30 am
Contact:

Post by Ros »

Locked