Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

180 Neutral

About DarkHamster

  • Rank
  1. So I'm writing an emulator, using GLUT/GL for windowing/input/graphics, and I want the game logic to be executed exactly once per re-draw and then free up the CPU for use by other programs. Unfortunately I can't find any functionality in GLUT to give me a callback once per frame, as would be optimal. Someone suggested to me that I use timer callbacks to get my code to run at roughly 60 hz, but this seemed like a bit of a hack. Anyone here have any suggestions?
  2. DarkHamster

    What program you use?

    Glasgow Haskell Compiler
  3. DarkHamster

    How 'wide' is a photon?

    Just because something has a chance of 0 doesn't mean it can't ever happen. Just thought I'd throw that out there. For instance, if you pick a function at random, the chance that it can be integrated is 0, yet clearly there are functions that can be integrated.
  4. I haven't tried Torque, but OGRE is free, and you're a hobbyist so why not give it a whirl? I'm using it for my current project, and I really like it. It's just a graphics engine (there's an input part too, but it's pretty weak -- I had to rewrite my own to take advantage of gamepads), but it does a very good job of being a graphics engine.
  5. DarkHamster

    std::string manipulation help

    char buffer[1000]; Obviously buffer isn't an std::string, you define it as a char array. Try making a string from that (e.g. "std::string buf_str = std::string(buffer)") and then using std::string::find.
  6. DarkHamster

    Post your screenshots!

    [nuffer@localhost Debug]$ cat test.g namespace Test { open Ghoul; open Ghoul.Collections; module TestModule { fib (n : int) : int { if(n <= 1) 1; else fib(n - 1) + fib(n - 2); } } } [nuffer@localhost Debug]$ mono GhoulIR.exe test.g fib { if((n <= 1)) 1 else (fib((n - 1)) + fib((n - 2))); } 0 errors. fib [Label(Ghoul.Semantics.Label), CJump(<=, Mem(BinOp(+, Tmp(Ghoul.Semantics.Var+FramePointer), Const(8))), Const(1), x, x), Label(Ghoul.Semantics.Label), Move(Tmp(Ghoul.Semantics.Var+Local), BinOp(+, Call(Name(Ghoul.Semantics.Label), [BinOp(-, Mem(BinOp(+, Tmp(Ghoul.Semantics.Var+FramePointer), Const(8))), Const(1))]), Call(Name(Ghoul.Semantics.Label), [BinOp(-, Mem(BinOp(+, Tmp(Ghoul.Semantics.Var+FramePointer), Const(8))), Const(2))]))), Label(Ghoul.Semantics.Label), Move(Tmp(Ghoul.Semantics.Var+Return), Tmp(Ghoul.Semantics.Var+Local)), Jump(Name(Ghoul.Semantics.Label)), Label(Ghoul.Semantics.Label), Move(Tmp(Ghoul.Semantics.Var+Local), Const(1)), Jump(Name(Ghoul.Semantics.Label))] I apologize for the strange formatting.
  7. DarkHamster

    1st game - newbie looking for feedback.

    Any game without hidden information is "perfect." Even chess. Tic-tac-toe just has a solution that even a child can comprehend.
  8. DarkHamster

    What do you think about playing piano?

    Choosing to play flute may well have been one of the best decisions of my life.
  9. DarkHamster

    compiler books, so many!

    I'm working through a compiler independent study (senior year of HS, not a big selection of CS courses) in compiler design right now. I've been using Appel's Modern Compiler Implementation in Java. It's separated into two halves; the first is intended for an undergraduate course, and the second for a graduate course. Mine lacks the "Basic Techniques" subtitle, so I suspect that edition might only have the first half of mine. In any case, the book does a good job covering all the bases of a normal compiler, but sometimes a little more explanation would have been helpful. Take, for example, Chapter 2, which covers regular expressions. His explanation of the theory behind building and evaluating a regular expression was very terse, and I had a hard time understanding it. After seeking out more information on the 'net, I came to understand everything Appel was talking about. Note, also, that the book does not expect you to implement some code -- it only covers the theory behind it. For instance, after the chapter on regular expressions, there is a Java regular expression library included (on the CD) apparently. I went and coded my own for fun. Also, he includes a parser generator library for your use (again, I wrote my own). I can't give a complete review of the book, as I'm only working on Chapter 8 (out of 13 to have a fully working compiler, 21 total). I don't have a good point of reference, as this is the first and only compiler book that I've used, but I would say that it is, while not perfect, quite good. I would, however, highly suggest that you look into the "Modern Compiler Implementation in SML" edition of the book, as I have heard good things about that edition (vs. the Java edition).
  10. DarkHamster

    Desktop thread!

  11. DarkHamster

    I never knew, am I stupid?

    Kylotan is right, when you allow a class to access private members of any instance of the same class, this can be checked at compile time. If you disallow access to private members of other instances, a run-time check is required.
  12. I don't think what you're trying to do is very clear. It looks like you're trying to pass a string in to a function that's expecting a MyObject, which makes no sense. Perhaps you want a map of strings to MyObjects? std::map<string, MyObject> MyObjects; ... MyObjects["object1"] = MyObject(); MyObjects["object2"] = MyObject(); ... MyFunction(MyObjects["object1"]); what seems more useful in your case is a vector of MyObjects... for example std::vector<MyObject> MyObjects; ... MyObjects.push_back(MyObject()); MyObjects.push_back(MyObject()); ... for(std::vector<MyObject>::iterator i = MyObjects.begin(); i != MyObjects.end(); ++i) MyFunction(*i); Please clarify your question if this isn't helpful.
  13. DarkHamster

    Summary of GNU/Linux IDEs

    You forgot monodevelop, a mature IDE for mono (C#, Java and Nemerle so far, probably VB soon). Written in C#, using Gtk# for the GUI.
  14. DarkHamster

    saving info in a class to a file

    If you're working in Nemerle (which I highly doubt you are), you might find this useful: http://nemerle.org/macros.html#attributes.
  15. DarkHamster

    Fantasy HTML Design

    At my school they have Dreamweaver MX, and so I've used it. I can say that I believe it is a fantastic tool. The code it generates is just as clean as I would have written it, and all the integrated tools sped up design of the site (especially since it was a collaborative effort between myself and another person). If you're eligable for an educational version (the professional one is quite expensive), it's highly recommended.
  • 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!