Jump to content

MaxGUI 1.39 with Leadwerks 2.32


Jules D.
 Share

Recommended Posts

  • 2 weeks later...

I put this together, the GUI was generated with LogicGUI and afew lines for the canvas rendering from the OpenSandbox project on the old forums.

 

SuperStrict

Framework leadwerks.ENGINE
Import koriolis.bufferedstream
Import koriolis.zipstream
Import leadwerks.logstream
Import leadwerks.audio
Import leadwerks.ENGINE
Import leadwerks.glewex
Import maxgui.maxgui
Import leadwerks.abstractstream
Import maxgui.win32maxguiex
Import maxgui.drivers
Import brl.event
Import brl.eventqueue

Local world:TWorld
Global gbuffer:TBuffer
Local camera:TCamera
Local mesh:TMesh
Global light:TLight
Local ground:TMesh
Local material:TMaterial

GCSetMode(2)

SetGraphicsDriver GLGraphicsDriver(), GRAPHICS_BACKBUFFER | GRAPHICS_DEPTHBUFFER

RegisterAbstractPath( "D:/Program Files (x86)/Leadwerks Engine SDK" ) 

Local Window1:TGadget = CreateWindow("Window1",383,112,1042,767,Null,WINDOW_TITLEBAR|WINDOW_RESIZABLE |WINDOW_CLIENTCOORDS )
Local Canvas1:TGadget = CreateCanvas(0,0,1042,767,Window1,Null)
	ActivateGadget( Canvas1 )
	SetGadgetLayout( Canvas1,EDGE_ALIGNED,EDGE_ALIGNED,EDGE_ALIGNED,EDGE_ALIGNED )

	SetGraphics CanvasGraphics(Canvas1)

world=CreateWorld()
If Not world RuntimeError "Failed to create world."

gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_DEPTH|BUFFER_COLOR0|BUFFER_COLOR1|BUFFER_COLOR2)

camera=CreateCamera()
PositionEntity camera,[0.0,0.0,-2.0]

material=LoadMaterial("abstract::cobblestones.mat")

mesh=CreateCube()
PaintEntity mesh,material

ground=CreateCube()
ScaleEntity ground,[10.0,1.0,10.0]
PositionEntity ground,[0.0,-2.0,0.0]
PaintEntity ground,material

light=CreateDirectionalLight()

RotateEntity light,[45.0,45.0,45.0]


Repeat
PollEvent()
Select EventID()
	Case EVENT_WINDOWCLOSE
		Select EventSource()
			Case Window1	Window1_WC( Window1 )
		End Select

End Select

TurnEntity mesh,[AppSpeed()*0.5,AppSpeed()*0.5,AppSpeed()*0.5]

If KeyHit(KEY_ESCAPE) Exit
If AppTerminate() Exit

UpdateAppTime()
UpdateWorld(AppSpeed())

SetBuffer(gbuffer)
RenderWorld()
SetBuffer(BackBuffer())
RenderLights(gbuffer)

Flip(0)

Forever

Function Window1_WC( Window:TGadget )
gbuffer=Null
FreeEntity light
GCCollect()
End
End Function

Intel Core i7 975 @ 3.33GHz, 6GB ram, GTX 560 Super OC, Windows 7 Pro 64bit

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