SDL and Direct3D question

and probably a fun candidate for the SDL/Windows FAQ:

Is it possible for SDL and Direct3D to interact?

I’m working on some 3D packages and while OpenGL is ideal for almost every
platform out there it seems there’s one ‘hardly-used’ platform that has
rotten OpenGL support wry grin
incidentally I haven’t tried. I also haven’t tried to get SDL running
under windows yet either.
windows devel env: windows 2000 + either vb6 or mingw32. I do have
both… and don’t know which to use with SDL sigh.

TIA and G’day, eh? :slight_smile:
- Teunis

I’m working on some 3D packages and while OpenGL is ideal for almost every
platform out there it seems there’s one ‘hardly-used’ platform that has
rotten OpenGL support wry grin

Yeah, but we like Linux anyhow.

–ryan.

I’m working on some 3D packages and while OpenGL is ideal for almost every
platform out there it seems there’s one ‘hardly-used’ platform that has
rotten OpenGL support wry grin

Yeah, but we like Linux anyhow.

there’s only one answer to this:
ROFLOL!!!

but true.
sigh

but it has worse Direct3D support… (although not none - see libwine :slight_smile:

G’day, eh? :slight_smile:
- TeunisOn Wed, 5 Jun 2002, Ryan C. Gordon wrote:

No. SDL is a portable graphics library and
OpenGL is supported 3D graphics library.

End of Story.

If you want to use D3D, you should use
DirectX. After all the program isn’t going
to be portable.

Paulo Pinto> -----Original Message-----

From: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org]On Behalf Of
Teunis Peters
Sent: quinta-feira, 6 de Junho de 2002 3:52
To: SDL list
Subject: [SDL] SDL and Direct3D question

and probably a fun candidate for the SDL/Windows FAQ:

Is it possible for SDL and Direct3D to interact?

I’m working on some 3D packages and while OpenGL is ideal for
almost every
platform out there it seems there’s one 'hardly-used’
platform that has
rotten OpenGL support wry grin
incidentally I haven’t tried. I also haven’t tried to get SDL running
under windows yet either.
windows devel env: windows 2000 + either vb6 or mingw32. I do have
both… and don’t know which to use with SDL sigh.

TIA and G’day, eh? :slight_smile:

  • Teunis

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

No. SDL is a portable graphics library and
OpenGL is supported 3D graphics library.

SDL -does- handle things other than video… sound, event management,
threading, and a few other items come to mind… verrry useful… :slight_smile:

End of Story.

If you want to use D3D, you should use
DirectX. After all the program isn’t going
to be portable.

It’s not that cut and dried. I’m trying to keep the level of rewriting
code for different platforms at a minimum.
I’m aware of Direct3D’s lack of portability to anything other than
windows-series boxen. Considering that SDL almost gets in the way of
OpenGL when one is handling video, it’s not really that different a
situation…
that doesn’t keep SDL from being -really- useful for handling everything
else.
besides, under windows, SDL frequently runs on top of DirectX…

I could use OpenGL under windows too - but am worried it’ll be unusably
slow due to lack of workable opengl implementation.

and to finish, it’s a challenge. I’m hoping to hear back from people
who’ve actually tried this or who have demonstrable proof this can’t be
done.
hrm - I should try and figure out how to get windows devel environment
working with SDL and try it out myself :slight_smile:

G’day, eh? :slight_smile:
- TeunisOn Thu, 6 Jun 2002, Paulo Pinto wrote:

I could use OpenGL under windows too - but am worried it’ll be unusably
slow due to lack of workable opengl implementation.

The opengl Windows drivers are AT LEAST as fast and compatible as the linux
ones…

and to finish, it’s a challenge. I’m hoping to hear back from people
who’ve actually tried this or who have demonstrable proof this can’t be
done.

Maybe it can be done, using the SDL_WM_SysInfo struct to get low level
implementation parameters, but I really don’t see the point in doing it.
The Direct* APIs are terrible, not clean and badly documented (there is
excess of documentation on how to do the simpler things but almost nothing
on more complex stuff). Use OpenGL and your know how will be also more
valuable for the future.

Bye,
Gabry (gabrielegreco at tin.it)

Thursday, June 6, 2002, 5:33:09 AM, you wrote:

I could use OpenGL under windows too - but am worried it’ll be unusably
slow due to lack of workable opengl implementation.

GG> The opengl Windows drivers are AT LEAST as fast and compatible as the linux
GG> ones…

and to finish, it’s a challenge. I’m hoping to hear back from people
who’ve actually tried this or who have demonstrable proof this can’t be
done.

GG> Maybe it can be done, using the SDL_WM_SysInfo struct to get low level
GG> implementation parameters, but I really don’t see the point in doing it.
GG> The Direct* APIs are terrible, not clean and badly documented (there is
GG> excess of documentation on how to do the simpler things but almost nothing
GG> on more complex stuff). Use OpenGL and your know how will be also more
GG> valuable for the future.

