deepstone

diff src/mglrast.c @ 38:17a5107b6fa4

- added perspective correct interpolation - added recording functionality - added video capture functionality
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 10 Mar 2014 17:24:42 +0200
parents 11d14f688485
children
line diff
     1.1 --- a/src/mglrast.c	Mon Sep 23 07:42:56 2013 +0300
     1.2 +++ b/src/mglrast.c	Mon Mar 10 17:24:42 2014 +0200
     1.3 @@ -187,6 +187,14 @@
     1.4  	ybeg = fb->height;
     1.5  	yend = 0;
     1.6  
     1.7 +#ifdef TEXMAP_PERSP_CORRECT
     1.8 +	for(i=0; i<numv; i++) {
     1.9 +		v[i].tc.x /= v[i].pos.w;
    1.10 +		v[i].tc.y /= v[i].pos.w;
    1.11 +		v[i].pos.w = 1.0 / v[i].pos.w;
    1.12 +	}
    1.13 +#endif
    1.14 +
    1.15  	for(i=0; i<numv; i++) {
    1.16  		struct vertex *v0 = v + i;
    1.17  		struct vertex *v1 = v + (i + 1) % numv;