Sdl2 textures and opengl

My question is about the new feature in sdl2 for using textures. A couple of questions actually. On a Windows machine, is this handled by directx or opengl and I assume on Linux it’s opengl. The other question - I’m doing some development on a slow Celeron processor machine with Intel HD graphics. Is there a recommended use of SDL2 (compilation, configuration, etc.) for slower machines. I’m not a professional developer, so compiling SDL2 myself is out of the question at this time, but I’m interested to know about that, if it’s the way to go with this.


On Windows, yes, DirectX is typically the default, whereas on Linux it is typically OpenGL [1], assuming hardware acceleration is found for the platform. Additionally, you may request a different rendering backend with SDL_SetHint [2].

SDL does a good job of being a robust library, staying out of your way, abstracting platform-specific details where it makes sense, etc. and thus performance will depend largely on your own programming code and your platform?s method of handling details.

Naturally, understanding how DirectX && OpenGL interface with video hardware will not hurt
in understanding how to get the most out of your hardware, but not something you?ll learn overnight! :slight_smile: SDL?s abstraction can help ease those growing pains (among other things).

The SDL2 wiki?s ?migration guide? is a good starting point for you to start understanding how to best utilize video acceleration with SDL. Note that most all of the tips in the guide apply to performant rendering in general, just as most performance rendering tips will apply to SDL. Things like keeping texture uploads to the GPU to a minimum and rendering as few objects as necessary is generally enough.

You?ll be surprised at how much even a Intel HD Graphics card can handle, though ? I use one, too ? always focus on getting things working right before worrying about performance, and only then worry about performance if your rendering code is not up to par (i.e.: minimum FPS requirement).


Jeffrey Carpenter <@Jeffrey_Carpenter>

-------------- next part --------------
A non-text attachment was scrubbed…
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1572 bytes
Desc: not available