Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - SpongeBob

#1
Off Topic / Re: 3D Modeller
2014-Aug-18
I've been a big fan Fragmotion for many years, it does animation, modelling, texturing, scripting and it's import/export options are focused on game models. It's pretty cheap too.

http://www.fragmosoft.com
#2
Doh!  :-[ Your quite correct, thank you for pointing that out.
#3
@backslider: Unfortunately our suggestion causes an "temp.gbas"(8) error : command not inside function or sub" error. This could be removed simple by moving the test routine to a function but I think "extern" is the way to go.

@hardyx: "extern" works great but removing the "//" here:

LOCAL l%
INLINE
     extern int xfoo;
     //l%=xfoo;
     DEBUG((DGStr)xfoo);
ENDINLINE

Causes an "*** Unhandled exception ***   EXCEPTION_INT_DIVIDE_BY_ZERO" runtime error. I think this is due to a C to GLBasic type conversion?
It's not really a big deal, as the global C var will only be used within various in-lined C sections scattered between various project files but I would still like to know why it's causing a divide by zero though?

@MrTAToad: Thanks for the suggestion but my project is very segmented into various files, segmented by required function and usually typed. The C code has to be inlined due to the way the code works but communication between C and GLBasic while trying to avoid complex type conversions was causing me no end of bother. There is a lot of C spread across this project, this is unavoidable but I am glad GLBasic has this C integration functionality, what a god-send it has already proven to be!

Thanks to all that helped me here! :)
#4
Thank you for your reply,

I tried to make a 2 file project, the 1st with this in it:

Code (glbasic) Select
LOCAL l%
INLINE
l%=xfoo;
ENDINLINE
DEBUG l%


The 2nd with this in it:

Code (glbasic) Select
INLINE
    int xfoo;
ENDINLINE

FUNCTION test%:
INLINE
   xfoo=27;
ENDINLINE
ENDFUNCTION


But I am now getting this error:
Code (glbasic) Select
C:\Users\Dad\AppData\Local\Temp\glbasic\gpc_temp0.cpp: In function `int __GLBASIC__::__MainGameSub_()':
C:\Users\Dad\AppData\Local\Temp\glbasic\gpc_temp0.cpp:58: error: `xfoo' was not declared in this scope

#5
Hi,

Is it possible to have a C variable, say int A;, that is accessable from various other inlined sections, in other files, spread throughout a multifile project?

I actually need it for a global like C struct that is only used in the C parts of the project code but can't get it to work, either scope errors or multiple definition errors.

Thanks in advance,

Bob