1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef ROSENRENDER_ROSEN_WEBGL_ACTIVEINFO 17 #define ROSENRENDER_ROSEN_WEBGL_ACTIVEINFO 18 19 #include <GLES2/gl2.h> 20 #include <GLES3/gl31.h> 21 #include <GLES2/gl2ext.h> 22 23 #include "../../../common/napi/n_exporter.h" 24 25 #define WEBGL_ACTIVE_INFO_NAME_MAX_LENGTH 128 26 27 namespace OHOS { 28 namespace Rosen { 29 class WebGLActiveInfo final : public NExporter { 30 public: 31 inline static const std::string className = "WebGLActiveInfo"; 32 33 bool Export(napi_env env, napi_value exports) override; 34 35 std::string GetClassName() override; 36 37 static napi_value Constructor(napi_env env, napi_callback_info info); 38 SetActiveName(GLchar * activename)39 void SetActiveName(GLchar* activename) 40 { 41 m_name = activename; 42 } 43 SetActiveSize(int activesize)44 void SetActiveSize(int activesize) 45 { 46 m_size = activesize; 47 } 48 SetActiveType(int activetype)49 void SetActiveType(int activetype) 50 { 51 m_type = activetype; 52 } 53 WebGLActiveInfo()54 explicit WebGLActiveInfo() : m_size(0), m_type(0) {}; 55 WebGLActiveInfo(napi_env env,napi_value exports)56 WebGLActiveInfo(napi_env env, napi_value exports) : NExporter(env, exports), m_size(0), m_type(0) {}; 57 ~WebGLActiveInfo()58 ~WebGLActiveInfo() {}; 59 private: 60 std::string m_name; 61 int m_size; 62 int m_type; 63 }; 64 } // namespace Rosen 65 } // namespace OHOS 66 67 #endif // ROSENRENDER_ROSEN_WEBGL_PROGRAM 68