Author Topic: Android Developement Log  (Read 535 times)

wiggins

  • Newbie
  • *
  • Posts: 46
Re: Android Developement Log
« Reply #15 on: April 18, 2013, 07:57:52 PM »
This is very exciting news.

Galleon

  • Administrator
  • Hero Member
  • *****
  • Posts: 4620
  • QB Forever
    • Email
Re: Android Developement Log
« Reply #16 on: April 18, 2013, 08:03:00 PM »
Just gotta replace these GL calls with some equivalent GL ES, it's mainly an issue of using vertex buffers as I see it. These are only used for scaling, so it may be possible to just comment out some of this (temporarily) and actually see program output.
Code: [Select]
In file included from jni/main.cpp:8:0:
jni/c/libqb.cpp: In function 'void GLUT_DISPLAY_REQUEST()':
jni/c/libqb.cpp:27977:53: error: 'gluOrtho2D' was not declared in this scope
jni/c/libqb.cpp:28014:10: error: 'GL_QUADS' was not declared in this scope
jni/c/libqb.cpp:28014:18: error: 'glBegin' was not declared in this scope
jni/c/libqb.cpp:28015:25: error: 'glTexCoord2f' was not declared in this scope
jni/c/libqb.cpp:28015:45: error: 'glVertex2f' was not declared in this scope
jni/c/libqb.cpp:28019:8: error: 'glEnd' was not declared in this scope
jni/c/libqb.cpp:28026:11: error: 'GL_QUADS' was not declared in this scope
jni/c/libqb.cpp:28026:19: error: 'glBegin' was not declared in this scope
jni/c/libqb.cpp:28027:26: error: 'glTexCoord2f' was not declared in this scope
jni/c/libqb.cpp:28027:44: error: 'glVertex2f' was not declared in this scope
jni/c/libqb.cpp:28031:9: error: 'glEnd' was not declared in this scope
jni/c/libqb.cpp:28047:45: error: 'glOrtho' was not declared in this scope
jni/c/libqb.cpp:28048:19: error: 'glRasterPos2f' was not declared in this scope
jni/c/libqb.cpp:28049:24: error: 'glPixelZoom' was not declared in this scope
jni/c/libqb.cpp:28061:98: error: 'glDrawPixels' was not declared in this scope
jni/c/libqb.cpp:28075:53: error: 'gluOrtho2D' was not declared in this scope
jni/c/libqb.cpp:28087:9: error: 'GL_QUADS' was not declared in this scope
jni/c/libqb.cpp:28087:17: error: 'glBegin' was not declared in this scope
jni/c/libqb.cpp:28088:16: error: 'glColor3f' was not declared in this scope
jni/c/libqb.cpp:28089:18: error: 'glVertex2f' was not declared in this scope
jni/c/libqb.cpp:28099:7: error: 'glEnd' was not declared in this scope
jni/c/libqb.cpp:28108:9: error: 'GL_QUADS' was not declared in this scope
jni/c/libqb.cpp:28108:17: error: 'glBegin' was not declared in this scope
jni/c/libqb.cpp:28109:16: error: 'glColor3f' was not declared in this scope
jni/c/libqb.cpp:28110:18: error: 'glVertex2f' was not declared in this scope
jni/c/libqb.cpp:28120:7: error: 'glEnd' was not declared in this scope
make: *** [obj/local/armeabi/objs/native-activity/main.o] Error 1

Galleon

  • Administrator
  • Hero Member
  • *****
  • Posts: 4620
  • QB Forever
    • Email
Re: Android Developement Log
« Reply #17 on: April 18, 2013, 08:19:39 PM »
DrawPixels is not supported in GL ES, so I'll have to do something different to get the buffer's pixel data onto the screen. Not a problem, but it'll mean a day or so (hey, I'm new to OpenGL ES!) of work-arounds until I get to see if things really work.

OlDosLover

  • Hero Member
  • *****
  • Posts: 3845
  • OlDosLover
    • Email
Re: Android Developement Log
« Reply #18 on: April 19, 2013, 01:02:48 AM »
Hi all,
    Exciting! Thanks for the updates.
OlDosLover.

fluffrabbit

  • Sr. Member
  • ****
  • Posts: 332
Re: Android Developement Log
« Reply #19 on: April 19, 2013, 02:34:35 AM »
I am curious about how licensing would work. If FreeGLUT is in the APK, would that count as dynamic linking?

Galleon

  • Administrator
  • Hero Member
  • *****
  • Posts: 4620
  • QB Forever
    • Email
Re: Android Developement Log
« Reply #20 on: April 19, 2013, 05:15:57 AM »
Quote
If FreeGLUT is in the APK, would that count as dynamic linking?
An APK is an special archive format, therefore FreeGLUT could still be distributed as a shared library "file" within the APK.

Galleon

  • Administrator
  • Hero Member
  • *****
  • Posts: 4620
  • QB Forever
    • Email
Re: Android Developement Log
« Reply #21 on: April 19, 2013, 05:31:37 AM »
It's my extreme pleasure to announce that Android now runs something old, something new, something borrowed and something blue....
http://www.qb64.net/AndroidsAreGo.png

