CEngine Module

Community Forums/Showcase/CEngine Module

N(Posted 2005) [#1]
This is my CEngine module. It requires the Pub.Lua module, obviously- but since I use my own tweaks (nothing's changed, only more functions are added to the extern block so that I can do what I need with Lua). The modified version is included.

Anyhow, right now it consists of some basic OpenGL functionality, possibility API abstraction, standard entity manager, and has Lua bindings (still work in progress on that front, but it's a lot nicer than hard coding all of your game content).

Standard run of the mill torus knot floating in space is visible from the CEngineTest.bmx.

Obviously, you put cengine.mod in your mod/ directory ('address' should be like C:\BlitzMax\mod\cengine.mod\).

The source is included- while there's no license included at the moment, I plan on using a zlib license for it. While I don't mind if you want to work on your own version based off the existing source, if you do it'd be nice to give credit to me somewhere (be it in your source code or your credits or readme or whatever), but obviously you don't have to.

Anyhow, enough rambling, DOWNLOAD.

Edit: And NO, the C does not stand for 'Cower'. It stands for Class.


N(Posted 2005) [#2]
Quick pic:



fredborg(Posted 2005) [#3]
Interesting. One thing I can't figure out is how the file is loaded...Any clues?

Well done!

[edit] Ah, found it :) Never mind!


Jim Teeuwen(Posted 2005) [#4]
Noel, I found something odd.

In your CMatrix type, there is a Copy() method.
Why not just do:
	Method Copy:CMatrix()
		Return Self.Copy()
	End Method

That uses the Blitz Object's native Copy method.
Or better still:
	Method Copy:CMatrix()
		Local dest:CMatrix = New CMatrix
		Local source:CMatrix = Self
		MemCopy( Varptr dest, Varptr source, 64 )
		Return dest
	End Method


What strikes me as odd is the following:
   n.m21 = m21
and 2 lines further:
   n.m21 = m23


Why is m21 assigned twice and is m33 left out alltogether?
Isn't this supposed to be a direct copy?

I heard you had some weird behaviour with your lib, perhaps this is the reason why..


Jim Teeuwen(Posted 2005) [#5]
Another bug found in the CVector type.

	Method Translate(tX#=0,tY#=0,tZ#=0)
		Self.X:+X
		Self.Y:+Y
		Self.Z:+Z
	End Method


the parameter names are prefixed with 't'.
The assigned variables are not.

Might help to run your lib with the Strict keyword on it a few times to get out these kind of thingies.


flying willy(Posted 2005) [#6]
Strict rules.


N(Posted 2005) [#7]
Thank you for that completely relevant reply, mephitis...

Anywho, thanks for that, Defiance.


N(Posted 2005) [#8]
I've got my GUI working alongside BGL contexts (using Max2D for fonts at the moment) and the Graphics() context. Basically, I'm using my own projection matrix for the 2D, and I push a new (client) attrib state before drawing. CEngine does this as well. Also, this screenshot showcases the 3d viewport gadget of CGUI, using CEngine to render its contents (you pass a function pointer to its Render field and it calls that when it's drawn [after saving attrib states]).




Kanati(Posted 2005) [#9]
The niftiness factor is growing with every screenshot.