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 * The %IGlRenderer virtual class defines the interface for GlPlayer to draw 3D scene.
42 class _OSP_EXPORT_ IGlRenderer
46 * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this.
51 virtual ~IGlRenderer(void) {}
54 * Initializes GL status and allocates necessary resources for the current Renderer such as shader, texture and so on.
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
61 virtual bool InitializeGl(void) = 0;
64 * Terminates the Renderer to unload shader and release allocated resources.
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
71 virtual bool TerminateGl(void) = 0;
75 * Users overload the %Draw() method and calls necessary operations for drawing a scene in this system.
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
82 virtual bool Draw(void) = 0;
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.
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
92 virtual bool Pause(void) = 0;
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.
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
102 virtual bool Resume(void) = 0;
105 * Gets the target control width.
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.
113 virtual int GetTargetControlWidth(void) = 0;
116 * Gets the target control height.
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.
124 virtual int GetTargetControlHeight(void) = 0;
127 * Sets the target control width.
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.
135 virtual void SetTargetControlWidth(int width) = 0;
138 * Gets the target control height.
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.
146 virtual void SetTargetControlHeight(int height) = 0;
150 // This method is for internal use only. Using this method can cause behavioral,
151 // security-related, and consistency-related issues in the application.
155 virtual void IGlRenderer_Reserved1(void) {}
156 virtual void IGlRenderer_Reserved2(void) {}
157 virtual void IGlRenderer_Reserved3(void) {}
161 }}} // Tizen::Graphics::Opengl
163 #endif //_FGRP_GL_RENDERER_H_