Menu

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.

Show posts Menu

Topics - Hemlos

#1
This is for win32 only.
You can control most of the aspects of a windows message box with these defined flags.
I included the return code definitions too.  :rtfm:

Notes:
A) The help button doesn't return anything in GLBasic.
B) You can use your own icon, however, i'm not sure how to define it.

Code (glbasic) Select
// --------------------------------- //
// Project: MessageBoxA function (winuser.h) - win32
// Start: Wednesday, June 14, 2023
// IDE Version: 15.238
// Coded by: Neil Silver AKA Hemlos
//
// ----------------------
//
// Resource:
// https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-messageboxa
//
//  Displays a modal dialog box that contains a system icon,
//  a set of buttons, and a brief application-specific message,
//  such as status or error information.
//  The message box returns an integer value that indicates which button the user clicked.
//
// ----------------------
//
// Note:
// There is an L (long) appended at the end of each code constant on this webpage.
// Omitting L gets it working in GLBasic. :D
//
// ----------------------
//
// Note:
// On the webpage example, you will notice the '|' indicator between the flag codes.
// This is a concatenation in C++
// In GLBasic use '+' to concatenate the flags, see example below.
//
// ----------------------
//
// Note:
// The dialog can disappear behind the main program window if you do not specify modality.
// All modalities require the dialog be responded to in order for the program to continue.
// Append MB_TASKMODAL or MB_SYSTEMMODAL or MB_TOPMOST to the flags to prevent this dialog from losing focus.
//
// ----------------------
//
// Example:
//
//    LOCAL Title$ = "Test Title"
//    LOCAL Body$  = "Test Body"
//    LOCAL Flags% = MB_ICONEXCLAMATION + MB_CANCELTRYCONTINUE + MB_DEFBUTTON2 + MB_TASKMODAL
//    LOCAL MessageOutput% = MessageBoxA(0, Body$, Title$, Flags )
//
//    SELECT MessageOutput%
//        CASE IDABORT; // Add code
//        CASE IDCANCEL;; // Add code
//        CASE IDCONTINUE;; // Add code
//        CASE IDIGNORE;; // Add code
//        CASE IDNO;; // Add code
//        CASE IDOK;; // Add code
//        CASE IDRETRY;; // Add code
//        CASE IDTRYAGAIN;; // Add code
//        CASE IDABORT;; // Add code
//        DEFAULT; // 0 = IDFAILED
//    ENDSELECT

    // ====================================================== //
    // MessageBoxA function (winuser.h) - win32
    IMPORT "C" int __stdcall MessageBoxA(int hwnd, const char* text, char* caption, int flags );
   
    // To indicate the buttons displayed in the message box, specify one of the following values.
    CONSTANT MB_ABORTRETRYIGNORE     = 0x00000002
    CONSTANT MB_CANCELTRYCONTINUE    = 0x00000006
    CONSTANT MB_HELP                 = 0x00004000 // This button doesn't seem to work in GLBasic, it shows, yet no return.
    CONSTANT MB_OK                   = 0x00000000
    CONSTANT MB_OKCANCEL             = 0x00000001
    CONSTANT MB_RETRYCANCEL          = 0x00000005
    CONSTANT MB_YESNO                = 0x00000004
    CONSTANT MB_YESNOCANCEL          = 0x00000003

    // To display an icon in the message box, specify one of the following values.
    CONSTANT MB_ICONEXCLAMATION      = 0x00000030 //  /!\
    CONSTANT MB_ICONINFORMATION      = 0x00000040 //  (i)
    CONSTANT MB_ICONQUESTION         = 0x00000020 //  (?)
    CONSTANT MB_ICONSTOP             = 0x00000010 //  (X)
    CONSTANT MB_USERICON             = 0x00000080 // user icon, unused
   
    // To indicate the default button, specify one of the following values.
    CONSTANT MB_DEFBUTTON1           = 0x00000000
    CONSTANT MB_DEFBUTTON2           = 0x00000100
    CONSTANT MB_DEFBUTTON3           = 0x00000200
    CONSTANT MB_DEFBUTTON4           = 0x00000300
   
    // To indicate the modality of the dialog box, specify one of the following values.
    CONSTANT MB_APPLMODAL            = 0x00000000
    CONSTANT MB_SYSTEMMODAL          = 0x00001000
    CONSTANT MB_TASKMODAL            = 0x00002000
   
    // To specify other options, use one or more of the following values.
    CONSTANT MB_DEFAULT_DESKTOP_ONLY = 0x00020000
    CONSTANT MB_RIGHT                = 0x00080000
    CONSTANT MB_RTLREADING           = 0x00100000
    CONSTANT MB_SETFOREGROUND        = 0x00010000
    CONSTANT MB_TOPMOST              = 0x00040000

    //Return:
    CONSTANT IDFAILED   = 0    // Function Failed
    CONSTANT IDABORT    = 3    // The Abort button was selected.
    CONSTANT IDCANCEL   = 2    // The Cancel button was selected.
    CONSTANT IDCONTINUE = 11   // The CONTINUE button was selected.
    CONSTANT IDIGNORE   = 5    // The Ignore button was selected.
    CONSTANT IDNO       = 7    // The No button was selected.
    CONSTANT IDOK       = 1    // The OK button was selected.
    CONSTANT IDRETRY    = 4    // The Retry button was selected.
    CONSTANT IDTRYAGAIN = 10   // The TRY Again button was selected.
    CONSTANT IDYES      = 6    // The YES button was selected..
    CONSTANT IDHELP     = 9    // Help Button pushed. Not GLBasic. \o/

