First of all, let me say that my embarrassment now knows no ends. Firstly for
such a newbie mistake as I made and then for replying to my own post not once,
not twice, but three whole times…
All I can say is: watch out for full-screen blits! Where the menu takes up the
full screen (like you get in a game’s main menu) I didn’t bother to re-set the
rectangle coordinates of the menu from the default (0,0,0,0) which I now have
the constructor doing. But, then when I detect a mouse click I’m checking if the
point where the mouse clicks is inside the rectangle of the menu…
D’uh! * 100.
So, please completely ignore this thread unless you are searching for odd
errors…
And I think I’ll take up teaching coding - specifically how not to make stupid
errors like this AND how not to reply to yourself heaps on a newsgroup …
First of all, let me say that my embarrassment now knows no ends. Firstly
for
such a newbie mistake as I made and then for replying to my own post not
once,
not twice, but three whole times…
All I can say is: watch out for full-screen blits! Where the menu takes up
the
full screen (like you get in a game’s main menu) I didn’t bother to re-set
the
rectangle coordinates of the menu from the default (0,0,0,0) which I now
have
the constructor doing. But, then when I detect a mouse click I’m checking
if the
point where the mouse clicks is inside the rectangle of the menu…
D’uh! * 100.
So, please completely ignore this thread unless you are searching for odd
errors…
And I think I’ll take up teaching coding - specifically how not to make
stupid
errors like this AND how not to reply to yourself heaps on a newsgroup
printf is your best friend for debugging.
When you run your app and you get strange
output on the screen, set printfs before the
blitting functions.
I usually use std::cerr and std::clog. But that’s just me.
Torsten Giebl said:
Hello !
First of all, let me say that my embarrassment now knows no ends.
Firstly
for
such a newbie mistake as I made and then for replying to my own post not
once,
not twice, but three whole times…
All I can say is: watch out for full-screen blits! Where the menu takes
up
the
full screen (like you get in a game’s main menu) I didn’t bother to
re-set
the
rectangle coordinates of the menu from the default (0,0,0,0) which I now
have
the constructor doing. But, then when I detect a mouse click I’m
checking
if the
point where the mouse clicks is inside the rectangle of the menu…
D’uh! * 100.
So, please completely ignore this thread unless you are searching for
odd
errors…
And I think I’ll take up teaching coding - specifically how not to
make
stupid
errors like this AND how not to reply to yourself heaps on a newsgroup
printf is your best friend for debugging.
When you run your app and you get strange
output on the screen, set printfs before the
blitting functions.
I usually use std::cerr and std::clog. But that’s just me.
printf is your best friend for debugging.
I’ve tried using printf and std::cerr but they get directed to a file, and then
when my app closes, those files disappear… What I’ve been doing and what led
to the AHA effect for me was to use Windows’ MessageBox functions. I’ve put them
inside #ifdef directives so they only come on specifically when I want them,
plus it means that when it all works it will still be portable! (I might remove
them all before then, though!)
The great thing about the MessageBox function is that the program stops while it
is displayed, which means I can toggle over to the debugger and check out what’s
caused the problem…