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] 2 3 ... 19
1
Announcements / Re: Turtle for Android
« on: 2019-Jun-22 »
Now it's normally visible and I can install it. Didn't encounter any issues. You can add two things (that may be not compatible with LOGO commands): drawing width - for example PD x (x is width), and command to fill region with selected color.

2
If someone is looking for good programing resources there is also this Programming Notes for Professionals books
Not sure if this was already posted here on forum. So many books, only one question - when to read all of them? :D

3
GLBasic temporary directory used for compiling:
Code: GLBasic [Select]
%Temp%\glbasic

Another thing that You can try, is to get some info by running GLB precompiler (that translates code to c++) from command line. For example this is whole command used to compile basic project with 2 sources using latest GLBasic version:
Code: GLBasic [Select]
gpc.exe -pWIN32=1 -pGLB_VERSION=16.026 -N"ArtDemo" -X640 -Y480 -M0 -R60 -O"C:\Users\Me\AppData\Local\Temp\glbasic\gpc_temp" -L3 -EXPLICIT -P"D:\inne\glb_projekty_net\ArtDemo" -V"000.001" D:\inne\glb_projekty_net\ArtDemo\ArtDemo.gbas D:\inne\glb_projekty_net\ArtDemo\gl.gbas
Change it to reflect Your user name, proper directories/sources and see what result it gives, run it from cmd, or use with bat file (add ' >> output.txt' at the end - without ').
Yet I'm not sure if this will give any additional information, how 'old' is that old project?

4
Bug Reports / Re: Profiler broken?
« on: 2019-May-24 »
I saw gprof2dot and tried it, little messing around with all that python, PATH setting stuff but it worked. Checked it on simple demo and produced image graph isn't something spectacular, at least it shows some connections between functions, but not all :/
There are some active profilers like tracy with more features but they require including additional functions/source in project, this particular profiler should be compatible with GCC & OpenGL.

5
GLBasic - en / Re: Fullscreen fix
« on: 2019-May-23 »
So You are rather looking for something like PRESCALER command? To get Your game scaled properly to all resolutions that user can choose.
There was also one system for that made by spacefractal
Or I'm getting something wrong - it's late :D

6
GLBasic - en / Re: Fullscreen fix
« on: 2019-May-23 »
hm.. on what OS You have problems with SetScreen? Did You tried using SetScreen on basic project just ot test if some graphic functions like 3d is causing problems?
Personally I didn't encounter problems with SetScreen apart one - default res 720p game on some user laptop (WXGA display) - game window was wrongly positioned - wasn't centered (so he wasn't able to see bottom of it), but that can be bypassed by manual change in app cfg file.

7
Bug Reports / Re: Profiler broken?
« on: 2019-May-23 »
Just tried and -pg is working ok (tested on small project), comment strip command, add '-pg' in project options in cmp & link, compile your app normally (no profiler).
Run your app for some time, so You will have something to measure, end/exit it, now it should create 'gmon.out' file, create .bat file or launch cmd, assuming that You will launch gprof.exe from app directory command should like this:
"GLBasic_SDK\Compiler\platform\Win32\bin\gprof.exe" youapp.exe gmon.out > profiler.txt
And here you have it. Only thing that those result's are basic and maybe could be better with other profiler/debugger - I will need to check some of them as nice graphs and better info/details would be handy :)

ps. I've checked some other profilers but all have some problems, either are vendor specific (AMD, Nvidia, Intel) or work only with VS projects (need *pdb file) and so on.. Basic gprof output may be sufficient, but I would like to compare it to GLB profiler (yet still can get it work even with previous versions hm..).

8
Bug Reports / Re: Profiler broken?
« on: 2019-May-22 »
That command is surely added by GLB Editor during compilation, so rather no way to fix this in that way. One workaround is to compile from cmd, You can grab whole compilation/link command passed to gcc using this
Start compile in GLB with profiler, switch to ProcessExplorer when GLB comes to 'link' part, hit space (on ProcessExplorer - pause refreshing) search for g++ entry and copy whole cmd, fix that wrongly placed ' ', save that to .bat file. Use it after GLB 'compile' stage to get your app (it would be something like output.obj in %TEMP%\glbasic folder).

On other hand just checked GLB v15 and I have some issues with profiler.. Didn't use it from a long time, yet I remember that it worked, now it produces empty csv file, maybe I'm doing something wrong...

ps. to avoid symbols stripping just comment (';') one line in proper platform.ini file:
Code: GLBasic [Select]
strip="%GLBASIC%Compiler\platform\Win32\bin\strip.exe" --strip-all

9
Bug Reports / Re: Profiler broken?
« on: 2019-May-21 »
Yes it's an error, surely with passing arguments to GCC (g++.exe) during link stage, GLB just doesn't add space before '-lGLBProfiler' command. Checked and 'GLBProfiler' library is in proper directory directory. File: 'resource.o' is from what I remember icon file, as now it's linked/added to project in different way than in previous GLB versions.
But another thing should be fixed too (also easy-to-fix), 'resource.rc' that's VERSIONINFO file, it contains little bug;
BLOCK "StringFileInfo" and BLOCK "VarFileInfo" should contain translation in same language code, now GLB sets StringFileInfo to '0809' code - UK English, but VarFileInfo has only translation for '0x409' - US English, this way file doesn't show proper description (author, copyright, version) in file-properties-details in system.
Just set both block's to same language, best US English so it would be:
Code: GLBasic [Select]
BLOCK "040904E4"
[...]
VALUE "Translation", 0x409, 1252
 
Info about VERSIONINFO resource file

10
It doesn't matter what programming language was used to make dll file, only what matters it that it should export functions with 'stdcall' calling convention, also 'cdecl' is supported without problems. (info about calling conventions: https://en.wikipedia.org/wiki/X86_calling_conventions) You can use DECLARE keyword to make direct use of dll functions in your code: http://www.glbasic.com/xmlhelp.php?lang=en&id=191&action=view
If you encounter problem with some specific dll and function just ask. GLB code is translated to c++, then compiled (so it doesn't have limitations present on other such tools), you can write direct c++ code to make use of some specific things not available directly on GLB itself ;)

11
Competitions / Re: GLBasic Contest 02: 2D Art
« on: 2019-May-16 »
@WPShadow - for me sounds ok.

@Snoopy - true console mode sounded original, we can have this earlier or later and another contest with limitations for only SetPixel.
For moment I was thinking that we are limited to standard console colors but:

main file
Code: GLBasic [Select]
// project -> options -> console program
LOCAL i1%, i2%
FOR i2 = 0 TO 15
        FOR i1 = 0 TO 15
                ConsoleSetColor(i1, i2)
                STDOUT "test"
        NEXT
        STDOUT "\n"
NEXT
KEYWAIT
second file
Code: GLBasic [Select]
IMPORT "C" int __stdcall GetStdHandle(int nStdHandle)
IMPORT "C" int __stdcall SetConsoleTextAttribute(int hConsoleOutput, int wAttributes)

FUNCTION ConsoleSetColor: fg_color%, bg_color%
        LOCAL console_handle% = GetStdHandle(-11)
        SetConsoleTextAttribute(console_handle, bg_color% * 16 + fg_color%)
ENDFUNCTION

only question is how fast console window can be refreshed, and some functions to print at selected X,Y position would be also usefully.
Another thing is that you need to have idea for demo that would fit into console/text mode nicely, this may be an issue for me hehe... :D

12
Off Topic / Re: Shaders
« on: 2019-May-15 »
Was it this topic? I think that there was also another one, but maybe not started by You, it had shaders included as sources not as attachments (that are now unavailable). Still this topic also gives some important info :)

13
Off Topic / Re: Shaders
« on: 2019-May-15 »
Already available shaders can be some base if you need basic/simple effects, only issue is that they are scattered on different forum threads.
Helmos I saw that topic some time ago but forgot to mark it, and now I can't find it :D

14
Imho if You want to delete elements by index/id in basic type array (int, float, string) and want to preserve elements position do something like this:

Code: GLBasic [Select]
// compile in Debug mode

GLOBAL myarray%[], elems2del%[], i1%, i2%, txt$
DIM myarray%[0]
DIM elems2del%[0]

SEEDRND 1
txt$ = ""
FOR i1 = 0 TO 20
        i2 = RND(100)
        DIMPUSH myarray[], i2
        INC txt$, i2 + ", "
NEXT
txt$ = LEFT$(txt$, LEN(txt$) - 2)

DEBUG txt$ + "\n"


DIMDATA elems2del[], 7, 14, 9   // or use DimPush
SORTARRAY elems2del[], 0        // ascending order

FOR i1 = LEN(elems2del[]) - 1 TO 0 STEP -1
        DIMDEL myarray[], elems2del[i1]
NEXT


txt$ = ""
FOR i1 = 0 TO LEN(myarray[]) - 1
        INC txt$, myarray[i1] + ", "
NEXT
txt$ = LEFT$(txt$, LEN(txt$) - 2)

DEBUG txt$ + "\n"


END

For dealing with UDT's I use 'toDelete%' flag, or approach similar to this, separate array with indexes to delete - depending on game logic, and if I don't need to preserve elements order just do elem[del_id] = elem[len[elem]-1], dec elem_count -> as this should be faster than multiple dimdel/push on large arrays.

15
GLBasic - en / Re: Inline C++
« on: 2019-May-10 »
What GLB version You are using? On v16 include files are in different path that in v15 (that I posted previously). Maybe some system environment variable was wrongly set, did You tried different GLB versions or reinstalling GLB?

in GLB v15:
cstdio -> 4.26KB
stdio.h ->14.7KB

Pages: [1] 2 3 ... 19