Interactive PowerBasic Forum

General Category => Third-Party Add-Ons => Topic started by: Brice Manuel on October 14, 2011, 06:30:26 PM

Title: SoftPixel Engine -- Free 3D engine
Post by: Brice Manuel on October 14, 2011, 06:30:26 PM
Here is another free 3D engine that would be perfect for use with PowerBASIC.  It is very full-featured.  It currently does not have a PowerBASIC wrapper, but it would be easy to work from the BlitzBasic wrappers.


http://softpixelengine.sourceforge.net/
http://softpixelengine.sourceforge.net/features.html


It could be something fun for somebody to play with.
Title: Re: SoftPixel Engine -- Free 3D engine
Post by: Peter Weis on October 14, 2011, 10:46:09 PM
Hello Manuel,

do only once n3xtD ready then we'll see. I do not know if I still feel like doing something else!

regards Peter
Title: Re: SoftPixel Engine -- Free 3D engine
Post by: Theo Gottwald on October 17, 2011, 07:49:05 PM
Peter, maybe it makes sense that you look which ios the better engine and choose to support only the best one?
Title: Re: SoftPixel Engine -- Free 3D engine
Post by: Brice Manuel on October 17, 2011, 08:44:45 PM
In fairness, N3xtD is probably the best of the two, especially for PB users.  N3xtD also has better documentation, more examples and is being actively used by more developers and is based on a well established 3D engine.

SoftPixel is available for more platforms, but obviously this is not beneficial to PB users.  SoftPixel also needs the wrapper DLL to access the engine DLL.  This makes for a slightly convoluted distribution.

Both have their pros and cons.  Choice is always good no matter what. :)

I am merely posting something I think could be beneficial to some PB users. ;D
Title: Re: SoftPixel Engine -- Free 3D engine
Post by: Peter Weis on October 17, 2011, 09:11:55 PM
Hi Theo,
I look at them again, but first I'm n3xtD error free
Do you really think that it is the better engine? :)
Maybe I did not do so many problems with ASCIZ
regards Peter
Title: Re: SoftPixel Engine -- Free 3D engine
Post by: Peter Weis on October 17, 2011, 09:22:16 PM
Hello,
n3xtD has problems with ASCIZ whom you pass an empty string, the program will crash because Powerbasic byval passes zero. What is actually correct. n3xtD expects a pointer to an empty String, ByVal therefore not zero! I am the now passed over for a function!
See the example:

GLOBAL nullstr AS ASCIZ * 10     

DECLARE FUNCTION NX3_AddItem_GUIComboBox CDECL LIB "N3XTD.DLL" ALIAS "_AddItem_GUIComboBox"(_
    BYVAL combo AS IGUIComboBox, _
    BYREF pbTEXT AS ASCIZ) AS LONG

FUNCTION AddItem_GUIComboBox CDECL(BYVAL combo AS IGUIComboBox, BYREF pbTEXT AS ASCIZ) AS LONG
    DIM a AS ASCIZ PTR
    IF pbtext <> "" THEN
        ASM mov eax, pbTEXT
        ASM mov a, eax
    ELSE
        a = VARPTR(Nullstr)
    END IF
    FUNCTION = NX3_AddItem_GUIComboBox(combo, BYVAL a)

END FUNCTION       


regards Peter













Title: Re: SoftPixel Engine -- Free 3D engine
Post by: José Roca on October 17, 2011, 11:42:25 PM
This is shorter and easier:


FUNCTION AddItem_GUIComboBox (BYVAL combo AS IGUIComboBox, BYVAL strText AS STRING) AS LONG
   FUNCTION = NX3_AddItem_GUIComboBox(combo, BYVAL STRPTR(strText))
END FUNCTION       

Title: Re: SoftPixel Engine -- Free 3D engine
Post by: Peter Weis on October 18, 2011, 07:08:18 PM
Hello Jose,

Thanks again for the tip :)

regards Peter
Title: Re: SoftPixel Engine -- Free 3D engine
Post by: Theo Gottwald on October 19, 2011, 07:10:51 AM
OK, this comparison is good to know. "Error free" sounds good, because this is also the strength of PowerBasic.