Hello, people.

Previous topic - Next topic

Kitty Hello

If you talk about the compile times, there's no way to speed that up. I did my best already. Get a faster PC, maybe?

com_1

Very sorry.

You have done so much, but "compiler times" spoiled it all.

Slydog

Compile times are only an issue the 1st time you compile after starting GLBasic. 
Then after that, only the files that you have changed require recompiling.
If your project is fairly large, and is still only in one file, break it into multiple smaller files, each with a common theme, like graphics routines, level routines, sound, input, etc.

My project is getting fairly large (over 4400 commands as reported by the compiler) but I have it spread over 15 files. 
My initial compile time may be around 40 seconds, but after that it is under 15 seconds.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

bigsofty

Yes, split your source into as many separate files, incredibuild only compiles the files that have been changed. Also, debug mode compiling is at least 50% slower, turn it off unless it's need.
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Moru

When I compile GLBasic recompiles everything now and then, even if I didn't change anything. Haven't found any pattern yet but haven't been looking for a while. I always run with debugging on so it's not that either :-)

Slydog

I find that also, but rarely.

I took me a bit to realize it also fully compiles whenever you change / add a global variable anywhere, or modify / add a TYPE, or modify / change a CONSTANT anywhere.  This makes sense I guess because the change can affect all code.

But, what I still find is happening is that if I change a file, Incredibuild thinks that file hasn't changed.  It happens repeatedly with certain files, and never with others.  I have to hit the Debug button twice to force a full compile.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

MrTAToad

Odd - I've not had it happen since V8...

com_1

I'm sorry for interrupting "MrTAToad", but i have a question.

People who have the latest version "GLBasic".
As there is with the video command ? (you can play the video during the game or not ?)

I have "GLBasic 6.111", and there can only reproduce(playing) video file.
Everything (game) else is automatically stopped.

Why I do not use the new "GLBasic" version ?

Everything is very simple.
Everything works great without a "global", "local" or "static" commands in "GLBasic  6.111"

Ian Price

TBH, you are losing a lot by not having the latest update of GLB - there are so many new additions and bug fixes over the 6.XX versions. There aren't however any additions to the movie playing side of things (IIRC), so you probably still won't be able to play a game over a movie backdrop (not that I've tried - I had success implementing a movie, but it wouldn't play on another machine due to a lack of codec, so this is iffy from the offset).

There is no logical reason to be so far behind with the updates/upgrades. It's just as stable now as it ever was, but now offers more features. The end .EXE isn't significantly enlarged as a result either.
I came. I saw. I played.

MrTAToad

QuoteAs there is with the video command ? (you can play the video during the game or not ?)
Only for WIndows unfortunately

com_1

Today (i will) downloaded and installed the last version.
Tomorrow will look at the "video" command.

Thanks for comments, people.

Gernot, why did you use commands "global, local" required ?

Moebius

Although you generally shouldn't do this, it isn't REQUIRED that you use globals and locals...
If you really think you're better off without them, just go into Project->Options, untick 'Explicit Declarations' on the bottom left, and anything you don't define with a LOCAL will automatically be a global variable.  This also means that you won't exactly be conserving memory (or maximising speed from what I've heard about globals vs. locals), but you CAN get away with not using the LOCAL and GLOBAL commands...
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

Moru

The reason why I want forced declarations is that typos in variable names will stop your compile and give you errors. Typo in a variable can give you hours of debugging later especially for those bigger projects where the error is not totally clear right away.

Also, if you don't force declarations local, they become global outside functions automaticly and this might not be what you intended all the time.

Kitty Hello

global, local -> Project Options/Explicit declarations

com_1

Anyone can help me ?

Trying to build(create) a primitive "paint".
But it is necessary to know "C++" commands.

All that I managed to gather(create) with relatives of commands can be seen below.

Code (glbasic) Select

// Attention. No Global or Local
// Move your mouse and press left or right mouse button

// screen options
scrx = (320 * 2); scry = (240 * 2); SETSCREEN scrx, scry, 0;

// mouse options
SYSTEMPOINTER TRUE;


