Allegro.cc - Online Community

Allegro.cc Forums » Game Design & Concepts » AllegroGL can't display fullscreen

This thread is locked; no one can reply to it. rss feed Print
AllegroGL can't display fullscreen
d d
Member #6,768
January 2006

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
Member #4,901
August 2004
avatar

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

--
Nightsticks, water cannons, tear gas, padlocks, molotov cocktails and rocks behind every curtain

Tobias Dammers
Member #2,604
August 2002
avatar

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.

---
Me make music: Triofobie
---
"We need Tobias and his awesome trombone, too." - Johan Halmén

miran
Member #2,407
June 2002

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...

--
sig used to be here

d d
Member #6,768
January 2006

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()
2{
3 // clear settings
4 allegro_gl_clear_settings();
5
6 // set window title
7 set_window_title(SGE_VERSIONSTR);
8
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
15 allegro_gl_set(AGL_SUGGEST, AGL_DOUBLEBUFFER | AGL_FULLSCREEN | AGL_COLOR_DEPTH | AGL_Z_DEPTH | AGL_RENDERMETHOD);
16 
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 }
22 
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
31
32 // show models
33 glMatrixMode(GL_MODELVIEW);
34 glLoadIdentity();
35
36 // clear to black (red,green,blue,alpha)
37 glClearColor(0.0,0.0,0.0,0.0);
38
39 return true;
40}

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

casey d
Member #4,901
August 2004
avatar

Quote:

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.

--
Nightsticks, water cannons, tear gas, padlocks, molotov cocktails and rocks behind every curtain

Milan Mimica
Member #3,877
September 2003
avatar

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

casey d
Member #4,901
August 2004
avatar

0.2.4

--
Nightsticks, water cannons, tear gas, padlocks, molotov cocktails and rocks behind every curtain

Milan Mimica
Member #3,877
September 2003
avatar

old, use cvs, or at least one from http://retrospec.sgn.net/allegro.php

Evert
Member #794
November 2000
avatar

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

casey d
Member #4,901
August 2004
avatar

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?

--
Nightsticks, water cannons, tear gas, padlocks, molotov cocktails and rocks behind every curtain

Go to: