Comments (3)
It looks like you've made some changes to the code. For example, std::shared_ptr
is a template class but you are not specifying any template arguments in the code example. It should be std::shared_ptr<Game>
as can be seen here DX12Lib/src/Window.cpp#L188.
Also, when using shared_from_this
, your class must publicly inherit from std::enable_shared_from_this<T>
(where T
is the derived class) as can be seen here: DX12Lib/inc/Game.h#L42.
from learningdirectx12.
It looks like you've made some changes to the code. For example, std::shared_ptr is a template class but you are not specifying any template arguments in the code example. It should be std::shared_ptr as can be seen here DX12Lib/src/Window.cpp#L188.
Sorry, I guess that was my mistake when trying to copy-paste the code and trying to get the code snippet to work. My code does have the template assigned.
`void Window::RegisterCallbacks(std::shared_ptr<Game arg_pGame)
{
m_pGame = arg_pGame;
return;
}
`
EDIT: I had to remove the ending angle brace for some reason, the code snippet tool omits that. The same is so in my original post.
Same goes for the class declarations as follows:
class Game : public std::enable_shared_from_this<Game> {
I tried changing the weak_ptr m_pGame to shared_ptr m_pGame, and commenting out the locks. but still, I get a similar error for Read Access violation.
Some of the ComPtr Objects are uninitialized at this point. Is that to be expected or have I bungled the code?
from learningdirectx12.
I believe I made a grave error in the code. Apparently, my window initialization was incorrect and I was using invalid handles to the Window to initialize the rest of the code.
Thank you so much for bearing my ineptitude. And a million thanks for writing these tutorials!
from learningdirectx12.
Related Issues (18)
- VertexBuffer resource barriers not working correctly HOT 4
- Cleanup: missing ByteAddressBuffer::m_BufferSize initialization value... HOT 1
- Error on line 77 of ThreadSafeQueue.h HOT 1
- GetTypelessFormat is missing... HOT 1
- Indicies is misspelled should be Indices HOT 2
- The GenerateProjectFiles.bat crash with VS2022 HOT 4
- RootSignature::SetRootSignatureDesc HOT 1
- Bugs on initialization sequence of Application::Run()
- Unhandled Exception on CreateCommittedResource. HOT 1
- Crash after minimizing the window HOT 1
- Minimal example to reproduce "D3D12_RESOURCE_STATES has bits that mismatch support required from D3D12_RESOURCE_FLAGS" Error HOT 1
- WARP HOT 1
- Texture loading bug with specific .png images HOT 1
- Structured buffer CreateViews doesn't check resource desc for validation HOT 1
- CommandList add wrapper functions for setting inline SRV's and UAV's HOT 2
- Iterator of m_AvailableHeaps after erase issue HOT 1
- Missing flushBarriers argument on AliasingBarrier and UAVBarrier HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from learningdirectx12.