From 250e30d73f09e9da2b5a81d0fbae63744ae12a73 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 2 Apr 2019 08:47:15 +0800 Subject: *misc --- source/modules/asura-core/graphics/gl.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'source/modules/asura-core/graphics/gl.h') diff --git a/source/modules/asura-core/graphics/gl.h b/source/modules/asura-core/graphics/gl.h index bfc60ea..4d21a5a 100644 --- a/source/modules/asura-core/graphics/gl.h +++ b/source/modules/asura-core/graphics/gl.h @@ -1,7 +1,9 @@ #ifndef __ASURA_ENGINE_OPENGL_H__ #define __ASURA_ENGINE_OPENGL_H__ -#include "glad/glad.h" +#include + +#include namespace AsuraEngine { @@ -11,7 +13,9 @@ namespace AsuraEngine class Profiler; /// - /// 用来做一些opengl状态的追踪。 + /// 用来做一些opengl状态的追踪。在编辑器多窗口环境下,一个窗口对应一个hwnd,一个hdc,以及 + /// 数个opengl context,如果使用wglMakeCurrent(hdc, glc)指定当前线程耳朵渲染窗口hdc和 + /// opengl上下文glc,gl中记录的就是任意一个线程的任意一个窗口的任意一个opengl上下文的状态, /// class OpenGL { @@ -19,6 +23,9 @@ namespace AsuraEngine OpenGL(); ~OpenGL(); + void SetViewport(const AEMath::Recti viewport); + AEMath::Recti GetViewport(); + private: friend class Profiler; @@ -28,6 +35,14 @@ namespace AsuraEngine /// static bool instantiated; + /// + /// 记录opengl状态。 + /// + struct + { + AEMath::Recti viewport; + } state; + }; /// -- cgit v1.1-26-g67d0