Relationship of SDL and OpenGL?

Hi,

 I begin to learn SDL shortly,Some things very confused,I want to know the relationship of SDl with Opengl? SDL encapsulates the interface of OpenGL,

 so what extent SDL supports OpenGL to ------------------------

sunshine

OpenGL is 3D rendering (HARDWARE_RENDERING)

SDL is (2D Rendering, AUDIO, NETWORKING, INPUTS (MOUSE,KEYBOARD,TOUCHSCREEN), IMAGES) SDL is cross platform (Windows, Linux, Mac I believe)
SDL is like the alternative to DirectX, but without the 3D element, add OpenGL and it can do what DirectX can basically do.

Problem with DirectX it’s not supposed to run on other platforms there for should be avoided entirely.

OpenGL is 2D rendering too (it’s meant for both 2D and 3D).

2013/9/8, Timodor :> OpenGL is 3D rendering (HARDWARE_RENDERING)

SDL is (2D Rendering, AUDIO, NETWORKING, INPUTS
(MOUSE,KEYBOARD,TOUCHSCREEN), IMAGES) SDL is cross platform (Windows, Linux,
Mac I believe)
SDL is like the alternative to DirectX, but without the 3D element, add
OpenGL and it can do what DirectX can basically do.

Problem with DirectX it’s not supposed to run on other platforms there for
should be avoided entirely.

Sik wrote:

OpenGL is 2D rendering too (it’s meant for both 2D and 3D).

2013/9/8, Timodor :

OpenGL is 3D rendering (HARDWARE_RENDERING)

SDL is (2D Rendering, AUDIO, NETWORKING, INPUTS
(MOUSE,KEYBOARD,TOUCHSCREEN), IMAGES) SDL is cross platform (Windows, Linux,
Mac I believe)
SDL is like the alternative to DirectX, but without the 3D element, add
OpenGL and it can do what DirectX can basically do.

Problem with DirectX it’s not supposed to run on other platforms there for
should be avoided entirely.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

If I want to use opengl’Renderfing,I must make my projiect to contain SDL and OpenGL I know SDL that contain OpenGL’ function,I donot how to use opengl in sdl. Do you have some code about video?------------------------
sunshine

SDL is neither a superset nor an extension to OpenGL. OpenGL is a 3D rendering API and nothing else. You can only use it to render scenes. OpenGL does not even provide functions to create a window, get user input etc. This is what other libraries are for. take GLUT, for example, which is a Window API just for that purpose.

SDL2 also allows you to create windows that have OpenGL capabilities, but that is just a minor subset if what SDL can do, as it is a much more general library. Read the about section in http://libsdl.org for a brief introduction to the features of SDL2.On Sep 8, 2013, at 6:19 AM, “juny” <459932369 at qq.com> wrote:

Hi,

I begin to learn SDL shortly,Some things very confused,I want to know the relationship of SDl with Opengl? SDL encapsulates the interface of OpenGL,

so what extent SDL supports OpenGL to ?

sunshine


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

For examples, have a look at ‘testgl’ from the ‘test/’ subdirectory of the SDL2 source code distributionOn Sep 8, 2013, at 11:02 AM, “juny” <459932369 at qq.com> wrote:

Sik wrote:
OpenGL is 2D rendering too (it’s meant for both 2D and 3D).

2013/9/8, Timodor <>:

Quote:
OpenGL is 3D rendering (HARDWARE_RENDERING)

SDL is (2D Rendering, AUDIO, NETWORKING, INPUTS
(MOUSE,KEYBOARD,TOUCHSCREEN), IMAGES) SDL is cross platform (Windows, Linux,
Mac I believe)
SDL is like the alternative to DirectX, but without the 3D element, add
OpenGL and it can do what DirectX can basically do.

Problem with DirectX it’s not supposed to run on other platforms there for
should be avoided entirely.


SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

