• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Offtopic › Delfino Plaza v
« Previous 1 ... 5 6 7 8 9 ... 64 Next »

Doubt about APIs
View New Posts | View Today's Posts

Pages (2): 1 2 Next »
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Doubt about APIs
01-21-2017, 02:27 PM
#1
ZLRK Offline
Member
***
Posts: 108
Threads: 20
Joined: Jul 2010
Hello.


Some people in other forum already lent me a good hand understanding the concepts, specially by suggesting to watch this:
https://www.youtube.com/watch?v=r0fgEVEgK_k
And before someone comments, yes, I already did a search around internet; still need a bit of help.

With all of that I understood API is kind of a resources "library" to facilitate access, kind of the "includes" one uses in C/C++ for example.

Still, I struggle to understand very well their role. I mean, I was once explained IIRC "for both PCs and game consoles, the ones having all graphics information are games/programs themselves; they then tell the OS to actually *draw* them. How skillful -and *fast*- OS does it depends precisely on the CPU/GPU, the 'drawer' indeed. OS and GPU communicate through GPU drivers". So I thought all the software work should be done solely by the drivers software indeed and that they should be enough. But then what role are APIs doing? Why is there another intermediate layer between OS and GPU hardware?

Also in another thing, this (in)famous MS's .NET... I was told it's neither and API, a programming language, nor a programming environment like Eclipse or JCreator. Then what is it actually? Why so used nowadays?

Thanks very much beforehand.
Find
Reply
01-21-2017, 07:45 PM
#2
JosJuice Offline
Developer
**********
Developers (Some Administrators and Super Moderators)
Posts: 7,995
Threads: 7
Joined: Oct 2014
APIs are not software - they are a specification of how different software can communicate with each other. So for instance, when a game talks to a GPU driver, the way they are talking can be called an API. If you want an analogy, you could say that us speaking English to each other is like programs speaking OpenGL to each other.
Find
Reply
01-22-2017, 05:17 AM
#3
ZLRK Offline
Member
***
Posts: 108
Threads: 20
Joined: Jul 2010
Thanks very much sir.
But, er, what about MS .Net framework?
Thanks again.
Find
Reply
01-23-2017, 03:30 AM
#4
ZLRK Offline
Member
***
Posts: 108
Threads: 20
Joined: Jul 2010
????????????'
Find
Reply
01-23-2017, 03:43 PM
#5
ZLRK Offline
Member
***
Posts: 108
Threads: 20
Joined: Jul 2010
Also in another thing, this (in)famous MS's .NET... I was told it's neither and API, a programming language, nor a programming environment like Eclipse or JCreator. Then what is it actually? Why so used nowadays?
Find
Reply
01-23-2017, 10:45 PM
#6
AnyOldName3 Offline
First Random post over 9000
*******
Posts: 3,491
Threads: 1
Joined: Feb 2012
I'll try and simplify things for you a bit. It involves a restaurant-based metaphor.

In a restaurant, customers show up, order food, are served food, and then (presumably) eat it (although the restaurant staff wouldn't really care if they did something else as long as it didn't ruin the experience of other customers). In this analogy, the menu is an API - it's a specification of requests that customers can make to the waiters, and what to expect to get back as a result of the request. The kitchen staff are a library implementing the API - they actually convert the requests to the thing that was requested, but customers probably wouldn't mind too much if a chef was replaced by a temp worker while they were off sick as long as they still made dishes matching the menu's description. The customers are application software - they make requests to waiters, and are brought the things they requested.

