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

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


	Cgl2d class


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


#include <nds.h>

#include "Cglsprite.h"


#ifndef Cgl2d__H
#define Cgl2d__H

class Cgl2d
{
	public:
	
	void init();
	void start();
	void end();	
	void viewortho();
	inline void disable_texture();
	void increase_depth();
	void load_texture(int &textureID,GL_TEXTURE_TYPE_ENUM type, int sizeX, int sizeY, const uint8* texture);
	void init_sprites(Cglsprite *sprite,int numframes, const unsigned int *texcoords, int textureID);
	void box_fill(int x1, int y1, int x2, int y2, int color);
	void line(int x1, int y1, int x2, int y2, int color);
	void box(int x1, int y1, int x2, int y2, int color);

	private:
	int depth;
	
};

// Reset TEXIMAGE_PARAM (40004A8h - Cmd 2Ah)
// What's the libnds equivalent?
// Needs to be called so that primitives does not
// get funky colors from texture
inline void Cgl2d::disable_texture()
{
	GFX_TEX_FORMAT = 0;
}


#endif