Jump to content

Help Request - Starting Up Leadwerks + C#


Shard
 Share

Recommended Posts

So I am now officially moving to coding in C# and I tried to get Leadwerks to import into it but it didn't work

 

Below is my code:

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Leadwerks;

namespace N_Body.Source
{
static class Program
   {
       static void Main()
       {

           Framework.Initialize(true);

           Leadwerks.Framework.Update();
           Leadwerks.Framework.Render();
       }
   }
}

 

 

I included the Leadwerks.dll from the repository (as a reference).

 

This is the result of the log file:

Leadwerks Engine 2.40

Initializing Renderer...

OpenGL Version:

GLSL Version:

Render device:

Vendor:

Error: GLSL 1.20 is not supported. Please update your graphics drivers or replace your hardware.

 

But Leadwerks programs in C++ works fine for me.

 

 

Can anyone help me start up?

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

You need to copy the engine.dll, newton.dll, jointlibrary.dll, shader.pak and if you use scripting the whole Script Folder into the Output Folder of your app (both, debug and release)

  • Intel® Core™ i7-8550U @ 1.80 Ghz 
  • 16GB RAM 
  • INTEL UHD Graphics 620
  • Windows 10 Pro 64-Bit-Version
Link to comment
Share on other sites

You need to copy the engine.dll, newton.dll, jointlibrary.dll, shader.pak and if you use scripting the whole Script Folder into the Output Folder of your app (both, debug and release)

 

I did that and got the results above.

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

  1. You didn't use Engine.Initialize before Framework.Initialize.
  2. You do not have a rendering loop with Graphics.Flip.
  3. You do not need to use the Leadwerks prefix if you import the using.

        static void Main()
       {
           Engine.Initialize(...);
           Framework.Initialize();

           while (!Keyboard.KeyHit(Key.Escape))
           {
                 Framework.Update();
                 Framework.Render();
                 Graphics.Flip();
           }

           Framework.Terminate();
           Engine.Terminate();
       }

Link to comment
Share on other sites

  1. You didn't use Engine.Initialize before Framework.Initialize.
  2. You do not have a rendering loop with Graphics.Flip.
  3. You do not need to use the Leadwerks prefix if you import the using.

        static void Main()
       {
           Engine.Initialize(...);
           Framework.Initialize();

           while (!Keyboard.KeyHit(Key.Escape))
           {
                 Framework.Update();
                 Framework.Render();
                 Graphics.Flip();
           }

           Framework.Terminate();
           Engine.Terminate();
       }

 

 

Thanks, but I did get an error:

D:\Source Code Control\N Body\N Body\N Body\Source\Main.cs(13,20): error CS0117: 'Leadwerks.Engine' does not contain a definition for 'Initialize'

 

At this

Engine.Initialize();

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

If you're using the 1.32.8 wrapper there is not Engine.Initialize, you should call Framework.Initialize after Graphics.Initialize (if you will get an error calling this, probably you're importing the System.Drawing using, in that case you can remove the using or prefix "Leadwerks."), watch the tutorial or download the templates (you need to overwrite the DLL after you save the solution in your project directory because the one shipped with the templates is before 1.32.8, they will be replaced with new versions as soon as the new stable wrapper has been released in the next weeks):

 

Graphics.Initialize(800, 600);
Framework.Initialize(true);
FileSystem.AbstractPath = "C:/Leadwerks Engine SDK";
while (!Keyboard.KeyHit(Key.Escape) && !Window.HasRequestedClose())
{
   Framework.Update();
   Framework.Render();
   Graphics.Flip();
}
Engine.Terminate();

?? FRANCESCO CROCETTI ??

http://skaredcreations.com

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...