JustinRichardsMusic

  • Sr. Member
  • ****
  • Posts: 282
  • Character names can be found in metal from the 90s
    • Email
Re: Android Developement Log
« Reply #22 on: April 19, 2013, 05:37:13 AM »
Woah, nice!

So does this mean you are able to get QB64 to spit out Android compatible code? (Javascript is it?)...
James Hetter's Revenge has been unleashed! Follow the games progress here:
http://www.qb64.net/forum/index.php?topic=6762.0

Download the latest version here:
https://www.dropbox.com/s/8p8gguliw1y6ink/Hetters%20Revenge.zip?m

Galleon

  • Administrator
  • Hero Member
  • *****
  • Posts: 4620
  • QB Forever
    • Email
Re: Android Developement Log
« Reply #23 on: April 19, 2013, 05:41:46 AM »
Quote
So does this mean you are able to get QB64 to spit out Android compatible code? (Javascript is it?)...
I'm using the Android NDK with a NATIVE ACTIVITY setup which means I can use C/C++ code and I'm given function hooks to Android commands so I've managed to avoid the emitting to Java issue entirely.

JustinRichardsMusic

  • Sr. Member
  • ****
  • Posts: 282
  • Character names can be found in metal from the 90s
    • Email
Re: Android Developement Log
« Reply #24 on: April 19, 2013, 05:48:36 AM »
Clever... 8)

It's weird how the screen displays to the bottom left of the window, rather than the top left...
James Hetter's Revenge has been unleashed! Follow the games progress here:
http://www.qb64.net/forum/index.php?topic=6762.0

Download the latest version here:
https://www.dropbox.com/s/8p8gguliw1y6ink/Hetters%20Revenge.zip?m

OlDosLover

  • Hero Member
  • *****
  • Posts: 3845
  • OlDosLover
    • Email
Re: Android Developement Log
« Reply #25 on: April 19, 2013, 06:59:38 AM »
Hi all,
    Very nice Galleon!
Quote
I'm using the Android NDK with a NATIVE ACTIVITY setup which means I can use C/C++ code and I'm given function hooks to Android commands so I've managed to avoid the emitting to Java issue entirely.
    What a shame for Java!
OlDosLover.

Coolman

  • Jr. Member
  • **
  • Posts: 76
Re: Android Developement Log
« Reply #26 on: April 19, 2013, 07:10:21 AM »
Using C++ is a very good idea, java is not really trusted name for its speed ...
ndk android allows you to program in C++ ...

Here is an interesting link:
http://www.codeproject.com/Articles/396538/Writing-an-Android-GUI-using-Cplusplus-Introductio
*** Excuse my English, I use google translate ***

Galleon

  • Administrator
  • Hero Member
  • *****
  • Posts: 4620
  • QB Forever
    • Email
Re: Android Developement Log
« Reply #27 on: April 19, 2013, 08:54:55 AM »
I tested this on a real Android tablet (as appose to the emulator) and it ran fine.

There's little issues like no software keyboard by default, the enter key not working (of all keys...), the displaying in the bottom left, no sound, etc etc, but the important thing is the program itself is working, everything else is 'window dressing' which can be implemented later.

Oh, and on the real tablet the frame-rate was super-smooth. The ARM emulator on a x86 host was quite sluggish for obvious reasons (including the OS UI).

I'm already adding an 'Android...' section to the IDE options menu where I (and you) can setup where it builds the project and what commands it should execute after building it (such as in my case building it and running it in Eclipse).

For the record OpenGL ES 1.x is being used in the screenshot I provided above. ES doesn't support BGRA, only RGBA, so I had some fun (ie. 5 hour wasted staring at a white rectangle which should have been a texture) there too!

It's an amazing feeling, seeing QB64 embracing the latest OS trends. And to think it only took a few days to port!
« Last Edit: April 19, 2013, 09:04:31 AM by Galleon »

fluffrabbit

  • Sr. Member
  • ****
  • Posts: 332
Re: Android Developement Log
« Reply #28 on: April 19, 2013, 10:37:07 AM »
Wow, that's awesome! I can't believe we're so close to this. Do programs accept touch input? Does it work like the mouse? Can one call the OpenGL commands?

Galleon

  • Administrator
  • Hero Member
  • *****
  • Posts: 4620
  • QB Forever
    • Email
Re: Android Developement Log
« Reply #29 on: April 19, 2013, 05:26:05 PM »
Quote
Do programs accept touch input? Does it work like the mouse?
The default behaviour for compatibility will be that touch input is treated as mouse input, but there will be new multi-touch commands to get detailed touch input info as well as commands to treat touch input and mouse input as totally separate events.

Quote
Can one call the OpenGL commands?
Here's where it gets a little tricky, you'll be able to call OPEN GL ES 1.x commands in SUB _GL. I've deliberately gone for EX 1.x over ES 2.x because the command set is very similar (a few things added, a few things deprecated). ES 2.x is like a completely different language.