![]() |
|
#1
|
|||
|
|||
Creating Thread Question!!!I encountered a situation that I used a time-exhausting command
when I took on 3D dynamic graphic programming. Next, what I am going to do is to creating "thread" instead of that time-exhausting command. For the process I dealed with was encapsulated within a class, if I wish to create thread, I would have declared "ThreadFunc" as static. However, all variable would not be used becuase I can not access non-static variables. Is there anybody tell me how to do? Or do I another way to do? I prepare some psuedo code for specification as following: //Loop Per Frame frame() { renderAnime(); if(needcapture){captureFrame();} } //Function to Capture Frame captureFrame() { captureSurface(); D3DXSaveSurfaceToFile(...);//Function of DirectX(Waste Time!!!) } //************************************************** ****************** I do not want to have any impact on the process of dynamic graphic when I intend to save file(frame), so that I create a thread for saving file(frame) process. I don not know the idea is right or not? Thanks for anyone who helps!!! //************************************************** ******************* |
|
#2
|
||||
|
||||
|
Hey, I have no idea how to solve your problem, because I'm only a year 1 programmer, but I do have a tip for you. I realize that you only posted pseudo-code, but if you get around to posting actual code that's written in the C language, you should encapsulate it in [c] tags. Read here for more info.
__________________
-Aaron |
|
#3
|
|||
|
|||
|
Quote:
|
|
#4
|
|||
|
|||
|
maybe you can use type casting
Quote:
|
Recent GIDBlog
Writing a book by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| question of practice | magiccreative | C++ Forum | 1 | 06-Feb-2004 08:17 |
| The Official Birthday Wishes thread for jrobbio | JdS | Open Discussion Forum | 8 | 20-Nov-2003 19:21 |
| a C input question.. | tmike | C Programming Language | 2 | 19-Sep-2003 03:39 |
| a C input question | tmike | C Programming Language | 1 | 16-Sep-2003 03:31 |
| a noobish compiler question | Charunks | C++ Forum | 5 | 03-Sep-2003 03:18 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The