Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » GFX_AUTODETECT_WINDOWED+maximize

This thread is locked; no one can reply to it. rss feed Print
GFX_AUTODETECT_WINDOWED+maximize
thirdy
Member #8,409
March 2007
avatar

Hi! How do you make your program run at maximized window?

int monitorx=getmaxx();//these 2 functions would work in Mr.Borlands graphics.h
int monitory=getmaxy();
set_gfx_mode(GFX_AUTODETECT_WINDOWED,monitorx,monitory,0,[);

Richard Phipps
Member #1,632
November 2001
avatar

Use GFX_AUTODETECT_FULLSCREEN instead of GFX_AUTODETECT_WINDOWED

thirdy
Member #8,409
March 2007
avatar

I need windowed mode but in maximum size

GullRaDriel
Member #3,861
September 2003
avatar

Use Platform Specific created windows.

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

thirdy
Member #8,409
March 2007
avatar

That would not be a good option for mes. Is there a way in allegro wer you can get the current screen resolution?

Kitty Cat
Member #2,815
October 2002
avatar

get_desktop_resolution
You won't necessarilly be able to get a maximized window, however. The size you pass to set_gfx_mode is the size of your drawing area, excluding the window borders. You can't gaurantee the size of the window borders, and certain systems won't let you create a window bigger than the screen.

The best thing to do would be to use a standard windowed resolution (640x480 or 800x600 or something), and switch to a fullscreen mode when you want to "maximize".

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Kris Asick
Member #1,424
July 2001

You have to use your own custom window with Allegro in order to make the window both resizable and able to use the maximize button. In the allegro\tests\win folder is a set of files called dxwindow which will demonstrate how to properly do this. (As there are a number of limitations and things you must do to correctly use your own window with Allegro.)

--- Kris Asick (Gemini)
--- http://www.pixelships.com

--- Kris Asick (Gemini)
--- http://www.pixelships.com

Go to: