Jump to content

klepto2

Developers
  • Posts

    854
  • Joined

  • Last visited

Everything posted by klepto2

  1. 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!
  2. 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.
  3. 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.
  4. 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).
  5. 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.
  6. 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.
  7. 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.
  8. Its exactly the same control which is contained in the SVN Version. So you don't need a prebuilt one.
  9. 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.
  10. 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);
  11. I'm using LE. but not for the 2D Part. The 2D part is my own 2D framework usin OpenGL.
  12. Hi guys, I have made some small progress on my gui system the last few days. Nothing fancy, but believe me there where a lot of changes under the hood and now I can show you a first skinned screenshot: As you see the base skinning part is done. Well it will develope further with later gadgets, but the base part is done. You can have multiple skins running in one application, so you can have your main gui in your own game style and another like an ingame pc with a WinXP skin. One other thing which is special about this picture: The 2D part isn't using a single part (except Texture loading, which may also change later) from the Leadwerks Engine. OK Buffers are still used as well as Textures, but the whole Drawingpart of images uses my own 2D Framework. A small code can show you how the logo is drawn on the right of the above image: Local img:TLEImage = TLEImage.Load("abstract::lelogo.dds") ... TLeGui.RenderGui(camera) BeginLE2D() TLe2DHelper.SetBlend(ALPHABLEND) TLEImage.DrawImageRect(img, GraphicsWidth() - 320, GraphicsHeight() - 100, 320, 100) TLEImage.DrawSubImageRect(img, 200, 300, 32, 20, 5, 5, 120, 120) EndLE2D() Flip() The commands are a bit inspired by Max2D as you may have noticed. Also you see the second DrawImage command, this command draws a subimage of the source image. Currently my 2D system supports: Completely new TLEImage Some Primitives Transformations (rotation,scaling,...) Blendmodes, Colors, and some small other things. I hope you enjoyed the read. See ya at my next entry.
  13. Maybe we should switch the forum language to Esperanto
  14. Ok, as said in my last post i will make an advanced 2d system and a gui. I have now decided to start with the gui and add 2d Functions on demand. Here is a first screen, nothing special, but it shows some progress: Note the correct rendering of the window at the cube. I'm using one of my first 2D additions, SetScale , to mirror the rendering correctly for the texture. What does the renderer currently do: Every control is itself contained in a buffer which is only updated if it is marked as dirty. the rendering goes up the parents tree and each control buffer is renderend into its parents buffer at the desired location. With this technique i only need to draw one Image most of the time to represent a root gui element. I will keep you informed.
  15. 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?
  16. After a forced break from programming with Leadwerks Engine, due to Work and other not 3D related Projects, I have started yesterday to come back to my Leadwerks project. As I'm continuing my project, I'm developing some extension for my own needs and if they are needed and good enough i will publish standalone addons here. The first project will be somekind of Leadwerks2D. It will offer a richer 2D function set than the current one. eg: Rotation, scaling, origin handling and new primitives with advanced options. The first project with LE2d will be a small skinnable gui system with the goal to provide an easy and flexible ingame gui system. One feature will be that you can attach a "rendertarget" to the gui and eg have the gui on 3D Objects. I will keep you informed on any News and post screens etc as soon as something showable is produced.
  17. Unfortunatly the LETKControl doesn't work with Framework. I'm working on this issue but haven't found a working solution by now.
  18. klepto2

    Sunrise, sunset

    this looks promising, but take a look at this: http://www-evasion.imag.fr/Membres/Eric.Bruneton/ the source is available and it is using OpenGL and GLSL so it may be possible to use. I'm currently trying to implement some of the features myself.
  19. klepto2

    .NET Headers

    @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)
  20. 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.
  21. klepto2

    .NET Headers

    new Headers with source are available: Leadwerks C# Headers next on todo: fixing Vehicles
  22. 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.
  23. klepto2

    C# Source

    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.
  24. klepto2

    C# Source

    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.
  25. 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.
×
×
  • Create New...