PDA

View Full Version : How i can disable hardware acceleration?



Sanya
01-11-2001, 02:15 AM
Can i disable/enable hardware acceleration from my program?

Jan
01-11-2001, 05:01 AM
Well, I donīt really know, I never tried it because I donīt see a sense why doing it. However, you will have your own reasons. So here is my suggestion: If you create your glwindow under windows and do not use glut then you surely know that you have to setup a window a device context, bla bla bla...
Well, I remember that when you set up a window or the pixel format, you somewhere use a flag which tells windows to use OpenGL (I donīt know the name of the flag, but you will find it, because of its name). Try if the program still runs if you donīt use this flag. I am absolutely uncertain if it will, but it is worth a try, I think. However, if you just want to test how big the differences are between accelerated and not-accelerated programs you should look if there is such an option in your graphics-card-panel. I think some cards let you disable the acceleration.

I hope I could help you, but how I said, I am not sure if it is possible. In spite of this, I donīt know why one want to do this.

coco
01-11-2001, 05:37 AM
In theory, if when requesting a pixelformat in win32 that has the PFD_GENERIC_FORMAT and doesn't have the PFD_GENERIC_ACCELERATED should work.
For testing purposes, I switch my video color depth to 8bit to test if my code works in software, etc. It requieres that you manage palletes in win32 (which you can get out from sample code out there).

Kilam Malik
01-11-2001, 05:56 AM
Originally posted by coco:
In theory, if when requesting a pixelformat in win32 that has the PFD_GENERIC_FORMAT and doesn't have the PFD_GENERIC_ACCELERATED should work.


Search for a post by Eric on that. He has posted working source (I tried ;-)).

And Jan2000: There is sense in doing that. There are some cards which crash when calling certain OpenGL functions. If the user has such a card, he can choose software rendering.

Eric
01-11-2001, 06:44 AM
Hehe, I am glad it worked Kilam !

Here is the link:
http://www.opengl.org/discussion_boards/ubb/Forum2/HTML/001818.html

Regards.

Eric

outlander78
01-11-2001, 07:13 AM
Another option would be to use 8-bit colour, since few cards accelerate 8-bit colour modes these days. Granted, your stuck with only 256 colours, but depending on what you're testing this won't matter much, and it'll work on non-Win32 platforms as well.

coco
01-11-2001, 09:35 AM
outlander78:
Thats what I said, but remember that at least on windows your app should manage palettes so your opengl display makes any sense in 8bits.

eric:
well, I believe described the short version: use PFD_GENERIC_FORMAT instead PFD_GENERIC_ACCELERATED, and you implemented a fully working version with a lot of other functionalities.

outlander78
01-11-2001, 10:48 AM
Originally posted by coco:
outlander78:
Thats what I said, but remember that at least on windows your app should manage palettes so your opengl display makes any sense in 8bits.

Sorry about that. I only read as far as your use of constants before skimming on. I didn't mean to repeat you word for word!

coco
01-11-2001, 11:04 AM
Outlander:
Hey, I didnt mean to complain about anything, just wanted to point out that to use 8bit it's better to manage palettes, that's all. In fact, its cool to know that others do that ugly trick too!

Eric
01-11-2001, 10:54 PM
Originally posted by coco:
well, I believe described the short version[/B]

Hi Coco !

Actually, if the only thing you do is use PFD_GENERIC_FORMAT instead of PFD_GENERIC_ACCELERATED, you will most likely obtain an accelerated context anyway... I don't know why but it seems that the Win32 API call ChoosePixelFormat does not care about this flag !

A funny thing I found while writing this routine is that a software rendering context features the PFD_GENERIC_FORMAT and not the PFD_GENERIC_ACCELERATED (logical!). But an accelerated one features none of them (not even PFD_GENERIC_ACCELERATED !). Perhaps it is due to my drivers but I thought it was strange... Mind you, if the flag for "generic" is not there, it should mean that you are "accelerated" !

Regards.

Eric

coco
01-12-2001, 04:02 AM
Wow, so the Win32 api messed that one too. We have to learn not to trust 100% the Win32 documentation. It says:
"PFD_GENERIC_FORMAT:
The pixel format is supported by the GDI software implementation, which is also known as the generic implementation. If this bit is clear, the pixel format is supported by a device driver or hardware."
So you shouldn't be getting an accelerated context if this bit is set.

[This message has been edited by coco (edited 01-12-2001).]

Relic
01-12-2001, 04:26 AM
>>A funny thing I found while writing this routine is that a software rendering context features the PFD_GENERIC_FORMAT and not the PFD_GENERIC_ACCELERATED (logical!). But an accelerated one features none of them (not even PFD_GENERIC_ACCELERATED !). <<

IIRC, the PFD_GENERIC_ACCELERATED was used to distinguish Mini Client Drivers (MCD, not miniGL!) from full Installable Client Drivers (ICD).
Means the geometry and state calculations were SW (MCD server) and the rasterizer (MCD client) could be HW.

And yes, ChoosePixelFormat() is evil!!!


[This message has been edited by Relic (edited 01-12-2001).]

Eric
01-12-2001, 05:22 AM
Thanks Relic !

I learnt two things from your post:

1) The meaning of PFD_GENERIC_ACCELERATED.
2) IIRC = If I Remember/Recall Correctly.

(I spent 3 minutes trying to figure out the IIRC thing http://www.opengl.org/discussion_boards/ubb/smile.gif http://www.opengl.org/discussion_boards/ubb/smile.gif http://www.opengl.org/discussion_boards/ubb/smile.gif http://www.opengl.org/discussion_boards/ubb/smile.gif !)

Seriously, these flags are pretty confusing when you start using OpenGL ! Thanks for the info !!!

Regards.

Eric

Relic
01-15-2001, 05:17 AM
You're welcome. http://www.opengl.org/discussion_boards/ubb/wink.gif
Found this: http://info.astrian.net/jargon/


[This message has been edited by Relic (edited 01-15-2001).]