You’re right on all counts about the quality of DirectX APIs.

The huge difference is that under Windows, OpenGL is no longer
officially supported by Microsoft, and many vendors no longer support
it.

I will quote liberally from an email I wrote recently:

----BEGIN QUOTES----------

OpenGL is getting worse again, not better. The Neomagic chips now
found in most of the big-brand laptops on the market (Sony, Toshiba)
suck little 3D rocks, and they don’t support OpenGL AT ALL. Period.
End of story.

Microsoft no longer ships OpenGL with their software – XP doesn’t
have it.

Today if you want to use OpenGL for a PC product, you have to:

a) Tell your user how to figure out what video card they have
b) Direct them to get from there to figuring out the web site for it,
which may or may not still be in operation.
c) Navigate the web site – many hardware manufacturers make this
nearly impossible.
d) Figure out which driver they need, which means knowing their OS,
video card make AND model.
e) Download the driver and then find it on the disk after it’s been
downloaded (don’t forget, this behavior has changed in EVERY version
of Windows)
f) Have them install it, which may or may not work. THey might need to
install DirectX to get their OpenGL driver to work (seriously).

This is assuming that the vendor still exists (you don’t want a list
of how many have gone out of business or changed names in the last
couple of years) and that they still support the customer’s video
card. It’s also assuming that the customer’s card supports OpenGL and
3D at all. You’d be amazed at how many 12-year-olds are running
computers that are almost as old as they are. S3 ViRGE, anyone?

And then there’s the whole question of setting up video modes. Opening
a window that reliably gets you a valid OpenGL context across versions
of Windows, video boards, and desktop video modes is a significant
challenge. When we built MindRover, we spent AT LEAST an entire
person-month on video initialization. Seriously.

Your alternative is to spend your time on learning D3D, ship the
DirectX installer on your CD, and largely forget about the support
problem.

Yes, it’s really that bad. I really wish this wasn’t the case, but on
Windows, anyway, Microsoft has successfully made OpenGL irrelevant.

---------END QUOTES-------------

So…if you want to make a game that real customers with money are
likely to be able to successfully play and then buy, you can’t do it
with OpenGL anymore.

So I’m thrilled that SDL supports DX5 for 2D stuff. One of these days,
I’d like to write the DX8 support as well and hook it in so it’s tried
first, then DX5, and finally the Win32 API. Haven’t had time yet.

      Kent-- 

Kent Quirk, CTO, CogniToy
@Kent_Quirk
http://www.cognitoy.com

Teunis Peters wrote:

and probably a fun candidate for the SDL/Windows FAQ:

Is it possible for SDL and Direct3D to interact?

I’m working on some 3D packages and while OpenGL is ideal for almost every
platform out there it seems there’s one ‘hardly-used’ platform that has
rotten OpenGL support wry grin
incidentally I haven’t tried. I also haven’t tried to get SDL running
under windows yet either.
windows devel env: windows 2000 + either vb6 or mingw32. I do have
both… and don’t know which to use with SDL sigh.

TIA and G’day, eh? :slight_smile:
- Teunis

I prefer OpenGL on Windows as well.
I am developing a game (for now it’s just planning it and making lot’s of
proof-of-concept demos) for Windows (Windows only for now, but with
minimum platform-specific code, so it could be ported to Linux in the
future) using OpenGL and SDL. All works fine. Using Windwos XP + Delphi.
Actually, I recently convinced my project (the aforementioned game)
parthner to forget about the idea of using DirectX, and not only because
SDL doesn’t support it.

Here’s what I wrote to him:

PLEASE open the following links and take a look at them. No need to read
every line, but merely go over it and get the point.

http://linux.oreillynet.com/lpt/a/linux/2001/09/21/sdl.html

http://www.macslash.com/articles/02/03/28/0837245.shtml
(read 2nd comment - “Thanks for making me laugh!”; skim other comments
if you want)

http://www.scorpioncity.com/djdirectxtut.html
(see 1st in the Resources - “A very nice cross-platform (Linux, Windows,
MacOS, BeOS) games API. Wraps DirectX on Windows. Uses OpenGL for 3D.
I’ve been using this for a little while now and I like it very much.
Free, with source code (GPL). Much easier to use than DirectX, produces
simpler, shorter, cleaner code, and requires less development time to
get going. A bit like “what DirectX should have been”.
(recommendation)”)

http://www.vcnet.com/bms/features/3d.html
(reading this one fully, including the letter in the end, is very
recommended!!!)

http://slashdot.org/articles/01/09/25/0318217.shtml
(OpenGL 2.0 will hopefully replace DirectX alltogether…)

