Page 1 of 1

Making the 3D Fundamentals framework cross-platform

Posted: November 21st, 2017, 2:30 am
by TheTask1337
Hi,
I know many programmers prefer Windows for programming, but is there some easy way to make this run on Mac?
I don't know how difficult would this be to use with Metal and if there is any easy way to port it.

Re: Making the 3D Fundamentals framework cross-platform

Posted: November 21st, 2017, 2:03 pm
by chili
It could be ported, would not even need metal. Could do with with SDL or similar even.

Re: Making the 3D Fundamentals framework cross-platform

Posted: November 21st, 2017, 4:53 pm
by TheTask1337
Is it something you plan on doing / would be willing to do for the series? I don't have enough space on my MacBook Pro to run Bootcamp. :cry:

Re: Making the 3D Fundamentals framework cross-platform

Posted: November 21st, 2017, 6:49 pm
by albinopapa
You wouldn't need to run a virtual machine if you used SDL, SFML or GTK+, they're all cross-platform. I wanted to mention it yesterday, but wasn't sure if you were set on Metal or not. You can even look into xCode if you want a graphical IDE.

One thing to note though is when chili goes over hardware 3D stuffs, it will be using the Direct3D 11 API. Though I wouldn't complain if it was using the Vulkan API, :lol:.

Re: Making the 3D Fundamentals framework cross-platform

Posted: November 21st, 2017, 8:10 pm
by TheTask1337
Okay so what you are basically saying is that if I manage to get a window handled by lets say SFML, all the rest of the framework should be pretty much good to go?

Re: Making the 3D Fundamentals framework cross-platform

Posted: November 21st, 2017, 10:46 pm
by cameron
1. First, you would have to switch over the window handling stuff like you said.
2. Next, you would have to switch all the internal d3d stuff over too (OpenGL maybe?)

Then... most of it would be working.

3. Finally, the xaudio2 stuff would need to be switched over to something else.

Perhaps I missed something; however, the point is that there would be much more work involved than switching over the window handling stuff to say sdl or sfml. I'm not saying that it isn't doable, it would just be a lot of work. Pretty much everything except the interfaces would have to be remade.

Re: Making the 3D Fundamentals framework cross-platform

Posted: November 22nd, 2017, 1:08 am
by chili
If you can replace the backend of putpixel with metal/sdl/sfml stuff then you will be good to go. Can also use sdl/sfml to handle window creation and input back-end. One annoying thing is you'll need to translate whatever constants those systems use to windows VK_ keyboard constants so that stuff will work. It's a bit of a project but not unreasonable.