Jump to content

Von04

Members
  • Posts

    77
  • Joined

  • Last visited

Posts posted by Von04

  1. It's extremely easy on Windows. Just call Context::CreateCustom(hWND) and off you go.

    I'm a noob when it comes to C++. I created a Windows Forms app and included the leadwerks.h file, and also added the leadwerks.lib to the solution. Problem is, whenever I try to use a Leadwerks command I receive the following type error:

     

    1>c:\users\kevin\desktop\testform\testform\Form1.h(29): error C2027: use of undefined type 'Leadwerks::Window'

    1> c:\leadwerks\engine\source\Classes/Context.h(7) : see declaration of 'Leadwerks::Window'

    1>c:\users\kevin\desktop\testform\testform\Form1.h(29): error C3861: 'Create': identifier not found

     

    Any help would be appreciated.

  2. @Von wow, that's strange. For the rotation issue I think I can force this to always be sideways and that might help. The Paid version not installing is a mystery. I do plan on adding a few things to the paid version (pause button, mole holding sign of new level, etc) soon so maybe a new version will help if I go through the signing process again.

     

    If you would like a refund until that time I think I'm able to do that in the google dev console. Just let me know. The new version is probably a month away.

    / Don't worry about a refund its going to a good cause I'll just wait for an update.
  3. Paid version still won't install. The Lite version installed correctly but when I try and load the game up with my phone up right it loads up half of the main screen rotated sideways and crashes after 3 seconds. If I load it up with my phone sideways it loads and runs just fine

  4. Really? That's the first error I've heard about. Have you tried installing the lite version yet to see if that one works for you?

    No I have not, but I'll give it a try and let you know.
  5. Hey Rick. I get an error while trying to install. It says "Error, package file not signed correctly."

    I downloaded from Google Play on a Samsung running Ice Cream Sandwich 4.1.

  6. Congratulations Rick, and very generous too. Downloading the paid version now. My 3 year old daughter should love it. Now when she plays a game on my phone, she has another choice besides Tiger Woods 2012and PBA Bowling.

  7. Have you already looked at TurnEntity? You can specify each axis and if the turn is global or local.

    (Or just apply the code that makes your head spin to the model. tongue.png )

    I applied the algorithm to my model that makes my head spin, and the model just blew up. Not exactly the effect I was looking for, but hey, at least now I know how to do destructible objects. LOL :)
  8. Since it is Christmas and all, I was just wondering if Josh would share his code for how he rotates a Model with the Mouse the way he does it in his ModelEditor. Or if anyone else knows how I could accomplish this in Leadwerks, that would be greatly appreciated. I figure it has to do with quaternions, but trying to understand those just made my head spin. Any help or links would be greatly appreciated. Merry Christmas all.

  9. Is there any way at all to declare a callback function in C# that uses the cdecl calling convention?

     

    Try something like this.

     

    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]

    public delegate void MyDelegate();

     

    if using this you'll also want to look into Marshaling e.g.

     

    Marshal.GetFunctionPointerForDelegate(Delegate d)

    //Converts a delegate into a function pointer that is callable from unmanaged code.

     

    Marshal.GetDelegateForFunctionPointer(IntPtr ptr, Type t)

    // Converts an unmanaged function pointer to a delegate

     

    I needed to use these when calling native functions from the engine.dll for my LEControl. It's how I finally got the GetSize and MakeCurrent Delegates to work properly. These function are under the System.Runtime.InteropServices namespace.

  10. I'm new to Blender. Does anyone know why when I export a model using the .fbx export option from blender, and then convert to .Gmf using the FBXtoGMF.exe, the model shows up all red? All the texutres are correct, it's just like the whole model has an entitycolor of red.

  11. I did resolve the problems. The only thing now is trying to implement a Timer inside of the control to fire an event, and use that to create an internal loop. The problem is that whenever I add a Threading.Timer to the control it crashes Visual Studio. I've read about a lot of other people having the same problem but I haven't figured out a work-around yet. If I can't figure this out by tomorrow, I'll just release the code as-is, and users will just have to add their own timer to their windows forms, and use that as a render loop. I post later tonight when I have some more time to work on this.

     

    Just uploaded a working version of the control to the Asset Store -> Tools section. Check it out and let me know how it goes. Hope my directions are clear enough for setting it up. The included LEControl.Dll contains the control. The example.cpp and form1.h files included are examples of how to set up leadwerks using the control. Best of luck.

  12. File Name: Custom control for rendering leadwerks and c++/cli windows forms.

    File Submitter: Von04

    File Submitted: 22 Jan 2012

    File Category: Tools

     

    This is a custom control which renders leadwerks to custom control using a custom buffer and a c++ window form application. It has been tested on 2008 and 2010 c++ express, 2010 visual studio professional and c# all versions.

     

    How to use:

     

    1. Create a windows form application.

     

    2. Add the LEControl.Dll file to your projects release/debug folder, whichever one your running.

     

    3. Add Shaders.Pak, Scripts Folder, Engine.dll, Engine.Cpp, and Engine.h to your project directory.

     

    4. Go to the Form designer and open up the Toolbox.

     

    5. Right-click and select Choose Items.

     

    6. After the Choose Items dialog appears (usually takes awhile) selecte the Browse... button.

     

    7. Navigate to your projects Release/Debug folder and select LEControl.Dll.

     

    8. A new control should now appear called LEControl. Click OK. LEControl should now be added to your toolbox.

     

    9. Drag a LEControl onto your windows form. In the example, I renamed from lecontrol1 to Window.

     

    10. Go to the new controls events (click the lightning bolt icon) and double click the Paint event.

     

    11. The newly created function is now your leadwerks rendering loop. Add your code here that you would normally have inside your main loop. There is no need to add the actual rendering code, because the control sets that up automatically. Just enter code for modifying entites e.g.

     

    12. Go back to the control events and double-click the Resize event. Inside the newly created function add the line: Window->ResizeBuffers(); This is assuming that you renamed your control Window. Otherwise add the line: lecontrol1->ResizeBuffers(); This will resize the custom buffer to match the size of the control.

     

    13. See the Example.Cpp file to see how to #include "Engine.Cpp".

     

    14. In your Form1.h file make sure your add #include "Engine.h" at the top of the file.

     

    15. In the Form1 constructor add:

    Initialize();

    RegisterAbstractPath("Your SDK Location Here");

    before the line:

    InitializeComponent();

     

    16. After InitializeComponent() add the line:

    Window->InitializeLeadwerks(true); // Uses framework

    or Window->IntializeLeadwerks(false); // no framework

     

    17. InitializeLeadwerks sets up leadwerks creating world and cameras for you. See the Form1.h file included with the zip pack for an example for accessing the different camera and worlds.

     

    18. Run your form and that should be it.

     

    This control has been tested on c++ 2008 and 2010 express, 2010 Visual Studio Professional, and all years of C#. If you have any suggestions and encounter any bugs please post them here.

     

    Enjoy!

     

    Click here to download this file

    • Upvote 2
  13. File Name: LEControl for rendering leadwerks on c++ windows forms.

    File Submitter: Von04

    File Submitted: 22 Jan 2012

    File Category: Tools

     

    This is a custom control for rendering leadwerks to a custom buffer using an opengl control on a c++/cli windows form. There is a sample project created with c++ 2008 express. The control was also tested on c++ 2010 express and professional versions and ran fine. This control has also been tested and works with c# windows forms. The sample project shows the custom control already attached to a form, but if you want to add the control to another form then follow these rules:

     

    1. Add the LEControll.Dll file to your projects release/debug folder.

     

    2. With your form project open, open the ToolBox and right-click.

     

    3. Select Choose Items.

     

    4. When the Choose Items dialog pops up (which usually takes a long time) select the Browse... button.

     

    5. Then go to your projects release/debug folder and select LEControl.Dll.

     

    6. A new control called LEControl should now show up and be checked. Click OK.

     

    7. Now a new control is added to your Toolbox called LEControl.

     

    8. Click and drag a LEControl onto your windows form.

     

    9. Highlight your newly created control and select the event properties ( the little lightning bolt icon).

     

    10. Go to the event called Paint and double click the empty value box.

     

    11. Under the newly created function is your rendering loop. Add all code here that would normally appear in

    in your loop. Don't worry about adding the code for actual rendering of the world or the framework for the

    control already has this code built in.

     

    12. Go back to the designer and find the Resize event. Double click. Inside the newly created function add

    line: lecontrol1->ResizeBuffers(); This is assuming you didn't change the name of the control.

    lecontrol1 is the default name of the control.

     

    13. Please see the included example project for setting up the main forms constructor.

     

     

    There are some things I'm still working on and will update as needed, but this is definitely a working control.

    If you encounter any bugs please post them here.

     

    Click here to download this file

  14. Any update on this? Did you manage to resolve the problem?

     

    I did resolve the problems. The only thing now is trying to implement a Timer inside of the control to fire an event, and use that to create an internal loop. The problem is that whenever I add a Threading.Timer to the control it crashes Visual Studio. I've read about a lot of other people having the same problem but I haven't figured out a work-around yet. If I can't figure this out by tomorrow, I'll just release the code as-is, and users will just have to add their own timer to their windows forms, and use that as a render loop. I post later tonight when I have some more time to work on this.

  15. I have no idea what happened to my code. I went to run my test form, and every time it gets to the line CreateWorld the form closes without any errors. What would cause CreateWorld to crash my form? Is it that there is not a active GLContext? I don't believe that I changed any of the code to cause this. I'm at a loss.

×
×
  • Create New...