summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/graphics/gl.h
blob: 4d21a5a2ac83ef5f0891ad595ed79db891fbbd4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef __ASURA_ENGINE_OPENGL_H__
#define __ASURA_ENGINE_OPENGL_H__

#include <asura-utils/math/rect.hpp>

#include <glad/glad.h>

namespace AsuraEngine
{
	namespace Graphics
	{

		class Profiler;

		///
		/// һЩopengl״̬׷١ڱ༭രڻ£һڶӦһhwndһhdcԼ
		/// opengl contextʹwglMakeCurrent(hdc, glc)ָǰ̶߳Ⱦhdc
		/// openglglcglм¼ľһ̵߳һڵһopenglĵ״̬
		///
		class OpenGL
		{
		public:
			OpenGL();
			~OpenGL();

			void SetViewport(const AEMath::Recti viewport);
			AEMath::Recti GetViewport();

		private:

			friend class Profiler;

			///
			/// opengl
			/// 
			static bool instantiated;

			///
			/// ¼opengl״̬
			/// 
			struct
			{
				AEMath::Recti viewport;
			} state;

		};

		///
		/// OpenGL
		///
		extern OpenGL gl;

	}
}

#endif