I'm using some code based on a snippet ReyBrujo posted some time ago.
First I get the list of drivers and write them out to a logifle and I get these options:
name: AllegroGL Windowed (Win32)
ID: 1330072663
name: AllegroGL Fullscreen (Win32)
ID: 1330072646
name: AllegroGL Default Driver
ID: 1330072644
However, when I call get_gfx_mode_list with any of these ID's it just returns NULL indicating failure. I get the same thing when I try to use the DIRECTX drivers instead.
Anyone else had this problem?
A little example program would help. And yes, it should work. Did you init allegro and allegroGL?
Also, from the manual: "Note that the card parameter must refer to a real driver. this function fails if you pass GFX_SAFE, GFX_AUTODETECT, or any other "magic" driver."
I don't think we implemented this, but it would be trivial to do so - AGL already builds up a list internally to pick the right graphics mode.
I might as well ask. Is AllegroGL still being worked on Bob?
Yes, but not by me.
Oh..
Who is now working on it then?
Elias, Peter and me mostly.
get_gfx_mode_list is implemented. I did it for Windows. At least it should work with DirecX drivers which has nothing to do with AGL.
I've found the directX part, but I presume their needs to be an equal part in the OpenGL side.
What are the plans for AllegroGL then?
So, does get_gfx_mode_list(GFX_OPENGL_FULLSCREEN) return something other than NULL, like it is supposed to?
The plan is to release AllegroGL-0.4.0 when Allegro-4.2.1 comes out. AGL-0.4.0 will work only with Allegro >= 4.2.0. Then I don't know, AGL should be merged in Allegro as a ordinary display driver.
I tried the 3 ID's I found:
name: AllegroGL Windowed (Win32) ID: 1330072663 name: AllegroGL Fullscreen (Win32) ID: 1330072646 name: AllegroGL Default Driver ID: 1330072644
But none of them worked. I didn't try GFX_OPENGL_FULLSCREEN, but that seems to be the second choice.
This works for me:
1 | #define ALLEGRO_USE_CONSOLE 1 |
2 | |
3 | #include <allegro.h> |
4 | #include <alleggl.h> |
5 | #include <stdio.h> |
6 | |
7 | int main() |
8 | { |
9 | GFX_MODE_LIST *l; |
10 | |
11 | allegro_init(); |
12 | install_allegro_gl(); |
13 | |
14 | l = get_gfx_mode_list(1330072646); |
15 | printf("%i\n", l); |
16 | printf("%i\n", l->num_modes); |
17 | |
18 | return 0; |
19 | } |
20 | END_OF_MAIN() |
Quering mode list of other two drivers makes no sense because the first one supports any resolution (window sizes) and the third one is ambiguous.
The only thing that might be important is I tried this with OpenLayer (about setting up Allegro and OpenLayer, but before opening a screen).
I just got 0 or NULL back from get_gfx_mode_list..
You didn't mention the version of AGL you are using. 0.4.0RC4 should do, older versions won't work because it was implemented recently.
Ah! It might be that. I just use OpenLayer, so not sure what version it links into. The .a file in the OpenLayer folders seems to be about a year old though..
I'm not sure if OpenLayer works with the newest AllegroGL lib. I've always been reluctant to use new versions of libraries while I'm in the middle of a project using them!