2222 * DEALINGS IN THE SOFTWARE.
2323 */
2424
25-
26- #if defined( __android__ ) && !defined( ANDROID )
27- #define ANDROID
28- #endif
29-
3025//Note: This interface provides the following two things privately.
3126//you may "extern" them in your code.
3227
3328
34- #ifdef ANDROID
29+ #ifdef CNFG_ANDROID
3530
3631
3732#include "CNFGAndroid.h"
@@ -60,7 +55,7 @@ int android_sdk_version;
6055#include <stdint.h>
6156#include <EGL/egl.h>
6257
63- #ifdef ANDROID
58+ #ifdef CNFG_ANDROID
6459#include <GLES3/gl3.h>
6560#else
6661#include <GLES2/gl2.h>
@@ -105,7 +100,7 @@ int android_sdk_version;
105100 unsigned int format ; /* extra format information in case rgbal is not enough, especially for YUV formats */
106101 } fbdev_pixmap ;
107102
108- #if defined( ANDROID )
103+ #if defined( CNFG_ANDROID )
109104EGLNativeWindowType native_window ;
110105#else
111106struct fbdev_window native_window ;
@@ -123,7 +118,7 @@ static EGLint const config_attribute_list[] = {
123118 EGL_STENCIL_SIZE , 0 ,
124119 EGL_DEPTH_SIZE , EGL_ZBITS ,
125120 //EGL_SAMPLES, 1,
126- #ifdef ANDROID
121+ #ifdef CNFG_ANDROID
127122#if ANDROIDVERSION >= 28
128123 EGL_RENDERABLE_TYPE , EGL_OPENGL_ES3_BIT ,
129124#else
@@ -164,7 +159,7 @@ void CNFGSwapBuffers()
164159 if ( egl_display == EGL_NO_DISPLAY ) return ;
165160 CNFGFlushRender ();
166161 eglSwapBuffers (egl_display , egl_surface );
167- #ifdef ANDROID
162+ #ifdef CNFG_ANDROID
168163 if ( !override_android_screen_dimensons )
169164 {
170165 android_width = ANativeWindow_getWidth ( native_window );
@@ -178,7 +173,7 @@ void CNFGSwapBuffers()
178173
179174void CNFGGetDimensions ( short * x , short * y )
180175{
181- #ifdef ANDROID
176+ #ifdef CNFG_ANDROID
182177 * x = android_width ;
183178 * y = android_height ;
184179#else
@@ -232,7 +227,7 @@ int CNFGSetup( const char * WindowName, int w, int h )
232227 egl_display = eglGetDisplay ((EGLNativeDisplayType ) XDisplay );
233228#else
234229
235- #ifndef ANDROID
230+ #ifndef CNFG_ANDROID
236231 if ( w >= 1 && h >= 1 )
237232 {
238233 native_window .width = w ;
@@ -306,7 +301,7 @@ int CNFGSetup( const char * WindowName, int w, int h )
306301 }
307302 printf ( "Width/Height: %dx%d\n" , android_width , android_height );
308303 egl_surface = eglCreateWindowSurface (egl_display , egl_config ,
309- #ifdef ANDROID
304+ #ifdef CNFG_ANDROID
310305 gapp -> window ,
311306#else
312307 (EGLNativeWindowType )& native_window ,
@@ -321,7 +316,7 @@ int CNFGSetup( const char * WindowName, int w, int h )
321316 return -1 ;
322317 }
323318
324- #ifndef ANDROID
319+ #ifndef CNFG_ANDROID
325320 int width , height ;
326321 if (!eglQuerySurface (egl_display , egl_surface , EGL_WIDTH , & width ) ||
327322 !eglQuerySurface (egl_display , egl_surface , EGL_HEIGHT , & height )) {
@@ -373,7 +368,7 @@ bool touch_is_down[MAX_NUM_TOUCHES];
373368
374369int32_t handle_input (struct android_app * app , AInputEvent * event )
375370{
376- #ifdef ANDROID
371+ #ifdef CNFG_ANDROID
377372 //Potentially do other things here.
378373
379374 if (AInputEvent_getType (event ) == AINPUT_EVENT_TYPE_MOTION )
@@ -440,7 +435,7 @@ int32_t handle_input(struct android_app* app, AInputEvent* event)
440435int CNFGHandleInput ()
441436{
442437
443- #ifdef ANDROID
438+ #ifdef CNFG_ANDROID
444439 int events ;
445440 struct android_poll_source * source ;
446441 while ( ALooper_pollOnce ( 0 , 0 , & events , (void * * )& source ) >= 0 )
@@ -473,7 +468,7 @@ int CNFGHandleInput()
473468
474469
475470
476- #ifdef ANDROID
471+ #ifdef CNFG_ANDROID
477472
478473void (* HandleWindowTermination )();
479474
0 commit comments