11 Replies - 1295 Views - Last Post: 27 January 2011 - 09:41 AM

#1 heyoman1  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 64
  • View blog
  • Posts: 735
  • Joined: 30-November 09

Are they really portable?

Posted 25 January 2011 - 02:02 PM

.dll files only run on windows. Yet, on some APIs (SDL, GLUT, Love2D), they claim they are cross platform, YET they rely on .lib's and .dll's. How can an API boast that they are cross platform when they can only run on Windows?
Is This A Good Question/Topic? 4
  • +

Replies To: Are they really portable?

#2 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5436
  • View blog
  • Posts: 11,662
  • Joined: 02-June 10

Re: Are they really portable?

Posted 25 January 2011 - 02:12 PM

Quote

YET they rely on .lib's and .dll's.

Who says?

I can imagine a DLL that is completely self contained and doesn't make use of another framework. It just depends on its purpose. One of the surest ways to protect your code from being killed by someone else's framework is to NOT use someone else's framework.

I don't know any of the API's you mentioned but I would guess that Love2D is some type of drawing API. That's all math performed on a bitmap. You don't have to use someone else's code to do math.
Was This Post Helpful? 0
  • +
  • -

#3 heyoman1  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 64
  • View blog
  • Posts: 735
  • Joined: 30-November 09

Re: Are they really portable?

Posted 25 January 2011 - 02:23 PM

SDL - Famous for making 2D games easier to make (C/C++)
GLUT - Makes OpenGL more portable by taking away the hassle of making OS specific windows. Also has additional methods.(mainly C/C++. Has ports for several languages)
Love2D - 2D engine that uses Lua as it's language.

I even tested this theory out by sending a test build of a project i was doing with Love2D to different friends that use Ubuntu and Mac OSX. Both said it would work because the .dll's couldn't be read.

This post has been edited by heyoman1: 25 January 2011 - 02:25 PM

Was This Post Helpful? 0
  • +
  • -

#4 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5436
  • View blog
  • Posts: 11,662
  • Joined: 02-June 10

Re: Are they really portable?

Posted 25 January 2011 - 02:54 PM

Do they maybe mean they produce DLL's for multiple platforms, but each DLL has identical publicly available calls?

So in Windows your code can all the method FlipImageHorizontal and a new image that is flipped is returned - and you can make the exact same call in MacOS, only it will be answered by the MacOS DLL.

So it isn't the exact DLL file that is portable, but the API functionality that is cross platform-ly available.

I do this same thing with a couple vendor provided DLL's where one is 32bit and one is 64bit. My program has to check if it is running on a 32bit Windows and load the 32bit DLL, or the 64bit DLL if on a 64bit version of Windoze. But the rest of the program doesn't know the difference because it is just calling a method by name.
Was This Post Helpful? 0
  • +
  • -

#5 5thWall  Icon User is offline

  • Occasional Member

Reputation: 31
  • View blog
  • Posts: 530
  • Joined: 17-September 08

Re: Are they really portable?

Posted 26 January 2011 - 09:31 AM

The built files are only portable if they run on some intermediary. Java .class files are portable because they run on the JVM, which in turn has different builds for different systems. For stuff like Love2D which is compiled, portable means that the code is portable. You can download the source for Love2D and build it on any system.