#2
Bug Reports / X_PRINT
2023-May-21
QuoteX_PRINT text#$, x#, y#, z#, scale#, kerning%=FALSE

"Gravity2023.gbas"(754) error : GPC0006 wrong number of aguments : "X_PRINT" called with 6 args. Required: 5 to 5
#3
Galactic Formation Simulator 2021, inspired by Sir Isaac Newton.
Version 2.10418a (April 18,2021)

This is the entire library. Just compile and run, Enjoy!

If you have questions, ill answer them here.
I do not plan on doing many updates, yet, i will do one once in a while.
Feel free to use the SVS library and Galactic Formation Simulator application in any way you see fit.
- Neil



--------------------------------
Screenshots:

No star in this one, just matter in a circular field crashing and starting a planet / moon system.
https://siasky.net/fANKk3t6ag14HbuBE1ufPwILQnXfm3O_ZGPVa4T5KOubow

This shot shows gravitational fields from the largest objects, and has vector direction.
https://siasky.net/fAJpyrh8ulsa9nFUCguPWXLmu_KEx0LatZGwg0daIrD-PQ

This shot shows the gravity fields of the ring simulation:
https://siasky.net/_AxFaA4W0WQvHdwyh9yAQisewq_Lg-As9HTshDtieI1rjw
Note: the lines represent only nearby actors, all objects affect all other objects motion, especially the star.

The 2 arm simulation, with gravity fields:
https://siasky.net/fAMzZPelCERvZokYgSHjMxpv_DNUU6tvc3tH6r98ElUNEg

This is a saturn-like ring formation simulation, it ends with a handful of stable planets possibly with moons:
https://siasky.net/fAR3iWQLQILwPZJjVG7aCdpzlw1YPWSXLQtDO2qpmqVMmg

--------------------------------
DOWNLOADS:

Download from Google Drive :
https://drive.google.com/file/d/1tTTwZmQuEcUuln2PLTPhuUmHH3xQtY4I/view?usp=sharing

Download from SIA Skynet :
https://siasky.net/AAB8DBMu1cNgXAii3u9GUOMOPyuGh8wkcp7YOHWkZv7T4g

#4
GLBasic has had a server change in the past.
Resulting from the server switch, many attachments across the forums are dead linked.
Most of the dead attachments are still relevant, as most are working samples, algorithms, and/or libraries.

Speaking for myself here, I will update any attachments that are dead links.
I will try to update all of them as I come across them, and as they're reported dead.

If you come across dead links, please report them within the thread that they are found, for these forum threads are linked to the creators emails.
#5
I built a theatre setup for my pc    :enc:

Has anyone considered a sound interface for atmos in GLB?  >:D
#7
Beta Tests / 3d Space Sim
2019-Feb-14
its kinda fun, i find myself spending hours every night playing with profiles, formations.
Fact: Most solar systems have a jupiter-like planet circling near the star.
In this sim, you can actually see this sort of thing form, and you can see why it happens (if you watch)
Watching, waiting, thats what this sim is about, theres not much to do except to start the planets and watch them whirl merge and form orbits.
#9
To prevent cam shake in 3d:

