[solved] Problems with render window

Eldritch

18-03-2007 20:26:01

I have embedded Mogre into a Form, but setting the display to 1024x768 creates a horribly pixelated view of all the objects I have in the scene. Here is the code I am using to create my render window:


// Create Mogre Root object.
m_refRoot = new Root();

// Load resources config.
LoadResourceConfig("resources.cfg");

// Create render window.
RenderSystem rs = m_refRoot.GetRenderSystemByName("Direct3D9 Rendering Subsystem");
m_refRoot.RenderSystem = rs;
rs.SetConfigOption("Full Screen", "No");
rs.SetConfigOption("Video Mode", "1024 x 768 @ 32-bit colour");
m_refRoot.Initialise(false, "Genuine Framework Demo"); // TODO: change this to read from language file
this.Text = "Genuine Framework Demo";
NameValuePairList misc = new NameValuePairList();
misc["externalWindowHandle"] = Handle.ToString();
m_refRenderWindow = m_refRoot.CreateRenderWindow("Main RenderWindow", 1024, 768, false, misc);
Width = 1024; Height = 768;
this.Size = new System.Drawing.Size(Width, Height);


It looks okey with 800x600, but that view is not really what I want. Also, is it possible to keep the config dialog and somehow extract the chosen resolution width and height (without having to parse the "Video Mode" string) ?

Ack! Found the problem. I forgot to add the resize event. Thought I would skip it to stop users from resizing the window... :roll: