Quote Originally Posted by YuriKahn View Post
Hello y'all.

I'm looking for a good description of how to do graphics (simply putting pixels is perfectly fine), keyboard and mouse I/O, and image and sound I/O with winAPI. Does anyone know of a good tutorial/some basic things to know?
I would love to have DOS-esque graphics (easy pixel putting) but sadly that doesn't work any more.

I'm using Windows 7 64-bit with MinGW as a compiler.
What you want to do is create your own little system on top of Windows.
So you need to set up windows in the normal way, with a main window and a message loop.
You then create a window of your own class, call it "raster" or "canvas". This is going to draw your graphics for you. Only you can decide exactly how you want it to work, but a good interface might be setpixel(x, y, rgb), and refresh(). So implement these as messages that the canvas understands - you've got a back buffer which setpixel() writes to, and you blit it out to the screen when you get a refresh(). Probably refresh() calls invalidate rect and generates a redraw message via updatewindow.
The next step is to set up a timer, which ticks at your frame refresh rate. You have a tick() function which is called in response to the timer, and which does your game logic and regenerates the frame. Then you call refesh() on your canvas window.
All graphics can be build on top of setpixel() and getpixel(), and simple graphics can very easily be implemented by calls to setpixel(). However if you want to use fonts, built in geometry routines, and the like, you need to make the canvas more complicated.
The mouse sends a message which you simply intercept, as does the keyboard. You've got to mess about a bit to get the focus into the window you want, which might be the main window or might be the canvas window. Code in response to these messages should be very simple - just set an x, y or put a character into a buffer. Do all your serious processing in tick().