1 #ifndef __DALI_INTERNAL_PROGRAM_CACHE_H__
2 #define __DALI_INTERNAL_PROGRAM_CACHE_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/integration-api/gl-abstraction.h> // for GLenum
33 * This class is interface for caching Program objects
46 * Destructor, virtual as this is an interface
48 virtual ~ProgramCache()
54 * @return GlAbstraction
56 virtual Integration::GlAbstraction& GetGlAbstraction() = 0;
59 * Get the program from cache with hash
60 * @param shaderHash to use
63 virtual Program* GetProgram( size_t shaderHash ) = 0;
66 * Add a program to cache
67 * @param shaderHash of the program
68 * @param program to add
70 virtual void AddProgram( size_t shaderHash, Program* program ) = 0;
73 * Get currently bound program
74 * @return program that is currently used
76 virtual Program* GetCurrentProgram() = 0;
79 * Set the currently bound program
80 * @param program that is used
82 virtual void SetCurrentProgram( Program* program ) = 0;
85 * @return true if program binaries are supported
87 virtual bool IsBinarySupported() = 0;
90 * @return the binary format to use
92 virtual GLenum ProgramBinaryFormat() = 0;
95 * @param programData to store/save
97 virtual void StoreBinary( Internal::ShaderDataPtr programData ) = 0;
99 private: // not implemented as non-copyable
101 ProgramCache( const ProgramCache& rhs );
102 ProgramCache& operator=( const ProgramCache& rhs );
107 } // namespace Internal
111 #endif // __DALI_INTERNAL_PROGRAM_CACHE_H__