ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

sdl.h

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef PLATFORM_SDL_H
00024 #define PLATFORM_SDL_H
00025 
00026 #include "backends/platform/sdl/sdl-sys.h"
00027 
00028 #include "backends/modular-backend.h"
00029 #include "backends/mixer/sdl/sdl-mixer.h"
00030 #include "backends/events/sdl/sdl-events.h"
00031 #include "backends/log/log.h"
00032 #include "backends/platform/sdl/sdl-window.h"
00033 // ResidualVM - Start
00034 #ifdef USE_OPENGL
00035 #include "backends/graphics/openglsdl/openglsdl-graphics.h"
00036 #endif
00037 // ResidualVM - End
00038 
00039 #include "common/array.h"
00040 
00044 class OSystem_SDL : public ModularBackend {
00045 public:
00046     OSystem_SDL();
00047     virtual ~OSystem_SDL();
00048 
00054     virtual void init();
00055 
00061     virtual SdlMixerManager *getMixerManager();
00062 
00063     virtual bool hasFeature(Feature f) override;
00064 
00065     // Override functions from ModularBackend and OSystem
00066     virtual void initBackend() override;
00067     virtual void engineInit() override;
00068     virtual void engineDone() override;
00069     virtual void quit() override;
00070     virtual void fatalError() override;
00071     Common::KeymapArray getGlobalKeymaps() override;
00072     Common::HardwareInputSet *getHardwareInputSet() override;
00073 
00074     // Logging
00075     virtual void logMessage(LogMessageType::Type type, const char *message) override;
00076 
00077     virtual Common::String getSystemLanguage() const override;
00078 
00079 #if SDL_VERSION_ATLEAST(2, 0, 0)
00080     // Clipboard
00081     virtual bool hasTextInClipboard() override;
00082     virtual Common::String getTextFromClipboard() override;
00083     virtual bool setTextInClipboard(const Common::String &text) override;
00084 #endif
00085 
00086     virtual void setWindowCaption(const char *caption) override;
00087     virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0) override;
00088     virtual uint32 getMillis(bool skipRecord = false) override;
00089     virtual void delayMillis(uint msecs) override;
00090     virtual void getTimeAndDate(TimeDate &td) const override;
00091     virtual Audio::Mixer *getMixer() override;
00092     virtual Common::TimerManager *getTimerManager() override;
00093     virtual Common::SaveFileManager *getSavefileManager() override;
00094 
00095     //Screenshots
00096     virtual Common::String getScreenshotsPath();
00097 
00098     // ResidualVM - Start
00099 #ifdef USE_OPENGL
00100     virtual void setupScreen(uint screenW, uint screenH, bool fullscreen, bool accel3d) override;
00101     Common::Array<uint> getSupportedAntiAliasingLevels() const;
00102 #endif
00103     virtual void launcherInitSize(uint w, uint h) override;
00104     // ResidualVM - End
00105 
00106 protected:
00107     bool _inited;
00108     bool _initedSDL;
00109 #ifdef USE_SDL_NET
00110     bool _initedSDLnet;
00111 #endif
00112 
00121     Common::String _logFilePath;
00122 
00127     SdlMixerManager *_mixerManager;
00128 
00132     SdlEventSource *_eventSource;
00133     Common::EventSource *_eventSourceWrapper;
00134 
00138     SdlWindow *_window;
00139 
00140     // ResidualVM specific code - start
00141 #ifdef USE_OPENGL
00142     // Graphics capabilities
00143     void detectFramebufferSupport();
00144     void detectAntiAliasingSupport();
00145     OpenGLSdlGraphicsManager::Capabilities _capabilities;
00146 #endif
00147     // End of ResidualVM specific code
00148 
00149     virtual Common::EventSource *getDefaultEventSource() override { return _eventSource; }
00150 
00154     virtual void initSDL();
00155 
00159     virtual AudioCDManager *createAudioCDManager();
00160 
00161     // Logging
00162     virtual Common::String getDefaultLogFileName() { return Common::String(); }
00163     virtual Common::WriteStream *createLogFile();
00164     Backends::Log::Log *_logger;
00165 
00166 #if 0 // ResidualVM - not used
00167 #ifdef USE_OPENGL
00168     typedef Common::Array<GraphicsMode> GraphicsModeArray;
00169     GraphicsModeArray _graphicsModes;
00170     Common::Array<int> _graphicsModeIds;
00171     int _graphicsMode;
00172     int _firstGLMode;
00173     int _defaultSDLMode;
00174     int _defaultGLMode;
00175 
00179     void setupGraphicsModes();
00180 
00181     virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const override;
00182     virtual int getDefaultGraphicsMode() const override;
00183     virtual bool setGraphicsMode(int mode) override;
00184     virtual int getGraphicsMode() const override;
00185 #endif
00186 #endif // ResidulVM
00187 protected:
00188     virtual char *convertEncoding(const char *to, const char *from, const char *string, size_t length) override;
00189 };
00190 
00191 #endif


Generated on Sat Aug 1 2020 05:01:05 for ResidualVM by doxygen 1.7.1
curved edge   curved edge