sdl

SDL in XCode 4.3.2 SDLMain.o undefined symbols

て烟熏妆下的殇ゞ 提交于 2019-12-10 17:31:29
问题 I have started trying to use SDL in Xcode 4.3.2 so I started up a Cocoa application for Mac OS X and connected all my frameworks : OpenGL, SDL etc. I don't have SDL_Image, SDL_Mixer etc. (Do I need these?) When I try to compile the project that just has SDLmain.h and SDLmain.m I get this error: Undefined symbols for architecture x86_64: "_SDL_main", referenced from: -[SDLMain applicationDidFinishLaunching:] in SDLMain.o ld: symbol(s) not found for architecture x86_64 clang: error: linker

How to set up SDL on XCODE 4?

南笙酒味 提交于 2019-12-10 17:12:20
问题 I'm having troubles with sample templates and overall installing of SDL on my Xcode 4. There are no tutorials and old templates just don't work! If anybody has Xcode 4 SDL templates, please share. EDIT: @Joshua Nozzi I tried opening template from old version of XCODE, 3.2 and it opened, but there were no files in the project and it said - base sdk missing. I tried adding SDL.framework but it didn't help! 回答1: I just pushed my working SDL test Xcode project as a public Github repository, so

How to send additional parameters to an SDL Thread?

▼魔方 西西 提交于 2019-12-10 16:49:46
问题 Yes, I know how to create an SDL thread. int myfunc(void* data) { //my code... } SDL_CreateThread* mythread=SDL_CreateThread(myfunc,NULL); But what if i want to do something like: int myfunc(void* data,int myparameter1,char myparameter2) { //my code... } SDL_CreateThread* mythread=SDL_CreateThread(myfunc,NULL,42,'c'); i.e how to create a thread for a function with more than one parameters (parameters excluding the usual 'void* data') If this is not possible can you suggest any method by which

Redirecting output in SDL 2

一曲冷凌霜 提交于 2019-12-10 15:17:43
问题 I'm using the SDL library in my project and I'm working on a Windows platform. When I'd decided to move my project to SDL 2, I encountered a problem: There was an option in SDL 1.2 to print output from stdout/stderr into the console window, rather than to files by defining a NO_STDIO_REDIRECT macro. However, I haven't found that macro in SDL 2. Is there a way to print SDL 2 output to the console instead of the standard files? 回答1: I suspect that NO_STDIO_REDIRECT is no longer part of SDL2.

How to rotate a rect in SDL2?

一世执手 提交于 2019-12-10 14:53:32
问题 I plan on making a game, and I want to create some background animations for said game. One of these animations is a rotating rectangle. I've looked all over, and I cannot find any form of math or logic that allows me to rotate a rectangle (SDL_Rect to be specific, but you might have already known that). I can't figure out the math for myself, I really don't have any working code for this, so I can't show anything. Essentially I'm looking for some type of logic that I can apply the rectangle

How to run ffplay as a window-less process?

点点圈 提交于 2019-12-10 14:15:49
问题 I am running ffplay as a background process which supplies image data to my main UI process. I have set " SDL_VIDEODRIVER = dummy " to suppress the ffplay video being shown in a SDL window. The issue is that the ffplay process still appears as an application window (dock, CMD+TAB entries etc.) even if the video output window is not displayed. How can I avoid that? 回答1: The option -nodisp worked fine for me (together with -autoexit ). Tested in a Ubuntu 18.04, ffmpeg 3.4.6: ffplay -f lavfi -i

C++ SDL on macosx without Xcode

天涯浪子 提交于 2019-12-10 13:58:50
问题 System: black Macbook running Mac os X 10.5.5 (Leopard) I want to compile an SDL hello-world application using only g++. Xcode is good for macintosh but I want cross-platform compatibility, so I won't use any of the coaca framework (no menus, no buttons, etc). Also, porting Xcode projects to other os's is not something that sounds fun. I downloaded and installed SDL into /Library/Frameworks. The big question is: what goes in the makefile (assuming just a helloWorld.cpp file in the source). I

Where is sdl-config installed on MacOS 10.6 (Snow Leopard)

僤鯓⒐⒋嵵緔 提交于 2019-12-10 13:32:10
问题 After installing SDL and SDL-devel in MacOS X 10.6 (Snow Leopard), trying to configure some source code that requires SDL yields: checking for sdl-config... no checking for SDL - version >= 1.2.0... no *** The sdl-config script installed by SDL could not be found *** If SDL was installed in PREFIX, make sure PREFIX/bin is in *** your path, or set the SDL_CONFIG environment variable to the *** full path to sdl-config. configure: error: *** SDL version 1.2.0 not found! Does anyone know where to

How can configuration tools like sdl-config be used with a cabalized project?

人走茶凉 提交于 2019-12-10 12:44:52
问题 I have a working SDL/Haskell application that I would like to build using Cabal instead of the current Makefile (because that is the "Haskell way"). The Makefile is itself very simple, and I was hoping that the default cabal build process could allow me to reconstruct a build command specified in my Makefile. The problem is that it makes use of "sdl-config", a utility that gives you all the necessary cc- compiler options: wrapper.o: SDLWrapper_stub.h ghc -no-hs-main `sdl-config --cflags`

CMake sdl-config

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 12:23:24
问题 Is there a way to use sdl-config in CMake? 回答1: Yes. Just use find_program() to find it and execute_process() to run it and capture its output. If you actually want to test for SDL and use it in your project, CMake comes with FindSDL.cmake , so you could just put find_package(SDL) in your CMakeLists.txt and then just access SDL_CFLAGS and so on directly. 来源: https://stackoverflow.com/questions/3792327/cmake-sdl-config