sdl

How to compile SDL program and run it without DLL

倖福魔咒の 提交于 2019-12-06 07:20:20
is it possible to compile SDL library program into exec and run it without having "sdl.dll"? for example let say i wrote sdl program and it works and everything but the thing is to run the program on windows, i need to have "sdl.dll" within the same folder or system folder. is it possible to compile it so that i can just take the exec with me without needing to have "sdl.dll" along with it? i am using visual studio 2010 express. Typically the procedure for this kind of stuff is: Download the source code for the library. In SDL's case: http://www.libsdl.org/download-1.2.php . Build the library

How to create a color gradient in SDL

不想你离开。 提交于 2019-12-06 07:12:12
问题 SDL has no function like this, curious if anyone in the past has done it and wouldn't mind heading me in the right direction. I want to create a gradient between two colors to be reflected on the height of a rectangle. 回答1: Just make a loop over the desired y positions, in which you: Compute the desired color by interpolating between the gradient's endpoint colors. Call SDL_SetRenderDrawColor() to set the color. Call SDL_RenderDrawLine() to draw a horizontal line at the current y position.

no mouse-wheel event when shift key is down (shift+mouse-wheel events?)

守給你的承諾、 提交于 2019-12-06 04:37:14
问题 I'm trying to manage some events in lisp with lispbuilder-sdl . Thus far I got this. ;; Load package : (ql:quickload "lispbuilder-sdl") ;; main definition: (defun main (argv) (defparameter *ticks* 0) (sdl:with-init () (sdl:window 100 100 :title-caption "test") (sdl:with-events () (setf (sdl:frame-rate) 60) (:quit-event () (progn (sdl:quit-image) (exit) t)) (:mouse-button-down-event (:button button :x x :y y) (format t "~&LSHIFT: ~a RSHIFT: ~a BUTTON: ~a X: ~d Y: ~d" (sdl:get-key-state :sdl

Render TTF SDL2.0 opengl 3.1

回眸只為那壹抹淺笑 提交于 2019-12-06 03:31:04
I'm working with SDL2.0, and using a (semi modern) opengl (3.1). I'm looking to add a text overlay to my application, and to render TTF in the application. How would I go about this using modern OpenGL? EDIT: As per the suggestion of genpfault, I've tried using the SDL_TTF library, but All I'm getting is garbage on screen http://i.stack.imgur.com/FqyCT.png I've attached a gist of my shaders, which are very simple for this program, and also the snipped I'm using to load the text into surface, and to bind it to the texture. I'm not trying to do anything crazy here at all. Is there anything I'm

Move fullscreen window to secondary monitor with Win32/SDL

我们两清 提交于 2019-12-06 02:49:26
问题 I am using SDL 1.2.14, and I've found a case where I need to be able to select which monitor gets the fullscreen window. With Xorg, I found Xinerama could do the job using the SDL_VIDEO_FULLSCREEN_HEAD environment variable, however, I've been unable to find something similar for Win32. The fullscreen window is always created on the primary monitor, and since SDL 1.2 does not (SDL 1.3 can, but it's not stable) provide the API to select which monitor is to be used on Win32, I wonder if it's

How to convert an OpenCV IplImage to an SDL_Surface?

陌路散爱 提交于 2019-12-06 01:48:30
问题 I'm trying to write a program which takes an SDL_Surface , converts it to an IplImage , uses the cvBlobsLib to find blobs, paints the blobs as spots back over the image, then converts the output IplImage back to an SDL_Surface . I'm almost done: only converting the IplImage back to an SDL_Surface hasn't been done yet. This IplImage has 3 image channels and is 8 bits per pixel. I think I have two calls I can use: SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth,

How to avoid tearing with pygame on Linux/X11

╄→гoц情女王★ 提交于 2019-12-06 01:39:23
问题 I've been playing with pygame (on Debian/Lenny). It seems to work nicely, except for annoying tearing of blits (fullscreen or windowed mode). I'm using the default SDL X11 driver. Googling suggests that it's a known issue with SDL that X11 provides no vsync facility (even with a display created with FULLSCREEN|DOUBLEBUF|HWSURFACE flags), and I should use the "dga" driver instead. However, running SDL_VIDEODRIVER=dga ./mygame.py throws in pygame initialisation with pygame.error: No available

Trying to use pkg-config but it not being a registered command

三世轮回 提交于 2019-12-06 00:58:39
Ok so I've got my whole Go development environment up under Windows 8, also with MinGW. I'm using the LiteIde . C:/Go/bin/go.exe build [C:/Users/Alyx/Go/Hi] pkg-config --cflags sdl exec: "pkg-config": executable file not found in %PATH% Error: process exited with code 2. But then I get an error for "pkg-config" which at first I didn't have installed. (I'm trying to compile the SDL binding with a test that lists the fullscreen modes) Then I got it all set up in the C:\MinGW\Bin folder (pkg-config.exe and the extra dll's). But then it still wouldn't work. Went into CMD typed in its name "not

Maximize SDL window

[亡魂溺海] 提交于 2019-12-05 22:08:39
问题 How should I tell SDL to maximize the application window? I'm creating the window with these flags: SDL_OPENGL | SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_RESIZABLE. 回答1: This functionality is controlled by the window manager when you use the SDL_RESIZABLE flag. To simulate the maximizing a window with SDL you would need to first determine the size the window would occupy when maximized. Then you would call SDL_SetVideoMode with this size after placing the window with the SDL_VIDEO_WINDOW_POS

Is it possible to use SDL2 with smart pointers?

[亡魂溺海] 提交于 2019-12-05 21:22:23
I have this line of code //std::unique_ptr<SDL_Window> _window_; // this is somewhere else... _window_ = std::make_unique<SDL_Window>(SDL_CreateWindow("SDL Window", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, _WIDTH_, _HEIGHT_, SDL_WINDOW_SHOWN)); it produces the following compiler error In file included from /usr/include/c++/6/memory:81:0, from /home/user/prj/src/main.cpp:4: /usr/include/c++/6/bits/unique_ptr.h: In instantiation of ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = SDL_Window; _Args = {SDL_Window*}; typename std::_MakeUniq<_Tp>::_