Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Game Engine Framework in C++ - WIP


Recommended Posts

Recopying from my G+ post:

I've been working on a game with a friend lately and been creating a general purpose game engine framework, which should make it alot easier to start with creating games. Its written in C++ and the core api is entirely portable.

The graphics part is currently opengl 2.0 and soon gles 2.0 only.

I'm releasing the core api I use for this game engine, not the game engine itself, I'll release it when I release a binary

The core api is also very strict about interfaces, and wherever possible a interface should be made for a group classes sharing similarity. I didnt go for this with the graphics api, its only lots of extra work and I only designed it for opengl anyway.

Its far from complete or to be used in anything production, and it lacks documentation, but it might prove a nice read if your interested in this stuff.

I strongly advise against using it as is, and if you intend to use most of it, its better to wait until its more polished, I will release updates to it regularly. It lacks alot of vital things like error checking in most areas as I wasnt clear on what error handling system to use when I started. I'm still uncertain about this issue, but have implemented a crude placeholder that works for now.

If you have ever used osg(OpenSceneGraph) you will notice I have adopted a similar

system for refcounting, and alot of the base classes for objects are subsets of their

classes, albeit without anything related to threading. Dont take the similarities to be absolute though, there are differences and this must be considered or else there will be errors in the code.

If you havent, then it means all objects that will be allocated on the heap, must always be allocated on the heap, and implement the IReferenced class with the virtual keyword. A base class Referenced is provided that implements the empty virtual methods in IReferenced. Referenced is always used unless a wrapper class for another library which uses refcounting is created. The template class ref_ptr<typename> is used to implement smart pointers for IReferenced objects.

Example of this system in pratice with a memory blob (useful for temporary dynamic arrays, since they automatically delete themselves):

grow::ref_ptr<grow::Blob> buffer = new grow::Blob(new char[dataSize], dataSize);

void * bufferPtr = buffer->GetBuffer();

size_t bufferSize = buffer->Length();

I'm happy to get feedback on what you like and what you dont like, so I can work on improving it :D I dont have any project files or makefiles, make those yourself :P

Requires SDL and GLEW

Download link

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...