Jump to content

Anton Boroda

Members
  • Posts

    28
  • Joined

  • Last visited

Posts posted by Anton Boroda

  1. There is hardly any support for C# and .NET if you compare it with C++ and the millions of standard libraries for C++ you can get for all platforms from the internet for free. No language will ever beat that.

    But still i'm very used to C# and don't want to even look at C/C++. There is a bullet for C# (bulletsharp), and it imports to leadwerks project fine but i think there is need of source code access to make it work (or maybe i'm just wrong, i'll look a bit more at it later this week).

  2. Will it work inside leadwerks? Or i need to write a separate render for it? (because link for building it for windows that should point to some engine page is dead)

  3. So i look over the forum and found that the most usable GUI system here is CEGUI, but there is no discussion about using it with C#. Also i noticed that CEGUI# project is dead. Maybe there are some other libraries to use?

  4. If you open engine.cpp you will see that the inline function DrawText calls leDrawText(buffer, x, y), that is the real function called (you can see at EntityPosition too as example).

    Yep, then the problem has to be with something else.

  5. Now looking into Draw.

    I'm not very familiar with dll import but still this look strange:

    [DllImport(EngineDll, EntryPoint = "DrawText", CallingConvention = CallingConvention.StdCall)]
    public static extern void DrawText(string text, int x, int y);
    

    When docs say there should be DrawText(int x, int y, string text), but it still doesn't work when corrected. Maybe it has something to do with c_str() pointer (does it need to be passed in dllimport calls?)?

     

    Also i get "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." exception when trying to run Draw.Text("text", 1, 1) or any other x,y specified with "fixed code". Without specified coords it starts fine (but text is still not shown)

  6. Solution found.

    Vector3.cs

    find

    public static Vector3 Parse(string s)
    {
           string[] values = s.Split(',');
           return new Vector3(float.Parse(values[0]), float.Parse(values[1]), float.Parse(values[2]));
    }
    

    replace with

    public static Vector3 Parse(string s)
    {
        string[] values = s.Split(',');
               float val0;
               float val1;
               float val2;
               float.TryParse(values[0], System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out val0);
               float.TryParse(values[1], System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out val1);
               float.TryParse(values[2], System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out val2);
        return new Vector3(val1, val1, val2);
    }
    

     

    Works with any regional code. "," and "." tested and working. Should be fine with any other.

  7. Ok, i found what is causing the error (still not fixed it)

    public static Vector3 Parse(string s)
    {
    string[] values = s.Split(',');
    return new Vector3(float.Parse(values[0]), float.Parse(values[1]), float.Parse(values[2]));
    }
    

    its the return ... line. Will debug more now.

     

     

    Ok, problem found. Its something to do with delimiters. My regional settings have "," as a float value delimiter. I've set it to "." and it works (at least loading scene, draw text still doesn't work).

    I will try to find a universal workaround for this.

  8. Here is a simple scene loading and a text printed at top-left corner, just drop inside its folder Leadwerks.dll, engine.dll, newton.dll, shaders.pak and the Scripts folder from your SDK.

    Yep, it DOES NOT work. So its a bug with headers + russian windows (the most most credible variant).

     

    I will try to find some english windows 7 to test and confirm this (cant confirm on net-book, leadwerks doesn't run on it).

     

    Any header devs want to look into this? It's really urgent for me (and any C# devs in general, because if one will publish his product it wont run on rus win7)

  9. You cannot use 2008 with the new headers because it requires framework 4.0, so you must use 2010. You should just try with C# 2010 Express.

    Tested with Express version on my net-book. And... it still doesn't work when i try to run it on work pc. Maybe it has something to do with my russian windows (path gets corrupted on executing machine? Because i have an english win on net-book)?

    Anyway it seems to be a library bug. (Draw doesn't work with express too).

     

    So until this bug is fixed i can't do anything (scene loading is working with Core, but Draw doesn't so i cant draw any interface currently, nor show debug info on screen).

     

    And this is not a low priority bug because if i compile it on english version it still doesn't work on russian one, so all russian windows is currently unable to run C# coded leadwerks apps correctly. Thats very bad.

     

    ZioRed can you please send me a compiled exe with scene loading (just exe, and empty scene)? If it won't work then its a locale bug with headers.

  10. Of course your project build platform is set to x86, right? I'll try to find a PC with VS10 Ultimate, even if it's a bit strange that the difference of VS family in the same version could create such issues but it seems to be the only difference between our systems.

    Yep, its x86. I will install a VS2008 on my old laptop with XP today and try the compilation (binaries won't work there though)

  11. Sorry but I finished my ideas about your scene loading problems, have you tried to use the express version of VS 2010 instead of Ultimate (or use another folder for the compiled+medias like "C:\TEMP")? Or also running directly the compiled EXE instead of start debugging? I know this is odd but I don't know what to try next because I have no issues with that code and your sbx.

     

     

    Gravity vector is not initialized from default (even if I read somewhere in the forum that a ~20 gravity is already set by default internally in the engine), so you should initialize yourself with a new Vector3(0,WHAT_YOU_WANT,0)

    I tried all this before (moved to C:\, renamed, replaced, copy, etc etc etc). All the same. It just doesn't work.

     

    Also no Draw functions work. Thats so lame. I cant figure out what is wrong :) This really stops me from doing anything.

     

    Maybe someone from header devs can look into this problem? This is really REALLY bad.

  12. You could try to set the full path into a variable and debug its value, may be it returns a null or empty value so the engine LoadScene fails. After this I cannot see more possible issues (can you attach your sample not working project solution and demo.sbx?).

     

    // After initialize try/catch
    string path = FileSystem.GetAbsolutePath("abstract::demo.sbx");

    Path points right the way it should (to the map). Just checked. Demo.sbx is just a simple map with dummy terrain.

    Anyway here is is: Maps.rar

    Solution is just a blank template with Leadwerks.dll reference and 1 class file with sample code you provided. I don't think something is wrong with it.

     

    I even tried filling the full path like this

    Scene scene = new Scene("D:\\Leadwerks Engine SDK\\Maps\\demo.sbx");
    

    Still the same. Will install VS2010 on my laptop and try it.

     

     

    Quick question. How to change world gravity if i'm using Framework? (it creates world already and World.Current.Gravity.Y doesn't work, NullPointer)

     

     

    Edit: Ok, tested on my Dell Vostro. Fresh VS10Ultimate, empty template. Same result.

  13. Really strange, I have win7 x64 and have no problems. Are you using C# 2010 express english version with a project targetted for 4.0 clients?

    Yes for all above except i'm using Ultimate (not express) version.

  14. And it STILL doesn't work!

    post-995-030292000 1288622244_thumb.jpg

    I copy-pasted all your code. Replaced engine.dll with the original one (was using custom). And it still throws the same error. Maybe it has something to do with x64 windows?

     

    P.S. Draw text doesn't work with original one too. This really boils me much <_<

  15. You should use Scene class and not Core.LoadScene

    It doesn't work!

    Scene.Load("abstract::demo.sbx");

    Results in:

    Input string was not in a correct format.

     

     

    Also Draw.Text("Test"); (same for Core.DrawText()) doesn't work. Text is not displayed on screen (but works in C++ with DrawText()). Maybe font is missing?

     

    Also there is other stuff i that is working really strange... I started to think i wasted my money. I really expected much more docs to be present. :lol:

  16. Sorry for necroposting but currently all my tries with LoadScene return me "Input string was not in a correct format."

    Core.LoadScene("abstract::demo.sbx"); works like it should.

    Whats the problem?

     

     

    P.S. C# docs are awful :lol: Its just a pain to find anything. I should really consider switching to C++...

     

    P.P.S Y as a vertical axis kills my brain

×
×
  • Create New...