Tizen 2.1 base
[framework/osp/uifw.git] / inc / FGrpIGlRenderer.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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  * @since 2.0
38  *
39  */
40 class _OSP_EXPORT_ IGlRenderer
41 {
42 public:
43         /**
44          * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this.
45          *
46          * @since 2.0
47          *
48          */
49         virtual ~IGlRenderer(void) {}
50
51         /**
52          * Initializes GL status and allocates necessary resources for the current Renderer such as shader, texture and so on.
53          *
54          * @since 2.0
55          * @return      Return true when this function successfully initialize the GL status and allocate resources, such as shader and textures. Otherwise, when this function meets some errors or exceptions, then return false.
56          *
57          */
58         virtual bool InitializeGl(void) = 0;
59
60         /**
61          * Terminate the Renderer to unload shader and release allocated resources.
62          *
63          * @since 2.0
64          * @return      Return true when this function successfully terminate the GL status and release all the resources, such as shader and textures. Otherwise, when this function meets some errors or exceptions, then return false.
65          *
66          */
67         virtual bool TerminateGl(void) = 0;
68
69         /**
70          * This function is called when GlPlayer draws a scene.
71          * Users overload this function and calls necessary operations for drawing a scene in this system.
72          *
73          * @since 2.0
74          * @return      Return true when this function successfully draws a scene with gl functions. Otherwise, when this function meets some errors or exceptions, then return false.
75          *
76          */
77         virtual bool Draw(void) = 0;
78
79         /**
80          * This function is called when GlPlayer is paused.
81          * Users overload this function and calls necessary operations for the pause of the system, including release resources.
82          *
83          * @since 2.0
84          * @return      Return true when this function successfully does intended operations for Pause state. Otherwise, when this function meets some errors or exceptions, then return false.
85          *
86          */
87         virtual bool Pause(void) = 0;
88
89         /**
90          * This function is called when GlPlayer is resumed.
91          * Users overload this function and calls necessary operations for the resume of the system, including allocation resources.
92          *
93          * @since 2.0
94          * @return      Return true when this function successfully does intended operations for Resume state. Otherwise, when this function meets some errors or exceptions, then return false.
95          *
96          */
97         virtual bool Resume(void) = 0;
98
99         /**
100          * Get the target control width.
101          *
102          * @since 2.0
103          *
104          * @return      Return the width of Target control.
105          * @remarks The control width is determined when you register %IGlRenderer to %GlPlayer with GlPlayer::SetIGlRenderer() function. Therefore, developers have to declare a integer variable for control width to implement this function.
106          *
107          */
108         virtual int GetTargetControlWidth(void) = 0;
109
110         /**
111          * Get the target control height.
112          *
113          * @since 2.0
114          *
115          * @return      Return the height of Target control.
116          * @remarks The control height is determined when you register %IGlRenderer to %GlPlayer with GlPlayer::SetIGlRenderer() function. Therefore, developers have to declare a integer variable for control height to implement this function.
117          *
118          */
119         virtual int GetTargetControlHeight(void) = 0;
120
121         /**
122          * Set the target control width.
123          *
124          * @since 2.0
125          *
126          * @param[in]   width   Width of Target control.
127          * @remarks The control width is determined when you register %IGlRenderer to %GlPlayer with GlPlayer::SetIGlRenderer() function. Therefore, this function is used in GlPlayer::SetIGlRenderer function, and developers have to declare a integer variable for control width to implement this function.
128          *
129          */
130         virtual void SetTargetControlWidth(int width) = 0;
131
132         /**
133          * Get the target control height.
134          *
135          * @since 2.0
136          *
137          * @param[in]   height  Height of Target control.
138          * @remarks The control height is determined when you register %IGlRenderer to %GlPlayer with GlPlayer::SetIGlRenderer() function. Therefore, this function is used in GlPlayer::SetIGlRenderer function, and developers have to declare a integer variable for control height to implement this function.
139          *
140          */
141         virtual void SetTargetControlHeight(int height) = 0;
142
143 protected:
144         //
145         // This method is for internal use only. Using this method can cause behavioral,
146         // security-related, and consistency-related issues in the application.
147         //
148         // @since 2.0
149         //
150         virtual void IGlRenderer_Reserved1(void) {}
151         virtual void IGlRenderer_Reserved2(void) {}
152         virtual void IGlRenderer_Reserved3(void) {}
153
154 }; // IGlRenderer
155
156 }}} // Tizen::Graphics::Opengl
157
158 #endif //_FGRP_GL_RENDERER_H_