LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-26-2008, 09:04 AM   #1
offRails
LQ Newbie
 
Registered: Apr 2008
Posts: 4

Rep: Reputation: 0
Lightbulb DirecX - like SDK for Linux - good idea for a project?


Hello everyone!

I am a software engineering student and for a final project of my studies I
consider developing a game development SDK for Linux, that will provide a direct
access to hardware - Something like implementing the concept of DirectX on
the Linux platform.

I'm new to Linux world, and
I'd like to have some tips on this subject, more specificly - How large will be the
performance gain from the direct access to hardware,and at all if there's a motivation
to implement it?

Are there sources to get some existing game development SDKs performance statistics?

Or any other ideas or tips are also welcome.


Tell me what you think!
 
Old 04-26-2008, 09:12 AM   #2
rubadub
Member
 
Registered: Jun 2004
Posts: 236

Rep: Reputation: 33
Here's some others that are already established, but you may want to trawl through sourceforge or the such like for a project to get involved with or take over. I tend to gravitate towards irrlicht when doing graphics projects because of the licence...
 
Old 04-26-2008, 10:15 AM   #3
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
For some odd reason, I wasn't able to find SDL itself in the Wikipedia link rubadub posted.

Anyway, definitely look at SDL first, before going any farther in your quest:

http://www.libsdl.org/

IMHO .. PSM
 
Old 04-26-2008, 10:32 AM   #4
rubadub
Member
 
Registered: Jun 2004
Posts: 236

Rep: Reputation: 33
It's listed as 'Simple DirectMedia Layer' here. But I had to see what SDL Collide was.

The other thing I meant to mention is that irrlicht depends upon other graphics libraries (well you choose which to use, opengl, sdl, directx, software).
 
Old 04-26-2008, 01:11 PM   #5
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi, Rubadub -

I assumed I just didn't have enough coffee :-) The link you posted included a bunch of SDL-based libraries... but it didn't say anything about SDL itself!

offRails - I'd suggest briefly scanning the following links, in the following order:

1) Main graphics libraries (DirectX, OpenGL and SDL):
http://en.wikipedia.org/wiki/Graphics_library

2) More detail on SDL:
http://en.wikipedia.org/wiki/Simple_DirectMedia_Layer

3) Lots more detail on SDL:
http://www.libsdl.org/

4) High-level comparison with DirectX:
http://en.wikipedia.org/wiki/DirectX

5) The previous Wikipedia link to a bunch of different graphics ibraries; some more specialized, some SDL-based, others not...

Bottom line:
I don't think the world needs another graphics library.

But all of the Open Source libraries could use help making them easier to use (for folks accustomed to the warm, fuzzy ... but ultimately *restrictive* Visual Studio paradigm). And any of them can be taken in exciting new directions nobody ever thought of ... or thought possible.

You might be just the guy to make it happen.

Good luck!

Sincerely .. PSM
 
