Click here to Skip to main content
15,885,537 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: elaborate the build instructions Pin
CPallini10-Sep-17 5:14
mveCPallini10-Sep-17 5:14 
QuestionHow to #include <string> in C code Pin
Vaclav_9-Sep-17 6:18
Vaclav_9-Sep-17 6:18 
AnswerRe: How to #include <string> in C code Pin
Richard MacCutchan9-Sep-17 6:39
mveRichard MacCutchan9-Sep-17 6:39 
AnswerRe: How to #include <string> in C code Pin
CPallini10-Sep-17 3:03
mveCPallini10-Sep-17 3:03 
Questiondirectx 9 ? Pin
bluatigro6-Sep-17 22:03
bluatigro6-Sep-17 22:03 
SuggestionRe: directx 9 ? Pin
Richard MacCutchan7-Sep-17 4:41
mveRichard MacCutchan7-Sep-17 4:41 
QuestionRe: directx 9 ? Pin
David Crow7-Sep-17 5:12
David Crow7-Sep-17 5:12 
AnswerRe: directx 9 ? Pin
leon de boer7-Sep-17 6:57
leon de boer7-Sep-17 6:57 
You generally do put the initD3D in the WM_CREATE and the cleanD3D in the WM_DESTROY.
The problem is you can't really put the render in the WM_PAINT you need to pump the render over and over.
So they have done a horrible hack to use the message loop to pump the render.

The problem with their hack is they can only have one render window and the render speed is controlled by the message loop.
Do you see the sneaky render_frame(); call in the message loop which is the render pump.

The correct way to do it is create a thread in WM_CREATE to pump the render call .. good old CreateThread()
You can link up WM_WINDOWPOSCHANGED (window size change) and WM_PAINT to the render thread if you want to do things from them to the renderer.

So they are basically trying to dodge having to deal with the complexity of having a render thread because it is targetted at beginners.
It is horrible as the render complexity and time goes up the message response time goes out the window.

MS has a proper threaded samples and there are probably others around
Windows Direct3D Multithreaded Rendering Win32 Sample in C++ for Visual Studio 2012[^]
NVidia also has do's and dont's ... see under do's ... Master Render Thread
DX12 Do's And Don'ts | NVIDIA Developer[^]
In vino veritas


modified 7-Sep-17 13:13pm.

QuestionOnce Again Assert in Release and I am lost Pin
ForNow4-Sep-17 13:39
ForNow4-Sep-17 13:39 
QuestionRe: Once Again Assert in Release and I am lost Pin
David Crow4-Sep-17 15:45
David Crow4-Sep-17 15:45 
AnswerRe: Once Again Assert in Release and I am lost Pin
ForNow4-Sep-17 16:01
ForNow4-Sep-17 16:01 
GeneralRe: Once Again Assert in Release and I am lost Pin
leon de boer6-Sep-17 19:09
leon de boer6-Sep-17 19:09 
AnswerRe: Once Again Assert in Release and I am lost Pin
Jochen Arndt4-Sep-17 21:13
professionalJochen Arndt4-Sep-17 21:13 
GeneralRe: Once Again Assert in Release and I am lost Pin
ForNow5-Sep-17 1:22
ForNow5-Sep-17 1:22 
GeneralRe: Once Again Assert in Release and I am lost Pin
Jochen Arndt5-Sep-17 1:39
professionalJochen Arndt5-Sep-17 1:39 
GeneralRe: Once Again Assert in Release and I am lost Pin
ForNow5-Sep-17 1:43
ForNow5-Sep-17 1:43 
GeneralRe: Once Again Assert in Release and I am lost Pin
ForNow7-Sep-17 6:00
ForNow7-Sep-17 6:00 
GeneralRe: Once Again Assert in Release and I am lost Pin
leon de boer7-Sep-17 6:39
leon de boer7-Sep-17 6:39 
GeneralRe: Once Again Assert in Release and I am lost Pin
ForNow8-Sep-17 10:09
ForNow8-Sep-17 10:09 
GeneralRe: Once Again Assert in Release and I am lost Pin
Rick York8-Sep-17 12:54
mveRick York8-Sep-17 12:54 
GeneralRe: Once Again Assert in Release and I am lost Pin
leon de boer8-Sep-17 18:07
leon de boer8-Sep-17 18:07 
GeneralRe: Once Again Assert in Release and I am lost Pin
ForNow9-Sep-17 15:03
ForNow9-Sep-17 15:03 
GeneralRe: Once Again Assert in Release and I am lost I finally figured out the bug .. My reflections Pin
ForNow10-Sep-17 12:50
ForNow10-Sep-17 12:50 
GeneralDeclaration Confuse Pin
Mr. Anup Roy31-Aug-17 6:38
professionalMr. Anup Roy31-Aug-17 6:38 
GeneralRe: Declaration Confuse Pin
leon de boer31-Aug-17 8:37
leon de boer31-Aug-17 8:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.