sdl

“winapifamily.h: No such file or directory” when compiling SDL in Code::Blocks

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am following along with the SDL2.0 tutorials by LazyFoo, using Code::Blocks 13.12. I have had no trouble getting SDL2 linked and running in VS2010 but have changed IDE and come across this error: winapifamily.h: No such file or directory I think everything is linked correctly. I have pointed the program to my SDL2 include and lib directories. Buildlog: (error is occuring in file: ..\include\SDL2\SDL_platform.h) === Build: Debug in SDL2_Setup (compiler: GNU GCC Compiler) === fatal error: winapifamily.h: No such file or directory === Build

Linker Errors from SDL2 in my project

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I used CMake and Code::Blocks to build SDL2 from source, and attempted to link my own project source to the following static libraries: libSDL2.a libSDL2main.a OpenGL32.lib These three libraries are contained within the directory known as %libdir% (I'm using Batch for the command). I obtained libSDL2 and libSDL2main from the Code::Blocks build. I obtained OpenGL32 from my Windows directory, although I found it long ago so I am unable to recall the exact location. I used the following command: g++ *.o -L%libDir% -lOpenGL32 -lSDL2main -lSDL -o

“undefined reference to `FT_Load_Glyph'” and other SDL2_ttf functions using CMAKE

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Using this CMAKE-file in Clion on Windows 10 (using MinGW 5.0): cmake_minimum_required(VERSION 3.3) project(ClionProjects) # configure the SDL (cf. "SDL2-2.0.3\i686-w64-mingw32\lib\pkgconfig\sdl2.pc") # C++ flags set(SDL2_Flags "-mwindows -Wl,--no-undefined -static-libgcc") # library paths set(SDL2_ROOT "C:/SDL2/i686-w64-mingw32") set(SDL2_Includes "${SDL2_ROOT}/include") set(SDL2_LibDir "${SDL2_ROOT}/lib") # imported targets for CMake (cf. https://cmake.org/Wiki/CMake/Tutorials/Exporting_and_Importing_Targets) add_library(SDL2 STATIC

SDL_GL_SwapBuffers() is intermittently slow

匿名 (未验证) 提交于 2019-12-03 02:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a sdl/opengl game I am working on for fun. I get a decent fps on average, but movement is really choppy because SDL_GL_SwapBuffers() will randomly take a crazy long amount of time to process. With textures loaded and written to the buffer sometimes it will take over 100ms! I cut out a lot of my code to try and figure out if it was something I did wrong but I haven't had much luck. When I run this bare bones program it will still block for up to 70ms at times. Main: // Don't forget to link to opengl32, glu32, SDL_image.lib // includes

Ubuntu 11.10: GCC/G++ won't link libraries

匿名 (未验证) 提交于 2019-12-03 02:24:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I went to compile a project of mine, which uses SDL, SDL_ttf, OpenAL, and GTK. All of which are outputting errors like the following: TxtFunc.cpp:(.text+0x61): undefined reference to `TTF_OpenFont' TxtFunc.cpp:(.text+0x8c): undefined reference to `TTF_RenderText_Solid' TxtFunc.cpp:(.text+0xf6): undefined reference to `SDL_UpperBlit' TxtFunc.cpp:(.text+0x108): undefined reference to `TTF_CloseFont' TxtFunc.cpp:(.text+0x114): undefined reference to `SDL_FreeSurface' for every library call. I am compiling with the following link options: sdl

SDL2.0 Alternative for SDL_Overlay

匿名 (未验证) 提交于 2019-12-03 01:55:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: So I've been trying to go through the following tutorial on ffmpeg: http://dranger.com/ffmpeg/tutorial02.html However, when I try to compile using gcc, I get the following output: root : /Users/ mbrodeur / Downloads / HACKATHON CONTENT / Tutorials -> gcc - o tutorial02 tutorial02 . c - lavutil - lavformat - lavcodec - lz - lavutil - lm - lswscale - D_THREAD_SAFE - lSDL2 tutorial02 . c : In function ‘ main ’: tutorial02 . c : 41 : error : ‘ SDL_Overlay ’ undeclared ( first use in this function ) tutorial02 . c : 41 : error : ( Each

“winapifamily.h: No such file or directory” when compiling SDL in Code::Blocks

匿名 (未验证) 提交于 2019-12-03 01:49:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am following along with the SDL2.0 tutorials by LazyFoo, using Code::Blocks 13.12. I have had no trouble getting SDL2 linked and running in VS2010 but have changed IDE and come across this error: winapifamily.h: No such file or directory I think everything is linked correctly. I have pointed the program to my SDL2 include and lib directories. Buildlog: (error is occuring in file: ..\include\SDL2\SDL_platform.h) === Build: Debug in SDL2_Setup (compiler: GNU GCC Compiler) === fatal error: winapifamily.h: No such file or directory === Build

undefined reference to WinMain@16 C++, SDL-2

匿名 (未验证) 提交于 2019-12-03 01:49:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've been getting the error undefined reference to WinMain@16 . To save space, here's a link to all the files currently in the project . At present, it shouldn't do much other than create a window, fill it in green and then draw a box in the corner, all the while tracking my mouse's position through the console. However, it won't build and I'm given the aforementioned error. My linker libraries are: glew32s libSDL2main mingw32 libSDL2 opengl32 glew32 I am using Codeblocks 13.12 with g++ following the C++11 ISO C++ language standard. My PC is

SDL - invalid texture error on SDL_DestroyTexture()

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm making a small "retro-style" 2D platformer game with SDL in C++. I figured that the best way to keep the game at a low resolution, while allowing people with different size monitors to stretch the game window to fit their setup, would be to render everything to a low-res texture and then render that texture to the whole window (with the window size/resolution set by the user). When I run this setup, the game works exactly as it should and renders fine (in both fullscreen and windowed modes). However, when I use SDL_DestroyTexture() to

Settting up SDL on Mac OS X Lion with XCode 4

匿名 (未验证) 提交于 2019-12-03 01:39:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've been trying to get a super simple SDL program to work. I'm using Mac OS X Lion. I've got SDL to work in Snow Leopard, but it doesn't seem to want to work in lion. So far I have this: #include #include "SDL/SDL.h" using namespace std; /* #ifdef main # undef main #endif */ int main( int argc, char* args[] ) { SDL_Surface* hello = NULL; SDL_Surface* screen = NULL; SDL_Init( SDL_INIT_EVERYTHING ); screen = SDL_SetVideoMode( 640, 480, 32, SDL_SWSURFACE ); hello = SDL_LoadBMP( "hello.bmp" ); SDL_BlitSurface( hello, NULL, screen, NULL ); SDL