1#ifndef _GLCCONTEXT_HPP
2#define _GLCCONTEXT_HPP
3/*-------------------------------------------------------------------------
4 * OpenGL Conformance Test Suite
5 * -----------------------------
6 *
7 * Copyright (c) 2016 Google Inc.
8 * Copyright (c) 2016 The Khronos Group Inc.
9 *
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
13 *
14 *      http://www.apache.org/licenses/LICENSE-2.0
15 *
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
21 *
22 */ /*!
23 * \file
24 * \brief OpenGL context.
25 */ /*-------------------------------------------------------------------*/
26
27#include "gluRenderConfig.hpp"
28#include "gluRenderContext.hpp"
29#include "tcuDefs.hpp"
30#include "tcuTestContext.hpp"
31
32namespace glu
33{
34class RenderContext;
35class ContextInfo;
36}
37
38namespace tcu
39{
40class RenderTarget;
41}
42
43namespace deqp
44{
45
46class Context
47{
48public:
49	Context(tcu::TestContext& testCtx, glu::ContextType contextType = glu::ContextType());
50	~Context(void);
51
52	tcu::TestContext& getTestContext(void)
53	{
54		return m_testCtx;
55	}
56
57	glu::RenderContext& getRenderContext(void)
58	{
59		return *m_renderCtx;
60	}
61
62	void setRenderContext(glu::RenderContext* renderCtx)
63	{
64		m_renderCtx = renderCtx;
65	}
66
67	const glu::ContextInfo& getContextInfo(void) const
68	{
69		return *m_contextInfo;
70	}
71
72	const tcu::RenderTarget& getRenderTarget(void) const;
73
74	glu::RenderContext* createSharedContext(
75		glu::ContextFlags			   ctxFlags = (glu::ContextFlags)0,
76		glu::ResetNotificationStrategy ctxReset = glu::RESET_NOTIFICATION_STRATEGY_NOT_SPECIFIED);
77
78private:
79	Context(const Context& other);
80	Context& operator=(const Context& other);
81
82	void createRenderContext(glu::ContextType& contextType, glu::ContextFlags ctxFlags = (glu::ContextFlags)0);
83	void destroyRenderContext(void);
84
85	tcu::TestContext&   m_testCtx;
86	glu::RenderContext* m_renderCtx;
87	glu::ContextInfo*   m_contextInfo;
88	glu::ContextType	m_contextType;
89};
90
91} // deqp
92
93#endif // _GLCCONTEXT_HPP
94