CG Updates and some SDL2 changes
This commit is contained in:
@@ -844,36 +844,36 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call
|
|||||||
/*
|
/*
|
||||||
* Get an EGL instance
|
* Get an EGL instance
|
||||||
*/
|
*/
|
||||||
mEgl = (EGL10) EGLContext.getEGL();
|
//mEgl = (EGL10) EGLContext.getEGL();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get to the default display.
|
* Get to the default display.
|
||||||
*/
|
*/
|
||||||
mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
|
//mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We can now initialize EGL for that display
|
* We can now initialize EGL for that display
|
||||||
*/
|
*/
|
||||||
int[] version = new int[2];
|
/*int[] version = new int[2];
|
||||||
mEgl.eglInitialize(mEglDisplay, version);
|
mEgl.eglInitialize(mEglDisplay, version);
|
||||||
mEglConfig = mEGLConfigChooser.chooseConfig(mEgl, mEglDisplay);
|
mEglConfig = mEGLConfigChooser.chooseConfig(mEgl, mEglDisplay);
|
||||||
if( mEglConfig == null )
|
if( mEglConfig == null )
|
||||||
Log.e("SDL", "GLSurfaceView_SDL::EglHelper::start(): mEglConfig is NULL");
|
Log.e("SDL", "GLSurfaceView_SDL::EglHelper::start(): mEglConfig is NULL");*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create an OpenGL ES context. This must be done only once, an
|
* Create an OpenGL ES context. This must be done only once, an
|
||||||
* OpenGL context is a somewhat heavy object.
|
* OpenGL context is a somewhat heavy object.
|
||||||
*/
|
*/
|
||||||
final int EGL_CONTEXT_CLIENT_VERSION = 0x3098;
|
/*final int EGL_CONTEXT_CLIENT_VERSION = 0x3098;
|
||||||
final int[] gles2_attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
|
final int[] gles2_attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
|
||||||
|
|
||||||
mEglContext = mEgl.eglCreateContext(mEglDisplay, mEglConfig,
|
mEglContext = mEgl.eglCreateContext(mEglDisplay, mEglConfig,
|
||||||
EGL10.EGL_NO_CONTEXT, mEGLConfigChooser.isGles2Required() ? gles2_attrib_list : null );
|
EGL10.EGL_NO_CONTEXT, mEGLConfigChooser.isGles2Required() ? gles2_attrib_list : null );
|
||||||
|
|
||||||
if( mEglContext == null || mEglContext == EGL10.EGL_NO_CONTEXT )
|
if( mEglContext == null || mEglContext == EGL10.EGL_NO_CONTEXT )
|
||||||
Log.e("SDL", "GLSurfaceView_SDL::EglHelper::start(): mEglContext is EGL_NO_CONTEXT, error: " + mEgl.eglGetError());
|
Log.e("SDL", "GLSurfaceView_SDL::EglHelper::start(): mEglContext is EGL_NO_CONTEXT, error: " + mEgl.eglGetError());*/
|
||||||
|
|
||||||
mEglSurface = null;
|
//mEglSurface = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -886,16 +886,16 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call
|
|||||||
* The window size has changed, so we need to create a new
|
* The window size has changed, so we need to create a new
|
||||||
* surface.
|
* surface.
|
||||||
*/
|
*/
|
||||||
if (mEglSurface != null) {
|
/*if (mEglSurface != null) {*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unbind and destroy the old EGL surface, if
|
* Unbind and destroy the old EGL surface, if
|
||||||
* there is one.
|
* there is one.
|
||||||
*/
|
*/
|
||||||
mEgl.eglMakeCurrent(mEglDisplay, EGL10.EGL_NO_SURFACE,
|
/*mEgl.eglMakeCurrent(mEglDisplay, EGL10.EGL_NO_SURFACE,
|
||||||
EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT);
|
EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT);
|
||||||
mEgl.eglDestroySurface(mEglDisplay, mEglSurface);
|
mEgl.eglDestroySurface(mEglDisplay, mEglSurface);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create an EGL surface we can render into.
|
* Create an EGL surface we can render into.
|
||||||
@@ -908,23 +908,24 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call
|
|||||||
attribList[2] = mEgl.EGL_NONE;
|
attribList[2] = mEgl.EGL_NONE;
|
||||||
attribList[3] = mEgl.EGL_NONE;
|
attribList[3] = mEgl.EGL_NONE;
|
||||||
*/
|
*/
|
||||||
mEglSurface = mEgl.eglCreateWindowSurface(mEglDisplay,
|
/*mEglSurface = mEgl.eglCreateWindowSurface(mEglDisplay,
|
||||||
mEglConfig, holder, null);
|
mEglConfig, holder, null);*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Before we can issue GL commands, we need to make sure
|
* Before we can issue GL commands, we need to make sure
|
||||||
* the context is current and bound to a surface.
|
* the context is current and bound to a surface.
|
||||||
*/
|
*/
|
||||||
mEgl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface,
|
/*mEgl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface,
|
||||||
mEglContext);
|
mEglContext);*/
|
||||||
|
|
||||||
|
|
||||||
GL gl = mEglContext.getGL();
|
/*GL gl = mEglContext.getGL();
|
||||||
if (mGLWrapper != null) {
|
if (mGLWrapper != null) {
|
||||||
gl = mGLWrapper.wrap(gl);
|
gl = mGLWrapper.wrap(gl);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
return gl;
|
//return gl;
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -932,7 +933,7 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call
|
|||||||
* @return false if the context has been lost.
|
* @return false if the context has been lost.
|
||||||
*/
|
*/
|
||||||
public boolean swap() {
|
public boolean swap() {
|
||||||
mEgl.eglSwapBuffers(mEglDisplay, mEglSurface);
|
//mEgl.eglSwapBuffers(mEglDisplay, mEglSurface);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Always check for EGL_CONTEXT_LOST, which means the context
|
* Always check for EGL_CONTEXT_LOST, which means the context
|
||||||
@@ -940,17 +941,18 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call
|
|||||||
* the device went to sleep). We need to sleep until we
|
* the device went to sleep). We need to sleep until we
|
||||||
* get a new surface.
|
* get a new surface.
|
||||||
*/
|
*/
|
||||||
return mEgl.eglGetError() != EGL11.EGL_CONTEXT_LOST;
|
//return mEgl.eglGetError() != EGL11.EGL_CONTEXT_LOST;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void finish() {
|
public void finish() {
|
||||||
Log.v("SDL", "GLSurfaceView_SDL::EglHelper::finish(): destroying GL context");
|
Log.v("SDL", "GLSurfaceView_SDL::EglHelper::finish(): destroying GL context");
|
||||||
if (mEglSurface != null) {
|
/*if (mEglSurface != null) {
|
||||||
mEgl.eglMakeCurrent(mEglDisplay, EGL10.EGL_NO_SURFACE,
|
mEgl.eglMakeCurrent(mEglDisplay, EGL10.EGL_NO_SURFACE,
|
||||||
EGL10.EGL_NO_SURFACE,
|
EGL10.EGL_NO_SURFACE,
|
||||||
EGL10.EGL_NO_CONTEXT);
|
EGL10.EGL_NO_CONTEXT);
|
||||||
mEgl.eglDestroySurface(mEglDisplay, mEglSurface);
|
//mEgl.eglDestroySurface(mEglDisplay, mEglSurface);
|
||||||
mEglSurface = null;
|
//mEglSurface = null;
|
||||||
}
|
}
|
||||||
if (mEglContext != null) {
|
if (mEglContext != null) {
|
||||||
mEgl.eglDestroyContext(mEglDisplay, mEglContext);
|
mEgl.eglDestroyContext(mEglDisplay, mEglContext);
|
||||||
@@ -959,14 +961,14 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call
|
|||||||
if (mEglDisplay != null) {
|
if (mEglDisplay != null) {
|
||||||
mEgl.eglTerminate(mEglDisplay);
|
mEgl.eglTerminate(mEglDisplay);
|
||||||
mEglDisplay = null;
|
mEglDisplay = null;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
EGL10 mEgl;
|
/*EGL10 mEgl;
|
||||||
EGLDisplay mEglDisplay;
|
EGLDisplay mEglDisplay;
|
||||||
EGLSurface mEglSurface;
|
EGLSurface mEglSurface;
|
||||||
EGLConfig mEglConfig;
|
EGLConfig mEglConfig;
|
||||||
EGLContext mEglContext;
|
EGLContext mEglContext;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1081,7 +1083,7 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call
|
|||||||
tellRendererSurfaceChanged = true;
|
tellRendererSurfaceChanged = true;
|
||||||
}
|
}
|
||||||
if (tellRendererSurfaceCreated) {
|
if (tellRendererSurfaceCreated) {
|
||||||
mRenderer.onSurfaceCreated(mGL, mEglHelper.mEglConfig);
|
//mRenderer.onSurfaceCreated(mGL, mEglHelper.mEglConfig);
|
||||||
tellRendererSurfaceCreated = false;
|
tellRendererSurfaceCreated = false;
|
||||||
}
|
}
|
||||||
if (tellRendererSurfaceChanged) {
|
if (tellRendererSurfaceChanged) {
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ public class MainActivity extends SDLActivity
|
|||||||
_layout2 = null;
|
_layout2 = null;
|
||||||
_btn = null;
|
_btn = null;
|
||||||
_tv = null;
|
_tv = null;
|
||||||
_inputManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
//_inputManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
/*_videoLayout = new FrameLayout(this);
|
/*_videoLayout = new FrameLayout(this);
|
||||||
SetLayerType.get().setLayerType(_videoLayout);
|
SetLayerType.get().setLayerType(_videoLayout);
|
||||||
setContentView(_videoLayout);*/
|
setContentView(_videoLayout);*/
|
||||||
@@ -432,9 +432,9 @@ public class MainActivity extends SDLActivity
|
|||||||
|
|
||||||
public void showScreenKeyboardWithoutTextInputField()
|
public void showScreenKeyboardWithoutTextInputField()
|
||||||
{
|
{
|
||||||
_inputManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
|
//_inputManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
|
||||||
_inputManager.showSoftInput(mGLView, InputMethodManager.SHOW_FORCED);
|
//_inputManager.showSoftInput(mGLView, InputMethodManager.SHOW_FORCED);
|
||||||
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
|
//getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showScreenKeyboard(final String oldText, boolean sendBackspace)
|
public void showScreenKeyboard(final String oldText, boolean sendBackspace)
|
||||||
@@ -466,7 +466,7 @@ public class MainActivity extends SDLActivity
|
|||||||
keyCode == KeyEvent.KEYCODE_BUTTON_3 ||
|
keyCode == KeyEvent.KEYCODE_BUTTON_3 ||
|
||||||
keyCode == KeyEvent.KEYCODE_BUTTON_4 ))
|
keyCode == KeyEvent.KEYCODE_BUTTON_4 ))
|
||||||
{
|
{
|
||||||
_parent.hideScreenKeyboard();
|
//_parent.hideScreenKeyboard();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (keyCode == KeyEvent.KEYCODE_DEL || keyCode == KeyEvent.KEYCODE_CLEAR)
|
if (keyCode == KeyEvent.KEYCODE_DEL || keyCode == KeyEvent.KEYCODE_CLEAR)
|
||||||
@@ -554,19 +554,19 @@ public class MainActivity extends SDLActivity
|
|||||||
}, 500 );
|
}, 500 );
|
||||||
};
|
};
|
||||||
|
|
||||||
public void hideScreenKeyboard()
|
/*public void hideScreenKeyboard()
|
||||||
{
|
{
|
||||||
if(_screenKeyboard == null)
|
if(_screenKeyboard == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
synchronized(textInput)
|
synchronized(textInput)
|
||||||
{
|
{
|
||||||
String text = _screenKeyboard.getText().toString();
|
String text = _screenKeyboard.getText().toString();*/
|
||||||
/*for(int i = 0; i < text.length(); i++)
|
/*for(int i = 0; i < text.length(); i++)
|
||||||
{
|
{
|
||||||
DemoRenderer.nativeTextInput( (int)text.charAt(i), (int)text.codePointAt(i) );
|
DemoRenderer.nativeTextInput( (int)text.charAt(i), (int)text.codePointAt(i) );
|
||||||
}*/
|
}*/
|
||||||
}
|
/*}
|
||||||
//DemoRenderer.nativeTextInputFinished();
|
//DemoRenderer.nativeTextInputFinished();
|
||||||
_inputManager.hideSoftInputFromWindow(_screenKeyboard.getWindowToken(), 0);
|
_inputManager.hideSoftInputFromWindow(_screenKeyboard.getWindowToken(), 0);
|
||||||
mLayout.removeView(_screenKeyboard);
|
mLayout.removeView(_screenKeyboard);
|
||||||
@@ -574,9 +574,9 @@ public class MainActivity extends SDLActivity
|
|||||||
mGLView.setFocusableInTouchMode(true);
|
mGLView.setFocusableInTouchMode(true);
|
||||||
mGLView.setFocusable(true);
|
mGLView.setFocusable(true);
|
||||||
mGLView.requestFocus();
|
mGLView.requestFocus();
|
||||||
};
|
};*/
|
||||||
|
|
||||||
public boolean isScreenKeyboardShown()
|
/*public boolean isScreenKeyboardShown()
|
||||||
{
|
{
|
||||||
return _screenKeyboard != null;
|
return _screenKeyboard != null;
|
||||||
};
|
};
|
||||||
@@ -670,8 +670,8 @@ public class MainActivity extends SDLActivity
|
|||||||
params[3] = _ad.getView().getMeasuredWidth();
|
params[3] = _ad.getView().getMeasuredWidth();
|
||||||
params[4] = _ad.getView().getMeasuredHeight();
|
params[4] = _ad.getView().getMeasuredHeight();
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
public void requestNewAdvertisement()
|
/*public void requestNewAdvertisement()
|
||||||
{
|
{
|
||||||
if( _ad.getView() != null )
|
if( _ad.getView() != null )
|
||||||
{
|
{
|
||||||
@@ -684,9 +684,9 @@ public class MainActivity extends SDLActivity
|
|||||||
}
|
}
|
||||||
runOnUiThread(new Callback());
|
runOnUiThread(new Callback());
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
@Override
|
/*@Override
|
||||||
public boolean onKeyDown(int keyCode, final KeyEvent event)
|
public boolean onKeyDown(int keyCode, final KeyEvent event)
|
||||||
{
|
{
|
||||||
if(_screenKeyboard != null)
|
if(_screenKeyboard != null)
|
||||||
@@ -696,7 +696,7 @@ public class MainActivity extends SDLActivity
|
|||||||
{
|
{
|
||||||
if( mGLView.nativeKey( keyCode, 1 ) == 0 )
|
if( mGLView.nativeKey( keyCode, 1 ) == 0 )
|
||||||
return super.onKeyDown(keyCode, event);
|
return super.onKeyDown(keyCode, event);
|
||||||
}
|
}*/
|
||||||
/*
|
/*
|
||||||
else
|
else
|
||||||
if( keyCode == KeyEvent.KEYCODE_BACK && downloader != null )
|
if( keyCode == KeyEvent.KEYCODE_BACK && downloader != null )
|
||||||
@@ -707,15 +707,15 @@ public class MainActivity extends SDLActivity
|
|||||||
onStop();
|
onStop();
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
else
|
/*else
|
||||||
if( keyListener != null )
|
if( keyListener != null )
|
||||||
{
|
{
|
||||||
keyListener.onKeyEvent(keyCode);
|
keyListener.onKeyEvent(keyCode);
|
||||||
}
|
}
|
||||||
return true;
|
return true;*/
|
||||||
}
|
//}
|
||||||
|
|
||||||
@Override
|
/*@Override
|
||||||
public boolean onKeyUp(int keyCode, final KeyEvent event)
|
public boolean onKeyUp(int keyCode, final KeyEvent event)
|
||||||
{
|
{
|
||||||
if(_screenKeyboard != null)
|
if(_screenKeyboard != null)
|
||||||
@@ -732,13 +732,13 @@ public class MainActivity extends SDLActivity
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/*@Override
|
/*@Override
|
||||||
public boolean dispatchTouchEvent(final MotionEvent ev)
|
public boolean dispatchTouchEvent(final MotionEvent ev)
|
||||||
{
|
{*/
|
||||||
//Log.i("SDL", "dispatchTouchEvent: " + ev.getAction() + " coords " + ev.getX() + ":" + ev.getY() );
|
//Log.i("SDL", "dispatchTouchEvent: " + ev.getAction() + " coords " + ev.getX() + ":" + ev.getY() );
|
||||||
if(_screenKeyboard != null)
|
/*if(_screenKeyboard != null)
|
||||||
_screenKeyboard.dispatchTouchEvent(ev);
|
_screenKeyboard.dispatchTouchEvent(ev);
|
||||||
else
|
else
|
||||||
if( _ad.getView() != null && // User clicked the advertisement, ignore when user moved finger from game screen to advertisement or touches screen with several fingers
|
if( _ad.getView() != null && // User clicked the advertisement, ignore when user moved finger from game screen to advertisement or touches screen with several fingers
|
||||||
@@ -756,14 +756,15 @@ public class MainActivity extends SDLActivity
|
|||||||
if( _btn != null )
|
if( _btn != null )
|
||||||
return _btn.dispatchTouchEvent(ev);
|
return _btn.dispatchTouchEvent(ev);
|
||||||
else
|
else
|
||||||
if( touchListener != null )
|
/*if( touchListener != null )
|
||||||
touchListener.onTouchEvent(ev);
|
touchListener.onTouchEvent(ev);*/
|
||||||
|
/*
|
||||||
return true;
|
return true;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
@Override
|
/* @Override
|
||||||
public boolean dispatchGenericMotionEvent (MotionEvent ev)
|
public boolean dispatchGenericMotionEvent (MotionEvent ev)
|
||||||
{
|
{*/
|
||||||
//Log.i("SDL", "dispatchGenericMotionEvent: " + ev.getAction() + " coords " + ev.getX() + ":" + ev.getY() );
|
//Log.i("SDL", "dispatchGenericMotionEvent: " + ev.getAction() + " coords " + ev.getX() + ":" + ev.getY() );
|
||||||
// This code fails to run for Android 1.6, so there will be no generic motion event for Andorid screen keyboard
|
// This code fails to run for Android 1.6, so there will be no generic motion event for Andorid screen keyboard
|
||||||
/*
|
/*
|
||||||
@@ -771,10 +772,10 @@ public class MainActivity extends SDLActivity
|
|||||||
_screenKeyboard.dispatchGenericMotionEvent(ev);
|
_screenKeyboard.dispatchGenericMotionEvent(ev);
|
||||||
else
|
else
|
||||||
*/
|
*/
|
||||||
if(mGLView != null)
|
/*if(mGLView != null)
|
||||||
mGLView.onGenericMotionEvent(ev);
|
mGLView.onGenericMotionEvent(ev);
|
||||||
return true;
|
return true;*/
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConfigurationChanged(Configuration newConfig)
|
public void onConfigurationChanged(Configuration newConfig)
|
||||||
@@ -1129,7 +1130,7 @@ public class MainActivity extends SDLActivity
|
|||||||
|
|
||||||
static int NOTIFY_ID = 12367098; // Random ID
|
static int NOTIFY_ID = 12367098; // Random ID
|
||||||
|
|
||||||
private static DemoGLSurfaceView mGLView = null;
|
// private static DemoGLSurfaceView mGLView = null;
|
||||||
private static AudioThread mAudioThread = null;
|
private static AudioThread mAudioThread = null;
|
||||||
private static DataDownloader downloader = null;
|
private static DataDownloader downloader = null;
|
||||||
|
|
||||||
|
|||||||
@@ -507,7 +507,7 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer
|
|||||||
Globals.CommandLine,
|
Globals.CommandLine,
|
||||||
( (Globals.SwVideoMode && Globals.MultiThreadedVideo) || Globals.CompatibilityHacksVideo ) ? 1 : 0,
|
( (Globals.SwVideoMode && Globals.MultiThreadedVideo) || Globals.CompatibilityHacksVideo ) ? 1 : 0,
|
||||||
android.os.Debug.isDebuggerConnected() ? 1 : 0 );*/
|
android.os.Debug.isDebuggerConnected() ? 1 : 0 );*/
|
||||||
System.exit(0); // The main() returns here - I don't bother with deinit stuff, just terminate process
|
//System.exit(0); // The main() returns here - I don't bother with deinit stuff, just terminate process
|
||||||
}
|
}
|
||||||
|
|
||||||
public int swapBuffers() // Called from native code
|
public int swapBuffers() // Called from native code
|
||||||
@@ -539,12 +539,12 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer
|
|||||||
this.notify();
|
this.notify();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( context.isScreenKeyboardShown() )
|
/*if( context.isScreenKeyboardShown() )
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
Thread.sleep(50); // Give some time to the keyboard input thread
|
Thread.sleep(50); // Give some time to the keyboard input thread
|
||||||
} catch(Exception e) { };
|
} catch(Exception e) { };
|
||||||
}
|
}*/
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -589,7 +589,7 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer
|
|||||||
public MainActivity parent;
|
public MainActivity parent;
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
parent.hideScreenKeyboard();
|
//parent.hideScreenKeyboard();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Callback cb = new Callback();
|
Callback cb = new Callback();
|
||||||
@@ -599,12 +599,13 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer
|
|||||||
|
|
||||||
public int isScreenKeyboardShown() // Called from native code
|
public int isScreenKeyboardShown() // Called from native code
|
||||||
{
|
{
|
||||||
return context.isScreenKeyboardShown() ? 1 : 0;
|
//return context.isScreenKeyboardShown() ? 1 : 0;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setScreenKeyboardHintMessage(String s)
|
public void setScreenKeyboardHintMessage(String s)
|
||||||
{
|
{
|
||||||
context.setScreenKeyboardHintMessage(s);
|
//context.setScreenKeyboardHintMessage(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startAccelerometerGyroscope(int started)
|
public void startAccelerometerGyroscope(int started)
|
||||||
@@ -623,19 +624,19 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer
|
|||||||
|
|
||||||
public void getAdvertisementParams(int params[])
|
public void getAdvertisementParams(int params[])
|
||||||
{
|
{
|
||||||
context.getAdvertisementParams(params);
|
//context.getAdvertisementParams(params);
|
||||||
}
|
}
|
||||||
public void setAdvertisementVisible(int visible)
|
public void setAdvertisementVisible(int visible)
|
||||||
{
|
{
|
||||||
context.setAdvertisementVisible(visible);
|
//context.setAdvertisementVisible(visible);
|
||||||
}
|
}
|
||||||
public void setAdvertisementPosition(int left, int top)
|
public void setAdvertisementPosition(int left, int top)
|
||||||
{
|
{
|
||||||
context.setAdvertisementPosition(left, top);
|
//context.setAdvertisementPosition(left, top);
|
||||||
}
|
}
|
||||||
public void requestNewAdvertisement()
|
public void requestNewAdvertisement()
|
||||||
{
|
{
|
||||||
context.requestNewAdvertisement();
|
//context.requestNewAdvertisement();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int PowerOf2(int i)
|
private int PowerOf2(int i)
|
||||||
@@ -719,7 +720,7 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer
|
|||||||
private EGL10 mEgl = null;
|
private EGL10 mEgl = null;
|
||||||
private EGLDisplay mEglDisplay = null;
|
private EGLDisplay mEglDisplay = null;
|
||||||
private EGLSurface mEglSurface = null;
|
private EGLSurface mEglSurface = null;
|
||||||
private EGLContext mEglContext = null;
|
//private EGLContext mEglContext = null;
|
||||||
private boolean mGlContextLost = false;
|
private boolean mGlContextLost = false;
|
||||||
public boolean mGlSurfaceCreated = false;
|
public boolean mGlSurfaceCreated = false;
|
||||||
public boolean mPaused = false;
|
public boolean mPaused = false;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
AppSettingVersion=19
|
AppSettingVersion=19
|
||||||
|
|
||||||
# libSDL version to use (1.2 or 1.3, specify 1.3 for SDL2)
|
# libSDL version to use (1.2 or 1.3, specify 1.3 for SDL2)
|
||||||
LibSdlVersion=2.0
|
LibSdlVersion=1.2
|
||||||
|
|
||||||
# Specify application name (e.x. My Application)
|
# Specify application name (e.x. My Application)
|
||||||
AppName="Commander Genius"
|
AppName="Commander Genius"
|
||||||
@@ -143,7 +143,7 @@ RedefinedKeysScreenKbNames="LCTRL LALT SPACE RETURN"
|
|||||||
# 1 = Simple Theme by Beholder (white, with gamepad joystick)
|
# 1 = Simple Theme by Beholder (white, with gamepad joystick)
|
||||||
# 2 = Sun by Sirea (yellow, with round joystick)
|
# 2 = Sun by Sirea (yellow, with round joystick)
|
||||||
# 3 = Keen by Gerstrong (multicolor, with round joystick)
|
# 3 = Keen by Gerstrong (multicolor, with round joystick)
|
||||||
TouchscreenKeysTheme=4
|
TouchscreenKeysTheme=3
|
||||||
|
|
||||||
# Redefine gamepad keys to SDL keysyms, button order is:
|
# Redefine gamepad keys to SDL keysyms, button order is:
|
||||||
# A B X Y L1 R1 L2 R2 LThumb RThumb
|
# A B X Y L1 R1 L2 R2 LThumb RThumb
|
||||||
@@ -153,13 +153,13 @@ RedefinedKeysGamepad="LCTRL LALT SPACE RETURN"
|
|||||||
StartupMenuButtonTimeout=3000
|
StartupMenuButtonTimeout=3000
|
||||||
|
|
||||||
# Menu items to hide from startup menu, available menu items:
|
# Menu items to hide from startup menu, available menu items:
|
||||||
#
|
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout
|
||||||
HiddenMenuOptions=''
|
HiddenMenuOptions=''
|
||||||
|
|
||||||
# Menu items to show at startup - this is Java code snippet, leave empty for default
|
# Menu items to show at startup - this is Java code snippet, leave empty for default
|
||||||
# new SettingsMenuMisc.ShowReadme(), (AppUsesMouse \&\& \! ForceRelativeMouseMode \? new SettingsMenuMouse.DisplaySizeConfig(true) : new SettingsMenu.DummyMenu()), new SettingsMenuMisc.OptionalDownloadConfig(true), new SettingsMenuMisc.GyroscopeCalibration()
|
# new SettingsMenuMisc.ShowReadme(), (AppUsesMouse \&\& \! ForceRelativeMouseMode \? new SettingsMenuMouse.DisplaySizeConfig(true) : new SettingsMenu.DummyMenu()), new SettingsMenuMisc.OptionalDownloadConfig(true), new SettingsMenuMisc.GyroscopeCalibration()
|
||||||
# Available menu items:
|
# Available menu items:
|
||||||
#
|
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout
|
||||||
FirstStartMenuOptions=''
|
FirstStartMenuOptions=''
|
||||||
|
|
||||||
# Enable multi-ABI binary, with hardware FPU support - it will also work on old devices,
|
# Enable multi-ABI binary, with hardware FPU support - it will also work on old devices,
|
||||||
@@ -170,10 +170,10 @@ MultiABI=n
|
|||||||
AppMinimumRAM=64
|
AppMinimumRAM=64
|
||||||
|
|
||||||
# Application version code (integer)
|
# Application version code (integer)
|
||||||
AppVersionCode=161000
|
AppVersionCode=165000
|
||||||
|
|
||||||
# Application user-visible version name (string)
|
# Application user-visible version name (string)
|
||||||
AppVersionName="1.6.1 Release"
|
AppVersionName="1.6.5 Beta"
|
||||||
|
|
||||||
# Reset SDL config when updating application to the new version (y) / (n)
|
# Reset SDL config when updating application to the new version (y) / (n)
|
||||||
ResetSdlConfigForThisVersion=n
|
ResetSdlConfigForThisVersion=n
|
||||||
@@ -184,7 +184,7 @@ DeleteFilesOnUpgrade="%"
|
|||||||
# Optional shared libraries to compile - removing some of them will save space
|
# Optional shared libraries to compile - removing some of them will save space
|
||||||
# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed
|
# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed
|
||||||
# Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2
|
# Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2
|
||||||
CompiledLibraries="tremor ogg sdl2_image boost_system"
|
CompiledLibraries="tremor ogg sdl_image boost_system"
|
||||||
|
|
||||||
# Application uses custom build script AndroidBuild.sh instead of Android.mk (y) or (n)
|
# Application uses custom build script AndroidBuild.sh instead of Android.mk (y) or (n)
|
||||||
CustomBuildScript=n
|
CustomBuildScript=n
|
||||||
|
|||||||
Submodule project/jni/application/commandergenius/commandergenius updated: 1bcbadd1ea...7d74f19934
@@ -732,6 +732,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
|||||||
public boolean onTouch(View v, MotionEvent event) {
|
public boolean onTouch(View v, MotionEvent event) {
|
||||||
final int touchDevId = event.getDeviceId();
|
final int touchDevId = event.getDeviceId();
|
||||||
final int pointerCount = event.getPointerCount();
|
final int pointerCount = event.getPointerCount();
|
||||||
|
|
||||||
// touchId, pointerId, action, x, y, pressure
|
// touchId, pointerId, action, x, y, pressure
|
||||||
int actionPointerIndex = (event.getAction() & MotionEvent.ACTION_POINTER_ID_MASK) >> MotionEvent.ACTION_POINTER_ID_SHIFT; /* API 8: event.getActionIndex(); */
|
int actionPointerIndex = (event.getAction() & MotionEvent.ACTION_POINTER_ID_MASK) >> MotionEvent.ACTION_POINTER_ID_SHIFT; /* API 8: event.getActionIndex(); */
|
||||||
int pointerFingerId = event.getPointerId(actionPointerIndex);
|
int pointerFingerId = event.getPointerId(actionPointerIndex);
|
||||||
|
|||||||
@@ -9,6 +9,9 @@
|
|||||||
#include "jniwrapperstuff.h"
|
#include "jniwrapperstuff.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// System specific functions
|
// System specific functions
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user