Saturday, December 28, 2013

Source code snapshot [28th Dec 2013]

The latest snapshot adds many new interesting features:

API Additions
  • Added SDLU::RWops cxx class
  • Added SDLU_GL_RenderCacheState() and SDLU_GL_RenderRestoreState(), which enable mixing pure OpenGL calls with the SDL2 Render API
API Changes
  • SDLU_SaveIniRW() and SDLU_LoadIniRW() now have a freesrc parameter
  • OpenGL functions are dynamically loaded, so we don't have to link to -lGL
Build System
  • Added configure script for the tests
  • You can now build deb and rpm packages using CMake
  • Check for std::string support
I have uploaded the source code snapshots as zip or tar.gz archives in the Downloads section of the repository over at bitbucket. The snapshots contain the latest source code, along with pre-generated documentation by doxygen.

If you have a copy of the git repository, the snapshot is tagged with the name snapshot-281213. (281213 stands for 28/12/13, I just don't like having slashes '/' in the tag name).
As always please test the library, run the test programs and report issues at the issue tracker.

-- Aggelos Kolaitis

New OpenGL API: Mix pure OpenGL calls with the SDL2 Render API!

Hello fellow programmers!


I'm writing this post to announce the new API that was added in the library only yesterday, namely SDLU_GL_RenderCacheState() and SDLU_GL_RenderRestoreState().

These two functions allow you to mix pure OpenGL, OpenGL ES or OpenGL ES 2 calls with the SDL2 Render API. They dynamically load the required OpenGL symbols that are used, and so all OpenGL libraries (desktop GL, GLES, GLES2) are supported.

Example:

SDL_RenderClear(sdl_renderer);
SDL_RenderDrawPoint(sdl_renderer, 100, 100);

SDLU_GL_RenderCacheState(sdl_renderer);
glColor3f(1,0,0);
glRecti(150, 150, 200, 200);
SDLU_GL_RenderRestoreState(sdl_renderer);

SDL_RenderPresent(sdl_renderer); 
 
For a complete example, you might want to check out testrender2 (link).

-- Aggelos Kolaitis

Wednesday, December 18, 2013

Source code snapshot [18/12/13]

The following new things are included in the source code snapshot:

Build System:
  • Added '--enable-cxx' and '--enable-debug' configure options
  • Initial support for cross-compilation of the Raspberry Pi port from Linux
  • Many bug fixes in the build system
  • Added sdlu-config script 
API Additions:
  • Added ini file handling API
  • Added new math API (for vector manipulation)


I have uploaded the source code snapshots as zip or tar.gz archives in the Downloads section of the repository over at bitbucket. The snapshots contain the latest source code, along with pre-generated documentation by doxygen.

If you have a copy of the git repository, the snapshot is tagged with the name snapshot-181213. (181213 stands for 18/12/13, I just don't like having slashes '/' in the tag name).

As always please test the library, run the test programs and report issues at the issue tracker.

-- Aggelos Kolaitis

Thursday, November 28, 2013

Source code snapshot [28/11/13]

This is the first source code snapshot since the 2.0.1 release. For a list of changes, see the ChangeLog.

I have uploaded the source code snapshots as zip or tar.gz archives in the Downloads section of the repository over at bitbucket. The snapshots contain the latest source code, along with pre-generated documentation by doxygen.

If you have a copy of the git repository, the snapshot is tagged with the name snapshot-281113. (281113 stands for 28/11/13, I just don't like having slashes '/' in the tag name).

As always please test the library, run the test programs and report issues at the issue tracker.

-- Aggelos Kolaitis

Tuesday, November 26, 2013

Development State [26/11/13]

  • Over the past two weeks, almost all of my time working with SDLU was spent at updating the build system. Here's the detailed info:

Build System:
  • Added new autotools build system
  • Added CMake build system for the tests
  • Added ability to link to OpenGL ES on desktop platforms [premake]  
  • Fixed compatibility with premake 4.3
  • Lots of bug fixes
API Changes:
    none

Misc Changes:
  • Increased speed of SDLU_RenderSetPoints()
  • Fixed common test code build errors for Android 
  • Removed old-unused code from the Button API
-- Aggelos Kolaitis

Wednesday, November 20, 2013

Autotools build system for SDLU [Updated]

Yeah, you read it right. After expirementing with autotools for a few days, I am proud to announce that the autotools build system (using autoconf, automake and libtool) is almost ready!

Adding an autotools build system (./configure) is in my belief a huge addition, because it makes SDLU much more convenient to build under Linux (mainly because configure does not depend on anything extra installed, other than a basic GNU system).

Of course, there are some things that have to be done first, like extending portability and testing on different GNU hosts (currently it's only tested under Ubuntu and Linux Mint).

I strongly believe that the build system will be ready and in the master repository by the end of this week, if I manage to take some time of studying.

UPDATE:
The autotools build system is now live in the bitbucket repository. Enjoy! (and report any bugs in the issue tracker.

-- Aggelos Kolaitis

Monday, November 11, 2013

Development State [11th November]

This is the first development update since the 2.0.1 release. The last week I didn't do much, but here's the changelog.

API Additions
  • Added button flag SDLU_BUTTON_FOREIGN, which allows you to have buttons without depending on the SDL2 Render API.
API Changes
  • Points in SDLU_RenderDrawPolygon() and SDLU_RenderFillPolygon() should now be passed SDL_Point* lists. 
  • Moved all cxx classes into the namespace SDLU, to make sure that naming collisions are avoided 
Build System
  • Many updates and fixes in the premake and CMake build systems
  • Added linux x86_64 executable  
Other Changes
  • A number of bug fixes in the code
  • Eliminated build errors
Expect a code snapshot soon...

-- Aggelos Kolaitis

Wednesday, November 6, 2013

I've been away...

Over the course of the past few days I haven't had much time to work on SDLU. There have been a few fixes here and there. and very few (but important!) feature additions.

But you need not worry my loyal users (all five of you :p), many things are yet to come!

Probably next week will be more productive.


Friday, October 25, 2013

SDLU 2.0.1 released!

2.0.1 is a feature release. The source code is available from the downloads page at bitbucket.

What's new in SDLU 2.0.1 (24/10/13)

Build System:

  • Added CMake based build system, as an alternative to the existing premake build system.
  • Eliminated Visual Studio warnings.
  • Small improvements to the premake4 build system.
  • Updated Makefile.minimal.

Added new APIs:

  • SDLU_SpriteDrawRotated(): set whether the sprite is being drawn rotated, works nice with SDLU_SetSpriteDirection().
  • SDLU_GetSpriteDirection(): query the direction of movement from a sprite.
  • SDLU_RenderSetPoints(): supply multiple points for polygon rendering with a single call.
Misc changes:
  • Added contributing guidelines.
  • Updated windows premake4 binary
-- Aggelos Kolaitis

Tuesday, October 22, 2013

Added CMake build system!

Surprise!! After one full week of coding and testing, the new CMake-based build system for SDLU is finally ready! This does not mean that the premake-based system will be ditched. A lot of work has been done there, and it's still the only way to go if you want to build the ports for iOS and Android.

I believe, however, that due to the fact that CMake is a little more well-known than premake, this move will make it easier for more people to build and try out the library.

Of course, the system is still under development, this is just a first draft that actually works (okay, not exactly a first draft, I paid extra attention into keeping it simple and well-structured).

-- Aggelos Kolaitis

Sunday, October 20, 2013

SDLU 2.0 released!

The SDL Utility Library (SDLU) is a cross-platfrom development library
that provides APIs to make development of SDL2 apps faster and easier.

It works on Windows, Linux, Mac OS X, iOS and Android, with a Raspberry Pi
port planned for the future.

The source code is available at bitbucket. There is also a website
and a small blog which I mostly use to announce the development
progress.

The library is available under the zlib license (same as SDL2).

Some of its main features are a powerful Button API that blends with SDL
nicely, an extensible 2D Sprite API, collision detection functions,
OpenGL texture loading functions, a simple to use Text Rendering API
and much more.

The library is considered to be stable with many of the bugs having been
fixed. New features are planned, and I'm very open to your suggestions and/or
feature requests.

This is the first public release, and is intended to make the library known
to the world, in the hope that it will be useful for every SDL developer out
there.

You can download the 2.0 source code from bitbucket, or the website.
Source code releases include pre-generated documentation in HTML format.

-- Aggelos Kolaitis

Monday, October 14, 2013

Development State [14th October]

For the last few days, I concentrated mostly on stabilizing the build system both for the main library as well as for the iOS and Android ports. I'm proud to say that everything went as planned, and the build system is almost (if not already) ready for a release.

Other changes were the addition of a new hint SDLU_HINT_GL_ADD_PADDING, which may be set to change how SDLU_GL_LoadTexture() handles non-power-of-two-textures. See SDLU_hints.h and here for details.

Finally, many changes were made to the README files, to be as helpful and accurate as possible.

Expect a new snapshot in the next few days.

Friday, October 4, 2013

Source code snapshot [03/10/13]

I have uploaded the source code snapshots as zip or tar.gz archives in the Downloads section of the repository over at bitbucket. The snapshots contain the latest source code, along with pre-generated documentation by doxygen.

If you have a copy of the git repository, the snapshot is tagged with the name snapshot-031013. (031013 stands for 3/10/13, I just don't like having slashes '/' in the tag name).

As always please test the library, run the test programs and report issues at the issue tracker.

-- Aggelos Kolaitis

Thursday, October 3, 2013

Development state [3rd October]

In my last post [about a week ago], I had said that the weekend would see some API changes that were planned to happen anyway. I decided it would be better for them to happen before the first release [it's going to be 2.0].

Well, the weekend turned out to be a week, because of some other tasks I had to fulfill over the last few days. Anyway, the changes are now in the main git repository here.

API Additions
  • Added two new functions, SDLU_GetSpriteVelocity() and SDLU_GetSpriteAdvance()
API Changes
  • Merged the functionality of SDLU_Get/SetSpritePaused() into SDLU_PauseSprite()
  • Merged the functionality of SDLU_Get/SetButtonHidden() into SDLU_HideButton()
  • Renamed SDLU_LoadTextureEx() to SDLU_LoadTextureWithColorkey()
API Removals
  • Removed the shorter FPS_* macros, to avoid conficts with other libraries
  • Removed SDLU_GetButtonPress(). Not only is it not required any more, but also using it would had negative impact in visuals and performance
Important changes
  • Added new premake action ios, used to build the iOS port of the library (oh yeah!). See README-ios for details.
  • Removed un-needed hard-coded stuff from the NetBeans project. Also, the project is now usable in NetBeans version 7.3 [may also work for older versions].
  • Made several improvements and fixes at the README files

With those changes applied, and with the official (finally) iOS support, we are getting closer to a stable 2.0 release. Expect a new code snapshot soon.

-- Aggelos Kolaitis

Friday, September 27, 2013

It's gonna be a weekend of huge changes

The library has been stabilized in terms of features, so this weekend will have many API changes to keep a consistent feeling. I decided to do this before the 2.0 release, since after that it will be too late to make such changes.

-- Aggelos Kolaitis

Thursday, September 26, 2013

The focus is now on the docs

For the next few days, I will restrict the development of the library to bug fixes and small API changes only, with very few additions. The primary goal right now is to start writing a rock-solid wiki, as well as update the documentation in the header files and the website.

Anyway, I haven't done much in the code over the last few days, so I guess we are also close to a release at this point. But first, I will try to update the build system to allow building SDLU as a DLL under Windows systems.

-- Aggelos Kolaitis

Sunday, September 22, 2013

New website is up!

All right, after tons of work this weekend, I finally finished the new website. It is now live at http://sdlu.bitbucket.org.

I consider the new website a vast improvement over the previous one, with a much better navigation menubar and -finally- an acceptable from the human race look.

-- Aggelos Kolaitis

Development State [22th September 2013]

Last week was a week of many changes. Some things were removed, others were changed, and many new things were added, along with a bug fix for Android.

New Additions
  • The code now should build for iOS and Mac OS X.
  • New button flags SDLU_BUTTON_ROUND and SDLU_BUTTON_THEMED
  • New premake option --force=LIBS [Read section Forcing Depencies in INSTALL]
Removals
  • The SDLU_ALIGN_* macros are now exclusive to the Text Rendering API.
Changes
  • Custom fonts for the Text Rendering API (see SDLU_SetTruetypeFont()) are now passed as ready TTF_Font* structures. This allows further control over the output as well as greater rendering speeds, since we don't have to create the font every time.
  • Fixed common test code crashing on Android
Expect a snapshot soon...

-- Aggelos Kolaits

Monday, September 16, 2013

Testers for Mac OS X wanted!

Well, currently the library has reached a stable point is probably ready for a beta. There are some things that have to be done before that, though...

Besides adding some small APIs, I want to make sure the library actually works as expected under Mac OS X [and if I have the time possibly add official support for iOS]. This is as hard as it can get, because I have no access to a Mac machine.

For that reason, fellow OS X developers: Please test the library [build and run all the tests too to see if anything has to be fixed]. I don't want to make a release of something that has not been tested for Mac OS X. SDL2 is a cross-platfrom library, and so should SDLU be. But that's impossible without your help :)

-- Aggelos Kolaitis

Sunday, September 15, 2013

Source code snapshot [15/09/13]

Now that I eliminated some bugs in the source code, the library is considered stable enough for use. Also, it's quite probable that there won't be any more breaking API changes before the 2.0 release, but there are still some features that I would like to add.

I have uploaded the source code snapshots as zip or tar.gz archives in the Downloads section of the repository over at bitbucket. The snapshots contain the latest source code, along with pre-generated documentation by doxygen.

If you have a copy of the git repository, the snapshot is tagged with the name snapshot-150913. (150913 stands for 15/9/13, I just don't like having slashes '/' in the tag name).

As always please test the library, run the test programs and report issues at the issue tracker.

-- Aggelos Kolaitis

Why SDLU v1.0 was never released

A while ago [Mid-summer of 2013], after roughly four months of development, version 1.0 was almost ready for release. I had even posted about that in the SDL2 forums. The library passed through three release candidate releases, yet it was never actually released. Furthermore, even the tags for these versions are not there anymore, leaving everyone using the library dissapointed [all four of them :p].

So what happened???

Well, after three and a half months of development, I wanted to make a first release (v0.9) of the library, which would be done alongside the release of SDL2. The release of SDL2 was postponed, with many bug fixes every day [I tracked the development state before the stable SDL2 release closely]. For that reason, I decided to keep the release of SDLU as well.

Time went along without an SDL2 release, so I kept fixing bugs and adding useful features in the library, as well premature support for Visual Studio and Android [at that time I used the library solely on my development system, which was Linux]. Many things were changed, so I decided to call off v0.9 and go on with v1.0.

After a while, I made the very first RC available. The response was quite depressing, as the announcement did not get even one comment. Anyway, I kept fixing bugs while releasing RC 2 and 3.
In the meantime, I had a local dev branch where I put new features (preparing the library for a stable release I could not add them to the main development line). I was aiming to keep that branch local until all tests were deployed, so I could then merge it into master for the next release.

However, one day or two before the release, I was commiting some stuff at my local dev branch [which had gone over 30 commits away from master], when that exact split-second my Windows machine decided to reboot by itself. That led to a complete disaster, because git had written inside the repository a bad tree. I couldn't recover the repository state, AND I had kept no local nor remote back-up.

Thankfully, I didn't lose any work [all changes were there, since I was on the dev branch when the corruption happened]. For that reason, and due to the little response I got while in RC status, I decided to once again call off the release. I began the git repository from scratch, losing all tags and branches. Furthermore, I noticed quite a few bugs in the code that should not be in a stable release.

So, I left the messy and painful version 1.0 go away, and went head on to prepare an as good as possible 2.0 release. The current code has had many API improvements, additions and bug fixes since that time, and after some things are added, I will hopefully go on to finally release it!

-- Aggelos Kolaitis

Development state [15th September 2013]

I just managed to fix a long-running bug [been there for about two weeks :p], that would mess up the Text Rendering API, by changing the output position of the text at will. Turns out I just used int instead of float to store the scale factors. Anyway, now that I've also finished reworking the Android port and the new Button API, I guess the code has come to a mostly stable point.

Expect a source code snapshot soon!

Website [under development]: http://sdlu.bitbucket.org/
Repository: http://bitbucket.org/sdlu/sdlu

-- Aggelos Kolaitis

Welcome!

Welcome to the blog of the SDL Utility Library. I started this blog so that I will be able to easily publish news about the development of the library, while also posting articles about different issues I've encountered, as well as how I managed to fix them. My hope is that someday, someone that has a similar problem will be able to find a suitable solution/answer without going through all the fuss I went through (yeah... there were things that I needed, and the information was scattered all around the web)

The SDL Utility Library, is exactly what its name suggests: an utility library for SDL2, the Simple Direct-Media Layer. It provides a set of APIs that make developing SDL2 applications faster and easier. Some of its core features are:
  • A fully-featured Button API [with ability for callbacks and completely customizable appearence], blending seamlessly with the SDL2 event queue.
  • A set of functions to cap the framerate of your application.
  • A 2D Sprite API, built on top of the SDL2 Render API.
  • A powerful Text Rendering API.
  • cxx, An optional C++ interface of SDL2 [SDL_Window, SDL_Renderer and SDL_Texture]
The SDL Utility Library (SDLU for short) is written in plain C (apart from the cxx interface, of course), and is licensed under the zlib license. zlib, which is also used by SDL2, is a very liberal license which permits almost anything. The library works with Windows, Linux, Mac OS X and Android [Mac OS X and iOS support mostly exists in the source code, but I have no access to a Mac machine to test it -- patches welcome].

-- Aggelos Kolaitis