Spécificités Windows



Windows programs normally start with a WinMain() function, rather than the ANSI C main() routine. Allegro does some magic to make a regular main() work like you expect, but you have to help it out a bit by writing END_OF_MAIN() right after your main() function. If you don't want to do that, you can of course just write a WinMain() in the usual Windows way. If you want to generate a console application, you have to disable this special processing of the main() function by defining the preprocessor symbol USE_CONSOLE before you include allegro.h.

DirectX requires bitmaps to be locked before you can draw onto them. This will be done automatically, but you can usually get much better performance by doing it yourself: see the acquire_bitmap() function for details.

Due to a major oversight in the design of DirectX, there is no way to preserve the contents of video memory when the user switches away from your program. You need to be prepared for the fact that your screen contents, and the contents of any video memory bitmaps, may be destroyed at any point. You can use the set_display_switch_callback() function to find out when this happens.

There are some conflicts between allegro.h and windows.h, so you will have problems if you include both of these from the same source file. If you need to access the Windows headers, #include <winalleg.h> after allegro.h. This will include windows.h for you, doing some magic to make it work correctly.

Drivers: GFX_*/Windows
The Windows library supports the following card parameters for the set_gfx_mode() function:

Drivers: DIGI_*/Windows
The Windows sound functions support the following digital soundcards:

      DIGI_AUTODETECT      - let Allegro pick a digital sound driver
      DIGI_NONE            - no digital sound
      DIGI_DIRECTX(n)      - use DirectSound device #n (zero-based)

Drivers: MIDI_*/Windows
The Windows sound functions support the following MIDI soundcards:

      MIDI_AUTODETECT      - let Allegro pick a MIDI sound driver
      MIDI_NONE            - no MIDI sound
      MIDI_WIN32(n)        - use win32 device #n (zero-based)
      MIDI_DIGMID          - sample-based software wavetable player




Retour au Sommaire