Jump to content

  • Log In with Google      Sign In   
  • Create Account

Tiny2D - new 2D C++ game library


Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
12 replies to this topic

#1   Members   

201
Like
3Likes
Like

Posted 17 January 2014 - 05:53 AM

Hi everyone,

 

I have just open sourced my 2D game library called Tiny2D.

 

My focus with this library was on being easy and quick to use. Minimum code, maximum effect. Whether you plan to develop commercial game or just taking part in some game jam, you might be interested.

 

Current feature set includes:

  • animated sprites
  • particle effects
  • shader based materials
  • render targets
  • some built-in postprocessing filters
  • asynchronous resource loading
  • audio

Home page: http://tiny2d.pixelelephant.com

Blog: http://gamedevcoder.wordpress.com/2014/01/16/tiny2d/

GitHub: https://github.com/macieks/Tiny2D

 

Any feedback welcome!

 

Maciej


Maciej Sawitus
my blog | my games

#2   Members   

532
Like
0Likes
Like

Posted 17 January 2014 - 07:31 AM

Sounds good!

 

I'd update your website with some screenshots or example content ;)



#3   Members   

201
Like
0Likes
Like

Posted 22 January 2014 - 02:49 AM

Good point! Going to put some screenshots in there soon.

 

Cheers!


Maciej Sawitus
my blog | my games

#4 fir   Members   

-464
Like
0Likes
Like

Posted 22 January 2014 - 04:31 AM

I would like it more if it would be c library



#5   Members   

201
Like
0Likes
Like

Posted 23 January 2014 - 08:16 AM

I would like it more if it would be c library

 

Why is that? smile.png

 

I love C and I prefer it in many cases (over C++) but C++ proved to result in a bit cleaner and more robust API than it would have been in C.

 

In fact I have initially coded Tiny2D in C but switched to C++ later on. The main reason for that was automatic destruction of objects via destructor. The only little thing I don't like about Tiny2D interface now is that you still see an internal private pointer inside of the class' declaractions (see the main header file https://github.com/macieks/Tiny2D/blob/master/Include/Tiny2D.h ) - e.g. MaterialObj* obj inside of Material. Ideally I'd like to hide that from the user. In C, it wouldn't have been an issue. But overall I think this is very minor.


Edited by MickeyMouse, 23 January 2014 - 08:17 AM.

Maciej Sawitus
my blog | my games

#6 fir   Members   

-464
Like
0Likes
Like

Posted 23 January 2014 - 01:00 PM

 

I would like it more if it would be c library

 

Why is that? smile.png

 

 

 

Well i will not tell you nothing interesting, I just prefer c as language and c libs over c++ libs.

I never used c++ style lib from c - do you think that using it 

from c would be hard? could you maybe explain a bit?



#7   Members   

201
Like
0Likes
Like

Posted 23 January 2014 - 02:21 PM

 

 

I would like it more if it would be c library

 

Why is that? smile.png

 

 

 

Well i will not tell you nothing interesting, I just prefer c as language and c libs over c++ libs.

I never used c++ style lib from c - do you think that using it 

from c would be hard? could you maybe explain a bit?

 

Many compilers allow you to mix C with C++. Since C is a mostly just a subset of C++, you can have all of your code in C if you like and still use Tiny2D which is in C++. You just have to tell the compiler that the files using Tiny2D shall be compiled with C++, not C, compiler - typically you just need to set their extension to .cpp instead of .c


Maciej Sawitus
my blog | my games

#8 fir   Members   

-464
Like
0Likes
Like

Posted 23 January 2014 - 03:09 PM

Many compilers allow you to mix C with C++. Since C is a mostly just a subset of C++, you can have all of your code in C if you like and still use Tiny2D which is in C++. You just have to tell the compiler that the files using Tiny2D shall be compiled with C++, not C, compiler - typically you just need to set their extension to .cpp instead of .c

 

that would break my rule of not using c++ ;\



#9   GDNet+   

4333
Like
1Likes
Like

Posted 23 January 2014 - 07:24 PM

Many compilers allow you to mix C with C++. Since C is a mostly just a subset of C++, you can have all of your code in C if you like and still use Tiny2D which is in C++. You just have to tell the compiler that the files using Tiny2D shall be compiled with C++, not C, compiler - typically you just need to set their extension to .cpp instead of .c


Not quite. You can mix C with your C++ source and compile as C++ mostly as-is (excepting a few corner cases), but it doesn't work the other way unless you have a C interface in the C++ headers. Take a look at SFML for an example of what I mean. It's usable from C, but only through the CSFML API, which wraps the C++ API. A C interface is also useful for creating bindings to other languages. The C ABI and calling convention is about as universal as you can get, something that is not true of C++.

Edited by Aldacron, 23 January 2014 - 07:24 PM.


#10   Members   

201
Like
0Likes
Like

Posted 24 January 2014 - 03:51 AM

unless you have a C interface in the C++ headers.

 

That's what I was thinking. Basically write all of _your_ code in C but compile with C++ compiler. That way you can use external C++ code.

 

And yeah, good point about C interface being great for doing all kinds of language bindings. With some effort I'd probably manage to extract pure C interface out of my library for that purpose.


Edited by MickeyMouse, 24 January 2014 - 03:52 AM.

Maciej Sawitus
my blog | my games

#11 fir   Members   

-464
Like
0Likes
Like

Posted 24 January 2014 - 04:34 AM

 

And yeah, good point about C interface being great for doing all kinds of language bindings. With some effort I'd probably manage to extract pure C interface out of my library for that purpose.

 

you should do that



#12   Members   

367
Like
0Likes
Like

Posted 26 January 2014 - 09:21 AM

Impressive, the code looks clean and simple yet powerful and OO which is a huge advantage for me. I must say well done. How long did it take to create the engine?



#13   Members   

201
Like
0Likes
Like

Posted 26 January 2014 - 03:03 PM

How long did it take to create the engine?

 

Took about 5 months by now but I've only worked on it in my spare time which I didn't have too much recently. On average probably less than 1 hour a day.


Maciej Sawitus
my blog | my games




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.