How does video work?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Creature
Member
Member
Posts: 548
Joined: Sat Dec 27, 2008 2:34 pm
Location: Belgium

Re: How does video work?

Post by Creature »

Tomaka17 wrote: - Qt, SDL, etc. are just libraries that are hiding OpenGL or o/s-dependent calls
Libraries like SDL, Qt, Glut, FreeGlut, Allegro, ClanLib, <Insert endless list here> are all libraries that plainly wrap OS-dependent code into one library, usually with a load of preprocessor-defines and #ifdefS. On Windows, there is (I believe) no way to go deeper than the Win32 API (unless you consider driver development deeper), there's no way you can say "Oh, I don't like the Win32 way of handling floppies, I'm going to write my own that uses BIOS interrupts.", cause that just won't work.

In these libraries, you get something like (very basic):

Code: Select all

#ifdef _WIN32
//We're on Windows
#elif defined(__linux)
//We're on Linux.

//Add more platforms here.
#endif
And sometimes even compiler-specific actions are needed:

Code: Select all

#ifdef _WIN32
//We're on Windows
#   ifdef _MSC_VER
     //We're on Windows with Visual C++.
#   endif
#elif defined(__linux)
//We're on Linux.

//Add more platforms here.
#endif
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
Post Reply