1 #ifndef __DALI_INTERNAL_GL_CALL_DEBUG_H__
2 #define __DALI_INTERNAL_GL_CALL_DEBUG_H__
5 * Copyright (c) 2016 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/debug.h>
34 * Helper to check GL errors
35 * @param glAbstraction to use for error check
36 * @param operation to be logged
38 void CheckGlError( Integration::GlAbstraction& glAbstraction, const char* operation );
40 // wrap gl calls with CHECK_GL e.g. "CHECK_GL( mGlAbstraction, mGlAbstraction.UseProgram(mProgramId) );"
41 // will LOG any glErrors eg "glError (0x0501) GL_INVALID_VALUE - glBindTexture(textureId)"
42 // only enable if specifically enabled as it can slow down GL a lot!
43 #ifdef DALI_GL_ERROR_CHECK
44 #define CHECK_GL(c,a) (a); CheckGlError(c,#a)
46 #define CHECK_GL(c,a) (a)
50 /// Switch debug level to Concise to disable, General to enable. Note, enabling snapshot logging will do this on the fly.
51 extern Debug::Filter* gGlLogFilter;
52 #endif // DEBUG_ENABLED
54 // Don't put guards around here (LOG_INFO has it's own guards)
55 #define LOG_GL(format, args...) \
56 DALI_LOG_INFO(gGlLogFilter, Debug::General, format, ## args)
62 #endif // __DALI_INTERNAL_GL_CALL_DEBUG_H__