08-29-2022, 03:44 PM
(This post was last modified: 08-29-2022, 04:43 PM by SpriggsySpriggs.
Edit Reason: revelation
)
I haven't read all of your code yet but I'd be willing to bet that some issues will arise from incorrect data types being used in your external function declarations. Every FUNCTION you've declared from the external libraries are set to use SINGLE as the return type. Also, according to the Wiki, C/C++ float is a SINGLE in QB64 so you will need to clean up a lot of TYPE and function declarations to use the proper data type. I see a lot of declarations using INTEGER. In C/C++, an int corresponds to a LONG in QB64. I'm not sure what the original declarations were but if they were int then they should be LONG. If they were int16 then you're fine. I haven't checked, but make sure any string passed to an external function is ended with a CHR$(0) so as to null-terminate the string. Before you move any further with the project, I'd check and fix the above to make sure these aren't hindering your progress.
Good luck!
P.S.
I just noticed that you're passing the value from RGBA32 to your fColor argument. The DrawTexture function expects a struct of Color but you're passing an UNSIGNED LONG value. https://www.raylib.com/cheatsheet/cheatsheet.html
P.P.S
If I have free time and I don't forget, I might download your BI file and try running it myself. If I get real ambitious, I'll make any change that would make your code be consistent with how I'd declare libraries and see if it resolves your issues. No promises, though.
P.P.P.S
"Option Explicit" is your friend. Make sure you explicitly declare each and every variable you use. This might seem inconvenient for a BASIC language but it prevents many hiccups. I don't write any code without it and I declare every variable even if it's a temp variable that will be disposed in the very next line.
P.P.P.P.S
I see that your fColor struct declaration is using UNSIGNED LONG as the data type for its members. You should instead be using UNSIGNED BYTE as the min value would be zero and the max value should not exceed 255. Your struct, as it currently stands, is 4 times as large as it should be.
Good luck!
P.S.
I just noticed that you're passing the value from RGBA32 to your fColor argument. The DrawTexture function expects a struct of Color but you're passing an UNSIGNED LONG value. https://www.raylib.com/cheatsheet/cheatsheet.html
P.P.S
If I have free time and I don't forget, I might download your BI file and try running it myself. If I get real ambitious, I'll make any change that would make your code be consistent with how I'd declare libraries and see if it resolves your issues. No promises, though.
P.P.P.S
"Option Explicit" is your friend. Make sure you explicitly declare each and every variable you use. This might seem inconvenient for a BASIC language but it prevents many hiccups. I don't write any code without it and I declare every variable even if it's a temp variable that will be disposed in the very next line.
P.P.P.P.S
I see that your fColor struct declaration is using UNSIGNED LONG as the data type for its members. You should instead be using UNSIGNED BYTE as the min value would be zero and the max value should not exceed 255. Your struct, as it currently stands, is 4 times as large as it should be.
Ask me about Windows API and maybe some Linux stuff