Commit Graph

13 Commits

Author SHA1 Message Date
Mis012
9ef2151c5e GLSurfaceView: remove old implementation, import the one from AOSP
Now that we have a reasonably well working SurfaceView implementation,
it is actually cleaner to just implement GLSurfaceView the way AOSP
does. In fact, their code doesn't have any weird dependencies, and
can mostly be used as-is.

The AOSP code is pure Java, which means we had to implement some
EGL wrappers.

This change fixes issues with Wayland (it only ever worked because
the pbuffers were allocated using an XWayland EGLDisplay), and
with resizing (which we simply didn't support), all while getting
rid of quite some (arguably not very readable) LoC.
2023-10-20 20:54:37 +02:00
Mis012
4a0755c6e0 api-impl{-jni}: make view.onTouchEvent work, misc stuff to make input work for Unity games
onTouchEvent was previously incorrectly handled in GLSurfaceView; move it
to View so that it works properly with any of it's descendants.

This is done by reusing the existing setOnTouchListener implementation
and changing it to use GtkEventControllerLegacy which provides motion
events.

Technically some of the code is in WrapperWidget.c since every widget
calls wrapper_widget_set_jobject and we already have related code
there.
2023-10-17 21:33:59 +02:00
Mis012
bf8f11d123 api-ipml/GLSurfaceView: fix indentation/newlines, fix compilation when DEBUG_GLAREA is defined 2023-10-09 20:10:29 +02:00
Julian Winkler
372ff3fba0 implement GLES10 by simply subclassing GLES20
Most GLES10 functions are identical to the GLES20 functions. No need to
implement this twice.
2023-09-01 16:05:26 +02:00
Julian Winkler
4d90002ec6 Simplify native interface of widget implementations
Makes it easier to overwrite behavior in subclasses. Have a fallback
implementation for ViewGroup.
Save some _GET_LONG_FIELD / _SET_LONG_FIELD calls by directly passing
the native pointers to and from native methods.
2023-08-22 15:53:09 +02:00
Julian Winkler
6b79adb2c3 add missing Context attribute to all View constructors 2023-08-08 14:18:20 +02:00
Mis012
0a9591c474 src/api-impl: fix up code style, mainly for code imported from AOSP
used the following (plus manual edits):
`clang-format --style="{BasedOnStyle: LLVM, IndentWidth: 8, UseTab: Always, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: true, ColumnLimit: 0}`
2023-06-22 11:45:46 +02:00
Julian Winkler
48ef2fffdf implement GLES20 java bindings
These are just one to one bindings for the native OpenGL 2.0 APIs
2023-06-18 11:28:40 +02:00
Mis012
4dd31731f9 src/api-impl: misc stubbing 2023-01-09 12:07:57 +01:00
Mis012
bc66fb69da api-impl/.../GLSurfaceView.java: implement queueEvent 2023-01-05 19:01:40 +01:00
Mis012
63d7427d0e GLSurfaceView: call SurfaceHolderCallback.surfaceCreated in case the app expects that; compensate for mismatch between touch input and the rendering area 2022-12-27 17:11:59 +01:00
Mis012
165f0fd4fe src/api-impl/android/opengl/GLSurfaceView.java: add onResume stub 2022-11-02 16:27:20 +01:00
Mis012
449090143e refactor source tree organization, switch to meson 2022-10-09 22:59:16 +02:00