Jump to content

Canardia

Developers
  • Posts

    4,127
  • Joined

  • Last visited

Posts posted by Canardia

  1. I would do it like this:

    #include <iostream>
    #include <vector>
    using namespace std;
    
    enum PieceType {Knight,King};
    
    string GetPieceTypeName(PieceType t)
    {
    switch(t)
    {
    	case Knight: return "Knight"; break;
    	case King  : return "King"; break;
    	default: return "Piece"; break;
    }
    }
    
    class Piece
    {
    PieceType type;
    public:
    void SetType(PieceType t)
    {
    	type=t;		
    }
    PieceType GetType()
    {
    	return type;
    }
    void Move()
    {
    	cout << GetPieceTypeName(GetType()).c_str() << " moved." << endl;
    }
    };
    
    int main()
    {
    vector<Piece> piece;
    Piece newitem;
    
    newitem.SetType(Knight);
    piece.push_back(newitem);
    
    newitem.SetType(King);
    piece.push_back(newitem);
    
    piece.at(0).Move();
    piece.at(1).Move();
    
    return 0;
    }

  2. A Linux version is actually as close as me getting the first cup of coffee with milk on the coming Saturday, and pressing the compile button when I multi-booted into Debian (I need to do some preparations first, like installing the newest BlitzMax for Linux (had some problems with openSUSE earlier since it conflicted in the GNU C++ version, but Debian might just work fine)). We'll see what happens, at some point there were some Windows specific bindings (like the TTF font function, but that has been long gone since), but at the moment I can't recall any, so it might just work :D

  3. Yes, I'm absolutely sure, since LE's dll uses stdcall convention, which is the standard calling convention for any and all Windows programs. Heck, you could even use LE with Fortran, Lisp, ADA or COBOL :D

     

    I've played around with Irrlicht also, but I don't know why they can't manage to unify their code. Well, it's not as clean as Ogre, but it has better model support (which a game engine doesn't even need). Irrlicht has also a custom software renderer, which is nice, but the visual quality is quite horrible :P

     

    The source of LE is not included in the SDK. It's a special license, from which the only public information is that such thing exists. Many other engines have a similar convention too, source is not officially marketed, but when asking about it, you will find that there is indeed such an option. Source owners don't usually do anything with it, they just need it as a business backup in case the original manufacturer is not in business anymore.

  4. I don't know how you can do any of the tutorials without having the registration key. When you have your LE license key, you can download all tutorials and updates to the engine. Nobody can send you any LE related files, as it's strictly forbidden in the EULA. The same goes for models, music and all kind of stuff made by other companies too, so there's nothing new about that.

  5. LE is partly written in BlitzMax, some functions are in C++ (newton.dll is completely written in C++), but most functions are written in OpenGL and GLSL. I guess in future more and more functions will be written in C++ to replace the BlitzMax functions, since it can be done on-the-fly, as BlitzMax can compile BlitzMax, C/C++ and Assembler code directly.

  6. It's not that simple. I would also need BlitzMax C++ compiler (bcc.exe) source code in order to compile LE with VC++. It was available earlier, but I think it's not available anymore. However, I've played around with converting few functions to C++, but it's a huge job to convert everything to native C++.

     

    Meanwhile, I reran all the speed tests again, and Debian GNU C++ wins!

    I remembered wrong, VC++ was not 2.5 times slower than GNU, but still a lot slower.

    Currently MinGW is 1.902 times slower than VC++, and VC++ is 1.315 times slower than GNU:

    MinGW default:

    Speedtest 1.0 © 2008 Siipi

    Counting 10 billion floating points...

    Done. i=1410063201, n=100000.000003, time=41.594000s.

    Creating and deleting 1 billion class objects...

    Done. i=100000000, time=16.937000s.

    Total time=58.531000s.

     

     

    VC default:

    Speedtest 1.0 © 2008 Siipi

    Counting 10 billion floating points...

    Done. i=1410063201, n=100000.000003, time=41.609000s.

    Creating and deleting 1 billion class objects...

    Done. i=100000000, time=15.469000s.

    Total time=57.078000s.

     

     

    VC -O3:

    Speedtest 1.0 © 2008 Siipi

    Counting 10 billion floating points...

    Done. i=1410063201, n=100000.000003, time=41.593000s.

    Creating and deleting 1 billion class objects...

    Done. i=100000000, time=15.453000s.

    Total time=57.046000s.

     

     

    MinGW -O3 -mtune=i686:

    Speedtest 1.0 © 2008 Siipi

    Counting 10 billion floating points...

    Done. i=1410063201, n=100000.000003, time=37.437000s.

    Creating and deleting 1 billion class objects...

    Done. i=100000000, time=15.766000s.

    Total time=53.203000s.

     

     

    VC IDE default:

    Speedtest 1.0 © 2008 Siipi

    Counting 10 billion floating points...

    Done. i=1410063201, n=100000.000003, time=15.078000s.

    Creating and deleting 1 billion class objects...

    Done. i=100000000, time=12.953000s.

    Total time=28.031000s.

     

     

    VC IDE -O3:

    Speedtest 1.0 © 2008 Siipi

    Counting 10 billion floating points...

    Done. i=1410063201, n=100000.000003, time=15.078000s.

    Creating and deleting 1 billion class objects...

    Done. i=100000000, time=12.890000s.

    Total time=27.968000s.

     

     

    openSUSE 11.2 GNU -O3 -mtune=i686:

    Speedtest 1.0 © 2008 Siipi

    Counting 10 billion floating points...

    Done. i=1410065408, n=100000.000009, time=16.060000s.

    Creating and deleting 1 billion class objects...

    Done. i=100000000, time=5.310000s.

    Total time=21.370000s.

     

     

    Debian 5.0 GNU -O3 -mtune=i686:

    Speedtest 1.0 © 2008 Siipi

    Counting 10 billion floating points...

    Done. i=1410065408, n=100000.000009, time=16.650000s.

    Creating and deleting 1 billion class objects...

    Done. i=100000000, time=4.620000s.

    Total time=21.270000s.

  7. Yeah, I have the benchmark programs still somewhere, but I could rerun them for the current versions of MinGW/VC/GNU to see if anything has changed. I used all possible optimizations also, and got some more speed out of MinGW too than with its default settings.

  8. You can use the same dll with any programming language, so it's the same also which C++ compiler you use.

    A Linux port would be very interesting, since currently LE is compiled using MinGW C++, which is a GNU C++ port to Windows, but it's much slower than the real GNU C++ under Linux. Under Linux, BlitzMax uses the real GNU C++, which makes about 400% (=5 times) faster code than BlitzMax under Windows, if you do the math: MinGW is 2.5 times slower than VC++, VC++ is 2.5 times slower than GNU C++.

  9. When you export to obj, you must provide the mtl file too. The obj file alone is not the complete model, since half of the information is stored in the mtl file. So, obj+mtl must be always together.

     

    In addition, UU3D Pro needs also the textures. If you don't have the textures available when importing and exporting, they will be removed from the model.

     

    When you have obj+mtl+dds (or any other texture format) available, then UU3D Pro works fully automatic, and you don't need to do anything else than save as GMF.

  10. Framewerk is not only post-processing, but it also provides water with physics, and transparency for windows and other transparent objects. That's quite important for games too. Everyone should use framewerk, else you spend 90% of your time writing your game with things which framewerk already does for you, instead of spending your time on the actual game.

  11. In the gamelib demo you can find a volume trigger. It's used to change the ambient light inside/outside the pyramid, and its placed at the entrance of the pyramid.

  12. It works fine for me. One thing I noticed though with the export from 3DSMax9 is that you need to export 3 loops of each animation to the same gmf, since 3DSMax9 doesn't export the animation frames correctly when you're using some bezier curves in the animation. But with 3 loops, the middle sequence will be complete with all frames.

  13. You could put each frame as a jpg file in a pak file, and then load each pictures into memory. Then you can "playback" the images from memory at any speed you want, along with playing an ogg sound for the soundtrack.

  14. There's really nothing much to do in order to load a scene with lights, sounds and all scripts. Just a simple LoadScene() is enough:

    --Register abstract path
    RegisterAbstractPath("")
    
    --Set graphics mode
    if Graphics(1024,768)==0 then
    Notify("Failed to set graphics mode.",1)
    return
    end
    
    --Create framewerk object and set it to a global object so other scripts can access it
    fw=CreateFramewerk()
    if fw==nil then
    Notify("Failed to initialize engine.",1)
    return
    end
    SetGlobalObject("framewerk",fw)
    
    camera=fw.main.camera
    camera:SetPositionf(0,2,-2)
    
    scene=LoadScene("abstract::testscene.sbx")
    
    while AppTerminate()==0 do
    fw:Update()
    fw:Render()
    Flip(0)
    end

  15. It was not left out, but dofile() is a native LUA command. LE would have to do it's own DoFile() command which supports abtract paths, or you can use dofile(AbstractPath("abstract::somefile.lua")), theoretically at least.

  16. What if a black hole is dragged into another black hole, wouldn't there the terminal velocity exceed lightspeed, since space and time is bent, so that no other object could even come close to reaching the same terminal velocity being dragged in either black hole?

    Newton's formula lacks that component. However, if you use Newton's formula of gravitational force between two masses, and assume the distance is limes 0, you get also very interesting results :)

×
×
  • Create New...