Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Problem with virtual screen and set_gfx_mode

This thread is locked; no one can reply to it. rss feed Print
Problem with virtual screen and set_gfx_mode
Number Six
Member #3,912
October 2003
avatar

I'm trying to simple create a screen with 640x480 res and a larger virtual screen size (say 1024x1024) No matter what size I try to make the virtual screen, set_gfx_mode fails with "Unsupported virtual resolution". This is on a system with a TNT2 Model64 pro so I'm sure theres plenty of Video Ram
Any advice would be appreciated since this is the first time I've tried to use this feature! ;D

---------------------------------------
By Hook or by Crook.... We WILL!

Evert
Member #794
November 2000
avatar

Not all drivers can do this. As far as I know, Windows' DirectX windowed driver cannot, for instance.
So... what operating system and Allegro version are you using?

Carl Divston
Member #4,843
July 2004
avatar

Aye Sir! The same problem happens here. Looks like its something that some videocards (or anything else) cant do. I needed to do a turn-around. You can make a simple scrolling system with some few variables. Problably this is not what you want, but its the only way I found...

EDIT: beaten...

Number Six
Member #3,912
October 2003
avatar

Oh yeah sorry! :-/

On this platform its Windows 2000 DX9.0b Allegro 4.1.14!
I'll try it at home on my WinXP Gforce-4 Ti box...

---------------------------------------
By Hook or by Crook.... We WILL!

gnolam
Member #2,030
March 2002
avatar

AFAIK there's no real reason to use the virtual screen parameters instead of create_video_bitmap() anyway...

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

Kitty Cat
Member #2,815
October 2002
avatar

The Windows gfx drivers do not support virtual screens. You can still create extra video bitmaps, but you won't be able to scroll the screen smoothly. Note though that other drivers do require a virtual screen if you want to use extra VRAM. If ALLEGRO_VRAM_SINGLE_SURFACE (IIRC) is defined, create a virtual screen. If not, leave those parameters 0 and just pray.

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

Number Six
Member #3,912
October 2003
avatar

Quote:

AFAIK there's no real reason to use the virtual screen parameters instead of create_video_bitmap() anyway...

So does that mean I have to try and do it with page flipping?
Damn! I knew it was too good to be true..

---------------------------------------
By Hook or by Crook.... We WILL!

Thomas Fjellstrom
Member #476
June 2000
avatar

I think only the DOS or linux VGA drivers support any kind of virtual screen. The rest all make you create video_bitmaps.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Number Six
Member #3,912
October 2003
avatar

Oh I think I'm (finally) getting it! <Touches wood!>

So do you make a large video_bitmap say (1280x960), instead of the large virual screen, and then blit from whereever you wanted in that video_bitmap area to the screen?
Not as easy but not that difficult either.

---------------------------------------
By Hook or by Crook.... We WILL!

Kitty Cat
Member #2,815
October 2002
avatar

All DOS drivers and all Unix/X drivers do (sort of.. DGA2 requires a virtual screen but it has access to all VRAM regardless of what virtual screen size you specify). I'm not sure about OSX.

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

Thomas Fjellstrom
Member #476
June 2000
avatar

Uh? X11 modes can't have a virtual screen, can they? Its like GDI in windows...

Number6: I'd actually create a second bitmap that you store the cached sprites in. or make one for each, butthat might be overdoing it ;)

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Evert
Member #794
November 2000
avatar

Quote:

X11 modes can't have a virtual screen, can they? Its like GDI in windows...

It's a hack. But yes, virtual screens and scrolling do work with the X11 driver.

Go to: