The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Why Doesn't SDL 2 Use OpenGL On PC Windows?
JeZ-l-Lee


Joined: 20 Sep 2009
Posts: 572
Location: Long Island, New York, United States, Earth
Why Doesn't SDL 2 Use OpenGL On PC Windows?

Hi,

I am starting to show interest in SDL 2 because it's being officially released in a few weeks.
I read the introduction on the wiki and am wondering why SDL 2 does not use OpenGL on PC Windows?
OpenGL is used on all the other supported platforms, but not PC Windows?
Just wondering why DirectX was chosen over OpenGL.
Thanks!
Why Doesn't SDL 2 Use OpenGL On PC Windows?
Jonny D


Joined: 12 Sep 2009
Posts: 932
That's for the rendering API.  Are you using OpenGL directly?  If so, then no need to worry.  I think there's an API or hint to choose OpenGL as the rendering API backend anyhow.  Simply put, DirectX is better supported by the vendor (Microsoft) than OpenGL is on Windows.

Jonny D



On Thu, Apr 18, 2013 at 12:15 PM, JeZ-l-Lee wrote:
Quote:
Why Doesn't SDL 2 Use OpenGL On PC Windows?

Hi,

I am starting to show interest in SDL 2 because it's being officially released in a few weeks.
I read the introduction on the wiki and am wondering why SDL 2 does not use OpenGL on PC Windows?
OpenGL is used on all the other supported platforms, but not PC Windows?
Just wondering why DirectX was chosen over OpenGL.
Thanks!



JeZ+Lee
JessePalser <AT> Gmail <DOT> com
16BitSoft(R)
Video Game Design Studio
www.16BitSoft.com


_______________________________________________
SDL mailing list

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

JeZ-l-Lee


Joined: 20 Sep 2009
Posts: 572
Location: Long Island, New York, United States, Earth
Hi,

I feel more comfortable with OpenGL over proprietary DirectX,
but if using DX will make my game run on more PC Windows computers
then I guess I'll use it...
Why Doesn't SDL 2 Use OpenGL On PC Windows?
Stephen Anthony
Guest

On April 18, 2013 1:55:31 PM Jonathan Dearborn wrote:
Quote:
That's for the rendering API. Are you using OpenGL directly? If so,
then no need to worry. I think there's an API or hint to choose
OpenGL as the rendering API backend anyhow. Simply put, DirectX is
better supported by the vendor (Microsoft) than OpenGL is on Windows.

This is actually one of the main drawing cards for me with SDL2. In at
least one major project I maintain (Stella, 2600 emulator), I've been
forced to add OpenGL support simply to get acceptable performance. And
OpenGL definitely isn't supported as well in Windows.

I'm really looking forward to actually dropping OpenGL, and instead using
the SDL API directly. That way, it will still use the best-available
hardware acceleration on each platform, and I can abstract away all those
(irrelevant) details.

Steve A.
Stella maintainer
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Why Doesn't SDL 2 Use OpenGL On PC Windows?
Sik


Joined: 26 Nov 2011
Posts: 905
I think you can force SDL to use OpenGL without resorting to hint
overrides, but I don't remember the exact procedure right now. They're
the SDL_GL_* functions though.

If you're using just the renderer then don't bother and let SDL choose
what's best. If you're using OpenGL directly then look into those
functions to ensure it creates an OpenGL window.

2013/4/18, Stephen Anthony:
Quote:
On April 18, 2013 1:55:31 PM Jonathan Dearborn wrote:
Quote:
That's for the rendering API. Are you using OpenGL directly? If so,
then no need to worry. I think there's an API or hint to choose
OpenGL as the rendering API backend anyhow. Simply put, DirectX is
better supported by the vendor (Microsoft) than OpenGL is on Windows.

This is actually one of the main drawing cards for me with SDL2. In at
least one major project I maintain (Stella, 2600 emulator), I've been
forced to add OpenGL support simply to get acceptable performance. And
OpenGL definitely isn't supported as well in Windows.

I'm really looking forward to actually dropping OpenGL, and instead using
the SDL API directly. That way, it will still use the best-available
hardware acceleration on each platform, and I can abstract away all those
(irrelevant) details.

Steve A.
Stella maintainer
_______________________________________________
SDL mailing list

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

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Why Doesn't SDL 2 Use OpenGL On PC Windows?
eclectocrat


Joined: 26 Mar 2011
Posts: 72
IME even if you use the SDL renderer only, you should give the user the option to switch between OpenGL and DirectX. There are a helluva lot of PC configurations out there and on some of them one system will be unstable.


On Thu, Apr 18, 2013 at 11:13 PM, Sik the hedgehog wrote:
Quote:
I think you can force SDL to use OpenGL without resorting to hint
overrides, but I don't remember the exact procedure right now. They're
the SDL_GL_* functions though.

If you're using just the renderer then don't bother and let SDL choose
what's best. If you're using OpenGL directly then look into those
functions to ensure it creates an OpenGL window.

2013/4/18, Stephen Anthony:
Quote:
On April 18, 2013 1:55:31 PM Jonathan Dearborn wrote:
Quote:
That's for the rendering API.  Are you using OpenGL directly?  If so,
then no need to worry.  I think there's an API or hint to choose
OpenGL as the rendering API backend anyhow.  Simply put, DirectX is
better supported by the vendor (Microsoft) than OpenGL is on Windows.

