sdl.mod

BlitzMax Forums/Brucey's Modules/sdl.mod

markcw(Posted 2015) [#1]
Trying to compile it with Bmx 1.50 which is probably the problem. What should I do?

In file included from /home/~/BlitzMax/mod/brl.mod/blitz.mod/blitz.h:21:0,
                 from /home/~/BlitzMax/mod/sdl.mod/sdl.mod/glue.c:26:
/home/~/BlitzMax/mod/sdl.mod/sdl.mod/glue.c: In function ‘bmx_SDL_FreeRW_stream’:
/home/~/BlitzMax/mod/brl.mod/blitz.mod/blitz_gc.h:57:33: error: request for member ‘refs’ in something not a structure or union
 #define BBRELEASE(X) {if( !--(X)->refs ) bbGCFree(X);}
                                 ^
/home/~/BlitzMax/mod/sdl.mod/sdl.mod/glue.c:85:3: note: in expansion of macro ‘BBRELEASE’
   BBRELEASE(ops->hidden.unknown.data1);
   ^



xlsior(Posted 2015) [#2]
You probably need to use Brucey's modified pub.mod and brl.mod as well?


Brucey(Posted 2015) [#3]
You could try changing
BBRELEASE(ops->hidden.unknown.data1);

to
BBRELEASE((BBObject*)ops->hidden.unknown.data1);

(which I'll fix later)

However... :-)

... the SDL modules have *not* been tested with legacy BlitzMax as it was introduced primarily to get BlitzMax onto other platforms (Pi, iOS, Android, etc).

So YMMV...


markcw(Posted 2015) [#4]
Oh, ok.

Well I tested your fix anyway and that removed the error but now it says:
Compile Error: Overriding method differs by type
[/home/~/BlitzMax/mod/sdl.mod/sdl.mod/sdl.bmx;107;2]
Build Error: failed to compile /home/~/BlitzMax/mod/sdl.mod/sdl.mod/sdl.bmx

I have 32bit ubuntu. These are longs and filePtr should be Int, so I guess I would have to cast/convert all to Int?

I'll just leave it until I get a 64bit ubuntu.


Brucey(Posted 2015) [#5]
In bmx_ng, all Stream functionality has been updated to work with 64-bit (Long), rather than 32-bit (Int) offsets/files.

This gives us access to large files via TStream, and also make interfacing with "real" APIs easier, as they generally support 64-bit files already.


So in SDL, the stream stuff would need to be wrapped in ?bmxng directives...

I'm sure there may be other things too ;-)


markcw(Posted 2015) [#6]
No that's ok. I'm done here. I was just curious.

Thanks.


Brucey(Posted 2015) [#7]
On Linux, SDL handles multiple screens really well, unlike BRL.GLGraphics. In fact the SDL-Linux experience is very pleasant compared to what one is used to in BlitzMax...

:-)


markcw(Posted 2015) [#8]
Stupid question time. Sorry but I am a bit confused.

So what is the difference between git repos bmx-ng/brl.mod and maxmods/brl.mod (and the same question for pub.mod)?

My guess is that Bmx-ng is for 64bit/ARM platforms and maxmods is an update for Bmx 1.50/legacy?


Brucey(Posted 2015) [#9]
Yes, maxmods/brl.mod and pub.mod are updates for the official modules that you can drop in place of the originals.

bmx_ng/brl.mod and pub.mod have been modified to support the new bcc compiler - This includes changes to internal structures, a new GC, and other things such as 64-bit file support, Reflection enhancements, and an Interfaces implementation. It works for 32-bit, 64-bit and ARM across multiple platforms.
The SDL modules can be used as a complete replacement for GLMax2D and BRL.System(default) - as it handles both graphics and event handling. SDL is required for ARM and mobile targets.


LT(Posted 2016) [#10]
Bumping this because I'm now looking into using SDL. I was hoping this would be an easy drop in replacement, but I'm still interested in keeping things working in vanilla BlitzMax.

Looks like resolving the issues could take some time. My first question is, will this SDL module enable use of later versions of OpenGL (3 or 4) in addition to 2 ES?


MrPhil(Posted 2016) [#11]
I'm also researching if using SDL2 is possible. I have an old BlitzPlus program I'm trying to keep alive, but some people are reporting problems with Windows 10.


RustyKristi(Posted 2016) [#12]
@MrPhil

SDL2 works with NG and Vanilla Blitzmax. I'm not sure why you need SDL2 specifically for Windows 10. What are those problems?

Maybe you could also try Dave's DirectX 11 drivers?

https://github.com/SRSSoftware/srs.mod

@LT

Brucey works on the sdl.mod so I guess you should probably ask him yourself if he would support GL 3 or 4 in the future.


LT(Posted 2016) [#13]
ask him yourself if he would support GL 3 or 4 in the future
Well, that's why I posed the question here. But I wonder if Brucey would have to do anything...thought perhaps SDL already covered those bases.


MrPhil(Posted 2016) [#14]
@RustyKristi
I haven't completely tracked it down, but I think it has something to do with permissions. The tool does a lot of data manipulation and stores some of the crunched data temporarily and I think this is the source of the problem, at least that's my current assumption.

So, I was looking at SDL2 as a way to both fix this sort of platform specific wonkiness but also makes a step towards potentially supporting Mac too. I'm getting the feeling it might be smart to portal the BlitzMax first.

It's worth noting that I didn't write this app originally. I purchased the IP, but it still sells and I'm slowly making improvements to it. It's not a big application but it is complicated, so I don't full understand how it all works. Otherwise I'd just port it C or C#. It's the Seamless Texture Generator link in my sig.