Max2D integration

BlitzMax Forums/MiniB3D Module/Max2D integration

ziggy(Posted 2007) [#1]
I'm wondering if it is any safe way to mix max2D commands with miniB3D. I'm using Klepto module, but I have some issues with some drawing commands. Are there any plans to integrate miniB3D with Max2D properly?


simonh(Posted 2007) [#2]
I may take another look at it at some point, but it's not really a priority. It should be easy enough for other people to iron out the issues though if they really want to.


*(Posted 2007) [#3]
This would be a good thing to do, it would make MiniB3d THE best max engine IMHO the only thing letting it down is its lack of Max2d stuff.


simonh(Posted 2007) [#4]
I would recommend using sprites instead to be honest. With a simple bit of code from the code archives you can emulate 2D coords behaviour.

Combining MiniB3D with Max2D at this stage would just open up another layer of possible issues which I don't wish to deal with.

Another thing to bare in mind is if in the future I decide to add a DX8 rendering mode, then your projects aren't going to work with it if they're full of Max2D code. OpenGL might be easy to mix and match, DX isn't.


*(Posted 2007) [#5]
The only thing I would like is text over 3d without the black background :), as you said everything else can be done with sprites as fast as Max2d but the text thing still eludes me.


simonh(Posted 2007) [#6]
Add this to before GLDrawText in TDebug.Text:

glEnable(GL_BLEND)

Easy!


*(Posted 2007) [#7]
Ah thanks, I havent dabbled that much in OpenGL yet. Will add the bit you have put there :).


*(Posted 2007) [#8]
Si: would it be possible to add a 'ResetForMax2D' command that resets the states so that Max2d can be used as you say in the FAQ


simonh(Posted 2007) [#9]
No :) That was added to an earlier version and issues kept appearing. Check out klepto's version, it's as good as I can do.


*(Posted 2007) [#10]
ok will do, TBH will probably use sprites anyways as they would be scaled with the screen resolutions. The reason why I ask as it would stop the hoard of 'when will we get Max2d' requests :)


klepto2(Posted 2007) [#11]

You just have to insert the following things for the original
minib3d:

simply add the globals to TGlobal and replace renderworld()

for my modified version you have to add the globals and replace renderworld by the code of the first post.



This is from the thread minib3d meets max2d. this works like charm and seems to have no direct speed issues.


*(Posted 2007) [#12]
does it have any other issues


klepto2(Posted 2007) [#13]
no ;)


ziggy(Posted 2007) [#14]
Are those changes included in your last mod version? I'm getting problems with max2D integration, and I was wondering if those changes have to be added to your last module version


klepto2(Posted 2007) [#15]
yes, the changes are build into my latest module version. You have to keep in mind that max2d commands only works after the RenderWorld command. And you may set the Blendmode to AlphaBlend because otherwise the commands could overwrite the backbuffer with black areas.