Author Topic: OpenGL Conversion  (Read 12957 times)

Goowolgo

  • Regular
  • **
  • Posts: 21
    • AOL Instant Messenger - CaseyAAdams
    • View Profile
    • Facebook
    • Email
OpenGL Conversion
« on: 2008-01-27, 01:25:27 PM »
I'm aware that the creator of SGDK is working on converting the inner working of SGDK2 to opengl. I've looked into what opengl is and from what I understand is that bluemonk willl be replacing all the DirectX functions/calls/whatever with the opengl. If I am not understanding that part correctly...please fill me in.

What I am really trying to get at is when all is converted and so forth, how will this affect the project I am working on now? and what new features would I expect to see?

v6v

  • Clever
  • Fanatic
  • ***
  • Posts: 500
  • Has renamed his project to Galaxy!
    • View Profile
    • My Developer Page!
    • Email
Re: OpenGL Conversion
« Reply #1 on: 2008-01-27, 02:38:07 PM »
I kind of doubt that bluemonkn will make a significant change that'll affect your project negatively. I really can't back that up more than 99.1 percent :-\, but I thing that your project will survive. OpenGL is really for the better though. :-X

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: OpenGL Conversion
« Reply #2 on: 2008-01-27, 05:15:47 PM »
If the conversion away from DirectX is complete, however, some functions may be changed in the code rules.  For example, SGDK2 also uses DirectInput, and while you won't be interacting with that for the most part, one place you do interact with it is in the IsKeyPressed function, which takes a Microsoft.DirectX.DirectInput.Key object as the argument.

While I think it would be a good idea to transfer away from DirectX entirely for SGDK2, I'm not entirely certain this will happen, so you needn't worry entirely, and I also think that this won't affect you too much.  It should be easy to fix most references to DirectX in the rules.

Also, if you just keep using SGDK2 v2.0, you don't have to worry about anything, because you won't be using OpenGL.  The OpenGL system may be an addon that you could import to overwrite the DirectX code, or vice versa, so you can choose which you want to use.

I know that my Weather sample would no longer work with OpenGL unless changes were made, since it draws directly to the screen using DirectX, but if you're not using that, that's not a problem either.
Edward Dassmesser

v6v

  • Clever
  • Fanatic
  • ***
  • Posts: 500
  • Has renamed his project to Galaxy!
    • View Profile
    • My Developer Page!
    • Email
Re: OpenGL Conversion
« Reply #3 on: 2008-01-27, 06:23:08 PM »
So, will you do any changes to the weather effect template?  :-\ :-\ :-\

Richard Kain

  • Regular
  • **
  • Posts: 23
    • View Profile
Re: OpenGL Conversion
« Reply #4 on: 2008-01-28, 04:52:13 PM »
Ideally, the low-level graphic calls will be what is primarily effected. I'm pretty sure that the fmod library being used is not reliant on DirectX, so it should be unnaffected. The player input is an issue, as you would need to substitute something other than DirectX in order to fully separate it from Microsoft's initiative. The ultimate goal of using OpenGL is to disconnect the engine from DirectX, thereby freeing it up for porting to other platforms.

