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.

Topics - Kitty Hello

Pages: [1] 2 3 ... 37
Inline / 3rd party / QR-Code library (QRcode)
« on: 2020-Jul-02 »
Attached, you'll find a wrapper for that creates a sprite with a QR code for a given UTF-8 text.
See also the UTF-8 library, if you really need utf-8 characters (not tested).

The new update 16.507 is available on STEAM now.
Among some bug fixes, this offers more possibilities on the Android platform. The mousewheel works better and DDgui got some bugfixes. (Yikes - I forgot to upload that - will soon do!)

You've seen the great efforts of spacefractal the last months. So, the Chomebook support is in and the game controlers are, too.
I fixed some bugs in the IDE and made strings even faster by implementing move semantics.
The bluetooth library is finally done and can be used for Windows and Android. Might also work on other platforms, but not tested.
For Android, I added a camera support and you can request permissions using the Android dialog popups.
Code: (glbasic) [Select]
IF "1" == android_JAVACALL("requestPermission:android.permission.CAMERA")

To see it all in action, here's a project that uses all of them.

Code Snippets / UTF-8 (UTF8) utilities
« on: 2019-Dec-10 »
Here's how to deal with UTF-8 strings in GLBasic. It can convert to and from ISO 8895-1 (Latin-1), so you can "PRINT" UTF-8 strings, and write UTF-8 file from latin encodings.
Code: (glbasic) [Select]
// --------------------------------- //
// Project: UTF8- Routines
// --------------------------------- //

//! Copyvert an ansi text with codepage latin-1 (ISO 8895-1) to a UTF-8 string.
//! Prefix the UTF8_BOM$() at the start of a file when you write it to disk.
FUNCTION UTF8_fromLatin1$: latin2$
LOCAL out$
FOR i% = 0 TO LEN(latin2$)-1
LOCAL cha = ASC(latin2$, i)
IF cha < 0x80
INC out$, CHR$(cha)
// all 11 bit codepoints (0x0 -- 0x7ff)
// fit within a 2byte utf8 char
// firstbyte = 110 +xxxxx := 0xc0 + (char>>6) MSB
// second    = 10 +xxxxxx := 0x80 + (char& 63) LSB
INC out$,  CHR$(bOR(0xc0, bAND(ASR(cha,6), 0x1f))) // 2+1+5 bits
INC out$,  CHR$(bOR(0x80, bAND(cha, 0x3f))) // 1+1+6 bits


