Ninfa3D wrapper

Advanced game related topics
Machiavelli
User
User
Posts: 26
Joined: Sun May 24, 2009 2:38 pm

Ninfa3D wrapper

Post 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 :)
tmyke
Enthusiast
Enthusiast
Posts: 132
Joined: Fri Sep 29, 2006 1:10 pm
Location: France

Post 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:
Strength and wisdom.
Image
Machiavelli
User
User
Posts: 26
Joined: Sun May 24, 2009 2:38 pm

Post by Machiavelli »

hmm... hehe.. why it doesn't work with my old code?)
ok, thx :)
tmyke
Enthusiast
Enthusiast
Posts: 132
Joined: Fri Sep 29, 2006 1:10 pm
Location: France

Post 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
:)
Strength and wisdom.
Image
real
User
User
Posts: 49
Joined: Fri Oct 08, 2004 5:17 am

Post 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? :?
Windows 7 x64, PureBasic 4.31 & 4.40b4 x86
Machiavelli
User
User
Posts: 26
Joined: Sun May 24, 2009 2:38 pm

Post by Machiavelli »

all functions works only after InitEngine()
real
User
User
Posts: 49
Joined: Fri Oct 08, 2004 5:17 am

Post 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
Windows 7 x64, PureBasic 4.31 & 4.40b4 x86
Post Reply