Sign in to follow this  
Lightness1024

[SDL] Carnage-engine, C++

Recommended Posts

Alright so, I announced it as a possible game library in the dedicated thread; I think it could also be proper to announce it correctly in its own thread.This engine is yet another 2D library. (yet.. c.f [url="http://www.ebonyfortress.com/blog/free-game-development-libraries/"]free-game-dev-libs[/url])Well I developed it so I thought since it exists, it'd better be used helping whoever has the use of it.So here it is, a simple SDL wrapper over C++. (2000 lines of engine, 2000 lines of generic C++/math tools)It features:

edit: v2 is out now, check project on sourceforge: [url="http://sourceforge.net/projects/carnage-engine/"]http://sourceforge.net/projects/carnage-engine[/url][list]
[*]wrapped SDL initialization and window creation
[*]sprite management, either statics, animated, or trick-rotated (all rotations baked in the bitmap)
[*]collisions management. register static object shapes in your level, and ask efficiently (binary tree) for intersections with basic shapes later.
[*]sound management, over sdl_mixer.
[*]generic tools: fps counter, mac/nux/win hi-res timer, freelist, circularlist, 2D vectors etc.an idea of the programming style:
[/list]
[CODE]
#include "carnage-engine/spritemanager.hpp"
namespace ce = carnage_engine; // let's not bother with gigantic prefixes.

int main(int, char**)
{
// creates a manager, will create a window if there is no window yet.
ce::SpriteManager spm;
int h = spm.LoadSprite("hello.bmp"); // let's use helper function to compute x = (screenRes - helloWidth) / 2...
spm.Move(h, ce::GetScreenCenterX(spm.GetW(h)), ce::GetScreenCenterY(spm.GetH(h)));
spm.Draw(h); // blit sprite h
spm.Update(); // flip surfaces
getchar(); // wait for keyboard in the console and quit the program
}
[/CODE]
showing:
[img]http://lightness1024.free.fr/hello-ce.png[/img]

With hope that it will help, knowing that there is only SDL (and SDL_mixer if you want sound) as dependencies, its nice for those who want to keep it simple. Edited by Lightness1024

Share this post


Link to post
Share on other sites
Today the engine reached its version 1.0
the demo is here to show how to use most of the features of the engine.

get it:
project at sourceforge

The upcoming features for 2.0:
- rotozoom
- dynamic objects collision detection

for 3.0:
- opengl renderer
- multi light sources lighting
- bump mapping and normal mapping

the demo, with sphere basic physics simulation and a laser shooter:
c++ sdl carnage-engine demo

Share this post


Link to post
Share on other sites
Sign in to follow this