1
0
forked from 0ad/0ad

Removes mostly useless video memory detection, fixes another crash with Nvidia Optimus on Windows, fixes #2145, #2138

This was SVN commit r13891.
This commit is contained in:
historic_bruno 2013-09-22 18:07:33 +00:00
parent e488ed09f5
commit 2a613f8236
2 changed files with 8 additions and 6 deletions

View File

@ -92,12 +92,11 @@ std::wstring DriverInfo()
size_t MemorySizeMiB() size_t MemorySizeMiB()
{ {
#if SDL_VERSION_ATLEAST(2, 0, 0) // TODO: not implemented, SDL_GetVideoInfo only works on some platforms in SDL 1.2
// and no replacement is available in SDL2, and it can crash with Nvidia Optimus
// see http://trac.wildfiregames.com/ticket/2145
debug_warn(L"MemorySizeMiB not implemented");
return 0; return 0;
#else
// (maybe add the size of the framebuffer?)
return (SDL_GetVideoInfo()->video_mem) / 1048576; // [MiB]
#endif
} }
} // namespace gfx } // namespace gfx

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2010 Wildfire Games /* Copyright (c) 2013 Wildfire Games
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
@ -41,6 +41,9 @@ LIB_API std::wstring CardName();
**/ **/
LIB_API std::wstring DriverInfo(); LIB_API std::wstring DriverInfo();
/**
* not implemented
**/
LIB_API size_t MemorySizeMiB(); LIB_API size_t MemorySizeMiB();
/** /**