Jump to content

Custom Buffer


ZeroByte
 Share

Recommended Posts

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/

Win 7 64, LE 2.31, Liquid Cooled I7-960 @ 4.00GHz, 6GB DDR3 Ram @ 1600mhz, BFG GTX295, Sound Blaster X-FI.

Link to comment
Share on other sites

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

Win 7 64, LE 2.31, Liquid Cooled I7-960 @ 4.00GHz, 6GB DDR3 Ram @ 1600mhz, BFG GTX295, Sound Blaster X-FI.

Link to comment
Share on other sites

Why am I seeing IntPtr's? This is not part of my headers.

 

What should i put instead of IntPtr's then ?

 

PS: i only posted my project, no dll's, just my code.

Win 7 64, LE 2.31, Liquid Cooled I7-960 @ 4.00GHz, 6GB DDR3 Ram @ 1600mhz, BFG GTX295, Sound Blaster X-FI.

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