08-31-2024, 08:33 PM
The source code is horribly confusing, but:
Somewhere around line 14109 (I poked around, so the number may not agree with the original) you call ResetScreenCLS and then on the next line you call showbg. What's going on: According to my research, ResetScreenCLS is supposed to insert an image with handle BG&. You know about BG& being ZERO? BG& is (probably) not a global shared variable, but a local variable used by showbg itself. It's just that showbg loads the background image, places it, and immediately deletes it from memory. I assume that the exact same problem will be in ResetScreenNoCLS, there it is exactly the same, you insert an image with an invalid handle.
So I would strongly recommend loading at least this specific image (bg.jpeg) into memory when the program starts and leave it there with the globally shared descriptor BG&.
Look, I spent more than an hour on this, like sorry, but normally my beer warmed up between testing your code. Do you understand the sacrifice I made?
Somewhere around line 14109 (I poked around, so the number may not agree with the original) you call ResetScreenCLS and then on the next line you call showbg. What's going on: According to my research, ResetScreenCLS is supposed to insert an image with handle BG&. You know about BG& being ZERO? BG& is (probably) not a global shared variable, but a local variable used by showbg itself. It's just that showbg loads the background image, places it, and immediately deletes it from memory. I assume that the exact same problem will be in ResetScreenNoCLS, there it is exactly the same, you insert an image with an invalid handle.
So I would strongly recommend loading at least this specific image (bg.jpeg) into memory when the program starts and leave it there with the globally shared descriptor BG&.
Look, I spent more than an hour on this, like sorry, but normally my beer warmed up between testing your code. Do you understand the sacrifice I made?
![Smile Smile](https://qb64phoenix.com/forum/images/smilies/smile.png)