Jump to content

ZeroByte

Members
  • Posts

    99
  • Joined

  • Last visited

Posts posted by ZeroByte

  1. Since there is no LoadScript in c++ anymore, How could i get this to run in my c++ project?

     

    I'm using LEO with support for Lua, from example Lummoja posted. Just plain project with character controller.

     

    If i drag the monstertruck into my map, i see it's in there rolling around, but how do i load the "driver_truck.lua" script?

     

     

     

    Thank's for any tips..

  2. Well done Ubu, look's like you got it working nicely, nice screenshot.

     

    Hey, i'm trying to use that code in vb.net, but i can't find the FreeCamera in this line.

     

    FreeCamera fc = new FreeCamera(Framework.Layers.Main.Camera); // Custom class

     

    In vb.net it look's like this

     

    Dim fc As New FreeCamera(Framework.Layers.Main.Camera)

     

    It say's type FreeCamera is not defined.

     

    Any idea what i'm doing wrong ?

     

    Thank's.

  3. ok, i changed the project to visual basic 2008 express.

     

    Imports System
    Imports Leadwerks
    Imports Leadwerks.Engine
    Imports Leadwerks.Core
    Imports Tao.Platform.Windows
    
    Public Class Form1
    
       Dim apprun As Boolean
       Dim buffer As IntPtr = 0
       Dim World As IntPtr = 0
    
       Public Shared Sub GetSize(ByVal width As Integer, ByVal height As Integer)
           width = 800
           height = 600
       End Sub
    
       Public Shared Sub MakeCurrent()
           Wgl.wglMakeCurrent(Wgl.wglGetCurrentDC, Wgl.wglGetCurrentContext)
       End Sub
    
       Public Shared DGetSize As New GetSize(AddressOf GetSize)
    
       Public Shared DMakeCurrent As New MakeCurrent(AddressOf MakeCurrent)
    
    
       Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
           OpenGlWindow.InitializeContexts()
    
           RegisterAbstractPath("C:\LE2.3")
    
           World = CreateWorld()
    
           OpenGlWindow.MakeCurrent()
    
           buffer = CreateCustomBuffer(DGetSize, DMakeCurrent)
    
           SetBuffer(buffer)
    
           Dim cam As IntPtr = CreateCamera(Nothing)
    
           Dim c() As Single = {0, 0, 0}
           CameraClearColor(cam, c)
           Dim pos() As Single = {0, 0, -5}
           PositionEntity(cam, pos, 1)
    
           Dim light As IntPtr = 0
           light = CreateDirectionalLight(0)
           Dim rotate() As Single = {45, 45, 0}
           RotateEntity(light, rotate, 1)
           Dim position() As Single = {0, 1, 0}
           PositionEntity(light, position, 1)
    
           Dim box As IntPtr = CreateBodyBox(1, 1, 1, Nothing)
           Dim posbox() As Single = {0, 1, 0}
           PositionEntity(box, posbox, 1)
           Dim meshcolor() As Single = {255, 0, 0}
           EntityColor(box, meshcolor)
    
           DebugEntities(1)
           DebugPhysics(1)
           DebugLights(1)
    
           apprun = True
    
           Me.Show()
           Me.Focus()
    
           While apprun And Not AppTerminate() = 1
    
               Me.Text = "FPS: " & Timing.FPS.ToString
               SetWorld(World)
               Timing.Update()
               Leadwerks.Core.UpdateWorld(Timing.Speed)
               Leadwerks.World.Render()
               RenderWorld(World)
               Drawing.Render()
               OpenGlWindow.SwapBuffers()
               Flip(1)
    
           End While
    
       End Sub
    
       Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
           Me.Close()
           Leadwerks.Core.Terminate()
       End Sub
    
       Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
           Dim scene As IntPtr = LoadScene("abstract::test.sbx")
       End Sub
    End Class
    
    

  4. Hi, i'm trying to get the CustomBuffer working with vb.net and Lazlo's .net wrapper.

     

    I took out the engine.dll, jointlibrary.dll, newton.dll files.

     

    Any idea what i'm doing wrong, i did have it working, with an older version of LE, and tyler's old wrapper.

     

    Thank's.

     

    Edit: I'm using visual basic 2008 now, but still won't render.

     

    http://66.244.240.13/

  5. You should post a separate thread with source of your app so we can debug the error.

     

    Ok i will, thank's, problem is, i have to use visual basic 2010 beta 2, or it doesn't seem to work at all.

  6. I chose c/c++, but if i could get Lazlo's .net wrapper working with custom buffer, i would probably have chose vb.net, no c#, cause vb.net not an option. :blink:

     

    I'm just a lot faster coding with .net, could always port to c/c++ later, if i had to.

  7. Hi Lazlo, great work on this .net wrapper.

     

    I'm using it with vb.net, and custom buffer, with Tao OpenGl Framewerk.

     

    So far, i can only change background color with "CameraClearColor(cam, c)".

     

    Can't seem to get anything rendering yet, probably something i'm doing wrong. :blink:

  8. Thank's Josh, it worked great.

     

    I converted it to use the Framewerk, but i can't get the blades to turn.

     

    Here is the code i'm using, with SetGlobalObject();

     

    #include "framewerk.h"
    using namespace leadwerks;
    
    int main()
    {
           if(!Initialize())return 1;
           RegisterAbstractPath("C:/LE2.3");
           SetAppTitle( "C++ Lua Demo" ) ;
           Graphics( 800, 600 ) ;
           AFilter() ;
           TFilter() ;      
    
           TLight    light;
           TMesh	  ground;
           TMaterial material;
    
           Framewerk fw;
    
    	if( !fw.Create() )
    		{
    			MessageBoxA(0,"Failed to initialize engine.",NULL,0);
    			return 1;
    		}
    
    
    
           //================================================================
           // Here is the code I added
           //================================================================
           SetGlobalObject("world_main",fw.GetMain().GetWorld());
           LoadModel("abstract::windmill.gmf");
           //================================================================
           //
           //================================================================
    
    	fw.GetRenderer().SetSkybox( LoadMaterial("abstract::FullskiesBlueClear0016_2_L.mat") );
    	fw.GetRenderer().SetSSAO(0);
    	fw.SetStats(2); 
    
           PositionEntity(fw.GetMain().GetCamera(),Vec3(0,8,-22));
    
    	material = LoadMaterial("abstract::cobblestones.mat");
    
    	ground = CreateCube();
    	ScaleEntity   ( ground, Vec3(12,  1, 12));
    	PositionEntity( ground, Vec3(0, -1, 0));
    	PaintEntity   ( ground, material );
    
           light=CreateDirectionalLight();
           RotateEntity( light, Vec3(45) );
    
           // Game loop
           do
    	{
    		if( KeyHit(KEY_ESCAPE) ) break;
    		if( AppTerminate()     ) break;
    
    		// Update timing and world
               //UpdateAppTime();
               //UpdateWorld(AppSpeed()) ;
    
               // Render
    
               fw.Update();
    		fw.Render();
    
               // Send to screen
               Flip(0) ;
           }
    	while( true );
    
           // Done
           return Terminate() ;
    }
    

     

     

     

    Is it possible to use Lua with Framewerk ?

    post-23-12591255949605_thumb.jpg

×
×
  • Create New...