Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 5th Jun 2010 16:33
Once i alt+tab my game and go back to it gives me error that some image number is illegal,why is that?

Where there is a will, there is a way.
I often edit my posts, that`s who i am
=PRoF=
23
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 5th Jun 2010 16:53
Alt-tabbing causes the graphic buffer to flush, meaning that all graphics (models, images, etc) need to be re-loaded before they can be displayed.

I usually add a check at the beginning of a loop to see if the first object/sprite etc exists, and if not then load them all again before continuing to avoid this error.

I know it's not 100%, but the only way to be sure it doesn't happen is to check EVERY time you use a object/sprite/image command.

Good luck

Sepnon
16
Years of Service
User Offline
Joined: 7th Feb 2010
Location: Brazil
Posted: 5th Jun 2010 21:06
Quote: "I usually add a check at the beginning of a loop to see if the first object/sprite etc exists, and if not then load them all again before continuing to avoid this error."


There's a better command for that: Screen invalid()
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 5th Jun 2010 22:46
@Sepnon:
Nice comand!How do you use it?Do you build some list with currently loaded items and if screen invalid you make a check for last loaded stuff and reload them or?

Where there is a will, there is a way.
I often edit my posts, that`s who i am
Sepnon
16
Years of Service
User Offline
Joined: 7th Feb 2010
Location: Brazil
Posted: 6th Jun 2010 04:06
Changing the resolution will flush the graphics buffer.. that command returns 1 once if that happened

btw, reloading? i prefer saving objects and images on memblocks, they are not lost when alt-tabbing

take a look:

Mnemonix
23
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 7th Jun 2010 19:06
luskos, perhaps you should consider switching to windowed full screen rather than full screen exclusive.

Alt+Tabbing will be possible if you do this.

Your signature has been erased by a mod because it's larger than 600x120
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 7th Jun 2010 19:51
I`ll try this Mnemonix, it looks easier to do than Sepnon`s suggestion.

Where there is a will, there is a way.
I often edit my posts, that`s who i am
Sepnon
16
Years of Service
User Offline
Joined: 7th Feb 2010
Location: Brazil
Posted: 7th Jun 2010 19:57
lol
but if you minimize it and use another fullscreen app it will give the same error.
it's not that hard.. try it
=PRoF=
23
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 7th Jun 2010 20:08 Edited at: 7th Jun 2010 21:43
With Windows 7 and Vista, the UAC requesters will also trigger the buffer flush thing.

Sepnon
16
Years of Service
User Offline
Joined: 7th Feb 2010
Location: Brazil
Posted: 7th Jun 2010 20:16
hmm.. but its a DX problem or dbp's?
btw prof, can you please check if screen invalid 'detects' those requests too?
Math89
22
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 7th Jun 2010 21:15
I would say it's more DBPro than DirectX (even though the buffer flush is caused by directx), because it should recover the textures and models automatically. Since DBPro keeps all the meshes in memory, I don't see any reason why it can't reupload them to the GPU every time the graphics device is lost.
=PRoF=
23
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 7th Jun 2010 21:42 Edited at: 7th Jun 2010 21:46
I just ran some quick tests and I remember why I opted for the object exist() method over the screen invalid() one.

It's because screen invalid returns true for many things, including clicking outside the window and then back on, minimising, maximising, etc.

Here's the code I used to test with alt-tabbing and also with the UAC enabled, (and yes, it does cause graphics to be lost)





>edit<

@Sepnon:
I will look into using memblocks in this way, good suggestion

Sepnon
16
Years of Service
User Offline
Joined: 7th Feb 2010
Location: Brazil
Posted: 7th Jun 2010 22:18 Edited at: 7th Jun 2010 22:18
Quote: "I would say it's more DBPro than DirectX (even though the buffer flush is caused by directx), because it should recover the textures and models automatically. Since DBPro keeps all the meshes in memory, I don't see any reason why it can't reupload them to the GPU every time the graphics device is lost. "


that doesnt look hard to do.. Why not adding that on update 7.5?

@Prof: nice, thanks .. but using object exist is a workaround, i dont like them :x
tiresius
23
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 7th Jun 2010 23:14
How does this work if you dynamically allocate image numbers with a GetFreeImage() function or whatever ?


A 3D marble platformer using Newton physics.
Sepnon
16
Years of Service
User Offline
Joined: 7th Feb 2010
Location: Brazil
Posted: 8th Jun 2010 00:42 Edited at: 8th Jun 2010 00:43
memblocks? bah, it's easy

convert any image to memblock and then back to image with the commands:



you can do that with sounds, images, meshes, bitmaps and arrays
And when converted to memblocks, you can edit them
search the forums.
Brendy boy
21
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 8th Jun 2010 00:49
Quote: "btw, reloading? i prefer saving objects and images on memblocks, they are not lost when alt-tabbing"

yes, but you can't convert object to memblock only meshes. To do that you need to convert object to mesh->by doing that you lose all texture data, limb data of an object -> so it isn't very good solution for objects, and also converting mesh to memblock converts the mesh to vertexdata only format which is slower for rendering

Sepnon
16
Years of Service
User Offline
Joined: 7th Feb 2010
Location: Brazil
Posted: 8th Jun 2010 01:26
1. Meshes are not lost when alt tabbing
2. Texture data? Images? Load them separatedly (that word exists in english? :x)
3. limb data.. well.. you got me x.x
Brendy boy
21
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 8th Jun 2010 01:39
Quote: "2. Texture data? Images? Load them separatedly (that word exists in english? :x)"

that would work for dbo objects, but if you have direct x objects with only one limb and multiple materials in wouldn't

Login to post a reply

Server time is: 2026-07-25 16:21:12
Your offset time is: 2026-07-25 16:21:12