/***********      .---.         .-"-.      *******************\
* -------- *     /   ._.       / ´ ` \     * ---------------- *
* Author's *     \_  (__\      \_°v°_/     * humus@rogers.com *
*   note   *     //   \\       //   \\     * ICQ #47010716    *
* -------- *    ((     ))     ((     ))    * ---------------- *
*          ****--""---""-------""---""--****                  ********\
* This file is a part of the work done by Humus. You are free to use  *
* the code in any way you like, modified, unmodified or copy'n'pasted *
* into your own work. However, I expect you to respect these points:  *
*  @ If you use this file and its contents unmodified, or use a major *
*    part of this file, please credit the author and leave this note. *
*  @ For use in anything commercial, please request my approval.      *
*  @ Share your work and ideas too as much as you can.                *
\*********************************************************************/

#include "../Framework3/OpenGL/OpenGLApp.h"
#include "../Framework3/Util/Model.h"
#include "../Framework3/Util/BSP.h"

class App : public OpenGLApp {
public:
	char *getTitle() const { return "Ambient aperture lighting"; }

	void moveCamera(const vec3 &dir);
	void resetCamera();

	bool init();
	void exit();

	bool load();
	void unload();

	void drawLight(const vec3 &lightPos, const vec3 &dx, const vec3 &dy);
	void drawEnvironment(const float4x4 &mvp);
	void drawFrame();

protected:
	Model *map;
	BSP bsp;

	ShaderID lighting, skybox, plainTex;
	TextureID base[3], bump[3], aperture[3], light, env;
	SamplerStateID trilinearClamp, bilinearAniso, trilinearAniso, nearestClamp, linear;
	BlendStateID blendAdd;
};
