Jump to content
  • Advertisement
Sign in to follow this  

[SDL] Carnage-engine, C++

This topic is 2200 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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 free-game-dev-libs)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: http://sourceforge.net/projects/carnage-engine

  • 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:

    #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


    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
Alright folks, I made version 2 aviable on sourceforge, new functions: check the changelist.txt

thanks for watching !

Share this post

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!