Page 1 of 3

A very small addition to minigl...

Posted: Thu Jan 02, 2014 2:49 pm
by Spirantho
Hi everybody,
I've been recompiling MAME (again), and this time - rather than hacking MAME - I thought I'd actually fix the minigl instead to make it work properly.

Is there any way we can get my change into the minigl.library and distributed? It's a VERY small change.

This is all I did:

I added:

Code: Select all

void unpack_argb_b(void *context, GLubyte *from, GLubyte *to, GLsizei num)
{
	GLsizei i;

	for (i = 0; i < num; i++)
	{
		to[A_COMPONENT] = *from++;
		to[R_COMPONENT] = *from++;
		to[G_COMPONENT] = *from++;
		to[B_COMPONENT] = *from++;

		to += 4;
	}
}
and inserted

Code: Select all

	{GL_BGRA,				GL_UNSIGNED_INT_8_8_8_8_REV,unpack_argb_b,		4},
to the FormatTypeToUnpack[] table.

I had to do this because MAME uses the GL_UNSIGNED_INT_8_8_8_8_REV form of packing, but the normal minigl doesn't understand this and so can't unpack the texture, resulting in a white blob.

I realise minigl is obsolete for developers anyway now, but for normal mortals, we're still using the old minigl.library which means my MAME and MESS won't work unless people get a new minigl.library.

Can anyone help with this?

Thanks!

(Incidentally, the OpenGL support gives a considerable speed-up to larger screen resolutions as the scaling is all in hardware. It makes my little 600MHz Sam440ep much more capable at emulating)

Re: A very small addition to minigl...

Posted: Fri Jan 03, 2014 8:45 pm
by samo79
Good news, if i remember correctly there were also some other third party fixes to be merged, now i don't know who is involved but you might try to contact Steven Solie to obtain the access to the MiniGL SVN :)

Re: A very small addition to minigl...

Posted: Thu Jan 09, 2014 12:31 pm
by samo79
About the access I sent a quick message to Hans, let's see what he say :-)

Re: A very small addition to minigl...

Posted: Thu Jan 09, 2014 10:39 pm
by Spirantho
Thanks!
As soon as the minigl is updated everyone can have nicely scaled MAME 0.152 :)

Re: A very small addition to minigl...

Posted: Sat Jan 11, 2014 9:43 pm
by samo79
Spirantho wrote:Thanks!
As soon as the minigl is updated everyone can have nicely scaled MAME 0.152 :)
No luck with Hans (it seems he doesn't have the access for the MiniGL SVN) so i wrote a direct message to Karlos, let's see how it goes ..
But strange that nobody reply here, ok that MiniGL is obsolete but giving the access for a couple of fix wasn't too mutch stressing ..

Aniway in the worse scenario i think you should release your Mame port and also a new official version of MiniGL that include your fixes aswell (maybe calling it as 2.5.1 or similar) so without committing any of your changes into the repository.

Eventually you may include the full source with your eventual MiniGL 2.5.1 release, so less problems for others too ..

Re: A very small addition to minigl...

Posted: Sun Jan 12, 2014 7:06 pm
by Karlos
Hi,

Posting from my phone so I'll have to keep it short. I can't do it just now but I'll try to make sure the changes are added to the repository as soon as I can. I need to make sure all my changes are properly reintegrated too.

Re: A very small addition to minigl...

Posted: Mon Jan 13, 2014 7:10 am
by kas1e
@Karlos
Maybe you will be able to add also few new functions to mgl ?:) glBindBuffers(), glGenBuffers() and glDeleteBuffers(). I know they use those VBOs which minigl does not support, but we can emulate it via switching inside to vertex arrays, so there will be no needs to implement the wheel in all codes which use it. As Hans says, its should be pretty easy. If you in interest, there is relevant topic about: http://www.amigans.net/modules/xforum/v ... 3&forum=25

Re: A very small addition to minigl...

Posted: Mon Jan 13, 2014 2:50 pm
by Karlos
kas1e wrote:@Karlos
Maybe you will be able to add also few new functions to mgl ?:) glBindBuffers(), glGenBuffers() and glDeleteBuffers(). I know they use those VBOs which minigl does not support, but we can emulate it via switching inside to vertex arrays, so there will be no needs to implement the wheel in all codes which use it. As Hans says, its should be pretty easy. If you in interest, there is relevant topic about: http://www.amigans.net/modules/xforum/v ... 3&forum=25
I can't promise anything there. It's not that I regard MiniGL as obsolete and not worth the effort, the simple fact is that I recently got married and even more recently bought a house that we're in the process of renovating. I already have a full time job that almost every day involves working late and there's simply no time left at the end of the day to do any work on Amiga projects. Add to that the fact that I still didn't get the A1 fixed and my only working OS4 machine is an A1200. You get the idea.

Re: A very small addition to minigl...

Posted: Sat Jan 18, 2014 3:31 pm
by Karlos
So,

I'm having some SVN issues with the repo at the moment that are preventing me reintegrating my branch (note, not your typical text/tree conflict, this is something else). It may take a while to sort out, so I will add the texture code to the branch. That way I can get an update out sooner rather than later.

As for the vertex buffer object stuff, I'm afraid I just don't have time right now.

Re: A very small addition to minigl...

Posted: Sat Jan 18, 2014 3:50 pm
by Spirantho
On behalf of all MAME fans, may I say "Thank you" :)