Cause Number #1: Camera Point-to Resolution
You want the resolution of the camera rotation to be very fine factors.
The Point-to magnitude, the point-to length must be high, like 100 or more.
If magnitude of pointto is small, like value of 1.0, the entire scene in the area will "shake" when the camera moves.

Cause Number #2: Skybox Sphere/Box Radius
For the same reason point-to res causes camera shaking, a background skybox sphere needs to be wider than 1.0
eg. The skybox position should follow your camera, and should be wide radius (although 1000.0 works, i use 1 million)
to be smooth moving to match the fine changes of movement of the camera.
Tip: A box as opposed to a sphere renders better, yet, it will need to be wide radius as well.

--------------------------------
Note about Z-Fighting:
Camera shaking is not the same thing as Z-Fighting, where textures overlap on identical xyz positions.
Some Z-Fighting can be caused by special effects, which are too far to render 100%
Z-Fighting also happens to spheres, with strange texture coordinates on the ends/sides of texture mapping, typical of a sphere.
--------------------------------

That said....you can create ENORMOUS 3d worlds!
I've been working on a 3d space/gravity program, and it is HUGE, no cam shaking even with the cam at extremely far distances (like 300k or more)
edit: I have created a smooth rendering 3d simulation, millions of 3d positions wide, and growing!
#10
MOUSEAXIS(0,1,2) fails after frame rate exceeds LIMITFPS
im using windows 7 and GLBasic IDE, Version: 14 & 15



#11
This Vector lib can be used for 2d or 3d.
The vector is treated as an object, hence OOP style.
It transforms, or analises the vectors as an object.
All known, fundamental, vector functions should be found in this lib, if there is something missing please let me know.
This lib is very stable and tested using Sir Isaac Newton's law of universal gravitation. (in my yet to be revealed game) =D

Notes about normalizing:
A. ||V|| = 1 (it should anyway, if not let me know how!)
B. Can be used to set the absolute length. eg. instead of using a second SCALAR. saves some CPU steps!


VEC3:

Code (glbasic) Select
// --------------------------------- //
// Project: Vector Object - OOP
// Start: Saturday, August 29, 2015
// Created By: Neil M. Silver
// Code based on the works done by BigSofty and Jestermon.
//
// ======================================================================================== //
// Vector Object - OOP
//
// This is a Vector Library, true OOP style.
// The Vector object can be analised, or transformed with vector math functions.
//
// Note:
// Declare your vectors ahead of time AS VEC3.
// Your main vector is the main object(VecA), and you pass in secondary vectors(VecB) as inputs.
// VecB as an input is always the OTHER secondary vector being analised.
// CrossProduct function outputs VectorOutput AS Vec3 as the output, to preserve the first vector.
//
// LOCAL My3dVector AS VEC3
// My3dVector._INIT_(1.0,1.0,1.0) //not a normalized vector.
// My3dVector._NORMALIZE()  //My3dVector length is now normalized to 1 which preserves its original direction, eg ||V|| = 1
// My3dVector._SCALE(2.0) // vector is now length = 2, in its original direction.
//
// LOCAL My3dVector2 AS VEC3
// My3dVector2._INIT_(3.0,-1.0,-2.0) //not a normalized vector.
// LOCAL MyProductOutputVector AS VEC3 // no need to init this one...itll be used for the product results.
// My3dVector._CROSSPRODUCT(My3dVector2, MyProductOutputVector ) //MyProductOutputVector contains the results of this function byref.
//
TYPE VEC3 // 3 dimensional Vector Object

//VecA
vX#
vY#
vZ#

// Initialise Your Vector Object Here.
FUNCTION _INIT_: vX#, vY#, vZ# // LIB VEC3 - Vector Object Input
self.vX# = vX#
self.vY# = vY#
self.vZ# = vZ#
ENDFUNCTION


// Information Analysis function sets:


