cwinapi

API & Compiler for C in Windows 7, primary concern is


I've been using a language for Garry's mod (A Source-engine based physics sandbox game) called Expression 2 for a while now, Expression 2 is very heavily based on C, in fact it's almost exactly the same except for the fact it uses ,'s or line-returns to end lines, rather than ;'s. At the suggestion of a friend I gave a C tutorial a look and I found the syntax and language instantly familiar, albeit with a number of scary looking semi-colons.

In the past I've dabbled with writing emulators in Expression 2 and have had some success with a chip8 emulator and a few headaches working on a Gameboy emulator. You see, one problem with Expression 2 is the lack of proper bitwise functions and switch-case statements (Something I'm really looking forward to using in C). Likewise as the language is being interpreted ontop of LUA it's naturally very slow, great for making stuff in garry's mod but not much else.

The advantages of course of Expression 2 are easy interaction with the Game itself, it was built just to do that, working with C however would be the opposite, where interacting with the OS can be the most frustrating part.

First of all I'm wondering what are the best available C compilers for Windows 7 64bit out there? I've given Visual C++ a whirl but find its myrid of options and configurations daunting and as someone who's just starting out I'd really like a compiler that just takes my .c or .txt or whatever and outputs an application, I don't need all the bells and whistles when I'm just starting out.

Secondly as I'd like to write emulators I need a good method of drawing on the screen, as per my understanding that requires an API to interact with the OS? What's the best API for Windows 7 64 in terms of ease of use and 2d drawing? and where can I find some good documentation or tutorials on said API?

Thank you for reading, I'm really looking forward to getting stuck in with some real programming but unfortunately tutorials usually skip over things like choosing a compiler :/


Solution

  • Most will agree that Intel C/C++ compiler still stands unbeaten, but you will be most likely OK with GCC/MinGW or MSVC (although I recommend avoiding MSVC if possible).

    As for the API's. DirectX is Windows native and has best support, but you will be locked to Windows platform, but if that's what you are targeting, DirectX is your best shot I guess.