I started this as merely a search of whether it’s possible to use
Direct3D with SDL, and if so - how.
What I found out is that DirectX was used in some places because it
gives you everything - input, sound, graphics, etc. OpenGL is just 3D.
But since there’s SDL, you can use SDL instead of all the DirectX
stuff (and that’s also cross-platform, easier, simpler, etc.), and
OpenGL for your 3D graphics.
So if I first had doubts (as you saw on the last e-mail I sent earlier
today) whether to use only OpenGL or to allow the use of Direct3D, now I
am totally convinced that we should use only OpenGL (yes, and no full
graphics abstraction - which will make life much much easier, but that’s
not the main reason I want to use only OpenGL). For input and all that
stuff we have SDL (and only it - what for example makes stuff simpler
by allowing us to save SDL Key Constants in the Input Configuration),
and for Sound we’ll use one of those libraries (FMod, BASS, SDL_mixer) -
no need to use DirectSound because all of the above use it if possible.

If you really read the links I gave you and you are still not
convinced that we should not use DirectX, please tell me. Don’t think
it’s possible though… :wink:

Please tell me if you’ve found any of the above information useful.

RK.

likely to be able to successfully play and then buy, you can’t do it
with OpenGL anymore.

What do you call all the games shipping that still use OpenGL? This year, and
even next?!?!

likely to be able to successfully play and then buy, you can’t do it
with OpenGL anymore.

What do you call all the games shipping that still use OpenGL? This year, and
even next?!?!

Not For Beginners

If one is lucky enough to have a chipset that’s maker supports OpenGL (I
believe nVidia is a good example but feel free to prove me wrong), OpenGL
is the wrong devel when dealing with people that aren’t computer literate.
And I’m writing something that (hopefully) will get me a job as I have
something of a lack of a visible past portfolio.

but I’m going to continue with:

  • This is wandering off topic.
  • This is not fair. The software I’ve got uses OpenGL at the
    moment. I’m looking to expand my horizons, not be jerked around.
  • also (if it matters) I actually have fairly extensive D3D docs. This is
    what I get for investing when I had the resources to do it… but not
    the time to explore.

so please back off on the “opengl is better” arg. I’m already convinced
everywhere outside of windows. Under windows I can trust that D3D will be
present, run, and be fairly fast especially under newer hardware. Now if
there were a usable OpenGL-1.2 (or newer g) API that operated on top of
D3D as an emu layer that would also solve - as long as it was
redistributable. The whole DirectX stuff may be a bizarre hack but it’s
a very well supported, maintained, and visible hack.

…On Thu, 6 Jun 2002, EvilTypeGuy wrote:

Teunis,

For what it’s worth, SciTech Software (http://www.scitechsoft.com/) has a
product called GLDirect that gives you the OpenGL API on top of DirectX. If
you’re going with a commercial application, you can license GLDirect to be
inside your application. Then you test for the existance of OpenGL, and it
it is not there just use the GLDirect interface to the OGL API. The actual
GLDirect product is $20US for end users that have an OGL program but no
OpenGL support on their system…

-Blake

You want OpenGL 1.2 on D3D? Take a look at
http://www.scitechsoft.com/products/enterprise/gld_home.html
These guy do great software and they have been working with the game
development world for a long time. They are also pretty much all that is
behind the OpenWatcom effort.

	Bob Pendleton

Teunis Peters wrote:> On Thu, 6 Jun 2002, EvilTypeGuy wrote:

likely to be able to successfully play and then buy, you can’t do it
with OpenGL anymore.

What do you call all the games shipping that still use OpenGL? This year, and
even next?!?!

Not For Beginners

If one is lucky enough to have a chipset that’s maker supports OpenGL (I
believe nVidia is a good example but feel free to prove me wrong), OpenGL
is the wrong devel when dealing with people that aren’t computer literate.
And I’m writing something that (hopefully) will get me a job as I have
something of a lack of a visible past portfolio.

but I’m going to continue with:

  • This is wandering off topic.
  • This is not fair. The software I’ve got uses OpenGL at the
    moment. I’m looking to expand my horizons, not be jerked around.
  • also (if it matters) I actually have fairly extensive D3D docs. This is
    what I get for investing when I had the resources to do it… but not
    the time to explore.

so please back off on the “opengl is better” arg. I’m already convinced
everywhere outside of windows. Under windows I can trust that D3D will be
present, run, and be fairly fast especially under newer hardware. Now if
there were a usable OpenGL-1.2 (or newer g) API that operated on top of
D3D as an emu layer that would also solve - as long as it was
redistributable. The whole DirectX stuff may be a bizarre hack but it’s
a very well supported, maintained, and visible hack.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-----------------------------------------+

  • Bob Pendleton, an experienced C/C++/Java +
  • UNIX/Linux programmer, researcher, and +
  • system architect, is seeking full time, +
  • consulting, or contract employment. +
  • Resume: http://www.jump.net/~bobp +
  • Email: @Bob_Pendleton +
    ±-----------------------------------------+