/arm9/source/swarm.c
/* swarmDS
 * Updated to use (probably buggy) fixed-point math
 */

#include <nds.h>
#include <stdlib.h>
#include <string.h>

#include "engine.h"

void engine(void);

int main(void) {
	int i;

	powerON(POWER_ALL);

	lcdMainOnBottom();
	videoSetMode(MODE_0_3D);

	irqInit();
	irqEnable(IRQ_VBLANK);

	glInit();
	glEnable(GL_ANTIALIAS);
	glClearColor(16, 16, 16, 31);
	glClearPolyID(63);
	glClearDepth(0x7FFF);

	glViewport(0, 0, 255, 191);

	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	glOrthof32(0, 255, 191, 0, 0, 1);

	// wireframe mode
	glPolyFmt(POLY_ALPHA(0) | POLY_CULL_NONE);

	// Init those pixels
	for (i = 0; i < NPIXELS; i++)
		pixel_init(&pixels[i]);

	glMatrixMode(GL_MODELVIEW);
	glColor3b(0, 0, 0);

	engine();

	return 0;
}