The screen
_______________
|_______________|
| ___|__
| |...|..|
| |...|..| The surfaced being blitted
| ---|--
| |
|_______________|
Will SDL take care of my blitting going beyond the surface I'm blitting to? Not just the 'screen' surface, but any surface I'm blitting to?
Also, I'm assuming in my code I'm working on that class destructors automaticly get called at system exit, or must I delete them with delete or something?
SDL - Drawing outside an image?
I'm wondering whether I am going out of bounds, when drawing outside of a surface? Basicly, I'm not bothering to cut my images as I draw them, to fit the screen, and am letting my blitting to overflow outside of the Surface I'm blitting to.
That will be fine. I think it just deletes the overhanging pixels (well it does for the screen).
Okay thanks. I thought I'd have to rewrite the code to stop outside drawing. [smile] Glad I can avoid it, although it wouldn't be to annoying.
But the class deconstructers, do I need to delete it specifically, or does it 'deconstuct' at the program quit?
Example: Can I go like this, and let the program automaticly call my decunstruct function?
Or, is there some way I call the deconstuctor? I tried '~MyInstance()' but it gave me compile-time errors.
But the class deconstructers, do I need to delete it specifically, or does it 'deconstuct' at the program quit?
Example: Can I go like this, and let the program automaticly call my decunstruct function?
int main(){ MyClass MyInstance(...Constuctor parameters...); while(Not Quited) { ... Main Loop ... } return 0;}
Or must I delete MyInstance manually?int main(){ MyClass MyInstance(...Constuctor parameters...); while(Not Quited) { ... Main Loop ... } delete MyInstance; return 0;}
Or, is there some way I call the deconstuctor? I tried '~MyInstance()' but it gave me compile-time errors.
Constructors and destructors are purely a C++ issue and have no relation to SDL. A destructor for an object is called as soon as it goes out of scope. You only call 'delete' on a pointer that points to an object that you previously allocated with 'new'.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement