958d0312bdc09d5771b853224ff0fbd462d24ab9
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / gl-view / gl-view.cpp
1 /*
2  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali-toolkit/public-api/controls/gl-view/gl-view.h>
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/internal/controls/gl-view/gl-view-impl.h>
23
24 namespace Dali
25 {
26 namespace Toolkit
27 {
28 GlView::GlView()
29 {
30 }
31
32 GlView::GlView(const GlView& GlView) = default;
33
34 GlView::GlView(GlView&& rhs) = default;
35
36 GlView& GlView::operator=(const GlView& GlView) = default;
37
38 GlView& GlView::operator=(GlView&& rhs) = default;
39
40 GlView::~GlView()
41 {
42 }
43
44 GlView GlView::New(ColorFormat colorFormat)
45 {
46   return Internal::GlView::New(colorFormat);
47 }
48
49 GlView GlView::DownCast(BaseHandle handle)
50 {
51   return Control::DownCast<GlView, Internal::GlView>(handle);
52 }
53
54 void GlView::RegisterGlCallbacks(CallbackBase* initCallback, CallbackBase* renderFrameCallback, CallbackBase* terminateCallback)
55 {
56   Dali::Toolkit::GetImpl(*this).RegisterGlCallbacks(initCallback, renderFrameCallback, terminateCallback);
57 }
58
59 void GlView::SetResizeCallback(CallbackBase* resizeCallback)
60 {
61   Dali::Toolkit::GetImpl(*this).SetResizeCallback(resizeCallback);
62 }
63
64 bool GlView::SetGraphicsConfig(bool depth, bool stencil, int msaa, GraphicsApiVersion version)
65 {
66   return Dali::Toolkit::GetImpl(*this).SetGraphicsConfig(depth, stencil, msaa, version);
67 }
68
69 void GlView::SetRenderingMode(RenderingMode mode)
70 {
71   Dali::Toolkit::GetImpl(*this).SetRenderingMode(mode);
72 }
73
74 Dali::Toolkit::GlView::RenderingMode GlView::GetRenderingMode() const
75 {
76   return Dali::Toolkit::GetImpl(*this).GetRenderingMode();
77 }
78
79 void GlView::RenderOnce()
80 {
81   Dali::Toolkit::GetImpl(*this).RenderOnce();
82 }
83
84 GlView::GlView(Internal::GlView& implementation)
85 : Control(implementation)
86 {
87 }
88
89 GlView::GlView(Dali::Internal::CustomActor* internal)
90 : Control(internal)
91 {
92   VerifyCustomActorPointer<Internal::GlView>(internal);
93 }
94
95 } // namespace Toolkit
96
97 } // namespace Dali