Advertisement Jump to content
  • Advertisement

Dookie

Member
  • Content Count

    548
  • Joined

  • Last visited

Community Reputation

290 Neutral

About Dookie

  • Rank
    Advanced Member
  1. Huh, now it works... I didn't do a thing, just tried it again today and youtube worked. I didn't turn off my computer overnight, either. Wonder if youtube was doing some updating, because it looks a little different from the way it did before the weirdness. Or, I wonder if my antivirus running overnight hogged up enough memory to cause Windows to automatically flush its caches? I dunno, but I'm glad it works! I thought that IE crash messed up my system, and I really didn't want to do ANOTHER OS reinstall. Thanks for the ideas and suggestions, I appreciate it!
  2. Thanks for the replies! smc, the problem continued to happen after I restarted the computer and then upgrade to IE 8... Restarting didn't get it to work again. Crud! Mr Explody (cool name), I do have the security/privacy settings cranked up for this screenshot (so my youtube name doesn't appear in the screenie), but I get the same problem when the security/privacy settings are set to default too. I think my Youtube problem started after my IE7 crashed (it locked up and I had to ctrl-alt-del to kill the browser window), but that may be a coinkidink because updating to IE8 should have cleared out any crash-related iffy-ness. Er, I think. [wink]
  3. Hello! This ain't game related, but you guys are the smartest people I can think of so I thought of this forum when I ran into this problem... Youtube Error (screenshot) What could be causing this? I've never seen it before... This is what I see when I go to youtube dot com. I can't view any videos on youtube, because I get a "don't have Flash installed" error. But if I go to a website where a Youtube video is embedded, I can play the video just fine. Have any of you ever seen this error before? If so, what'd you do to fix it? I have WinXP Pro, IE 8, security/privacy settings are set to default. The problem started with IE 7, so I updated to IE8 but the problem persists. Thanks in advance for the help!
  4. Dookie

    Direct3D9 and multithreading

    Oh, OK... I didn't know I had to break in order to see the threads. I see them now! Thanks for the info, I'm gonna do a little research to see why my game engine is such a CPU hog.
  5. Dookie

    Direct3D9 and multithreading

    That sounds cool! How do I view the threads from the debugger? When I go to 'Debug' -> 'Windows' -> 'Threads', it brings up a 'Threads' panel in my IDE that is blank (I'm using Visual Studio 2002). That panel has columns labeled 'ID', 'Name', 'Location', 'Priority', 'Suspend', but there's nothing listed while my game engine's running. I compiled my game using the 'Debug' option, so I'm not sure why I can't see the threads.
  6. Hello! I'm still new to multithreading, so forgive my ignorance if there's a painfully solution to my problem. [grin] First of all, I'm doing this to create my Direct3D object: DXStuff->g_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, DXStuff->hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED, &d3dpp, &DXStuff->g_pd3dDevice ) When I first start my game engine, I start an animated splashscreen for the player to see while game textures and sounds are loaded in the background. Here's how I load this splashscreen code: _beginthread(SplashThread, 0, &sParams); and here's the code for the above call: void SplashThread(PVOID pvoid) { PPARAMS pparams; pparams = (PPARAMS) pvoid; while (!pparams->threadDone) { UpdateGameTimer(pparams->DXStuff); RenderSplash(pparams->DXStuff, pparams->DXEnts); } CleanupSplash(); _endthread(); } When I'm done loading the game, I exit out of the SplashThread with "pparams->threadDone = true;" What's weird is that my game engine seems to be using an awful lot of CPU power than if I'm not using multithreading. Is it possible the SplashThread is still running in another thread even if I've ended it? Or, maybe it hasn't completely ended? Is there a way I can ensure ALL splash-related threads are completely closed when the game is completely loaded? Thanks in advance for the help!
  7. Thanks for the reply, the_edd! If you look at the code segment, you'll notice that "_endthread()" was being called from within the MyThread() function itself (the function called by "_beginthread()"). The thread had not ended yet, so I was going to use _endthread() at the end of the function to formally free up any resources it may have been using. I have indeed read the MSDN page on threads, and I've heard differing opinions here and there whether it's necessary to manually shut down a thread. I figured that I probably didn't need to actually use _endthread(), but I was just baffled as to why the function was getting stuck when it tried to execute _endthread(). I still don't know why the MyThread() function stops at _endthread()... Anybody else know why? Thanks in advance for the help!
  8. Hello! I have some code called with '_beginthread()' and it executes fine. But when I get to the end of the thread function, I call '_endthread()' and it doesn't go beyond that... For example (pseudocode): void MyThread(void *Duh) { print "Thread entered successfully." Sleep(500); print "Gonna execute '_endthread()'..." _endthread(); print "Thread ended successfully" } ... _beginthread(MyThread, 0, 0); will display: Thread entered successfully. Gonna execute '_endthread()'... It never displays that last part ("Thread ended successfully") because it gets hung up on the _endthread() statement. Am I doing something wrong? Are resources getting hogged up because of this? Is _endthread() even necessary? Am I nuts? Thanks in advance for the help!
  9. Dookie

    If the world could vote.

    Going back to try_catch_this's original post, if these polls are accurate then I can believe it. I think what the world outside of the US is interested in is a superpower that is willing to shake its hand rather than leave it in the dark. The US currently doesn't have much of an open-door policy anymore... Reagan was successful in heralding positive world/US relations and averting full-out war by being a people person. Clinton kept that ball rolling. But the Bush family nipped that ideal in the bud, by being wary and untrusting of others and avoiding interaction with other countries unless it somehow benefitted the US. Imagine living in a community where you have a neighbor living on each side of you. Neighbor Bob offers small talk, invites you to the occasional backyard barbeque, and waves at you when you leave for work. Neighbor Sam doesn't even make eye contact with you, although his daughter once asked if you would purchase a candy bar for a school fundraiser. Even though they both give you your mail if the mail carrier accidently delivers it to their house instead of yours, which neighbor would you most likely lend your lawn mower to if he asked to borrow it? To wrap up these analogies, I think the world outside of the US views Obama as potentially being a better ambassador than McCain, and they like that idea. Obama made it clear that he wants to talk face-to-face with world leaders, and McCain's team made it clear that they believe such an idea is naive and foolish. From another country's point of view, which sounds like the better choice: A president who is open and willing to talk together, or a president who continues to leave them wondering what they're going to do next? Dem's my two cents, and mostly just my opinions and ramblings, so take it with a grain with salt.
  10. Thanks for the tip rip-off, it now works!
  11. Hello! I'm using tellg() to get the position of my reader within a file. But I keep getting this error when compiling: warning C4244: 'argument' : conversion from '__int64' to 'std::basic_istream<_Elem,_Traits>::off_type', possible loss of data with [ _Elem=char, _Traits=std::char_traits<char> ] I'm doing this: stPos = inStart.tellg(); to get the reader's position, where 'stPos' is a '__int64' integer. How do I define 'stPos' as 'basic_ios::pos_type'? I'm pretty new to playing around with file readers, so this is most likely an embarassingly simple solution... Thanks in advance for the help!
  12. Thanks for the info, SiCrane. I'll check out that readme file and see if I can figure it out... By the way, how good is that Visual Express Edition? Will it work fine with Windows XP, or is it more designed with Vista in mind? It might be time for me to upgrade to a new programming environment.
  13. I tried your idea of going with ICU SiCrane, but I'm drowning in 'Can't find xxx.lib' and 'A tool returned an error code: "Performing Custom Build Step"' and similar errors to the point where I'm ripping out even more hair than before. I have VisualC 7.0, and the code/binaries at ICU are either 6.0 or 7.1 or 8.0. On top of that, the souce code won't compile because it's looking for libraries that weren't packaged with the code (icuuc.lib, icuucd.lib, etc)... Must be one of those things where Windows programming environments are an afterthought, being as how 'Microsoft' and 'Windows' aren't even mentioned on their home page. Any other ideas, or can this even be done in my programming environment of choice? Or rather, the only programming environment I know? Thanks for cleaning up my code, Zahlman! I just threw it together as I was experimenting with different ideas, so it got sloppy fast. Thanks!
  14. Well, I'm starting to understand Unicode but it looks like portability of my code would be a pain in the poop chute. Good thing I don't care about portability... All I want is for this to work with a file saved in Windows Notepad (saves in UTF-8, I think): void ScanThread(PVOID pvoid) { PPARAMS pparams; // Scanner variables char startRes[2048]; char endRes[2048]; int strInfo; ifstream inStart, inEnd; ofstream outDiff; pparams = (PPARAMS) pvoid; while (!pparams->threadDone) { if (pparams->doCompare) { pparams->doCompare = false; // open the file 'start.txt' for reading... SetDlgItemText( pparams->hwnd, IDC_STAGENUM, "Stage 1" ); inStart.open("start.txt"); if (!inStart) { // No 'start' file... // ------------------ pparams->retResult = 1; goto EndCompare; } // and open the file 'end.txt' for reading... SetDlgItemText( pparams->hwnd, IDC_STAGENUM, "Stage 2" ); inEnd.open("end.txt"); if (!inEnd) { // No 'end' file... // ---------------- inStart.close(); pparams->retResult = 2; goto EndCompare; } // create the file 'difference.txt' for writing... SetDlgItemText( pparams->hwnd, IDC_STAGENUM, "Stage 3" ); outDiff.open("difference.txt"); if (!outDiff) { // Can't create 'difference' file... // --------------------------------- inStart.close(); inEnd.close(); pparams->retResult = 3; goto EndCompare; } // First, compare every line in Start with End... outDiff << "-----------------------------------------------------" << endl << "| Stuff found in Start that was different from End: |" << endl << "-----------------------------------------------------" << endl << endl; SetDlgItemText( pparams->hwnd, IDC_STAGENUM, "Stage 4" ); while (!inStart.eof()) { IncrementStartCounter(pparams->hwnd, pparams->StartNum); inStart.getline(startRes, 2048); inEnd.seekg(0, ios_base::beg); inEnd.clear(); pparams->EndNum = 0; while (!inEnd.eof()) { IncrementEndCounter(pparams->hwnd, pparams->EndNum); inEnd.getline(endRes, 2048); strInfo = strcmp(startRes, endRes); if (strInfo == 0) goto NextIteration; } outDiff << startRes << endl; NextIteration: inEnd.clear(); } inStart.seekg(0, ios_base::beg); inStart.clear(); inEnd.seekg(0, ios_base::beg); inEnd.clear(); // ...then compare every line in End with Start. pparams->StartNum = 0; pparams->EndNum = 0; outDiff << endl << endl << "-----------------------------------------------------" << endl << "| Stuff found in End that was different from Start: |" << endl << "-----------------------------------------------------" << endl << endl; SetDlgItemText( pparams->hwnd, IDC_STAGENUM, "Stage 5" ); while (!inEnd.eof()) { IncrementStartCounter(pparams->hwnd, pparams->StartNum); inEnd.getline(endRes, 2048); inStart.seekg(0, ios_base::beg); inStart.clear(); pparams->EndNum = 0; while (!inStart.eof()) { IncrementEndCounter(pparams->hwnd, pparams->EndNum); inStart.getline(startRes, 2048); strInfo = strcmp(startRes, endRes); if (strInfo == 0) goto NextIteration2; } outDiff << endRes << endl; NextIteration2: inStart.clear(); } // We're done! outDiff << endl << endl << "==============" << endl << "Scan complete!" << endl; inStart.close(); inEnd.close(); outDiff.close(); SetDlgItemText( pparams->hwnd, IDC_STAGENUM, "Finished!" ); EndCompare: pparams->compareDone = true; } Sleep(50); } _endthread(); } The above code is a comparison program thread that looks at two text files and then outputs any differences to a third file, and it works perfectly as long as the 'Start.txt' and 'End.txt' files are plain vanilla text files. If I try to run this routine with the same text files after saving them in Notepad (Unicode 8, I think), then it outputs a couple of control characters and nothing else. How in tarnation do I get the above code to work with Unicode-encrusted Windows Notepad text files? I just can't figure it out. [Mr Bump] Poopity-poop! [/Mr Bump] Thanks in advance for the help!
  15. Sorry I wasn't more specific about 'it doesn't work', I'm just frustrated with it and some of my hair is missing from pulling it out. D'oh! When I open the file, it opens OK without errors. But when I read data from it using "inTxt.getline(txtStuff, 2048);", the variable 'txtStuff' contains garbage if it's a Unicode text file. The variable 'txtStuff' contains a line of readable text if the text file is a plain vanilla text file. Other things are frustrating me today, but I digress. Sorry if I sound ticked off, I don't mean to come off that way. :(
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!