#pragma once

#include "math.h"

inline int Offset(int x, int y, int sizeRow);
bool LoadHeightMap(vector3* &normalArray, float* &heightArray, char filename[]);

class rHeightMap
{
public:
	~rHeightMap();
	void Load(vector3* normalArray, float* heightArray,
		int x,
		int z,
		int patchSize,
		int mapSize,
		float &highestY,
		float &lowestY);
	void Render();

	float* heights;
	vector3* normals;
	int sideX;
	int sideZ;
	vector2 texCoord[4];

	unsigned int texture;
	unsigned int detailTexture;

	int listIndex;
};