This is actually one of the main drawing cards for me with SDL2.  In at
least one major project I maintain (Stella, 2600 emulator), I've been
forced to add OpenGL support simply to get acceptable performance.  And
OpenGL definitely isn't supported as well in Windows.

I'm really looking forward to actually dropping OpenGL, and instead using
the SDL API directly.  That way, it will still use the best-available
hardware acceleration on each platform, and I can abstract away all those
(irrelevant) details.

Steve A.
Stella maintainer
_______________________________________________
SDL mailing list

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

_______________________________________________
SDL mailing list

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


Why Doesn't SDL 2 Use OpenGL On PC Windows?
Stephen Anthony
Guest

On April 19, 2013 10:25:12 AM Jeremy Jurksztowicz wrote:
Quote:
IME even if you use the SDL renderer only, you should give the user the
option to switch between OpenGL and DirectX. There are a helluva lot of
PC configurations out there and on some of them one system will be
unstable.

Not sure if this was directed to me, but if so, I agree. I have no issue
with letting the user choose the backend that SDL will use. My main
concern is that I don't want to maintain the backend code *myself.*

This is becoming a problem in my project, since (a) OpenGL isn't as well
supported in Windows, and (b) isn't supported at all on some newer tablet-
type devices. The latter probably use OpenGLES (1 or 2), or something
else. Basically, that stuff belongs in abstraction library like SDL, and
is my primary reason for wanting to move to SDL2.

All I personally want is to create a window and send some data to it, and
have it stretched accordingly (with hardware acceleration). It doesn't
*have* to be OpenGL doing it, and I look forward to killing approx 2000
lines of code and no longer having to maintain that stuff.

Steve A.
Stella maintainer
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Why Doesn't SDL 2 Use OpenGL On PC Windows?
Sik


Joined: 26 Nov 2011
Posts: 905
Technically SDL2 already lets the user choose the backend by setting
an environment variable, it's just cumbersome for the normal user Razz
(and it affects all SDL2 programs, not just any specific one) Making
it a program setting involves using hint overrides, which makes SDL
ignore the environment variables of the overriden hints.

What do you mean by tablet-type? Because if you mean iOS and Android,
those *never* supported anything but OpenGL ES.

2013/4/19, Stephen Anthony:
Quote:
On April 19, 2013 10:25:12 AM Jeremy Jurksztowicz wrote:
Quote:
IME even if you use the SDL renderer only, you should give the user the
option to switch between OpenGL and DirectX. There are a helluva lot of
PC configurations out there and on some of them one system will be
unstable.

Not sure if this was directed to me, but if so, I agree. I have no issue
with letting the user choose the backend that SDL will use. My main
concern is that I don't want to maintain the backend code *myself.*

This is becoming a problem in my project, since (a) OpenGL isn't as well
supported in Windows, and (b) isn't supported at all on some newer tablet-
type devices. The latter probably use OpenGLES (1 or 2), or something
else. Basically, that stuff belongs in abstraction library like SDL, and
is my primary reason for wanting to move to SDL2.

All I personally want is to create a window and send some data to it, and
have it stretched accordingly (with hardware acceleration). It doesn't
*have* to be OpenGL doing it, and I look forward to killing approx 2000
lines of code and no longer having to maintain that stuff.

Steve A.
Stella maintainer
_______________________________________________
SDL mailing list

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

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Why Doesn't SDL 2 Use OpenGL On PC Windows?
Stephen Anthony
Guest

On April 19, 2013 11:52:38 AM Sik the hedgehog wrote:
Quote:
Technically SDL2 already lets the user choose the backend by setting
an environment variable, it's just cumbersome for the normal user Razz
(and it affects all SDL2 programs, not just any specific one) Making
it a program setting involves using hint overrides, which makes SDL
ignore the environment variables of the overriden hints.

What do you mean by tablet-type? Because if you mean iOS and Android,
those *never* supported anything but OpenGL ES.

OK, to be clear. I currently have to maintain OpenGL-specific code in my
project (Stella, using SDL1.2) to get good performance for image
stretching and alpha-blending, v'sync, etc. I've even brought in VBO
stuff.

OpenGL (often) doesn't work as well as Direct3D in Windows, and like you
say, isn't present at all in iOS/Android/etc (what I call tablet-like or
'small' systems). If SDL2 hadn't come along, my only option for expanding
support for all platforms would be to write backends myself
(Direct3D/OpenGL/OpenGLES/etc).

Basically, I would be duplicating what SDL2 is doing. In fact, over the
years (as I've been maintaining this project since 2002), I've already
added to Stella much of what is in SDL2, such as different backends,
multiple framebuffer surfaces, window centering, etc. I *really* look
forward to removing all this code, and letting SDL2 do the work. It is
literally 1000's of lines of code that I will no longer have to maintain,
and at the same time Stella will become available to many more platforms.

It may seem strange, but I look forward to SDL2 so I can delete large
parts of my codebase Smile

Steve A.
Stella maintainer
_______________________________________________
SDL mailing list

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