why do some games only work on windows?

760 views

why do some games only work on windows?

In: Technology

7 Answers

Anonymous 0 Comments

Games are rarely made completely from scratch, instead they’re built using existing tools and frameworks which are known as APIs, or application programming interfaces.

An API is a list of documented functions and the parameters they take that perform a known action when called, an example of an API to draw a circle might be:

drawCircle(int x, int y, int radius);

You don’t need to know how it works internally, only that so long as you use the API as documented it should give you the outcome you expect.

Those APIs themselves may be built on other APIs, which may be built on other APIs. In many cases you’ll eventually hit upon an API which is part of the operating system itself.

In gaming, the big one is called DirectX and is the Microsoft API for, amongst other things, game programming. It’s an abstraction layer built around other APIs such as graphics card drivers that presents a unified interface for development on Windows machines (and the XBox consoles).

If you’re writing an application and part of the API hierarchy depends on APIs that are only available on Windows, then the application can only run on Windows.

Now there are two ways around this:

1. Certain APIs are designed to be completely independent of the operating system they run on. Often times these APIs have a general way of doing things, but can be re-compiled using special flags that will utilise specific operating-system specific APIs for the sake of performance, but the key thing is that their actual API (the functions exposed) don’t change between hardware or operating system type.

2. The reverse of 1, people take platform specific APIs and emulate them by creating a substitute version on a platform that was not intended to run them. This is how the popular Linux application ‘Wine’ works.

You are viewing 1 out of 7 answers, click here to view all answers.