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.


Messages - dreamerman

Pages: 1 ... 20 21 [22] 23 24
316
Schranz0r:
As I assume after loading some project you can't edit it, due error, if you could provide little more info (how many files, is there any c++ inline) it would be helpfully..

Helmos:
1. Ide/code editor is totally written by me, in VB .Net and with use of Scintilla.Net.
Pre-GPC archive (little pb app that can be used it other editors like SublimeText), includes SumblimeText 'package' started by Albert here, I have edited that package to get it working with my pre-compiler, apparently I removed info about that from first post, since I focused on code editor. I will add it again...
2. Hm..  Yes, in my opinion GLB isn't best for making applications in desktop system meaning (e.g. ftp client), but it's great for games.
3. Currently this topic is about still unfinished application, so you have right, please move it to beta subforum, it would be more appropriate than 'code-snippets'...
4. Every one can have their own opinion  :)
Additional answer to 2 & 4: This project (code editor) started, because I felt that standard GLB IDE is insufficient for my needs, lacks some features that are crucial for me, and it was hard to manage bigger projects without them. I wanted to have at least few things that were very helpful in other ide's like VS, Qt Creator, and thats all about it, no hidden/bad intentions. I have some unfinished glb projects, and for them new code editor was first thing to make, after testing my projects, that were loaded, compiled without errors, and having some pm about that ide I decided to make more frequent updates on forum. I hope that no one feels offended  :|

Moru:
Thanks, I totally forgot about that, with next update app name will be changed.

317
I thought that info from first post will be sufficient.

But ok step-by-step:
1. Download and install .Net 2.0 Framework Redistributable / Client Pack, newer system have it built-in.
2. Compile any project with normal GLB IDE, and copy 'glblicence.inc' to app directory. This file is needed by glbasic compiler, but files from temp dir are always deleted, so we need to have it in some place and copy each time before compiling.
3. Run my IDE, goto 'tools->Options', type proper path to your GLBasic dir (to know where is the compiler, both stable and beta, they can be the same, for example: 'C:\Program Files (x86)\GLBasic_v12'), also specify company name, save cfg.
4. Load your project, edit, select win32 platform, compile. All should work now.
5. DEBUG command doesn't work (it just don't show info), to replace it use STDOUT with fix from first post.

If any error/problem occurs let me know. Most important, does hints, auto-complete work ok for your project...

318
Another update, again some fixes in auto-complete, hints, code tracking, full info in change-log file... Still no comments? :/

319
 :o Eh, yes, such error occurred after clicking on Scintilla object - but only if you didn't loaded existing project or created new one, just project info wasn't initialized, so loading/creating was working properly. Now it's ok, ide creates blank temp project. That was a little problem, other changes from last version:
- before loading sources ide copies them to backup directory,
- small fixes in: searching words for autocomplete, rename source file, 'create project' functions, updating user functions (both: itself and arguments), additionally empty line at end of source isn't added anymore,
Mostly changes in autocomplete and code change tracking.

320
No comments? :P
New version uploaded, most important changes from last ver:
- changes in function parsing variables (fixed type identification, other changes),
- function arguments are now treated as local variables (so are visible on autocomplete list),
- updates in 'code change tracking' functions (some new bugs, but they will be fixed with next update),

321
Little update, arrays parsing fixed, all word identification functions are using custom code now (so #$% are no longer problem, at least shouldn't be).
The priority is to add new functions for tracking changes in code.
btw. in first post I have attached gif that shows how autocomplete functions is working with types.  ;)

322
@up
In short, GLB isn't best language for making applications, you would need to made advanced edit control with many features similar to Scintilla, all ui stuff, and so on..

It tooked to long but I returned to this project some time ago and now you can see what is new in 3 public version of my IDE.
Compiling for win32 works ok, there are some issues with other platforms, but autocomplete, hints and all that stuff is working, give it a try ;]
To compile projects you need copy 'glblicence.inc' file from 'C:\Users\-X-\AppData\Local\Temp\glbasic' to ide application dir - standard glb ide generates that file before compiling.
Second thing, GLB doesn't close stdout stream after each line, so to get info from DEBUG function attach that source:

Code: (glbasic) [Select]
INLINE
        }
                extern "C" {
                        #include <cstdio>
                }
        namespace __GLBASIC__ {
ENDINLINE

TYPE test_type2
        some_var%
ENDTYPE

//fix glb stdout
FUNCTION stdout_fix:
        INLINE
                setbuf(stdout, NULL);
        ENDINLINE
ENDFUNCTION
and use 'stdout_fix()' function at start of your sources.

If there would be some problems with refreshing variables, functions, save current file or switch to edit another file in project and get back to previous file, that will parse first file again, and all missing stuff should be recognized.

Edit: current problems: arrays bug, does not recognize function arguments as local defined variables..

323
hm.. no replies? :p Unfortunately I didn't found other good cross language IDE that could be easily configured to use with GLB, and would have all needed features, so I decided to write my own editor for GLB. Based on ScintillaNet and written in VB .Net, most important to me is to have hint's for user typed functions and auto-completion for them. Still .Net version of Scintilla is old and doesn't have all newer features and bugfixes but it should be sufficient for what I plan to add in my editor.

You can download current version from first post, this is very limited release - just to show how hints and other stuff will work, I need to finish some things, then I will add compiling, and later other features.
Ah and remember it's not planned to be most beautiful IDE, just to have all features working.

324
Setup is really simple, only few steps, I have change first post a little so now it's clearly written how to setup app.
For SublimeText most of GLBasic functions are defined now, so auto-completion is more usefully. Still this editor isn't perfect, no function list and so on :/

I looked into CodeBlocks custom syntax highlighting and it's little complicated - need to write scintilla lexer and some additional things.
Is there any other good, free IDE with auto-completion, hints with easy configuration for custom languages? Or it would be better to write new IDE from scratch..

325
BR GLB IDE (may change)
This is my attempt to make code editor with features that standard IDE is missing.
Written in Visual Basic 2013 with .NET 4.5 and ScintillaNet 3.x, a source code editor for GLBasic. Free, full source code included (WIP project so beware of coding style).

Current version: 17.07.2020
Download link in attachments - so I can easily count them ;)

What does it look like?