// DOT Product
// Note, Computers arent reliable calcultating DOT
// IF value is < 0.01 THEN it is really 0!
// I tested many different values in a vector calculator to find this tolerance number.
// That said, this DOT function works really well.
FUNCTION _DOT#: VecB AS VEC3 // LIB VEC3 - Vector DOT Product
LOCAL DOT# = ( (self.vX*VecB.vX) + (self.vY*VecB.vY) + (self.vZ*VecB.vZ) )
IF DOT < 0.01 THEN DOT = 0
RETURN DOT
ENDFUNCTION



// Magnitude
FUNCTION _MAG#: // LIB VEC3 - Vector Magnitude
RETURN SQR( (self.vX*self.vX) + (self.vY*self.vY) + (self.vZ*self.vZ) )
ENDFUNCTION



// Cross Product
// Returns VecOutput with a vector cross product as its value.
FUNCTION _CROSS: VecB AS VEC3, VecOutput AS VEC3 // LIB VEC3 - Cross Product - VecOutput is the output.
    VecOutput.vX = (self.vY * VecB.vZ) - (self.vZ * VecB.vY)
    VecOutput.vY = (self.vZ * VecB.vX) - (self.vX * VecB.vZ)
    VecOutput.vZ = (self.vX * VecB.vY) - (self.vY * VecB.vX)
ENDFUNCTION



// Vector Math Section, These Mutate/Transform/Affect your Vector Object:

// Normalize, Vector Length = 1 (eg. ||V|| = 1)
// You can change the Size of the normal, mutates vector absolute size as the product =D
// This is the same as normalizing your vector then scaling it up!
// Much faster to scale the absolute size here initially, rather than to normailize and then scale up, saves steps.
// If you dont feel comfortable with this, then use the regular vector _SCALAR function after normalizing to 1.
// Leave it as 1.0 for a normal normalization product.
FUNCTION _NORMALIZE: Size# = 1.0  // LIB VEC3 - Normalize the Vector to length = 1.0
LOCAL vLEN# = self._MAG()
self.vX# = self.vX#  * ( Size# / vLEN )
self.vY# = self.vY#  * ( Size# / vLEN )
self.vZ# = self.vZ#  * ( Size# / vLEN )
ENDFUNCTION



FUNCTION _ADD: VecB AS VEC3 // LIB VEC3 - Vector Addition
self.vX = self.vX + VecB.vX
self.vY = self.vY + VecB.vY
self.vZ = self.vZ + VecB.vZ
ENDFUNCTION



FUNCTION _SUBTRACT: VecB AS VEC3 // LIB VEC3 - Vector Subtraction
self.vX = self.vX - VecB.vX
self.vY = self.vY - VecB.vY
self.vZ = self.vZ - VecB.vZ
ENDFUNCTION



FUNCTION _SCALAR: Scale# // LIB VEC3 - Vector Scalar
self.vX = self.vX * Scale
self.vY = self.vY * Scale
self.vZ = self.vZ * Scale
ENDFUNCTION



FUNCTION _INVERT: // LIB VEC3 - Vector Inversion, flip all signs.
self.vX = -self.vX
self.vY = -self.vY
self.vZ = -self.vZ
ENDFUNCTION

ENDTYPE






#12
In project options, when i try to change the version info from 000.000 to 015.0829
it resets, and looks like this: 015.829
Also, i cant remove the decimal.
What are the semantics if this inst a bug?
#13
music/sound / HUSH(channel%)
2015-Aug-16
HUSH(channel%)

see my sound object below, youll see how it becomes useful.

Code (glbasic) Select

TYPE lib_SOUND_Object_

SndObj_Name$
SndObj_Path$
SndObj_Buff%
SndObj_Balance%
SndObj_ID%

SndObj_Channel% //internal glbasic channel id

SndObj_Volume#
SndObj_Mute%
SndObj_IS_Playing%


// This sound is an object.
// A sound object is preloaded with independant balance and volume.
// This sounds volume level, can be controlled by a master volume input at playtime.
FUNCTION _SNDOBJ_LOAD: FilePath$, FileName$, NumBuffers%, Balance%// NumBuffers% [1..4], Returns ID%
self.SndObj_Name$ = FileName$
self.SndObj_Path$ = FilePath$
self.SndObj_Buff% = NumBuffers%
self.SndObj_Balance% = Balance%
self.SndObj_ID% = GENSOUND()
LOADSOUND ( self.SndObj_Path$ + self.SndObj_Name$ ), self.SndObj_ID%, self.SndObj_Buff%
RETURN self.SndObj_ID%
ENDFUNCTION


