Sign in to follow this  
  • entries
    455
  • comments
    639
  • views
    421701

Bonsai!

Sign in to follow this  
_the_phantom_

55 views

As I mentioned in the Show us your projects thread I'm working on rebuilding the 2D game I did in April so that the graphics speed (at least) doesn't suck.

To this end I've started working on a DLL for Lua for an 'engine' under the name of Bonsai [grin]

In order to avoid the trap of writing engines for ever I'm only going to write the functionality I know I'll need, based on the last time I wrote this game. After that as I need new functionality I can expand upon it.

That said, I've reserved space for input and audio, the latter not being in the game at all orginal and the former being simply keyboard input, which will be redone for XInput and my XB360 joypad. Audio will follow once the inital build is done.

The graphics is going to be based on OpenGL and the window creation routines will be done via OGLWFW.

The current graphics based function list is;
Quote:

createWindow
destroyWindow
createTexture
deleteTexture
renderQuads
renderText
setRotation
setTranslation
setScale


Everything is pretty easy to understand I think, 'renderQuads' is the only intresting one there as it enables you to render large amounts of quads in one go, the idea here being to populate a table with tables of sprites to render and then reduce the transition time from Lua=>C++ while rendering.

Granted, this probably won't be a bottle neck so I might also add a 'drawQuad' to allow for single drawing of Quads to make life easier to start with.

'drawQuads' takes a table of tables, with the later containing position, size, texture id and optionally an offset into the texture, to allow for sprite sheets to be used. It will also have an optional 'frame' parameter which allows you to select the sprite you want from a strip of sprites which make up an animation.

I'll be writing the basic functionality tonight for all this, the interesting one is going to be 'renderText' as it's going to be based on FreeType2 and I've not decided how I'm going to deal with that yet (we might as yet spawn an 'openFont' and 'closeFont' set of functions, we'll see).
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now