Page 1 of 1

Ninfa3D wrapper

Posted: Mon Jun 01, 2009 11:10 am
by Machiavelli
anyone have working wrapper for this engine? ( http://www.mysticrealitystudio.comuv.com/ )

i'm try to write wrapper, but it doesn't work, main InitEngine() function open a freezed window :(
here is that wrapper - http://depositfiles.com/files/f1k2k7pni

sorry for my bad english :)

Posted: Mon Jun 01, 2009 5:00 pm
by tmyke
I just tested with this code and it seems that it run fine

Code: Select all

IncludeFile "ninfa3D.pbi"

nEnableVsync()

nInitEngine(640, 480, 32, 0)
nAppTitle(":sob:")

  	nBackGroundColor(0,0,128)
	  nAmbientLight(64,64,64)
	  *camera.l = nCreateCamera()
	  nPositionEntity(*camera, 0,0,-10)

	  *cube.l = nCreateMeshCube()
	  nPositionEntity(*cube, 0,0,0)
	  nRotateEntity(*cube, 40,45,0)
	  
Repeat

    nBeginScene()
    
      If nKeyHit(#KEY_ESCAPE) 
       nCloseEngine()
      EndIf; 
      
    nUpdateEngine(0)
      
	  nEndScene(); 
Until nEngineRun()<1
No ? :roll:

Posted: Mon Jun 01, 2009 5:26 pm
by Machiavelli
hmm... hehe.. why it doesn't work with my old code?)
ok, thx :)

Posted: Mon Jun 01, 2009 5:30 pm
by tmyke
With the code give above, I have no problem (Windows XP) and I tried it on two computers without problems. ;)

Here's what I get:

Image

and inside the main loop, you must write (Minimum code, it seems to me) :

Code: Select all

Repeat

  nBeginScene()

   nUpdateEngine(0)

   nEndScene();

Until nEngineRun()<1
while the engine is running, nEngineRun () return '1 '.
As soon as you execute nCloseEngine (), then nEngineRun() return 0.

moreover, it would certainly be better to write like this:

Code: Select all

Repeat

    
   If nKeyHit(#KEY_ESCAPE) 
       nCloseEngine()
   EndIf; 

    nBeginScene()
      nUpdateEngine(0)
	  nEndScene()
	  
Until nEngineRun()<1
:)

Posted: Sat Jun 06, 2009 10:47 am
by real
Nice engine and great idea to wrap it... :idea: But I can't get it run. :(

Every try to call an engine command (e.g. nEnableVsync()) causes an 'Invalid memory access. (write error at address 0)'.

Does anybody know what to do? :?

Posted: Sun Jun 07, 2009 6:49 pm
by Machiavelli
all functions works only after InitEngine()

Posted: Mon Jul 06, 2009 7:34 pm
by real
Here is the pbi for version 1.0e plus one example. You still need to download the Ninfa3D package for media stuff and ninfa3d.dll.

And: it's only a test of a parser to automatically convert ninfa3d.bi to ninfa3d.pbi to make it available for PB users. I had to correct it a little, so the code is quick and dirty...

Link