Fix for klockwork minor issues.
[platform/framework/native/uifw.git] / inc / FGrpIGlRenderer.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file        FGrpIGlRenderer.h
20  * @brief       This is the header file for the %IGlRenderer class.
21  *
22  * This header file contains the declarations of the %IGlRenderer class.
23  *
24  */
25
26 #ifndef _FGRP_GL_RENDERER_H_
27 #define _FGRP_GL_RENDERER_H_
28
29 #include <FOspConfig.h>
30
31 namespace Tizen { namespace Graphics { namespace Opengl
32 {
33
34 /**
35  * @class       IGlRenderer
36  * @brief       This virtual class defines the interface for %GlPlayer to draw 3D scene.
37  *
38  * @since 2.0
39  *
40  * The %IGlRenderer virtual class defines the interface for GlPlayer to draw 3D scene.
41  */
42 class _OSP_EXPORT_ IGlRenderer
43 {
44 public:
45         /**
46          * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this.
47          *
48          * @since 2.0
49          *
50          */
51         virtual ~IGlRenderer(void) {}
52
53         /**
54          * Initializes GL status and allocates necessary resources for the current Renderer such as shader, texture and so on.
55          *
56          * @since 2.0
57          * @return      @c true if this method successfully initializes the GL status and allocate resources, such as shader and textures, @n
58          else @c false if this method meets some errors or exceptions
59          *
60          */
61         virtual bool InitializeGl(void) = 0;
62
63         /**
64          * Terminates the Renderer to unload shader and release allocated resources.
65          *
66          * @since 2.0
67          * @return      @c true if this method successfully terminates the GL status and releases all the resources, such as shader and textures, @n
68          else @c false if this method meets some errors or exceptions
69          *
70          */
71         virtual bool TerminateGl(void) = 0;
72
73         /**
74          * Draws a scene. @n
75          * Users overload the %Draw() method and calls necessary operations for drawing a scene in this system.
76          *
77          * @since 2.0
78          * @return      @c true if this method successfully draws a scene with gl functions, @n
79          else @c false if this method meets some errors or exceptions
80          *
81          */
82         virtual bool Draw(void) = 0;
83
84         /**
85          * Pauses the GlPlayer instance. @n
86          * Users overload the %Pause() method and calls necessary operations for the pause of the system, including release of resources.
87          *
88          * @since 2.0
89          * @return      @c true if this method successfully does intended operations for pause state, @n else @c false if this method meets some errors or exceptions
90          *
91          */
92         virtual bool Pause(void) = 0;
93
94     /**
95      * Resumes the GlPlayer instance. @n
96          * Users overload the %Resume method and calls necessary operations for the resume of the system, including allocation of resources.
97      *
98      * @since 2.0
99          * @return      @c true if this method successfully does intended operations for resume state, @n else @c false if this method meets some errors or exceptions
100      *
101      */
102         virtual bool Resume(void) = 0;
103
104         /**
105          * Gets the target control width.
106          *
107          * @since 2.0
108          *
109          * @return      The width of target control
110          * @remarks The control width is determined when you register %IGlRenderer to %GlPlayer with the GlPlayer::SetIGlRenderer() method. Therefore, developers have to declare an integer variable for control width to implement this method.
111          *
112          */
113         virtual int GetTargetControlWidth(void) = 0;
114
115         /**
116          * Gets the target control height.
117          *
118          * @since 2.0
119          *
120          * @return      The height of target control
121          * @remarks The control height is determined when you register %IGlRenderer to %GlPlayer with the GlPlayer::SetIGlRenderer() method. Therefore, developers have to declare an integer variable for control height to implement this method.
122          *
123          */
124         virtual int GetTargetControlHeight(void) = 0;
125
126         /**
127          * Sets the target control width.
128          *
129          * @since 2.0
130          *
131          * @param[in]   width   The width of target control
132          * @remarks The control width is determined when you register %IGlRenderer to %GlPlayer with the GlPlayer::SetIGlRenderer() method. Therefore, developers have to declare an integer variable for control width to implement this method.
133          *
134          */
135         virtual void SetTargetControlWidth(int width) = 0;
136
137         /**
138          * Gets the target control height.
139          *
140          * @since 2.0
141          *
142          * @param[in]   height  The height of target control
143          * @remarks The control height is determined when you register %IGlRenderer to %GlPlayer with the GlPlayer::SetIGlRenderer() method. Therefore, developers have to declare an integer variable for control height to implement this method.
144          *
145          */
146         virtual void SetTargetControlHeight(int height) = 0;
147
148 protected:
149         //
150         // This method is for internal use only. Using this method can cause behavioral,
151         // security-related, and consistency-related issues in the application.
152         //
153         // @since 2.0
154         //
155         virtual void IGlRenderer_Reserved1(void) {}
156         virtual void IGlRenderer_Reserved2(void) {}
157         virtual void IGlRenderer_Reserved3(void) {}
158
159 }; // IGlRenderer
160
161 }}} // Tizen::Graphics::Opengl
162
163 #endif //_FGRP_GL_RENDERER_H_