sdl

Why does my custom component raise AVs in the IDE?

I'm trying to write a simple component that will allow you to embed one or more SDL rendering surfaces on a Delphi window, using the SDL 1.3 APIs. It will compile and install just fine, but when I try to use the component in the form designer, it raises AVs whenever I try to access its properties in the object inspector, save the form, ...

How to program a RPG game in C++ with SDL?

I want to know how to program a 2D RPG game in C++ with SDL. I searched, but I haven't found anything good. Many of the articles were too basic and didn't delve into anything practicical. Can anyone help give me some articles, free books or other resources so I can learn how to program a RPG using C++ and SDL? EDIT: I don't need do...

SDL/C++ OpenGL Program, how do I stop SDL from catching SIGINT

Hi I am using SDL for an OpenGL application, running on Linux. My problem is that SDL is catching SIGINT and ignoring it. This is a pain because I am developing through a screen session, and I can't kill the running program with CTRL-C (the program the computer is running on is connected to a projector and has no input devices). Is the...

Why does CreateDIBSection() fail when the window is offscreen?

I'm building a Delphi component to embed an SDL rendering surface on a VCL form. It works just fine as long as the form is on-screen at the moment that the SDL surface is created. Otherwise, it's not able to create any rendering textures. I traced into the SDL code and ended up with the following function call, which fails (returns NUL...

simple cross-platform c++ GUI console -- how to?

I'm writing a game and I'm wound up in needing a console for simple text input; filenames and simple values. Using SDL, my console looks the following at it's simplest: class Console { public: typedef std::list<String> InputList; enum Result { NOTHING = 0, ENTERED, ESCAPED }; static const String& GetInput() { return...

How to save an SDL surface to a PNG and get the colors right?

I wrote up a simple patch to add PNG-saving capabilities to the SDL_Image library. It almost works, too. Problem is, the colors come out all scrambled, and I don't know enough C to figure out what's wrong. Can anyone take a look at this and help me fix it up? Use case: Load a 256-color PNG image with IMG_LoadPNG_RW. Save it with IM...

Problem using pthread to utilize multiple cores

I'm doing a simple ray tracer in C++ using SDL for graphics and pthread for threading. And I have a problem making my program utilizing two cores, the threads work, they just don't drive both cores to 100%. To interface SDL I write directly to it's memory, SDL_Surface.pixels, so I assume that it can't be SDL locking me. My thread functi...

Extern compile error with SDL_Surface

I've been getting a compile error in Code::Block for an SDL_Surface variable. Strangely enough, this is the first time I have received this kind of error, as I have used this line of code previously and it has worked fine. One (of several with the same problem) sample line of code that causes this problem is: extern SDL_Surface *screen...

How do I use SDl_Threads properly?

I am new to threads,SDL and how graphic work in general. I've been looking through all of LazyFoo's SDL tutorials, and had helped me greatly. But in his tutorials about multi threading, he commented that you should never use video functions in separate threads, or might cause problem. I am curious how it should be done, as I still have a...

How can I make my mouse control the camera like a FPS using OpenGL/SDL?

I've created this basic 3D Demo using OpenGL/SDL. I handled the keyboard callback so I can "strafe" left and right using 'a' and 's' and move forward and backward using 's' and 'w'. However, I would like to now make it so I can control the direction my camera is "looking" based off my mouse movements. Just like in a FPS shooter when...

hardware buffering using SDL, question about how it works

I'm deciding to do my first game, its going to be simple but I want to use c++ and I chose SDL for my learning. So my question is about how the "buffers" are handled when writing code. I'll post my related code at the bottom. Ok, so basically the way I understand it is that SDL takes care of which buffer is actually being drawn to the s...

SDL_surface to OpenGL texture

Hey, I have this script to load a SDL_Surface and save it as a OpenGL texture: typedef GLuint texture; texture load_texture(std::string fname){ SDL_Surface *tex_surf = IMG_Load(fname.c_str()); if(!tex_surf){ return 0; } texture ret; glGenTextures(1, &ret); glBindTexture(GL_TEXTURE_2D, ret); glTexImage2D(GL_TEXTURE_2D, 0, 3, te...

Pygame cannot find include file "sdl.h"

I am trying to build a downloaded Python app on Windows that uses Pygame. I have installed Python 2.5 and Pygame 1.7.1. I am new to Python, but I just tried typing the name of the top level .py file on a Windows console command line. (I'm using Win XP Pro.) This is the message that I get. C:\Python25\include\pygame\pygame.h(68) : fa...

A bunch of questions about SDL

I'm starting a little RTS game with SDL and here are some questions: I work with small sprites, is there a way of displaying the screen x2 with scanlines ? I tried zooming it with rotozoom but it slows down the game and I would like to avoid scaling my sprites by hand. How can I switch between fullscreen and windowed while running ? I ...

How do I load an image using SDL and Xcode on OS X 10.5?

Edit: After using a bmp at toastie's suggestion, I'm still having problems loading the image: I'm using SDL and OpenGL with Xcode and I'm trying to load an image to use as a texture on a cube. The image is a 256x256 RBG jpeg. The image is in the same directory as all of my source code, and it's under the Resources folder in the Xcode pr...

I have an unintended delay in playing a Mix_Chunk

So I am trying to learn SDL and creating a small game. When the user presses the space bar, it should play a sound. This works, but the sound takes about .5 seconds to play... How would I fix this? I've checked the actual file to see if the delay was just part of it, and that turned out to not be the case. SDL with c++ on win vista. He...

Emacs crashes when I open a specific header file

I was digging through the header files for SDL in Linux when I tried to open the file from the SDL library called "SDL_opengl.h" in Emacs. For some reason, it always causes it to crash. It opens just fine in Vim and in gedit. Has anyone else had an issue with Emacs just plain refusing to open a particular file? What sort of things s...

Is there a better way to load in a big animation?

Maybe not really big, but a hundred frames or something. Is the only way to load it in by making an array and loading each image individually? load_image() is a function I made which loads the images and converts their BPP. expl[0] = load_image( "explode1.gif" ); expl[1] = load_image( "explode2.gif" ); expl[2] = load_image( "explode3.g...

How to install SDL library in Visual C++ 2008?

Hey, How to install SDL library in VISUAL C++ 2008? I I am looking for a tutorial how to install, but I found nothing good :(( please help me?, sorry for bad english. Thanks :)) ...

OpenGL v2.0 Shaders with Dev-C++ and SDL?

I was about to rebuild my library in Dev-C++, under Windows; however, the shader functionality I've added in the meantime is not supported, the compiler could not find the related functions (::glCreateShader(), ::glCreateProgram(), etc.) Digging around the internet and the Dev-C++ folder, I've found that the OpenGL implementation (gl.h)...