text: /******************************************************************************
  Class:RendererBase
  Implements:
  Author:Rich Davison
  Description:TODO
  
  -_-_-_-_-_-_-_,------,
  _-_-_-_-_-_-_-|   /\_/\   NYANYANYAN
  -_-_-_-_-_-_-~|__( ^ .^) /
  _-_-_-_-_-_-_-""  ""
  
  *//////////////////////////////////////////////////////////////////////////////
  #pragma once
  #include "Window.h"
  
  namespace NCL {
  	namespace Rendering {
  		enum class VerticalSyncState {
  			VSync_ON,
  			VSync_OFF,
  			VSync_ADAPTIVE
  		};
  		class RendererBase {
  		public:
  			friend class NCL::Window;
  
  			RendererBase(Window& w);
  			virtual ~RendererBase();
  
  			virtual bool HasInitialised() const {return true;}
  
  			virtual void Update(float dt) {}
  
  			void Render()
  			{
  				BeginFrame();
  				RenderFrame();
  				EndFrame();
  			}
  
  			// 1.12.19
  			// used to render the debug frame, basically just sets the clear color to black...
  			void DebugRender()
  			{
  				BeginFrame();
  				RenderDebugFrame();
  				EndFrame();
  			}
  
  			virtual bool SetVerticalSync(VerticalSyncState s) { return false; }
  
  		protected:
  			virtual void OnWindowResize(int w, int h) = 0;
  			virtual void OnWindowDetach() {}; //Most renderers won't care about this
  			
  			virtual void BeginFrame()	= 0;
  			virtual void RenderFrame() = 0;
  			virtual void RenderDebugFrame()	{}
  			virtual void EndFrame()		= 0;
  			
  			Window& hostWindow;
  
  			int currentWidth;
  			int currentHeight;
  		};
  	}
  }
  