// is this object playing?
FUNCTION _SNDOBJ_ISPLAYING:
self.SndObj_IS_Playing% = SOUNDPLAYING(self.SndObj_Channel%)
RETURN self.SndObj_IS_Playing%
ENDFUNCTION


FUNCTION _SNDOBJ_PLAY: MasterVolume% // [0..1]
self.SndObj_Channel% = PLAYSOUND( self.SndObj_ID%, self.SndObj_Balance%, ( self.SndObj_Volume% * MasterVolume% ))
RETURN self.SndObj_Channel%
ENDFUNCTION


FUNCTION _SNDOBJ_STOP:
HUSH // HUSH(channel%) command requested
RETURN self._SNDOBJ_ISPLAYING()
ENDFUNCTION


ENDTYPE

#14
1. In 2d, window mode: work fine when i change resolution of the window, from what i can see,
2. In 3d, window mode: the 3d scene is the old resolution viewport even though the window is resized.
3. I experienced the program completly stops rendered graphics to the screen when using SETSCREEN, when switching from window to fullscreen mode during runtime.

first image is as expected rendering in v12.312
Seconds image is v14.001
#15
You can design stars with any specs...fully customizable, inner and outer radius, and number of points.
Skinable too!
This is an AWESOME project, and has alot more potential, as i only made it today.
So far...the stars are perfect from what i can tell.....skys the limit!
Personally...im going to use these stars in my next game for various effect, enjoy!

ps. SF did some stars too, pixel style though, not polyvectors like these.
however sf's are pretty, and they are good for making artsy images.

pps. project is attached to this message below screeny
#16
I just discovered you can add colors...heh silly huh.
This led to a discovery...you can add random colors too.

Color = RGB(128,128,128) + RGB( RND(127), RND(127), RND(127) )
Color = 0x808080 + RGB( RND(127), RND(127), RND(127) )

Want to tint a simple gray with a little red?
Color = RGB(128,128,128) + 0x000040

Heres a code sample that shows colors being randomized


Code (glbasic) Select

// --------------------------------- //
// Project: ColorPalette
// Start: Saturday, August 08, 2015
// IDE Version: 12.312


// SETCURRENTDIR("Media") // go to media files


WHILE TRUE
ColorPalette(10,10,64)
SHOWSCREEN
WEND


FUNCTION ColorPalette: x%, y%, BlockWidth%
LOCAL ColorBandColumnID%, xx%

