Skip to main content
Share Your Experience: Take the 2024 Developer Survey
42 votes
Accepted

What advantage do OpenGL, SFML and SDL have over software rendering?

It's not just about speed of execution, but also about simplicity. Although the software rendering used in this example would be a lot slower than using hardware acceleration (i.e. a GPU), drawing a ...
Richard Greenlees's user avatar
25 votes

What advantage do OpenGL, SFML and SDL have over software rendering?

My question is: why even bother using something like open gl, sfml, sdl when all you have to do is simply allocate some buffer, pass a bitmap and draw it to the screen? Short: Because its fast (...
tkausl's user avatar
  • 1,860
11 votes

How to use SDL_TTF's outlines

You can acheive what you want by drawing the text with an outline in one color, and then drawing it without outline on top of that, in another color. Here's an example of white text with a black ...
user3533716's user avatar
11 votes

What advantage do OpenGL, SFML and SDL have over software rendering?

What he does is called software rendering, what OpenGL does is called GPU rendering What's the difference between them? Speed and memory. Rasterization (filling out triangles on screen) takes some ...
Bálint's user avatar
  • 14.9k
8 votes

What advantage do OpenGL, SFML and SDL have over software rendering?

While the answers from others are more correct than any answer I could give, I want to point out the fundamental misunderstanding about how software development works that I think underlies your ...
egherrmann's user avatar
7 votes
Accepted

Game Loop getting 58-62 FPS. Why not exactly 60FPS? (SDL/C++/OSX)

SDL_Delay() doesn't really have fidelity of any sort; it puts your main thread to sleep, and once your thread is sleeping it's up to the OS to decide when to wake ...
Trevor Powell's user avatar
6 votes

SDL Function for Loading PNGs

SDL 2 SDL_image minimal runnable example main.c ...
Ciro Santilli OurBigBook.com's user avatar
6 votes
Accepted

How to set up OpenGL for CLion on Windows

Use a CMakeLists.txt file. It would look something like this. ...
Andreas's user avatar
  • 405
6 votes

How do I handle a lot of big textures for a visual novel?

There are couple of things you can do, if you haven't already: Use texture compression to decrease memory footprint. OpenGL supports this out of the box nowdays. Don't use 32 bit textures. Sometimes ...
Lasse's user avatar
  • 3,241
5 votes

Fast texture pixel access using SDL2

SDL2's "texture" rendering API is designed for accelerated graphics in mind; this is where you upload textures to your graphics hardware beforehand, and then render that texture by referring to it. ...
congusbongus's user avatar
  • 14.8k
5 votes

How to calculate delta time with SDL?

They way I've gone about calculating the delta time has been via SDL_GetTicks(): ...
Salajouni's user avatar
  • 154
5 votes
Accepted

SDL2 mouse motion event keeps occurring

You're not checking the return value of SDL_PollEvent to see if there's a new event, which means that regardless of whether there is an event to handle, you're ...
wizzwizz4's user avatar
  • 165
4 votes
Accepted

Having issue's with a confusing access violation? - C , OpenGL 3.3+ , SDL 2.0+

void glShaderSource(GLuint shader, GLsizei count, const GLchar **string, const GLint *length); Okay, I guess you didn't understand what these values ...
Antoine Morrier's user avatar
4 votes

What is the difference between OpenGL, SDL, DirectX, GLFW, GLUE?

Both OpenGL and DirectX are APIs. They serve as an interface between the GPU and the programming language. GLFW, GLUE, and SDL (not SLD) are both frameworks with different goals. GLFW and GLUE is just ...
Bálint's user avatar
  • 14.9k
3 votes

What advantage do OpenGL, SFML and SDL have over software rendering?

The above answers are excellent, but none really goes over the most important reason as to why OpenGL and such are preferred. The main reason is to make use of dedicated hardware designed especially ...
Aiman Al-Eryani's user avatar
3 votes

What advantage do OpenGL, SFML and SDL have over software rendering?

Engines do much more that just draw a picture to the screen. They handle lighting, shadows, input , collision detection. Even just the rendering part is way more complex than just pushing a buffer ...
Uri Popov's user avatar
  • 3,027
3 votes
Accepted

C++ SDL Vector of Textures Storing NULL Objects

From what I can tell, the SDL_Texture* taken from textureList and stored in tx is NULL, and ...
Quentin's user avatar
  • 1,178
3 votes

SDL_RenderPresent is writing over the previous frame

To get past this, you might be able to use a texture buffer which you render to before rendering to the window. This is accomplished with creating a texture with ...
Ray C's user avatar
  • 273
3 votes
Accepted

SDL2 dragging a sprite with mouse

"Pressed" and "Released" are usually treated as events, rather than states. (ie. "Became Pressed" rather than "Is Still Pressed") So processing a drag can be as simple as: When the Pressed event ...
DMGregory's user avatar
  • 135k
3 votes

SDL/C++ Keyboard Input

You're mixing two methods of input detection SDL provides. There is the event API which lets you get input via events, and there is the keyboard state API, which allows you to get the state of the ...
Gaxio's user avatar
  • 51
3 votes
Accepted

OpenGL draw functions and multi-threading. How they work together?

It is definitely possible and useful to make your rendering multithreaded, but it wouldn't work the way you've proposed. Keep in mind that with OpenGL, you're drawing all the objects for a frame into ...
user1118321's user avatar
  • 2,632
3 votes
Accepted

C++ OpenGL texture warping

This looks like it could be an export issue. Some 3d modelling programs allow multiple uv co-ordinates per vertex. So if this is the case, you can map the three faces adjacent to that vertex with up ...
Jay's user avatar
  • 810
3 votes
Accepted

C++ Wrapper class for raw pointer to an SDL_Texture

Shared pointers make sense when you have unclear ownership and unclear lifespan; otherwise they're just a dead weight you're dragging around. For most games you want to have a defined build-up and ...
Jack Aidley's user avatar
  • 2,126

Only top scored, non community-wiki answers of a minimum length are eligible