EuIrr - Euphoria Wrapper for Irrlicht

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
GameDude
Posts: 498
Joined: Thu May 24, 2007 12:24 am

EuIrr - Euphoria Wrapper for Irrlicht

Post by GameDude »

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

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.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: EuIrr - Euphoria Wrapper for Irrlicht

Post by CuteAlien »

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.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
GameDude
Posts: 498
Joined: Thu May 24, 2007 12:24 am

Re: EuIrr - Euphoria Wrapper for Irrlicht

Post by GameDude »

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