sdl-2

Can't install pygame_sdl2

故事扮演 提交于 2020-01-17 07:08:51
问题 I'm creating a tower defense game using python and pygame. I would like to add this one on the Google Play Store, but I need to create an apk file. I'm following a tutorial on GitHub: https://github.com/renpytom/rapt-pygame-example. I follow all the instructions but can't install pygame_sdl2 . I use the command prompt, and use $ python setup.py install in the appropriate directory. But it gave me this error : C:\Users\gomes\Downloads\pygame_sdl2-master>python setup.py install Traceback (most

Attempting to reference a deleted function (VS2013)

心已入冬 提交于 2020-01-16 02:51:09
问题 I'm trying to write a game of checkers in SDL. When I compile my code, I get this error: std::basic_ifstream>::basic_ifstream(conststd::basic_ifstream> &)' : attempting to reference a deleted function From what I can find on the web, this means that the compile has helpfully deleted my constructor for some reason, and now it can't find it again. (Bad organization if you ask me) Why could this be? Board.h: #include <fstream> class Board { public: SDL_Surface * boardSurface; int boardArray[8][8

undefined reference to 'WinMain' with SDL compiling in a native enviroment

拟墨画扇 提交于 2020-01-16 00:43:12
问题 I'm struggeling with my first steps in SDL. I wanted to compile a simple test class, just including the SDL2 header, nothing special for startup: main.cpp: #include <SDL.h> int main() { return 0; } main.cpp itself compiles fine: g++ -c main.cpp -ISDL/include but as soon as i want to link it with the SDL2.dll either with the machinecode main.o or directly, i'm getting this error: g++ main.cpp -o sdl_test -I SDL/include -L SDL/lib/x64 -l SDL2 -mwindows g++ -o test main.o -L SDL/lib/x64 -l SDL2

cannot open file 'SDL2.lib'

限于喜欢 提交于 2020-01-15 09:58:06
问题 I am trying to open sdl2 in my project on Visual C++ 2012 but i keep getting this error: error LNK1104: cannot open file 'SDL2.lib' I added the additional libraries and include folder but no luck.. I added the link to the libraries through the linker but i get the same error.. what should i do? 回答1: I'm referencing VS 2010, but I've read before that some people have had errors when using the VC++ Directories in their project properties as opposed to the Linker->General->Additional Library

Why does SDL freezes on changing & resuming focus?

牧云@^-^@ 提交于 2020-01-15 07:24:13
问题 We are using SDL-2.0.8 for UI in our application on Android. The application is a bit complex entity altogether & the issue we are facing is that the UI will freeze whenever the application looses focus & is resumed. The UI freezes on either of the below scenarios. If the settings drop-down is dragged (Just pull down the settings screen from the top). When the home button is pressed & the application is resumed. If the application is switched between an another application. When the

SDL2 empty transparent window in Linux

只谈情不闲聊 提交于 2020-01-15 05:54:26
问题 Here is some sample SDL2 code I tried to run on my Linux computer running Ubuntu 18.04 with KDE Plasma Desktop Environment (I have multiple desktop environments installed in case it is relevant): #include<iostream> #include<SDL2/SDL.h> int main(int argc, char** argv) { if(SDL_Init(SDL_INIT_VIDEO) != 0){ std::cerr << "SDL_Init() Error: " << SDL_GetError() << std::endl; return 1; } SDL_Window* win = SDL_CreateWindow( "Hello world", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640,480, 0 );

SDL2 empty transparent window in Linux

独自空忆成欢 提交于 2020-01-15 05:54:02
问题 Here is some sample SDL2 code I tried to run on my Linux computer running Ubuntu 18.04 with KDE Plasma Desktop Environment (I have multiple desktop environments installed in case it is relevant): #include<iostream> #include<SDL2/SDL.h> int main(int argc, char** argv) { if(SDL_Init(SDL_INIT_VIDEO) != 0){ std::cerr << "SDL_Init() Error: " << SDL_GetError() << std::endl; return 1; } SDL_Window* win = SDL_CreateWindow( "Hello world", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640,480, 0 );

How do I check for SDL2_ttf in CMakeLists.txt?

和自甴很熟 提交于 2020-01-13 19:55:10
问题 I am currently writing an SDL2 program with the SDL2-ttf library and wanted to add a check for it in CMakeLists.txt. How do I do that? I am using CMake 3.1. 回答1: FindSDL_ttf.cmake is part of cmake 3.x just use find_package(SDL_ttf REQUIRED) 回答2: The FindSDL_ttf doesn't work with SDL2, so you'll have to use a third party option. I've used this and it works: https://raw.githubusercontent.com/Deraen/ohj2710/master/cmake_modules/FindSDL2TTF.cmake Just put it in a directory included by set(CMAKE

How do I check for SDL2_ttf in CMakeLists.txt?

Deadly 提交于 2020-01-13 19:55:07
问题 I am currently writing an SDL2 program with the SDL2-ttf library and wanted to add a check for it in CMakeLists.txt. How do I do that? I am using CMake 3.1. 回答1: FindSDL_ttf.cmake is part of cmake 3.x just use find_package(SDL_ttf REQUIRED) 回答2: The FindSDL_ttf doesn't work with SDL2, so you'll have to use a third party option. I've used this and it works: https://raw.githubusercontent.com/Deraen/ohj2710/master/cmake_modules/FindSDL2TTF.cmake Just put it in a directory included by set(CMAKE

SDL2 on Raspberry Pi without X?

自古美人都是妖i 提交于 2020-01-13 19:52:27
问题 I'm hoping to develop some code that uses SDL2 to display graphics on the 7" RPi touchscreen, but I'd rather not install a full desktop OS. I've got Raspbian Buster Lite installed. Some simple test code gets an error when I try to run it: user@rpi4:~/01_hello_SDL $ ./hw Window could not be created! SDL_Error: Could not initialize EGL user@rpi4:~/01_hello_SDL $ sudo ./hw error: XDG_RUNTIME_DIR not set in the environment. Window could not be created! SDL_Error: Could not initialize EGL I'm