Answer the question
In order to leave comments, you need to log in
How to integrate C++ OpenGL application in React Native?
Once I tried to do something similar, only in a native environment (first of all, we are talking about Android). Here's what happened.
The idea is that the main part of the application, which is responsible for displaying the OpenGL context and all the logic, is sufficiently productive, so C ++ was chosen, after which it was possible to insert it all in the form of a .so library (though for linking it without hundreds of lines on the Java and C ++ side did not work out).
As a result, the main part of the 3D application is developed separately from the platform-dependent one.
After a while, I decided to return to work on this, but the idea of developing the native part for Android no longer seems so interesting (although later it is planned for iOS).
And before I considered various frameworks for creating hybrid applications, such as Cordova or React Native. The first one definitely disappears due to its sluggishness. For the second, I didn’t even find any arguments about why you shouldn’t use it, I tried simple examples - everything is ok.
But first of all, the task is the following - to introduce a native component into the application, which should work independently with Surface. If in the tested case from Java it was still necessary to start rendering and share events, then here it is even worse: for example, here is the implementation of canvas . 1000 lines Carl! + It is not yet completely clear how it works.
Someone solved a similar problem with React Native, are there simpler examples of linking the native part with RN? Or are there other more friendly tools in this regard?
Answer the question
In order to leave comments, you need to log in
React Native surprised me in this regard)) I managed to insert a native GLSurfaceView without any problems.
branch with a simple Renderer, and in master already with a .so library that was built in a once proven way
Bottom line: React Native interacts with the native part without any problems and allows not only manipulate simple data, but also embed native elements
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question