Old 04-26-2008, 07:11 PM   #6
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by offRails View Post
I am a software engineering student and for a final project of my studies I
consider developing a game development SDK for Linux, that will provide a direct
access to hardware - Something like implementing the concept of DirectX on
the Linux platform.
There is already OpenGL available, along with SDL (with SDL_image, OpenAL, pLib, and bunch of other game-related packages like Allegro, etc. Also, Wine has already implemented part of DirectX functionality.

BTW, you should point, at least, which part of DirectX you'd like to implement (DirectInput, DirectMusic, DirectShow, Direct3D, DirectSetup, D3DX, DirectXFile). This all requires a team and several years of work. So I suggest supporting existing projects instead.


Quote:
Originally Posted by offRails View Post
I'm new to Linux world, and
I'd like to have some tips on this subject, more specificly - How large will be the
performance gain from the direct access to hardware,and at all if there's a motivation
to implement it?
I think that gain will be minimal, and there is a little need to implement DirectX on Linux, since there are already enough portable game-development-related libraries. Besides, modern video chips have too much functionality to communicate with them directly and efficiently. Supporting existing projects (like SDL) will be more useful. Besides, if you are looking for working with 3D graphics, you better use OpenGL - it's more portable, and you'll run into less trouble when you'll need to dynamicaly generate mesh which topology changes every frame. (IMO) With OpenGL writing programs are simpler and more fun, so you can concentrate on your task instead of dealing with API.

Quote:
Originally Posted by offRails View Post
Are there sources to get some existing game development SDKs performance statistics?

Or any other ideas or tips are also welcome.
The game-related SDK's, libraries and technologies I know of:
1) OpenGL (3D). http://www.opengl.org . if you are interested in shaders, I also recommend to read GLSL (GL shader language) specification.
2) OpenAL ((3D) sound) http://www.openal.org , originally developed by LOKI, to make porting windows games easier.
3) SDL, also known as libsdl (generic cross-platform framework with OGL support. Something like DirectDraw, Direct3D, DirectInput and DirectSound put together ). There are many more those SDL_* libraries.
http://www.libsdl.org
4) SDL_image (loading SDL_surfaces, something like D3DXLoadTexture replacement)
5) SDL_sound, SDL_mixer (sound packages, 3D and music)
6) GLEE, GLEW (detecting OGL extensions). From those GLEE is less trouble when porting application to Windows.
7) OGLFT, FTGL - D3DXFont replacement for OpenGL.
8) libmikmod - tracker music, can be used as a simple DirectMusic replacement, automatically used (so you won't need to use it directly) by SDL, SDL_mixer or SDL_sound packages - don't remember which one exactly. I don't know if it offers dynamic music feature that was available in DirectMusic (IDirectMusicCompuser and other interfaces).
9) Allegro library. Never used that one.
10) pLib. "Portable game library". Never used this.
11) Also take a look at NVSDK (NVidia software development kit). Many OpenGL from there compile and run on linux without much problems)
12) many many more. I suggest to search internet with google, and log into any gentoo's ftp repository and look for all SDL_*.tar.gz files to get the idea of what is available. In fact, there are tons of packages available, including OpenSource 3D boolean support(gts), physics (OpenDynamicsEngine), and whatever you'll need.