Naturally, there's no reason to abandon code already written. If an OpenGL options is added in the future, I'm sure that the Windows version of the SGDK2 will still allow you the option of using DirectX. You just need to put conditionals in the right places, after all. And again, this is just experimental at the moment. The SGDK2 author is still experimenting with getting OpenGL working on the engine. (I believe he is using the Tao library at the moment, which is friendly for cross-platform C#) If he feels it is impractical, I'm sure that he will likely focus on other features to develop.

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: OpenGL Conversion
« Reply #5 on: 2008-01-29, 06:22:51 AM »
Actually after a few false starts, I'm proceeding with OpenTK, a relatively thin and new OpenGL wrapper that I think has better cross-platform support than Tao.

Tanja

  • Clever
  • Fanatic
  • ***
  • Posts: 606
    • View Profile
Re: OpenGL Conversion
« Reply #6 on: 2008-01-29, 01:04:00 PM »
but do i understand this right, if you once made the change to open gl, i guess you will develop sgdk2 in this way further...
someone who wants to use directx, has to stay on the current version.

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: OpenGL Conversion
« Reply #7 on: 2008-01-29, 04:39:43 PM »
I'm not sure yet.  Ideally, there will be two project templates.  One will be for DirectX and the other will be for OpenGL, and both will be available in SGDK2.1.  The SGDK2 IDE will be pure OpenGL, but the projects could use either technology.  But I'm not sure yet if that will work out the way I plan.

Richard Kain

  • Regular
  • **
  • Posts: 23
    • View Profile
Re: OpenGL Conversion
« Reply #8 on: 2008-01-29, 05:36:03 PM »
but do i understand this right, if you once made the change to open gl, i guess you will develop sgdk2 in this way further...
someone who wants to use directx, has to stay on the current version.

Also, it is worth noting that ultimately, this would only really effect...well...effects. Higher-level shader effects would be the only real difficulty in porting between the two different APIs. And for the most part, I don't think most users of SGDK2 are really looking to push graphical effects quite THAT far. I know that I'm primarily focused on gameplay elements, and eventually sprite artistry. Shader effects are way, way down the line in my development cycle.

Goowolgo

  • Regular
  • **
  • Posts: 21
    • AOL Instant Messenger - CaseyAAdams
    • View Profile
    • Facebook
    • Email
Re: OpenGL Conversion
« Reply #9 on: 2008-01-29, 07:55:16 PM »
I'm not sure yet.  Ideally, there will be two project templates.  One will be for DirectX and the other will be for OpenGL, and both will be available in SGDK2.1.  The SGDK2 IDE will be pure OpenGL, but the projects could use either technology.  But I'm not sure yet if that will work out the way I plan.

So like when we go to file and to create a new project there would just be another choice around that point to choose a DirectX project or OpenGL?

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: OpenGL Conversion
« Reply #10 on: 2008-01-30, 06:11:21 AM »
Exactly

Jam0864

  • Contributor
  • Fanatic
  • **
  • Posts: 744
    • MSN Messenger - marmalade0864@hotmail.com
    • View Profile
    • Jam0864's Content Dump
    • Email
Re: OpenGL Conversion
« Reply #11 on: 2008-01-30, 05:18:01 PM »
so if you compiled your project in opengl, a linux or mac os could run it? or is there furthur porting to do?

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: OpenGL Conversion
« Reply #12 on: 2008-01-30, 06:29:44 PM »
No, SGDK2 would still have to be ported to another environment and run in that environment in order to compile games for that environment.  Or the project created by SGDK2 (C# source code) would have to be loaded into a compiler on the other environment and compiled.  But hopefully having it based on OpenGL will make that easier.

SmartBoy16

  • Contributor
  • Fanatic
  • **
  • Posts: 587
  • Looking for inspiration.....
    • View Profile
    • Email
Re: OpenGL Conversion
« Reply #13 on: 2008-01-31, 12:09:43 AM »
would OpenGL be compatable on more computers (like my old one that im using rigth now for RANAT)
Looking to the skies.....

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: OpenGL Conversion
« Reply #14 on: 2008-01-31, 06:43:49 AM »
I don't know.  I hope it works on at least as many as DirectX did.  I'm using some TextureRectangleNV feature, which might be NVidia-specific, but we'll have to do some testing when I'm done with the conversion to see if it works on some systems where DirectX didn't or, heaven forbid, fails to work on some systems where DirectX worked.  I might have to put some extra time into figureing out how to use OpenGL in a more compatible way if this doesn't work out.  There's another similar feature, and I don't know why they are separate.  (Both features allow the use of textures that are not a power of 2 in size.  For example, if your graphics sheet is 500 pixels wide instead of 512 pixels wide, this feature is necessary.)