//=============================================================================
// FILE: app.h
//
//                  Copyright (c) 2017 QUALCOMM Technologies Inc.
//                              All Rights Reserved.
//
//=============================================================================

#pragma once

#include "../../common/spatialaudio_common.h"
#include <glm/glm.hpp>

class ObjectDynamic : public SpatialAudioCommon
{
	virtual void Initialize();
	virtual void Shutdown();

protected:
	virtual void OnTouchScreen();
	virtual void RenderModelCallback(int whichEye, float elapsedTime);
	virtual void RenderCallback(float elapsedTime);

private:
	#define						SPATIAL_AUDIO_SOUND_OBJECT_NUM 2
	Q3DSound					mSoundObject[SPATIAL_AUDIO_SOUND_OBJECT_NUM];
	Q3DSoundCrossFader			mCrossfader;

	Svr::SvrGeometry*           mpGazeBoxModel;
	Svr::SvrShader              mGazeBoxShader;
	GLuint						mGazeBoxTexture[kGazeBoxNum];
    GLuint                      mGazeBoxTextureSampler;
	bool						mGazeBoxActive[kGazeBoxNum];
	float						mGazeBoxLastHsvSaturation[kGazeBoxNum];
	float						mGazeBoxLastHsvValue[kGazeBoxNum];

	Svr::SvrGeometry*           mpSkyModel;
	Svr::SvrShader              mSkyShader;

	Svr::SvrGeometry*           mpFloorModel;
	Svr::SvrShader              mFloorShader;

	Svr::SvrGeometry*           mpObjectModel;
	Svr::SvrShader              mObjectShader;
	glm::mat4                   mMdlMtx;

	float						mSoundObjectVerticalNormalizedFunctionArg;
	float						mSoundObjectHorizontalNormalizedFunctionArg;
	float						mSoundObjectHorizontalRadiusNormalizedFunctionArg;
	bool						mSoundObjectHorizontalRadiusGrowing;
};
