You've already forked lazarus-ccr
Starts preparing the example for using the new jnigraphics version of the LCL
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2169 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.pascal.opengltest"
|
||||
package="com.pascal.lcl"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
@ -9,7 +9,7 @@
|
||||
<application android:label="@string/app_name"
|
||||
android:icon="@drawable/icon"
|
||||
android:debuggable="True">
|
||||
<activity android:name="android.app.NativeActivity"
|
||||
<activity android:name="LCLActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTop">
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="OpenGLNDKTest" default="help">
|
||||
<project name="LCLExample" default="help">
|
||||
|
||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
||||
It contains the path to the SDK. It should *NOT* be checked into
|
||||
|
62
examples/androidlclv2/android/src/com/pascal/lcl/LCLActivity.java
Executable file
62
examples/androidlclv2/android/src/com/pascal/lcl/LCLActivity.java
Executable file
@ -0,0 +1,62 @@
|
||||
package com.pascal.jnitest;
|
||||
|
||||
import android.app.*;
|
||||
import android.content.*;
|
||||
import android.os.*;
|
||||
import android.widget.*;
|
||||
import android.util.*;
|
||||
import android.graphics.*;
|
||||
import android.view.*;
|
||||
|
||||
public class LCLActivity extends Activity
|
||||
{
|
||||
// Our drawing surface
|
||||
private class LCLSurface extends SurfaceView
|
||||
{
|
||||
public LCLSurface(Context context)
|
||||
{
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override protected void onDraw(Canvas canvas)
|
||||
{
|
||||
Bitmap lclbitmap = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888);
|
||||
LCLDrawToBitmap(getWidth(), getHeight(), lclbitmap);
|
||||
canvas.drawBitmap(lclbitmap, 0, 0, null);
|
||||
}
|
||||
}
|
||||
|
||||
/** Called when the activity is first created. */
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
// TextView tv = new TextView(this);
|
||||
// tv.setText( Integer.toString(intFromJNI()) );
|
||||
// setContentView(tv);
|
||||
LCLSurface lclsurface = new LCLSurface(this);
|
||||
setContentView(lclsurface);
|
||||
}
|
||||
|
||||
// JNI table of functions
|
||||
public native String stringFromJNI();
|
||||
public native int intFromJNI();
|
||||
public native int LCLDrawToBitmap(int width, int height, Bitmap bitmap);
|
||||
|
||||
public long nativeCodeLoaded=0;
|
||||
|
||||
static
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.i("JNI", "Trying to load libnativetest.so");
|
||||
System.loadLibrary("nativetest");
|
||||
}
|
||||
catch(UnsatisfiedLinkError ule)
|
||||
{
|
||||
Log.e("JNI", "WARNING: Could not load libnativetest.so");
|
||||
ule.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user