aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/platform/sdl/sdl.h12
-rw-r--r--common/system.h8
2 files changed, 19 insertions, 1 deletions
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index b36139f24b..b788022d57 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -88,6 +88,18 @@ public:
// Game screen
virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; }
+
+ // Highest supported
+ virtual Graphics::PixelFormat getBestFormat() const {
+ //TODO scale down 16/32 bit based on hardware support
+#ifdef ENABLE_32BIT
+ return Graphics::PixelFormat(Graphics::kFormatRGBA8888);
+#elif defined ENABLE_16BIT
+ return Graphics::PixelFormat(Graphics::kFormatRGB565);
+#else
+ return Graphics::PixelFormat(Graphics::kFormatCLUT8);
+#endif
+ }
#endif
// Set the size of the video bitmap.
diff --git a/common/system.h b/common/system.h
index 81b86820df..b6e78474ca 100644
--- a/common/system.h
+++ b/common/system.h
@@ -360,10 +360,16 @@ public:
virtual void initFormat(Graphics::PixelFormat format) = 0;
/**
- * Returns the pixel format description of the screen.
+ * Returns the pixel format of the screen.
* @see Graphics::PixelFormat
*/
virtual Graphics::PixelFormat getScreenFormat() const = 0;
+
+ /**
+ * Returns the highest color pixel format supported by the backend
+ * @see Graphics::PixelFormat
+ */
+ virtual Graphics::PixelFormat getBestFormat() const = 0;
#endif
/**