sdl

rectangle disappearing with SDL

So I'm simply trying to make a red 10 x 10 box move vertically back and forth. I compile and run my program and the red box appears starts moving down, then just disappears after it hits the edge of the screen. I used some cout << statements that tell me when the functions are being called and they are all being called when they are supp...

strange SDL memory usage depending on bits per pixel

I have a very simple SDL program that uses only 1MB of memory with 32 bits per pixel, 2.4MB with 24 bits per pixel, 1.9MB with 16 bits per pixel, and 1.4MB with 8 bits per pixel. what is with this strange memory usage? why does the most bits per pixel take up the least amount of memory? C++ GCC thanks ...

How to use SDL with OGRE?

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->restoreC...

SDL with Code::Blocks and Visual Studio 2008 VC++ Compiler

I've looked around on Google for tutorials on setting up SDL with it. The problem is that all the tutorials for linking to SDL with Code::Blocks is with the Mingw compiler, and never with VC++ 2008 Compiler. I have the SDL for VS downloaded at C:\SDL. The problem is, I can't get it to work with Code::Blocks. What do I need to do? I tri...

trying to install cabal package sdl-mpeg can't find include file smpeg.h

running "cabal install sdl-mpeg" $ ls -l /usr/include/smpeg/smpeg.h -rw-r--r-- 1 root root 7503 2008-11-05 18:07 /usr/include/smpeg/smpeg.h $ cabal install sdl-mpeg Resolving dependencies... Configuring SDL-mpeg-0.0.1... cabal: Missing dependency on a foreign library: * Missing header file: smpeg.h This problem can usually be solved b...

C++/SDL 'void*' is not a point-to-object type

Hello there, I'm new on C++ and I'm trying to make some testing with C++ and SDL and in SDL we have a function: SDL_TimerID SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param); which I can pass a callback for the timer created. But apparently it converts my instance this to *void so I can't retrieve it again on...

Compiling the cal3d demo "cally" (3d model library with boned animations)

Hi! I think this is a question about automake. http://home.gna.org/cal3d/ I'm struggling with the cally demo of Cal3D. The first problem I ran into was that the Cal3D code base is missing #include <cstring> and #include <memory> in a lot of places. Doing this every time I got an error in any source file in Cal3d was enough to let me ...

Why does valgrind say basic SDL program is leaking memory?

Here is the SDL program: #include <SDL/SDL.h> int main(int argc, char** argv){ SDL_Init(SDL_INIT_VIDEO); SDL_Surface* screen = SDL_SetVideoMode(640, 480, 16, SDL_HWSURFACE); SDL_Quit(); return 0; } Compiled with the command: g++ -o test test.cpp -lSDL And here is the output of valgrind: christian@christian-laptop:~/cpp...

Has Apple approved any SDL based iphone apps on the Appstore?

I'm looking to port an existing game of my own to from SDL 1.2 on linux SDL 1.3 on the iphone. While I'm fairly happy that SDL 1.3 provides the features I want I do not know if this will damage my chances off this getting accepted by apple. Has anyone had an SDL app accepted? If anyone has had one rejected, were the reasons due to SDL? ...

If I build and link an OpenGL application using only OpenGL ES 1.x calls, will it still work?

I am writing an OpenGL game which will hopefuflly be for both linux and iphoneOS, I basically want to be able to build using the OpenGL ES 1.5 headers and run it on my linux desktop. Can I do this? IE, I want to only use the subset of API calls common between OpenGL and OpenGL-ES. Doing the above and linking with normal libGL.a from my ...

Reading SDL_RWops from a std::istream

I'm quite surprised that Google didn't find a solution. I'm searching for a solution that allows SDL_RWops to be used with std::istream. SDL_RWops is the alternative mechanism for reading/writing data in SDL. Any links to sites that tackle the problem? An obvious solution would be to pre-read enough data to memory and then use SDL_RWF...

Mac OSX fullscreen application problem

My application uses SDL library. For enter to fullscreen mode I use SDL_SetVideoMode and appropriate flag - SDL_FULLSCREEN. Problem: When application is in fullscreen mode, I can't call "force quit" dialog and switching between other applications. After Cmd+Option+ESQ clicking my application is quit instead of "force quit" dialog is app...

Pygame integrated text editor

Hello, I am looking for an integrated pygame text editor, that is, something that can run in a pygame window without hijacking the event loop. I don't need anything fancy, just a basic editor. I have looked at pgu, and it is just barely ok, I am in the midst of modifying it to better suit my needs. Ocempgui is pretty cool, but seems a b...

Where is sdl-config installed on MacOS 10.6 (Snow Leopard)

After installing SDL and SDL-devel in MacOS X 10.6 (Snow Leopard), trying to configure some source code that requires SDL yields: checking for sdl-config... no checking for SDL - version >= 1.2.0... no *** The sdl-config script installed by SDL could not be found *** If SDL was installed in PREFIX, make sure PREFIX/bin is in *** your pa...

How to suppress console output in Python?

I'm using Pygame/SDL's joystick module to get input from a gamepad. Every time I call its get_hat() method it prints to the console. This is problematic since I use the console to help me debug and now it gets flooded with SDL_JoystickGetHat value:0: 60 times every second. Is there a way I can disable this? Either through an option in Py...

Inconsistent SDL/OpenGL results?

I have this little SDL/OpenGL game that I am working on. It runs great, but only on one computer. If I compile it and run it on my desktop, it just pops up a blank screen. If I run it on my netbook, it works just fine and I am able to see what I am trying to render. My question is: What could be causing these inconsistent rendering resul...

Switching between fullscreen and windowed in Mac OS X

I have a project in the works with OpenGL and SDL. Users have the option of using a full-screen or windowed mode for the display. I use SDL_SetVideoMode to set up the window, but this solution destroys the original SDL_Surface context (so all my OpenGL textures get cleaned too). How can I correctly switch between full-screen and window...

How to turn a SVG image to a SDL surface or an array of RGBA pixels with python?

I'm guessing it has to be done with the aid of some sort of framework. Google gives libCairo as the most common result, but that is way too many dependencies. I mean something that would work on Win/Lin/OSX, be non-GPL, python-compatible, freely re-distributable. And preferably a few hundred KB in size. Thing is, it doesn't even have t...

C++ Pac-Man : SDL or Qt ?

Hi everyone, I have to code a Pac-Man clone in C++ for a school project, and I'm hesitating between SDL and Qt for the graphical implementation. I have already a little experience with SDL, but I wanted to give Qt a try. I was asking myself if it is "technically" realisable and if Qt is a good choice for that. I know that it have an an...

Scaling sprites in SDL

Hi. How can i scale sprites in SDL? ...