void Latin8FromUtf8(char* str, int slen) {
    int i = 0;

    char* dest = str;

    const char* pStrC = str;
    const char* pEnd = str + slen;
    // *pStrC != '\0' &&
    while(pStrC < pEnd) {
        const wchar_t c = wchar_t(static_cast<unsigned char>(*pStrC++));

        // U-0 to U-7F
        if((c & 0x80) == 0x00) {
        // U-80 to U-7FF
        if((c & 0xE0) == 0xC0) {
            if(i<slen) {
                wchar_t d = static_cast<wchar_t>(*pStrC++);
                *dest++=(char((c&0x1f)<<6 | (d&0x3f)));

        // U-800 to U-FFFF
        if((c & 0xF0) == 0xE0) {
            if(i+1<slen) {
                const wchar_t d = static_cast<wchar_t>(*pStrC++);
                const wchar_t e = static_cast<wchar_t>(*pStrC++);
                *dest++=(char((c&0x0f)<<12 | (d&0x3f)<<6 | (e&0x3f)));
        // three continuation (U-10000 to U-10ffff)
        if((c & 0xF8) == 0xF0) {
            if(i+2<slen) {
                const wchar_t d = static_cast<wchar_t>(*pStrC++);
                const wchar_t e = static_cast<wchar_t>(*pStrC++);
                const wchar_t f = static_cast<wchar_t>(*pStrC++);
                *dest++=(char((((c&0x0f)<<18 | (d&0x3f)<<12 | (e&0x3f)<<6 | (f&0x3f)) + 655536)  & 0x000000ff));
    *dest = '\0';

//! Convert the utf8$ string to a Latin-1 (ISO 8895-1) string. Use this to 'PRINT' an UTF-8 string.
FUNCTION UTF8_toLatin1$: utf8$
LOCAL copy$ = utf8$
char* str = copy_Str.getbuffer(1);
Latin8FromUtf8(str, LEN(copy_Str));
RETURN copy$


//! Return the 3 byte UTF-8 BOM (byte order mask).
//! That is the first 3 bytes of an UTF-8 text file.
RETURN CHR$(0xef) + CHR$(0xbb) + CHR$(0xbf)

Announcements / Server change
« on: 2019-Sep-20 »
Our webhoster quits. I have time to the end of 2019 to move to another hoster.
I amy very anxious about the email/https certificate after the move.
On the other hand, I can move to a hoster that cares about the linux backbone, so I don't have to care about this anymore. It caused my so much headache, since I'm a total noob when it comes to this.

Just wanted to let you know.
If anyone if good at that stuff, please let me know.
I would have to:
-move the php sites (easy)
-backup all email (4 accounts. I use thunderbird. I plan to pull them all local and then copy back. Would that be OK?)
-move 3 data bases (yes, this forum too!). I have no idea, but I hope something like mysql-php offers that option...
-point the domains (3) to the new server (I hope that one is a quick one. My new hoster offers a GUI for that).
-What about the certificate for the https/email accounts?
-Anything I missed?

The version sounds like nothing special, but indeed, this update brings:
I took some time, yesterday and finally fixed what was due for years. I am so sorry for the delay. You will love it. It makes work so much easier, if you use TYPEs.

Also, DDgui was a bit polished and the new toast messages look quite good. (See my 2nd G.A.C.K. trailer on STEAM - sprite editor, where I copy/paste an image).


Wohoo! Finally made it to where it should go. I hope people will like it.
I added support for moving platforms. Did anyone program that before? Dude, that is really hard. I'm programming for about 0x20 years now, but that was a brain twister even for me. It's not 100.00% perfect after all...

I remember yeeeers ago, someone had a bit of code, that created a random city. Houses and stuff.
Can anyone remember this?
It would be cool to make a "deliver a pizza" game in 3D, with a city like: C64's Miami Vice, but in 3D:

The following is a C++ wrapper for a library, that does high-quality image scaling.
To use it, just add the gbas file to your project. The C++ lib is linked by REQUIRE.

Here's how to use it as a STRETCHSPRITE substitute:
Code: (glbasic) [Select]
FUNCTION HQStretchSprite: id%, x%, y%, w%, h%
ReSampler(id, s2, w,h)
GRABSPRITE s2, 0,0,0,0
Warning - the above does not work (yet), if you're currently on an offscreen (USESCREEN x).

Announcements / New Version - Android Support
« on: 2019-Jun-29 »
Live on Steam as an update now :)

Media Section / Android - new icon design
« on: 2019-May-31 »
In my store page I get the error:
The following localisations have not applied the new icon specification: English (United States).
Learn More

I can't change the text - what is wrong? Whatever I do with the icon - it won't let me pass.

Attached the icon I try to submit.

I've got good news and bad news. Good news first.

Compiling for Android no longer is a pain (for you). The kids got older and I start finding some more time for GLBasic, slowly. Spacefractal and me, we took the long route to recreate the Android build totally from scratch. Starting with a new template project based on SDL2, we adjusted and expanded this project to include all the GLBasic sources and thus compile all stuff only using Android Studio, now.
Then, we wrote a program in GLBasic, that prepares and updates this project in your project's distribute folder and starts Android Studio for you.
You just press "run" and really, you project runs on the emulator or your connected device.
You need help with some Android specific stuff? Google/Stack Overflow answers will perfectly work for your problem.
Joypads were always a pain on Android. Spacefractal remapped them for you. You can produce KEY() codes and/or GETJOY... codes.
The Android TV remote control? Works out of the box.
Google requires your native code (NDK) to be built for several platforms, now. (x86, ARM64, ...). It's all done for you. Even the SDL2 code gets compiled, so we can bring important updates just in time. Even YOU can do this - you are completely in control of your project. We're ready for any changes Google requires from us in the future.
The update will be on Steam, soon.

Which takes me to the bad news.
GLBasic V16 will from now on only be available on Steam. If you don't have a Steam version yet, please consider getting one. It's cheaper than the V1-V15 original versions, and honestly, you got free updates until now from day one. That is nineteen years! Do you know any other software, like that?
See, many game devs using GLBasic made more money with their games, than I did with GLBasic. I am happy about that. GLBasic gave me good money to always buy testing hardware and keep the servers running. It still is - don't worry. But it was always a hobby, never a commercial success. That might be, because I'm an engineer, not a business man. And that's often what makes a great product, isn't it.
So, if you want to support me further, get the Steam version. Otherwise be welcome to stay here with your V15 support.
Also, if you are on a social network, don't hessitate to post what you did with GLBasic or what you like about it. I, again, am not good at that kind of stuff.

Media Section / STEAM - Asset Creator
« on: 2019-Feb-01 »
The attached GLBasic project creates all assets required for your STEAM page.
You just replace the files "banner.png", "logo.png" and "font.png" with your stuff and in the source change the app$.
It will proportionally scale the banner background, add the logo at the left side and scale the app name to the right side for the capsule graphics.
That's handy, ain't it!?

Updated. Uses ReSampler lib for high quality images and a DDgui.

Announcements / Bluetooth / Serial RS232
« on: 2018-Dec-12 »
OK. after another sleepless night, I can print to the bluetooth printer on windows. (V16 will feature this).

I kept it quite abstract, so you can talk to any bluetooth device and it should be fully cross platform.
Also, you can use the COM interfaces to talk to RS232 devices with this library. I use parts of the LGPL library from

Folks, I'm so amazed about my new gadget. A thermal printer (see attached image).

I've got GLBasic code running, that can send a sprite image to that printer via bluetooth on your Android device. (You can use the BT library to talk to any bluetooth device, btw.)

For the competition you get a few functions in a library and this test project:
Code: (glbasic) [Select]
LOADSPRITE "Media/test.png", 101

LOCAL printer_pixels_width% = 384 // must be editable by user. Default = 384
DitherSprite(101, printer_pixels_width) // id%, cut_width%

// Show the dithered image - you can save or use that for debugging/preview

// List all paired BT devices - user must pick one from the list
LOCAL devs$[]

// connect to one of the string in devs$[]
BT_connect("BlueTooth Printer")

// do print the image pixels

// close connection

// some more paper and cut (if device lets you do this)


You will also get a function to pick a picture from camera or from the gallery.

The BlueTooth-Library attached is cross-platform and can talk to any BlueTooth device with raw data streams.

That's all you need. Now join the competition and write a software for that printer with the given functions. A demo project is attached. It might not compile for Android, but the function names wil stay as they are. I did tests and all is working great. Ready? Set? GO!

Do samething amazing. Something creative. Something funny. Something that makes one want to get such a printer.

The 1st prize is such a printer. Shiny new device, sparkling on your table, purring in your pocket.
2nd to 3rd price: Printer paper

Competition ends at March, 1st 2019.

PS.Spread the word - I'm not very connected in social media anymore  :good:

Edit - See my test project and the final libraries attached.

Announcements / Wumbo's Adventure for Android
« on: 2018-May-21 »

Should be free for a frew days. I'd welcome you to put a positive feedback on the play store :)

Pages: [1] 2 3 ... 37