From a37889886c80888733c117129320aaa1f748a42a Mon Sep 17 00:00:00 2001 From: Alexander Mahr Date: Sat, 1 Mar 2025 11:14:22 +0100 Subject: [PATCH] remove graphic texture and "why this?" --- app/src/nativecode/main.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/app/src/nativecode/main.c b/app/src/nativecode/main.c index e98f68f..66c59cd 100644 --- a/app/src/nativecode/main.c +++ b/app/src/nativecode/main.c @@ -517,8 +517,8 @@ uint32_t randomtexturedata[256*256]; int main( int argc, char ** argv ) { //Heightmap int x, y; - double ThisTime; - double LastFPSTime = OGGetAbsoluteTime(); +//why this? double ThisTime; +//why this? double LastFPSTime = OGGetAbsoluteTime(); Log( "Starting Up" ); @@ -571,7 +571,7 @@ int main( int argc, char ** argv ) CNFGHandleInput(); //SENSORSTURFF AccCheck(); - if( suspended ) { usleep(50000); continue; } + if( suspended ) { usleep(1000000); continue; } //webview // RunCallbackOnUIThread( (void(*)(void*))WebViewRequestRenderToCanvas, &MyWebView ); //webview // RunCallbackOnUIThread( CheckWebView, &MyWebView ); @@ -638,26 +638,27 @@ int main( int argc, char ** argv ) //webview CNFGPenX = 0; CNFGPenY = 100; //webview // CNFGDrawText( fromJSBuffer, 6 ); - int x, y; - for( y = 0; y < 256; y++ ) - for( x = 0; x < 256; x++ ) - randomtexturedata[x+y*256] = x | ((x*394543L+y*355+iframeno*3)<<8); - CNFGBlitImage( randomtexturedata, 100, 600, 256, 256 ); +//graphic-random-texture int x, y; +//graphic-random-texture for( y = 0; y < 256; y++ ) +//graphic-random-texture for( x = 0; x < 256; x++ ) +//graphic-random-texture randomtexturedata[x+y*256] = x | ((x*394543L+y*355+iframeno*3)<<8); +//graphic-random-texture CNFGBlitImage( randomtexturedata, 100, 600, 256, 256 ); //webview //WebViewNativeGetPixels( &MyWebView, webviewdata, 500, 500 ); //webview //CNFGBlitImage( webviewdata, 500, 640, 500, 500 ); - frames++; +//why this? frames++; //On Android, CNFGSwapBuffers must be called, and CNFGUpdateScreenWithBitmap does not have an implied framebuffer swap. CNFGSwapBuffers(); - ThisTime = OGGetAbsoluteTime(); - if( ThisTime > LastFPSTime + 1 ) - { - printf( "FPS: %d\n", frames ); - frames = 0; - LastFPSTime+=1; - } +// unclear if this would garanty a fram rate limiting? +//why this? ThisTime = OGGetAbsoluteTime(); +//why this? if( ThisTime > LastFPSTime + 1 ) +//why this? { +//why this? printf( "FPS: %d\n", frames ); +//why this? frames = 0; +//why this? LastFPSTime+=1; +//why this? } }