sdl

SDL-Mixer audio stops upon starting Reactive-Banana input loop

孤人 提交于 2020-01-14 22:51:33
问题 I've been working on a game that uses multiple audio tracks whose volumes are adjusted in realtime based on mouse motion. I'm using SDl-Mixer for audio, and Reactive-Banana for the game in general. The problem is that the tracks, which have all been started at the beginning, stop playing when the input-loop starts. The cause may be something else, but I wonder if there's some strange interaction between SDL and Reactive-Banana that I don't understand. I've been trying to puzzle this out for a

SDL-Mixer audio stops upon starting Reactive-Banana input loop

♀尐吖头ヾ 提交于 2020-01-14 22:51:27
问题 I've been working on a game that uses multiple audio tracks whose volumes are adjusted in realtime based on mouse motion. I'm using SDl-Mixer for audio, and Reactive-Banana for the game in general. The problem is that the tracks, which have all been started at the beginning, stop playing when the input-loop starts. The cause may be something else, but I wonder if there's some strange interaction between SDL and Reactive-Banana that I don't understand. I've been trying to puzzle this out for a

ffmpeg音视频学习(1)--使用SDL播放视频流

回眸只為那壹抹淺笑 提交于 2020-01-14 09:11:28
由于想要学习一下音视频的知识,所以想写博客记录一下学习历程,由于在学习ffmpeg的过程中,需要进行测试,而且对应音视频的渲染播放也应该有所了解,所以第一篇音视频博客打算先写一下关于SDL的使用。 1.开发环境 开发环境:vs2019社区版 语言:cpp SDL版本: SDL2.0.10 2.在VS工程中使用SDL 对于cpp来说,引入外部dll,只需要引入头文件,添加链接库lib就可以使用了。 但对于SDL来说,由于在SDL_main中,存在宏定义,导致了我们的main函数必须使用纯正风格的main函数 /** * \file SDL_main.h * * The application's main() function must be called with C linkage, * and should be declared like this: * \code * #ifdef __cplusplus * extern "C" * #endif * int main(int argc, char *argv[]) * { * } * \endcode */ # if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) # define main SDL_main # endif

How do I link SDL with Visual Studio 2019

a 夏天 提交于 2020-01-14 05:42:06
问题 I don't know how to link libraries with Visual Studio 2019 (I am using Windows 10), how do I link libraries? 回答1: I assume is the same as in VS 2017. Project / "your project name" Properties... / At Configuration select All Configurations Then Project / "your project name" Properties... / Configuration Properties / VC++ Directories / At Include Directories add path to your SDL include folder At Library Directories add path to your SDL lib folder ( lib/x86 or lib/x64 ) Then Project / "your

SDL/opengl multisampling not working

被刻印的时光 ゝ 提交于 2020-01-14 03:41:11
问题 I'm trying to do multisampling with SDL/opengl but SDL won't accept setting SDL_MULTISAMPLEBUFFERS and SDL_MULTISAMPLESAMPLES. Instead these are left at 0 and SDL_SetVideoMode() will fail afterwards. I know my hardware can do this pixel format with 4x multisampling. I'm running Ubuntu 10.10. Code: SDL_Init( SDL_INIT_VIDEO ); 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

C++ / SDL Debugging with console window

天大地大妈咪最大 提交于 2020-01-13 09:47:21
问题 I am playing around with some OpenGL, using SDL to handle the window / input etc. Currently I am displaying any information I want to see to a HUD. Well, this is getting over-cumbersome, and I was wondering if there is a simple way to open up a separate console window to report this information to me. I am still new to C++ so go easy on me if this is an obvious one. 回答1: In Linker -> System in your project's properties, check that the SubSystem is "Console (/SUBSYSTEM:CONSOLE)". That causes a

SDL2 How to position a window on a second monitor?

爷,独闯天下 提交于 2020-01-12 08:22:09
问题 I am using SDL_SetWindowPosition to position my window. Can I use this function to position my window on another monitor? UPDATE Using SDL_GetDisplayBounds will not return the correct monitor positions when the text size is changed in Windows 10. Any ideas how to fix this? 回答1: SDL2 uses a global screen space coordinate system. Each display device has its own bounds inside this coordinate space. The following example places a window on a second display device: // enumerate displays int

No SDL Keypress events being detected

别来无恙 提交于 2020-01-11 10:32:27
问题 I am completely stumped as to why this code does not get any SDL keypress events. The other SDL events (removed for clarity) work fine. It does not work on my XP or Vista machines. No compile/link errors, just never recieve a keydown event. #include "SDL/SDL.h" // Yes SDL.lib and SDLmain.lib are linked Uint32 TimeLeft(void) { static Uint32 next_time = 0; Uint32 now; now = SDL_GetTicks(); if ( next_time <= now ) { next_time = now + tickInterval; return 0; } return(next_time-now); } int main(

No SDL Keypress events being detected

痞子三分冷 提交于 2020-01-11 10:32:09
问题 I am completely stumped as to why this code does not get any SDL keypress events. The other SDL events (removed for clarity) work fine. It does not work on my XP or Vista machines. No compile/link errors, just never recieve a keydown event. #include "SDL/SDL.h" // Yes SDL.lib and SDLmain.lib are linked Uint32 TimeLeft(void) { static Uint32 next_time = 0; Uint32 now; now = SDL_GetTicks(); if ( next_time <= now ) { next_time = now + tickInterval; return 0; } return(next_time-now); } int main(

pygame on OSX Yosemite: unrecognized music format

99封情书 提交于 2020-01-07 09:25:14
问题 I'm playing around with Pygame on my Mac, running OSX Yosemite. I can't get it to play an MP3 file using the following code: pygame.mixer.music.load('bg_music.mp3') pygame.error: Unrecognized music format I'm using Python 2.7.1 and have the following libraries installed: sdl (brew): 1.2.15 sdl_mixer (brew): 1.2.12 libvorbis (brew): 1.3.4 pygame: 1.9.2a0 I've searched around and tried all the suggestions on this thread without success. Does anyone have any ideas how I can get this thing to