If you want to share your game with your friends, either they will need to download Love2D for their system (or build it from source if they're into that). This is the same as if you had written a program in Ruby or Python and wanted to share. Your friends would need to have Ruby or Python installed to use it.

Another option is that you could grab the compiled versions of Love2D for Mac and Linux and try to package them for distribution.
Was This Post Helpful? 0
  • +
  • -

#6 heyoman1  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 64
  • View blog
  • Posts: 735
  • Joined: 30-November 09

Re: Are they really portable?

Posted 26 January 2011 - 12:18 PM

Would bundling my program with all the resources it needs for all OS's count as making portable? So far, I only see Love2D have a zip for Mac OSX. I can just unzip that and put all the frameworks and stuff into the program folder.

This post has been edited by heyoman1: 26 January 2011 - 12:20 PM

Was This Post Helpful? 0
  • +
  • -

#7 BetaWar  Icon User is online

  • #include "soul.h"
  • member icon

Reputation: 1138
  • View blog
  • Posts: 7,109
  • Joined: 07-September 06

Re: Are they really portable?

Posted 26 January 2011 - 12:28 PM

I would say that will depend on the langauge you are using. If you are using C/C++ then no. This is because C/C++ are compiled down to assembly instructions which depend on the OS and system architecture as to how they are layed out (for instance Linux has different assembly conventions than Windows or Mac).

The idea between these frameworks which claim to be cross-platform is that you can take your source code (from a game or whatever) you wrote on Linux, put it in Windows and compile it to get the same final product without having to worry about all the different ways of calling the functionality. This, however, doesn't mean that one executable will work on all platforms. Additionally, if you are using something like OpenGL on Linux to make a program and want to make it on Windows as well that Windows box will need to have OpenGL installed on it.

Hopefully that makes sense.
Was This Post Helpful? 2
  • +
  • -

#8 5thWall  Icon User is offline

  • Occasional Member

Reputation: 31
  • View blog
  • Posts: 530
  • Joined: 17-September 08

Re: Are they really portable?

Posted 26 January 2011 - 01:53 PM

Yes, I guess that would make it portable... but it seems like a kludgy way to go about it, and you'd probably need to include instructions on how to run it on each platform. If you just distributed a .love file and showed people where to download the framework, that would also make your app portable. Probably easiest on your users would be to make a bundle for each platform.
Was This Post Helpful? 0
  • +
  • -

#9 heyoman1  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 64
  • View blog
  • Posts: 735
  • Joined: 30-November 09

Re: Are they really portable?

Posted 26 January 2011 - 03:48 PM

So it's better to make OS specific copies than 1 giant file that supposedly supports different OS's?
Was This Post Helpful? 0
  • +
  • -

#10 Dogstopper  Icon User is offline

  • The Ninjaducky
  • member icon



Reputation: 2870
  • View blog
  • Posts: 11,021
  • Joined: 15-July 08

Re: Are they really portable?

Posted 26 January 2011 - 03:51 PM

I know that SDL in Windows has DLLs, but in my Linux Distro, they take a different form (and what exactly, I am not sure). However, if I write the code ON my windows machine, I can take that same source code and compile it on Windows or Mac or whatever other machine I wanted...
Was This Post Helpful? 0
  • +
  • -

#11 5thWall  Icon User is offline

  • Occasional Member

Reputation: 31
  • View blog
  • Posts: 530
  • Joined: 17-September 08

Re: Are they really portable?

Posted 26 January 2011 - 04:11 PM

From what little I know about your specific case, I'd say yes. Though depending on your audience you might be able to get away with asking them to download the appropriate packages and just distributing the .love file (just like you could distribute a .jar if you were sure your users would have or be willing to install the java runtime). If your audience isn't really technical then go with packaging separate files for each OS.
Was This Post Helpful? 1
  • +
  • -

#12 SpeedisaVirus  Icon User is offline

  • Baller
  • member icon

Reputation: 114
  • View blog
  • Posts: 855
  • Joined: 06-October 08

Re: Are they really portable?

Posted 27 January 2011 - 09:41 AM

The GLUT api is cross platform in the sense that writing code utilizing glut whether you are using glut on windows or glut on linux. A framework itself like this usually either has an implementation for each platform due to system dependencies and/or is compiled for each supported platform. Portable it is not...not in the drop in and use sense usually.

I can't say much about many of these frameworks that were mentioned but according to the GLUT site it is portable because it depends on OpenGL which has implementations on a number of systems. According to their site, if it has OpenGL, you could probably compile the GLUT source and use it.

EDIT: Don't take my word for fact about GLUT. That was my take away from 20 seconds of skimming

This post has been edited by SpeedisaVirus: 27 January 2011 - 09:43 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1