indielib.com

IndieLib Forum
It is currently Sun Nov 19, 2017 5:28 pm

All times are UTC




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Tue Jan 27, 2009 11:13 pm 
Offline

Joined: Sun Jan 18, 2009 12:42 pm
Posts: 8
Hello,

I made a C++/cli wrapper for IndieLib to harness it's abilities from all managed languages.
I did it mainly for myself, but after a several weeks of work I thought that it may be useful for someone else, so here I am to share it with you.
If you don't want to read all this b/s, links are at the bottom.

License
--------
IndieLib is LGPL, this wrapper is Public domain, weeee~.
But keep in mind, for every person mentioned in credits your karma receives a little boost, and a simple contribution is equivalent of taking ritual walk around holy lake.^_^


Quick Overview
-----------------
The Good:
- It's straightforward wrapper, consistent with the API of IndieLib.
- It's fast, you won't notice wrapper overhead over GPU bound. See for yourself and compare results of the benchmarks.
- IndieLib tutorials were translated as well!
- Since sources are included, build your own debug version and start debugging even the native code!

The Bad:
- It's the same C-style API with minimal additions on the .NET side.
- Since IndieLibNet is a wrapper it introduces additional CPU/memory overhead, but hey, it's really small!

The Ugly:
- I still haven't tried anything really big with IndieLibNet, so I'm sure there are bugs and/or memory leaks.


Getting started
-----------------
I compiled IndieLib from SVN, so I'm suppling compiled dll in the binaries archive.

Binary dll:
- Add IndieLibNet.dll to the references in your project.
- Drop all supplied native dependencies in the build directory.
- Code away.

Using sources:
- You'll need to have Microsoft Visual Studio 2008 installed or be bad enough dude to create your own project in the IDE of your choice.
- Add IndieLibNet project to your solution.
- Open IndieLibNet project properties and set Additional include directories (C++ tab) to your IndieLib headers path.
- Also set Additional library directories (Linker tab) to your IndieLib lib path.
- While still on it, set output path to your like.
- Drop all IndieLib native dependencies in the output path.
- Build it and you're all set.


Documentation
-----------------
What's a documentation? >_<
Seriously, it's just a plain wrapper, so all you have is IndieLib commentaries carefully converted into xmldoc and available via Intellisence(tm)/Object browser.
For everything else visit official website.


Making IndieLibNet a better place to code
-----------------------------------------------
I'm really grateful for all the feedback I can get, so if you wish to point out some obvious bugs, give me some patches, write a poem of glory and despair or contribute in some other way, don't hesitate, contact me today!

Since I think that wrappers without source code is virtually unusable, I will include sources, so feel free to experiment with them.
Sadly, as you could have guessed already, I don't have any developer's references or stuff like that. So if you're going to dive into the code, do so on your own risk.
Currently, IndieLibNet don't have any source controls associated, so no svn patches for me T_T


Give me some links already!
--------------------------------
I didn't want to bother with codeplex or sourceforge, sooo~ sorry, but you will have to download plain archives from some really ugly place. To begin downloading click on the large zipped folder icon:
Sources and tutorials
Binaries


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 28, 2009 3:01 am 
Offline
User avatar

Joined: Fri Jan 09, 2009 5:43 am
Posts: 21
Sorry for the noob question. What is a wrapper and what functionality does it add?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 28, 2009 7:33 am 
Offline

Joined: Sun Jan 18, 2009 12:42 pm
Posts: 8
When you want to use some C++ code from, say, C#, Vb.net, Haskell, Nemerle, F#, whatever else .Net language, you have two choices.

First is the explicit PInvoke, called "bindings" by many, when C++ code is imported via dll and caller with various metadata attributes defines how the native code is to be called and data accessed. Basically, you just write a new signatures for imported functions.

Second is implicit PInvoke, called "wrapper" by many. By using C++/CLI, you may use the managed heap and native memory at the same time, so all you need to do is to wrap native classes in their managed counterpart. Hence the name, wrapper.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 28, 2009 11:10 am 
Offline
Site Admin
User avatar

Joined: Wed Dec 26, 2007 1:38 am
Posts: 626
Location: Murcia, Spain
:shock: :shock: :shock: :shock: :shock: :shock:

This is... AWEASOME.

What a HUGE work. So, this means... IndieLib is now working in C#? This could be the first step in order to port IndieLib to XBOX, what do you think?

