OpenGL win resized: enters SW mode; NOT GOOD!
So I''ve got an OpenGL window up and it is not fullscreen. The user can resize it. There comes a point where it is possible the window is to big for OpenGL to redraw it using hardware, so it reverts to software mode. The problem, of course, is the framerate turns from interactive to something like many seconds to redraw.
Anybody else attempted to deal with this problem? Is there a way to detect when the window will be too large for an interactive redraw BEFORE it happens so we prevent the window from being resized too large and essentially ''hanging'' the application for too long?
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
I don''t have a perfect solution, but if the screensize grows bigger, OGL needs a larger buffer. Maybe you can calculate the size of this buffer OGL needs, and check this with the memory on the card.
Is there a standard size for these things, or do they differ per card? I don''t have a clue, but maybe someone knows...
Is there a standard size for these things, or do they differ per card? I don''t have a clue, but maybe someone knows...
in the resizing code
check the new window size and if it exceeds the max for hardware acceleration eg 800x600x16 just only size it to 800x600.
note this problem will only occur with cards that dont have that much memory 8mb or less
http://members.xoom.com/myBollux
check the new window size and if it exceeds the max for hardware acceleration eg 800x600x16 just only size it to 800x600.
note this problem will only occur with cards that dont have that much memory 8mb or less
http://members.xoom.com/myBollux
I''m not sure about whether this would work nicely or not (I''ve never used OpenGL before) but when they resize, you could do a quick test to see if you are in SW mode, and if so, resize the window back to what it was previously, but store the size as a Maximum Width/Height sort of thing, and then disallow any more resizing above that.
That way it wouldn''t happen very much, but it is an ugly solution IMO.
(And on my computer, Software mode is faster than HW mode, so what would I know )
Trying is the first step towards failure.
That way it wouldn''t happen very much, but it is an ugly solution IMO.
(And on my computer, Software mode is faster than HW mode, so what would I know )
Trying is the first step towards failure.
Trying is the first step towards failure.
Okay, here''s an example. On my machine, I have a TNT 16MB card and it drives a 1600 x 1200 display for my desktop. Obviously I am consuming quite a bit of memory for display. If I run a OpenGL app in a 800 x 600 window, I get interactive rates. If I resize it to say about 1000 x 1000 or above, then I lose interactivity and it takes many many seconds to update the frame. I am assuming it has consumed more memory for the z buffer, etc. and must use software mode.
Now I know there must be machines out there with similar configurations, and it just seems like ''bad'' quality to let the user resize to a window that will hang it like this. Instead, it should limit the max size of the window, or let the user change the resolution settings of the display.
BTW, how do you detect if OpenGL is in SW or HW mode?
Now I know there must be machines out there with similar configurations, and it just seems like ''bad'' quality to let the user resize to a window that will hang it like this. Instead, it should limit the max size of the window, or let the user change the resolution settings of the display.
BTW, how do you detect if OpenGL is in SW or HW mode?
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
The driver is soemthing like windows GDI its in one of the nehe tutorials how to get the driver version but I cant remember which.
http://www.3dgamedev.com/resources/openglfaq.txt this has info on how to tell if you''re in software mode or not.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement