Menu

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

Messages - Paul Smith

#1
Thanks dreamerman, I did search the forum and only found info from the 3rd part topic. I'm sure this forum plays tricks on me. :D  I'll read the treads and hopefully come up with a solution.
#2
I assume GLBASIC uses the SDL2 library when compiling to HTML5.

I've been messing with music formats in browsers and it looks like firefox is the least compatible, anyways I was trying to understand if using the SDL2 mixer to play MOD/S3m would work better.

As I know very little about C/C++ importing into GLBasic, I was hoping someone could give me any pointers.

I can see GLBasic adds the path to the .h files location for HTML.
would it be used like
INLINE
#include "SDL.h"
#include "SDL_mixer.h"
ENDINLINE

or would it be import / require.

#require "SDL.h"
#require "SDL_mixer.h"

IMPORT "C" int SDL_Init(int flags)
IMPORT "C" void SDL_Quit()
IMPORT "C" int Mix_OpenAudio(int frequency, unsigned short format, int channels, int chunksize)
IMPORT "C" void Mix_CloseAudio()
IMPORT "C" void Mix_FreeMusic(void* music)
IMPORT "C" void* Mix_LoadMUS(const char* file)
IMPORT "C" int Mix_PlayMusic(void* music, int loops)

If anyone can help, I would be grateful.

 



 
#3
I can't seem to use strings. This won't compile 
}, url$);  or {, url_Str);
The version I was supposed to show was  }); that just opens a new tab. It does compile but just a blank page.

This code does work and will open the correct page, strange thing is the // shows as comments after the https: but compiles fine.

INLINE
        EM_ASM({
       window.open('https://www.glbasic.com', '_blank');
    });
   ENDINLINE

Hope this helps
#4
Not used that command, but others like NETWEBEND dont work.

I've been short on time this month and was looking into using alternative inline for NETWEBEND. I have two methods that need Ironing out. This code is from a google search. And needs formatting correctly.

    INLINE
    #include <emscripten.h>
    emscripten_run_script("window.open(\"" + url$ + "\", \"_blank\");");
    ENDINLINE

the other is

INLINE
    #include <emscripten.h>

    EM_ASM_({
        window.open(url, '_blank');  // Open the URL in a new tab
    }, url$);
   
    ENDINLINE

Not tried the first one but the second one opens a page, just not the right link.  :D
Hopefully someone smarter than me will fix this is seconds.


#5
I think Wiki needs an update to keep it current.
#6
Confirmed your Bleep does not work on Android Firefox.

I noticed firefox can be a little particular with sound as can Chrome, I tried a few settings for a bleep and in the end I used WAV 8/16bit 16/22/41 khz stereo(Mono didn't work) and these works on all platforms so far.

My Key click sound works on Firefox on my android.

https://paulsmith6175gmailcom.itch.io/bc

This is a work in progress and once its sorted I will create a thread with all the little things I discovered on my journey like how to get the full phone resolution not the 360x760ish, Audio formats, reading the screen width and height
#7
I love it when updates and fixes are being worked on, But I have the same question as Qedo. Does a push to GIT mean it will start to roll out on a STEAM update or do we have to do something manually?
#8
Thanks Qedo. I think now it maybe because I have stuff open its trying to alter when compiling.
#9
Just reinstalled all my Steam stuff from Drive C to Drive D (free up my small 240g NVMe), I've installed HTML5Extras and know the HtmlPost script works as it shows in the console.
The problem I think I have is with HTML5Extra. If I use CheckCanvasSize() it returns with call to undefined function.

I know I could add it to my code and remove the DPRINT commands etc. But would love to know where i've gone wrong.
I dont think I got it working when it was on drive C and one of the reasons I reinstalled incase I corrupted something.

slightly off topic sometimes when I compile for Windows, the console shows LEAF duplicated ( or something similar ) but works. Any Ideas what this is?
#10
https://paulsmith6175gmailcom.itch.io/bc

If anyone want to report what their touchscreen stops at on a mobile
#11
Hi Spacefractal, been reading this thread again and you mentioned you solved the canvas size checking and resizing. I've installed your tool.zip again as some how it reverted back. I'm still getting 0,0 from GETSCREENSIZE and 300,150 from GETDESKTOPSIZE.

@gernot did you have time implement the HTML5 changes in an update? or is it on your todo list.

*UPDATE* In project options you can manually change the resolution to what you want rather than the listed ones in the dropdown.
Something I never knew. ( I bet everyone else did :). This now shows in GETSCREENSIZE in HTML.
300,150 still in GETDESKTOPSIZE.

The problem is Android has scaling like windows, so a canvas as 480x900 shows as 360,790 unless you go into the android display and change it to small.

#12
Off Topic / Re: how well :-D
2024-Jul-29
For me its 2 projects
This one is an educational tool, its an European intruder alarm keypad so learner can practice in preparation for there final exam. it 90% complete and the version linked below is not the latest and is full of bugs.
https://paulsmith6175gmailcom.itch.io/epa-pyronix-prep

engineer code is 1111 if you want to play.

The other I've just started is to work out the battery capacity requirements of Fire / Security systems.
All my student have Iphones so its all targeted for HTML5.
just working on the screen rescale but GLBasic respondes with 0s or 300,150 using GETSCREENSIZE or GETDESKTOPSIZE when compiled for HTML. Anyone knows a better way let me know.
#13
I use a 4K screen and I can adjust the font size to suit but the Icons toolbar is unreadable. I think it needs updating as the windows scaler also causes it problems.
#14
Thanks guys, I selected 800x480 in the project options. used Itch.io to force landscape mode and fullscreen.
Android rotates the screen and goes into fullscreen, Ios just rotates the screen. Browsers show the 800x480, android and Ios show 800x360.
I just rewrote the bit of code and made sure is all fits 800x360.

Just struggling re-writings the same code multiple ways. Its the same buffer problem I had that spacefractal solved for me last time to stop multiple clicks. However its not working for this.
Im making a menu with numbers you click, it require 4 numbers to be entered, but if I press 7 i get four 7s.

I miss my while/wend loops.

#15
Thanks Spacefractal. 

I spent 15min messing with the Itch.io settings and it allows apps other then games to be hosted which is what I need.. I am going to have to re-write most of my program due to using a fixed resolution and general poor programming. I find writing for HTML5 far more difficult, having no examples to learn from doesn't help. I even don't understand the code I wrote years ago :o