External IDE (Sublime Text Editor or another)

Previous topic - Next topic

ampos

Perhaps we someone can make another editor to compile for windows (95% of the time), and when the proyect is "over" and we need different targets, switch to original GLB editor...
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Hark0

Quote from: Kitty Hello on 2012-Feb-14
that's a pretty nice idea. There's a project that can read the glbasic gbap xml files, already. So I think we should write an GLBasic project that can do this.

THANKS!!!!
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

Hark0

Quote from: ampos on 2012-Feb-14
Perhaps we someone can make another editor to compile for windows (95% of the time), and when the proyect is "over" and we need different targets, switch to original GLB editor...

Maybe writted by GLB?  :P
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

Albert

#18
I've found a PureBasic package for Sublime Text 2. I've modified to adapt for glBasic.



There is still a lot of work to do, but you get some basic autocompletion and I added some snippet (try 'func' and press tab, then fill out the fields pressing tab)

Download from here:
http://dl.dropbox.com/u/292449/glbasic/sublime/GLBasic.zip

You can follow this workflow:
* Open your project in glBasic and close all of the open files in it, only left 1 file open.
* Open the neccessery files in Sublime Text Editor (you also get cross-file auto completion)
* Edit and save all the files in Sublime Text 2.
* Compile and Debug in GLBasic

ps: I'd really like to see someone expand this plugin. There is still a lot of PureBasic stuff in here, and lot of GLBasic Constans and Keyword are missing.

Schranz0r

looking realy good right now :D
I like the style from that IDE!
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

MrTAToad

#20
Excellent - It would allow the editor to be used in Windows, Mac and more importantly Linux...

The scripting language used to deal with everything though is hideous though...  I'll see if I can at least get all the commands in the auto-completion list

Either code completion is a bit different, or something is dodgy, but I tried it with :

Code (glbasic) Select
{
"scope": "source.glbasic",

// GLBasic, GLBasic Functions
"completions":
[
{ "trigger": "?DEFINE","contents": "?DEFINE $(1:var) = $(2:value)"},
{ "trigger": "?ELSE", "contents": "?ELSE"},
{ "trigger": "?ENDIF","contents": "?ENDIF"},
{ "trigger": "?ERROR","contents": "?ERROR $(1:Text)"},
{ "trigger": "?IF","contents": "?IF $(1:var) = $(2:value)"}
]
}


And it either didn't find the correct code completion keyword or selecting a keyline (in the editor) just wipes out the text...  Nor could I get it to compile...

Albert


MrTAToad

No, it's regarded as an invalid escape code :)

Enigma

Is this still being worked on as I would really like to use Sublime Text 2 as my main editor?
Russ Hoy

Albert

#24
I'm managed to set-up a simple command line environment to compile glBasic stuff with gcc (only the gcc compile part, I skipped the preprocess).
What I wanted to achieve is: create the minimal .cpp and .h files which are necessary to succesfully compile and run a precompiled and stripped down GLBasic project.

If one add the precompile part then we can easily create a build system for Sublime Text 2.

So here it is what I did:

You can configure your project in config.bat, setting the glBasic path
Config.bat
Code (glbasic) Select

@set GLBASIC=%programfiles%\glbasic\
@set path=%path%;%GLBASIC%\compiler\platform\win32\bin
@set PROJECT_PATH=.
@set SOURCEFILES=*.cpp


You must copy your glblicence.inc file to the project folder from c:\Users\username\AppData\Local\Temp\glbasic\

Then you can compile your project with compile.bat and link with link.bat

The main program in the test.cpp, which is a stripped down gpc_temp0.cpp
Code (glbasic) Select
#include "gpc_temp.h"
void __GQuitNProfile()
{
   __PPExportProf("profile.csv", __DATE__, __TIME__);
}

namespace __GLBASIC__{
void __glb_init_globals();
int __MainGameSub_(void)
{   __PPRegisterFunction
    __glb_init_globals();

PRINT( CGStr("STUFF"), 1, 1, true);
SHOWSCREEN();
MOUSEWAIT();

END();
return 0;
} // end main
// ------------------------ //
DGInt __end_main__foo__()
{
   __PPRegisterFunction
return 0;
}
void __GLB_Defaults(){
__DG_RESX=640;
__DG_RESY=480;
__DG_FULLSCREEN=0;
__DG_MULTISAMPLE=0;
__DG_FRAMERATE=40;
__DG_DEBUG=1;
__DG_WANTMOUSE=GLB_WANTMOUSE_AT_START;
__DG_SCHOOLVER=0;
__glb_AppName()= "test";
}

#include "glblicence.inc"
} // namespace


Download: https://dl.dropbox.com/u/292449/glbasic/sublime/GLBasic_gcc_compiler_scripts.zip

kanonet

Maybe im wrong, but this shouldnt be necessary, cuz you can call the GLB (pre-)compile with a few parameters and it will do the work for you. So at least under Windows it should be easy to use an other IDE.
Does your solution work under Linux too?
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

Albert

Sure, replace all the set to export, and change the target system to linux.

Slydog

This is from the help file, not sure if it's of any help:
(under the 'Contents' tab, 'GLBasic interm' node, then 'GPC-GLBasic Precompiler')

GPC-GLBasic Precompiler
The heart of the GLBasic development environment is the GPC precompiler. It takes a list of .gbas files and converts them to .cpp files that you can compile with a g++ (gcc) C++ compiler to machine code. Since version 8 the GPC is freely accessible and thus can be used from a 3rd party IDE, which is not recommended since the GLBasic IDE offers a lot of GLBasic specific aid.
The following syntax is used when calling the GPC:

GPC.exe
-N"Project Name" (for names with spaces, directly connect the quotes to the parameter)
-O"Output prefix (with path)"
-P"Project path" (without trailing "\")
-D - Debug version
-F - Fullscreen
-X640 - Width
-Y480 - Height
-R60 - Frame rate
-M0 - Multisample factor
-EXPLICIT - Explicit declarations
-pNAME=value - Preprocessor definitions (e.g. -pGLB_CONSOLE=1 -pWIN32=1 -pGLB_VERSION=8.01)
-L - License info bits 0=2D, 1=3D, 2=NET (only relevant for warnings)
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

FutureCow

I'm not sure how the debug version would work - I can't see how you could introduce breakpoints and do a debug run of your code through an external IDE.

mentalthink

This IDE it´s genial, will be very interesting have for GLBasic...