1 #ifndef DALI_PROJECT_NATIVE_RENDERER_H
2 #define DALI_PROJECT_NATIVE_RENDERER_H
5 * Copyright (c) 2020 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 * This is demo that doesn't use DALi directly as if it's
23 * a separate non-DALi app (so not using DALi math etc.)
26 #include <dali/public-api/signals/render-callback.h>
29 #include <GLES3/gl3.h>
35 NativeRenderer( uint32_t width, uint32_t height);
37 bool OnRender( const Dali::RenderCallbackInput& input );
41 void Setup( int width, int height);
43 void RenderCube( const Dali::RenderCallbackInput& input );
46 * Creates GL program from shader sources
48 GLuint CreateProgram(const char* vertexSource, const char* fragmentSource);
53 GLuint LoadShader(GLenum shaderType, const char* shaderSource);
63 State mState {State::INIT};
65 GLuint mProgramId{0u};
67 GLint mVertexLocation{};
68 GLint mVertexColourLocation{};
69 GLint mProjectionLocation{};
70 GLint mModelViewLocation{};
72 float mModelViewMatrix[16];
73 float mProjectionMatrix[16];
79 #endif // DALI_PROJECT_NATIVE_RENDERER_H