sdl

Start with a scene graph engine or with opengl direct?

I am a professional developer working mostly with Java but on my spare time i like to play around with different languages and libraries. The thing is that i want to start learning how to develop 3D enabled applications or games. There are alot of engines out there but im afraid that by using those directly i will fail to learn the basic...

What is the best way to create a nested opengl canvas

I would like to write a library that draws some opengl on a given window handle. How can I initialize an opengl-context inside a given window? Is it possible to do that platform independent using SDL or some other library? ...

Game engine map editor. SDL->wxWidgets

I have been writing an OpenGL game engine for a while which uses SDL for all the window management and for portability. I would like to create a level editor using the full engine. The engine itself isn't at all tied in with SDL except for input. I would like to use wxWidgets for the GUI and I have been looking at some OpenGL samples whi...

what does this code mean?

this is some code that SDL requires in visual studios 2005 in order for my simple program to work. what is the code doing? the only reason i have it is because my instructor told me to put it in and never explained it. // what is this code doing? //--------------------------------------------------------- #ifdef WIN32 #pragma comment(li...

Unicode Input Handling in Games

This is a C++ SDL OpenGL question. Hello, I have a game that requires me to allow players to chat with each other via network. All is well, except the part where players can type in Unicode input. So, the question can be split into two parts: When players type, how do I capture input? I have done this before via the game input handl...

OpenGL absolute coordinates

I'm very new to creating games (and working in OpenGL in general). I'm trying to make a 2D game but have come upon a stumbling point when trying to get my head around collision detection. Lets say for example I translate the current matrix, the rotate and translate again and then draw a point. How do I know where that point is in relat...

SDL: Initializng TTF problems. Possibly freetype?

Edited: Look at comments below. Short version: Screen simply flashes when I try to run program. int main(int argc, char** args) { bool quit = false; std::ofstream out("error.txt"); if(init() == false) { return 1; } if (load_files() == false) { return 1; } // Render the text me...

Trying to make SDL widget in QT4 using SDL_WINDOWID, but can't get widget to show

Hi all! I'm trying to create an SDL drawing canvas inside of a simple QT4 window, following the information provided in the SDL wiki and in another question on this site. The project is an NES emulator using QT and SDL that a friend and I decided we wanted to try creating. Currently, I have a main_window class that will contain the SDL...

Dynamic texture loading in SDL

I´ve got problems with opening textures in SDL. I´ve got a function to read bmp files, optimize them and add colorkey: SDL_Surface* SDLStuff::LoadImage( char* FileName ) { printf( "Loading texture: \"%s\"\n", FileName ); SDL_Surface* loadedImage = 0; SDL_Surface* optimizedImage = 0; loadedImage = SDL_LoadBMP( FileName ); optimizedImag...

Member initialization of a data structure's members

I just ran into an awkward issue that has an easy fix, but not one that I enjoy doing. In my class's constructor I'm initializing the data members of a data member. Here is some code: class Button { private: // The attributes of the button SDL_Rect box; // The part of the button sprite sheet that will be shown SDL_Rect*...

Is there a faster and object orientated alternative to SDL for C++ ?

The current version of libsdl (1.2.x branch) is very, very slow with blending and per pixel alpha (as it uses software blending). Is there any other good alternative to it? ...

Java and SDL_GetKeyState()

I'm trying to convert to Java some code that uses SDL. I'm using the sdljava bindings. sdljava uses SWIG as the bridge between the C datatypes and Java. To get the equivalent of SDL_GetKeyState(), sdljava provides the method SWIG_SDLEvent.SDL_GetKeyState(), which returns something called a SWIGTYPE_p_unsigned_char. Of course, Java has...

code blocks 8.02 console program not outputting cout statements with SDL

im currently using the SDL-devel-1.2.13-mingw32 library in code blocks 8.02. with the mingw 5.1.6 installed separately on C:\ this program compiles and runs with no errors but i can't see the last system("pause"); on the screen. When i press any key, it of course skips over the system("pause"); then code blocks tells me that it successfu...

Stuck building a game engine

I'm trying to build a (simple) game engine using c++, SDL and OpenGL but I can't seem to figure out the next step. This is what I have so far... An engine object which controls the main game loop A scene renderer which will render the scene A stack of game states that can be pushed and popped Each state has a collection of actors and...

Reading in image files without specifying name

Are there any facilities in SDL or C++ that allow you to read image files in from a folder without specifying their name, like reading them in sequential order, etc.? If not are there any techniques you use to accomplish something along the same lines? Doing something like this: foo_ani[0] = LoadImage("Animations/foo1.png"); foo_ani[1]...

Using SDL on Android: can't compile because of missing "GLES_CM"

Hi. I'm trying to use OpenGL on Android using C. I'm following this excellent tutorial, but I've hit a wall. I'm using an ARM compiler (arm-none-linux-gnueabi-ld) on Linux Mint 7 (Ubuntu 9.04 branch). I can copy the compiled binary to the Android emulator just fine, it runs. But when I try to make it myself, I get the following error:...

C# and SDL - Does the end user need SDL installed?

I'm thinking about whether or not to try out SDL as an alternative to DirectX, seems I only create 2D games, however I can't find anywhere if SDL is required to be installed on the end users computer to play a game developed in C#, using SDL for the graphics. Does anyone know? ...

SDL_Mixer sound problems

Basic Info: Programming Language - C++ Platform - Windows Audio Formats - wav and mid I recently finished a game and was fooling around with figuring out the best way to upload it to a file hosting site. I eventually decided on using 7zip's self-extracting feature. However, I think the mistake I made was that instead of just copying ...

How can I clear a SDL_Surface to be replaced with another one?

Been trying to find this online for a while now. I have a SDL_Surface with some content (in one it's text, in another is a part of a sprite). Inside the game loop I get the data onto the screen fine. But then it loops again and it doesn't replace the old data but just writes over it. So in the case of the text, it becomes a mess. I've ...

SDL GL program terminates immediately

I'm using Dev-C++ 4.9.9.2 (don't ask why) and SDL 1.2.8. Next I've created new project: SDL&GL. This project contains already some code: #include <SDL/SDL.h> #include <gl/gl.h> int main(int argc, char *argv[]){ SDL_Event event; float theta = 0.0f; SDL_Init(SDL_INIT_VIDEO); SDL_SetVideoMode(600, 300, 0, SDL_OPENGL | SD...