mirror of
https://github.com/borgesdan/xn65
synced 2024-12-29 21:54:47 +01:00
28 lines
614 B
C++
28 lines
614 B
C++
|
#include "vertexinput-dx.hpp"
|
||
|
#include "device-dx.hpp"
|
||
|
#include <d3dcompiler.h>
|
||
|
#include "dxgi.h"
|
||
|
#include "d3d11.h"
|
||
|
|
||
|
namespace xna {
|
||
|
bool VertexInputLayout::Initialize(ID3DBlob* blob, xna_error_ptr_arg){
|
||
|
if (!_device || !blob) {
|
||
|
xna_error_apply(err, XnaErrorCode::INVALID_OPERATION);
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
const auto hr = _device->_device->CreateInputLayout(
|
||
|
_description.data(),
|
||
|
_description.size(),
|
||
|
blob->GetBufferPointer(),
|
||
|
blob->GetBufferSize(),
|
||
|
&_inputLayout);
|
||
|
|
||
|
if (FAILED(hr)) {
|
||
|
xna_error_apply(err, XnaErrorCode::INVALID_OPERATION);
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
return true;
|
||
|
}
|
||
|
}
|