/******************************************************************************
*******************************************************************************

	Space Impakto DS
	relminator
	http://rel.betterwebber.com


	Cglsprite class


*******************************************************************************
******************************************************************************/


#include <nds.h>


#ifndef Cglsprite__H
#define Cglsprite__H

// absolute vertex pack
// 2 params for GFX_VERTEX16 
#define glVertex3i(x,y,z) ({ GFX_VERTEX16 = (((u16)(y)) << 16) | ((u16)(x)); GFX_VERTEX16 = z; })
#define glVertex2i(x,y) ({ GFX_VERTEX_XY = (((u16)(y)) << 16) | (((u16)(x)) & 0xFFFF); })	


// TEX_COORD expects [12.4] fixed point values 
#define glTexcoord2i(u,v) ({ GFX_TEX_COORD = ((u16)(v)) << 20 | ((u16)(u)) << 4; })	

class Cglsprite
{
	public:
	
	void render(int x, int y);					// x.y are top left of sprite
	void rotate(int x, int y, int angle);		// x.y are center of sprite
	void stretch_h(int x, int y, int length_x); // x.y top-left of sprite, stretches with length_x
	void color(int x, int y, int color);		// simulate being hit
	

	int textureID;			// texture id 
	int width;				// width of sprite - 1
	int height;				// height of sprite - 1
	int u_off;				// x texture offset
	int v_off;				// y texture offset
	
};


#endif
