I'm interested in creating a 2-dimensional tile-based game utilizing sprites and such, but I have no idea where to begin. I have a 14 year background in programming console applications in C++, but...
Type: Posts; User: drrcknlsn
I'm interested in creating a 2-dimensional tile-based game utilizing sprites and such, but I have no idea where to begin. I have a 14 year background in programming console applications in C++, but...
Thanks, CornedBee. That's exactly what I was looking for.
Can anyone point me to a good reference for reading an image pixel by pixel? I need to discern the color information of each pixel for use in a program, but I'm unsure of how to go about it.
...
It was on the definition line.
So would this be one of the cases where you'd want to return a const pointer instead of a pointer to a const object?
Edit: Errr... I meant 'accept', not 'return'.
OK... I modified what you suggested, but now it's spitting out "error C2440: '=' : cannot convert from 'const Node *' to 'Node *'
void setNext ( const Node * pNewNext ) { mpNext =...
Why does 'next' need to return a const, but not 'data'?
And does 'const Node *' translate to 'a constant pointer to a Node object' or 'a pointer to a constant Node object'? From what I've read,...
Thanks guys.
Incidentally, while I have your attention, is there a better reference for reading up on const-correctness? I've read the article on this site and a few other brief ones I found on...
If I understand correctly, because the object owns the object being pointed to, but doesn't manage the memory (the member is just a pointer), then I have to delete it somewhere, and the destructor...
Because I was introduced to C++ through MSVS.NET, I quickly got used to the managed extensions before learning standard C++. Now, I'm having to go back and relearn a lot of things so that my code is...
Ah... thanks. I guess I overlooked it since it normally tells me "unreferenced identifier" when I forget to include the header. Stupid me!
What would prompt an error telling me that "std is not recognized as a namespace, blah blah blah..." while attempting to use 'std::string'? Obviously std is a namespace, so that error seems rather...
...can't increment before initialization.
Student is supposed to be an abstract class that will never be instanced, but I get what you're saying.
Would it not be more efficient to have a dedicated inquiry method (like virtual bool...
Correct - things like uint16 Graduate::GRE(), which returns a graduate student's GRE score. While this probably isn't the best example, since all students can take the GRE regardless of...
Well, basically...
A = student
B = undergraduate (inherits student)
C = graduate (inherits student)
D = class
D::x = class role (list of all students in the class)
So, to send a message to...
Right. I didn't think it would work like that, which is why I was asking about void *.
The only other option I can think of that satisfies my requirements is splitting D::x into two different...
The only reason isB() exists is so D objects will know whether x() points to a B or C. What would be a better way to test this?
A pointer to a base class can also point to any derived classes...
I have a base class, A, with an inquiry method bool isB(), and two derived classes, B and C, that inherit from A. I also have a container class, D, with a variable, x, and its respective accessor,...
That's kind of what I was looking for, I guess. I was really hoping there was something like #ifdef ___64BIT___ that would work for all 64-bit processors, and one for 32-bit, etc.
I know that type "int" is not guaranteed to be a specific size, as well as all of the other primitives, but is there a quick and easy way to dynamically create custom data types that isn't going to...
Thanks for the explanation. I think it's all somewhat stupid as well, but to make the implementation as OO as feasibly possible, everything should theoretically be objects, including the class's...
I don't suppose you could break this down with an explanation as to what you're doing, could you? I don't have a good book handy, and I'm having trouble finding examples of most of what you've done...
I am trying to get away from returning references - hence why I mentioned creating wrapper classes for the primitives.
I know it takes roughly twice as much memory to store a wrapped primitive...
Since primitive types in C++ are not objects and must be turned into objects via wrapper classes in order to use the "attributes as objects" accessor methodology, does this pose a significant risk to...