15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    WGL_I3D_swap_frame_usage
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    WGL_I3D_swap_frame_usage
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciVersion
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Date: 5/1/2000   Revision: 1.3
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciNumber
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    ???
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciDependencies
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    WGL_EXT_extensions_string is required.
205bd8deadSopenharmony_ci    WGL_EXT_swap_control affects the definition of this extension
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ciOverview
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ci    This extension allows an application to obtain the percent of time
255bd8deadSopenharmony_ci    used to draw a frame.  A floating-point value in the range [0,max]
265bd8deadSopenharmony_ci    is returned which is calculated as follows:
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ci                              td
295bd8deadSopenharmony_ci                   percent = ----
305bd8deadSopenharmony_ci                              tf
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ci    where td is the time measured from the last buffer swap (or call to
335bd8deadSopenharmony_ci    enable the statistic) to when the application issued a buffer swap,
345bd8deadSopenharmony_ci    tf is the entire time for a frame which may be multiple screen
355bd8deadSopenharmony_ci    refreshes depending on the swap interval as set by the
365bd8deadSopenharmony_ci    WGL_swap_control extension.
375bd8deadSopenharmony_ci
385bd8deadSopenharmony_ci    The value, percent, indicates the amount of time spent during the
395bd8deadSopenharmony_ci    draw.  If the value is in the range [0,1], the buffer swap occurred
405bd8deadSopenharmony_ci    within the time period required to maintain a constant frame rate.
415bd8deadSopenharmony_ci    If the value is in the range (1,max], a constant frame rate was not
425bd8deadSopenharmony_ci    achieved.  The value indicates the number of frames required to
435bd8deadSopenharmony_ci    draw.
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ci    There is also a mechanism to determine whether a frame swap was
465bd8deadSopenharmony_ci    missed.
475bd8deadSopenharmony_ci
485bd8deadSopenharmony_ciNew Procedures and Functions
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ci    BOOL wglGetFrameUsageI3D(float *pUsage)
515bd8deadSopenharmony_ci
525bd8deadSopenharmony_ci    BOOL wglBeginFrameTrackingI3D(void)
535bd8deadSopenharmony_ci
545bd8deadSopenharmony_ci    BOOL wglEndFrameTrackingI3D(void)
555bd8deadSopenharmony_ci
565bd8deadSopenharmony_ci    BOOL wglQueryFrameTrackingI3D(DWORD *pFrameCount,
575bd8deadSopenharmony_ci                                  DWORD *pMissedFrames,
585bd8deadSopenharmony_ci                                  float *pLastMissedUsage)
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ciNew Tokens
615bd8deadSopenharmony_ci
625bd8deadSopenharmony_ci    None
635bd8deadSopenharmony_ci
645bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.2 GL Specification (OpenGL Operation)
655bd8deadSopenharmony_ci
665bd8deadSopenharmony_ci    None
675bd8deadSopenharmony_ci
685bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.2 GL Specification (Rasterization)
695bd8deadSopenharmony_ci
705bd8deadSopenharmony_ci    None
715bd8deadSopenharmony_ci
725bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.2 GL Specification (Per-Fragment Operations
735bd8deadSopenharmony_ciand the Framebuffer)
745bd8deadSopenharmony_ci
755bd8deadSopenharmony_ci    None
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.2 GL Specification (Special Functions)
785bd8deadSopenharmony_ci
795bd8deadSopenharmony_ci    None
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.2 GL Specification (State and State Requests)
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ci    None
845bd8deadSopenharmony_ci
855bd8deadSopenharmony_ciAdditions to the WGL Specification
865bd8deadSopenharmony_ci
875bd8deadSopenharmony_ci    wglGetFrameUsageI3D returns a floating-point value in <pUsage>
885bd8deadSopenharmony_ci    that represents the percentage of time that the application spent
895bd8deadSopenharmony_ci    drawing a scene.  The percentage is calculated as the time spent
905bd8deadSopenharmony_ci    within the time available.
915bd8deadSopenharmony_ci
925bd8deadSopenharmony_ci    The time available is the frame refresh time unless a swap interval
935bd8deadSopenharmony_ci    has been established.  In this case, the time available is an
945bd8deadSopenharmony_ci    integer multiple of the frame time as established by the swap
955bd8deadSopenharmony_ci    interval.
965bd8deadSopenharmony_ci
975bd8deadSopenharmony_ci    Missed frame swaps can be tracked by calling the following function:
985bd8deadSopenharmony_ci
995bd8deadSopenharmony_ci       BOOL wglBeginFrameTrackingI3D(void)
1005bd8deadSopenharmony_ci
1015bd8deadSopenharmony_ci    wglBeginFrameTrackingI3D resets a "missed frame" count and
1025bd8deadSopenharmony_ci    synchronizes with the next frame vertical sync before it returns.
1035bd8deadSopenharmony_ci    If a swap is missed based in the rate control specified by the
1045bd8deadSopenharmony_ci    <interval> set by wglSwapIntervalEXT or the default swap of once
1055bd8deadSopenharmony_ci    per frame, the missed frame count is incremented.
1065bd8deadSopenharmony_ci
1075bd8deadSopenharmony_ci    The current missed frame count and total number of swaps since
1085bd8deadSopenharmony_ci    the last call to wglBeginFrameTrackingI3D can be obtained by
1095bd8deadSopenharmony_ci    callling the following function:
1105bd8deadSopenharmony_ci
1115bd8deadSopenharmony_ci       BOOL wglQueryFrameTrackingI3D(DWORD *pFrameCount,
1125bd8deadSopenharmony_ci                                     DWORD *pMissedFrames,
1135bd8deadSopenharmony_ci                                     float *pLastMissedUsage)
1145bd8deadSopenharmony_ci
1155bd8deadSopenharmony_ci    The location pointed to by <pFrameCount> will be updated with the
1165bd8deadSopenharmony_ci    number of swaps that have occurred.  This value may not match the
1175bd8deadSopenharmony_ci    number of swaps that have been requested since swaps may be
1185bd8deadSopenharmony_ci    queued by the implementation.  This function can be called at any
1195bd8deadSopenharmony_ci    time and does not synchronize to vertical blank.
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ci    The location pointed to by <pMissedFrames> will contain the number
1225bd8deadSopenharmony_ci    swaps that missed the specified frame.  The frame usage for the
1235bd8deadSopenharmony_ci    last missed frame is returned in the location pointed to by
1245bd8deadSopenharmony_ci    <pLastMissedUsage>.
1255bd8deadSopenharmony_ci
1265bd8deadSopenharmony_ci    Frame tracking is disabled by calling the function
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ci       BOOL wglEndFrameTrackingI3D(void)
1295bd8deadSopenharmony_ci
1305bd8deadSopenharmony_ci    This function will not return until all swaps have occurred.  The
1315bd8deadSopenharmony_ci    application can call wglQueryFrameTrackingI3D for a final swap and
1325bd8deadSopenharmony_ci    missed frame count.
1335bd8deadSopenharmony_ci
1345bd8deadSopenharmony_ci    If these functions fail, FALSE is returned.  To get extended
1355bd8deadSopenharmony_ci    error information, call GetLastError.
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ciDependencies on WGL_EXT_extensions_string
1385bd8deadSopenharmony_ci
1395bd8deadSopenharmony_ci    Because there is no way to extend wgl, these calls are defined in
1405bd8deadSopenharmony_ci    the ICD and can be called by obtaining the address with
1415bd8deadSopenharmony_ci    wglGetProcAddress.  Because this extension is a WGL extension, it
1425bd8deadSopenharmony_ci    is not included in the GL_EXTENSIONS string.  Its existence can be
1435bd8deadSopenharmony_ci    determined with the WGL_EXT_extensions_string extension.
1445bd8deadSopenharmony_ci
1455bd8deadSopenharmony_ciErrors
1465bd8deadSopenharmony_ci
1475bd8deadSopenharmony_ci    If the function succeeds, the return value is TRUE. If the function
1485bd8deadSopenharmony_ci    fails, the return value is FALSE.  To get extended error information,
1495bd8deadSopenharmony_ci    call GetLastError.
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ci       ERROR_DC_NOT_FOUND      An RC was not current to the calling
1525bd8deadSopenharmony_ci                               thread; therefore, no DC could be
1535bd8deadSopenharmony_ci                               obtained.
1545bd8deadSopenharmony_ci
1555bd8deadSopenharmony_ci       ERROR_BUSY              The resource used for obtaining usage
1565bd8deadSopenharmony_ci                               was currently in use by another
1575bd8deadSopenharmony_ci                               application.
1585bd8deadSopenharmony_ci
1595bd8deadSopenharmony_ciNew State
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ci    None
1625bd8deadSopenharmony_ci
1635bd8deadSopenharmony_ciNew Implementation Dependent State
1645bd8deadSopenharmony_ci
1655bd8deadSopenharmony_ci    None
166