mirror of
https://github.com/AxioDL/boo.git
synced 2025-05-15 11:51:27 +00:00
Windows fixes
This commit is contained in:
parent
478b05ceb7
commit
d657f3c8f8
@ -766,6 +766,7 @@ struct D3D11CommandQueue : IGraphicsCommandQueue
|
|||||||
m_initcv.wait(m_initlk);
|
m_initcv.wait(m_initlk);
|
||||||
m_initlk.unlock();
|
m_initlk.unlock();
|
||||||
ThrowIfFailed(ctx->m_dev->CreateDeferredContext1(0, &m_deferredCtx));
|
ThrowIfFailed(ctx->m_dev->CreateDeferredContext1(0, &m_deferredCtx));
|
||||||
|
m_deferredCtx->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
|
||||||
}
|
}
|
||||||
|
|
||||||
void stopRenderer()
|
void stopRenderer()
|
||||||
@ -846,14 +847,6 @@ struct D3D11CommandQueue : IGraphicsCommandQueue
|
|||||||
m_deferredCtx->ClearDepthStencilView(m_boundTarget->m_dsv.Get(), D3D11_CLEAR_DEPTH, 1.0, 0);
|
m_deferredCtx->ClearDepthStencilView(m_boundTarget->m_dsv.Get(), D3D11_CLEAR_DEPTH, 1.0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setDrawPrimitive(Primitive prim)
|
|
||||||
{
|
|
||||||
if (prim == Primitive::Triangles)
|
|
||||||
m_deferredCtx->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
|
||||||
else if (prim == Primitive::TriStrips)
|
|
||||||
m_deferredCtx->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
|
|
||||||
}
|
|
||||||
|
|
||||||
void draw(size_t start, size_t count)
|
void draw(size_t start, size_t count)
|
||||||
{
|
{
|
||||||
m_deferredCtx->Draw(count, start);
|
m_deferredCtx->Draw(count, start);
|
||||||
@ -958,6 +951,7 @@ class D3D11DataFactory : public ID3DDataFactory
|
|||||||
std::unordered_set<D3D11Data*> m_committedData;
|
std::unordered_set<D3D11Data*> m_committedData;
|
||||||
std::mutex m_committedMutex;
|
std::mutex m_committedMutex;
|
||||||
std::unordered_set<D3D11Data*> m_deletedData;
|
std::unordered_set<D3D11Data*> m_deletedData;
|
||||||
|
uint32_t m_sampleCount;
|
||||||
|
|
||||||
void destroyData(IGraphicsData* d)
|
void destroyData(IGraphicsData* d)
|
||||||
{
|
{
|
||||||
@ -996,8 +990,8 @@ class D3D11DataFactory : public ID3DDataFactory
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
D3D11DataFactory(IGraphicsContext* parent, D3D11Context* ctx)
|
D3D11DataFactory(IGraphicsContext* parent, D3D11Context* ctx, uint32_t sampleCount)
|
||||||
: m_parent(parent), m_ctx(ctx)
|
: m_parent(parent), m_ctx(ctx), m_sampleCount(sampleCount)
|
||||||
{}
|
{}
|
||||||
~D3D11DataFactory() {destroyAllData();}
|
~D3D11DataFactory() {destroyAllData();}
|
||||||
|
|
||||||
@ -1035,12 +1029,12 @@ public:
|
|||||||
|
|
||||||
GraphicsDataToken
|
GraphicsDataToken
|
||||||
newStaticTextureNoContext(size_t width, size_t height, size_t mips, TextureFormat fmt,
|
newStaticTextureNoContext(size_t width, size_t height, size_t mips, TextureFormat fmt,
|
||||||
const void* data, size_t sz, ITextureS** texOut)
|
const void* data, size_t sz, ITextureS*& texOut)
|
||||||
{
|
{
|
||||||
D3D11TextureS* retval = new D3D11TextureS(m_ctx, width, height, mips, fmt, data, sz);
|
D3D11TextureS* retval = new D3D11TextureS(m_ctx, width, height, mips, fmt, data, sz);
|
||||||
D3D11Data* tokData = new struct D3D11Data();
|
D3D11Data* tokData = new struct D3D11Data();
|
||||||
tokData->m_STexs.emplace_back(retval);
|
tokData->m_STexs.emplace_back(retval);
|
||||||
*texOut = retval;
|
texOut = retval;
|
||||||
|
|
||||||
std::unique_lock<std::mutex> lk(m_committedMutex);
|
std::unique_lock<std::mutex> lk(m_committedMutex);
|
||||||
m_committedData.insert(tokData);
|
m_committedData.insert(tokData);
|
||||||
@ -1067,10 +1061,10 @@ public:
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
ITextureR* newRenderTexture(size_t width, size_t height, size_t samples)
|
ITextureR* newRenderTexture(size_t width, size_t height)
|
||||||
{
|
{
|
||||||
D3D11CommandQueue* q = static_cast<D3D11CommandQueue*>(m_parent->getCommandQueue());
|
D3D11CommandQueue* q = static_cast<D3D11CommandQueue*>(m_parent->getCommandQueue());
|
||||||
D3D11TextureR* retval = new D3D11TextureR(m_ctx, width, height, samples);
|
D3D11TextureR* retval = new D3D11TextureR(m_ctx, width, height, m_sampleCount);
|
||||||
if (!m_deferredData)
|
if (!m_deferredData)
|
||||||
m_deferredData = new struct D3D11Data();
|
m_deferredData = new struct D3D11Data();
|
||||||
static_cast<D3D11Data*>(m_deferredData)->m_RTexs.emplace_back(retval);
|
static_cast<D3D11Data*>(m_deferredData)->m_RTexs.emplace_back(retval);
|
||||||
@ -1216,9 +1210,9 @@ IGraphicsCommandQueue* _NewD3D11CommandQueue(D3D11Context* ctx, D3D11Context::Wi
|
|||||||
return new D3D11CommandQueue(ctx, windowCtx, parent);
|
return new D3D11CommandQueue(ctx, windowCtx, parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
IGraphicsDataFactory* _NewD3D11DataFactory(D3D11Context* ctx, IGraphicsContext* parent)
|
IGraphicsDataFactory* _NewD3D11DataFactory(D3D11Context* ctx, IGraphicsContext* parent, uint32_t sampleCount)
|
||||||
{
|
{
|
||||||
return new D3D11DataFactory(parent, ctx);
|
return new D3D11DataFactory(parent, ctx, sampleCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -981,6 +981,7 @@ struct D3D12CommandQueue : IGraphicsCommandQueue
|
|||||||
ThrowIfFailed(m_ctx->m_qalloc[m_fillBuf]->Reset());
|
ThrowIfFailed(m_ctx->m_qalloc[m_fillBuf]->Reset());
|
||||||
ThrowIfFailed(m_cmdList->Reset(m_ctx->m_qalloc[m_fillBuf].Get(), nullptr));
|
ThrowIfFailed(m_cmdList->Reset(m_ctx->m_qalloc[m_fillBuf].Get(), nullptr));
|
||||||
m_cmdList->SetGraphicsRootSignature(m_ctx->m_rs.Get());
|
m_cmdList->SetGraphicsRootSignature(m_ctx->m_rs.Get());
|
||||||
|
m_cmdList->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
|
||||||
}
|
}
|
||||||
|
|
||||||
void resetDynamicCommandList()
|
void resetDynamicCommandList()
|
||||||
@ -1027,6 +1028,7 @@ struct D3D12CommandQueue : IGraphicsCommandQueue
|
|||||||
nullptr, __uuidof(ID3D12GraphicsCommandList), &m_cmdList));
|
nullptr, __uuidof(ID3D12GraphicsCommandList), &m_cmdList));
|
||||||
m_renderFenceHandle = CreateEvent(nullptr, FALSE, FALSE, nullptr);
|
m_renderFenceHandle = CreateEvent(nullptr, FALSE, FALSE, nullptr);
|
||||||
m_cmdList->SetGraphicsRootSignature(m_ctx->m_rs.Get());
|
m_cmdList->SetGraphicsRootSignature(m_ctx->m_rs.Get());
|
||||||
|
m_cmdList->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
|
||||||
|
|
||||||
ThrowIfFailed(ctx->m_dev->CreateFence(0, D3D12_FENCE_FLAG_NONE, __uuidof(ID3D12Fence), &m_dynamicBufFence));
|
ThrowIfFailed(ctx->m_dev->CreateFence(0, D3D12_FENCE_FLAG_NONE, __uuidof(ID3D12Fence), &m_dynamicBufFence));
|
||||||
m_dynamicBufFenceHandle = CreateEvent(nullptr, FALSE, FALSE, nullptr);
|
m_dynamicBufFenceHandle = CreateEvent(nullptr, FALSE, FALSE, nullptr);
|
||||||
@ -1131,14 +1133,6 @@ struct D3D12CommandQueue : IGraphicsCommandQueue
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setDrawPrimitive(Primitive prim)
|
|
||||||
{
|
|
||||||
if (prim == Primitive::Triangles)
|
|
||||||
m_cmdList->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
|
||||||
else if (prim == Primitive::TriStrips)
|
|
||||||
m_cmdList->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
|
|
||||||
}
|
|
||||||
|
|
||||||
void draw(size_t start, size_t count)
|
void draw(size_t start, size_t count)
|
||||||
{
|
{
|
||||||
m_cmdList->DrawInstanced(count, 1, start, 0);
|
m_cmdList->DrawInstanced(count, 1, start, 0);
|
||||||
@ -1317,6 +1311,7 @@ class D3D12DataFactory : public ID3DDataFactory
|
|||||||
struct D3D12Context* m_ctx;
|
struct D3D12Context* m_ctx;
|
||||||
std::unordered_set<D3D12Data*> m_committedData;
|
std::unordered_set<D3D12Data*> m_committedData;
|
||||||
std::mutex m_committedMutex;
|
std::mutex m_committedMutex;
|
||||||
|
uint32_t m_sampleCount;
|
||||||
|
|
||||||
void destroyData(IGraphicsData* d)
|
void destroyData(IGraphicsData* d)
|
||||||
{
|
{
|
||||||
@ -1334,8 +1329,8 @@ class D3D12DataFactory : public ID3DDataFactory
|
|||||||
m_committedData.clear();
|
m_committedData.clear();
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
D3D12DataFactory(IGraphicsContext* parent, D3D12Context* ctx)
|
D3D12DataFactory(IGraphicsContext* parent, D3D12Context* ctx, uint32_t sampleCount)
|
||||||
: m_parent(parent), m_ctx(ctx)
|
: m_parent(parent), m_ctx(ctx), m_sampleCount(sampleCount)
|
||||||
{
|
{
|
||||||
CD3DX12_DESCRIPTOR_RANGE ranges[] =
|
CD3DX12_DESCRIPTOR_RANGE ranges[] =
|
||||||
{
|
{
|
||||||
@ -1391,12 +1386,12 @@ public:
|
|||||||
|
|
||||||
GraphicsDataToken
|
GraphicsDataToken
|
||||||
newStaticTextureNoContext(size_t width, size_t height, size_t mips, TextureFormat fmt,
|
newStaticTextureNoContext(size_t width, size_t height, size_t mips, TextureFormat fmt,
|
||||||
const void* data, size_t sz, ITextureS** texOut)
|
const void* data, size_t sz, ITextureS*& texOut)
|
||||||
{
|
{
|
||||||
D3D12TextureS* retval = new D3D12TextureS(m_ctx, width, height, mips, fmt, data, sz);
|
D3D12TextureS* retval = new D3D12TextureS(m_ctx, width, height, mips, fmt, data, sz);
|
||||||
D3D12Data* tokData = new struct D3D12Data();
|
D3D12Data* tokData = new struct D3D12Data();
|
||||||
tokData->m_STexs.emplace_back(retval);
|
tokData->m_STexs.emplace_back(retval);
|
||||||
*texOut = retval;
|
texOut = retval;
|
||||||
|
|
||||||
/* Create heap */
|
/* Create heap */
|
||||||
D3D12_RESOURCE_ALLOCATION_INFO texAllocInfo =
|
D3D12_RESOURCE_ALLOCATION_INFO texAllocInfo =
|
||||||
@ -1451,10 +1446,10 @@ public:
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
ITextureR* newRenderTexture(size_t width, size_t height, size_t samples)
|
ITextureR* newRenderTexture(size_t width, size_t height)
|
||||||
{
|
{
|
||||||
D3D12CommandQueue* q = static_cast<D3D12CommandQueue*>(m_parent->getCommandQueue());
|
D3D12CommandQueue* q = static_cast<D3D12CommandQueue*>(m_parent->getCommandQueue());
|
||||||
D3D12TextureR* retval = new D3D12TextureR(m_ctx, q, width, height, samples);
|
D3D12TextureR* retval = new D3D12TextureR(m_ctx, q, width, height, m_sampleCount);
|
||||||
if (!m_deferredData)
|
if (!m_deferredData)
|
||||||
m_deferredData = new struct D3D12Data();
|
m_deferredData = new struct D3D12Data();
|
||||||
static_cast<D3D12Data*>(m_deferredData)->m_RTexs.emplace_back(retval);
|
static_cast<D3D12Data*>(m_deferredData)->m_RTexs.emplace_back(retval);
|
||||||
@ -1724,9 +1719,9 @@ IGraphicsCommandQueue* _NewD3D12CommandQueue(D3D12Context* ctx, D3D12Context::Wi
|
|||||||
return new struct D3D12CommandQueue(ctx, windowCtx, parent, cmdQueueOut);
|
return new struct D3D12CommandQueue(ctx, windowCtx, parent, cmdQueueOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
IGraphicsDataFactory* _NewD3D12DataFactory(D3D12Context* ctx, IGraphicsContext* parent)
|
IGraphicsDataFactory* _NewD3D12DataFactory(D3D12Context* ctx, IGraphicsContext* parent, uint32_t sampleCount)
|
||||||
{
|
{
|
||||||
return new D3D12DataFactory(parent, ctx);
|
return new D3D12DataFactory(parent, ctx, sampleCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ namespace boo
|
|||||||
static LogVisor::LogModule Log("boo::ApplicationWin32");
|
static LogVisor::LogModule Log("boo::ApplicationWin32");
|
||||||
Win32Cursors WIN32_CURSORS;
|
Win32Cursors WIN32_CURSORS;
|
||||||
|
|
||||||
IWindow* _WindowWin32New(const SystemString& title, Boo3DAppContext& d3dCtx);
|
IWindow* _WindowWin32New(const SystemString& title, Boo3DAppContext& d3dCtx, uint32_t sampleCount);
|
||||||
|
|
||||||
class ApplicationWin32 final : public IApplication
|
class ApplicationWin32 final : public IApplication
|
||||||
{
|
{
|
||||||
@ -303,7 +303,7 @@ public:
|
|||||||
/* New-window message (coalesced onto main thread) */
|
/* New-window message (coalesced onto main thread) */
|
||||||
std::unique_lock<std::mutex> lk(m_nwmt);
|
std::unique_lock<std::mutex> lk(m_nwmt);
|
||||||
const SystemString* title = reinterpret_cast<const SystemString*>(msg.wParam);
|
const SystemString* title = reinterpret_cast<const SystemString*>(msg.wParam);
|
||||||
m_mwret = newWindow(*title);
|
m_mwret = newWindow(*title, 1);
|
||||||
lk.unlock();
|
lk.unlock();
|
||||||
m_nwcv.notify_one();
|
m_nwcv.notify_one();
|
||||||
continue;
|
continue;
|
||||||
@ -359,7 +359,7 @@ public:
|
|||||||
std::mutex m_nwmt;
|
std::mutex m_nwmt;
|
||||||
std::condition_variable m_nwcv;
|
std::condition_variable m_nwcv;
|
||||||
IWindow* m_mwret = nullptr;
|
IWindow* m_mwret = nullptr;
|
||||||
IWindow* newWindow(const SystemString& title)
|
IWindow* newWindow(const SystemString& title, uint32_t sampleCount)
|
||||||
{
|
{
|
||||||
if (GetCurrentThreadId() != g_mainThreadId)
|
if (GetCurrentThreadId() != g_mainThreadId)
|
||||||
{
|
{
|
||||||
@ -370,7 +370,7 @@ public:
|
|||||||
return m_mwret;
|
return m_mwret;
|
||||||
}
|
}
|
||||||
|
|
||||||
IWindow* window = _WindowWin32New(title, m_3dCtx);
|
IWindow* window = _WindowWin32New(title, m_3dCtx, sampleCount);
|
||||||
HWND hwnd = HWND(window->getPlatformHandle());
|
HWND hwnd = HWND(window->getPlatformHandle());
|
||||||
m_allWindows[hwnd] = window;
|
m_allWindows[hwnd] = window;
|
||||||
return window;
|
return window;
|
||||||
|
@ -25,10 +25,10 @@ static LogVisor::LogModule Log("boo::WindowWin32");
|
|||||||
#if _WIN32_WINNT_WIN10
|
#if _WIN32_WINNT_WIN10
|
||||||
IGraphicsCommandQueue* _NewD3D12CommandQueue(D3D12Context* ctx, D3D12Context::Window* windowCtx, IGraphicsContext* parent,
|
IGraphicsCommandQueue* _NewD3D12CommandQueue(D3D12Context* ctx, D3D12Context::Window* windowCtx, IGraphicsContext* parent,
|
||||||
ID3D12CommandQueue** cmdQueueOut);
|
ID3D12CommandQueue** cmdQueueOut);
|
||||||
IGraphicsDataFactory* _NewD3D12DataFactory(D3D12Context* ctx, IGraphicsContext* parent);
|
IGraphicsDataFactory* _NewD3D12DataFactory(D3D12Context* ctx, IGraphicsContext* parent, uint32_t sampleCount);
|
||||||
#endif
|
#endif
|
||||||
IGraphicsCommandQueue* _NewD3D11CommandQueue(D3D11Context* ctx, D3D11Context::Window* windowCtx, IGraphicsContext* parent);
|
IGraphicsCommandQueue* _NewD3D11CommandQueue(D3D11Context* ctx, D3D11Context::Window* windowCtx, IGraphicsContext* parent);
|
||||||
IGraphicsDataFactory* _NewD3D11DataFactory(D3D11Context* ctx, IGraphicsContext* parent);
|
IGraphicsDataFactory* _NewD3D11DataFactory(D3D11Context* ctx, IGraphicsContext* parent, uint32_t sampleCount);
|
||||||
IGraphicsCommandQueue* _NewGLCommandQueue(IGraphicsContext* parent);
|
IGraphicsCommandQueue* _NewGLCommandQueue(IGraphicsContext* parent);
|
||||||
|
|
||||||
struct GraphicsContextWin32 : IGraphicsContext
|
struct GraphicsContextWin32 : IGraphicsContext
|
||||||
@ -55,7 +55,8 @@ struct GraphicsContextWin32D3D : GraphicsContextWin32
|
|||||||
public:
|
public:
|
||||||
IWindowCallback* m_callback;
|
IWindowCallback* m_callback;
|
||||||
|
|
||||||
GraphicsContextWin32D3D(EGraphicsAPI api, IWindow* parentWindow, HWND hwnd, Boo3DAppContext& b3dCtx)
|
GraphicsContextWin32D3D(EGraphicsAPI api, IWindow* parentWindow, HWND hwnd,
|
||||||
|
Boo3DAppContext& b3dCtx, uint32_t sampleCount)
|
||||||
: GraphicsContextWin32(api, parentWindow, b3dCtx)
|
: GraphicsContextWin32(api, parentWindow, b3dCtx)
|
||||||
{
|
{
|
||||||
/* Create Swap Chain */
|
/* Create Swap Chain */
|
||||||
@ -74,7 +75,7 @@ public:
|
|||||||
D3D12Context::Window& w = insIt.first->second;
|
D3D12Context::Window& w = insIt.first->second;
|
||||||
|
|
||||||
ID3D12CommandQueue* cmdQueue;
|
ID3D12CommandQueue* cmdQueue;
|
||||||
m_dataFactory = _NewD3D12DataFactory(&b3dCtx.m_ctx12, this);
|
m_dataFactory = _NewD3D12DataFactory(&b3dCtx.m_ctx12, this, sampleCount);
|
||||||
m_commandQueue = _NewD3D12CommandQueue(&b3dCtx.m_ctx12, &w, this, &cmdQueue);
|
m_commandQueue = _NewD3D12CommandQueue(&b3dCtx.m_ctx12, &w, this, &cmdQueue);
|
||||||
|
|
||||||
scDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD;
|
scDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD;
|
||||||
@ -113,7 +114,7 @@ public:
|
|||||||
fbRes->GetDesc(&resDesc);
|
fbRes->GetDesc(&resDesc);
|
||||||
w.width = resDesc.Width;
|
w.width = resDesc.Width;
|
||||||
w.height = resDesc.Height;
|
w.height = resDesc.Height;
|
||||||
m_dataFactory = _NewD3D11DataFactory(&b3dCtx.m_ctx11, this);
|
m_dataFactory = _NewD3D11DataFactory(&b3dCtx.m_ctx11, this, sampleCount);
|
||||||
m_commandQueue = _NewD3D11CommandQueue(&b3dCtx.m_ctx11, &insIt.first->second, this);
|
m_commandQueue = _NewD3D11CommandQueue(&b3dCtx.m_ctx11, &insIt.first->second, this);
|
||||||
|
|
||||||
if (FAILED(m_swapChain->GetContainingOutput(&m_output)))
|
if (FAILED(m_swapChain->GetContainingOutput(&m_output)))
|
||||||
@ -190,7 +191,8 @@ struct GraphicsContextWin32GL : GraphicsContextWin32
|
|||||||
public:
|
public:
|
||||||
IWindowCallback* m_callback;
|
IWindowCallback* m_callback;
|
||||||
|
|
||||||
GraphicsContextWin32GL(EGraphicsAPI api, IWindow* parentWindow, HWND hwnd, Boo3DAppContext& b3dCtx)
|
GraphicsContextWin32GL(EGraphicsAPI api, IWindow* parentWindow, HWND hwnd,
|
||||||
|
Boo3DAppContext& b3dCtx, uint32_t sampleCount)
|
||||||
: GraphicsContextWin32(api, parentWindow, b3dCtx)
|
: GraphicsContextWin32(api, parentWindow, b3dCtx)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -262,7 +264,7 @@ public:
|
|||||||
Log.report(LogVisor::FatalError, "unable to share contexts");
|
Log.report(LogVisor::FatalError, "unable to share contexts");
|
||||||
m_3dCtx.m_ctxOgl.m_lastContext = w.m_mainContext;
|
m_3dCtx.m_ctxOgl.m_lastContext = w.m_mainContext;
|
||||||
|
|
||||||
m_dataFactory = new GLDataFactory(this);
|
m_dataFactory = new GLDataFactory(this, sampleCount);
|
||||||
m_commandQueue = _NewGLCommandQueue(this);
|
m_commandQueue = _NewGLCommandQueue(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -707,7 +709,7 @@ class WindowWin32 : public IWindow
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
WindowWin32(const SystemString& title, Boo3DAppContext& b3dCtx)
|
WindowWin32(const SystemString& title, Boo3DAppContext& b3dCtx, uint32_t sampleCount)
|
||||||
{
|
{
|
||||||
m_hwnd = CreateWindowW(L"BooWindow", title.c_str(), WS_OVERLAPPEDWINDOW,
|
m_hwnd = CreateWindowW(L"BooWindow", title.c_str(), WS_OVERLAPPEDWINDOW,
|
||||||
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
|
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
|
||||||
@ -720,10 +722,11 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
if (b3dCtx.m_ctxOgl.m_dxFactory)
|
if (b3dCtx.m_ctxOgl.m_dxFactory)
|
||||||
{
|
{
|
||||||
m_gfxCtx.reset(new GraphicsContextWin32GL(IGraphicsContext::EGraphicsAPI::OpenGL3_3, this, m_hwnd, b3dCtx));
|
m_gfxCtx.reset(new GraphicsContextWin32GL(IGraphicsContext::EGraphicsAPI::OpenGL3_3,
|
||||||
|
this, m_hwnd, b3dCtx, sampleCount));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_gfxCtx.reset(new GraphicsContextWin32D3D(api, this, m_hwnd, b3dCtx));
|
m_gfxCtx.reset(new GraphicsContextWin32D3D(api, this, m_hwnd, b3dCtx, sampleCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
~WindowWin32()
|
~WindowWin32()
|
||||||
@ -1288,9 +1291,9 @@ public:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
IWindow* _WindowWin32New(const SystemString& title, Boo3DAppContext& d3dCtx)
|
IWindow* _WindowWin32New(const SystemString& title, Boo3DAppContext& d3dCtx, uint32_t sampleCount)
|
||||||
{
|
{
|
||||||
return new WindowWin32(title, d3dCtx);
|
return new WindowWin32(title, d3dCtx, sampleCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user