1e9297d28Sopenharmony_ci/* 2e9297d28Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd. 3e9297d28Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4e9297d28Sopenharmony_ci * you may not use this file except in compliance with the License. 5e9297d28Sopenharmony_ci * You may obtain a copy of the License at 6e9297d28Sopenharmony_ci * 7e9297d28Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8e9297d28Sopenharmony_ci * 9e9297d28Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10e9297d28Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11e9297d28Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12e9297d28Sopenharmony_ci * See the License for the specific language governing permissions and 13e9297d28Sopenharmony_ci * limitations under the License. 14e9297d28Sopenharmony_ci */ 15e9297d28Sopenharmony_ci 16e9297d28Sopenharmony_ci#ifndef MESH_H 17e9297d28Sopenharmony_ci#define MESH_H 18e9297d28Sopenharmony_ci 19e9297d28Sopenharmony_ci#include <iostream> 20e9297d28Sopenharmony_ci#include <GLES3/gl32.h> 21e9297d28Sopenharmony_ci 22e9297d28Sopenharmony_cinamespace OHOS { 23e9297d28Sopenharmony_cinamespace Rosen { 24e9297d28Sopenharmony_ciconst float VERTICES[] = { 25e9297d28Sopenharmony_ci 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 26e9297d28Sopenharmony_ci 1.0f, -1.0f, 0.0f, 1.0f, 0.0f, 27e9297d28Sopenharmony_ci -1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 28e9297d28Sopenharmony_ci -1.0f, 1.0f, 0.0f, 0.0f, 1.0f 29e9297d28Sopenharmony_ci}; 30e9297d28Sopenharmony_ciconst unsigned int INDICES[] = { 31e9297d28Sopenharmony_ci 0, 1, 3, 32e9297d28Sopenharmony_ci 1, 2, 3 33e9297d28Sopenharmony_ci}; 34e9297d28Sopenharmony_ci 35e9297d28Sopenharmony_ciclass Mesh { 36e9297d28Sopenharmony_cipublic: 37e9297d28Sopenharmony_ci static constexpr int DEFAULT_STRIDE = 5; 38e9297d28Sopenharmony_ci static constexpr int DEFAULT_OFFSET = 3; 39e9297d28Sopenharmony_ci static constexpr int DEFAULT_VERTEX_POINT_SIZE = 3; 40e9297d28Sopenharmony_ci static constexpr int DEFAULT_TEXTURE_POINT_SIZE = 2; 41e9297d28Sopenharmony_ci 42e9297d28Sopenharmony_ci Mesh(); 43e9297d28Sopenharmony_ci virtual ~Mesh(); 44e9297d28Sopenharmony_ci void Use(); 45e9297d28Sopenharmony_ci void Delete(); 46e9297d28Sopenharmony_ci unsigned int VAO_ = 0; 47e9297d28Sopenharmony_ci 48e9297d28Sopenharmony_ciprivate: 49e9297d28Sopenharmony_ci unsigned int VBO_ = 0; 50e9297d28Sopenharmony_ci unsigned int EBO_ = 0; 51e9297d28Sopenharmony_ci}; 52e9297d28Sopenharmony_ci} // namespace Rosen 53e9297d28Sopenharmony_ci} // namespace OHOS 54e9297d28Sopenharmony_ci#endif // MESH_H 55e9297d28Sopenharmony_ci 56