Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualServant of the Lord

Posted 20 September 2013 - 07:20 PM

SDL 1.x used software rendering by default.
I've heard, perhaps incorrectly, that SDL 2 uses OpenGL by default.

SFML (another 2D C++ library) uses OpenGL by default, and definitely is built ontop of OpenGL.

You can perfectly use OpenGL for 2D games, but you don't need to. It'd be easier to use something like SDL or SFML, which may or may not be using OpenGL under the hood to take advantage of the videocard. To do '2D' with these '3D' APIs, they just draw rectangles facing the screen, among other things, allowing them to still use the super-optimized drawing routines of the specialized hardware (the videocard). We could have (and have had in the past) hardware specialized for 2D drawing, but 3D videocards work fast enough for 2D that we no longer have the need for specialized 2D hardware, preferring (to save on the cost of computer hardware) to just do 2D on the 3D hardware and/or with 2D-specialized software. 2D rendering is rather simple after all, and is kinda a 'solved' problem (where with 3D we still hit performance limitations, and continually need to produce better hardware to meet the demands of new software).

You can use SDL or SFML without manually using OpenGL functions and make 2D games just fine.
Even when you move to 3D, you don't *have to* use OpenGL. You might just decide use a 3D engine that wraps OpenGL (or DirectX, an alternative).

OpenGL and DirectX define common APIs for accessing the messy videocard-specific interfaces to the videocards in a consistent way. SFML and some other APIs and 3D rendering engines then wrap OpenGL and DirectX to provide a nicer interface and more higher-level features. By 'higher level' I mean they provide convenience functions and classes that allow you to do common tasks in fewer lines of code than OpenGL and DirectX, in their generalized low-level nature, would require. E.g. doing something in one or two lines of code that might require 20 or 30 lines of OpenGL or DirectX.

So to answer your question, "Do I really need OpenGL?", no, you don't really need to learn OpenGL, but in most your projects you'll likely be using something that itself uses DirectX or OpenGL (or uses something that uses something else that uses OpenGL or DirectX, or... ad infinitum).


#3Servant of the Lord

Posted 20 September 2013 - 07:10 PM

SDL 1.x used software rendering by default.
I've heard, perhaps incorrectly, that SDL 2 uses OpenGL by default.

SFML (another 2D C++ library) uses OpenGL by default, and definitely is built ontop of OpenGL.

You can perfectly use OpenGL for 2D games, but you don't need to. It'd be easier to use something like SDL or SFML, which may or may not be using OpenGL under the hood to take advantage of the videocard.

You can use SDL or SFML without manually using OpenGL functions and make 2D games just fine.
Even when you move to 3D, you don't *have to* use OpenGL. You might just decide use a 3D engine that wraps OpenGL (or DirectX, an alternative).

OpenGL and DirectX define common APIs for accessing the messy videocard-specific interfaces to the videocards in a consistent way. SFML and some other APIs and 3D rendering engines then wrap OpenGL and DirectX to provide a nicer interface and more higher-level features. By 'higher level' I mean they provide convenience functions and classes that allow you to do common tasks in fewer lines of code than OpenGL and DirectX, in their generalized low-level nature, would require. E.g. doing something in one or two lines of code that might require 20 or 30 lines of OpenGL or DirectX.

So to answer your question, "Do I really need OpenGL?", no, you don't really need to learn OpenGL, but in most your projects you'll likely be using something that itself uses DirectX or OpenGL (or uses something that uses something else that uses OpenGL or DirectX, or... ad infinitum).

#2Servant of the Lord

Posted 20 September 2013 - 07:10 PM

SDL 1.x used software rendering by default.
I've heard, perhaps incorrectly, that SDL 2 uses OpenGL by default.

SFML (another 2D C++ library) uses OpenGL by default, and definitely is built ontop of OpenGL.

You can perfectly use OpenGL for 2D games, but you don't need to. It'd be easier to use something like SDL or SFML, which may or may not be using OpenGL under the hood to take advantage of the videocard.

You can use SDL or SFML without manually using OpenGL functions and make 2D games just fine.
Even when you move to 3D, you don't *have to* use OpenGL. You might just decide use a 3D engine that wraps OpenGL (or DirectX, an alternative).

OpenGL and DirectX define common APIs for accessing the messy videocard-specific interfaces to the videocards in a consistent way. SFML and some other APIs and 3D rendering engines then wrap OpenGL and DirectX to provide a nicer interface and more higher-level features. By 'higher level' I mean they provide convenience functions and classes that allow you to do common tasks in fewer lines of code than OpenGL and DirectX, in their generalized low-level nature, would require. E.g. doing something in one or two lines of code that might require 20 or 30 lines of OpenGL or DirectX.

So to answer your question, "Do I really need OpenGL?", no, you don't really need to learn OpenGL, but in most your projects you'll likely be using something that itself uses DirectX or OpenGL (or uses something that uses something else that uses OpenGL or DirectX, and etc...).

#1Servant of the Lord

Posted 20 September 2013 - 07:07 PM

SDL 1.x used software rendering by default.
I've heard, perhaps incorrectly, that SDL 2 uses OpenGL by default.

SFML (another 2D C++ library) uses OpenGL by default, and definitely is built ontop of OpenGL.

You can perfectly use OpenGL for 2D games, but you don't need to. It'd be easier to use something like SDL or SFML, which may or may not be using OpenGL under the hood to take advantage of the videocard.

You can use SDL or SFML without manually using OpenGL functions and make 2D games just fine.
Even when you move to 3D, you don't *have to* use OpenGL. You might just decide use a 3D engine that wraps OpenGL (or DirectX, an alternative).

OpenGL and DirectX define common APIs for accessing the messy videocard-specific interfaces to the videocards in a consistent way. SFML and some other APIs and 3D rendering engines then wrap OpenGL and DirectX to provide a nicer interface and more higher-level features. By 'higher level' I mean they provide convenience functions and classes that allow you to do common tasks in fewer lines of code than OpenGL and DirectX, in their generalized low-level nature, would require. E.g. doing something in one or two lines of code that might require 20 or 30 lines of OpenGL or DirectX.

PARTNERS