Search:

Type: Posts; User: pandu

Search: Search took 0.01 seconds.

  1. If, lets say, you have a person named John Smith,...

    If, lets say, you have a person named John Smith, sometimes you can also see the name written Smith, John. Likewise, "the controller" is Controller::the. I got the habit from Java, where you would...
  2. thanks

    Thanks a lot. It's kinda inconsistent and unintuitive...
  3. Calling non-static functions on static variables

    In the Controller class, I have the following:


    static Controller the;
    Controller()
    {
    static Controller the=*this;
    }
  4. Replies
    9
    Views
    1,833

    What? Even without the braces? Never read of it...

    What? Even without the braces? Never read of it in any tutorial. Lol, so many surprises in this language.
  5. Replies
    9
    Views
    1,833

    how?

    How would you use a forward declaration here? You can't just say "struct BITMAP" like he did, can you?
  6. Replies
    9
    Views
    1,833

    aaah

    Thanks. But still, that's such a weird, ambiguous error...

    I'm going to include my library.h file then.
  7. Replies
    9
    Views
    1,833

    Pure virtual function error

    Here, I have a class which is intended to be a superclass so that I can put a bunch of its subclasses in a set.




    class Drawable
    {
    public:
    virtual void draw(BITMAP* b) =0;
  8. Thread: Following camera

    by pandu
    Replies
    5
    Views
    2,172

    in Allegro

    I'm doing this in Allegro (not Allegro3D or OpenGL), which means that I have a fixed-size bitmap. Thusly, I'm forced to check each and every single object to see if (a) it should be drawn on screen...
  9. Thread: Following camera

    by pandu
    Replies
    5
    Views
    2,172

    Following camera

    I'm trying to create a game in which there is going to be a bunch of object in one room, or stage. The objects are going have locations outside the room as well as inside. My player will be at the...
  10. Replies
    9
    Views
    1,394

    stupid mistake

    Oh, right, being careless. Would it be easier if I used a function to compare? I guess it wouldn't change too much. Thanks again.
  11. Replies
    9
    Views
    1,394

    here's what I tried

    struct circlecomparator
    {
    bool operator()(Circle* c, Circle* i) //const
    {
    return c->gsize() >= i->gsize();
    }
    };

    //...
  12. Replies
    9
    Views
    1,394

    The easiest way...

    What would be the easiest way to pass in a comparator? I tried the function way, but I couldn't get the syntax right. And then there is the struct way... If possible, can you show me both?
  13. Replies
    9
    Views
    1,394

    So, I really have no reason to use pointers to...

    So, I really have no reason to use pointers to objects here? Should I only do it when passing into functions and stuff?

    Thanks by the way for that.
  14. Replies
    9
    Views
    1,394

    Making items in a set do stuff

    Take a look:



    set<Circle*>* circles = new set<Circle*>() ;

    for(int i=0; i<100; i++)
    circles->insert(new Circle(rand()%screen_width, rand()%screen_height ));

    set<Circle*>::iterator...
Results 1 to 14 of 14