SDL2 and 3D Rendering

11,990

Your question would be better off on GameDev Stackexchange but to simply answer your question: SDL2 itself has no capabilities to render 3D objects. This is also stated in SDLs about page:

Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D

SDL provides some functions to help you ease the use of OpenGL, but you'll have to learn and use OpenGL to allow rendering 2D and 3D vector graphics.

A good tutorial that I'd recommend on the basics of SDL is this site. It only has some chapters related to the use of OpenGL, but if you haven't used SDL much, this is a great start.

Share:
11,990
Shoaib Ahmed
Author by

Shoaib Ahmed

Updated on June 04, 2022

Comments

  • Shoaib Ahmed
    Shoaib Ahmed almost 2 years

    Does SDL2 have the capability to render things in 3D (i.e. make cubes, spheres, etc.) without the use of OpenGL, or does it only have 2D capabilities?

  • HolyBlackCat
    HolyBlackCat about 5 years
    You're correct, but the quote is unrelated. "access to ... graphics hardware via OpenGL and Direct3D" means that SDL2 can use OpenGL and Direct3D under the hood to render primitives.
  • pr0f3ss
    pr0f3ss about 5 years
    @HolyBlackCat Fair enough, that could be understood in an ambiguous manner.