#pragma once
#ifdef _MX_OPENGL_WINDOWS_NORMAL

#include <string>
class MxCADOpenGlViewImp;
class MXCADDLL MxCADOpenGlView {
public:
	struct stuCreateMxDrawParam {
		int width;
		int height;
		std::string sCanvasId;
		void* hWnd;
		bool isVisible;
		int posx;
		int posy;
		int iOpenGlWindowFlag;
		stuCreateMxDrawParam() {
			iOpenGlWindowFlag = 0;
			width = 0;
			height = 0;
			hWnd = 0;
			isVisible = false;
			posx = 0;
			posy = 0;
		}
	};


	MxCADOpenGlView();
	virtual ~MxCADOpenGlView();

	virtual bool createWindow(stuCreateMxDrawParam* pParam) = 0;
	virtual bool destroyWindows() = 0;
	virtual void glMakeContextCurrent() = 0;
	virtual void glMakeContextCurrentNull() = 0;
	virtual void glSwapBuffers() = 0;
	virtual bool moveWindow(int posx, int posy, int width, int height) = 0;
	virtual bool glGetMouseButton(int button) = 0;
	virtual bool invalidate() { return false; }
	virtual void* glGetCurrentContext() = 0;
	virtual void glMakeContextCurrent(void* hContextCurrent) = 0;

	void onGlfwWindowSize(int width, int height);

	void onMouseButton(int button, int action, int mods);

	void onCursorPostion(double x, double y);

	void onMouseMove(double x, double y);

	void onMouseScroll(double x, double y);

	void onTouchesBegin(int num, int ids[], float xs[], float ys[]);

	void onTouchesMove(int num, int ids[], float xs[], float ys[]);

	void onTouchesEnd(int num, int ids[], float xs[], float ys[]);

	void onTouchesCancel(int num, int ids[], float xs[], float ys[]);

	void onPaint();

	bool onInitOpenGLGlad(void* pLoadProc);

	MxCADOpenGlViewImp* m_pImp;
};
#endif