Moves checkDeviceLost to renderer9_utils.h

TRAC #22141 Signed-off-by: Nicolas Capens Signed-off-by: Daniel Koch git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1483 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 5fbf177c
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "libGLESv2/Fence.h" #include "libGLESv2/Fence.h"
#include "libGLESv2/main.h" #include "libGLESv2/renderer/renderer9_utils.h"
namespace gl namespace gl
{ {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "libGLESv2/Query.h" #include "libGLESv2/Query.h"
#include "libGLESv2/main.h" #include "libGLESv2/renderer/renderer9_utils.h"
namespace gl namespace gl
{ {
......
...@@ -121,18 +121,6 @@ egl::Display *getDisplay() ...@@ -121,18 +121,6 @@ egl::Display *getDisplay()
return current->display; return current->display;
} }
bool checkDeviceLost(HRESULT errorCode)
{
egl::Display *display = NULL;
if (isDeviceLostError(errorCode))
{
display = gl::getDisplay();
display->notifyDeviceLost();
return true;
}
return false;
}
} }
// Records an error code // Records an error code
......
...@@ -32,7 +32,6 @@ Context *getContext(); ...@@ -32,7 +32,6 @@ Context *getContext();
Context *getNonLostContext(); Context *getNonLostContext();
egl::Display *getDisplay(); egl::Display *getDisplay();
bool checkDeviceLost(HRESULT errorCode);
} }
void error(GLenum errorCode); void error(GLenum errorCode);
......
...@@ -1890,7 +1890,7 @@ void Renderer9::readPixels(gl::Framebuffer *framebuffer, GLint x, GLint y, GLsiz ...@@ -1890,7 +1890,7 @@ void Renderer9::readPixels(gl::Framebuffer *framebuffer, GLint x, GLint y, GLsiz
// It turns out that D3D will sometimes produce more error // It turns out that D3D will sometimes produce more error
// codes than those documented. // codes than those documented.
if (gl::checkDeviceLost(result)) if (checkDeviceLost(result))
return error(GL_OUT_OF_MEMORY); return error(GL_OUT_OF_MEMORY);
else else
{ {
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <d3d9.h> #include <d3d9.h>
#include "libGLESv2/utilities.h" #include "libGLESv2/utilities.h"
#include "libGLESv2/main.h"
const D3DFORMAT D3DFMT_INTZ = ((D3DFORMAT)(MAKEFOURCC('I','N','T','Z'))); const D3DFORMAT D3DFMT_INTZ = ((D3DFORMAT)(MAKEFOURCC('I','N','T','Z')));
const D3DFORMAT D3DFMT_NULL = ((D3DFORMAT)(MAKEFOURCC('N','U','L','L'))); const D3DFORMAT D3DFMT_NULL = ((D3DFORMAT)(MAKEFOURCC('N','U','L','L')));
...@@ -77,4 +78,17 @@ inline bool isDeviceLostError(HRESULT errorCode) ...@@ -77,4 +78,17 @@ inline bool isDeviceLostError(HRESULT errorCode)
} }
} }
inline bool checkDeviceLost(HRESULT errorCode)
{
egl::Display *display = NULL;
if (isDeviceLostError(errorCode))
{
display = gl::getDisplay();
display->notifyDeviceLost();
return true;
}
return false;
};
#endif // LIBGLESV2_RENDERER_RENDERER9_UTILS_H #endif // LIBGLESV2_RENDERER_RENDERER9_UTILS_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment