sdl

Undefined Reference to WinMain@16 When Compiling SDL_ttf?

给你一囗甜甜゛ 提交于 2019-12-11 08:24:42
问题 I am trying to compile SDL_ttf with MinGW and Code::Blocks. I have imported the MSVC Solution to Code::Blocks, There were three projects. SDL_ttf showfont glfont the SDL_ttf project compiled fine after adding the SDL headers to the path and linking with SDL.a . Now whenever I try to compile glfont or showfont I get: undefined reference to `WinMain@16` From the SDL FAQ I understood that this problem may occur when you do not link with SDLmain.a , so I linked with it, but I'm still getting the

sdl2 SDL_Quit() segmentation fault

我是研究僧i 提交于 2019-12-11 08:15:37
问题 I encounter a segmentation fault when calling SDL_Quit() with the following code: #include <SDL2/SDL.h> #include <stdio.h> const int SCREEN_WIDTH = 640; const int SCREEN_HEIGHT = 480; int init(){ return SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO); } void close(){ SDL_Quit(); return; } int main(int argc, char *argv[]) { if( init() < 0 ){ SDL_Log("Unable to initialize SDL: %s\n", SDL_GetError()); return 1; } SDL_Delay(1000); close(); return 0; } This is the gdb output: Breakpoint 1, main (argc=1,

can i use SDL-1.2.15 with SDL2-image extension?

倾然丶 夕夏残阳落幕 提交于 2019-12-11 06:57:04
问题 I have SDL version 1.2.15 install in code block-12.11 when i tries to use it with SDL2-image extension i ran into a certain problem .When i click 'run' a window pop up and vanishes instanly .I followed the instruction of installing the sdl2-image extension from this video http://lazyfoo.net/SDL_tutorials/lesson03/windows/codeblocks/index.php .Here is what i did i transfer all the files under lib in sdl2-image extension to lib folder of the codeblock istallation directory and all the files

How to create an NSTouchBar from an NSWindow object?

六月ゝ 毕业季﹏ 提交于 2019-12-11 05:57:41
问题 I'm trying to integrate touchbar support with an SDL application. I've gone into the objective c code in SDL and hacked directly into the SDLView code and gotten a working touchbar, but now I want to get the same functionality with the stock SDL2 library. SDL exposes the NSWindow object it creates and I think I can create a responder object with makeTouchBar and makeItemForIdentifier implemented, but I don't know how to "attach" it to the window. I think it would be a "responder chain" but I

SDL mouse events are not being handled quick enough

若如初见. 提交于 2019-12-11 05:38:43
问题 I've been playing around with SDL for a few days now, and while I think I got the hang of it, I've run into a small problem with the menu. More specifically, the buttons in the menu. They work flawlessly when the mouse isn't moving that fast, but when I speed it up a bit (moving the cursor between the buttons, constantly making the button redraw from "normal" sprite to "mouse-over sprite"), it lags behind, sometimes doesn't update at all and small bugs start appearing. This is all my code

how to load an image using sdl from memory (c++)

旧巷老猫 提交于 2019-12-11 03:58:04
问题 I have an image inside a std::vector<std::string> variable. I downloaded the image from a website using winhttp I successfully managed to write to file and displayed but now I want to display it directly from memory. How can I load it? I have tried this but it does not work: SDL_Surface *load_image(char * buff,int size) { SDL_RWops *rw = SDL_RWFromMem(buff,size ); SDL_Surface *temp = IMG_Load_RW(rw, 1); if (temp == NULL) { printf("IMG_Load_RW: %s\n", IMG_GetError()); system("pause"); exit(1);

Unable to run SDL program in Eclipse but able to do so in Windows Explorer

五迷三道 提交于 2019-12-11 03:57:10
问题 I have installed and set up SDL and managed to get a tutorial example to build (the tutorial code is from http://zamma.co.uk/setup-sdl2-eclipse-windows/) as a C++ Project in Eclipse. The problem is that when I try to run the application from Eclipse, the window doesn't appear, or perhaps it gets closed soon after appearing. Eclipse doesn't appear to show any errors. When I open the folder containing the executable in Windows Explorer and double-click on the application, it works; a window

Using Netbeans with Cygwin and SDL, including SDL.h creates strange error

Deadly 提交于 2019-12-11 03:45:35
问题 I've got Netbeans C/C++ set up, Cygwin installed, configured and running correctly. SDL was installed from the sources using the Cygwin terminal. I've confirmed that Cygwin, Netbeans and SDL are all running correctly, I can write and compile C++ projects just fine with Netbeans and Netbeans can see SDL without having to include any files or anything, it just works like the default libraries. #include <cstdlib> #include <sdl2/SDL.h> using namespace std; int main(int argc, char** argv) { return

Jittering when moving mouse

柔情痞子 提交于 2019-12-11 03:45:04
问题 I have an opengl program and I am using SDL for the window creating / event handling etc. Now, when I move the mouse to re-position the cameras yaw/pitch, I get a jittering image, with the old position flashing on the screen for a split second. Now i think this may be an issue with the way I re-position the mouse. I have it set back to the center of the screen at the end of the re-positioning. Here is the said code: void handleMouseMove(int mouseX, int mouseY) { GLfloat vertMouseSensitivity =

Combining SDL windows and GTK+ windows in the same program

蹲街弑〆低调 提交于 2019-12-11 03:36:10
问题 I'm creating and SDL program in which some functions open GTK+ windows. The main window is an SDL window and the GTK+ windows are mostly dialog boxes. The main() function opens the SDL window normally and has a while loop with SDL events like usually in SDL. Some SDL events call functions that open GTK+ windows like GTK+ windows usually are opened and that have the same structure as the main() has in a GTK+ program. All windows open as they should, the problem is about closing the GTK+