Index: ddraw/glDirectDraw.cpp |
— | — | @@ -1097,9 +1097,13 @@ |
1098 | 1098 | TRACE_ENTER(2,14,this,14,lpdwScanLine);
|
1099 | 1099 | if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
1100 | 1100 | if(!lpdwScanLine) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
1101 | | - FIXME("IDirectDraw::GetScanLine: stub\n");
|
1102 | | - TRACE_EXIT(23,DDERR_GENERIC);
|
1103 | | - ERR(DDERR_GENERIC);
|
| 1101 | + if(!renderer) TRACE_RET(HRESULT,23,DDERR_NOTINITIALIZED);
|
| 1102 | + if(!primary) TRACE_RET(HRESULT,23,DDERR_NOTINITIALIZED);
|
| 1103 | + if(!initialized) TRACE_RET(HRESULT,23,DDERR_NOTINITIALIZED);
|
| 1104 | + *lpdwScanLine = renderer->GetScanLine();
|
| 1105 | + if(*lpdwScanLine > primary->fakey) TRACE_RET(HRESULT,23,DDERR_VERTICALBLANKINPROGRESS);
|
| 1106 | + TRACE_EXIT(23,DD_OK);
|
| 1107 | + return DD_OK;
|
1104 | 1108 | }
|
1105 | 1109 | HRESULT WINAPI glDirectDraw7::GetVerticalBlankStatus(LPBOOL lpbIsInVB)
|
1106 | 1110 | {
|
— | — | @@ -1106,9 +1110,13 @@ |
1107 | 1111 | TRACE_ENTER(2,14,this,14,lpbIsInVB);
|
1108 | 1112 | if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
1109 | 1113 | if(!lpbIsInVB) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
1110 | | - FIXME("IDirectDraw::GetVerticalBlankStatus: stub\n");
|
1111 | | - TRACE_EXIT(23,DDERR_GENERIC);
|
1112 | | - ERR(DDERR_GENERIC);
|
| 1114 | + if(!renderer) TRACE_RET(HRESULT,23,DDERR_NOTINITIALIZED);
|
| 1115 | + if(!primary) TRACE_RET(HRESULT,23,DDERR_NOTINITIALIZED);
|
| 1116 | + if(!initialized) TRACE_RET(HRESULT,23,DDERR_NOTINITIALIZED);
|
| 1117 | + if(renderer->GetScanLine() > primary->fakey) *lpbIsInVB = TRUE;
|
| 1118 | + else *lpbIsInVB = FALSE;
|
| 1119 | + TRACE_EXIT(23,DD_OK);
|
| 1120 | + return DD_OK;
|
1113 | 1121 | }
|
1114 | 1122 | HRESULT WINAPI glDirectDraw7::Initialize(GUID FAR *lpGUID)
|
1115 | 1123 | {
|
Index: ddraw/glRenderer.cpp |
— | — | @@ -608,6 +608,11 @@ |
609 | 609 | LeaveCriticalSection(&cs);
|
610 | 610 | }
|
611 | 611 |
|
| 612 | +unsigned int glRenderer::GetScanLine()
|
| 613 | +{
|
| 614 | + return timer.GetScanLine();
|
| 615 | +}
|
| 616 | +
|
612 | 617 | /**
|
613 | 618 | * Main loop for glRenderer class
|
614 | 619 | * @return
|
Index: ddraw/glRenderer.h |
— | — | @@ -107,6 +107,7 @@ |
108 | 108 | HRESULT DrawPrimitives(glDirect3DDevice7 *device, GLenum mode, GLVERTEX *vertices, int *texformats, DWORD count, LPWORD indices,
|
109 | 109 | DWORD indexcount, DWORD flags);
|
110 | 110 | void DeleteFBO(FBO *fbo);
|
| 111 | + unsigned int GetScanLine();
|
111 | 112 | HGLRC hRC;
|
112 | 113 | GLCAPS gl_caps;
|
113 | 114 | private:
|