Jump to content

  • Log In with Google      Sign In   
  • Create Account

14 years ago on June 15th Gamedev.net was first launched! We want to thank all of you for being part of our community and hope the best years are ahead of us. Happy birthday Gamedev.net!

#ActualCornstalks

Posted 31 December 2012 - 04:24 PM

It's a lot of code to go through, so I just skimmed it, but this looks suspicious:
Bitmap *bitmap;
...
    tex = bitmap->loadTexture("Practice.bmp");

I don't see you ever initializing bitmap. My guess is that it's an invalid pointer and you aren't setting it/allocating a Bitmap. Perhaps it shouldn't be a pointer and should just be a regular Bitmap instead of a Bitmap*? I see no reason to make it a pointer. I'm also unsure of why you made bitmap and tex global variables instead of member variables of Editor...
 
But yes, as fastcall22 said, now would be a great time to get familiar with your debugger.

#3Cornstalks

Posted 31 December 2012 - 04:22 PM

It's a lot of code to go through, so I just skimmed it, but this looks suspicious:
Bitmap *bitmap;
...
    tex = bitmap->loadTexture("Practice.bmp");

I don't see you ever initializing bitmap. My guess is that it's an invalid pointer and you aren't setting it/allocating a Bitmap. Perhaps it shouldn't be a pointer and should just be a regular Bitmap instead of a Bitmap*? I see no reason to make it a pointer.
 
But yes, as fastcall22 said, now would be a great time to get familiar with your debugger.

#2Cornstalks

Posted 31 December 2012 - 04:21 PM

It's a lot of code to go through, so I just skimmed it, but this looks suspicious:

 
Bitmap *bitmap;
...
    tex = bitmap->loadTexture("Practice.bmp");


I don't see you ever initializing bitmap. My guess is that it's an invalid pointer and you aren't setting it/allocating a Bitmap. Perhaps it shouldn't be a pointer and should just be a regular Bitmap instead of a Bitmap*? I see no reason to make it a pointer.
 
But yes, as fastcall22 said, now would be a great time to get familiar with your debugger.


#1Cornstalks

Posted 31 December 2012 - 04:21 PM

It's a lot of code to go through, so I just skimmed it, but this looks suspicious:

 
</p><div>Bitmap *bitmap;</div>
<div>...</div>
<div>    tex = bitmap->loadTexture("Practice.bmp");</div>
<div>
 
I don't see you ever initializing bitmap. My guess is that it's an invalid pointer and you aren't setting it/allocating a Bitmap. Perhaps it shouldn't be a pointer and should just be a regular Bitmap instead of a Bitmap*? I see no reason to make it a pointer.
 
But yes, as fastcall22 said, now would be a great time to get familiar with your debugger.

PARTNERS