Author Topic: External IDE (Sublime Text Editor or another)  (Read 11234 times)

Offline ampos

  • Prof. Inline
  • *****
  • Posts: 1600
    • View Profile
    • AMpostata Website
Re: External IDE (Sublime Text Editor or another)
« Reply #15 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...
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

Offline Hark0

  • Prof. Inline
  • *****
  • Posts: 1020
  • Geek Developer
    • View Profile
    • LitioPixel - Desarrollo de videojuegos con GLBasic | Videogame development with GLBasic
Re: External IDE (Sublime Text Editor or another)
« Reply #16 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

Offline Hark0

  • Prof. Inline
  • *****
  • Posts: 1020
  • Geek Developer
    • View Profile
    • LitioPixel - Desarrollo de videojuegos con GLBasic | Videogame development with GLBasic
Re: External IDE (Sublime Text Editor or another)
« Reply #17 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

Offline Albert

  • Dr. Type
  • ****
  • Posts: 257
    • View Profile
    • Blog
Re: External IDE (Sublime Text Editor or another)
« Reply #18 on: 2012-Apr-21 »
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.
« Last Edit: 2012-Apr-21 by Albert »

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5070
  • O Rly?
    • View Profile
Re: External IDE (Sublime Text Editor or another)
« Reply #19 on: 2012-Apr-21 »
looking realy good right now :D
I like the style from that IDE!
I <3 DGArray's :D

PC:
AMD Ryzen 7 1700 @3.9GHz, 16GB HyperX Fury 3000MHz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

MrTAToad

  • Guest
Re: External IDE (Sublime Text Editor or another)
« Reply #20 on: 2012-Apr-22 »
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...
« Last Edit: 2012-Apr-22 by MrTAToad »

Offline Albert

  • Dr. Type
  • ****
  • Posts: 257
    • View Profile
    • Blog
Re: External IDE (Sublime Text Editor or another)
« Reply #21 on: 2012-Apr-22 »
Regexp? Then try \?

MrTAToad

  • Guest
Re: External IDE (Sublime Text Editor or another)
« Reply #22 on: 2012-Apr-22 »
No, it's regarded as an invalid escape code :)

Offline Enigma

  • Mc. Print
  • *
  • Posts: 24
    • View Profile
Re: External IDE (Sublime Text Editor or another)
« Reply #23 on: 2012-Jun-12 »
Is this still being worked on as I would really like to use Sublime Text 2 as my main editor?
Russ Hoy

Offline Albert

  • Dr. Type
  • ****
  • Posts: 257
    • View Profile
    • Blog
Re: External IDE (Sublime Text Editor or another)
« Reply #24 on: 2012-Jun-12 »
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
« Last Edit: 2012-Jun-12 by Albert »

Offline kanonet

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1142
    • View Profile
    • My GLBasic code archiv
Re: External IDE (Sublime Text Editor or another)
« Reply #25 on: 2012-Jun-12 »
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

Offline Albert

  • Dr. Type
  • ****
  • Posts: 257
    • View Profile
    • Blog
Re: External IDE (Sublime Text Editor or another)
« Reply #26 on: 2012-Jun-12 »
Sure, replace all the set to export, and change the target system to linux.

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 932
  • KodeSource
    • View Profile
    • KodeSource
Re: External IDE (Sublime Text Editor or another)
« Reply #27 on: 2012-Jun-12 »
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]

Offline FutureCow

  • HelpEditor
  • Prof. Inline
  • ******
  • Posts: 680
    • View Profile
Re: External IDE (Sublime Text Editor or another)
« Reply #28 on: 2012-Jun-13 »
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.

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3372
  • Integrated Brain
    • View Profile
Re: External IDE (Sublime Text Editor or another)
« Reply #29 on: 2012-Jun-13 »
This IDE it´s genial, will be very interesting have for GLBasic...