Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - fivesprites

Sorry Ian, but I had to pinch your thread title somewhat ;)

Ok, anybody getting a Gamestick?  I'm hoping to add support to AndroidExtras for it as soon as I can find some spare time. 

Any more Android consoles?  NVidia Shield anybody? ;)

Off Topic / PixelProspector
Seems to me that GLBasic should be listed here too:
Hi All,

For those interested in GLBasic Android development, I've put a small compilation of extras into the Code Snippets section:

This allows you to use GPS, Virtual Keyboard and enhanced audio.

Enjoy :)

Hi All,

I've been working away on a few extra Android utilities and I ended up realising it was a bit dumb to have multiple forum posts - especially when it meant getting people to make the same changes every time.  Eww.

So, I've wrapped everything up into one and I've even written some instructions! (see the ReadMe file)

Download and updates here (its now version 3.0 using sdk 22, Android 5.1):

Questions in this thread please (or create your own).

Current Version: AndroidExtras_v1.1
This ONLY supports the new beta v11.414

Changes in v1.1:

- Added new commands to TMusic:
   - getDuration()  - returns the length of the music track currently playing (in milliseconds)
   - getCurrentPosition()  - returns the current position in the playing track (in milliseconds)

- Added support to reload textures on some devices when OpenGL context is lost (please see the sample application for details)

If you want to try out Game Controller support for OUYA/Android then SpaceFractal has implemented the code and integrated it into AndroidExtras.  A beta release is available here:

Current Beta Version: 1.4beta3


I've not had time to try this out, but if it can be confirmed as working then I'll update this post accordingly.  Thanks again SpaceFractal! :)

Please see the ReadMe.txt file inside the zip for installation instructions.

If you have any questions then fire away.

Hi All,

I've managed to get a dialog window to appear above GLBasic applications to allow text entry.  If you click on the text entry field then the Android Virtual Keyboard will appear :)

I'm currently cleaning up the code and trying to test on a variety of devices.  I'd be grateful if you guys could try out the attached APK and let me know what you think.   Just tap anywhere on screen to start text entry.

Note: The attached APK is also the demo app for the Android GPS stuff I put in the Code Snippets forum last night - so you'll be trying two things at once :)

Any suggestions for improvements, or if you have found a bug, then please let me know.   


//Andy    :bed:

For those that are interested, I've posted in the Code Snippets forum with details on how to get GPS locations using Android:

There's still lots that could be done with it, but I personally don't have much use for GPS at the moment - I wrote the above to help some people on the #glbasic IRC channel  :nana:

Have fun!

Hi Chaps,

By request of a few of the #glbasic IRC regulars, here's an example of how to obtain GPS information on an Android device.  The information below refers to the V11 beta.  It should be simple enough to copy/paste code into a V10 release of GLB, but if you're finding difficulty then let me know and I'll post up some V10 sources.

First up, if you are using the V11.322 beta and have NOT modified the following files:

Code (glbasic) Select


then you can use the files of the same name as attached and save them to:

Code (glbasic) Select

        C:\Program Files (x86)\GLBasic_v11\Compiler\platform\android\templateproj\AndroidManifest.xml
        C:\Program Files (x86)\GLBasic_v11\Compiler\platform\android\templateproj\src\com\glbasic\test\
        C:\Program Files (x86)\GLBasic_v11\Compiler\platform\android\bin\sdl_main.cpp

then, save the new file to:

Code (glbasic) Select

        C:\Program Files (x86)\GLBasic_v11\Compiler\platform\android\templateproj\src\com\glbasic\test

Extract the GLB test app that and try it out and see the notes below.

However, if you have modified the above files then please compare and adjust accordingly :)

If GPS is disabled on your device then a dialog box will appear asking if you wish to jump to settings to enable it.

Important Note: The output may show 0 or some bizarre location initially.  You must wait for your device to lock onto a satellite, so please be patient before saying this doesn't work :D

Also, this is only a GPS implementation - it does not fall back to a Network Provider if GPS is unavailable. I will add this when I get time.

Assuming all of the above worked, then implementing GPS in your own project is very simple:

- Include the AndroidGPS.gbas file in your project

Use the functions as shown in the test project.

- When you don't need GPS anymore, call: stopGPS()

Apologies if this sounds a little complicated - it's late and I need sleep :)  If you need help then feel free to ask.

One last note: Thanks must go to spacefractal for the initial idea with the GLB/Android JavaCall:

Math / Simplex Noise
GLBasic implementation of Simplex noise.  2D and 3D noise are supported.  I'll update with 4D when I get time.

Also provided is very basic demo to show how Simplex noise can be used to affect the velocities of particles.

Left mouse button to create particles, right to clear the screen.  Spacebar to toggle the screen hold effect on/off.

I'm sure you guys can put this to better use (generating funky heightmap data etc) and I can't wait to see the results :)


Hi All,

Does anybody know how to access OpenGL extensions such as glGenBuffersARB() ?

Specifically, I'm trying to make use of VBO's for which there's no direct access within GLBasic.  gl.gbas doesn't contain any inline code for glGenBuffers or glGenBuffersARB.  The ARB extension can be found in the headers (GLext.h) but I always get link failures if I try to inline:

} extern "C" { void __stdcall glGenBuffers( GLsizei n , GLuint *buffers );; }; namespace __GLBASIC__ {
FUNCTION glGenBuffers: n, buffers[]
      GLuint* pf=new GLuint[(int)n];
      for(int i=0; i<(int)n; ++i) pf=buffers(i);
      OGL glGenBuffers(n, pf);
      delete[] pf;

gpc_temp3.o:gpc_temp3.cpp:(.text+0x3833b): undefined reference to `_glGenBuffers@8'

The same applies for glGenBuffersARB


Has anybody managed to get shaders working on the Android platform? 
No matter what I try, I can't seem to get even the most basic to work - even though they work without fault on PC.

Simple Fragment Shader (test.frag)

Code (glbasic) Select

void main(void)
  gl_FragColor = vec4( 1, 1, 0, 1);

Any request to load that shader using:

Code (glbasic) Select

IF (X_LOADSHADER(1, "", "test.frg"))
STDOUT "Shader loaded ok\n"

results in "FAILED TO LOAD SHADER" being lobbed out in the Android logs.  No other clues given :(

Any help would be greatly appreciated.