//______________________________________________________________________________________________
WHILE TRUE

// background
DRAWRECT 0, 0, scrx - 0, scry - 0, RGB(10, 20, 30);

// mouse
MOUSESTATE mx, my, mbl, mbr;

pencil();

SHOWSCREEN; WEND
//______________________________________________________________________________________________


//______________________________________________________________________________________________
FUNCTION pencil:

IF pe_dost = 0; pe_dost = 1;// dostup >

// dim
pe_max1 = 25; pe_max2 = 361;
DIM pe_x1[pe_max1][pe_max2]; DIM pe_y1[pe_max1][pe_max2]; DIM pe_r1[pe_max1][pe_max2]; DIM pe_x2[pe_max1][pe_max2]; DIM pe_y2[pe_max1][pe_max2]; DIM pe_r2[pe_max1][pe_max2]; DIM pe_col[pe_max1][pe_max2];

// options
a_max = 1; pe_im$ = "no";

FOR d1 = 0 TO pe_max1 - 1;// for >
FOR d2 = 0 TO pe_max2 - 1;// for >
// radius
pe_r1[d1][d2] = 1 + (d1 * 1);
pe_r2[d1][d2] = 1 + (d1 * 1);
// color
pe_col[d1][d2] = 10;
NEXT;// for <
NEXT;// for <

ENDIF;// dostup <


// press mouse - mbl
IF     mbl = 1 OR mbr = 1;
// start pos.
IF pe_sl = 0; pe_sl = 1; pe_xx1 = mx; pe_yy1 = my; pe_xx2 = mx; pe_yy2 = my;ENDIF;
// new pos.
pe_xx2 = pe_xx1; pe_yy2 = pe_yy1; pe_xx1 = mx; pe_yy1 = my;
ELSEIF mbl = 0 AND mbr = 0;
// new pos.
pe_sl = 0; pe_xx2 = -1000; pe_yy2 = -1000; pe_xx1 = -1000; pe_yy1 = -1000;
ENDIF;

// pos.
FOR d1 = 0 TO pe_max1 - 1;// for >
FOR d2 = 0 TO pe_max2 - 1;// for >
// pos. 1
pe_x1[d1][d2] = pe_xx1 + (pe_r1[d1][d2] * SIN(d2 * 1));
pe_y1[d1][d2] = pe_yy1 - (pe_r1[d1][d2] * COS(d2 * 1));
// pos. 2
pe_x2[d1][d2] = pe_xx2 + (pe_r2[d1][d2] * SIN(d2 * 1));
pe_y2[d1][d2] = pe_yy2 - (pe_r2[d1][d2] * COS(d2 * 1));
NEXT;// for <
NEXT;// for <

// sprite
IF pe_im$ = "yes"; DRAWSPRITE 1, 0, 0;ENDIF;

// image
IF     mbl = 1 AND mbr = 0;
ALPHAMODE (a_max / 10);
FOR d1 = 0 TO pe_max1 - 1;// for >
FOR d2 = 0 TO pe_max2 - 1;// for >
// image - white
DRAWLINE pe_x1[d1][d2], pe_y1[d1][d2], pe_x2[d1][d2], pe_y2[d1][d2], RGB((pe_col[d1][d2] * 1), (pe_col[d1][d2] * 1), (pe_col[d1][d2] * 1));
NEXT;// for <
NEXT;// for <
ALPHAMODE 0;
ELSEIF mbr = 1 AND mbl = 0;
FOR d1 = 0 TO pe_max1 - 1;// for >
FOR d2 = 0 TO pe_max2 - 1;// for >
// image - black (delete)
DRAWLINE pe_x1[d1][d2], pe_y1[d1][d2], pe_x2[d1][d2], pe_y2[d1][d2], RGB(10, 20, 30);
NEXT;// for <
NEXT;// for <
ENDIF;

// sprite
IF mbl = 1 OR mbr = 1; GRABSPRITE 1, 0, 0, (scrx / 1), (scry / 1); pe_im$ = "yes";ENDIF;

ENDFUNCTION