If I want to use opengl’Renderfing,I must make my projiect to contain SDL and OpenGL? I know SDL that contain OpenGL’ function,I donot how to use opengl in sdl. Do you have some code about video?

sunshine


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

The testgl.c and testgles.c are terrible places to start; they mix in a
whole pile of unnecessary complexity (being tests).

Have a look at the gist I posted the other day if you want a starting point:

…and yes.

If you use opengl you must link your binary to the SDL library AND to the
system opengl library.

Ignore the SDL_GL_* functions for most purposes.

You may also need to use: http://wiki.libsdl.org/SDL_GL_BindTexture to
create usable textures from SDL_Surface.~
Doug.

On Mon, Sep 9, 2013 at 1:39 AM, wrote:

For examples, have a look at ‘testgl’ from the ‘test/’ subdirectory of the
SDL2 source code distribution

On Sep 8, 2013, at 11:02 AM, “juny” <459932369 at qq.com> wrote:

Sik wrote: OpenGL is 2D rendering too (it’s meant for both 2D and 3D).

2013/9/8, Timodor <>:

Quote: OpenGL is 3D rendering (HARDWARE_RENDERING)

SDL is (2D Rendering, AUDIO, NETWORKING, INPUTS
(MOUSE,KEYBOARD,TOUCHSCREEN), IMAGES) SDL is cross platform (Windows,
Linux,
Mac I believe)
SDL is like the alternative to DirectX, but without the 3D element, add
OpenGL and it can do what DirectX can basically do.

Problem with DirectX it’s not supposed to run on other platforms there for
should be avoided entirely.


SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

If I want to use opengl’Renderfing,I must make my projiect to contain SDL
and OpenGL? I know SDL that contain OpenGL’ function,I donot how to use
opengl in sdl. Do you have some code about video?


sunshine


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Do you have some material or code about playing video that coding by opengl within SDL?
Morevover,if I want to use the opengl’interface in sdl ,how can I use it?

Doug wrote:> The testgl.c and testgles.c are terrible places to start; they mix in a whole pile of unnecessary complexity (being tests).

Have a look at the gist I posted the other day if you want a starting point:
https://gist.github.com/anonymous/6450139 (https://gist.github.com/anonymous/6450139)

…and yes.

If you use opengl you must link your binary to the SDL library AND to the system opengl library.

Ignore the SDL_GL_* functions for most purposes.

You may also need to use: http://wiki.libsdl.org/SDL_GL_BindTexture (http://wiki.libsdl.org/SDL_GL_BindTexture) to create usable textures from SDL_Surface.

~

Doug.

On Mon, Sep 9, 2013 at 1:39 AM, <neoaggelos at gmail.com (neoaggelos at gmail.com)> wrote:

For examples, have a look at ‘testgl’ from the ‘test/’ subdirectory of the SDL2 source code distribution

