BRL.Retro and SDL Conflict

BlitzMax Forums/Brucey's Modules/BRL.Retro and SDL Conflict

RustyKristi(Posted 2016) [#1]
I was wondering what is the best way to use Retro and SDL (GL2) together. It has been discussed previously with this in conflict and with brl timer vs sdl own timer function (afaik). It is not an issue on desktops but there other platforms like android and it seems to be the case.

I have some code samples that are a bit complicated/long and using BRL.Retro. It would be easy for a change to get those working without modifying BRL modules or picking them apart.

The last code I tried did work but I have to copy string functions from BRL.Retro to my main bmx just to get it to work. It's kind of awkward and tedious having to do that all the time.

What is the best way to resolve this issue?

Something like changing drivers like before..

BRL.GLMax2D
BRL.Retro

to

SDL.GL2SDLMax2D
BRL.Retro


Brucey(Posted 2016) [#2]
I was wondering what is the best way to use Retro and SDL together.

Don't :-)

Learn and adapt, and do things with strings directly - which is what those "retro" functions are doing anyway.

Retro pulls in all kinds of stuff that decreases modularity, as you've found. The whole point of having a modular system is that you use only the bits that you need. Retro imports half of all the modules, some of which prevent implementing things like custom timer modules.

You may have noticed that I split the brl.system module into two parts, because it made things more modular and allowed for the introduction of things like SDL.System - and easing the implementation of other potential "backends".


Derron(Posted 2016) [#3]
Brl.timer includes c-files which define functions - which are not available for android-targets.

As Brucey described, this sounds as if all modules which have equivalents in SDL would need a similar split like brl.system. Making them "replaceable" by their alternative equivalents.


bye
Ron


Brucey(Posted 2016) [#4]
Yes, I'm considering splitting timer too...


RustyKristi(Posted 2016) [#5]
Thanks! :D


Brucey(Posted 2016) [#6]
I've implemented a new factory-based timer. (updates to brl and sdl)

I split brl.timer into two parts, with the actual timer implementation moved to brl.timerdefault.

TTimer is now an abstract type.

You create timers as before with CreateTimer().

You can only load a single timer factory. You will get an error if you try to use more than one (say, for example, you have both brl.timerdefault and sdl.sdltimer loaded).


Derron(Posted 2016) [#7]
Nice.


bye
Ron


RustyKristi(Posted 2016) [#8]
great update!