ColorBandColumnID% = 0
xx% = ( x% + (BlockWidth% * ColorBandColumnID% ) )
FOR i% = 0 TO 7
LOCAL cby% = y% + (BlockWidth% * i%)
LOCAL cbC% = (255-(i% * 32))
LOCAL Color# = RGB( cbC%, 0, 0 )
ColorBlock( xx%, cby%, Color#, BlockWidth% )
NEXT

ColorBandColumnID% = 1
xx% = ( x% + (BlockWidth% * ColorBandColumnID% ) )
FOR i% = 0 TO 7
LOCAL cby% = y% + ( BlockWidth% * i% )
LOCAL cbCR% = ( 255 - ( i% * 32 ) )
LOCAL cbCG% = ( 128 - ( i% * 16 ) )
LOCAL Color# = RGB( cbCR%, cbCG%, 0 )
ColorBlock( xx%, cby%, Color#, BlockWidth% )
NEXT

ColorBandColumnID% = 2
xx% = ( x% + (BlockWidth% * ColorBandColumnID% ) )
FOR i% = 0 TO 7
LOCAL cby% = y% + ( BlockWidth% * i% )
LOCAL cbCR% = ( 255 - ( i% * 32 ) )
LOCAL cbCG% = ( 255 - ( i% * 32 ) )
LOCAL Color# = RGB( cbCR%, cbCG%, 0 )
ColorBlock( xx%, cby%, Color#, BlockWidth% )
NEXT

ColorBandColumnID% = 3
xx% = ( x% + (BlockWidth% * ColorBandColumnID% ) )
FOR i% = 0 TO 7
LOCAL cby% = y% + ( BlockWidth% * i% )
LOCAL cbCR% = ( 128 - ( i% * 16 ) )
LOCAL cbCG% = ( 255 - ( i% * 32 ) )
LOCAL Color# = RGB( cbCR%, cbCG%, 0 )
ColorBlock( xx%, cby%, Color#, BlockWidth% )
NEXT

ColorBandColumnID% = 4
xx% = ( x% + (BlockWidth% * ColorBandColumnID% ) )
FOR i% = 0 TO 7
LOCAL cby% = y% + ( BlockWidth% * i% )
LOCAL cbCG% = ( 255 - ( i% * 32 ) )
LOCAL Color# = RGB( 0, cbCG%, 0 )
ColorBlock( xx%, cby%, Color#, BlockWidth% )
NEXT

ColorBandColumnID% = 5
xx% = ( x% + (BlockWidth% * ColorBandColumnID% ) )
FOR i% = 0 TO 7
LOCAL cby% = y% + ( BlockWidth% * i% )
LOCAL cbCG% = ( 255 - ( i% * 32 ) )
LOCAL cbCB% = ( 128 - ( i% * 16 ) )
LOCAL Color# = RGB( 0 ,cbCG%, cbCB%)
ColorBlock( xx%, cby%, Color#, BlockWidth% )
NEXT

ColorBandColumnID% = 6
xx% = ( x% + (BlockWidth% * ColorBandColumnID% ) )
FOR i% = 0 TO 7
LOCAL cby% = y% + ( BlockWidth% * i% )
LOCAL cbCG% = ( 255 - ( i% * 32 ) )
LOCAL cbCB% = ( 255 - ( i% * 32 ) )
LOCAL Color# = RGB( 0, cbCG%, cbCB% )
ColorBlock( xx%, cby%, Color#, BlockWidth% )
NEXT

ColorBandColumnID% = 7
xx% = ( x% + (BlockWidth% * ColorBandColumnID% ) )
FOR i% = 0 TO 7
LOCAL cby% = y% + ( BlockWidth% * i% )
LOCAL cbCG% = ( 128 - ( i% * 16 ) )
LOCAL cbCB% = ( 255 - ( i% * 32 ) )
LOCAL Color# = RGB( 0, cbCG%, cbCB% )
ColorBlock( xx%, cby%, Color#, BlockWidth% )
NEXT

ColorBandColumnID% = 8
xx% = ( x% + (BlockWidth% * ColorBandColumnID% ) )
FOR i% = 0 TO 7
LOCAL cby% = y% + ( BlockWidth% * i% )
LOCAL cbCB% = ( 255 - ( i% * 32 ) )
LOCAL Color# = RGB( 0, 0, cbCB% )
ColorBlock( xx%, cby%, Color#, BlockWidth% )
NEXT

ColorBandColumnID% = 9
xx% = ( x% + (BlockWidth% * ColorBandColumnID% ) )
FOR i% = 0 TO 7
LOCAL cby% = y% + ( BlockWidth% * i% )
LOCAL cbCB% = ( 255 - ( i% * 32 ) )
LOCAL cbCR% = ( 128 - ( i% * 16 ) )
LOCAL Color# = RGB( cbCR%, 0, cbCB% )
ColorBlock( xx%, cby%, Color#, BlockWidth% )
NEXT

ColorBandColumnID% = 10
xx% = ( x% + (BlockWidth% * ColorBandColumnID% ) )
FOR i% = 0 TO 7
LOCAL cby% = y% + ( BlockWidth% * i% )
LOCAL cbCB% = ( 255 - ( i% * 32 ) )
LOCAL cbCR% = ( 255 - ( i% * 32 ) )
LOCAL Color# = RGB( cbCR%, 0, cbCB% )
ColorBlock( xx%, cby%, Color#, BlockWidth% )
NEXT

ColorBandColumnID% = 11
xx% = ( x% + (BlockWidth% * ColorBandColumnID% ) )
FOR i% = 0 TO 7
LOCAL cby% = y% + ( BlockWidth% * i% )
LOCAL cbCB% = ( 128 - ( i% * 16 ) )
LOCAL cbCR% = ( 0xff - ( i% * 0x24 ) )
LOCAL Color# = RGB( cbCR%, 0, cbCB% )
ColorBlock( xx%, cby%, Color#, BlockWidth% )
NEXT

RETURN 0
ENDFUNCTION


FUNCTION ColorBlock: x#,y#, color#, size%
DRAWRECT x,y,size%,size%,color#+ RGB(RND(32), RND(32), RND(32))
RETURN 0
ENDFUNCTION
#17
SUB GLB_ON_RESUME

For windows....doesnt seem to work at all.

I tried adjusting type based variables and GLOBALs, and ran comparisons in the main loop to no effect.
#18
Bug Reports / GETDESKTOPSIZE
2014-Sep-06
GETDESKTOPSIZE causes this error

ps. gernot could you look into why all windowed binaries on win32 become blacked-out after minimizing them for a 10-15 minutes?

Quote
_______________________________________
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.10.053 SN:17b922e3 - 3D, NET
Wordcount:1334 commands
compiling:
C:\Users\A10TRI~1\AppData\Local\Temp\glbasic\gpc_temp0.cpp: In function `int __GLBASIC__::__MainGameSub_()':
C:\Users\A10TRI~1\AppData\Local\Temp\glbasic\gpc_temp0.cpp:794: error: no matching function for call to `GETDESKTOPSIZE(DGInt&, DGNat&)'
C:/Program Files (x86)/GLBasic_v12/Compiler/platform/Include/glb.h:1369: note: candidates are: void __GLBASIC__::GETDESKTOPSIZE(DGInt&, DGInt&)
C:/Program Files (x86)/GLBasic_v12/Compiler/platform/Include/glb.h:1370: note:                 void __GLBASIC__::GETDESKTOPSIZE(DGNat&, DGNat&)
*** FATAL ERROR - Please post this output in the forum
_______________________________________
*** Finished ***
Elapsed: 3.0 sec. Time: 01:44
Build: 0 succeeded.
*** 1 FAILED ***

#19
New codesnippet...litterally in every sense of it.

This is how you turn time, into a circle =D

Actually, this shows how i fluxuate a color back and forth....smoothly.
In this snipet...the color fades from White to Black To White in one second.

Code (glbasic) Select
// Color Override - Fluxuator
STATIC ColorRotator% = 0 , ColorWheel% = 1
LOCAL Circulartime = 2.777777778 // = 1000/360, one second of time divided by 360.  Divide gettimer() with this, and accumulate the value every loop, and you get 360 degrees rotating every second.
ColorRotator = (GETTIMER()/Circulartime) + ColorRotator
IF ColorRotator > 359 THEN ColorRotator = 0
ColorWheel = INTEGER((SIN(ColorRotator) * 127) + 128)
Color = RGB(ColorWheel,ColorWheel,ColorWheel)
#20
Media Section: '[FRIED] Free Random Image Export Depository'

The intention here is to have an archive of images that can be used for any purpose, by our GLBasic community.
And now I will thank everyone of you personally ahead of time, for sharing your works of art!


I will be moderating this thread, so be hip with these rules!
Breaking these rules will put all your images into scrutiny of my judgemental eye,
and possible deletion of your posts.  :rtfm:
Please respect the rules(mainly so i dont have to work harder than i already do),
and the whole community will be able to really enjoy and use this thread effectively.


Rule #1: If you post to this thread, please share a nice image that you made.
No posts will be permitted without an accompanying image!
As a curtesy to the creators, If you are starting with a screenshot, please post with a link or a reference to the original.
The idea for this rule is to allow you to share really cool looking stuff, as long as you are not breaking any laws by doing so.
And please, keep it RATED G, refrain from sharing images that involve human interactions of any kind.
These images should be useful, like for games, or other cool programs, or maybe wallpapers!

Rule #2: Dont include any text on the images.
When i say any text, this includes watermarks(this could be tricky, especially if you are starting with screenshots) if possible!
If you want to describe it, do so in the main body of your post.
If any symbolism is very noticable in your images, please dont post it.
When i say 'symbolism', I am meaning: No Human Generated Symbolism, period, the end, none at all, sorry, they BETTER be screaming Switzerland!
Exception: fonts for GLBasic

Rule #3: These images must not have any copyrights, totally free, royalty free, re-editable, re-distributable.
Any conflicts that arise due to these images, is a conflict that I may not have mentioned, yet, un-said were implied and you are doing wrong!