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 FGrpCanvasTexture.h
20 * @brief This is the header file for the %CanvasTexture class.
22 * This header file contains the declarations of the %CanvasTexture class.
26 #ifndef _FGRP_CANVAS_TEXTURE_H_
27 #define _FGRP_CANVAS_TEXTURE_H_
29 #include <FBaseObject.h>
31 namespace Tizen { namespace Graphics {
35 namespace Tizen { namespace Graphics { namespace Opengl
39 * @class CanvasTexture
40 * @brief This class provides a method to bind 2D Canvas and OpenGL-ES Texture.
41 * With this feature, you can easily draw 2D primitives on OpenGL-ES Textures with consistency.
45 * @final This class is not intended for extension.
47 * The %CanvasTexture class provides a method to bind 2D Canvas and OpenGL-ES Texture.
48 * With this feature, you can easily draw 2D primitives on OpenGL-ES Textures with consistency.
51 class _OSP_EXPORT_ CanvasTexture
52 : public Tizen::Base::Object
56 * The object is not fully constructed after this constructor is called. For full construction, the Construct() method be called right after calling this constructor.
64 * This destructor overrides Tizen::Base::Object::~Object().
68 virtual ~CanvasTexture(void);
71 * Initializes this instance of %CanvasTexture with the specified parameters.
74 * @feature %http://tizen.org/feature/opengles, %http://tizen.org/feature/opengles.version.1_1, or %http://tizen.org/feature/opengles.version.2_0
76 * @return An error code
77 * @param[in] textureId Texture ID which points to the texture associated with the 2D canvas @n The texture ID must be generated from glGenTextures().
78 * @param[in] width The width of the input texture. The width must be greater than @c 0, and smaller or equal than GL_MAX_TEXTURE_SIZE.
79 * @param[in] height The height of the input texture. The height must be greater than @c 0, and smaller or equal than GL_MAX_TEXTURE_SIZE
80 * @exception E_SUCCESS Construction is successfully done.
81 * @exception E_INVALID_ARG Input parameter is invalid.
82 * @exception E_UNSUPPORTED_OPERATION The Emulator or target device does not support the required feature.
83 * For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.
84 * @exception E_INVALID_STATE Getting egl information failed. It is necessary to bind egl context by using the eglMakeCurrent() method.
86 * - Before calling this method, check whether the feature is supported by %Tizen::System::SystemInfo::GetValue() methods.
87 * - There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is E_OUT_OF_MEMORY or not. For more information on how to handle the out-of-memory exception, refer <a href="../org.tizen.native.appprogramming/html/basics_tizen_programming/exception_check.htm">here</a>.
89 result Construct(int textureId, int width, int height);
92 * Returns a 2D Canvas which is associated with the Texture of %CanvasTexture.
96 * @return The 2D canvas of the %CanvasTexture, @n
97 * else @c null if an exception occurs
98 * @exception E_SUCCESS The method is successful.
99 * @exception E_OPERATION_FAILED The method fails to construct the canvas properly due to some system error.
101 Tizen::Graphics::Canvas* GetCanvasN(void) const;
105 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
107 // @param[in] rhs The source from which this instance is copied
109 CanvasTexture(const CanvasTexture& rhs);
112 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
114 // @param[in] rhs An instance of %CanvasTexture
116 CanvasTexture& operator =(const CanvasTexture& rhs);
119 friend class _CanvasTextureImpl;
121 class _CanvasTextureImpl* __pImpl;
124 }}} // Tizen::Graphics::Opengl
126 #endif //_FGRP_CANVAS_TEXTURE_H_