| Joined: Mar 2002 Posts: 93 Junior Member | OP Junior Member Joined: Mar 2002 Posts: 93 | Ok, I'm going to ask all the REAL C++ programmers out there to answer this.. and give me some good advice. I'm programming an arcade game, probotector style, with flashy lights, lots of ammo, and sh*t. This blended in with the all-mighty invaders feeling with ships moving downwards and changing direction and so... Now.. I have been reading on multithreading. (I have Turbo C++ 5.02 <borland>) And the help that I find there is not very satisfactory! I have been reading till my eyeballs started to bleed, but it doesn't make any sense!I mean, god!!! Can annyone here give a light-easy to understand-explanation of how to: Start a new thread - and linking or putting in or whatever it's called functions into it. Stopping the tread. The compilation is suposed to be speciall with some parameters.. that's no problem...
<img border="0" alt="[[censored]]" title="" src="graemlins/[censored].gif" />
- "It's not my code that's useless it's you loosers being unable to apprecitate it because of your lack of skills!" /zenon - C++ master Apprentice
| | | | Joined: Mar 2002 Posts: 1,273 DollarDNS Owner | DollarDNS Owner Joined: Mar 2002 Posts: 1,273 | Real C++ programmers huh? Well, how 'bout a fake C++ programmer giving you a heads up. Go to planetsourcecode.com and search for Base64. While looking around for example code in C for decoding/encoding Base64 algorithms, I found somebody had made a dll which supports both syncronus and asyncronus functions. I'm sure you know what that means and yes, it uses multithreading. I've looked through the code and found things quite interesting - and understandable enough.
*grumbles under his breath about what makes so-called 'real' C++ programmers...*
If ya was a little less cocky there, I would've looked for and got ya a direct link and/or learned the process real quick so that I could teach ya. It wouldn't be the first time. Consider yourself fortunate that I remembered that much off the top of my head to steer ya in the right direction. Like hell I'd go search for the answer for ya like I normally would. | | | | Joined: Mar 2002 Posts: 93 Junior Member | OP Junior Member Joined: Mar 2002 Posts: 93 | SilentRage, with 'real programmer', i'm refering to the guys that know what theyr'e talking about. Not the showoff boardgliders that oftenly get their nowses into discutions that they haven't got a clue about just to look cool. And I'm sure that you don't fit into THAT category =) Thanx a lot for the 'directioning', if it doesn't work out i'll let ya know.
- "It's not my code that's useless it's you loosers being unable to apprecitate it because of your lack of skills!" /zenon - C++ master Apprentice
| | | | Joined: Mar 2002 Posts: 1,273 DollarDNS Owner | DollarDNS Owner Joined: Mar 2002 Posts: 1,273 | well, if you said 'real programmer' I probably wouldn't have said anything cause I consider myself a real programmer (I place a lot of meaning to 'real programmers'). however, you said 'REAL C++ programmers' and I do not code in C++ at all. My hold on C is patchy at best - learning only what I need to learn to do a given project or answer a given question. So I was a bit miffed that even though I wasn't a 'REAL C++ programmer' that you indicated that I couldn't be of any help to you at all. But anyway, it was a moments irritation. I no longer care. You're coo'. And if you do still have issues, I'll learn it and give ya a detailed tut/example code on how to multi-thread. | | | | Joined: Mar 2002 Posts: 93 Junior Member | OP Junior Member Joined: Mar 2002 Posts: 93 | Well SilentRage, enlight me! I'm sure that you will give me something better than the planetsourcecode. Honestly, I'm not good at reading other peep's code that doesn't have any good comments. I got lost in an example that I downloaded. I would really like you to show me some multithreading, not something complex. Just some basic, so that I can carry it on from there. Example: a program that has 2 balls, ball no1's movement is calculated in one thread and ball no2's movement in another thread. =) Thanx a lot <img border="0" alt="[Thumb]" title="" src="graemlins/thumb.gif" />
- "It's not my code that's useless it's you loosers being unable to apprecitate it because of your lack of skills!" /zenon - C++ master Apprentice
| | | | Joined: Mar 2002 Posts: 93 Junior Member | OP Junior Member Joined: Mar 2002 Posts: 93 | Come on SilentRage, tell me...
- "It's not my code that's useless it's you loosers being unable to apprecitate it because of your lack of skills!" /zenon - C++ master Apprentice
| | | | Joined: Mar 2002 Posts: 1,273 DollarDNS Owner | DollarDNS Owner Joined: Mar 2002 Posts: 1,273 | ah yes, thanks for reminding me. Last time I had searched for the example code that I had previous downloaded from planet source code and couldn't find it. Then I had given up and forgot to pursue other sources. I found a tutorial by doing a google search: http://www.flipcode.com/tutorials/tut_mthreading.shtml http://www.flipcode.com/tutorials/tut_mthreading2.shtml However, I was not entirely satisfied, and altered my search criteria at msdn.microsoft.com for "creating threads". Then i found a bundle of information which is what I myself would prefer to read if I wanted to make a multi-threading application. Here's the link that will take you through several pages of helpful information. http://msdn.microsoft.com/library/en-us/dllproc/prothred_0t83.asp Only after you've looked at all that and still can't get a grasp on what you need to do, will I take that information and round it out into a no-nonsense tutorial. | | | | Joined: Mar 2002 Posts: 93 Junior Member | OP Junior Member Joined: Mar 2002 Posts: 93 | Thanx man =) If I would have chosen someone to be my programming teacher, you would have been the man,,, (if you are a man I really honestly don't know). <img border="0" alt="[Thumb]" title="" src="graemlins/thumb.gif" />
- "It's not my code that's useless it's you loosers being unable to apprecitate it because of your lack of skills!" /zenon - C++ master Apprentice
| | | | Joined: Feb 2002 Posts: 7,203 Likes: 11 Community Owner | Community Owner Joined: Feb 2002 Posts: 7,203 Likes: 11 | BTW, sr, you're my hero :x... | | | | Joined: Mar 2002 Posts: 1,273 DollarDNS Owner | DollarDNS Owner Joined: Mar 2002 Posts: 1,273 | aw shucks. Such nice words. Hey everybody, I found the secret to popularity. Learn how to search for info and give people links. | | | | Joined: Mar 2002 Posts: 93 Junior Member | OP Junior Member Joined: Mar 2002 Posts: 93 | Hmmm.. maybe I should refrace myself, yes I will use the links you gave me when I get into Visual C++, but now I wonder...
(the most classicall problem of all) How do I do to make for example (in DOS) to program the motion of the space ships in "Invaders", and still be able to have the user moving the spaceship at the same time? Something like multithreading, but for DOS. How? Thanks...
- "It's not my code that's useless it's you loosers being unable to apprecitate it because of your lack of skills!" /zenon - C++ master Apprentice
| | | | Joined: Mar 2002 Posts: 1,273 DollarDNS Owner | DollarDNS Owner Joined: Mar 2002 Posts: 1,273 | Er, I'm a windows programmer so I won't be much help here except in programming concepts. Your ship is controlled by a loop. Each iteration of the loop you move the ship another increment. You also check for keyboard input with each loop. If there's no keyboard input, move the ship in it's present course. If there is, then process the input THEN move the ship based upon it. If you want to see programming technique involving a constantly moving 'something' and keyboard input - then I suggest reading the QBasic code for Snakes. It would help bunches if you had QBasic and could step through the code. You wouldn't have to learn QBasic to see what things do.
I don't know if you can do "true" multithreading in DOS programming, but for sure you can divide your code's attention between many functions. | | | | Joined: Mar 2002 Posts: 93 Junior Member | OP Junior Member Joined: Mar 2002 Posts: 93 | For example. How did they do Duke Numed 1, I mean, that's for sure some DOS game. How did they get the enviorment to function, independently from the player?
- "It's not my code that's useless it's you loosers being unable to apprecitate it because of your lack of skills!" /zenon - C++ master Apprentice
| | | | Joined: Mar 2002 Posts: 1,273 DollarDNS Owner | DollarDNS Owner Joined: Mar 2002 Posts: 1,273 | I have absolutely no idea. I suggest getting the Quake code, it's free for the public ya know. It runs under DOS I think.
For all I know, it's one helleva big loop. lol | | | | Joined: Mar 2002 Posts: 93 Junior Member | OP Junior Member Joined: Mar 2002 Posts: 93 | Was that suposed to be a joke or something? <img border="0" alt="[Sheep]" title="" src="graemlins/sheep.gif" />
- "It's not my code that's useless it's you loosers being unable to apprecitate it because of your lack of skills!" /zenon - C++ master Apprentice
| | | | Joined: Mar 2002 Posts: 1,273 DollarDNS Owner | DollarDNS Owner Joined: Mar 2002 Posts: 1,273 | well, no, I wasn't joking. But it would be hell trying to know what to do with quake's source - so I guess that isn't much help. | | | | Joined: Mar 2002 Posts: 8 Junior Member | Junior Member Joined: Mar 2002 Posts: 8 | Does Quake 1 use the opengl api? If it does, ogl would take care of everything.... But i guess being the first 3d game it didn't...
But at any rate you can use opengl for your game and it will take care of all of your problems... If there is a dos api... sorry ive only used it with win, never looked into a dos version. Maybe there is a port (from win to dos for opengl) on sourceforge.... | | |
Posts: 860 Joined: March 2002
| | Forums41 Topics33,840 Posts68,858 Average Daily Posts0 | Members2,176 Most Online3,253 Jan 13th, 2020 | | | | | | | | | | | Doom 3 by Cyrez - 09/11/14 08:58 PM
| | | | | | | | | | | | | | | | | | |