EuIrr - Euphoria Wrapper for Irrlicht

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki

EuIrr - Euphoria Wrapper for Irrlicht

Postby GameDude » Tue May 23, 2017 12:57 am

Hello,

I have made a wrapper for the Irrlicht 3D Engine in Euphoria. You can now use the Euphoria programming language with Irrlicht. It is based off the CIrrlicht port, but it runs fairly well. You'll need a good understanding of the Euphoria language to fully use it, but Euphoria is very easy to learn.

https://pasteboard.co/9xEz1PGu1.png

Euphoria code
cpp Code: Select all
 
include std/machine.e
 
include EuIrr.ew
include std/get.e
 
--Get vars ready
constant TRUE = 1, FALSE = 0
 
atom dims = irrDimension2duNew(640,480)
atom campos = irrVector3dfNew(0,30,-40)
atom camat = irrVector3dfNew(0,5,0)
atom rect = irrRectiNew(10,10,262,22)
 
atom driver,scene,gui
atom col = irrSColorNew(255,100,100,100)
 
--create Irrlicht device
irrCreateDevice(dims,FALSE,TRUE,FALSE)
 
--check if was created properly
if irrIrrlichtDeviceWasCreated() = -1 then
    puts(1,"Failed to create device!\n")
    abort(0)
end if
 
--get Irrlicht drivers ready
driver = irrIrrlichtDeviceGetVideoDriver()
scene = irrIrrlichtDeviceGetSceneManager()
gui = irrIrrlichtDeviceGetGUIEnviroment()
 
--title in window
irrIrrlichtDeviceSetWindowsCaption("Example 1")
 
--add gui text
irrIGUIEnviromentAddStaticText(gui,"Hello World",rect,TRUE,FALSE,irrIGUIElementGetNull(),irrGetDefaultID(),TRUE)
 
--load mesh and set node
atom mesh = irrISceneManagerGetMesh(scene,"sydney.md2")
 
atom node = irrISceneManagerAddAnimatedMeshSceneNode(scene,mesh)
 
--Setup node
if node then
    atom tex
    atom sn = irrIAnimatedMeshSceneNodeGetSceneNode(node)
    irrISceneNodeSetMaterialFlag(sn,irr_video_EMF_LIGHTING(),FALSE)
   
    irrIAnimatedMeshSceneNodeSetFrameLoop(node,0,157)
   
    tex = irrIVideoDriverGetTexture(driver,"sydney.bmp")
    irrISceneNodeSetMaterialTexture(sn,0,tex)  
end if
 
 
--Display using Camera
irrISceneManagerAddCameraSceneNode(scene,irrISceneNodeNull(),campos,camat,TRUE)
 
--Run Irrlicht
while irrIrrlichtDeviceRun() do
 
    atom key = get_key()
   
    irrIVideoDriverBeginScene(driver,TRUE,TRUE,col)
   
    irrISceneManagerDrawAll(scene)
   
    irrIGUIEnviromentDrawAll(gui)
   
    irrIVideoDriverEndScene(driver)
   
    if key = 27 then
        irrIrrlichtDeviceClose()
    end if
 
end while
 
--Cleanup
irrDimension2duDelete(dims)
irrSColorDelete(col)
irrVector3dfDelete(campos)
irrVector3dfDelete(camat)
irrRectiDelete(rect)
irrIrrlichtDeviceDrop()
 


You can get it here: http://rapideuphoria.com/euirr.zip
Last edited by GameDude on Tue May 23, 2017 5:50 pm, edited 1 time in total.
GameDude
 
Posts: 488
Joined: Thu May 24, 2007 12:24 am

Re: EuIrr - Euphoria Wrapper for Irrlicht

Postby CuteAlien » Tue May 23, 2017 9:42 am

Huh, such an old language and I've never heard of it. But I never owned an Atari back then, guess they never ported it to Commodore machines ;-)
Nice to see another Irrlicht port. Your link does not seem to work by the way (getting 404's).
IRC: #irrlicht on irc.freenode.net
Code snippets, patches&stuff: http://www.michaelzeilfelder.de/irrlicht.htm
Free racer created with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
User avatar
CuteAlien
Admin
 
Posts: 8255
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany

Re: EuIrr - Euphoria Wrapper for Irrlicht

Postby GameDude » Tue May 23, 2017 5:52 pm

The new Euphoria has been made for new machines. It runs on Windows, Linux, FreeBSD, and Mac. You can find it here. http://openeuphoria.org/wiki/view/DownloadEuphoria.wc
Its still an interpeted language, but it has a lot of neat features. It is also very easy to wrap C libraries with this language. I've also updated the link, it should work now.
GameDude
 
Posts: 488
Joined: Thu May 24, 2007 12:24 am


Return to Project Announcements

Who is online

Users browsing this forum: No registered users and 1 guest