On Sep 8, 2013, at 11:02 AM, “juny” <@juny (http://qq.com)> wrote:

Sik wrote:   	OpenGL is 2D rendering too (it's meant for both 2D and 3D).

2013/9/8, Timodor <>:

Quote:   	OpenGL is 3D rendering (HARDWARE_RENDERING)

SDL is (2D Rendering, AUDIO, NETWORKING, INPUTS
(MOUSE,KEYBOARD,TOUCHSCREEN), IMAGES) SDL is cross platform (Windows, Linux,
Mac I believe)
SDL is like the alternative to DirectX, but without the 3D element, add
OpenGL and it can do what DirectX can basically do.

Problem with DirectX it’s not supposed to run on other platforms there for
should be avoided entirely.


SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

If I want to use opengl’Renderfing,I must make my projiect to contain SDL and OpenGL??? I know SDL that contain OpenGL’ function,I donot how to use opengl in sdl. Do you have some code about video?

sunshine


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)


sunshine

You can find many examples online, just search for ‘OpenGL SDL2 example’ on google.

Sorry, but I am from my phone right now so I can’t point to an example.

Also, by the OpenGL interface, do you mean the Render API?On Sep 9, 2013, at 11:15 AM, “juny” <459932369 at qq.com> wrote:

Do you have some material or code about playing video that coding by opengl within SDL?
Morevover,if I want to use the opengl’interface in sdl ,how can I use it?

Doug wrote:
The testgl.c and testgles.c are terrible places to start; they mix in a whole pile of unnecessary complexity (being tests).

Have a look at the gist I posted the other day if you want a starting point:
https://gist.github.com/anonymous/6450139

…and yes.

If you use opengl you must link your binary to the SDL library AND to the system opengl library.

Ignore the SDL_GL_* functions for most purposes.

You may also need to use: http://wiki.libsdl.org/SDL_GL_BindTexture to create usable textures from SDL_Surface.

~

Doug.

On Mon, Sep 9, 2013 at 1:39 AM, <> wrote:

Quote:
For examples, have a look at ‘testgl’ from the ‘test/’ subdirectory of the SDL2 source code distribution

On Sep 8, 2013, at 11:02 AM, “juny” <459932369 at qq.com> wrote:

Quote:

Sik wrote: OpenGL is 2D rendering too (it’s meant for both 2D and 3D).

2013/9/8, Timodor <>:

Quote: OpenGL is 3D rendering (HARDWARE_RENDERING)

SDL is (2D Rendering, AUDIO, NETWORKING, INPUTS
(MOUSE,KEYBOARD,TOUCHSCREEN), IMAGES) SDL is cross platform (Windows, Linux,
Mac I believe)
SDL is like the alternative to DirectX, but without the 3D element, add
OpenGL and it can do what DirectX can basically do.

Problem with DirectX it’s not supposed to run on other platforms there for
should be avoided entirely.


SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

If I want to use opengl’Renderfing,I must make my projiect to contain SDL and OpenGL? I know SDL that contain OpenGL’ function,I donot how to use opengl in sdl. Do you have some code about video?

sunshine


SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

sunshine


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Yes, Because SDL contain Opengl’ interface,why have we must use the independent opengl’ function ? Don’t can I use SDI to visit opengl’ fucntion ?

juny

[quote=“neoaggelos”]You can find many examples online, just search for ‘OpenGL SDL2 example’ on google.

Sorry, but I am from my phone right now so I can’t point to an example.

Also, by the OpenGL interface, do you mean the Render API?------------------------
sunshine

SDL2 has a Render API that sticks to basic 2D stuff. This API uses some backends, one of which is OpenGL. Other backends are Direct3D(windows only), OpenGL ES (1+2). There is also a software backend for compatibility purposes only.

OpenGL, as an API contains much more features than the SDL Render API. Now if you want to stick to pure OpenGL, or you want the Render API, is up to you, and the requirements of your project.On Sep 9, 2013, at 11:47 AM, “juny” <459932369 at qq.com> wrote:

Yes, Because SDL contain Opengl’ interface,why have we must use the independent opengl’ function ? Don’t can I use SDI to visit opengl’ fucntion ?

juny

[quote=“neoaggelos”]You can find many examples online, just search for ‘OpenGL SDL2 example’ on google.

Sorry, but I am from my phone right now so I can’t point to an example.

Also, by the OpenGL interface, do you mean the Render API?

sunshine


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

In fact ,I want to use Render API, can it meet my need of render video? or do you have exampe of using render api to play video?

[quote=“neoaggelos”]SDL2 has a Render API that sticks to basic 2D stuff. This API uses some backends, one of which is OpenGL. Other backends are Direct3D(windows only), OpenGL ES (1+2). There is also a software backend for compatibility purposes only.

OpenGL, as an API contains much more features than the SDL Render API. Now if you want to stick to pure OpenGL, or you want the Render API, is up to you, and the requirements of your project.On Sep 9, 2013, at 11:47 AM, “juny” <@juny> wrote:

Yes, Because SDL contain Opengl’ interface,why have we must use the independent opengl’ function ? Don’t can I use SDI to visit opengl’ fucntion ?

juny

neoaggelos wrote:

You can find many examples online, just search for ‘OpenGL SDL2 example’ on google.

Sorry, but I am from my phone right now so I can’t point to an example.

Also, by the OpenGL interface, do you mean the Render API?

sunshine


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


sunshine

2013/9/9, Doug <douglas.linder at gmail.com>:

Ignore the SDL_GL_* functions for most purposes.

Er, they’re needed to create the context though (I’d advice against
using anything else though, you’ll probably want OpenGL access to be
as pure as possible, even though this means having to do things like
create textures manually and such)

I want to use render? opengl interface to play video, not use independent opengl. having example about this?

Er, they’re needed to create the context though (I’d advice against
using anything else though, you’ll probably want OpenGL access to be
as pure as possible, even though this means having to do things like
create textures manually and such)------------------------
sunshine

If you want the Render API, then the backend used should not be a problem to you. SDL2 will use the best backend available, unless you specify which one you want.

Note that the whole point of the Render API is that you don’t have to care about which render driver is used.On Sep 9, 2013, at 12:48 PM, “juny” <459932369 at qq.com> wrote:

In fact ,I want to use Render API, can it meet my need of render video? or do you have exampe of using render api to play video?

[quote=“neoaggelos”]SDL2 has a Render API that sticks to basic 2D stuff. This API uses some backends, one of which is OpenGL. Other backends are Direct3D(windows only), OpenGL ES (1+2). There is also a software backend for compatibility purposes only.

OpenGL, as an API contains much more features than the SDL Render API. Now if you want to stick to pure OpenGL, or you want the Render API, is up to you, and the requirements of your project.

On Sep 9, 2013, at 11:47 AM, “juny” <> wrote:

Quote:
Yes, Because SDL contain Opengl’ interface,why have we must use the independent opengl’ function ? Don’t can I use SDI to visit opengl’ fucntion ?

juny

neoaggelos wrote:
You can find many examples online, just search for ‘OpenGL SDL2 example’ on google.

Sorry, but I am from my phone right now so I can’t point to an example.

Also, by the OpenGL interface, do you mean the Render API?

sunshine


SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

sunshine


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Message-ID: <40F0D041-9B46-44DB-AF1D-EF3A7BBED25C at gmail.com>
Content-Type: text/plain; charset=“us-ascii”

If you want the Render API, then the backend used should not be a problem to
you. SDL2 will use the best backend available, unless you specify which one
you want.

It’s worth noting that he doesn’t REALLY care about any of that. What
he really cares about is how to display video in SDL2. Does anyone
know of a relevant link?> Date: Mon, 9 Sep 2013 13:21:04 +0300

From: neoaggelos at gmail.com
To: “sdl at lists.libsdl.org
Subject: Re: [SDL] Relationship of SDL and OpenGL?

The only example I know of off the top of my head is:
http://svn.icculus.org/checkout/smpeg/trunk/plaympeg.c?revision=400&content-type=text%2Fplain~
Doug.

On Tue, Sep 10, 2013 at 4:28 AM, Jared Maddox wrote:

Date: Mon, 9 Sep 2013 13:21:04 +0300
From: neoaggelos at gmail.com
To: “sdl at lists.libsdl.org
Subject: Re: [SDL] Relationship of SDL and OpenGL?
Message-ID: <40F0D041-9B46-44DB-AF1D-EF3A7BBED25C at gmail.com>
Content-Type: text/plain; charset=“us-ascii”

If you want the Render API, then the backend used should not be a
problem to
you. SDL2 will use the best backend available, unless you specify which
one
you want.

It’s worth noting that he doesn’t REALLY care about any of that. What
he really cares about is how to display video in SDL2. Does anyone
know of a relevant link?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org