GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 15-Mar-2004, 21:31
Melvin Lin Melvin Lin is offline
New Member
 
Join Date: Mar 2004
Posts: 16
Melvin Lin is on a distinguished road

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  
Old 15-Mar-2004, 23:53
aaroncohn's Avatar
aaroncohn aaroncohn is offline
Regular Member
 
Join Date: Feb 2004
Location: Bay Area, CA.
Posts: 564
aaroncohn is a jewel in the roughaaroncohn is a jewel in the roughaaroncohn is a jewel in the rough
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  
Old 17-Mar-2004, 20:20
Melvin Lin Melvin Lin is offline
New Member
 
Join Date: Mar 2004
Posts: 16
Melvin Lin is on a distinguished road
Quote:
Originally Posted by aaroncohn
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 http://www.gidforums.com/t-689.html for more info.
Thanx a lot!!!
  #4  
Old 20-Mar-2004, 10:08
machinated machinated is offline
Regular Member
 
Join Date: Mar 2004
Location: victoria, canada
Posts: 324
machinated has a spectacular aura aboutmachinated has a spectacular aura about
maybe you can use type casting


Quote:
Originally Posted by Melvin Lin
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!!!
//************************************************** *******************
 
 

Recent GIDBlogWriting a book by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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

All times are GMT -6. The time now is 01:07.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.