Irrlicht Lime is a .NET wrapper for Irrlicht Engine

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
EagleEye
Posts: 6
Joined: Thu Jul 14, 2011 9:02 pm

Re: Irrlicht Lime is a .NET wrapper for Irrlicht Engine

Post by EagleEye »

Okay. Thank you. :)
RaymondEllis
Posts: 2
Joined: Fri Jun 22, 2012 8:22 am

Re: Irrlicht Lime is a .NET wrapper for Irrlicht Engine

Post by RaymondEllis »

TextBoxs on second windows.form?

I have Irrlicht Lime running in it's default form or one I created. Then Iv got a from that opens on the side of the render form.
The TextBoxs I put on the other form don't work properly. (can't type anything) unless I show the form with .ShowDialog
The TextBoxs are getting focus and are getting KeyDown & KeyUp but no KeyPress.

Anybody got any ideas so I don't have to have it as a dialog?
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Re: Irrlicht Lime is a .NET wrapper for Irrlicht Engine

Post by greenya »

Well, need to test that and say my diagnosis. But that is very likely, since Irrlicht dispatches the events in its own way. For now i can say for sure that for example if you have Irrlicht rendering window inside your form (i mean you create Irrlicht device providing window handle) your FPS camera will not be able to receive mouse events, and this is the same behavior for native Irrlicht + Win32 usage too.
RaymondEllis
Posts: 2
Joined: Fri Jun 22, 2012 8:22 am

Re: Irrlicht Lime is a .NET wrapper for Irrlicht Engine

Post by RaymondEllis »

greenya wrote:if you have Irrlicht rendering window inside your form (i mean you create Irrlicht device providing window handle) your FPS camera will not be able to receive mouse events, and this is the same behavior for native Irrlicht + Win32 usage too.
Using:

Code: Select all

Dim frmRender As new Form
sub main()
        frmRender.Show()
        Dim deviceParamerters As New IrrlichtCreationParameters
        deviceParamerters.DriverType = DriverType.Direct3D9
        deviceParamerters.WindowID = frmRender.Handle
        Device = IrrlichtDevice.CreateDevice(deviceParamerters)
 
I still get mouse & keyboard events through Irrlicht Lime.

I was able to get it working using:

Code: Select all

Dim t As New Threading.Thread(Sub()
                             Application.Run(New ApplicationContext(New Form))
                             End Sub)
t.SetApartmentState(Threading.ApartmentState.STA)
t.Start()
vs
Dim frm As Form
frm.Show()
Witch likely isn't the best way to do it. But it seems to work. :roll:
Revan1985
Posts: 89
Joined: Tue May 08, 2007 4:11 pm
Location: Italy

Re: Irrlicht Lime is a .NET wrapper for Irrlicht Engine

Post by Revan1985 »

i see that you have also a nuget package.
Why it's not updated?
CPU: AMD PHENOMII X6 1090T BE 3,2GHZ
RAM : OCZ 8GB 2*4GB DDR3 LOW VOLTAGE 1333
VGA: GeForce GTX680 2GB
HD : 500GB + 500GB + 2x1TB Raid Edition + 500GB External
Motherboard: ASUS CROSSHAIR FORMULA 4 890FX AM3
PSU: Corsair 750W
CPU Cooling: Katana 2
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Re: Irrlicht Lime is a .NET wrapper for Irrlicht Engine

Post by greenya »

Well, i haven't made any nuget packages, and didn't know about its existence for Irrlicht Lime until you said. I will try to contact the author and ask to update it.
rubenwardy
Posts: 91
Joined: Mon Mar 05, 2012 4:51 pm
Location: Bristol, UK
Contact:

Re: Irrlicht Lime is a .NET wrapper for Irrlicht Engine

Post by rubenwardy »

When I do this code,

Code: Select all

Dim node = scenepanel.device.SceneManager.AddLightSceneNode(Nothing, New IrrlichtLime.Core.Vector3Df(-5, 5, 10))
        scenepanel.ChangeSelected(node)
        Dim billboard As IrrlichtLime.Scene.BillboardSceneNode = scenepanel.device.SceneManager.AddBillboardSceneNode(node)
        Dim light_text As Video.Texture
        Try
            If My.Computer.FileSystem.FileExists("textures/editor_defaults/grass1.jpg") = False Then
                log.print("Texture File does not exist: textures/editor_defaults/default_light.jpg")
                Exit Try
            End If
 
            light_text = scenepanel.device.VideoDriver.GetTexture("textures/editor_defaults/grass1.jpg")      <--- error here
            billboard.SetMaterialTexture(0, light_text)
        Catch ex As Exception
 
        End Try
        
        billboard.SetMaterialType(Video.MaterialType.TransparentAddColor)
        billboard.SetMaterialFlag(Video.MaterialFlag.Lighting, False)