Let me take a look at it, but this deserves it's own section in the webpage, it's own repository, references in the wiki, a marble statue for you, etc. I'll take a look at it tonight :), thank you very much!

Really good work!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 28, 2009 9:15 pm 
Offline

Joined: Sun Jan 18, 2009 12:42 pm
Posts: 8
Thank you for your kind words.

IndieLib is now available not only in C#, but in every .NET language (at least in theory :P), and there are plenty of them around.

If you meant xbox 360, someone will have to completely rewrite IndieLib from scratch using C# and XNA, since you can't use unsafe code, pointers and PInvoke of any kind on xbox 360. Of course, this is possible, everything is possible, but quite hard, at least as I can tell.

I intend to try and maintain my wrapper, maybe someone will add something, so repository would be nice. I put high hopes into IndieLib ^_^

Of course, if you'll look at it,please tell me what can be improved.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 28, 2009 10:49 pm 
Offline

Joined: Sat Aug 02, 2008 10:37 pm
Posts: 4
Vigil just say: THANK YOU AND AMAZING WORK. GREAT JOB!!!

INDIE LIB ON XBOX?? YAYYY!!!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2009 9:30 am 
Offline

Joined: Sun Jan 18, 2009 12:42 pm
Posts: 8
Err, Yens, forgive me if I was unclear, what I meant to say is that my work won't help to bring indielib on xbox 360, since you can't just wrap native code, you have to write everything from scratch using C# instead of C++ and xna instead of directx.

My work serves another purpose, to help rising game developers forget about enormous quantity of C++ pitfalls and have a power of the .net framework at their disposal thus improving prototyping speed.

For now managed wrapper is somewhat "beta", but I released it anyway, maybe someone will use it and find bugs I don't know of:)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2009 11:41 am 
Offline
Site Admin
User avatar

Joined: Wed Dec 26, 2007 1:38 am
Posts: 626
Location: Murcia, Spain
Quote:
My work serves another purpose, to help rising game developers forget about enormous quantity of C++ pitfalls and have a power of the .net framework at their disposal thus improving prototyping speed.


And that's what I call a BIG work.

Do you think you will be able to maintain the project alive along IndieLib development? I mean, to update the wrapper every time there is a new release.

I think this project needs a proper section on the webpage, wiki, forum, FAQ and menu. And that the repository should be in the same Asembla Code repository as IndieLib. And a bit of "marketing" talking about that in .NET development forums, etc.

Are you agree with that? :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2009 4:18 pm 
Offline

Joined: Sun Jan 18, 2009 12:42 pm
Posts: 8
I certainly will fix bugs and update wrapper to take advantage of new IndieLib releases, that's what I intended to do anyway, regardless of the level of community support.

I guess it would be alright to create it's own little place on the website, but as you've probably guessed already, my english is rather funny if not outright horrible:)

So all in all I agree with you, except for the marketing bit. Shareware developers are currently limited to C++ due to the publisher's constraints and estabilished frameworks like popcap's, hge, etc, everyone else is using whatever they want and I think it's not possible to change one's mind.

At least not for now, since IndieLib lacks unicode support, particles and gui, and those are among the most essential features to win developers' hearts, especially considireng that it's impossible to find such complete engine even among xna-based projects. The most feature-complete looking one is IceCream engine, and it's not even out yet.
Yet I believe sooner or later these features will be added to IndieLib, call me an optimist:)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 04, 2009 9:27 pm 
Offline
User avatar

Joined: Sat Dec 20, 2008 8:46 pm
Posts: 137
Location: Sweden
Truly great work.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 29, 2010 2:58 am 
What is a wrapper and what functionality does it add?


Top
  
 
 Post subject:
PostPosted: Fri Mar 11, 2011 5:50 am 
How to end a C program but not within the main() function? I'm trying to end a C program from another function within main() is there any way i can do this?
__________________________


Last edited by jekonaa on Sat Mar 12, 2011 12:07 pm, edited 1 time in total.

Top
  
 
 Post subject:
PostPosted: Fri Mar 11, 2011 11:47 am 
Offline
Site Admin

Joined: Thu Jul 16, 2009 1:52 pm
Posts: 250
Location: London, UK
You need exit from stdlib.

http://www.cplusplus.com/reference/clibrary/cstdlib/exit/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group