Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
An option to not need _GL sub
#5
(10-17-2025, 12:09 PM)DSMan195276 Wrote:
(10-17-2025, 12:27 AM)SMcNeill Wrote: I think it's as simple as just removing it from the displayorder.
I think Unseen is actually talking about the fact that if you don't have a `SUB _GL` then you're not allowed to call any OpenGL functions anywhere in your code. IE. You're allowed to have a `SUB foo` that calls `_glBegin`, but the compiler will error on `_glBegin` being called if there's no `SUB _GL` elsewhere in the code. This gets messy if you're providing a library with optional OpenGL features and don't know if the code using it will have `_GL` defined.

I think the best approach would be to wrap all the OpenGL stuff in a `$IF EnableGL THEN` type of thing. That way the users can simply define `$LET EnableGL = 1` to get all the OpenGL functionality if they want it, and it will otherwise get excluded if they don't (avoiding the compilation issues).
Yes thats exactly it!

Thanks for the responses though guys! I'm using the method steve suggested at the moment and using a flag to allow the sub to run...

Unseen
Reply


Messages In This Thread
An option to not need _GL sub - by Unseen Machine - 10-16-2025, 11:55 PM
RE: An option to not need _GL sub - by SMcNeill - 10-17-2025, 12:27 AM
RE: An option to not need _GL sub - by SMcNeill - 10-17-2025, 12:31 AM
RE: An option to not need _GL sub - by Unseen Machine - 10-17-2025, 02:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  option explicit Unseen Machine 20 1,367 01-26-2026, 03:09 AM
Last Post: bplus
  Found a BUG with the QB64 editor compiled with the -O3 option Coolman 2 826 06-02-2022, 06:27 PM
Last Post: Coolman
  A preview of a new QB64 option SMcNeill 12 2,682 05-04-2022, 01:11 PM
Last Post: DSMan195276

Forum Jump:


Users browsing this thread: 1 Guest(s)