Quad-ren 0.4


hessiess

Member
Joined
Apr 26, 2008
Messages
219
Quad-Ren is a resolution independent 2D graphics engine that aims to ease the development of bitmap-based applications, primarily games. Applications using Quad-Ren will function the same regardless of screen resolution or aspect ratio, windowed or fullscreen.

Version 0.4 adds a number of features, one being an event system, providing a cleaner method of reading user input. It also adds a new scene node, qr_line.

The example program has bean moved out of the main release into its own package, and 2 more examples have bean added, a simple "hello world" style program and an example of the usage of the event system.

There have also bean a number of bug fixes, most notably to the PNG loader, which will no longer load images without an alpha channel and are not a power of two.

QR 0.4 can be downloaded from www.quad-ren.sourceforge.net.
 

synkro

0xdeadbeef
Joined
Aug 26, 2003
Messages
823
Location
Germany
Website
Visit site
I had a look into quad-ren, just a small one but would already note some things:

1)
Your vector types are far from being complete, like add(), sub(), rotate() or dot(). Those will be needed. Maybe you want to change to already porved, free vector implementation.

2)
Functions like bezier(vector2d_f P[4], float crv_pos) should not copy an array of four vectors, but use a pointer/reference, will be way faster.
 

hessiess

Member
Joined
Apr 26, 2008
Messages
219
'synkro' said:
I had a look into quad-ren, just a small one but would already note some things:

1)
Your vector types are far from being complete, like add(), sub(), rotate() or dot(). Those will be needed. Maybe you want to change to already porved, free vector implementation.

2)
Functions like bezier(vector2d_f P[4], float crv_pos) should not copy an array of four vectors, but use a pointer/reference, will be way faster.
I agree the vector type could be better, currently its just a class for storing a pair of intagers or floats :). Arrays in C++ are pointers, which is proved by the ability of using pointer math to address them instead of the [] operator.
 
Last edited by a moderator:

synkro

0xdeadbeef
Joined
Aug 26, 2003
Messages
823
Location
Germany
Website
Visit site
'Hessiess' said:
I agree the vector type could be better, currently its just a class for storing a pair of intagers or floats :). Arrays in C++ are pointers, which is proved by the ability of using pointer math to address them instead of the [] operator.
I meant to say, in the following example the compiler will make a copy of the parameter array which is slow

CODE

void foo( int[4] array);
int a[4];
foo(a)



If you use just a pointer, onyl an adress will be used which will likely be register allocated

CODE

void foo( const int* a);
int a[4];
foo(a);



EDIT: now that I think about it again, the compiler might in both cases generate the same code, I should test that.
 
Last edited by a moderator:

hessiess

Member
Joined
Apr 26, 2008
Messages
219
'synkro' said:
If you use just a pointer, onyl an adress will be used which will likely be register allocated
CODE

void foo( const int* a);
int a[4];
foo(a);

Doing that would make the documentation messy, and make the application more lickly to segfault, should a pointer to a block of memory with less than 4 elements be passed.
 
Last edited by a moderator:

Tor

Member
Joined
Oct 3, 2008
Messages
709
As syncro already suspected in that edit, passing an array or passing a pointer just passes the address anyway -- they are equivalent on that level. So there's no gain in declaring *a instead of a[4], and it would also be more error prone as Hessiess said.
 
Last edited by a moderator:
Top