Author Topic: Is it possible to use qb64 modules in c++?  (Read 1430 times)

0 Members and 1 Guest are viewing this topic.

Offline Alex

  • Newbie
  • Posts: 1
Is it possible to use qb64 modules in c++?
« on: July 22, 2020, 07:20:24 pm »
I wrote a program in C++ which I later wanted to add graphics to. Unfortunately options to do simple pixel plotting graphics in 4-bit color modes are either non-existant or really ugly with the (modern) graphics libraries I've found for use in Linux. I'd much prefer to use QB but my program is too large and too dependent on the full spectrum of C++ OO magic to convert that into QB. So I want to know, since qb64 builds C++ code to compile, if it would be possible to rewrite the graphics portion of my program in qb64 and link it with my C++ program so that my C++ program calls QB subs to do the drawing easily and efficiently. If the main function of the program has to be in qb64 for graphics to work, that's fine as my C++ main function just creates an instance of a class and calls one of its methods with argv, argc as parameters. I could easily write a main in qb64 that does this as long as 1) it could instantiate my C++ class and call its member function and 2) my C++ code could then call back to qb64 subs to do the drawing. I didn't see discussion or examples of this using Google and my search in this forum was not giving meaningful results (far too many and not related to my needs).

So:
Is this possible?
Can you construct a simple example to demonstrate how to code and compile the two sides to work together?

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • GitHub
Re: Is it possible to use qb64 modules in c++?
« Reply #1 on: July 23, 2020, 10:16:42 am »
Honestly, I think not. I don't know all the details though.
Shuwatch!