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 - spacefractal

GLBasic - en / Dropbox links
Many of the dropbox links, mostly by me has beem removed. That is include the newer html 5 project. Most important files can been found here:!An17V5n5xcPmlkdpjiZiVMDR1CXD?e=vVc9ua

One Drive Link

They will all been dead as im currectly moving. Sorry about it. Im havent checked all links im have done on this page. But the html5 tool link is of course changed to the new on that page.

Since not all might seen the bonus section, im have finally started a game of my own. actuelly a game im allready have done in blitzmax, but want to done it again in glbasic, but this time its not a strictly remake of the original game, but screens has been extended here and there, mostly to find the new item: Diamonds (seen in level 2 im diddent took in the video).

Its a game based on H.E.R.O. and im might want to get some graphics on this game, mostly on the polish side throught, etc backgrounds (this version has seperate layers on background and foreground, unlike the blitzmax version.

The game is now fully playable. Still missing various things throught (you dont get bonus with remaining bombs example).
After im gav up Android Studio with the cat after mouse game, html5/Java have prove to been so much fun with work with.

Im got all 6 games ported and run in a browser. Not all games might works in all browsers. But here these:

The saving (due a async mount issue) and freeze on launch (when assert() failed) should all been fixed on all games that uses them.

any changes and fixes is in this post (im will edit that post by now): - All ported games.


Actuelly PowerUp Elevation works fine, but has some issues.

Etc for start, why that tiny window? We need to change the html file to get it looks much nicer.

Also arrows keys seens not work? but in this case, can been a bug in code of course (which im thinks its is), same with sound fx ingame as sound in meny works as intended.
based from this thread:

Im have choosen to update and reimplement GameInput to v2.0 beta. In this version the remapping has been totally rewrote and is now supporting gamepads as well keyboards. The formatting of codes is now based on a sdl database, but also added to possible to remap keyboard as well.

to implement to your game, you can do something like this:

Code (glbasic) Select

// top of the code should have those defines:


// start of the code somewhere under loading.
LOCAL SaveFile$=PLATFORMINFO$("DOCUMENTS")+"/Yourgame/Yourgame_AutoSave.ini" // should been APPDATA on other platforms.
IF STEAMDECK=1 // if you want to do that, howover users can quit remapping by mouse button now (you could get stuck).
GameInput.init(SaveController$, 1) // the first two devices should not been possible to been remapped on steamdeck.
GameInput.init(SaveController$, -1) // if you dont want possible to remap keyboard, set it to 0.

// Somewhere in the game input code.
// actuelley does nothing now on Windows, but only on Android.
LOCAL profilechanged=GameInput.update()

IF GameInput.Remap_IsRemapping()=1 // the function is doing remapping, dont do any game code
LOCAL result=GameInput.Remap_ScanCode() // return a sound/visual effect.
IF result=1 THEN SoundPlay("selectlevel")
IF result=2 THEN SoundPlay("confirmlevel")

// polling input from the api (incude keyboard) example. far from all games should do this.
IF ISPAUSE OR S_Status$<>"play"
GameInput.EnableKeyboard(FALSE) // in some cases, you dont want keyboard remapped ingame.

// This is something like that when you want to poll a joystick. In PowerUp Elevation, wbich
// im toke this snippet from, here all sticks controls the bird (include the right one).
LOCAL K1, K2, K3, K4, KJ
LOCAL Players=GameInput.GetNumberOfPlayers()

GameInput.SetDeadZone(0, 0.6) // analoge as digital with 0.6 as deadzone.
FOR i=0 TO Players-1
//IF GameInput.GetControllerName$(i)<>""
IF Players>0 // could been 0 on Android, but allways a least 1 on Windows throught as first player is on keyboard.

KL=KL+GameInput.Left(i)+GameInput.LeftStick_Left(i)+GameInput.RightStick_Left(i); IF KL>1 THEN KL=1
KR=KR+GameInput.Right(i)+GameInput.LeftStick_Right(i)+GameInput.RightStick_Right(i); IF KR>1 THEN KR=1
KU=KU+GameInput.Up(i)+GameInput.LeftStick_Up(i)+GameInput.RightStick_Up(i); IF KU>1 THEN KU=1
KD=KD+GameInput.Down(i)+GameInput.LeftStick_Down(i)+GameInput.RightStick_Down(i); IF KD=1 THEN KD=1

IF GameInput.ActionButton("A", i) OR GameInput.ActionButton("B", i) THEN KJ=1
IF GameInput.ActionButton("X", i) OR GameInput.ActionButton("Y", i) THEN KJ=1
IF GameInput.LeftTrigger(i) OR GameInput.ActionButton("RB", i) THEN KJ=1
IF GameInput.RightTrigger(i)=1 OR GameInput.ActionButton("LB", i) THEN TURNED=1

LOCAL SE=GameInput.ActionButton("select", i); // AB cab been swapped on some controllers
LOCAL PA=GameInput.ActionButton("parent", i); // AB cab been swapped on some controllers

// somewhere in the menu to start the remap
// First argument, is if you want keyboard remapped or not.
// this is a full remap for a game controller, but only required buttons for keyboard.
// if a game controller dont have all buttons, the user will escape.
// if you dont want a full remap for a controller, you can remove those you dont uses.
GameInput.Remap_Start(0,"back:back/pause|*,start:start|*,leftx:Left Stick|Movement,a:Face Bottom|Jump,b:Face Right|Turn,x:Face Left|*,y:Face Up|*,leftshoulder:Back Left Top|*,rightshoulder:Back Right Top|*,LeftTrigger:Back Left Bottom|*,RightTrigger:Back Right Bottom|*,dpdown:Dpad Down|*,dpright:Dpad Right|*,dpup:DPad Up|*,dpleft:DPad Left|*,rightx:Right Stick|*,leftstick:Left Stick|*,rightstick:Right Stick|*")

// somewhere to print, when under remapping (allways max 3 lines)
// also escape or back button will allways quit remapping with no save.
IF GameInput.Remap_IsRemapping()=1
LOCAL line$=GameInput.Remap_GetText$(1)
BMFont.DrawText(line$, 0, PY+PH+SCALING*70, SIN(FADING*90)*1, SIN(FADING*90)*0.5*2, 0, -1, -2)

IF line$<>"" THEN BMFont.DrawText(line$, 0, PY+PH+SCALING*75, SIN(FADING*90)*1, SIN(FADING*90)*0.5*2, 0, -1, -2)

IF line$<>"" THEN BMFont.DrawText(line$, 0, PY+PH+SCALING*80, SIN(FADING*90)*1, SIN(FADING*90)*0.5*2, 0, -1, -2)


this code is only tested on Windows, while the code for Android is there, im have nowhere tested it at all. Its might or might not work, or not compile at all. No idea. Im have still yet to update Android Studio, if im want to do that.

PS. PowerUp Elevation has been updated on steam, which uses this api (that game became test game).
Those who have Swicth Pro controller. Can you checking which buttons that does that.

Etc im need the name of it, and how and which axis the right controller and the both analoge triggers does.

Im purchased such of one you can see, but that controller did not have the analoge trigger, but a digital trigger instead (not a issue in such a game that is not racing really). Im wasent aware of that of course, but im implementated this feature of course.

Im do believe they follow the ps layout button wise, not xbox. Then im will update my GameInput thing for Windows.
Im just got my Steam Deck recently. There is a issue with the MUSIC commands as this start a fullscreen window, that cover up the gameplay window, cause the games unplayable. So im have in this case choosen to uses samples as music and forgoe saving disk space for tunes.

This can seen on all my games, but im did do managed to fix Greedy Mouse and Spot Race. Both games run nicely on the Steam Deck and both updated to the official version.

Now im need to fix the rest, so they dont uses any MUSIC commands. But we might need to implement either bass or fmod, so they can been used when found? here im dont care about older versions really.

A Direct linux build is NOT required for this device. Only PLAYMUSIC and such commands failed.
Micheal Ware has just got approvede Nintendo Switch devkit portal access and im also getting a DevKit as well.

Im wonder if im can get Glbasic run on a Nintendo Switch? Could been cool. Long time im used glbasic (as my focus has and is still with Spectrum Next and other none computer stuff).
Hi im is back again and we have a strange issue we needs too at as im not sure what happens?

Currectly glbasic compiles, run, compile, run twice (and closing the previous app). Im have newer seen this bug before.
as some of you might notice as im have not been on the forum in a while (dispite im did do checks here and there).

The reasons is im currectly have various Spectrum Next projects with Rusty Pixels those time, so im have not code that much or could help. Currectly we trying to do Baggers in Space - Detour finished in time (most is done) and a Tyvarian 2 game, named "Tyvarian - To the Victor the Spoils".

For more info about those two projects is on the Kickstart update here:

When im building windows 32 binary files from _build.bat. The _build.bat compiles its self fine, but im got a wast of about 50 errors when trying to compile from IDE.

Its look like you somehow have mixed 64 and 32 bit code?

Gernot, im have uploaded the source code to steam again, but im do have password protected that branch, this is due this issue and would make sure we both has been sync correctly. You can get the password from the SteamWorks as this is not hidden there, but for users.

Of course im wont share the password here and you are fell free to change it eventuelly.
Currectly im have no idea why this happens, but a app can crash out on a backbuffer flip after you have minimized the app.

Etc im tried do this:

Code (glbasic) Select

void OpenGLRainbows::PrepareBackbuffer() {
#if defined(TINYGL) || defined(TRENKI3D)
                                                                                                                            if (m_Surface[0].m_Height) {
} else {
if (m_bHasClearColor) {
#ifdef TRENKI3D
if (m_bDirtyZBuffer) {
                                                                                                                            if (m_Surface[0].usex>0) {
if (m_bDirtyZBuffer) {
m_bDirtyZBuffer=false; glClear(GL_DEPTH_BUFFER_BIT);
} else if (m_bHasClearColor || m_bDirtyZBuffer) {
GLbitfield bits=0;
if (m_bHasClearColor)  { bits |= GL_COLOR_BUFFER_BIT; }
if (m_bDirtyZBuffer) { bits |= GL_DEPTH_BUFFER_BIT;  m_bDirtyZBuffer=false; }
    g_debug("PrepareBackbuffer start");
    if (m_BackSurfaceSpriteID[0] != -1) {
    } else if (m_bHasClearColor || m_bDirtyZBuffer) {
        GLbitfield bits = 0;
        if (m_bHasClearColor) { bits |= GL_COLOR_BUFFER_BIT; }
        if (m_bDirtyZBuffer) {
            bits |= GL_DEPTH_BUFFER_BIT;
            m_bDirtyZBuffer = false;

    g_debug("PrepareBackbuffer end");

but got a logcat like this:
Code (glbasic) Select

I/glbasic: [GLB]->loop start() after SHOWSCREEN
    [GLB]->loop start()
I/glbasic: [GLB]->loop start() before SHOWSCREEN
    __g_paused: 0 0
    FlipScreens before
    PrepareBackbuffer start
I/glbasic: OnPause()
V/SDL: onPause()
V/SDL: nativePause()
V/SDL: surfaceDestroyed() start
I/SDL: surfaceDestroyed() end
A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4 in tid 21728 (SDLThread), pid 21683 (ractal.spotrace)
V/SDL: onWindowFocusChanged(): false

And now, removeing glClear(bits) diddent help a test, then its just crashout in a another place in the function.
Glbasic coming soon to Chromebook,

Even i is inquired after a crash, im did do work slowly today.

- Im just got keybaord with most keys remapped to pc scancodes (not all was possible, most of them)
- mouse and primary touchpad (one finger by now) include hover. Pointer is still there thought.
- You can even detect a chromebook from PLATFORMINFO$()
- Android Studio is of course required and is enabled by adding this to manifest.xml:
Code (glbasic) Select

    <uses-feature android:name="android.hardware.type.pc" android:required="false" />

- howover resize window wont been supported and is chrashing out, but app just works fine in fullscreen.
- some keys is remapped to different pc style on a chromeos keybaord:
ESCAPE is F1 and Forward is F2 and Refresh is F3.
- Landscape is required as minimum supports! That one im have is required!
The reason is im did not want to conflict escape button to the back button.

No idea about release date, but im slow in the moment.


Enable Beta in the steam:
- Right Click on Glbasic in library.
- Click on Properties.
- Click on betas.
- Select "beta - beta builds".

Im still use beta for the version im do, even after a official release when Gernot release that as official (im only release beta versions). This so its possibe to eventuelly do a roolback when testing is required before a release.

First a bit of warning:
This is for the steam version of glbasic. Im cannot garentee its works on Glbasic 15 or below, so im only checked with code from Glbasic 16. Im do no longer uses external downloads.

Here is what that is fixed (listed here as official 16.507 release):
- The theme has been changed a bit, so its now launch in a pure black screen.
- Various new arguments added to androidmanifest.xml, strings.xml and some changes to other xml files (themes).
- Surface might not allways have whole screen! That could causes game not been placed in center correctly. This is fixed.
- navigationbar enabled by default! See next post about it.
- Admob has been more integrated! Admob is optional, not required!
- JOY() commands works much better in this version! Multiply gamepads is even supported!
- You can now use Tilt and Orientation using JOY() commands as well a Android TV remote.
- Assest loading should works much better since SETCURRENTDIR() now finally works correctly between c++ and java. That means c++ does no longer needs to try to guess the path anymore. This is include both relative as well full path using GETCURRENTDIR$()
- Keyboard, Touchpad (one finger) and Mouse (include right button) is now supported for ChromeBook!
- Keyboard can been mapped for pc style scankey layout for most keys. disabled by default. Set it in Strings.xml
- ChromeBook can been detected by PLATFORMINFO$("DEVICE") as well AndroidTV. "Keyboard" tag here is depreacted as im allways hated it and diddent make sense at all!
- Fullscreen is required on ChromeBook! So keep android:resizeableActivity="false" in manifest!

Property other small fixes as well!

Android 6 required!
Android 6 and better is required. Its look like its a grandle issue that cause its dont support png and jpg files in Android 5. Im cant do anything with it at all. So Dont ask me about it. But if you do NOT use png and jpg files at all, then you should been possible to support Android 5. Its depend of game of course.

Can im update Android Studio
Also you can SAFELY update your Android Studio, that include buildtools. But you should stays on the Grandle version we using, currectly version 3.4.1. So dont update the project its self when Android Studio is asking about it to your glbasic project!
Now im is fully back to get my stuff working again with Android Studio. Genius Greedy Mouse is all running again (but still yet to been submitted). Now im missing to do rest of the games im have did past on the day.

The games im have done in glbasic is those:

Genius Greedy Mouse
Karma Miwa
Spot Race
PowerUp Elevation
The Beagle Jam

Im plans to do all 6 games back to Google Play, all free and some games with ads (not all).
Im have choosen to unsticky 4 old unrelevant Android threads, but added a new one that is for the v16.

Im wiill not touch the stores sticky theads, even some of them cant been supported anymore. The reason: Its fun to see what people have done back in time, so im see no reason to do it.

If im do, im would make sure to do similar with the old android stuff sticky thread, so they can easy to been found.
Im will unsticky various Android Stuff as they are very old or not required anymore after move to Android Studio. Im sticky this soon that collect those old threads and locking it:

AndroidExtras and iOS/tvOS updates + Download Links:

This is for glbasic 15 and below only and im will no longer support it at all.

LibPng security Fix - If Google Reject it:

This wont been happens in Android Studio of course. This was fixed long time ago.

How to use ADB:

This is not relevant anymore when using Android Studio. Its much easier here.

Android debug certificate has expired:

This is very old issue that should long time to fixed and is not relevant with Android Studio at all

the newest Android Studio 3.5.1 works very fine (but you might let it need to update the grandle, but should do it fine)! There is some more bugs with Android 5.0 throught (SDL Audio also might not work anymore, which can been disabled), but has not seen issues from Android 6. This can also just been a emulation issue. Not checked on a device.

Im have not Not heard any trouble with Android 6.0, but if its does, let me know of course.

To been clear:
Android 5 is very hard to get working in Android Studio and will currectly not to to get it working again as threre too many issues. So please do NOT ask me about Android 5.0 issues as im will skip it. If its should fixed, im/Gernot will let you know!

So API23 is required as minimum with Glbasic and Android Studio!


First at all: Sorry to all (include Gernot), if im have been aggreisve or frustated!

Even im finally uninstalled AS under by rage and frustation, im will try again after some days with a very fresh install. So dont worry.

But first at all im wlll NOT recommened to use Android Studio 3.5 as Google have choosen not to write how to update the grandle files as they would been totally broken and no longer work (why those hard coded version numbers, diddent make sense if they can breaks). But im do seen AS 3.4 does works nicely with the newest SDK, so you would still could release on Google Play at least. This is the  matter anyway.

Here is the place you can manually download Android Studio Version 3.4 (or version 3.4.1):

IM will NO LONGER support Android Version 5 and down:
Android Studio have broken it, that it and im fighted too long time on it, and Android 5 is now really old now. So im will no longer support it (only if Gernot can fix the file access issues). Im will require API 23 or higher (as im did do seen that version worked fine).

What about API 22 and down?
We could actuelly just include the current version we did for Android SDK really. Im do not sure its still allowered and how multiple apks works. No idea actuelly.

Why did im delete threads?
im should not do that, so sorry, was just by frustation (was my own throught). Im do have those issues in mind and will update in the weeked or next week. Dont worry. its was nowhere the jpg issue, which is not present on Android 6+ anyway as well the other issue was also not present too. Im do thinks im did send those to Gernot, so he might have implmeented and updated it. so im have still have the files.