Quote:
Originally Posted by offRails View Post
Tell me what you think!
I think you better take a look at OpenGL/SDL, instead of trying to reimplement DirectX (IMO, it is pointless - too much work, too little gain), since WINE already reimplemented most part of it (Direct3D. You can create and run Direct3D9 windows application with shader support on Linux without much trouble, although I do not reccomend this), and DirectX (to be more exact - Direct3D, when compared with OpenGL) is quite inflexible, less intuitive and requires more coding for simpler tasks. I've worked with DirectX for some time (since 2002 or 2003), so I suppose I have right to say that. After Direct3D/D3DX/HLSL/ASM shaders, working with OpenGL/SDL/GLSL looks like a dream come true on Linux, but this also annoyance when porting program back to windows (if you ever will do that), due to Windows troublesome OpenGL implementation - WinXP's officially support OpenGL 1.1 or something like this, newer version support is added by Video Drivers, and this requires that you use GLEE, GLEW or something like that to detect OpenGL version, available functions and supported extensions (well, On Windows there were D3DCAPS9-related troubles with DirectX, so that's not much difference). Linux don't have those OpenGL troubles.

Last edited by ErV; 04-27-2008 at 01:18 AM.
 
Old 05-03-2008, 06:16 AM   #7
offRails
LQ Newbie
 
Registered: Apr 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Thanx for the advice, guys!

I followed the recommendation to investigate SDL, I used the book "Programming Linux Games"
by John R. Hall as a source of information.

So far, I found out that automatic detectoin of video hardware acceleration, detecting available video modes could be an useful thing to develop for SDL, and also to make an extended threads mechanism. Right now I'm investigating the issues of networking, input and audio, so if you have a further advice/recommendations/ideas - I'd like to hear it!
 
Old 05-03-2008, 08:25 AM   #8
axelraider
LQ Newbie
 
Registered: May 2008
Posts: 5

Rep: Reputation: 0
The Problem with DirectX is the path it is taking. Let me Explain.

DirectX in every version of windows was used to take hostage of gamers. The mainstream developers stuck to DirectX itself. Combined with the bloatware that windows can be along with more and more shaders, consumers in every generation of games are forced to upgrade at least one piece of hardware and can't get max performance. DirectX however in its defense has been a good implementation up until the end of version 9.

DirectX10 optimized some directX9c code. Nothing new exists in DirectX10, just a lot more of DirectX9 and more features to bloatware an image beyond belief using the same shader models. DirectX 10.1 is the one that really screwed things.....by forcing every gamer to use x4AA regardless the resolution. If you play at 2560 x 1600, you are more likely to get screwed in your framerate. Anyone knows Anti Aliasing loses its purposes at high resolutions and does more harm than good. I know this from personal experience that Vista gives 20% less framerate than on Vista without AA, but with the forced AntiAlliasing, I lose around 70% performance at that resolution making current games unplayable. Windows XP 64-bit actually gives 15 - 24% more performance than XP 32-bit (Ive tested this) on games that have 64-bit mode implementations to use more of the registers that they have available for the process.

The people at ID were smart. They knew when DirectX started becoming heavy shader oriented that it was to steal money from customers by bloatwaring Operating Systems and games as much as possible to force customers to upgrade Operating Systems and Hardware, so in all ID games, they have concentrated on OpenGL to make their games.

The problem with DirectX is that microsoft controls its development as it is their product. If we simulate or create DirectX for Linux, that means simulating Microsoft's creation and having to match on par all successes and failures. The reason people go from Windows to Linux is for a better life and to escape the bloatware.

I think the best thing to do to move forward is to work with OpenGL. It has far more independence than DirectX.
 
Old 05-03-2008, 02:38 PM   #9
dmail
Member
 
Registered: Oct 2005
Posts: 970

Rep: Reputation: Disabled
Ok enough of the windows bashing.
Fact one. Visual Studio is the best IDE full stop.
Fact two. DirectX is far supperior to OpenGL as well they are different things.

"The Problem with DirectX is the path it is taking." You could also say The Problem with OpenGL is the path it is taking, or it may take well at least it has been reported and will arrive at some point before computers are a thing of the past.

Quote:
I am a software engineering student and for a final project of my studies I
consider developing a game development SDK for Linux, that will provide a direct
access to hardware - Something like implementing the concept of DirectX on
the Linux platform. I'm new to Linux world...
This is a bad idea, did you talk this over with your project supervisor. Hmm I would be surprised if this project was given the OK and you could get a supervisor, so is this just a proposal?

You seem to have shifted your idea in later posts but I would question what is it that you want to do now, is it as paulsm4 said
Quote:
But all of the Open Source libraries could use help making them easier to use ( then some crap ).
If not then I assume that the following is still your aim
Quote:
...direct
access to hardware...
Could you explain this please, what hardware do you want direct access to? network device, inputs (pad/keyboard/mouse...) as graphics cards have really low access already.
 
Old 05-03-2008, 02:52 PM   #10
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by axelreader
Nothing new exists in DirectX10
There are Geometry Shaders, which are available in DirectX 10 only, although you can make something nearly similar (with the cost of CPU usage) with either dynamic buffers or Raw OpenGL.

Quote:
Originally Posted by dmail View Post
Fact two. DirectX is far supperior to OpenGL as well they are different things.
If they are different, perhaps you could then try to compare Direct3D to OpenGL, SDL to DirectInput/DirectSound, instead of saying that DirectX is superior? That would be fair, at least. By the way, IMO it is bad idea to present your opinions/tastes/thoughts as "facts". (not in the mood for flamewars, so I won't describing all the troubles I was getting with both DirectX/Visual Studio (i hated several bugs and intellisense...) for last years) In short: Direct3D is rather clumsy, Platform-Dependant, exist on windows only and is quite inflexible. As long as you don't do anything interesting - it'll be fine, but try to perfectly chose visible faces in the selected level - you'll have to use dynamic buffer, and will end writing OpenGL emulator...

Last edited by ErV; 05-03-2008 at 02:55 PM.
 
Old 05-03-2008, 02:59 PM   #11
dmail
Member
 
Registered: Oct 2005
Posts: 970

Rep: Reputation: Disabled
Quote:
If they are different, perhaps you could then try to compare Direct3D to OpenGL,
Same, pretty much anything that can be done with OpenGL can be done with Direct3D, it just requires using a different API.

Quote:
By the way, IMO it is bad idea to present your opinions/tastes/thoughts as facts.
Well they are facts hence "Fact" and it was in response to the following comment which in hind site I should have quoted in the post.
Quote:
I think the best thing to do to move forward is to work with OpenGL. It has far more independence than DirectX.
Quote:
SDL to DirectInput/DirectSound,
SDL nice clean interface easy to use.
DirectInput - crap and already dropped by MS IIRC
DirectSound - good yet being phased out by MS.

Last edited by dmail; 05-03-2008 at 03:02 PM.
 
Old 05-03-2008, 06:01 PM   #12
axelraider
LQ Newbie
 
Registered: May 2008
Posts: 5

Rep: Reputation: 0
Quote:
Originally Posted by ErV View Post
There are Geometry Shaders, which are available in DirectX 10 only, although you can make something nearly similar (with the cost of CPU usage) with either dynamic buffers or Raw OpenGL.


If they are different, perhaps you could then try to compare Direct3D to OpenGL, SDL to DirectInput/DirectSound, instead of saying that DirectX is superior? That would be fair, at least. By the way, IMO it is bad idea to present your opinions/tastes/thoughts as "facts". (not in the mood for flamewars, so I won't describing all the troubles I was getting with both DirectX/Visual Studio (i hated several bugs and intellisense...) for last years) In short: Direct3D is rather clumsy, Platform-Dependant, exist on windows only and is quite inflexible. As long as you don't do anything interesting - it'll be fine, but try to perfectly chose visible faces in the selected level - you'll have to use dynamic buffer, and will end writing OpenGL emulator...

As a game programmer myself working for top companies out there....they have us deal with DirectX. We don't like the performance hit we take when testing out different resolutions. Our QA personnel reports far too many graphical bugs and errors.

It was our media department and Graphic Artists working on Texturing along with the mappers who spoke out against the x4AA. After listening to them, we tried a test using an 8800 GTX SLI configuration at 1680 x 1050 set to DirectX 10.1 Mode. The result was around a framerate of 20 - 30 in what we were working on. Our framerate was in the single digits at 2560 x 1600.

When we tried running in DirectX 10 mode (Not 10.1), the whole system defaulted into DirectX9c compatability mode and our framerate was over 150 . We came to the conclussion that DirectX 10.1 has bugs that really killed our framerate beyond the x4AA and its unstable at this time. Its implementation was rushed, that after a few weeks, we decided to join the long list of companies refusing to make products in DirectX 10.1.

Our stance is DirectX9c with DirectX10 support. A lot of us didn't like the first service pack for Vista and a lot of us here do not approve of the Operating System. We also enjoyed success on the consoles that we decided to primarily develop for the consoles as well, while we work on porting to PC later.

It because of Windows Vista that a lot of us have resolved to run Linux as our primary operating system with an XP dual boot. We approve of XP and like it very much...but we believe there was no need to even develop an implementation like Vista to begin with....It cost our company a lot to upgrade hardware and learn DirectX 10.
 
Old 05-04-2008, 03:15 PM   #13
offRails
LQ Newbie
 
Registered: Apr 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Ok, so after we've vented some steam on DirectX, I'll put this another way:

As it's pointless to create a game API from scratch, as I was advised here, I thought it's maybe a good idea to add something to SDL. Then comes the question: "What can I do to make it better?" And after a brief comparision to DirectDraw, I thought it could be useful that SDL will take advantage of graphics card acceleration automatically,which it's currently does not,and DirectDraw does. Same goes to sound, and also the thread mechanism
in SDL offers a lot of room for extension.

All those may come at the cost of platform dependency, but there may be programmers who are willing to
sacrifice it for easier life, I guess.

I'm currently searching for other possible ideas, and then I'll choose what I'll finally do.

And I'd like to ask anyone who's familiar with SDL, or just into game programming, to throw some ideas/issues.

Quote:
This is a bad idea, did you talk this over with your project supervisor. Hmm I would be surprised if this project was given the OK and you could get a supervisor, so is this just a proposal?
Well, I have a supervisor, and all the research is for writing an extended porposal.

Bad idea? Even to try add some stuff to SDL? Does everybody agree?
 
Old 05-04-2008, 04:11 PM   #14
rubadub
Member
 
Registered: Jun 2004
Posts: 236

Rep: Reputation: 33
SDL isn't a game engine its a graphics library, here's some game engines, and that doesn't include physics engines or ai libraries...
 
Old 05-05-2008, 03:07 AM   #15
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by offRails View Post
Then comes the question: "What can I do to make it better?"
SDL should have wishlist or something like that.
http://www.libsdl.org/gsoc-ideas.php

Quote:
Originally Posted by offRails View Post
And I'd like to ask anyone who's familiar with SDL, or just into game programming, to throw some ideas/issues.
Force Feedback support.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux w/o internet a good idea? cal_gundert05 Linux - General 10 05-10-2007 11:39 PM
Good idea/bad idea: interface colors introuble General 5 10-30-2006 01:33 PM
Old versions of linux distros - is it a good idea to use them on old machines? pwc101 Linux - Laptop and Netbook 4 02-28-2006 04:54 PM
Idea for a project with linux(es) - What's possible? kanzure Linux - Newbie 1 03-14-2004 11:59 AM
linux multimedia forum.. who thinks it is a good idea? exodist Linux - Software 10 11-02-2003 08:34 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration