I thought I was not going to be able to do it... Today is the day! AMCerasoli is not a noob anymore!.
Yes I know they're are just a couple of lines, but I know what it's happening, that's what it matters!.
Another thing is that I could swear that I saw that ninja with some shadows but now he doesn't have it...
The code example
Edited:
Damn with the title!! , I screw it again... I meant "working with Allegro 5 on windows"
The ninja is supposed to have shadows in that example.
ent1->setCastShadows(true);
So you ain't done yet.
EDIT: What did you add to stop the white screen from appearing tho?
Nothing... I just kick the case a couple of time and that did it...
Well actually I did something that my brain is still deciphering, practically I just read 1.000 websites and start extracting what I thought it could make the difference.
In one of those website I found this, all what I found was related to SDL so I had to make some modifications:
unsigned long winHandle = reinterpret_cast<size_t>(al_get_win_window_handle(al_get_current_display())); unsigned long winGlContext = reinterpret_cast<size_t>(wglGetCurrentContext());
So here I'm kind of "serializing" the al_get_win_window_handle() value. Why? I don't know.
The same with the second function...
But what I think is the most important part is this one:
misc["externalWindowHandle"] = StringConverter::toString(winHandle); misc["externalGLContext"] = StringConverter::toString(winGlContext); misc["externalGLControl"] = String("True");
Where after telling to Ogre to don't initialize (would create another display) with mRoot->initialise(false);, I'm then tell it to use this values instead.
As you can see it's not very clear, but boy I can already see a new tutorial on the wiki .
That's cool. Really cool.
Indeed. I'll download Ogre later and see if the example still works in Linux (if I can get it to work at all) - then commit your version if it does.
WTH is carring your avatar?...
Anyway...
So you ain't done yet.
Well in my defense, I have ran the example in my laptop, and works perfectly. I'm getting a:
WARNING: Stencil shadows were requested, but this device does not have a hardwar e stencil. Shadows disabled.
Why? I dunno.
A question.. ¿?¿?¿:
If I set the GL context to Ogre, then I'm not going to be able to use normal drawing functions from Allegro?.
I ask this because before initializing Ogre, I'm able to draw with allegro, but once I init ogre, the function don't crash or anything but I can't see anything, just the 3d example.
Edited: Oh, By the way, thank you guys!
WTH is carring your avatar?...
A christmas tree (notice the green?) and a yellow box. It's not finished but I won't have time to finish most likely so replaced it anyway
Stencil shadows were requested, but this device does not have a hardwar
e stencil. Shadows disabled.
What if you use al_set_display_option(ALLEGRO_STENCIL_SIZE, 8, ALLEGRO_SUGGEST)?
If I set the GL context to Ogre, then I'm not going to be able to use normal drawing functions from Allegro?
Yes, unless you are willing to reset the complete OpenGL state to something Allegro expects (and then back to something Ogre expects).
A christmas tree
It looks more like a cucumber .
What if you use al_set_display_option(ALLEGRO_STENCIL_SIZE, 8, ALLEGRO_SUGGEST)?
That fixed it!, well I used al_set_new_display_option() instead.
Take that Dario!!.
Take that Dario!
Anyway, it's so nice to see this working so easily, I've been longing for using both A5 and Ogre for a long time. I've just recently began using Ogre as well, so this thread's timing is ideal.
Do you dare to try using the Direct3D driver now? The OpenGL Ogre one is a bit glitchy with some addons.
Kinda related:
What's Ogre?
Not related:
A5 scares me
I need to learn it from A4
Do you dare to try using the Direct3D driver now? The OpenGL Ogre one is a bit glitchy with some addons.
Actually once when it appeared the platform screen, that which ask you if you want to run it as DirectX or OpenGL, I pressed DirectX , with all configured to work with OpenGL and it could create the display, import everything and start even rendering, the problem was that it as an horrendous flicker, that sometimes let me see only half of the screen. But I think it should be possible. Would need to read about how to get the directx context?
What's Ogre?
Ogre is the equivalent of Allegro in the world of 3D. Actually should be OGRE since it is is an acronym: Object-Oriented Graphics Rendering Engine, but it happens the same than with Allegro which supposedly it's also an acronym, but you're not going around putting ALLEGRO 5 ALLEGRO 5 because it looks grotesque. Well not quite the equivalent of Allegro since it only allows you to draw 3D meshes on the screen, there is no events, keyboards, mouse, threads, UTF-8, file IO... It's just an OGRE.
But since we all know how difficult is to be able to create a mesh in Blender for example, and then import it to Allegro and draw it with raw OpenGL, Ogre is a wonderful tool to keep you away from that. That's only a tiny reason of course, if you get into 3D you'll know what I'm talking about.
OGRE among other things, is cross-platform (Windows, Linux, Mac and I thin even iPhone), it has a resource manager included, which allow you to load files from Zip files too (as Allegro 5), support shaders and a lot more.
And now combined with Allegro 5, you have really BIG and powerful tool on your hands, configurable within minutes.
A5 scares me
What do you mean with that?, don't you like it?
Do you know what scares me? the size of the main .dll of Ogre... 11MB in relase mode... and... 310MB in debug mode , MY GOOOOD!!. And you also need to link to a lot of plugins!.
Only thing that annoys me about Ogre so far is that the only interface is C++. There was a project to write a C interface for it I think, but I think it was never finished.
Heck, I think it was even gonna use Allegro.
Low level C Ogre3D Interface(llcoi)