Another thing: Would it be better to determine the amount of videoRam when installing
wine
and storing it in the registry or checking at runtime when GetAvailableTextureMem is called?
I'd suggest to determine it in IWineD3D::CreateDevice and store it in the IWineD3DDeviceImpl class.
How does this script work with multiple graphics cards?
Parsing the X log file is way to hacky in my opinion to determine the amount of video memory. Depending on how many X servers you use it can be a different file. In case of nvidia videocards I would prefer to use the NV-CONTROL extension for X. (it is available on Linux/Solaris/FreeBSD) In other cases I would use the pci header of the videocard. A part of it contains what memory ranges are mapped and a part of it corresponds to the size which is mapped for the framebuffer. For instance 128MB on my system:
0000:01:00.0 VGA compatible controller: nVidia Corporation NV35 [GeForce FX 5900] (rev a1) (prog-if 00 [VGA]) Flags: bus master, 66MHz, medium devsel, latency 248, IRQ 11 Memory at de000000 (32-bit, non-prefetchable) [size=16M] Memory at d0000000 (32-bit, prefetchable) [size=128M] Expansion ROM at dfee0000 [disabled] [size=128K] Capabilities: <available only to root>
The only thing is that the pci header can't be thrusted in all cases but I would say it is a lot better than nothing.
Regards, Roderick