(https://github.com/rubenwardy/Irrlicht- ... nel.vb#L50)

A System.AccessViolationException happens in the function called on the above noted line.

The full error description is this:

Code: Select all

System.AccessViolationException was unhandled
  Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
  Source=IrrlichtLime
  StackTrace:
       at IrrlichtLime.Video.VideoDriver.GetTexture(ReadFile file) in c:\users\grinevich\documents\visual studio 2010\projects\irrlichtlime.svn\trunk\source\videodriver.cpp:line 1248
       at Multa_Map_Editor.menupanel.LightToolStripMenuItem_Click(Object sender, EventArgs e) in C:\Users\Andrew\Documents\Visual Studio 2010\Projects\Multa Map Editor\Multa Map Editor\menupanel.vb:line 45
       at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
       at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
       at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
       at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
       at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
       at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
       at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
       at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.ToolStrip.WndProc(Message& m)
       at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at Multa_Map_Editor.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 
 
And line 1248 is this:

Code: Select all

Texture^ VideoDriver::GetTexture(String^ filename)
{
    video::ITexture* t = m_VideoDriver->getTexture(Lime::StringToPath(filename));    <-- Line 1248 is here
    return Texture::Wrap(t);
}

My projects complete code: https://github.com/rubenwardy/Irrlicht-Map-Editor
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Re: Irrlicht Lime is a .NET wrapper for Irrlicht Engine

Post by greenya »

Hello.
I don't see any problem with the code. If texture file doesn't exist GetTexture will simply return null (Empty in terms of VB if i'm correct).
Please provide "grass1.jpg", maybe it is a key to crashing app.
Do you have this problem with any texture or only with particular like "grass1.jpg"?
Also maybe some problems with access rights to file in your OS, not sure about that.
rubenwardy
Posts: 91
Joined: Mon Mar 05, 2012 4:51 pm
Location: Bristol, UK
Contact:

Re: Irrlicht Lime is a .NET wrapper for Irrlicht Engine

Post by rubenwardy »

greenya wrote:Hello.
I don't see any problem with the code. If texture file doesn't exist GetTexture will simply return null (Empty in terms of VB if i'm correct).
Please provide "grass1.jpg", maybe it is a key to crashing app.
Do you have this problem with any texture or only with particular like "grass1.jpg"?
Also maybe some problems with access rights to file in your OS, not sure about that.
I also tried loading .png and other .jpg files, but they do not work.

I tried giving the GetTexture function a IO::ReadFile variable, but it fails to execute on a similar overload function

It seems that the data has been corrupted else where, I posted a link to the complete source above.

Image
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Re: Irrlicht Lime is a .NET wrapper for Irrlicht Engine

Post by greenya »

I could not reproduce the problem. I checked in C# and VB, I checked with path that contains Unicode characters (Cyrillic and Chinese) and all worked OK. It seems that problem is somewhere else.

Please confirm next:
1) all the examples that comes with Lime works fine for you.
2) you did not replaced original Irrlicht.dll that comes with Lime SDK with one that you may downloaded from Irrlicht Engine official SDK.
rubenwardy
Posts: 91
Joined: Mon Mar 05, 2012 4:51 pm
Location: Bristol, UK
Contact:

Re: Irrlicht Lime is a .NET wrapper for Irrlicht Engine

Post by rubenwardy »

I can not open any of the examples. They do not appear to be written in Visual Basic
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Re: Irrlicht Lime is a .NET wrapper for Irrlicht Engine

Post by greenya »

When you download Irrlicht Lime archive, it contains bin/Release folder where placed all the examples which are already compiled. They all can be started simply by double clicking on any of them and should run OK. Please confirm that they runs OK on your system.
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Re: Irrlicht Lime is a .NET wrapper for Irrlicht Engine

Post by greenya »

Version 1.3 has been released

New examples:
Image
L14.Pathfinding // shows pathfinding on 64x48 map using simplified A* algorithm. // preview
L15.AbstractTrace // generating abstract traces using plane of rarely set cubes. // preview

Changes:
- Updated Irrlicht SDK to trunk rev. 4446.
- MaterialRendererServices changes: added GetPixelShaderConstantID and GetVertexShaderConstantID. Updated methods to take index instead of name. Renamed SetPixelShaderConstant (and "Vertex") which took argument "startRegisterIndex" to SetPixelShaderConstantList (and "Vertex"). Removed SetPixelShaderConstant (and "Vertex") with "bool" argument.
- GUIEditBox changes: added get-set props CursorBlinkTime, CursorChar, DrawBackground and DrawBorder. Removed SetDrawBorder method.
- Added DrawBackground and DrawBorder props to GUICheckBox.
- Added ValidateOn prop to GUISpinBox. Added GUISpinBoxValidation enum.
- Added AddShadowVolumeSceneNode to MeshSceneNode.
- Added BoundingBoxTransformedEdges to SceneNode.
- Added ButtonPressedImageOffsetX, ButtonPressedImageOffsetY, ButtonPressedTextOffsetX and ButtonPressedTextOffsetY to GUIDefaultSize enum.
- Added Disabled to ComparisonFunc enum.
rubenwardy
Posts: 91
Joined: Mon Mar 05, 2012 4:51 pm
Location: Bristol, UK
Contact:

Re: Irrlicht Lime is a .NET wrapper for Irrlicht Engine

Post by rubenwardy »

I attempted to run the examples, and they work.
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Re: Irrlicht Lime is a .NET wrapper for Irrlicht Engine

Post by greenya »

Well, then i can't say why your code cannot open texture :(
Post Reply