.NET includes a bunch of things, including some APIs (including the specification of the .NET virtual machine, the Common Language Interface/Runtime), some libraries implementing those APIs (although users have the option of using the open-source Mono implementation of the APIs instead), and programming language specifications for languages including C# and Visual Basic (although it's theoretically possible to implement these languages completely independent of .NET). It's associated with the Visual Studio development environment, but it can also be used with a text editor and command-line tools, or alternative IDEs such as MonoDevelop/Xamarin Studio. It includes everything you need to write application software, and it's commonly used because it's quite easy to do a wide range of things with it (although that doesn't mean that it's the best solution to everything).
OS: Windows 10 64 bit Professional
CPU: Intel i5 4670K @3.4GHz... for now @4.6GHz with a quick and dirty (yet stable) OC. May get faster in a bit before the end of time.
RAM: 16GB (Down from 24 GB after some was given to siblings)
GPU: Radeon Vega 56
Find
Reply
01-24-2017, 03:20 AM
#7
ZLRK Offline
Member
***
Posts: 108
Threads: 20
Joined: Jul 2010
@AnyOldName3:
Thanks sir.

From my first post, I reviewed again yotubue link, but also the posted comment: I thought the application was able to directly communicate with the GPU hardware through GPU's driver, being it all indeed! Which was the reason I thought API was just a library (an *include* set) which purpose was not clear at all for me. But with yours and @JosJuice 's comments, it'd seem application cannot actually directly talk to GPU, but instead needs kind of an interpreter, "translator", which is the waiter, the API? Is it that kitchen staff are the *real* libraries, or the actual *GPU drivers*, and the kitchen itself the actual GPU hardware?

This is hell complicated! I wanted to believe in the "include" easy analogy just because that's ALL I learned back in school...

Regarding .NET, so it's actually a kind of monstruous entire "virtual machine" like Java... But what relation does it have with *other* languages? Does it totally include them like a d**n giantic monster devouring them?
Find
Reply
01-25-2017, 11:41 AM
#8
ZLRK Offline
Member
***
Posts: 108
Threads: 20
Joined: Jul 2010
?????????????'
Find
Reply
01-26-2017, 03:39 AM
#9
AnyOldName3 Offline
First Random post over 9000
*******
Posts: 3,491
Threads: 1
Joined: Feb 2012
I think there's still a little bit of confusion between specification and implementation still here. A specification is similar to an API in that it describes some things, and what they mean, but on its own is useless, and APIs are/have specifications (e.g. the Kronos group releases specifications for OpenGL and Vulkan, which are APIs). The Kronos group also release a specification for the language OpenCL, and like OpenGL and Vulkan, it's up to other entities (including Intel, NVidia and AMD) to implement it. Similarly, C++ has its specification released by the International Standards Authority, but it's actually implemented by GCC, Visual Studio and Clang etc. The languages Microsoft include with .NET work in a similar way - Microsoft releases a specification, and other organisations are free to implement it. It's just the case that Microsoft also are one of the organisations that implement the languages, too.

One of .NET's components is the .NET virtual machine, which is exactly analogous to java's JVM, but that doesn't mean it's necessarily monstrous - there are some JVM implementations which run on the chips in credit cards, and they've not got the power or space to deal with anything particularly complex.
OS: Windows 10 64 bit Professional
CPU: Intel i5 4670K @3.4GHz... for now @4.6GHz with a quick and dirty (yet stable) OC. May get faster in a bit before the end of time.
RAM: 16GB (Down from 24 GB after some was given to siblings)
GPU: Radeon Vega 56
Find
Reply
01-26-2017, 04:57 AM
#10
ZLRK Offline
Member
***
Posts: 108
Threads: 20
Joined: Jul 2010
So all of this is about specifications and implementations, like TCP/IP being the specification and NIC manufacturers the implementators...
So .NET actually *implements* several other languages like C/C++, aside of having its own .NET vm, which may be the reason it's SO used by windows devs...

So games (applications) actually cannot *directly* talk to GPU driver; they do need an interpreter, "translator", which would be the API.
However, being this the case I think I found one of the reasons of my confussion. The restaurant analogy makes API look like a MENU rather than a standard or something else, thus any beginner would/should understand it certainly like an include library instead of a language translator!!

WTH with this?

Thanks again.
Find
Reply
« Next Oldest | Next Newest »
Pages (2): 1 2 Next »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode