List of Frameworks

BlitzMax Forums/BlitzMax Programming/List of Frameworks

Brucey(Posted 2014) [#1]
Hallo forum :-)

Can you help me build up a list of open-source BlitzMax frameworks that provide "virtual resolution" functionality, please? (or other non-BlitzMax frameworks if you think they would be easy enough to integrate with BlitzMax)

The idea will be to borrow the best bits and use it to facilitate working on the plethora of different screen resolutions out in the wild - on things like desktop, to mobile, etc.

On mobile specifically, you cannot change the screen resolution to fit your game, and instead must adapt your game screen around this fixed dimension (which may vary considerably depending on the device you are running on).

Thanks !


Derron(Posted 2014) [#2]
https://code.google.com/p/sdl-gpu/

http://www.discussiongenerator.com/2014/01/16/resolution-independent-2d-rendering-in-sdl2/
-> which refers to "SDL_RenderSetLogicalSize()"

I wrote an Email to you 2 minutes before your post ... maybe some ideas will get rid of the need for an external library.

The "SDL_RenderSetLogicalSize()" adds letterbox, which might not be intended (or must be "avoidable" using the method I described in the "goes mobile" thread).

bye
Ron


Brucey(Posted 2014) [#3]
Well, I was actually thinking more specifically of BlitzMax frameworks... (I shall add that word to the original post to avoid too much confusion later!) :-)


Brucey(Posted 2014) [#4]
@ SDL_RenderSetLogicalSize

Alas, we are not using the "Renderer" on SDL, we are banging the hardware directly via OpenGL.


Derron(Posted 2014) [#5]
Ahh ok ... sorry :p

Maybe this could be a start: http://www.blitzbasic.com/codearcs/codearcs.php?code=2879


bye
Ron


GfK(Posted 2014) [#6]
There is Qube's Oddball's Odd2D module, which is about as good as they get, but I've no idea if it's open-source or not.


Derron(Posted 2014) [#7]
As I use BlitzSupports code too (SuperStrict, singleton: https://github.com/GWRon/Dig/blob/master/base.util.virtualgraphics.bmx)

I would extend it to have support for multiple stretching options (fullscreen, keep aspect ratio, extend, ...).


@Odd2D
According to this post it is "[...] Public Domain, so you can use it for whatever purpose you want."

Dunno if the tighter integration as "driver" fits more to bruceys ideals.


bye
Ron


therevills(Posted 2014) [#8]
I use this
http://www.blitzmax.com/codearcs/codearcs.php?code=2879


BlitzSupport(Posted 2014) [#9]
Doh! Just posted mine in the Mobile thread!

Another option might be to run AutoFit through Monkey on GLFW with the GLES2 option (unless I'm hallucinating the existence of that option), as I assume that'd give a lower level OpenGL take on things... might be a bit hard to comprehend/integrate, though. [EDIT: You want higher-level, anyway, so n/m.]


Wiebo(Posted 2014) [#10]
My framework uses James Boyd's code as well. Works perfectly.

https://github.com/wiebow/game2d.mod


Derron(Posted 2014) [#11]
Ok... So I created a new "framework file".

TSurfaceCamera is a base class which could get more tightly integrated into "NG".
By default it does nothing but returning the same values a "unscaled" graphics areal would return.

But you could switch other cameras - or even provide new ones (other "scaling/offset" strategies).

I already included 2 other "SurfaceCameras": TStretchableSurfaceCamera, which stretches/scales while keeping the aspect-ratio. The code includes some portions of BlitzSupports code (the "flickering"-bugfix - which clears the screen before limiting the viewport again) and Odd2D (the setclscolor part to "black" out the letterbox). The code also uses "shorter formulas" (rearranging sometimes isnt effortless).

TExtendedSurfaceCamera limits the virtual resolution to the given 2 resolutions ... so it does not matter what "graphics" you have - you will end up having something between "w,h - w2,h2" (might be handy for android as you just have to calculate things for these resolutions). But somehow I am not that satisfied with the current implementation of this camera.
(Edit: for now the ExtendedSurfaceCamera should react similar to the approach explained @ blog.gemserk.com)

Ok... the system tries to create a default camera upon "import" of the source file. Of course this is then the "simple" camera.


Hmm, more could be seen when you try out the "demo file":

source:
https://github.com/GWRon/Dig/blob/master/base.util.surfacecamera.bmx

demo:
https://github.com/GWRon/Dig/blob/master/samples/surfacecamera/surfacecamera.bmx

demo image:
cameraareas.png


Hope it is somehow useful.


bye
Ron