Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
69 user(s) are online (65 user(s) are browsing Forums)

Members: 0
Guests: 69

more...

Support us!

Headlines

 
  Register To Post  

Supporting MiniGL *and* GL4ES
Just popping in
Just popping in


See User information
Hi!

As I now did three ports (not yet finished) with support for both MiniGL and GL4ES I thought I write a small tutorial of how to support both.

I often see ports which only support one - the extra work to support the second is really MINIMAL.

Step 1: Preparations

Sadly both use the include path GL. I fixed this by changing the GL/ from MiniGL into GL2/. Of course then also the includes inside the MiniGL Includes - and in your game or demo - need to be adapted. You still need two source paths, but to a large part the main difference is that you include GL/GL.h for GL4ES and GL2/GL.h for MiniGL. I think I had to rename one lib file too, not sure anymore.

Step 2: Actual coding

The actual source difference asides from GL path are minimal. Basically is

- How to init opening a display
- How to close display
- How to doublebuffer
- and some other minor differences

On MiniGL there are probably enough tutorials (but if you do not know how to do it from MiniGL side, feel free to ask), so I mainly focus on the GL4ES side here.

Open a display:

(Assuming you already have a standard intuition Window open, with the variable name window (this example uses a 16 Bit Color screen).

struct TagItem contextparams[] =
{
{OGLES2_CCT_WINDOW,(ULONG)window},
{OGLES2_CCT_DEPTH,16},
{OGLES2_CCT_STENCIL,8},
{OGLES2_CCT_VSYNC,0},
{OGLES2_CCT_SINGLE_GET_ERROR_MODE,1},
{OGLES2_CCT_RESIZE_VIEWPORT, TRUE},
{TAG_DONE,0}
};

ogles_context = IOGLES2->aglCreateContext2(&errCode,contextparams);
if (!ogles_context)
{
closeWindow();
return false;
}
IOGLES2->aglMakeCurrent(ogles_context);

glViewport(0,0, 500, 500);

This completely REPLACES the MiniGL part of creating a miniGL Context or whatever. You still need to open ogles2.library before you call this codepiece.

Closing (the method closeWindow above) should do:

IOGLES2->aglDestroyContext(ogles_context);
ogles_context = 0;

and then close the Window and screen etc.

Screen Refresh now looks like this:

IOGLES2->aglSwapBuffers();

A lot of the stuff MiniGL does here you simply DO NOT NEED. Just one call is needed.

Other minor differences:

- Where you had glBegin(MGL_FLATFAN); for MiniGL you write glBegin(GL_QUADS); for GL4ES.
- Remove mglUnlockDisplay/mglLockDisplay for GL4ES
- MGL_PERSPECTIVE_MAPPING stuff - remove it and hope your code still looks good A range of other "changes to the state-machine" also is not supported by GL4ES, but most games/demos should not need them anyways.

If possible do as many stuff as possible inside one big GL_QUADS. If not, it still should be fast (or possibly FASTER) even if you do not optimize here.

This is ALL.

And if you say "I do not have the hardware to run it" - I wrote the GL4ES Renderer for Quake 2 when I did not yet have fitting 3D Hardware. Just sent it off to a Betatester then and he confirmed it works

Note on GL4ES you have a range of extensions you did not have on MiniGL (Multitexturing for example).

Personally I think both should be supported for any new Amiga Game/Demo using 3D Hardware. It is not so hard to do. And there are systems which only support MiniGL and there are systems only supporting GL4ES (also GL4ES has big advantages).

If anyone still got questions, feel free to email me at tirionareonwe@gmail.com

Steffen "MagicSN" Haeuser

Go to top
Re: Supporting MiniGL *and* GL4ES
Just popping in
Just popping in


See User information
@TheMagicSN

As currently I have a microA1, I'd warmly welcome if minigl (with restrictions) would be continously supported. It is a nice little hardware, and can't see if I can purchase an X1000 or X5000. Also can't see the point why to buy any if their lifetime will predestined to such short timeframe as the mA1 had... I recently reinstalled my OS4.1.6 and it is so frustrating to download anything from OS4depot for example then I have to realize that my hw is not supported.

Go to top
Re: Supporting MiniGL *and* GL4ES
Home away from home
Home away from home


See User information
@Reynolds
Quote:

I'd warmly welcome if minigl (with restrictions) would be continuously supported


That all depends on the developer's wish, time, and their interest in. No one develop minigl anymore, and the ones who left, concentrate instead on ogles2 and warp3dnova: because it gives a little more fun. With ogles2/warp3dnova/gl4es bugs fixed more or less fast in compare with minigl, where no one fix anything anymore.

More of it, sam440, microa1 and pegasos2, can't be labeled as the good machines for semi-modern PC ports. Most of them can't handle modern GFX cards anymore, and even x1000 and x5000 which can handle new cards, a bit too slow for some new games from EntwicklerX (like the “pyramid quest” they're trying to make to be 60fps).

So until there will be found some developer willing to spend their free time and fun on the minigl improvements, i fear the support of minigl will drop more and more.

New games need more CPU power, new GFX cards, and new drivers. The same story as everywhere.

Quote:

Also can't see the point why to buy any if their lifetime will predestined to such short timeframe as the mA1 had...


If you have no interest in, and see no point, then surely you shouldn't buy anything. But you also shouldn't be in hope everyone thinks the same way, of course, and want to stick with microa1, radeon9250 and os4.0 (for example). Things improves a bit, some of us like it, some not. But at least improvements and changes in software and hardware front, that what make it fun for some of us and still stick with it. Probably there will be much less activity in os4 world, if all will have microa1 and have no progress in hardware/software fronts.


Quote:

I recently reinstalled my OS4.1.6 and it is so frustrating to download anything from OS4depot for example, then I have to realize that my HW is not supported.


Sure, some last games require warp3dnova/ogles2. As well as some apps like shaderjoy, glsnoop. But the casual software still the same as before, and not need warp3dnova/ogles2.

Probably reason why things not works for you, is that you're on the os4.1.6, which should be updated as soon as possible to os4.1FE update2. Most of the new things will just not work for you anymore on older OS4.

What I mean by all this, that even if this all retro and dead horse, still it's interesting to progress bit by bit, and not stick on the past fully. When things improves (even a little), it means updates of software and hardware, just like everywhere.

Saying all that, of course will be good if someone come, and made a MiniGL working on all old and new GFX cards, and be better in the features and speed. But ..

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Supporting MiniGL *and* GL4ES
Just popping in
Just popping in


See User information
@kas1e
I know you're right in several things, I just feel sorry of seeing how these nice mobos are going "out of business" more and more, albeit they still have potential for certain things, and just as I like to use my CSPPC, I'd like to use my mA1 also. It is like having a totally average car instead of any brand's top model, as for various tasks that one also could be sufficient.
Anyway the question is regarding to buy or not to buy is on a different level. It doesn't mean I'd not want to get access to the latest OS4.x developments, but I have other personal activities which takes up costs, and also real life, as it is there for all of us, so that's not an excuse, but stating a fact.
I just wanted to react on the chance to have any recent stuff with lowered settings fits likely to older hw would be amazing. Heretic 2 and Shogo runs really well on 640x480 with MiniGL. I know it can't be compared to the performance of X5000, but at the end of the day it does the trick and there are still earlyNG configs out there, whose owners could think like me if stuff comes to their hands too, even with restrictions. but that's just my opinion.

Go to top
Re: Supporting MiniGL *and* GL4ES
Home away from home
Home away from home


See User information
@Reynolds

Just out of curiosity, does ScummVM work on your Micro?
It's using both GL targets, MiniGL and OGLES2.

Go to top
Re: Supporting MiniGL *and* GL4ES
Just popping in
Just popping in


See User information
@Reynolds

You misunderstood my post. My point was not to
stop supporting MiniGL, my post was that it is easy
to support both. I described only the gl4es changes
as i assume 3d developers will already know how to do
it with MiniGL. It is maybe extra effort of 1h to support
both (unless you need special features only one of them
offer - direct control of the 3d state machine which only
MiniGL offers or shaders or multitexturing which only gl4es offers.

My point was „why only support one if it is easy to
support more hardware?“

My assumption was it was due to many developers
not knowing HOW.

At the shortness of my tutorial you see how easy it
actually is.

Go to top
Re: Supporting MiniGL *and* GL4ES
Just popping in
Just popping in


See User information
@Raziel

Haven't tried since the reinstall, but that I also want to copy on.
There are so many amazing point'n'click games out there. :)

Go to top
Re: Supporting MiniGL *and* GL4ES
Just popping in
Just popping in


See User information
@TheMagicSN

I don't think I misunderstood, but more likely meant that I would love to see if developments will comes on hw available in a mA1 and other older NG configs. The more setups supported, the better for all of us. And if it is really easy to solve, then everyone should support older NG boards. If those can't perform enough well, recent boards can be bought if their time comes. I know that the mA1 is a not-so-good mobo at all, but still, it does it's task long time ago and although I can see and feel it's weakness in some programs, I still think it deserves to keep on my desk. but that's just my thoughts. I know it is better to buy recent mobos & stuff, but currently that's not on my to-do list. If I can get access to recent titles under more modest circumstances, I can live with that till buying a new board will be on the top of my list.
So in my thinking we shouldn't have to turn away from the early NG systems so fast, if those also could serve us, with acceptable limitations.
Regarding your current projects, if there would be no minigl, a certain amount of users could be closed out immediately to get involved of their developments and also some possible forthcoming stuff, although as Heretic 2 shows these stuff can be handled by a mA1-leveled machine, so why not to let it do the job. That's all. :)

Go to top
Re: Supporting MiniGL *and* GL4ES
Just popping in
Just popping in


See User information
@kas1eQuote:
kas1e wrote:@Reynolds
Quote:

I'd warmly welcome if minigl (with restrictions) would be continuously supported


That all depends on the developer's wish, time, and their interest in. No one develop minigl anymore, and the ones who left, concentrate instead on ogles2 and warp3dnova: because it gives a little more fun. With ogles2/warp3dnova/gl4es bugs fixed more or less fast in compare with minigl, where no one fix anything anymore.

More of it, sam440, microa1 and pegasos2, can't be labeled as the good machines for semi-modern PC ports. Most of them can't handle modern GFX cards anymore, and even x1000 and x5000 which can handle new cards, a bit too slow for some new games from EntwicklerX (like the “pyramid quest” they're trying to make to be 60fps).

So until there will be found some developer willing to spend their free time and fun on the minigl improvements, i fear the support of minigl will drop more and more.

New games need more CPU power, new GFX cards, and new drivers. The same story as everywhere.

Quote:

Also can't see the point why to buy any if their lifetime will predestined to such short timeframe as the mA1 had...


If you have no interest in, and see no point, then surely you shouldn't buy anything. But you also shouldn't be in hope everyone thinks the same way, of course, and want to stick with microa1, radeon9250 and os4.0 (for example). Things improves a bit, some of us like it, some not. But at least improvements and changes in software and hardware front, that what make it fun for some of us and still stick with it. Probably there will be much less activity in os4 world, if all will have microa1 and have no progress in hardware/software fronts.


Quote:

I recently reinstalled my OS4.1.6 and it is so frustrating to download anything from OS4depot for example, then I have to realize that my HW is not supported.


Sure, some last games require warp3dnova/ogles2. As well as some apps like shaderjoy, glsnoop. But the casual software still the same as before, and not need warp3dnova/ogles2.

Probably reason why things not works for you, is that you're on the os4.1.6, which should be updated as soon as possible to os4.1FE update2. Most of the new things will just not work for you anymore on older OS4.

What I mean by all this, that even if this all retro and dead horse, still it's interesting to progress bit by bit, and not stick on the past fully. When things improves (even a little), it means updates of software and hardware, just like everywhere.

Saying all that, of course will be good if someone come, and made a MiniGL working on all old and new GFX cards, and be better in the features and speed. But ..


First of all, I'm still on the positive side. Did not decide to give up or anything, just currently to buy a today's NG Amiga is not on the top of my list sadly.
Other thing is, I've not just installed 4.1.6FE but registered as did that with other OS4.X releases at Hyperion for support and updates, so on my mA1 I have the latest stuff installed. In the meantime I'm digging forums and sites to learn recent things about the whole stuff again as I went a bit away from NG for a while, but still keep getting to know as much as possible about it.
About retro & semi-retro, there are lots of stuff came out in the PS1-PS2 era which could be handled on a mA1-kind of machine for sure, and I fully agree, if we are thinking on to get more recent stuff, we have to pay our dues on the altair of expansions.
Just because more powerful machines are available, we shouldn't have to let less strong ones to diminish, if those also could deliver solutions on their level. And I think on it in terms of potential userbase for example.
So I still hope new programs and ports will come out for older NG hw too :)

Go to top
Re: Supporting MiniGL *and* GL4ES
Home away from home
Home away from home


See User information
@Reynolds

Oh man, yes there are and the supported engines just keep growing

I'd love to hear about your adventures with ScummVM, especially speed-wise since i fear that the 3D games may put too much load on the poor Micro cpu/gpu.

Go to top
Re: Supporting MiniGL *and* GL4ES
Just popping in
Just popping in


See User information
@Raziel

Actually, Heretic 2, Shogo, and Quake 1-2 runs pretty well. I can live with it's screen resolution in 640x480, for a decent speed. Heretic 2 runs with 31 FPS in SW render, while 40-42 with minigl. That is fair for me. I know that poor little board is not a powerhouse :)

Go to top
Re: Supporting MiniGL *and* GL4ES
Just popping in
Just popping in


See User information
@Reynolds

As I said, this opinion "The more setups supported, the better for all of us." is exactly the reason for my post.

Remember we have some boards only supported by MiniGL, and if someone does not have NovaBridge on the new systems he can only run GL4ES.

As I explained it is easy to support both (if directly using ogles2.library this is not an option of course, or if needing shaders or multitexturing).

None of my current projects has such requirements. They all run with both. And I think some projects which currently only support MiniGL could easily be updated to also support GL4ES.

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project