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.
If you're running Windows the problem is probably an outdated version of Direct X.
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...
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:
1 | bool 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).
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.
casey d & d d: which version of AllegroGL are you using?
0.2.4
old, use cvs, or at least one from http://retrospec.sgn.net/allegro.php
As said, you need a more recent version of AllegroGL than 0.2.4 for Allegro 4.2.
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?