Features
Feature list:
- custom lexer for code coloring, syntax highlighting (all GLB keywords and user typed),
- code folding (Subs, Functions, Types, //#region),
- colored margins to see what part of code were modified,
- colored background for tabs with source names (color depends on source modification counter),
- customisable styles, that can be easily shared,
- bookmarks, saved in separate file,
- auto-completion (see attached gif) for both GLB keywords (full list), and dynamically typed user functions, types and variables, (includes identification of global, local variables/functions),
- hints (function arguments, comments) for all standard GLB functions, and user typed functions,
- show function/type definition (press CTRL and click on word (if it's a function) to go to its definition, works also with types and normal variables),
- quite advanced types handing - identifies nested types, functions in types and all what comes with it,
- support for older GLB v12 up to newest Steam v16 compilers,
- each project is compiled/built in separate temporary directory, skipping unchanged files during compilation (similar to IncrediBuild),
- and more, ah and full source code included,
NOTE: Not all functions have their own menus, try using same keyboard shortcuts as in standard editor.


FUNCTION HINTS:

AUTO-COMPLETE:




Current issues:
- Current version of Scintilla doesn't use hard tabs (like most of modern text editors/ide), default soft tabs are 4 spaces width,
- Only basic project management,
- Not bullet-proof for errors,
- Compiling tested only for WIN32/64 platform, other platforms could be working,
- Find&Replace is binded to one Scintilla object (can't do multiple file search/replace without writing new component),
- DEBUG command doesn't work (it just don't show info), to replace it use STDOUT with this fix:
Code: (glbasic) [Select]
INLINE
}
extern "C" {
#include <cstdio>
}
namespace __GLBASIC__ {
ENDINLINE

FUNCTION stdout_fix:
INLINE
setbuf(stdout, NULL);
ENDINLINE
ENDFUNCTION
and use 'stdout_fix()' function at start of your sources, and STDOUT as equivalent of DEBUG.


Current TODO
Fix bugs.


What you need to get it work?
1. Download and install .Net 4.5 Framework Redistributable / Client Pack, newer system have it built-in.
2. Compile any project with normal GLB IDE, and copy 'glblicence.inc' ('C:\Users\-X-\AppData\Local\Temp\glbasic' or '%temp%\glbasic') to app directory. This file is needed by glbasic compiler, but files from temp dir are always deleted, so we need to have it in some place and copy each time before compiling.
3. Run my IDE, goto 'tools->Options', type proper path to your GLBasic dir (to know where is the compiler, for example: 'C:\Program Files (x86)\GLBasic_v15'), also specify company name, save cfg.
4. Load your project, edit, select win32 platform, compile. All should work now.


Legacy projects - no longer updated.
To keep this post clean download links will be separated from main editor attachment.

BR GLD IDE ver VB 2010
Previous version of my code editor, made with VB 2010, .Net 2.0 and ScintillaNET 2.x

Pre GPC - precompiler to use with your favorite IDE
Simply it's PureBasic project with command line interface, that can open and compile GLB projects, you just need to pass any legit source code as argument, and app will handle the rest. Thats why it can be used with external code editors like SublimeText (as they can't read GLB project themselves).
This archive includes SumblimeText 'package' started by Albert here

326
GLBasic - en / Re: Voxel - Visibility
« on: 2013-Oct-09 »
Very good piece of code :good: Really clear code, easy to read..
The biggest problem is that X_ object generation is so slow, but it's simpler to draw and quite fast.

Note that fps drawing function is wrong :p just change
Code: (glbasic) [Select]
fps = timer / frames to
Code: (glbasic) [Select]
fps = framesSo if you had 20fps earlier truely it was 50fps..

Even more it's working on Android, just add icon.png to folder and compile.. app needed more than 5 minutes to load :D but my chinese single core 1Ghz tablet with Mali400 on bigger map (-> voxelMap.Generate(128, 12, 128,  16, 12, 16)) has ~33fps, of course only small portion of cubes are visible.. Needed to comment lines that randomly delete chunks.

Some time ago I was also working on cube style engine, but mostly to see what rendering method would be faster, each have some pro and cons, and it would be great if you would add vertices and visible sides counting to your code. My project is a total mess, and when I will have some free time to rewrite it I will post it on forum.

327
Didn't read your post, and I already downloaded latest beta 11.556, and this z-order bug seems to be fixed  :good:

Next thing, I was checking what would be faster drawArrays or drawElements but still long way before this will be needed truely, but to get glDrawArrays working on Android and other OpenGL ES devices little change to wrapper is needed, as bigsofty mentioned:
Quote from: bigsofty
In OpenGL the"type" param for glDrawElements() can be GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, GL_UNSIGNED_INT but in OpenGLES it can only be GL_UNSIGNED_BYTE or GL_UNSIGNED_SHORT.
so glDrawElements for OpenGL ES should look like this:
Code: (glbasic) [Select]
FUNCTION glDrawElements: mode, count, typ, indices%[]
typ = GL_UNSIGNED_SHORT;
INLINE
GLushort* pi=new GLushort[(int)count];
for(int i=0; i<count; ++i) pi[i]=indices(i);
OGL glDrawElements(mode, count, typ, pi);
delete[] pi;
ENDINLINE
ENDFUNCTION
and it's working properly now :-)

328
GLBasic - en / Re: Problem with Polyvector
« on: 2013-Apr-08 »
Little to small image, but from these diagonal lines I would say that maybe texture coords are little wrong.. on the other hand always use 'SMOOTHSHADING FALSE' to eliminate artifacts which may arise from stretching and rotations..

329
@mentalthink:
X_Cullmode doesn't really help as rendering order is wrong... in that not rotating pyramid example it will mask the problem, but in more complex project that problem still will be visible, and with use of native OpenGL calls, passing additional array of normals isn't a solution - it will slow down rendering process.

@bigsofty:
This improved 'gl.bas' is same as that one included in beta so wont help. But I overlooked that detail about OpenGLES types, so for mobile devices glDrawElements should look like this:
Code: (glbasic) [Select]
FUNCTION glDrawElements: mode, count, typ, indices%[]
typ = GL_UNSIGNED_SHORT;
INLINE
GLushort* pi=new GLushort[(int)count];
for(int i=0; i<count; ++i) pi[i]=indices(i);
OGL glDrawElements(mode, count, typ, pi);
delete[] pi;
ENDINLINE
ENDFUNCTION
And this is working correctly :-)

Still remains first problem with rendering order, as I understand changing normals will not help, because even if all polygons are rendered (either back or front face) the further ones are drawed over those closer ones.

330
This problem applies to Android platform with latest 11.322 GLB version, on v10 (and Android) or Win32 (either v10 or v11) there is no such problem.
In simple words, some polygons that are further are rendered over the closer ones, as if the depth function was set wrong or some z buffer parameter was incorrect. This applies to X_Drawobj and inline glDrawArrays, I tried to use glDepthFunc(GL_LESS) and with GL_LEQUAL parameter but that doesn't help, so problem is probably in some init functions.

Example:
Code: (glbasic) [Select]
SYSTEMPOINTER FALSE
SETCURRENTDIR("Media") // seperate media and binaries?

// Create a Pyramid
 X_OBJSTART 5
 X_OBJADDVERTEX -50, 0, -50, 0,0,RGB(0,0,255)
 X_OBJADDVERTEX 50, 0, -50, 0,0,RGB(0,0,255)
 X_OBJADDVERTEX 0, 100, 0, 0,0,RGB(255,255,255) // Peak
 X_OBJADDVERTEX 50, 0, 50, 0,0,RGB(0,0,255)
 X_OBJADDVERTEX -50, 0, 50, 0,0,RGB(0,0,255)
 X_OBJNEWGROUP
 X_OBJADDVERTEX -50, 0, -50, 0,0,RGB(0,0,255)
 X_OBJADDVERTEX 0, 100, 0, 0,0,RGB(255,255,255)
 X_OBJADDVERTEX -50, 0, 50, 0,0,RGB(0,0,255)
 X_OBJEND

WHILE TRUE
 X_MAKE3D 1, 500, 45 // Viewport 3D
 X_CAMERA 150, 50, -200, 0, 30, 0
 //glDepthFunc(GL_LESS)
 X_DRAWOBJ 5, 0
SHOWSCREEN
WEND
END

SUB GLB_ON_LOOP:
ENDSUB

Another issue is glDrawElements, that doesn't work on Android, I have no idea why, no error with glGetError (returns 0), same code works on windows but not on my tablet :> Apart from that, there is an error in 'Samples\Common\gl.bas' file wrapping that function, currently it's:
Code: (glbasic) [Select]
FUNCTION glDrawElements: mode, count, typ, indices[]
typ = GL_INT;
INLINE
GLint* pi=new GLint[(int)count];
for(int i=0; i<count; ++i) pi[i]=indices(i);
OGL glDrawElements(mode, count, typ, pi);
delete[] pi;
ENDINLINE
ENDFUNCTION
But 'typ' => 'type' parameter for that function can only have values: GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, or GL_UNSIGNED_INT. So it should look like this:
Code: (glbasic) [Select]
FUNCTION glDrawElements: mode, count, typ, indices%[]
typ = GL_UNSIGNED_INT;
INLINE
//GLuint* pi=new GLuint[(unsigned int)count];
// for(unsigned int i=0; i<count; ++i) pi[i]=indices(i);
// OGL glDrawElements(mode, count, typ, pi);
// delete[] pi;
OGL glDrawElements(mode, count, typ, &indices(0));
ENDINLINE
ENDFUNCTION
And if 'indices' will be DGIntArray - % type as above there is no need to convert indices[] to GLuint, it's working without it.


polygons order attached image: left = v10, right = v11 - Android

Pages: 1 ... 20 21 [22] 23 24