android: link with the jni is now ok
This commit is contained in:
parent
0a479ca7ff
commit
aa3e79f8d1
13
Makefile
13
Makefile
@ -65,7 +65,7 @@ else
|
|||||||
$(error you must specify a corect platform : make PLATFORM=$(SUPPORTED_PLATFORM))
|
$(error you must specify a corect platform : make PLATFORM=$(SUPPORTED_PLATFORM))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(info Build for $(PLATFORM))
|
$(info Build for PLATFORM=$(PLATFORM))
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
### Compilateur base system ###
|
### Compilateur base system ###
|
||||||
@ -305,10 +305,14 @@ $(OUTPUT_NAME_DEBUG): $(OBJ) $(MAKE_DEPENDENCE)
|
|||||||
@cp $@ $(PROG_NAME)
|
@cp $@ $(PROG_NAME)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@echo $(CADRE_HAUT_BAS)
|
@echo $(CADRE_HAUT_BAS)
|
||||||
@echo ' CLEANING : $(F_VIOLET)$(OUTPUT_NAME)$(F_NORMALE)'$(CADRE_COTERS)
|
@echo ' CLEANING : $(F_VIOLET)$(OUTPUT_NAME)$(F_NORMALE)'$(CADRE_COTERS)
|
||||||
@echo $(CADRE_HAUT_BAS)
|
@echo $(CADRE_HAUT_BAS)
|
||||||
|
ifeq ($(PLATFORM), Android)
|
||||||
|
rm -r bin libs gen obj
|
||||||
|
else
|
||||||
@echo Remove Folder : $(OBJECT_DIR)
|
@echo Remove Folder : $(OBJECT_DIR)
|
||||||
@rm -rf $(OBJECT_DIR)
|
@rm -rf $(OBJECT_DIR)
|
||||||
@echo Remove File : $(PROG_NAME) $(OUTPUT_NAME_DEBUG) $(OUTPUT_NAME_RELEASE)
|
@echo Remove File : $(PROG_NAME) $(OUTPUT_NAME_DEBUG) $(OUTPUT_NAME_RELEASE)
|
||||||
@ -322,10 +326,15 @@ clean:
|
|||||||
@rm -f doxygen.log
|
@rm -f doxygen.log
|
||||||
@echo Remove temporary files *.bck
|
@echo Remove temporary files *.bck
|
||||||
@rm -f `find . -name "*.bck"`
|
@rm -f `find . -name "*.bck"`
|
||||||
|
endif
|
||||||
|
|
||||||
count:
|
count:
|
||||||
wc -l Makefile `find $(FILE_DIRECTORY)/ -name "*.cpp"` `find $(FILE_DIRECTORY)/ -name "*.h"`
|
wc -l Makefile `find $(FILE_DIRECTORY)/ -name "*.cpp"` `find $(FILE_DIRECTORY)/ -name "*.h"`
|
||||||
|
|
||||||
|
ifeq ($(PLATFORM), Android)
|
||||||
|
install:
|
||||||
|
sudo $(PROJECT_SDK)/platform-tools/adb install -r ./bin/EwolActivity-debug.apk
|
||||||
|
else
|
||||||
install: .encadrer .versionFile $(OUTPUT_NAME_RELEASE)
|
install: .encadrer .versionFile $(OUTPUT_NAME_RELEASE)
|
||||||
@echo $(CADRE_HAUT_BAS)
|
@echo $(CADRE_HAUT_BAS)
|
||||||
@echo ' INSTALL : $(F_VIOLET)$(OUTPUT_NAME_RELEASE)=>$(PROG_NAME)$(F_NORMALE)'$(CADRE_COTERS)
|
@echo ' INSTALL : $(F_VIOLET)$(OUTPUT_NAME_RELEASE)=>$(PROG_NAME)$(F_NORMALE)'$(CADRE_COTERS)
|
||||||
@ -342,7 +351,7 @@ install: .encadrer .versionFile $(OUTPUT_NAME_RELEASE)
|
|||||||
@mkdir -p /usr/share/edn/images/
|
@mkdir -p /usr/share/edn/images/
|
||||||
@cp -vf data/imagesSources/icone.png /usr/share/edn/images/
|
@cp -vf data/imagesSources/icone.png /usr/share/edn/images/
|
||||||
@cp -vf data/imagesSources/delete-24px.png /usr/share/edn/images/
|
@cp -vf data/imagesSources/delete-24px.png /usr/share/edn/images/
|
||||||
|
endif
|
||||||
|
|
||||||
# http://alp.developpez.com/tutoriels/debian/creer-paquet/
|
# http://alp.developpez.com/tutoriels/debian/creer-paquet/
|
||||||
package: .encadrer
|
package: .encadrer
|
||||||
|
@ -24,6 +24,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include <jni.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <android/log.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <ewol/Debug.h>
|
#include <ewol/Debug.h>
|
||||||
#include <etk/String.h>
|
#include <etk/String.h>
|
||||||
@ -31,11 +36,6 @@
|
|||||||
#include <base/guiAndroid.h>
|
#include <base/guiAndroid.h>
|
||||||
|
|
||||||
|
|
||||||
#include <jni.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <time.h>
|
|
||||||
#include <android/log.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include <app.h>
|
#include <app.h>
|
||||||
|
|
||||||
@ -61,99 +61,98 @@ static long _getTime(void)
|
|||||||
return (long)(now.tv_sec*1000 + now.tv_usec/1000);
|
return (long)(now.tv_sec*1000 + now.tv_usec/1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Call to initialize the graphics state */
|
extern "C"
|
||||||
void Java_com_example_ewolAbstraction_EwolRenderer_nativeInit( JNIEnv* env )
|
|
||||||
{
|
{
|
||||||
EWOL_INFO("Init : Start All Application");
|
|
||||||
appInit();
|
|
||||||
gAppAlive = 1;
|
|
||||||
sDemoStopped = 0;
|
|
||||||
sTimeOffsetInit = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/* Call to initialize the graphics state */
|
||||||
void Java_com_example_ewolAbstraction_EwolRenderer_nativeResize( JNIEnv* env, jobject thiz, jint w, jint h )
|
void Java_com_example_ewolAbstraction_EwolRenderer_nativeInit( JNIEnv* env )
|
||||||
{
|
{
|
||||||
currentWidth = w;
|
EWOL_INFO("Init : Start All Application");
|
||||||
currentHeight = h;
|
appInit();
|
||||||
EWOL_INFO("Resize w=" << w << " h=" << h);
|
gAppAlive = 1;
|
||||||
}
|
sDemoStopped = 0;
|
||||||
|
sTimeOffsetInit = 0;
|
||||||
/* Call to finalize the graphics state */
|
|
||||||
void Java_com_example_ewolAbstraction_EwolRenderer_nativeDone( JNIEnv* env )
|
|
||||||
{
|
|
||||||
EWOL_INFO("Renderer : Close All Application");
|
|
||||||
appDeinit();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This is called to indicate to the render loop that it should
|
|
||||||
* stop as soon as possible.
|
|
||||||
*/
|
|
||||||
void Java_com_example_ewolAbstraction_EwolGLSurfaceView_nativePause( JNIEnv* env )
|
|
||||||
{
|
|
||||||
sDemoStopped = !sDemoStopped;
|
|
||||||
if (sDemoStopped) {
|
|
||||||
/* we paused the animation, so store the current
|
|
||||||
* time in sTimeStopped for future nativeRender calls */
|
|
||||||
sTimeStopped = _getTime();
|
|
||||||
} else {
|
|
||||||
/* we resumed the animation, so adjust the time offset
|
|
||||||
* to take care of the pause interval. */
|
|
||||||
sTimeOffset -= _getTime() - sTimeStopped;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Java_com_example_ewolAbstraction_EwolGLSurfaceView_nativeEventInputMotion( JNIEnv* env, jobject thiz, jint pointerID, jfloat x, jfloat y )
|
void Java_com_example_ewolAbstraction_EwolRenderer_nativeResize( JNIEnv* env, jobject thiz, jint w, jint h )
|
||||||
{
|
{
|
||||||
EWOL_INFO("Event : Input Motion ID=" << pointerID << " x=" << x << " y=" << y);
|
currentWidth = w;
|
||||||
if (0 == pointerID) {
|
currentHeight = h;
|
||||||
appMove(x,y);
|
EWOL_INFO("Resize w=" << w << " h=" << h);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void Java_com_example_ewolAbstraction_EwolGLSurfaceView_nativeEventInputState( JNIEnv* env, jobject thiz, jint pointerID, jboolean isUp)
|
/* Call to finalize the graphics state */
|
||||||
{
|
void Java_com_example_ewolAbstraction_EwolRenderer_nativeDone( JNIEnv* env )
|
||||||
if (isUp) {
|
{
|
||||||
__android_log_print(ANDROID_LOG_INFO, "EWOL", "Event : Input ID=%d [DOWN]", pointerID);
|
EWOL_INFO("Renderer : Close All Application");
|
||||||
EWOL_INFO("Event : Input ID=" << pointerID << " [DOWN]");
|
appDeinit();
|
||||||
} else {
|
|
||||||
__android_log_print(ANDROID_LOG_INFO, "EWOL", "Event : Input ID=%d [UP]", pointerID);
|
|
||||||
EWOL_INFO("Event : Input ID=" << pointerID << " [UP]");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* This is called to indicate to the render loop that it should
|
||||||
|
* stop as soon as possible.
|
||||||
|
*/
|
||||||
|
void Java_com_example_ewolAbstraction_EwolGLSurfaceView_nativePause( JNIEnv* env )
|
||||||
|
{
|
||||||
|
sDemoStopped = !sDemoStopped;
|
||||||
|
if (sDemoStopped) {
|
||||||
|
/* we paused the animation, so store the current
|
||||||
|
* time in sTimeStopped for future nativeRender calls */
|
||||||
|
sTimeStopped = _getTime();
|
||||||
|
} else {
|
||||||
|
/* we resumed the animation, so adjust the time offset
|
||||||
|
* to take care of the pause interval. */
|
||||||
|
sTimeOffset -= _getTime() - sTimeStopped;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Java_com_example_ewolAbstraction_EwolGLSurfaceView_nativeEventInputMotion( JNIEnv* env, jobject thiz, jint pointerID, jfloat x, jfloat y )
|
||||||
|
{
|
||||||
|
EWOL_INFO("Event : Input Motion ID=" << pointerID << " x=" << x << " y=" << y);
|
||||||
|
if (0 == pointerID) {
|
||||||
|
appMove(x,y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Java_com_example_ewolAbstraction_EwolGLSurfaceView_nativeEventInputState( JNIEnv* env, jobject thiz, jint pointerID, jboolean isUp)
|
||||||
|
{
|
||||||
|
if (isUp) {
|
||||||
|
EWOL_INFO("Event : Input ID=" << pointerID << " [DOWN]");
|
||||||
|
} else {
|
||||||
|
EWOL_INFO("Event : Input ID=" << pointerID << " [UP]");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Java_com_example_ewolAbstraction_EwolGLSurfaceView_nativeEventUnknow( JNIEnv* env, jobject thiz, jint eventID)
|
||||||
|
{
|
||||||
|
EWOL_WARNING("Event : Unknow ID=" << eventID);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Call to render the next GL frame */
|
||||||
|
void Java_com_example_ewolAbstraction_EwolRenderer_nativeRender( JNIEnv* env )
|
||||||
|
{
|
||||||
|
long curTime;
|
||||||
|
|
||||||
|
/* NOTE: if sDemoStopped is TRUE, then we re-render the same frame
|
||||||
|
* on each iteration.
|
||||||
|
*/
|
||||||
|
if (sDemoStopped) {
|
||||||
|
curTime = sTimeStopped + sTimeOffset;
|
||||||
|
} else {
|
||||||
|
curTime = _getTime() + sTimeOffset;
|
||||||
|
if (sTimeOffsetInit == 0) {
|
||||||
|
sTimeOffsetInit = 1;
|
||||||
|
sTimeOffset = -curTime;
|
||||||
|
curTime = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
appRender(curTime, currentWidth, currentHeight);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Java_com_example_ewolAbstraction_EwolGLSurfaceView_nativeEventUnknow( JNIEnv* env, jobject thiz, jint eventID)
|
|
||||||
{
|
|
||||||
EWOL_WARNING("Event : Unknow ID=" << eventID);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Call to render the next GL frame */
|
|
||||||
void Java_com_example_ewolAbstraction_EwolRenderer_nativeRender( JNIEnv* env )
|
|
||||||
{
|
|
||||||
long curTime;
|
|
||||||
|
|
||||||
/* NOTE: if sDemoStopped is TRUE, then we re-render the same frame
|
|
||||||
* on each iteration.
|
|
||||||
*/
|
|
||||||
if (sDemoStopped) {
|
|
||||||
curTime = sTimeStopped + sTimeOffset;
|
|
||||||
} else {
|
|
||||||
curTime = _getTime() + sTimeOffset;
|
|
||||||
if (sTimeOffsetInit == 0) {
|
|
||||||
sTimeOffsetInit = 1;
|
|
||||||
sTimeOffset = -curTime;
|
|
||||||
curTime = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//__android_log_print(ANDROID_LOG_INFO, "EWOL", "curTime=%ld", curTime);
|
|
||||||
|
|
||||||
appRender(curTime, currentWidth, currentHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -179,9 +179,9 @@ class FTFontInternal
|
|||||||
}
|
}
|
||||||
EWOL_INFO(" unit per EM = " << m_fftFace->units_per_EM);
|
EWOL_INFO(" unit per EM = " << m_fftFace->units_per_EM);
|
||||||
EWOL_INFO(" num of fixed sizes = " << m_fftFace->num_fixed_sizes);
|
EWOL_INFO(" num of fixed sizes = " << m_fftFace->num_fixed_sizes);
|
||||||
EWOL_INFO(" Availlable sizes = " << (int)m_fftFace->available_sizes);
|
//EWOL_INFO(" Availlable sizes = " << (int)m_fftFace->available_sizes);
|
||||||
|
|
||||||
EWOL_INFO(" Current size = " << (int)m_fftFace->size);
|
//EWOL_INFO(" Current size = " << (int)m_fftFace->size);
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
FTFontInternal(etk::File fontFileName, etk::String fontName)
|
FTFontInternal(etk::File fontFileName, etk::String fontName)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user