sdl

How to use SDL with OGRE?

不想你离开。 提交于 2019-12-19 19:46:37
问题 When I go to use OGRE with SDL (as described in this article), I seem to be having trouble with a second window that appears behind my main render window. Basically, the code I'm using is this: SDL_init(SDL_INIT_VIDEO); SDL_Surface *screen = SDL_SetVideoMode(640, 480, 0, SDL_OPENGL); Ogre::Root *root = new Ogre::Root(); root->restoreConfig(); root->initialise(false); Ogre::NameValuePairList windowSettings; windowSettings["currentGLContext"] = Ogre::String("True"); Ogre::RenderWindow *window =

How to set up gl3w on Windows?

本小妞迷上赌 提交于 2019-12-19 10:08:50
问题 I was looking for a detailed guide to setting up Gl3w, since there are none anywhere I look! 回答1: First of all, download gl3w at https://github.com/skaslev/gl3w Then, download Python 3.x: https://www.python.org/downloads/ Next, run the script. It'll generate gl3w.c in the source folder, and gl3w.h and glcorearb.h in the include/GL/ folder. Take the three of them, and either add them directly to your project, or (easier to do the includes), move them into your project's source files folder,

2D Platformer Collision Problems With Both Axes

允我心安 提交于 2019-12-19 07:49:27
问题 I'm working on a little 2D platformer/fighting game with C++ and SDL, and I'm having quite a bit of trouble with the collision detection. The levels are made up of an array of tiles, and I use a for loop to go through each one (I know it may not be the best way to do it, and I may need help with that too). For each side of the character, I move it one pixel in that direction and check for a collision (I also check to see if the character is moving in that direction). If there is a collision,

SDL.dll is missing from my computer - VS 2010

天大地大妈咪最大 提交于 2019-12-19 06:54:28
问题 I'm trying to compile a SDL-program I've written, but when I do, this error shows up: The program can't start because SDL.dll is missing from your computer. Try reinstalling the program to fix this problem I have no idea as to why. I have SDL.dll. I have put it in the correct folder: C:\Windows\System32 . I have the correct PATHS to all the SDL headers and such as well. VS says: Build succeeded: 1 and THEN the error above pops up on screen. 回答1: Add it into your debug folder or whatever

pyGame within a pyGTK application

删除回忆录丶 提交于 2019-12-19 05:51:24
问题 What is the best way to use PyGame (SDL) within a PyGTK application? I'm searching for a method that allows me to have a drawing area in the GTK window and at the same time being able to manage both GTK and SDL events. 回答1: I've never attempted it myself, but hearing plenty about other people who've tried, it's not a road you want to go down. There is the alternative of putting the gui in pygame itself. There are plenty of gui toolkits built specifically for pygame that you could use. Most of

Undefined reference to WinMain@16 when using SDL

↘锁芯ラ 提交于 2019-12-18 21:17:26
问题 I've been having a lot of trouble getting everything working so that I can start developing on Windows, as apposed to Linux, which is what I normally use when coding. I'm having a rather bizarre issue when trying to compile an SDL program. As soon as I include the SDL library, the program refuses to compile, giving me this error: c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../libmingw32.a<main.o>: In function 'main': C:\MinGW\msys\1.0\src\mingwrt/../mingw/main.c:73: undefined reference to

Decode audio and video and process both streams — ffmpeg, sdl, opencv

梦想的初衷 提交于 2019-12-18 17:27:12
问题 My goal is to proceed on audio and video of mpeg-2 file independently, and to keep synchronicity on both flows. Duration of video is about 1 or 2 minutes maximum. First, following this post "opencv for reading videos (and do the process),ffmpeg for audio , and SDL used to play both" sounds perfect. I have done some modification on the code considering recent ffmpeg naming changes. Compilation with cmake on 64-bits machine is fine. I get an error "Unsupported codec [3]" when opening codec. The

How can I modify pixels using SDL?

时光毁灭记忆、已成空白 提交于 2019-12-18 13:28:23
问题 I have a slight problem: I can't modify the pixels of an SDL screen. Specifically, the following code doesn't work. Uint32 * pixels = (Uint32 *) screen -> pixels; screen -> pixels = pixels; This compiles, but it doesn't show anything. What am I missing? 回答1: I had the following functions lying around for setting pixels in an SDL_Surface. There are two versions each for 32-bit, 24-bit, 16-bit and 8-bit surfaces. If you just want to set a single pixel, you would use the normal versions. But if

Rendering pixels from array of RGB values in SDL 1.2?

只谈情不闲聊 提交于 2019-12-18 08:59:33
问题 I'm working on a NES emulator right now and I'm having trouble figuring out how to render the pixels. I am using a 3 dimensional array to hold the RGB value of each pixel. The array definition looks like this for the 256 x 224 screen size: byte screenData[224][256][3]; For example, [0][0][0] holds the blue value, [0][0][1] holds the green values and [0][0][2] holds the red value of the pixel at screen position [0][0] . When the vblank flag goes high, I need to render the screen. When SDL goes

SDL 2.0: linking error

女生的网名这么多〃 提交于 2019-12-18 08:49:14
问题 I know that similar questions had been asked but none of the answers helped me... I wrote a simple SDL program: #include "SDL.h" int main( int argc, char* args[] ) { //Start SDL SDL_Init( SDL_INIT_EVERYTHING ); //Quit SDL SDL_Quit(); return 0; } using Code:Blocks. I followed this tutorial http://lazyfoo.net/SDL_tutorials/lesson01/windows/codeblocks/index.php but I still cannot compile. Here is the build log: mingw32-g++.exe -LC:\SDL\SDL2\lib\x86 -o bin\Debug\test.exe obj\Debug\test.o