Welcome, Guest. Please login or register.

Author Topic: StormC4 C++ Library Base Weirdness!  (Read 2191 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Steady

Re: StormC4 C++ Library Base Weirdness!
« on: March 21, 2004, 02:39:20 PM »
Hi Karlos,

I came across the same problem. It is unbelievably annoying and should never have been allowed to happen, but there it is. I worked around it by declaring GfxBase as 'struct Library *' and not including graphics/gfxbase.h in the source file that opens/closes the library base. When the library was opened the GfxBase variable was copied to another variable with a different name.

All functions that needed access to a variable stored in GfxBase were placed in a different source file that did have graphics/gfxbase.h included.

In the second source file, I declared 'struct GfxBase *gfx' variable and copied the GfxBase pointer from the variable with a different name like so:

gfx = (struct GfxBase *)(sim.gfxLibPtr);

Then I could use gfx as GfxBase in that source file.

It might have been a round-about way to get past this and it might be done slightly easier, but it was just driving me insane at the time so when it worked I left it.
 

Offline Steady

Re: StormC4 C++ Library Base Weirdness!
« Reply #1 on: March 22, 2004, 10:09:26 AM »
Thanks for that Karlos. I hated my hacky work-around anyway. It's just that it was driving me :crazy: at the time.

I'll try it out.