Sign in to follow this  
  • entries
  • comments
  • views

Bonsai! Part 2

Sign in to follow this  


So, work progressed a bit, mostly to the point where I can make and destroy a window as well as make the message pump go.


Lua 5.1.2 Copyright (C) 1994-2007, PUC-Rio
> require "engine" *** load the dll
> a = bonsai.createGraphics() *** create an interface to graphics system
> a:createWindow() *** create a window
> a:startFrame() *** pump the events, setup the mv matrix and clear the window
> a:endFrame() *** swap buffers
> a:startFrame() *** repeat above
> a:endFrame() *** swap buffers (window content turns clear colour)
> a:destroyWindow() *** window goes away
> a = nil *** lose reference to graphics object
> collectgarbage() *** collect garbage
> ^C

So, it all looks good thus far; next I need to get the drawing functions in.
I've decided I'm going to use the BMFGen font system from AngelCode instead of Freetype2 for rendering; at least for now. I don't know if I'll keep that Lua side or move it into C++ (I've already got it working in C++ using some code Promit wrote a while back).

Quad drawing comes first however, this will get two interfaces I think; one for quads and one for sprite sheets.

I'll do the quads first however and then work on the sprite sheet interface at some point.

Oh, and atm the dll loaded is called 'engine' as I'll probably have a Lua layer which loads the support dll or dlls in as required. This tripped me up to start with as I accidently called the loading function the wrong name, heh.. opps.

Right, maybe more tomorrow, if not tuesday/wednesday once my brain comes around...
Sign in to follow this  


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