2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://floralicense.org/license/
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.
19 * @file FGrpIGlRenderer.h
20 * @brief This is the header file for the %IGlRenderer class.
22 * This header file contains the declarations of the %IGlRenderer class.
26 #ifndef _FGRP_GL_RENDERER_H_
27 #define _FGRP_GL_RENDERER_H_
29 #include <FOspConfig.h>
31 namespace Tizen { namespace Graphics { namespace Opengl
36 * @brief This virtual class defines the interface for GlPlayer to draw 3D scene.
40 class _OSP_EXPORT_ IGlRenderer
44 * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this.
49 virtual ~IGlRenderer(void) {}
52 * Initializes GL status and allocates necessary resources for the current Renderer such as shader, texture and so on.
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.
58 virtual bool InitializeGl(void) = 0;
61 * Terminate the Renderer to unload shader and release allocated resources.
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.
67 virtual bool TerminateGl(void) = 0;
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.
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.
77 virtual bool Draw(void) = 0;
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.
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.
87 virtual bool Pause(void) = 0;
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.
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.
97 virtual bool Resume(void) = 0;
100 * Get the target control width.
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.
108 virtual int GetTargetControlWidth(void) = 0;
111 * Get the target control height.
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.
119 virtual int GetTargetControlHeight(void) = 0;
122 * Set the target control width.
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.
130 virtual void SetTargetControlWidth(int width) = 0;
133 * Get the target control height.
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.
141 virtual void SetTargetControlHeight(int height) = 0;
145 // This method is for internal use only. Using this method can cause behavioral,
146 // security-related, and consistency-related issues in the application.
150 virtual void IGlRenderer_Reserved1(void) {}
151 virtual void IGlRenderer_Reserved2(void) {}
152 virtual void IGlRenderer_Reserved3(void) {}
156 }}} // Tizen::Graphics::Opengl
158 #endif //_FGRP_GL_RENDERER_H_