Click here to Skip to main content
15,899,313 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Linker error Pin
Vaclav_13-Sep-17 9:05
Vaclav_13-Sep-17 9:05 
GeneralRe: Linker error Pin
Jochen Arndt14-Sep-17 3:38
professionalJochen Arndt14-Sep-17 3:38 
GeneralRe: Linker error Pin
leon de boer15-Sep-17 22:21
leon de boer15-Sep-17 22:21 
GeneralRe: Linker error Pin
Vaclav_16-Sep-17 3:02
Vaclav_16-Sep-17 3:02 
GeneralRe: Linker error Pin
leon de boer16-Sep-17 3:16
leon de boer16-Sep-17 3:16 
QuestionClarification of Debug/Release mode Pin
ForNow11-Sep-17 2:24
ForNow11-Sep-17 2:24 
AnswerRe: Clarification of Debug/Release mode Pin
Jochen Arndt11-Sep-17 3:21
professionalJochen Arndt11-Sep-17 3:21 
AnswerRe: Clarification of Debug/Release mode Pin
leon de boer11-Sep-17 15:51
leon de boer11-Sep-17 15:51 
GeneralRe: Clarification of Debug/Release mode Pin
ForNow11-Sep-17 15:58
ForNow11-Sep-17 15:58 
GeneralRe: Clarification of Debug/Release mode Pin
leon de boer12-Sep-17 8:33
leon de boer12-Sep-17 8:33 
GeneralRe: Clarification of Debug/Release mode Pin
ForNow12-Sep-17 8:46
ForNow12-Sep-17 8:46 
GeneralRe: Clarification of Debug/Release mode Pin
leon de boer13-Sep-17 18:25
leon de boer13-Sep-17 18:25 
Questionbatch file quicksort algorithm Pin
wayne wu10-Sep-17 16:10
wayne wu10-Sep-17 16:10 
AnswerRe: batch file quicksort algorithm Pin
Richard MacCutchan10-Sep-17 19:24
mveRichard MacCutchan10-Sep-17 19:24 
AnswerRe: batch file quicksort algorithm Pin
CPallini11-Sep-17 2:22
mveCPallini11-Sep-17 2:22 
Questionelaborate the build instructions Pin
Member 125524089-Sep-17 13:05
Member 125524089-Sep-17 13:05 
AnswerRe: elaborate the build instructions Pin
Richard MacCutchan10-Sep-17 4:18
mveRichard MacCutchan10-Sep-17 4:18 
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.

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.