home *** CD-ROM | disk | FTP | other *** search
/ PC World 2006 July & August / PCWorld_2006-07-08_cd.bin / system / rivatuner / RivaTuner20RC16.exe / SDK / Include / RTSSSharedMemory.h < prev   
Encoding:
C/C++ Source or Header  |  2006-05-21  |  13.6 KB  |  382 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // This header file defines statistics server's shared memory format
  4. //
  5. /////////////////////////////////////////////////////////////////////////////
  6. #ifndef _RTSS_SHARED_MEMORY_INCLUDED_
  7. #define _RTSS_SHARED_MEMORY_INCLUDED_
  8. /////////////////////////////////////////////////////////////////////////////
  9. // v1.0 memory structure
  10. typedef struct RTSS_SHARED_MEMORY_V_1_0
  11. {
  12.     DWORD    dwSignature;
  13.         //signature allows applications to verify status of shared memory
  14.  
  15.         //The signature can be set to:
  16.         //'RTSS'    - statistics server's memory is initialized and contains 
  17.         //            valid data 
  18.         //0xDEAD    - statistics server's memory is marked for deallocation and
  19.         //            no longer contain valid data
  20.         //otherwise    the memory is not initialized
  21.     DWORD    dwVersion;
  22.         //structure version ((major<<16) + minor)
  23.         //must be set to 0x00010000 for v1.0 structure
  24.     DWORD    dwTime0;
  25.         //start time of framerate measurement period (in milliseconds)
  26.  
  27.         //Take a note that this field must contain non-zero value to calculate 
  28.         //framerate properly!
  29.     DWORD    dwTime1;
  30.         //end time of framerate measurement period (in milliseconds)
  31.     DWORD    dwFrames;
  32.         //amount of frames rendered during (dwTime1 - dwTime0) period 
  33.  
  34.         //to calculate framerate use the following formula:
  35.         //1000.0f * dwFrames / (dwTime1 - dwTime0)
  36.  
  37. } RTSS_SHARED_MEMORY_V_1_0, *LPRTSS_SHARED_MEMORY_V_1_0;
  38. /////////////////////////////////////////////////////////////////////////////
  39. #define OSDFLAG_UPDATED            0x00000001
  40.     //use this flag to force the server to update OSD
  41. /////////////////////////////////////////////////////////////////////////////
  42. // v1.1 memory structure
  43. typedef struct RTSS_SHARED_MEMORY_V_1_1
  44. {
  45.     DWORD    dwSignature;
  46.         //signature allows applications to verify status of shared memory
  47.  
  48.         //The signature can be set to:
  49.         //'RTSS'    - statistics server's memory is initialized and contains 
  50.         //            valid data 
  51.         //0xDEAD    - statistics server's memory is marked for deallocation and
  52.         //            no longer contain valid data
  53.         //otherwise    the memory is not initialized
  54.     DWORD    dwVersion;
  55.         //structure version ((major<<16) + minor)
  56.         //must be set to 0x00010001 for v1.1 structure
  57.     DWORD    dwTime0;
  58.         //start time of framerate measurement period (in milliseconds)
  59.  
  60.         //Take a note that this field must contain non-zero value to calculate 
  61.         //framerate properly!
  62.     DWORD    dwTime1;
  63.         //end time of framerate measurement period (in milliseconds)
  64.     DWORD    dwFrames;
  65.         //amount of frames rendered during (dwTime1 - dwTime0) period
  66.  
  67.         //to calculate framerate use the following formula:
  68.         //1000.0f * dwFrames / (dwTime1 - dwTime0)
  69.  
  70.     DWORD    dwOSDFlags;
  71.         //bitmask, containing combination of OSDFLAG_... flags
  72.  
  73.         //Note: set OSDFLAG_UPDATED flag as soon as you change any OSD related
  74.         //field
  75.     DWORD    dwOSDX;
  76.         //OSD X-coordinate (coordinate wrapping is allowed, i.e. -5 defines 5
  77.         //pixel offset from the right side of the screen)
  78.     DWORD    dwOSDY;
  79.         //OSD Y-coordinate (coordinate wrapping is allowed, i.e. -5 defines 5
  80.         //pixel offset from the bottom side of the screen)
  81.     DWORD    dwOSDPixel;
  82.         //OSD pixel zooming ratio
  83.     DWORD    dwOSDColor;
  84.         //OSD color in RGB format
  85.     char    szOSD[256];
  86.         //OSD text
  87.     char    szOSDOwner[32];
  88.         //OSD owner ID
  89.  
  90.         //Use this field to capture OSD and prevent other applications from
  91.         //using OSD when it is already in use by your application.
  92.         //You should change this field only if it is empty (i.e. when OSD is
  93.         //not owned by any application) or if it is set to your own application's
  94.         //ID (i.e. when you own OSD)
  95.         //You shouldn't change any OSD related feilds until you own OSD
  96.  
  97. } RTSS_SHARED_MEMORY_V_1_1, *LPRTSS_SHARED_MEMORY_V_1_1;
  98. /////////////////////////////////////////////////////////////////////////////
  99. // v1.2 memory structure
  100. typedef struct RTSS_SHARED_MEMORY_V_1_2
  101. {
  102.     DWORD    dwSignature;
  103.         //signature allows applications to verify status of shared memory
  104.  
  105.         //The signature can be set to:
  106.         //'RTSS'    - statistics server's memory is initialized and contains 
  107.         //            valid data 
  108.         //0xDEAD    - statistics server's memory is marked for deallocation and
  109.         //            no longer contain valid data
  110.         //otherwise    the memory is not initialized
  111.     DWORD    dwVersion;
  112.         //structure version ((major<<16) + minor)
  113.         //must be set to 0x00010002 for v1.2 structure
  114.     DWORD    dwTime0;
  115.         //start time of framerate measurement period (in milliseconds)
  116.  
  117.         //Take a note that this field must contain non-zero value to calculate 
  118.         //framerate properly!
  119.     DWORD    dwTime1;
  120.         //end time of framerate measurement period (in milliseconds)
  121.     DWORD    dwFrames;
  122.         //amount of frames rendered during (dwTime1 - dwTime0) period
  123.  
  124.         //to calculate framerate use the following formula:
  125.         //1000.0f * dwFrames / (dwTime1 - dwTime0)
  126.  
  127.     DWORD    dwOSDFlags;
  128.         //bitmask, containing combination of OSDFLAG_... flags
  129.  
  130.         //Note: set OSDFLAG_UPDATED flag as soon as you change any OSD related
  131.         //field
  132.     DWORD    dwOSDX;
  133.         //OSD X-coordinate (coordinate wrapping is allowed, i.e. -5 defines 5
  134.         //pixel offset from the right side of the screen)
  135.     DWORD    dwOSDY;
  136.         //OSD Y-coordinate (coordinate wrapping is allowed, i.e. -5 defines 5
  137.         //pixel offset from the bottom side of the screen)
  138.     DWORD    dwOSDPixel;
  139.         //OSD pixel zooming ratio
  140.     DWORD    dwOSDColor;
  141.         //OSD color in RGB format
  142.     char    szOSD[256];
  143.         //primary OSD slot text
  144.     char    szOSDOwner[32];
  145.         //primary OSD slot owner ID
  146.  
  147.         //Use this field to capture OSD slot and prevent other applications from
  148.         //using OSD when it is already in use by your application.
  149.         //You should change this field only if it is empty (i.e. when OSD slot is
  150.         //not owned by any application) or if it is set to your own application's
  151.         //ID (i.e. when you own OSD slot)
  152.         //You shouldn't change any OSD related feilds until you own OSD slot
  153.  
  154.     char    szOSD1[256];
  155.         //OSD slot 1 text
  156.     char    szOSD1Owner[32];
  157.         //OSD slot 1 owner ID
  158.     char    szOSD2[256];
  159.         //OSD slot 2 text
  160.     char    szOSD2Owner[32];
  161.         //OSD slot 2 owner ID
  162.     char    szOSD3[256];
  163.         //OSD slot 3 text
  164.     char    szOSD3Owner[32];
  165.         //OSD slot 3 owner ID
  166. } RTSS_SHARED_MEMORY_V_1_2, *LPRTSS_SHARED_MEMORY_V_1_2;
  167. /////////////////////////////////////////////////////////////////////////////
  168. #define STATFLAG_RECORD            0x00000001
  169. /////////////////////////////////////////////////////////////////////////////
  170. // v1.3 memory structure
  171. typedef struct RTSS_SHARED_MEMORY_V_1_3
  172. {
  173.     DWORD    dwSignature;
  174.         //signature allows applications to verify status of shared memory
  175.  
  176.         //The signature can be set to:
  177.         //'RTSS'    - statistics server's memory is initialized and contains 
  178.         //            valid data 
  179.         //0xDEAD    - statistics server's memory is marked for deallocation and
  180.         //            no longer contain valid data
  181.         //otherwise    the memory is not initialized
  182.     DWORD    dwVersion;
  183.         //structure version ((major<<16) + minor)
  184.         //must be set to 0x00010003 for v1.3 structure
  185.     DWORD    dwTime0;
  186.         //start time of framerate measurement period (in milliseconds)
  187.  
  188.         //Take a note that this field must contain non-zero value to calculate 
  189.         //framerate properly!
  190.     DWORD    dwTime1;
  191.         //end time of framerate measurement period (in milliseconds)
  192.     DWORD    dwFrames;
  193.         //amount of frames rendered during (dwTime1 - dwTime0) period
  194.  
  195.         //to calculate framerate use the following formula:
  196.         //1000.0f * dwFrames / (dwTime1 - dwTime0)
  197.  
  198.     DWORD    dwOSDFlags;
  199.         //bitmask, containing combination of OSDFLAG_... flags
  200.  
  201.         //Note: set OSDFLAG_UPDATED flag as soon as you change any OSD related
  202.         //field
  203.     DWORD    dwOSDX;
  204.         //OSD X-coordinate (coordinate wrapping is allowed, i.e. -5 defines 5
  205.         //pixel offset from the right side of the screen)
  206.     DWORD    dwOSDY;
  207.         //OSD Y-coordinate (coordinate wrapping is allowed, i.e. -5 defines 5
  208.         //pixel offset from the bottom side of the screen)
  209.     DWORD    dwOSDPixel;
  210.         //OSD pixel zooming ratio
  211.     DWORD    dwOSDColor;
  212.         //OSD color in RGB format
  213.     char    szOSD[256];
  214.         //primary OSD slot text
  215.     char    szOSDOwner[32];
  216.         //primary OSD slot owner ID
  217.  
  218.         //Use this field to capture OSD slot and prevent other applications from
  219.         //using OSD when it is already in use by your application.
  220.         //You should change this field only if it is empty (i.e. when OSD slot is
  221.         //not owned by any application) or if it is set to your own application's
  222.         //ID (i.e. when you own OSD slot)
  223.         //You shouldn't change any OSD related feilds until you own OSD slot
  224.  
  225.     char    szOSD1[256];
  226.         //OSD slot 1 text
  227.     char    szOSD1Owner[32];
  228.         //OSD slot 1 owner ID
  229.     char    szOSD2[256];
  230.         //OSD slot 2 text
  231.     char    szOSD2Owner[32];
  232.         //OSD slot 2 owner ID
  233.     char    szOSD3[256];
  234.         //OSD slot 3 text
  235.     char    szOSD3Owner[32];
  236.         //OSD slot 3 owner ID
  237.  
  238.     DWORD    dwStatFlags;
  239.         //bitmask containing combination of STATFLAG_... flags
  240.     DWORD    dwStatTime0;
  241.         //statistics record period start time
  242.     DWORD    dwStatTime1;
  243.         //statistics record period end time
  244.     DWORD    dwStatFrames;
  245.         //total amount of frames rendered during statistics record period
  246.     DWORD    dwStatCount;
  247.         //amount of min/avg/max measurements during statistics record period 
  248.     DWORD    dwStatFramerateMin;
  249.         //minimum instantaneous framerate measured during statistics record period 
  250.     DWORD    dwStatFramerateAvg;
  251.         //average instantaneous framerate measured during statistics record period 
  252.     DWORD    dwStatFramerateMax;
  253.         //maximum instantaneous framerate measured during statistics record period 
  254. } RTSS_SHARED_MEMORY_V_1_3, *LPRTSS_SHARED_MEMORY_V_1_3;
  255. /////////////////////////////////////////////////////////////////////////////
  256. #define APPFLAG_DD                    0x00000010
  257. #define APPFLAG_D3D8                0x00000100
  258. #define APPFLAG_D3D9                0x00001000
  259. #define APPFLAG_OGL                    0x00010000
  260. /////////////////////////////////////////////////////////////////////////////
  261. // v2.0 memory structure
  262. typedef struct RTSS_SHARED_MEMORY
  263. {
  264.     DWORD    dwSignature;
  265.         //signature allows applications to verify status of shared memory
  266.  
  267.         //The signature can be set to:
  268.         //'RTSS'    - statistics server's memory is initialized and contains 
  269.         //            valid data 
  270.         //0xDEAD    - statistics server's memory is marked for deallocation and
  271.         //            no longer contain valid data
  272.         //otherwise    the memory is not initialized
  273.     DWORD    dwVersion;
  274.         //structure version ((major<<16) + minor)
  275.         //must be set to 0x00020000 for v2.0 structure
  276.  
  277.     DWORD    dwAppEntrySize;
  278.         //size of RTSS_SHARED_MEMORY_OSD_ENTRY for compatibility with future versions
  279.     DWORD    dwAppArrOffset;
  280.         //offset of arrOSD array for compatibility with future versions
  281.     DWORD    dwAppArrSize;
  282.         //size of arrOSD array for compatibility with future versions
  283.  
  284.     DWORD    dwOSDEntrySize;
  285.         //size of RTSS_SHARED_MEMORY_APP_ENTRY for compatibility with future versions
  286.     DWORD    dwOSDArrOffset;
  287.         //offset of arrApp array for compatibility with future versions
  288.     DWORD    dwOSDArrSize;
  289.         //size of arrOSD array for compatibility with future versions
  290.  
  291.     DWORD    dwOSDFrame;
  292.         //Global OSD frame ID. Increment it to force the server to update OSD for all currently active 3D
  293.         //applications.
  294.  
  295.     //OSD slot descriptor structure
  296.  
  297.     typedef struct RTSS_SHARED_MEMORY_OSD_ENTRY
  298.     {
  299.         char    szOSD[256];
  300.             //OSD slot text
  301.         char    szOSDOwner[256];
  302.             //OSD slot owner ID
  303.     } RTSS_SHARED_MEMORY_OSD_ENTRY, *LPRTSS_SHARED_MEMORY_OSD_ENTRY;
  304.  
  305.     //application descriptor structure
  306.  
  307.     typedef struct RTSS_SHARED_MEMORY_APP_ENTRY
  308.     {
  309.         //application identification related fields
  310.  
  311.         DWORD    dwProcessID;
  312.             //process ID
  313.         char    szName[MAX_PATH];
  314.             //process executable name
  315.         DWORD    dwFlags;
  316.  
  317.         //instantaneous framerate related fields
  318.  
  319.         DWORD    dwTime0;
  320.             //start time of framerate measurement period (in milliseconds)
  321.  
  322.             //Take a note that this field must contain non-zero value to calculate 
  323.             //framerate properly!
  324.         DWORD    dwTime1;
  325.             //end time of framerate measurement period (in milliseconds)
  326.         DWORD    dwFrames;
  327.             //amount of frames rendered during (dwTime1 - dwTime0) period
  328.         DWORD    dwFrameTime;
  329.             //frame time (in microseconds)
  330.  
  331.  
  332.             //to calculate framerate use the following formulas:
  333.  
  334.             //1000.0f * dwFrames / (dwTime1 - dwTime0) for framerate calculated once per second
  335.             //or
  336.             //1000000.0f / dwFrameTime for framerate calculated once per frame 
  337.  
  338.         //framerate statistics related fields
  339.  
  340.         DWORD    dwStatFlags;
  341.             //bitmask containing combination of STATFLAG_... flags
  342.         DWORD    dwStatTime0;
  343.             //statistics record period start time
  344.         DWORD    dwStatTime1;
  345.             //statistics record period end time
  346.         DWORD    dwStatFrames;
  347.             //total amount of frames rendered during statistics record period
  348.         DWORD    dwStatCount;
  349.             //amount of min/avg/max measurements during statistics record period 
  350.         DWORD    dwStatFramerateMin;
  351.             //minimum instantaneous framerate measured during statistics record period 
  352.         DWORD    dwStatFramerateAvg;
  353.             //average instantaneous framerate measured during statistics record period 
  354.         DWORD    dwStatFramerateMax;
  355.             //maximum instantaneous framerate measured during statistics record period 
  356.  
  357.         //OSD related fields
  358.  
  359.         DWORD    dwOSDX;
  360.             //OSD X-coordinate (coordinate wrapping is allowed, i.e. -5 defines 5
  361.             //pixel offset from the right side of the screen)
  362.         DWORD    dwOSDY;
  363.             //OSD Y-coordinate (coordinate wrapping is allowed, i.e. -5 defines 5
  364.             //pixel offset from the bottom side of the screen)
  365.         DWORD    dwOSDPixel;
  366.             //OSD pixel zooming ratio
  367.         DWORD    dwOSDColor;
  368.             //OSD color in RGB format
  369.         DWORD    dwOSDFrame;
  370.             //Application specific OSD frame ID. Don't change it directly!
  371.             
  372.  
  373.     } RTSS_SHARED_MEMORY_APP_ENTRY, *LPRTSS_SHARED_MEMORY_APP_ENTRY;
  374.  
  375.     RTSS_SHARED_MEMORY_OSD_ENTRY arrOSD[8];
  376.         //array of OSD slots
  377.     RTSS_SHARED_MEMORY_APP_ENTRY arrApp[256];
  378.         //array of application descriptors
  379.  
  380. } RTSS_SHARED_MEMORY, *LPRTSS_SHARED_MEMORY;
  381. /////////////////////////////////////////////////////////////////////////////
  382. #endif //_RTSS_SHARED_MEMORY_INCLUDED_