Simple DirectMedia Layer (SDL) is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.
1
vote
4answers
342 views
How to run my game outside of visual c++
I am having trouble running my game. It works fine when I run it from Visual C++, but when I try to open the .exe, it complains that it can't find SDL.dll.
What should I do in order to play the game?
...
1
vote
1answer
653 views
Displaying a grid based map using C++ and sdl
I am trying to create a roguelike game using c++ and SDL. However, I am having trouble getting it to display the map, which is represented by a 2d array of a tile class.
Currently, my code is this:
...
0
votes
4answers
1k views
Problem trying to lock framerate at 60 FPS
I've written a simple class to limit the framerate of my current project.
But it does not work as it should. Here is the code:
void FpsCounter::Process()
{
deltaTime = ...
3
votes
3answers
1k views
Gamestate management without evil Singletons
I wanted to use a game state management system similiar to this approach: Managing Game States in C++
But from what I've heard singletons are evil and should not be used in 99.9%.
Can you tell me ...
0
votes
1answer
414 views
SDL and software/hardware rendering. How to go about it?
I know that SDL 1.2 does software rendering (CPU) and not hardware rendering (GPU). My question is, how do I use SDL but with hardware rendering? How do I not use its rendering API (software) and ...
0
votes
1answer
421 views
SDL mouse wheel not picking up
Running Ubuntu 11.04, SDL 1.2 trying to pickup mouse wheel up/down movement with this (stripped down) code:
int main( int argc, char **argv )
{
SDL_MouseButtonEvent *mousebutton = NULL;
...
0
votes
2answers
601 views
C++ and SDL resource management for 2D game
My first question is about stateManagers. I do not use the singleton pattern (read many random posts with various reasons not to use it), I have gameStateManager which runs the pointer ...
2
votes
1answer
251 views
Draw Bug 2D player Camera
EDIT *Along with the Palindromes helpful response, I found that my bug was because I was calculating the camera coordinates in terms of tiles instead of pixels which caused the irregular motion.*
I ...
2
votes
0answers
148 views
What is causing this behavior with the movement of Pong Ball in 2D? [closed]
//edit after running it through the debugger it turned out i had the display function set to x,x...TIL how to use a debugger
I've been trying to teach myself C++ SDL with the lazyfoo tutorial and ...
2
votes
2answers
927 views
How can I create a rectangular SDL surface filled with a particular color?
I'm learning SDL. I'd like to create rectangular surface filled with a flat color (not an image). Below is my code -- it compiles fine, but doesn't work.
I'm passing the function these parameters:
...
1
vote
1answer
257 views
Is SDL conducive to detailed 2D in-Game Animation and intricate particle effects?
Is SDL (when used CORRECTLY) conducive to detailed in-Game animation and displaying interesting high quality particle effects?
If my question seems too vague, at the other end of this link I have an ...
2
votes
1answer
521 views
Game class and main function
I have a Game class with my main game functions and instances of game objects like screen, etc. My game is made using C++ and SDL.
I was wondering, though, should main be a function of my class? Or ...
1
vote
2answers
458 views
Why do I get a segmentation fault on launch with this code?
I am currently writing a pong clone in C++ with SDL on top. Currently, I have hit a roadblock. If I add a new variable, my game won't launch, and will give "segmentation fault" in the debug terminal.
...
2
votes
3answers
855 views
OpenGL & SDL textures… game shuts down
I'm going to create a game in C++ with SDL & openGL but adding textures won't work.
the code is in some different classes.
here's the main file
...
0
votes
5answers
500 views
Is the way I remove objects causing a memory leak?
The game I'm working on consumes memory, and the memory used in megabytes increases around 2MB every 4 seconds.
It starts at 5MB and grows to hundreds of megabytes in minutes.
I was careful, and ...
0
votes
1answer
1k views
SDL, SFML, OpenGL, or just move to Java [closed]
I recently started a new project, and I'm wondering if I should change the technology now before it's too late.
I'm using SDL with C++, I have around 6 classes, and the game is going alright, but I ...
1
vote
1answer
321 views
Why does my 2d collision and movement not work properly?
I'm trying to write(in c++ using sdl) a mario like game as in a tile based world with by pixel movement for the character and I've run into some problems I cannot seem to find the source of:
1.The ...
5
votes
4answers
8k views
Wavefront *.obj loader in C++
I'm creating a game using OpenGL (via SDL) and C++ (via Visual Studios 2010 Professional). During the game, I will be using 3D character animation. I'd like to use wavefront *.obj files for all the 3D ...
2
votes
1answer
529 views
SDL and OpenGL resize window event question
So basically my question is im making a 2D game with openGL and SDL.
So what im trying to do is resize the game and have the openGL quad scale to the size my window becomes.
void CApp::OnResize(int ...
2
votes
1answer
345 views
Positioning a 2D image after rotation
Using SDL_gfx's rotozoomSurface function to rotate a 38x58 sprite....naturally when it rotates it creates a new surface with a new size, and the rotation isn't going around the center point. I am ...
0
votes
1answer
482 views
What's wrong my code to create a GL texture from an SDL_Surface?
I have an issue here with converting an existing SDL_Surface into an OpenGL texture.
The texture gets created, but it's a plain white texture, below is a screenshot of the result:
It seems to me ...
3
votes
1answer
507 views
What are the performance implications of multiple windows with indivdual OpenGL contexts?
For an engine I'm developing I've decided to allow users to set up multiple windows showing differing views of the same "world." This is being developed using OpenGL (hopefully aiming for 3.2 core ...
2
votes
1answer
776 views
C++/SDL Getting Multiple Bullets On-Screen
I've finally gotten this laser thing to work for my Space Shooter, and so far I've come across a slight problem. I've gotten the laser to position itself at the starting position correctly and move ...
0
votes
1answer
497 views
Will using OpenGL for rendering with SDL make my 2D game run smoother?
I've been working on a 2D game using SDL. I've noticed the objects look blurry and glitchy when they're moving, so I was thinking about using OpenGL to render the graphics. Would this help? What ...
9
votes
1answer
531 views
Why does V8 not run with SDL threads?
i was able to compile and link V8 against my game and code interpretation works fine. However I want to divide my code and the game loop should exist in one thread and the scripting engine should run ...
3
votes
1answer
79 views
What does `FPSManager.lastticks` stand for in SDL_gfx?
I'm having trouble finding documentation on SDL_gfx, and I can't figure this out. I've managed to use SDL_gfx to automatically cap the framerate, and I it's working a lot better than my manual attempt ...
0
votes
0answers
161 views
SDL 1.3 and extension libraries for VC++ 2010 express
Ive been able to compile SDL1.3 libraries with VC++ 2010 express. But im having a bit of trouble trying to compile the updated HG Mercurial repositories with VC2010++.
The problem comes from the fact ...
5
votes
2answers
1k views
How should I manage level progression?
In my code, I just have a Level class right now in the main game loop that just blits a background and spawns some enemies for testing purposes...But I can't figure out how to go about implementing ...
2
votes
3answers
1k views
Question About An Implementation Of Parallax Scrolling In C++/SDL/OpenGL
I been working in a project with a team for a Software Engineering class and we think that using the parallax scrolling will help our game to look really nice but we are not really sure if our idea ...
2
votes
1answer
618 views
Platformer collision detection problems
I'm having a few problems with collision detection in my game (written in C# with SDL.Net). Detecting the floor and roof is fine, as does detecting sides of tiles when not jumping/falling. My problem ...
0
votes
1answer
450 views
How do I install SDL.NET in Visual Studio 2010? (Or any other .NET library)
I'm trying to get SDL.NET to work in Visual Studio 2010, but am really not sure how to go about installing the library (or creating a custom project or something), and any basic instructions would be ...
1
vote
5answers
903 views
OpenGL Performance Questions
This subject, as with any optimisation problem, gets hit on a lot, but I just couldn't find what I (think) I want.
A lot of tutorials, and even SO questions have similar tips; generally covering:
...
1
vote
0answers
76 views
reflection not being drawn [closed]
I am using stencil buffer to render reflections in my scene.I am using SDL and opengl and am using the Ubuntu environment.I get a value of 8 when I try to get the buffer size for stencil buffer so it ...
0
votes
0answers
195 views
sdl stencil buffer [closed]
I am trying to use the stencil buffer for rendering reflection and am working with SDL and OpenGL.
When I give the command SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE,8),I get a return value of 0 ...
0
votes
2answers
494 views
What graphics library should I use for line rendering for a raycasting renderer?
I want to develop simple RPG with ray casting rendering. I chose SDL for graphics and input. The problem is there is no native line drawing in it, which I need to start prototyping a ray casting ...
3
votes
1answer
399 views
OpenGL textures loaded with SDL_Image display with no alpha
I am making a game using OpenGL, with SDL_Image employed to load the textures. When drawn on screen, there's no alpha -- in an exact square around the opaque contents of the texture, black is drawn; ...
2
votes
2answers
842 views
Problem With Smooth Animation In C++/SDL/OpenGL
I been working in the animation of a 2D platformer game in C++/SDL/OpenGL, and my team and I reach the point where we need to establish that every animation of the player (Walking, Running, etc..) ...
3
votes
5answers
1k views
Does SFML support these specific features that I require?
I've been working on a game in c++ for about a week and a half, and I've been using SDL. However, my current engine only needs the following from whatever library I use:
enable double buffering
load ...
1
vote
3answers
668 views
How does one make a 3D background in a 2D game?
I am trying to figure out how to make a background that looks 3D in a game that is 2D.
Below there is a video of the game "Under The Lotus." I am trying to get a background with similar effect (it ...
4
votes
2answers
1k views
Integrate LibRocket With SDL And OpenGL
I been currently involved in a game project and we reach the point we're want to added the GUI for menus and other stuff but the time that we maybe spent developing our own system could cost us a bit ...
2
votes
1answer
629 views
Question About Scrolling A Tilemap In C++/SDL/OpenGL
I been working with scrolling this week but I recently encounter a problem that I don't understand why it's happening.
In a 2D scroller I want to scroll a tilemap pixel per pixel which gives a smooth ...
20
votes
3answers
744 views
Multi-platform multi-threading: What are the real challenges?
While a library like SDL provides a cross-platform wrapper API for threading, I think it would be naive to assume that this leads directly to easy development of games across vastly different ...
-1
votes
1answer
1k views
What is the best engine for my first serious 2d game? [closed]
What game engine/graphics engine should I use for my first indie game?
I'd like to add that this is not my first game, I've previously used Allegro for 2d development (pong, chess and stuff).
I am ...
3
votes
1answer
1k views
Setting up OpenGL 3.3 in SDL 1.2
I've been using SDL 1.2.14 for awhile without using many of the features from newer OpenGL versions. I'm now interested working only with the 3.3 API (not using the deprecated functions, etc... that's ...
2
votes
1answer
880 views
SDL (or OpenGL), HTML5, Gecko and vector movies
I'm writing a platform game which uses SDL for the main graphics code. There is a chance that I may be using OpenGL for the rendering at a later stage, so answers could relate to either.
I'm needing ...
-7
votes
1answer
966 views
Alternative to C# and XNA? [closed]
I'm interested in Game Development, I know OOP programming and so, but I never used a Stable Language.
My favourite language is Java, but people say that is not a good Game Language, since it can be ...
8
votes
1answer
742 views
Separating logic/update from render/drawing code in a single thread using sleep
I've read that the speed of game objects should not be hindered by FPS but instead should be based on time. How can I seperate the update/draw code to maximize performance without limiting the drawing ...
2
votes
2answers
191 views
Working towards going 3D
I am a beginner-intermediate C++/Java programmer and my long term goal is to be a game programmer.
I have decided to start off with 2D and work my way towards 3D.
I would like to use SDL to start ...
3
votes
7answers
3k views
OpenGL Insanely Slow
I'm learning C++, and I'm writing my first OpenGL program. Unfortunately, it seems to be defaulting to Software Rendering (CPU uses bounces, GPU uses stays at 1%). I'm using SDL as the Windowing ...
8
votes
1answer
807 views
Getting OpenGL hardware acceleration with SDL on Linux
I'm trying to use SDL + OpenGL but I don't believe hardware acceleration is working because the framerate for around 18000 polys is about 24fps on a quad core machine but is a hopeless 1-2fps on an ...