home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


Sauerbraten in a dll

by PlateWolf on 07/24/2006 01:50, 45 messages, last message: 03/24/2008 16:27, 15647 views, last view: 06/26/2024 11:27

Hi, I want to access Sauerbraten externally, did anyone managed to compile it in a dll ?
(Like SDL for example).

Go to first 20 messagesGo to previous 20 messages    Board Index    Go to next 20 messagesGo to last 20 messages

#23: Re: ..

by fdshjkfhsdkconorhfsdjk on 03/18/2008 04:19, refers to #22

what can be done with a dll vs exe.

reply to this message

#24: ..

by ezombie on 03/18/2008 04:26

I think they want to link to it from another language - like VB, C#, D, C-, Python, Ruby, Perl, PHP, Lua - just about anything that can load and call shared libraries.

Of course it matters *what* is in the DLL versus what is in the EXE. You must put enough in the DLL to be useful to another EXE, but no so much that it restricts what you can make...

reply to this message

#25: Re: ..

by MovingTarget on 03/18/2008 13:11, refers to #22

The list would be two long. Make two duplicate projects, and in one, delete the fpsgame and rpggame folders from the headers and source in the project, and in the other, delete the engine stuff. DO NOT DELETE THE SHARED STUFF! (I wonder why it's called that :D)

reply to this message

#26: ..

by 9382938475 on 03/18/2008 14:29

isn't making the engine a shared library a bit backwards? I'd imagine that it'd be much simpler instead to make the games sharedlibs and have the engine load them. basically just have the game code declare a func like:

const igame *_registergame(void)

which returns the game/mod. am I missing something?

reply to this message

#27: Re...

by StickyFeet on 03/18/2008 14:46

MovingTarget, not really following your description here, its very vague and generalised?

reply to this message

#28: Re: Re...

by MovingTarget on 03/18/2008 15:50, refers to #27

Go into the src/mingw subdirectory of the Sauer base folder. Duplicate the sauerbraten.cbp projectfile two times. Name one engine.cbp (the DLL project) and name the other one game.cbp (the game that loads/calls the DLL). In engine.cbp, expand the "Sources" folder, go into the "src" subdirectory, and delete the fpsgame and rpggame subdirs. Do the same in the "Headers" folder.

In game.cbp, reverse the process, deleting the enet and engine subdirs from "Sources" and "Headers".

I hope *someone* can figure out how to make engine.cbp build a DLL with a .def file! And they better know how to make game.cbp link to the library generated!!

reply to this message

#29: ..

by HashBox3 on 03/18/2008 23:00

This would be a great way to write games in Java :D You could get the graphical power of Sauerbraten, with the game friendly object orientedness of Java :D

reply to this message

#30: ..

by ezombie on 03/18/2008 23:05

'isn't making the engine a shared library a bit backwards? I'd imagine that it'd be much simpler instead to make the games shared libs and have the engine load them.'

This is how most ID engines do it. It's an effective system. I would personally love this.

'This would be a great way to write games in Java :D You could get the graphical power of Sauerbraten, with the game friendly object orientedness of Java :D'

Muzzah?!? Not sure you get get more OO then C++ - the native language of Sauerbraten. :D

reply to this message

#31: Re: ..

by yoopers on 03/19/2008 20:21, refers to #29

>> This would be a great way to write games in Java :D You could get the graphical power of Sauerbraten, with the game friendly object orientedness of Java :D

If this ever comes to fruition, I volunteer to help with Ruby and Perl bindings - someone else who doesn't cringe at the word "Java" can handle that. I've spent far too much time today debugging what I thought was a Tomcat issue, only to find out it was a Java keystore problem. *sigh*

reply to this message

#32: Re: ..

by MovingTarget on 03/19/2008 20:42, refers to #31

Want me to upload the engine dll?

reply to this message

#33: Re: ..

by yoopers on 03/19/2008 22:50, refers to #32

Upload would be appreciated. :]

Does anyone have a preference between Ruby and Perl? I'll start with whatever would get used by folks.

reply to this message

#34: Re: ..

by MovingTarget on 03/20/2008 00:59, refers to #33

I figured I wouldn't upload the dll directly, so you could tweak it, so I uploaded the two project files (engine.cbp and game.cbp). The only one you're really interested in is engine.cbp. Put 'em both in the src subdir, and you can open/build them.

Engine.cbp:
http://www.mediafire.com/?ymnzitkmbyg

Game.cbp:
http://www.mediafire.com/?zgxcmyi0lzz

reply to this message

#35: ..

by ezombie on 03/20/2008 03:50

Likely Ruby - it is very 'hot' right now. But I do see more Python development going on in games right now, so YMMV...

reply to this message

#36: Re: ..

by SheeEttin on 03/20/2008 03:53, refers to #33

Perl bindings for Sauerbraten?!
Kids these days. What'll they think of next...

reply to this message

#37: ..

by HashBox3 on 03/20/2008 20:57

ezombie, you do have a very good point ;)

reply to this message

#38: Re: ..

by yoopers on 03/21/2008 00:55, refers to #34

@MovingTarget: you are a scholar and gentleman. :]

@SheeEttin: I have to caveat the following by saying I was bored at work today. With that in mind:

perl "I am not a kid ;]" 2>&1| \
perl -pe's/^.*?\"(.*?)not a kid.*?\".*?$/\
$1\x74\x68\x65\x20\x77\x61\x6c\x72\x75\x73\x2c\x20\x63\x6f\x6f\x20\x63\
\x6f\x6f\x20\x6b\x61\x20\x63\x68\x6f\x6f/' 2>&1|\
perl -pe's/\n//g';perl -e'print "\n"'

reply to this message

#39: Re: ..

by yoopers on 03/21/2008 01:04, refers to #38

(btw, that was was a Perl quintet for those who aren't familiar ;)

reply to this message

#40: Re: the undead (aka perl)

by ezombie on 03/21/2008 02:56

Ah crud, now where did I put my holy water?

reply to this message

#41: Re: ..

by SheeEttin on 03/21/2008 04:37, refers to #39

Functional, but not especially obfuscated.

I once saw a program/script/thing (pretty sure it was Perl) that'd create a bitmap image based on how the source looked. Character-filled parts would be black, while whitespace would be, well, white.
Tried Google, but I don't see it...

reply to this message

#42: Re: ..

by yoopers on 03/21/2008 05:16, refers to #41

What, the ultra-obscure hex didn't keep you guessing? ;] Man, this damn head cold is killing my Perl buzz. I promise I'll start posting haikus when I feel better.

And for all the Perl advocacy, I'm working on Python bindings for Sauer, although the nested classes in some places means it'll take me a bit longer than I anticipated to create the SWIG interface.

**This message has been ROT13-encoded twice for extra security and for great justice.**

reply to this message

Go to first 20 messagesGo to previous 20 messages    Board Index    Go to next 20 messagesGo to last 20 messages


Unvalidated accounts can only reply to the 'Permanent Threads' section!


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
55270378 visitors requested 73123786 pages
page created in 0.072 seconds using 10 queries
hosted by Boost Digital