AllegroGL can't display fullscreen
d d

I can't get AllegroGL to display something on fullscreen mode. My code works fine in windowed mode but when I try fullscreen my program works but nothing comes on my screen it justs goes to off-mode (the screen). When I press a button for readkey(); it jumps back on and displays the desktop. I could use some help on this.

casey d

If you're running Windows the problem is probably an outdated version of Direct X.

Tobias Dammers

Errr... he's using AllegroGL, which implies OpenGL, not DirectX. Still, there's probably a driver issue there, or the graphics card simply can't handle fullscreen in that particular color mode (though that sounds unlikely to me).
Do the allegrogl examples work correctly? Have you tried different color or z-buffer depths? Screen resolutions? At the very least, 640*480 at 16bpp with either 8bit or 16bit z-buffer should work.


Try forcing a screen refresh rate you know works at your selected resolution and colour depth. Should be in your gfx card driver settings somewhere...

d d

It's probably something on my own machine since the program runs fine on my other (much older) PC in fullscreen mode. I've tried a whole bunch of resolutions but they all failed in fullscreen. I'm gonna download the latest nvidia geforce drivers and try again later. If that doesn't work then I don't know what the problem is. Here's my setgfx function:

1bool SGE_SetGFXMode()
3 // clear settings
4 allegro_gl_clear_settings();
6 // set window title
7 set_window_title(SGE_VERSIONSTR);
9 // suggest screen mode for opengl
10 allegro_gl_set(AGL_DOUBLEBUFFER, TRUE);
11 allegro_gl_set(AGL_FULLSCREEN, TRUE);
12 allegro_gl_set(AGL_COLOR_DEPTH, 16);
13 allegro_gl_set(AGL_Z_DEPTH, 8);
14 allegro_gl_set(AGL_RENDERMETHOD, TRUE); // Hardware acceleration
17 // set graphics mode
18 if(set_gfx_mode(GFX_OPENGL, 640, 480, 0, 0) < 0){
19 allegro_message("Error setting OpenGL graphics mode:\n%s\nAllegro GL error : %s\n", allegro_error, allegro_gl_error);
20 return false;
21 }
23 // opengl enablers
24 //glEnable(GL_CULL_FACE);
25 glEnable(GL_TEXTURE_2D); // textures
26 //glEnable(GL_DEPTH_TEST); // zbuffering
27 glEnable(GL_BLEND);
28 //glCullFace(GL_BACK); // don't draw polygons we can't see
29 glShadeModel(GL_SMOOTH); // smooth shading // blending
30 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // set to alpha blending
32 // show models
33 glMatrixMode(GL_MODELVIEW);
34 glLoadIdentity();
36 // clear to black (red,green,blue,alpha)
37 glClearColor(0.0,0.0,0.0,0.0);
39 return true;

My computer is a AMD64 3200+, 512MB DDR, GeForce Ti 4600, running in WinXP at res 1024x768x32x85 (width,height,cdepth,refreshrate).

casey d

Errr... he's using AllegroGL, which implies OpenGL, not DirectX.

Haha, yeah, I just realized that. I did in fact miss the GL at the end. Still not as bad and when I confused vector art with pixel art.

I can't even run AllegroGL programs myself unless I compile them with Allegro 4.0.3 AND MSVC. Any later version of Allegro causes the window to be blank and MinGW cause the program to crash. A standard OpenGL application compiled in MinGW however works just fine. I personally think there's some serious compatibility problems going on but since nobody else is complaining I guess that's my problem.

Maybe you should try compiling a standard OpenGL program in fullscreen and see if that works.

Milan Mimica

casey d & d d: which version of AllegroGL are you using?

casey d


Milan Mimica

old, use cvs, or at least one from


As said, you need a more recent version of AllegroGL than 0.2.4 for Allegro 4.2.

casey d

The version on Retrospec gives me the same problem, and I can't login to the CVS repository. :( Could somebody please upload a recent snapshot?

Thread #561688. Printed from