Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I've programmed a couple simple games so far, in C++ as that's my language of choice, all using open source, cross platform libraries, they're great. I'd like to understand how are cross platform libraries written, this is why i want to write a game for windows only without using a library that provides an abstract layer for the technical side of things like input. However i have some general questions.

First of all, is the windows.h library still used (there's so many new technologies and libraries comming in, i can't tell which are outdated since i'm new to this) for the low level communication between a C++ application and Windows? This means handling input, multithreading, etc. Similarly, is winsock.h still the library for network programming under Windows? I know it's very old, though so are OS standards, i'm confused. Are all the libraries that handle networking just wrappers that use winsock.h? Are these libraries maintained by Microsoft, do i need to manualy update them, do they come with the compiler or the OS.

Do cross platform libraries like SFML or Qt use windows.h or do they go lower than that? I know you can get input straight from reading interrupts, but how do you handle f.e. multithreading.

Do Unix systems also provide a library for interfacting with the OS? Does this include things like sockets? Are these libraries used in cross platform libraries?

All of the libraries, no matter the OS, were written first, so there is a way to get to the OS directly without using them, but are low level "tricks" like these used, or do people just use the API provided by the OS for cross platform libraries and then compile apropriate parts of the code depending on the target platform.

share|improve this question
7  
You really should break up your questions into multiple actual questions. –  Tetrad Mar 1 '12 at 18:05
    
which part is confusing, because they seem like specific questions to me –  dreta Mar 1 '12 at 19:04
3  
I mean each of your paragraphs can be its own separate question on the site, since somebody who can answer one might not be able to speak to another, and having singular questions means it's easier for people to find what they need and for you to mark a single answer as accepted. –  Tetrad Mar 1 '12 at 19:06
    
i thought of that, but i'm too incompetent in these areas to ask questions worthwhile of their own topic, sorry, the answers i got so far seem good, though –  dreta Mar 1 '12 at 19:08
2  
I think that, as-is, this qualifies as "overly broad". –  Jim Mar 1 '12 at 19:40

2 Answers 2

up vote 3 down vote accepted

all your questions have same short answer, "YES".

windows.h is still used. also people still use "winsock.h", but there is "winsock2.h" which has provide same API as the "Berkeley sockets" (the one used in linux/unix/etc.) so the later is more common.

in windows working with devices is very restricted, it's either using windows API or using DirectX API. Infact DirectX was introduced to let people use devices directly. so all the libraries should use one of those two. on linux however things are a little bit different. there is a direct access to every device. But all devices usually have some libraries to handle them. for example almost everyone uses OpenAL for audio management.

share|improve this answer
1  
Is there a source for your assertion that "almost everyone uses OpenAL for audio management"? I've never heard of it, though, admittedly I don't program for *nix. –  Richard Marskell - Drackir Mar 1 '12 at 19:07
    
it's cross platform, handles all the calculations for you and there aren't really any sound engines around, there's directsound, but that's for windows only –  dreta Mar 1 '12 at 19:14
    
It was my own statement. but there is some reasons behind it. the first time I saw OpenAL was when I tried to develop an app for IPhone. the standard audio library there was OpenAL, later I saw it's also an standard library for linux/mac. just check their website. you can check the list of games written with OpenAL and see it's even considered standard in windows platform. –  Ali.S Mar 1 '12 at 19:18

Your question is so complicated, but I'll try to answer for some of sub-questions.

Yes, windows.h is still used in cross platform librares. E.g. SMFL:

[...]You can't use OpenGL on Windows without windows.h included first[...]

Unix-like system often get more low-level libraries than Windows. Just look at Linux where you can edit kernel.

If you want to dive into some cross-platform programming just download some open-sourced library and read it's source. You can start with SMFL.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.