bool SDLPlatform::notifyCursorIconSetup( const ConstString & _name, const FilePath & _path, const MemoryInterfacePtr & _buffer ) { PARAM_UNUSED(_name); PARAM_UNUSED(_path); PARAM_UNUSED(_buffer); return true; }
void SDLPlatform::notifyWindowModeChanged( const Resolution & _resolution, bool _fullscreen ) { PARAM_UNUSED(_resolution); PARAM_UNUSED(_fullscreen); // SDL can't toggle this without recreating the window! }
bool SDLPlatform::createDirectoryUserMusic( const WString & _path, const WString & _file, const void * _data, size_t _size ) { PARAM_UNUSED(_path); PARAM_UNUSED(_file); PARAM_UNUSED(_data); PARAM_UNUSED(_size); return false; }
SFPCMDevice* SFPCMDevice_Create(SFInt aFormat,SFInt aSamplesPerSec,SFInt aBit,SFInt aChannel) { PARAM_UNUSED(aFormat); PARAM_UNUSED(aSamplesPerSec); PARAM_UNUSED(aChannel); return &device; }
bool SDLPlatform::createWindow( uint32_t _icon, const Menge::WString & _projectTitle, const Resolution & _resolution, bool _fullscreen ) { PARAM_UNUSED(_icon); PARAM_UNUSED(_fullscreen); Menge::Char utf8Title[1024] = { 0 }; size_t utf8Size = 0; UNICODE_SERVICE( m_serviceProvider )->unicodeToUtf8(_projectTitle.c_str(), _projectTitle.size(), utf8Title, sizeof(utf8Title) - 1, &utf8Size); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1); Uint32 windowFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN; if( _fullscreen ) { windowFlags |= SDL_WINDOW_FULLSCREEN; } m_width = static_cast<int>(_resolution.getWidth()); m_height = static_cast<int>(_resolution.getHeight()); m_window = reinterpret_cast<WindowHandle>(SDL_CreateWindow(utf8Title, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, m_width, m_height, windowFlags)); if( m_window == nullptr ) { return false; } m_glContext = SDL_GL_CreateContext(reinterpret_cast<SDL_Window*>(m_window)); if( m_glContext == nullptr ) { SDL_DestroyWindow(reinterpret_cast<SDL_Window*>(m_window)); return false; } m_sdlInput->updateSurfaceResolution(static_cast<float>(m_width), static_cast<float>(m_height)); return true; }
/** * @brief 关闭设备 * @param aDevice - 创建的声音设备 */ void SFPCMDevice_Close(SFPCMDevice* aDevice) { PARAM_UNUSED(aDevice); if(u8_g_sound_playflag == 1) { u8_g_sound_playflag = 0; mdi_audio_stop_string(); } return; }
void SFPCMDevice_GetCurrentPosition(SFPCMDevice* self,SFUint32*pPlayCursor,SFUint32* pWriteCursor) { PARAM_UNUSED(self); if(pPlayCursor) { *pPlayCursor=(uint32)(pu8_g_sound_out_ptr-pu8_g_sound_bufstart); } if(pWriteCursor) { *pWriteCursor=(uint32)(pu8_g_sound_in_ptr-pu8_g_sound_bufstart); } }
/** * @brief 停止声音播放 * @param aDevice - 播放的设备 */ void SFPCMDevice_Stop(SFPCMDevice* aDevice) { PARAM_UNUSED(aDevice); if((MMI_PROFILE_SILENT == gactivatedprofile) || (MMI_PROFILE_MEETING == gactivatedprofile)) { return; } u8_g_sound_playflag = 0; mdi_audio_stop_string(); }
/** * @brief 开始播放指定的设备 * @param aDevice - 播放的设备 */ void SFPCMDevice_Start(SFPCMDevice* aDevice) { PARAM_UNUSED(aDevice); if((MMI_PROFILE_SILENT == gactivatedprofile) || (MMI_PROFILE_MEETING == gactivatedprofile)) { return; } u8_g_sound_playflag = 1; pu8_g_sound_bufstart = (U8 *)u8_g_sound_buffer; u32_g_sound_bufsize = SF_SOUND_BUFFER_SIZE; pu8_g_sound_in_ptr = pu8_g_sound_out_ptr = pu8_g_sound_bufstart; memset(pu8_g_sound_bufstart,0x0,u32_g_sound_bufsize); mdi_audio_play_string(pu8_g_sound_bufstart, u32_g_sound_bufsize, MDI_FORMAT_PCM_8K, DEVICE_AUDIO_PLAY_INFINITE, NULL, NULL); }
void SDLPlatform::onEvent( const ConstString & _event, const TMapParams & _params ) { PARAM_UNUSED(_event); PARAM_UNUSED(_params); }
void SDLPlatform::notifyVsyncChanged( bool _vsync ) { PARAM_UNUSED(_vsync); }
bool SDLPlatform::openUrlInDefaultBrowser( const WString & _url ) { PARAM_UNUSED(_url); return false; }
/** * @brief 获取设备的音量 * @param aDevice - 创建的声音设备 * @return 音量 */ SFInt SFPCMDevice_GetVolume(SFPCMDevice* aDevice) { PARAM_UNUSED(aDevice); return 0; }
/** * @brief 设置设备的音量 * @param aDevice - 创建的声音设备 * @param aVolume - 设置的音量 */ void SFPCMDevice_SetVolume(SFPCMDevice* aDevice,SFInt aVolume) { PARAM_UNUSED(aDevice); PARAM_UNUSED(aVolume); }