sdl

Linker Error when using the SDL Library: _main already defined in main.obj

萝らか妹 提交于 2019-12-25 04:59:13
问题 So I already know why this error happens, inside the SDL_main.h file a 'main' macro is being created, which will cause problems with your actual main function. It's just that none of the obvious workarounds seem to be helping me. I have tried: Defining my main function with (int argc, char* argv[]). Tried it with C linkage like the comments in SDL_main.h suggest: * The application's main() function must be called with C linkage, * and should be declared like this: * \code * #ifdef __cplusplus

Runtime linking error with SDL_Mixer and SMPEG2 on Android

风格不统一 提交于 2019-12-25 04:42:32
问题 I managed to fix the previous linking problem I had with NDK which was caused by android api 21, and managed to get SDL_TTF built and working easily, but with SDL_Mixer I bumped into another runtime Unsatisfiedlinkererror where the app somehow can't link smpeg2 lib with SDL2_Mixer. This time I don't see how it could have anything to do with api-level and have tried everything I could come up with, gone through every makefile and triple-checked every version. I am using SDL_Mixer 2.0.0 and

Can't use SDL2 variables in Block scope

半腔热情 提交于 2019-12-24 20:33:15
问题 I'm programming with SDL2, but I cannot grasp the reason behind the following. This works: SDL_Window *window; SDL_Surface *screen_surface; SDL_Surface *picture; auto initWindow(void) {…} auto loadMedia(void) {…} auto close(void) {…} int main(void) { initWindow(); loadMedia(); … close(); } However this does not: auto initWindow(SDL_Window *window, SDL_Surface *screen_surface) {…} auto loadMedia(SDL_Surface *picture, std::string resource) {…} auto close(SDL_Window *window, SDL_Surface *picture

SDL window seemingly improperly being marked 'unresponsive' by OS

梦想的初衷 提交于 2019-12-24 18:08:03
问题 I have an SDL2 windowed window accessed via Derelict 3. It is supposed to strobe black and white (not because I hate epileptics), and it does this successfully. However, after a certain period of time, Ubuntu 13.10 marks the window as 'unresponsive', grays it out, and dulls the strobe effect. This is highly irritating and totally kills the effect required by the application for visual stimulation to retrieve SSVEP readings from my EEG headset. How do I get my OS to realize that the window is

Converting cv2 images to PySDL2 surfaces for blitting to screen

社会主义新天地 提交于 2019-12-24 14:32:10
问题 I'm using the new PySDL2 package, trying to interface it with my existing OpenCV code. I want to take an image captured from a webcam via the cv2 python interface to OpenCV and use PySDL2 to show it in a window on screen. I think I figured out how to convert the cv2 image format to a PySDL2 surface properly, but at the end of the code below, all I get is a black window. Any pointers on where I have gone awry would be greatly appreciated! #grab a frame from a webcam import cv2 vc = cv2

Invalid renderer SDL2

吃可爱长大的小学妹 提交于 2019-12-24 12:11:15
问题 I am looking through the code and i cant find solution for the problem of invalid renderer. I am beginner with SDL2 and i have to write code in pure C. I think that in my code there is more errors but because of this one i cant go further. Code is half in polish language so if u cant get what is where i can rewrite this a bit . Problem occure when in main i try to load function"Odczyt_z_Pliku". Probably somewhere there is a problem. SDL_GetError() says" invalid renderer. #include<SDL.h>

simple tcp echo program not working when SDL included?

我们两清 提交于 2019-12-24 10:56:48
问题 I have this weird problem where whenever I #include "SDL/SDL.h" , my windows socket program doesn't execute. It compiles but it doesn't do anything when run. When I remove the #include "SDL/SDL.h" header, compile and run, it starts working again??. I'm trying to make both SDL and my original socket program work but I don't understand whats wrong this. //#include "SDL/SDL.h" #define _WIN32_WINNT 0x501 #include <iostream> #include <windows.h> #include <winsock2.h> #include <ws2tcpip.h> #include

Segmentation fault initializing SDL2. What am I doing wrong with memory?

守給你的承諾、 提交于 2019-12-24 10:55:49
问题 This is just suppose to display a bmp image to the SDL window front buffer. I played around with the code. And I think there is something wrong with my init() function. I'm new to SDL. But there must be a problem with my pointers or something I'm missing about SDL's fucntions EDIT: I used GDB and it turned out my close() function was the problem. I believe it was because I was freeing memory that was set to NULL? I got rid of the close fucntion and just freed mem after my delay function.

Why can't my application receive UDP packets when the Windows Base Filtering Engine service is enabled?

我只是一个虾纸丫 提交于 2019-12-24 10:22:33
问题 Before starting, I just want to say that this situation works perfectly using TCP, without any problems - the issue is that I want to auto-detect devices on my network however, so I still need UDP to broadcast and detect devices over my network. I have a simple UDP broadcast/send/receive program running on my laptop and desktop, using UDP and SDL_Net, coded in C++. My desktop is running Linux, while my laptop is running Windows. The Linux machine can receive all UDP packets, while the Windows

SDL_Surface into GTK Window

匆匆过客 提交于 2019-12-24 07:47:18
问题 I'm currently making a project in my IT School and I work with SDL (The project is image processing and stuff like that), and currently I just display the image with SDL without interface (buttons etc...). I know a little bit about GTK so I want to know if I can display an image (here a SDL_Surface) into a GTK window I made some research but nothing was very clear... Thank you ! 回答1: Drawing widgets using SDL Drawing widgets(menu, buttons etc) using SDL drawing functions and handling actions