diff --git a/src/engine/engine.h b/src/engine/engine.h index 3631331a2..62d4cbf7e 100644 --- a/src/engine/engine.h +++ b/src/engine/engine.h @@ -54,8 +54,8 @@ class DivWorkPool; #define DIV_UNSTABLE -#define DIV_VERSION "DX9 Test VII" -#define DIV_ENGINE_VERSION 208 +#define DIV_VERSION "DX9 Test VIII" +#define DIV_ENGINE_VERSION 209 // for imports #define DIV_VERSION_MOD 0xff01 #define DIV_VERSION_FC 0xff02 diff --git a/src/gui/render/renderDX9.cpp b/src/gui/render/renderDX9.cpp index 8cc7412e6..a4afe7e54 100644 --- a/src/gui/render/renderDX9.cpp +++ b/src/gui/render/renderDX9.cpp @@ -45,6 +45,23 @@ class FurnaceDX9Texture: public FurnaceGUITexture { dynamic(false) {} }; +struct WipeVertex { + float x, y, z; + unsigned int color; + + WipeVertex(float _x, float _y, float _z, unsigned int c): + x(_x), + y(_y), + z(_z), + color(c) {} + WipeVertex(): + x(0), + y(0), + z(0), + color(0) {} +}; + + ImTextureID FurnaceGUIRenderDX9::getTextureID(FurnaceGUITexture* which) { FurnaceDX9Texture* t=(FurnaceDX9Texture*)which; return (ImTextureID)t->tex; @@ -232,6 +249,12 @@ void FurnaceGUIRenderDX9::clear(ImVec4 color) { if (mustResize) { logI("DX9: resizing buffers"); ImGui_ImplDX9_InvalidateDeviceObjects(); + + if (wipeBuf!=NULL) { + wipeBuf->Release(); + wipeBuf=NULL; + } + priv->present.BackBufferWidth=outW; priv->present.BackBufferHeight=outH; priv->present.BackBufferCount=1; @@ -242,7 +265,15 @@ void FurnaceGUIRenderDX9::clear(ImVec4 color) { if (result==D3DERR_INVALIDCALL) { logE("OH NO"); } + ImGui_ImplDX9_CreateDeviceObjects(); + + result=device->CreateVertexBuffer(sizeof(WipeVertex)*4,0,D3DFVF_XYZ|D3DFVF_DIFFUSE,D3DPOOL_DEFAULT,&wipeBuf,NULL); + + if (result!=D3D_OK) { + logE("could not create wipe buffer! %.8x",result); + } + mustResize=false; } @@ -279,22 +310,6 @@ void FurnaceGUIRenderDX9::renderGUI() { } } -struct WipeVertex { - float x, y, z; - unsigned int color; - - WipeVertex(float _x, float _y, float _z, unsigned int c): - x(_x), - y(_y), - z(_z), - color(c) {} - WipeVertex(): - x(0), - y(0), - z(0), - color(0) {} -}; - void FurnaceGUIRenderDX9::wipe(float alpha) { if (wipeBuf==NULL) return;