-
Posts
854 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by klepto2
-
-
ups, you're right. the MouseMove indead is hardcoded to the middle of the screen. I knew why i called it beta
Well, ok, it was one of the last commands i added so i was a bit unconcentrated.
Fixed Control assembly: Klepto.Controls.dll
-
This happens if you don't have all LE dlls in the bin/Debug or bin/Release folder. Copy the engine.dll, newton.dll and jointlibrary.dll into these folder.
I will maintain both, Forms and WPF. WPF is just the Forms control hostet in WPF. I also had trouble to come into WPF but once you get into it its beautyfull. OK useless for Editors which needs highperformance, but other applications are done much easier and faster with WPF.
-
Hi, here is a new Version of the LE-TKControl (binary only currently).
The Sample has a subfolder containing all needed assemblies (excluding regular SDK dlls).
Whats new:
- Framework compatibility
- Polled Input
What to do:
- Cleanup the code
- Fix some minor issues (update timing)
- Porting it to WPF
- Add some overloads to the current polled input functions
Changes:
- Namespace has changed to Klepto.Controls because i have added it to my own GameEngine. I will go back to Leadwerks Namespace as soon as it is stable enough
- Instead of 1 Render Event there are now 3 Events (Pre, Main and After) makes handling of Framework drawing easier
- Handles the Framework rendering automatically if you use rendercontext.InitFramework(useLua)
Download : LESDK Control.zip
Have Fun!
- 1
-
sorry Rick, it takes a bit longer as i thought. I need to fix a bug with the release of the control. But i hope that i can upload it today.
-
Hi, I just want to inform you that i will release a newer Version of this Control Thursday or Friday.
There will be a lot of new small functions in the control which will make the handlicng of the Control much easier.
A short summary:
- Handling of PolledInput with the same function like the raw version of Leadwerks
- MoveMouse, KeyDown, KeyHit, MouseHit, etc.
- You will be able to assign a Framework directly to the control so the buffer rendering is done internal
And this is how the current Cam View code looks like in the control:
if (RenderContext.MouseDown(MouseButtons.Left))
{
//Camera look
mx = Maths.Curve(RenderContext.MouseX() - RenderContext.Width/2, mx, 6);
my = Maths.Curve(RenderContext.MouseY() - RenderContext.Height/2, my, 6);
RenderContext.MoveMouse(RenderContext.Width/2, RenderContext.Height/2);
// Leadwerks.Mouse.Move(RenderContext.Width / 2 , RenderContext.Height / 2 );
camrotation.X = camrotation.X + my/5.0f;
camrotation.Y = camrotation.Y - mx/5.0f;
Leadwerks.Framework.Layers.Main.Camera.Rotation = camrotation;
}
move =
Maths.Curve(
(float)
(Convert.ToDouble(RenderContext.KeyDown(Key.W)) - Convert.ToDouble(RenderContext.KeyDown(Key.S))),
move, 20);
strafe =
Maths.Curve(
(float)
(Convert.ToDouble(RenderContext.KeyDown(Key.D)) - Convert.ToDouble(RenderContext.KeyDown(Key.A))),
strafe, 20);
Leadwerks.Framework.Layers.Main.Camera.Move(new Vector3(strafe/10.0f, 0, move/10.0f));
This code gives the same smooth results as the original one. Also the MoveMouse method already takes the control offset into acount so no offset is needed.
- Handling of PolledInput with the same function like the raw version of Leadwerks
-
This looks like it was mine
You need VisualStudio Professional if I remember correctly.
In VS Pro you have a button called 'View Class Diagram' in the solution explorer for each project. This will generate the right picture (well some adjustments may be needed).
-
Ok, the buffer thing maybe due to wrong timer initialisation. So it tries to update the buffer before LE is initialised. This should be a minor issue and easy to solve.
The issue with using events is a bit more complicated. The problem is that the events and the redraw maybe asyncron. So you press the key, update the camera but the next frame will not be updated. To solve this you can do the following:
private bool KeyW = false; private bool KeyS = false; private bool KeyA = false; private bool KeyD = false; private void RenderContext_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if (e.KeyCode == Keys.W) KeyW = true; if (e.KeyCode == Keys.S) KeyS = true; if (e.KeyCode == Keys.A) KeyA = true; if (e.KeyCode == Keys.D) KeyD = true; } private void RenderContext_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.W) KeyW = false; if (e.KeyCode == Keys.S) KeyS = false; if (e.KeyCode == Keys.A) KeyA = false; if (e.KeyCode == Keys.D) KeyD = false; }
And in the main loop do the standard Move code
move = Maths.Curve((float)(Convert.ToDouble(KeyW) - Convert.ToDouble(KeyS)), move, 20); strafe = Maths.Curve((float)(Convert.ToDouble(KeyD) - Convert.ToDouble(KeyA)), strafe, 20); Framework.Layers.Main.Camera.Move(new Vector3(strafe / 10.0f, 0, move / 10.0f));
I will add a similar eventhandling like the original LE Polledinput later. eg: LETKControl.KeyDown(Key.A) or something like this.
-
Are you using the latest R5 dll?
Graphics doesn't need to be called, as it would create an own gfxcontext which we don't want.
-
Yes it should. Well i havn't tried it yet, but others already have used VB.Net with this control.
I'm also working on a WPF Control. But this is a bit more difficult as WPF uses DirectX natively and i need to wrap the Forms Control to a WPF control.
-
Its exactly the same control which is contained in the SVN Version. So you don't need a prebuilt one.
-
After revisiting the TKControl again I wasn't able to find a big bug or anything else i have made wrong (ok the refreshrate calculation is buggy) but then i have tried to get the Framework to work with the LETKControl and :
Success!!!
As said, there is nothing wrong with the Control itself, but something small is needed to get the Control working with the Framework.
Here is the code:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Leadwerks; namespace Leadwerks_FormsFramewerk_Test { public partial class Form1 : Form { private Leadwerks.Buffer buffer; public Form1() { InitializeComponent(); } private void RenderContext_Init(object sender, EventArgs e) { Leadwerks.FileSystem.AbstractPath = @"D:\LESDK232r5"; //Create a render buffer buffer = new Leadwerks.Buffer(RenderContext.Width, RenderContext.Height, (int)(BufferType.Color | BufferType.Depth | BufferType.Normal)); RenderContext.Start(); Leadwerks.Framework.Initialize(true); Leadwerks.Framework.StatisticMode = StatisticMode.Detailed; Leadwerks.Scene scene = Scene.Load("abstract::Test.sbx"); Framework.Layers.Main.Camera.Position = new Vector3(4, 3, -4); Framework.Layers.Main.Camera.Point(new Pivot()); } private void RenderContext_Redraw(object sender, EventArgs e) { //Set the created renderbuffer as current buffer and let LE render to it Leadwerks.Buffer.Current = buffer;//Leadwerks.Buffer.Back; Leadwerks.Framework.Update(); Leadwerks.Framework.Render(); //Set the buffer of the Control as current and draw the flipped image of the 'framework' buffer Leadwerks.Buffer.Current = RenderContext.Buffer; Leadwerks.Drawing.Image(buffer.GetColorTexture(0), 0, RenderContext.Buffer.Height, RenderContext.Buffer.Width, -RenderContext.Buffer.Height); } private void RenderContext_Resize(object sender, EventArgs e) { buffer = new Leadwerks.Buffer(RenderContext.Width, RenderContext.Height, (int)(BufferType.Color | BufferType.Depth | BufferType.Normal)); } private void RenderContext_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Q) Framework.Layers.Main.Camera.Move(new Vector3(0, 1 * Leadwerks.Core.AppSpeed(), 0)); if (e.KeyCode == Keys.Y) Framework.Layers.Main.Camera.Move(new Vector3(0, -1 * Leadwerks.Core.AppSpeed(), 0)); } } }
I hope this will help you. I will now try to integrate this a bit more into the control so that you won't need to handle this by your own.
-
Hi, I'm still working on this issue.
The polled Input is working, but in another way then the usual way in leadwerks. you have handle the correct events. In the Formssample you need this:
private void RenderContext_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.W) cam.Move(new Vector3(0.0f, 0.0f, 1.0f * Core.AppSpeed())); if (e.KeyCode == Keys.S) cam.Move(new Vector3(0.0f, 0.0f, -1.0f * Core.AppSpeed())); }
And this:
this.RenderContext.KeyDown += new System.Windows.Forms.KeyEventHandler(this.RenderContext_KeyDown);
-
Maybe we should switch the forum language to Esperanto
-
I'm also from Germany and I'm also against undersections for different languages. If someone will have a german or other language forum he may build up a fan forum in the specific language like it is done over at Blitzbasic. But with this together i don't believe it is currently a good idea to "split" the users by their language because of different points:
1. The userbase for each language is not that big that an own forum will need
2. This is quite young engine and the whole power and support should be bundled exactly where it is.
3. You can contact people in your language via PM if you have a question or need help translating a question to English.
My English is of course far from perfect, but i never had a problem to post a question and i doubt this will be a problem for anyone. Well, it may take a bit longer to formulate the questions but it is a good training for school and later jobs where english is needed nearly everywhere. At least english is essential for a programer you will find most technical papers in english, programming languages have mostly an english command set and most bigger support/help forums are english. Also it is no standard for technical communities.
PS: Standart gibt es nicht, oder sprichst du von Stehkunst?
-
Unfortunatly the LETKControl doesn't work with Framework. I'm working on this issue but haven't found a working solution by now.
-
-
@enablerbr: thx i will definatly look into this and add this. I have tried something similar bug gave up as i have seen the TAO and OpenTK Controls. But I think a native control may be the best solution to be independent from others.
I haven't tested it with the express editions yet but normally there should be no problem. Keep in mind to copy the needed dlls from leadwerks into the release folder if they are not automatically copied. Also you may test if the target platform is really X86 and not AnyCPU or X64.
@ZeroByte: Yes the control should work in vb.net as well (all .net languanges should be able to use it
@All: Keep in mind that this is still beta. I'm currently try to figure out how to use framewerk with the controls and some other stuff i have in mind. I'm also revisiting my own old (2.25 based) Wrapper which has a more bmx oriented Object Layout. (See Image below)
-
Hi, I'm currently writing / continueing the C# Headers and found no way to set the target buffer of the framework. This may be needed to be able to use the CustomBuffers with Framewerk (eg: a LEControl).
If there is already such functionality, please tell me.
-
-
How about saving it as png and then using the freeimage lib to convert it to dds? Of course it would be nice if Josh includes the dds saver but in the meantime this might be a solution.
-
Hi klepto2, will those 2 controls make it easier to setup a custom buffer with TAO Framework ?
I've been trying to get that working in vb.net, and this great wrapper.
BTW, thank's for releasing the source Ubu.
Yes, you just drop the control as every other control in your form. the Custombuffer is automatically created. The control will provide 2 extra events.
1. OnInit: In there youinitilize your objects, framewerk etc.
2. OnUpdate: In there you update the code ( no Flip needed as it this is done autmatically)
You only need to keep track of your own buffers via the resize events.
Both the TAO Control and the OpenTK Control are working exactly the same as the control, so you can swap the controls without changing the underlying code. (I prefer the OpenTK as it is still continued and already offers OGL4.0). I still need to fix some issues. But I think i will upload my version the coming weekend.
-
http://localhostr.com/files/d1f5ed/Leadwerks%20Source.zip
Enjoy
NOTE: This source might lack the picks, callbacks and delegates.
In this case, I leave it up to Tyler and Klepto to fix it and add them in.
Hopefully someone will take on the development.
Sorry to hear that you don't have time to continue on this, I will continue working on the delegates and some other functions which are currently missing or named wrong. I also have 2 working Leadwerks Controls (1 for the TAO Framework and 1 for the OpenTK lib). I will post the new files as soon as possible.
-
I'm still working on this issue, but for the meantime you can surround the UpdateWorld command with a Try Catch Block. Not elegant but it seems to work.
-
No, but I need to to investigate a bit further. If i remember correctly there was a need to Marshal the structs. Yesterday I wasn't able to solve it but hopefully i will solve everything over eastern weekend.
New LETKControl (beta)
in Programming
Posted
Ok, here we go last update for today
changes:
MouseX/ MouseY will update now after mousemove
experimental MouseRelease
the behaviour of MouseHit and MouseDown is different. Whereas MouseDown just checks if a button is pressed, Mousehit returns the number of clicks since the last time the given button was clicked.
Klepto.Controls.dll