From efdb3e0c77f1c83c5d78986bf5aefeea30c18ed1 Mon Sep 17 00:00:00 2001 From: Adam Bialogonski Date: Tue, 5 Apr 2022 12:41:53 +0100 Subject: [PATCH] Added GlView::BackendMode to the NUI/C# binder Change-Id: Ice65b25c7dea663692d9741eb3489d5956ae7b7c --- dali-csharp-binder/src/gl-view-wrap.cpp | 46 ++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/dali-csharp-binder/src/gl-view-wrap.cpp b/dali-csharp-binder/src/gl-view-wrap.cpp index cc72aa5..888953e 100644 --- a/dali-csharp-binder/src/gl-view-wrap.cpp +++ b/dali-csharp-binder/src/gl-view-wrap.cpp @@ -33,13 +33,33 @@ extern "C" Dali::Toolkit::GlView result; Dali::Toolkit::GlView::ColorFormat colorFormat; + colorFormat = static_cast(nuiColorFormat); + { + try + { + result = Dali::Toolkit::GlView::New(colorFormat); + } + CALL_CATCH_EXCEPTION(0); + } + jresult = new Dali::Toolkit::GlView((const Dali::Toolkit::GlView &)result); + return jresult; + } + + SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_GlView_New2_SWIG(int nuiBackendMode, int nuiColorFormat) + { + void *jresult; + Dali::Toolkit::GlView result; + + Dali::Toolkit::GlView::ColorFormat colorFormat; + Dali::Toolkit::GlView::BackendMode backendMode; colorFormat = static_cast(nuiColorFormat); + backendMode = static_cast(nuiBackendMode); { try { - result = Dali::Toolkit::GlView::New(colorFormat); + result = Dali::Toolkit::GlView::New(backendMode, colorFormat); } CALL_CATCH_EXCEPTION(0); } @@ -244,6 +264,30 @@ extern "C" } } + SWIGEXPORT int SWIGSTDCALL CSharp_Dali_GlView_GetBackendMode(void *nuiGlView) { + int jresult; + Dali::Toolkit::GlView *glView = nullptr; + Dali::Toolkit::GlView::BackendMode result; + + glView = (Dali::Toolkit::GlView *)nuiGlView; + if (!glView) { + SWIG_CSharpSetPendingExceptionArgument( + SWIG_CSharpArgumentNullException, + "Attempt to dereference null Dali::Toolkit::GlView", 0); + return 0; + } + + { + try { + result = (Dali::Toolkit::GlView::BackendMode)(glView)->GetBackendMode(); + } + CALL_CATCH_EXCEPTION(0); + } + + jresult = (int)result; + return jresult; + } + #ifdef __cplusplus } #endif -- 2.7.4