Guest User

win32_handmade.h

a guest
Oct 14th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.02 KB | None | 0 0
  1. #include <windows.h>
  2.  
  3. #define internal static
  4. #define local_persist static
  5. #define global_variable static
  6.  
  7. // A struct that returns the buffer we draw to. Pixels are always 32-bits wide, 0xBBGGRRPP.
  8. struct win32_offscreen_buffer
  9. {
  10.     BITMAPINFO Info;
  11.     void *Memory;
  12.     int width;
  13.     int height;
  14.     int pitch;
  15.     int bytesPerPixel;
  16. };
  17.  
  18. // A struct that returns the size of the window.
  19. struct win32_window_dimension
  20. {
  21.     int width;
  22.     int height;
  23. };
  24.  
  25. // Stuff relating to sound buffer calculations.
  26. struct win32_sound_output
  27. {
  28.     int samplesPerSecond;
  29.     // Todo: Should runningSampleIndex be in bytes also?
  30.     uint32_t runningSampleIndex;
  31.     int bytesPerSample;
  32.     DWORD secondaryBufferSize;
  33.     float tSine;
  34.     int latencySampleCount;
  35.     DWORD safetyBytes;
  36.     // Todo: Add a bytesPerSecond field to simplify math.
  37. };
  38.  
  39. struct win32_debug_time_marker
  40. {
  41.     DWORD OutputPlayCursor;
  42.     DWORD OutputWriteCursor;
  43.     DWORD OutputLocation;
  44.     DWORD OutputByteCount;
  45.     DWORD ExpectedFlipPlayCursor;
  46.     DWORD FlipPlayCursor;
  47.     DWORD FlipWriteCursor;
  48. };
Add Comment
Please, Sign In to add comment