#include "lmfeffort.h"
#pragma once

HWND hWnd;

namespace lmfeffort {

	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;
	using namespace System::Threading;

	/// <summary>
	/// Summary for main
	/// </summary>
	public ref class main : public System::Windows::Forms::Form
	{
	public:
		main(void)
		{
			InitializeComponent();
			this->Icon = Drawing::Icon::FromHandle( (IntPtr)LoadIconA(0, (LPCSTR)IDI_APPLICATION) );
		}
		void InitFunc( void ) {
			R_BringAboutGL( GetDC(hWnd) );
		}

	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~main()
		{
			if (components)
			{
				delete components;
			}
		}
	private: System::Windows::Forms::Panel^  panel1;
	private: System::Windows::Forms::Label^  label1;
	private: System::Windows::Forms::Label^  label2;
	protected: 

	private:
		/// <summary>
		/// Required designer variable.
		/// </summary>
		System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		void InitializeComponent(void)
		{
			this->panel1 = (gcnew System::Windows::Forms::Panel());
			this->label1 = (gcnew System::Windows::Forms::Label());
			this->label2 = (gcnew System::Windows::Forms::Label());
			this->panel1->SuspendLayout();
			this->SuspendLayout();
			// 
			// panel1
			// 
			this->panel1->Controls->Add(this->label2);
			this->panel1->Controls->Add(this->label1);
			this->panel1->Location = System::Drawing::Point(0, 0);
			this->panel1->Name = L"panel1";
			this->panel1->Size = System::Drawing::Size(624, 442);
			this->panel1->TabIndex = 0;
			// 
			// label1
			// 
			this->label1->AutoSize = true;
			this->label1->BackColor = System::Drawing::Color::Transparent;
			this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(204)));
			this->label1->Location = System::Drawing::Point(12, 9);
			this->label1->Name = L"label1";
			this->label1->Size = System::Drawing::Size(192, 65);
			this->label1->TabIndex = 0;
			this->label1->Text = L"CONTROLS:\r\n   W -> Zoom in\r\n   S -> Zoom out\r\n   A -> Rotate alongside X towards " 
				L"left\r\n   D -> Rotate alongside X towards right\r\n   BACKSPACE -> Flip the model vertically";
			// 
			// label2
			// 
			this->label2->AutoSize = true;
			this->label2->BackColor = System::Drawing::Color::Transparent;
			this->label2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(204)));
			this->label2->Location = System::Drawing::Point(372, 9);
			this->label2->Name = L"label2";
			this->label2->Size = System::Drawing::Size(240, 65);
			this->label2->TabIndex = 1;
			this->label2->Text = L"CONTROLS:\r\n   UPARROW -> Shift Y position towards bottom\r\n   DOWNARROW -> Shift Y" 
				L" position towards top\r\n   LEFTARROW -> Shift X position towards left\r\n   RIGHTAR" 
				L"ROW -> Shift X position towards right\r\n   Q -> Exit  ";
			this->label2->TextAlign = System::Drawing::ContentAlignment::TopRight;
			// 
			// main
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->BackColor = System::Drawing::Color::White;
			this->ClientSize = System::Drawing::Size(624, 442);
			this->Controls->Add(this->panel1);
			this->DoubleBuffered = true;
			this->MaximizeBox = false;
			this->Name = L"main";
			this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
			this->Text = L"LMF EFFORT For Loot";
			this->Load += gcnew System::EventHandler(this, &main::main_Load);
			this->panel1->ResumeLayout(false);
			this->panel1->PerformLayout();
			this->ResumeLayout(false);

		}
#pragma endregion
	private: System::Void main_Load(System::Object^  sender, System::EventArgs^  e) {
				 hWnd = (HWND)panel1->Handle.ToPointer();
				 Thread^ pRenderLoop = gcnew Thread(gcnew ThreadStart(this, &main::InitFunc) );
				 pRenderLoop->Start();
			 }
	};
}