Author Topic: Samples Gallery  (Read 43661 times)

0 Members and 1 Guest are viewing this topic.

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: Samples Gallery
« Reply #150 on: March 14, 2020, 03:43:33 am »
@Qwerkey
Menger Sponge [Commented]

Code: QB64: [Select]
  1. '@Author:Ashish Kushwaha
  2. '28 Feb, 2020s
  3. _TITLE "Menger Sponge"
  4. SCREEN _NEWIMAGE(600, 600, 32)
  5.  
  6. TYPE vec3
  7.     x AS SINGLE
  8.     y AS SINGLE
  9.     z AS SINGLE
  10.  
  11.     SUB glutSolidCube (BYVAL dsize AS DOUBLE) 'use to draw a solid cube by taking the side length as its arguement
  12.  
  13. 'Algorithm
  14. '1. We take a cube.
  15. '2. We divide it into 27 equal cubical parts.
  16. '3. Out of this 27 cubes, 7 cubes are removed.
  17. '4. In the remaining 20 cubes, Step-1 is repeated for each cube.
  18. iteration = 3 'no. of iteration. At each iteration, 7 cubes are removed from parent cube.
  19. size = 0.5 'the size of our first cube
  20. n = (20 ^ iteration) - 1
  21.  
  22. DIM SHARED glAllow, cubeLoc(n) AS vec3, fundamentalCubeSize 'cubeLoc array store the location of cubes to be rendered. They are the smallest cube which are formed in the last iteration
  23. fundamentalCubeSize = size / (3 ^ iteration) 'the size the smallest cube which is formed in the last iteration
  24. initFractal 0, 0, 0, size, iteration 'this sub done all calculation for cube location & other stuff.
  25.  
  26. PRINT (n + 1); " Cubes will rendered with total of "; 8 * (n + 1); " vertices"
  27. PRINT "Hit a Key"
  28. glAllow = 1 'to start rendering in the SUB _GL
  29.     _LIMIT 40
  30.  
  31. SUB _GL () STATIC
  32.     DIM clr(3)
  33.     IF glAllow = 0 THEN EXIT SUB 'So that rendering will start as soon as initialization is done.
  34.     IF glInit = 0 THEN
  35.         _glViewport 0, 0, _WIDTH, _HEIGHT 'this defines the area in the screen where GL rendering will occur
  36.         aspect# = _WIDTH / _HEIGHT
  37.  
  38.         glInit = 1
  39.     END IF
  40.  
  41.     _glEnable _GL_DEPTH_TEST 'this enable Z-buffer. So that we can do 3D things.
  42.     _glClear _GL_DEPTH_BUFFER_BIT OR _GL_COLOR_BUFFER_BIT 'Not required unless we do softwre rendering as well.
  43.  
  44.     'LIGHTS CONFIG
  45.     _glEnable _GL_LIGHTING 'this enable us to use light. There are max of 8 lights in GL
  46.     _glEnable _GL_LIGHT0
  47.     clr(0) = 0.2: clr(1) = 0.2: clr(2) = 0.2: clr(3) = 1
  48.     _glLightfv _GL_LIGHT0, _GL_AMBIENT, _OFFSET(clr()) 'this define the color of the material where light can hardly reach.
  49.     clr(0) = 0.8: clr(1) = 0.8: clr(2) = 0.8: clr(3) = 1
  50.     _glLightfv _GL_LIGHT0, _GL_SPECULAR, _OFFSET(clr()) 'this define the color of the material where light is directly reflected & reach your eye.
  51.     _glLightfv _GL_LIGHT0, _GL_DIFFUSE, _OFFSET(clr()) 'this define the default/usual color of the light on the material.
  52.     clr(0) = 0: clr(1) = 0: clr(2) = 0: clr(3) = 1
  53.     _glLightfv _GL_LIGHT0, _GL_POSITION, _OFFSET(clr()) 'use to define the direction of light when 4th component is 0. When 4th component is 1, it defines the position of light. In this case, the light looses its intensity as distance increases.
  54.  
  55.     _glMatrixMode _GL_PROJECTION 'usually used for setting up perspective etc.
  56.     _gluPerspective 60, aspect#, 0.1, 10 'first arguement tell angle for FOV (Field of View, for human it is round 70degree for one eye.LOL) next one aspect ratio, next 2 are near & far distance. Objects which are not between these distance are clipped. (or are not rendered.)
  57.  
  58.     _glMatrixMode _GL_MODELVIEW 'rendering takes place here
  59.  
  60.     _glTranslatef 0, 0, -1 'move the origin forward by 1 unit
  61.     _glRotatef _MOUSEX, 0, 1, 0 'these are for rotation by the movement of mouse.
  62.     _glRotatef _MOUSEY, 1, 0, 0
  63.  
  64.     drawFractal 'draws the fractal
  65.     _glFlush 'force all the GL command to complete in finite amount of time
  66.  
  67. SUB initFractal (x, y, z, s, N) 'x-position, y-position, z-position, size, N-> iteration
  68.     STATIC i
  69.         'As we divide the cube, value of N decreases.
  70.     IF N = 0 THEN 'when the division is done N times (no. of iteration)
  71.         cubeLoc(i).x = x 'store the coordinates of cube
  72.         cubeLoc(i).y = y
  73.         cubeLoc(i).z = z
  74.         i = i + 1
  75.         ' ? "Added #",i
  76.         ' sleep
  77.         EXIT SUB
  78.     END IF
  79.     'top section
  80.     'front row, left to right
  81.     initFractal (x - s / 3), (y + s / 3), (z + s / 3), s / 3, N - 1
  82.     initFractal (x), (y + s / 3), (z + s / 3), s / 3, N - 1
  83.     initFractal (x + s / 3), (y + s / 3), (z + s / 3), s / 3, N - 1
  84.     'behind the previous row, left to right
  85.     initFractal (x - s / 3), (y + s / 3), (z), s / 3, N - 1
  86.     initFractal (x + s / 3), (y + s / 3), (z), s / 3, N - 1
  87.     'behind the previous row, left to right
  88.     initFractal (x - s / 3), (y + s / 3), (z - s / 3), s / 3, N - 1
  89.     initFractal (x), (y + s / 3), (z - s / 3), s / 3, N - 1
  90.     initFractal (x + s / 3), (y + s / 3), (z - s / 3), s / 3, N - 1
  91.     'middle section
  92.     'front row, left to right
  93.     initFractal (x - s / 3), (y), (z + s / 3), s / 3, N - 1
  94.     initFractal (x + s / 3), (y), (z + s / 3), s / 3, N - 1
  95.     'behind the previous row (last one as middle one contain no cube ;) ), left to right
  96.     initFractal (x - s / 3), (y), (z - s / 3), s / 3, N - 1
  97.     initFractal (x + s / 3), (y), (z - s / 3), s / 3, N - 1
  98.     'bottom section
  99.     'front row, left to right
  100.     initFractal (x - s / 3), (y - s / 3), (z + s / 3), s / 3, N - 1
  101.     initFractal (x), (y - s / 3), (z + s / 3), s / 3, N - 1
  102.     initFractal (x + s / 3), (y - s / 3), (z + s / 3), s / 3, N - 1
  103.     'behind the previous row, left to right
  104.     initFractal (x - s / 3), (y - s / 3), (z), s / 3, N - 1
  105.     initFractal (x + s / 3), (y - s / 3), (z), s / 3, N - 1
  106.     'behind the previous row, left to right
  107.     initFractal (x - s / 3), (y - s / 3), (z - s / 3), s / 3, N - 1
  108.     initFractal (x), (y - s / 3), (z - s / 3), s / 3, N - 1
  109.     initFractal (x + s / 3), (y - s / 3), (z - s / 3), s / 3, N - 1 '20
  110.  
  111.  
  112. SUB drawFractal ()
  113.     FOR i = 0 TO UBOUND(cubeLoc)
  114.         _glPushMatrix 'save the previous transformation configuration
  115.         _glTranslatef cubeLoc(i).x, cubeLoc(i).y, cubeLoc(i).z 'move at given location
  116.         glutSolidCube fundamentalCubeSize 'draws the solid cube of smallest size which is formed in the last iteration
  117.         _glPopMatrix 'restore the original transformation configuration
  118.     NEXT
  119.  

3D Knots [Commented]
Code: QB64: [Select]
  1. 'Coded in QB64 by Ashish on 9 March, 2018
  2. 'http://paulbourke.net/geometry/knots/
  3. _TITLE "3D Knot [Press space for next knot]"
  4.  
  5. SCREEN _NEWIMAGE(700, 700, 32)
  6.  
  7. TYPE vec3
  8.     x AS SINGLE
  9.     y AS SINGLE
  10.     z AS SINGLE
  11. DECLARE LIBRARY 'used for camera.
  12.     SUB gluLookAt (BYVAL eyeX#, BYVAL eyeY#, BYVAL eyeZ#, BYVAL centerX#, BYVAL centerY#, BYVAL centerZ#, BYVAL upX#, BYVAL upY#, BYVAL upZ#)
  13.  
  14. DIM SHARED glAllow AS _BYTE, knot_type, ma 'knot_type store the type knot being drawn. ma store percentage of knot which is being drawn.
  15. knot_type = 1
  16. glAllow = -1
  17.  
  18.     k& = _KEYHIT
  19.     IF k& = ASC(" ") THEN
  20.         knot_type = knot_type + 1
  21.         ma = 0
  22.         IF knot_type > 7 THEN knot_type = 1 '7 knots are there.
  23.     END IF
  24.     _LIMIT 60
  25.  
  26. SUB _GL ()
  27.     STATIC glInit, clock
  28.     ' static r, pos, theta, phi, beta
  29.  
  30.     IF NOT glAllow THEN EXIT SUB
  31.  
  32.     IF NOT glInit THEN
  33.         glInit = -1
  34.         aspect# = _WIDTH / _HEIGHT
  35.         _glViewport 0, 0, _WIDTH, _HEIGHT
  36.     END IF
  37.    
  38.     _glEnable _GL_DEPTH_TEST 'We are doing 3D. This enables Z-Buffer.
  39.    
  40.         'set perspective configuration
  41.     _glMatrixMode _GL_PROJECTION
  42.     _gluPerspective 45.0, aspect#, 1.0, 100.0
  43.    
  44.     _glMatrixMode _GL_MODELVIEW
  45.     ' gluLookAt 0,0,-1,0,0,0,0,1,0
  46.    
  47.     _glColor3f 1, 1, 1 'set color
  48.     _glTranslatef 0, 0, 0 'not require. becoz, origin is already at 0,0,0
  49.     _glRotatef clock * 90, 0, 1, 0 'rotation along Y-axis
  50.     _glLineWidth 3.0 'width of the line.
  51.    
  52.     SELECT CASE knot_type
  53.         CASE 7 'equations are knots are taken from paulbourke site
  54.             _glBegin _GL_LINE_STRIP
  55.                         'for animation, value of ma is gradually increased till a certain constant. In this case, it is pi.
  56.             FOR beta = 0 TO ma STEP .005
  57.                 r = .3 + .6 * SIN(6 * beta)
  58.                 theta = 2 * beta
  59.                 phi = _PI(.6) * SIN(12 * beta)
  60.                 x = r * COS(phi) * COS(theta)
  61.                 y = r * COS(phi) * SIN(theta)
  62.                 z = r * SIN(phi)
  63.                 _glColor3f map(x, -1, 1, 0, 1), map(y, -1, 1, 0, 1), map(z, -1, 1, 0, 1)
  64.                 _glVertex3f x, y, z 'draws it.
  65.             NEXT
  66.             _glEnd
  67.             IF ma <= _PI THEN ma = ma + .005
  68.                         'others are made to be rendered in the same way.
  69.         CASE 6
  70.             _glBegin _GL_LINE_STRIP
  71.             FOR beta = 0 TO ma STEP .005
  72.                 r = 1.2 * 0.6 * SIN(_PI(.5) * 6 * beta)
  73.                 theta = 4 * beta
  74.                 phi = _PI(.2) * SIN(6 * beta)
  75.                 x = r * COS(phi) * COS(theta)
  76.                 y = r * COS(phi) * SIN(theta)
  77.                 z = r * SIN(phi)
  78.                 _glColor3f map(x, -1, 1, 0, 1), map(y, -1, 1, 0, 1), map(z, -1, 1, 0, 1)
  79.                 _glVertex3f x, y, z
  80.             NEXT
  81.             _glEnd
  82.             IF ma <= _PI(2) THEN ma = ma + .005
  83.         CASE 5
  84.             k = 1
  85.             _glBegin _GL_LINE_STRIP
  86.             FOR u = 0 TO ma STEP .005
  87.                 x = COS(u) * (2 - COS(2 * u / (2 * k + 1))) / 5
  88.                 y = SIN(u) * (2 - COS(2 * u / (2 * k + 1))) / 5
  89.                 z = -SIN(2 * u / (2 * k + 1)) / 5
  90.                 _glColor3f map(x, -1, 1, 0, 1), map(y, -1, 1, 0, 1), map(z, -1, 1, 0, 1)
  91.                 _glVertex3f x, y, z
  92.             NEXT
  93.             _glEnd
  94.             IF ma < _PI(4 * k + 2) THEN ma = ma + .045
  95.         CASE 4
  96.             k = 2
  97.             _glBegin _GL_LINE_STRIP
  98.             FOR u = 0 TO ma STEP .005
  99.                 x = COS(u) * (2 - COS(2 * u / (2 * k + 1))) / 5
  100.                 y = SIN(u) * (2 - COS(2 * u / (2 * k + 1))) / 5
  101.                 z = -SIN(2 * u / (2 * k + 1)) / 5
  102.                 _glColor3f map(x, -1, 1, 0, 1), map(y, -1, 1, 0, 1), map(z, -1, 1, 0, 1)
  103.                 _glVertex3f x, y, z
  104.             NEXT
  105.             _glEnd
  106.             IF ma < _PI(4 * k + 2) THEN ma = ma + .045
  107.         CASE 3
  108.             k = 3
  109.             _glBegin _GL_LINE_STRIP
  110.             FOR u = 0 TO ma STEP .005
  111.                 x = COS(u) * (2 - COS(2 * u / (2 * k + 1))) / 5
  112.                 y = SIN(u) * (2 - COS(2 * u / (2 * k + 1))) / 5
  113.                 z = -SIN(2 * u / (2 * k + 1)) / 5
  114.                 _glColor3f map(x, -1, 1, 0, 1), map(y, -1, 1, 0, 1), map(z, -1, 1, 0, 1)
  115.                 _glVertex3f x, y, z
  116.             NEXT
  117.             _glEnd
  118.             IF ma < _PI(4 * k + 2) THEN ma = ma + .045
  119.         CASE 2
  120.             _glBegin _GL_LINE_STRIP
  121.             FOR u = 0 TO ma STEP .005
  122.                 x = (41 * COS(u) - 18 * SIN(u) - 83 * COS(2 * u) - 83 * SIN(2 * u) - 11 * COS(3 * u) + 27 * SIN(3 * u)) / 200
  123.                 y = (36 * COS(u) + 27 * SIN(u) - 113 * COS(2 * u) + 30 * SIN(2 * u) + 11 * COS(3 * u) - 27 * SIN(3 * u)) / 200
  124.                 z = (45 * SIN(u) - 30 * COS(2 * u) + 113 * SIN(2 * u) - 11 * COS(3 * u) + 27 * SIN(3 * u)) / 200
  125.                 _glColor3f map(x, -1, 1, 0, 1), map(y, -1, 1, 0, 1), map(z, -1, 1, 0, 1)
  126.                 _glVertex3f x, y, z
  127.             NEXT
  128.             _glEnd
  129.             IF ma < _PI(2) THEN ma = ma + .005
  130.         CASE 1
  131.             _glBegin _GL_LINE_STRIP
  132.             FOR u = 0 TO ma STEP .005
  133.                 x = (-22 * COS(u) - 128 * SIN(u) - 44 * COS(3 * u) - 78 * SIN(3 * u)) / 200
  134.                 y = (-10 * COS(2 * u) - 27 * SIN(2 * u) + 38 * COS(4 * u) + 46 * SIN(4 * u)) / 200
  135.                 z = (70 * COS(3 * u) - 40 * SIN(3 * u)) / 200
  136.                 _glColor3f map(x, -1, 1, 0, 1), map(y, -1, 1, 0, 1), map(z, -1, 1, 0, 1)
  137.                 _glVertex3f x, y, z
  138.             NEXT
  139.             _glEnd
  140.             IF ma < _PI(2) THEN ma = ma + .005
  141.     END SELECT
  142.     _glFlush
  143.    
  144.     clock = clock + .01
  145.  
  146. FUNCTION map! (value!, minRange!, maxRange!, newMinRange!, newMaxRange!)
  147.     map! = ((value! - minRange!) / (maxRange! - minRange!)) * (newMaxRange! - newMinRange!) + newMinRange!
  148.  

STARWARS Opening Crawl [Commented]

Code: QB64: [Select]
  1. '###########################
  2. '# StarWars Opening Crawl  #
  3. '# By Ashish               #
  4. '###########################
  5.  
  6. _TITLE "STARSWARS Opening crawl"
  7.  
  8. SCREEN _NEWIMAGE(800, 600, 32)
  9.  
  10. DIM SHARED glAllow, text&, text2&, lines$(26)
  11. DIM SHARED starWars&
  12. 'Feel free to modify the value of these lines as your wish. You can also add more lines by increasing the array length then adding values for next
  13. lines$(0) =  "It is a period of civil war"
  14. lines$(1) =  "Rebel spaceships, striking"
  15. lines$(2) =  "from a hidden base, have "
  16. lines$(3) =  "won their first victory"
  17. lines$(4) =  "against the evil Galactic"
  18. lines$(5) =  "Empire."
  19. lines$(6) =  ""
  20. lines$(7) =  ""
  21. lines$(8) =  "During the battle, rebel"
  22. lines$(9) =  "spies managed to steel"
  23. lines$(10) =  "secret plans to the Empire's"
  24. lines$(11) =  "ultimate weapon, the DEATH"
  25. lines$(12) =  "STAR, an armored space station"
  26. lines$(13) =  "with enough to destroy an entire"
  27. lines$(14) =  "planet."
  28. lines$(15) =  ""
  29. lines$(16) =  ""
  30. lines$(17) =  "Pursued by the Empire's sinister"
  31. lines$(18) =  "agents, Princess Leia races"
  32. lines$(19) =  "home abroad her starship,"
  33. lines$(20) =  "custodian of the stolen plans"
  34. lines$(21) =  "that cansave her people and"
  35. lines$(22) =  "restore the freedom to the galaxy"
  36. lines$(23) =  ""
  37. lines$(24) =  ""
  38. lines$(25) =  ""
  39. lines$(26) =  "QB64 Rocks!"
  40.  
  41. 'What am I actually doing?
  42. '1. I create an image handle text& as per our array length of lines$
  43. '2. I create another copy this image handle in text2&
  44. '3. Then, I print all the text in that image with suitable color in text2& image
  45. '4. After this, I draw the text2& image on text& image and move it from bottom to top.
  46. '5. I use text& as a texture for plane in 3D which is tilted somewhat.
  47. '6. So, as the image move in text&, the plane have corresponding texture in the plane. In fact, if draw anything on text&, it will textured on plane as well. (like bouncing balls, plasma, etc)
  48. text& = _NEWIMAGE(280, (UBOUND(lines$) + 1) * _FONTHEIGHT, 32)
  49.  
  50. text2& = _COPYIMAGE(text&)
  51. starWars& = _NEWIMAGE(65, 17, 32)
  52.  
  53. _DEST starWars&
  54. COLOR _RGB32(255, 255, 255)
  55. _PRINTSTRING (0, 0), "STARWARS"
  56.  
  57. COLOR _RGB(0, 0, 255)
  58. centerPrint "A long time ago in galaxy far,", _WIDTH, 280
  59. centerPrint "far away...", _WIDTH, 308
  60. FOR i = 0 TO 255 STEP 5
  61.     LINE (0, 0)-(_WIDTH, _HEIGHT), _RGB32(0, 0, 0, i), BF
  62.     _DISPLAY
  63.     _DELAY 0.01
  64. _PUTIMAGE (_WIDTH / 2 - _WIDTH(starWars&) * 3, _HEIGHT / 2 - _HEIGHT(starWars&) * 3)-STEP(_WIDTH(starWars&) * 6, _HEIGHT(starWars&) * 6), starWars&
  65. FOR i = 0 TO 255 STEP 5
  66.     LINE (0, 0)-(_WIDTH, _HEIGHT), _RGB32(0, 0, 0, i), BF
  67.     _DISPLAY
  68.     _DELAY 0.01
  69. _DEST text2&
  70. COLOR _RGB(255, 220, 0), _RGB(0, 0, 0)
  71. FOR i = 0 TO UBOUND(lines$)
  72.     IF i = UBOUND(lines$) THEN COLOR _RGB(255, 0, 255)
  73.     centerPrint lines$(i), _WIDTH, y + i * _FONTHEIGHT
  74.  
  75. glAllow = -1
  76. COLOR _RGB(255, 220, 0), _RGBA(0, 0, 0, 0)
  77. y = _HEIGHT(text&) + 10
  78.  
  79.  
  80.     _DEST text&
  81.     _PUTIMAGE (0, y), text2&
  82.     y = y - 1
  83.     _LIMIT 30
  84. LOOP UNTIL y < -_HEIGHT(text2&) - 10
  85.  
  86. SUB centerPrint (t$, w, y)
  87.     _PRINTSTRING ((w / 2) - (LEN(t$) * _FONTWIDTH) / 2, y), t$
  88.  
  89. SUB _GL ()
  90.     STATIC glInit, tex&, texMem AS _MEM ', clock!
  91.     IF NOT glAllow THEN EXIT SUB
  92.     IF glInit = 0 THEN
  93.         glInit = -1
  94.         _glViewport 0, 0, _WIDTH, _HEIGHT
  95.         texMem = _MEMIMAGE(text&) 'creating texture
  96.         _glGenTextures 1, _OFFSET(tex&)
  97.     END IF
  98.        
  99.     IF glInit = -1 THEN clock! = clock! + 0.01
  100.        
  101.     _glEnable _GL_TEXTURE_2D 'enable us to use 2D texture
  102.     _glEnable _GL_DEPTH_TEST 'enable us to go 3D. Enables Z-Buffer
  103.  
  104.  
  105.  
  106.     _glMatrixMode _GL_PROJECTION 'set up perspective
  107.     _gluPerspective 60.0, _WIDTH / _HEIGHT, 0.01, 10
  108.  
  109.     _glMatrixMode _GL_MODELVIEW
  110.      
  111.          'pass the image data each time, as the text& is modified everytime
  112.     _glTexImage2D _GL_TEXTURE_2D, 0, _GL_RGB16, _WIDTH(texMem.IMAGE), _HEIGHT(texMem.IMAGE), 0, _GL_BGRA_EXT, _GL_UNSIGNED_BYTE, texMem.OFFSET
  113.     _glTexParameteri _GL_TEXTURE_2D, _GL_TEXTURE_MAG_FILTER, _GL_LINEAR
  114.     _glTexParameteri _GL_TEXTURE_2D, _GL_TEXTURE_MIN_FILTER, _GL_LINEAR
  115.  
  116.     'draws the plane with texture
  117.     _glBegin _GL_QUADS
  118.     _glBindTexture _GL_TEXTURE_2D, tex&
  119.     _glTexCoord2f 0, 1: _glVertex3f -0.8, -1, -0.5 'bottom left     #
  120.     _glTexCoord2f 1, 1: _glVertex3f 0.8, -1, -0.5 'bottom right     # Coordinates sign are same as in Cartesian Plane   (3D)
  121.     _glTexCoord2f 1, 0: _glVertex3f 0.8, 3, -7 'upper right       #
  122.     _glTexCoord2f 0, 0: _glVertex3f -0.8, 3, -7 ' upper left      #
  123.     _glEnd
  124.  
  125.  
  126.     _glFlush
  127.  


PS: I don't like to comment much in code. For this reason, one of my friend (newbie) who also code in Qb64, doesn't like this habit of mine.
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

Offline krovit

  • Forum Regular
  • Posts: 179
    • View Profile
Re: Samples Gallery
« Reply #151 on: March 14, 2020, 07:47:38 am »
Hi Ashish!
Beautiful effects. really beautiful.

You're there again and still write with qb64... What good news!

I am very pleased to use the code of your drop-down menu (GUI-Menu Bar), that I allowed to modify a little to suit my needs.
Simple, efficient, light... it's just great!

I'm sorry if I take the opportunity to ask you something...
Why don't you complete the code with the keyboard control so you can use the drop-down menu with the one as well as the mouse?

Thank you very much!




« Last Edit: March 14, 2020, 07:49:46 am by krovit »
Nothing is easy, especially when it appears simple (and nothing could be as dangerous as trying to do good to others)

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: Samples Gallery
« Reply #152 on: March 14, 2020, 09:55:24 am »
Hello @krovit
Thank You, I am glad you like it!
I am sure that you might be using an old code of GUI-Menu-Bar. The latest one support keyboard control as well.
The project is hosted here - https://github.com/AshishKingdom/GUI-Menu-Bar
You can download the latest one from here - https://github.com/AshishKingdom/GUI-Menu-Bar/archive/master.zip
I never thought that this can be useful for someone. There is much better and advance GUI support in @FellippeHeitor InForm.
« Last Edit: March 14, 2020, 09:56:50 am by Ashish »
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Samples Gallery
« Reply #153 on: March 14, 2020, 11:44:33 am »
Quote
PS: I don't like to comment much in code. For this reason, one of my friend (newbie) who also code in Qb64, doesn't like this habit of mine.

Think of it as giving yourself notes 5 years into the future when you don't have a clue what you did with the code :)

I think this is main reluctance of Qwerkey to go revisit Scra88l3. Without code broken into functional blocks and commented it is hard to modify or fix because it's hard to figure out all over again.

« Last Edit: March 14, 2020, 11:50:13 am by bplus »

Offline TerryRitchie

  • Seasoned Forum Regular
  • Posts: 495
  • Semper Fidelis
    • View Profile
Re: Samples Gallery
« Reply #154 on: March 14, 2020, 11:48:19 am »
Think of it as giving yourself notes 5 years into the future when you don't have a clue what you with the code :)

Amen brother! That's why I do it.
In order to understand recursion, one must first understand recursion.

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: Samples Gallery
« Reply #155 on: March 15, 2020, 08:13:21 am »
@STxAxTIC @bplus
Now that we have a reasonable (starting) number of Samples/Games, I feel that we can begin to revert to "normal" Library activities - Library Staff keeping an eye out for suitable projects and having members submit requests.  But I'd like to feature Samples from our most prolific members.  The attached shows a table of (in my judgement) our most prolific members and if they have at least one in Samples and/or one in Games.  If agreeable, I'd like to put out a request to those missing a Smiley Face to ask them if they'd like to make submissions?  After we have done that extra task then we'll revert to purely normal Library activities.  Good idea / Bad Idea?  List needs amending?
  [ You are not allowed to view this attachment ]  

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Samples Gallery
« Reply #156 on: March 15, 2020, 09:32:11 pm »
I can contribute when and if I can... but, based on my current skill level, I do not believe I have earned the right to be included on the list... I appreciate the gesture but would prefer that my name be removed. Thank you...
Logic is the beginning of wisdom.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Samples Gallery
« Reply #157 on: March 15, 2020, 10:59:08 pm »
Pete has a sample? Oh he's the smiley :)

He does have a Space Invaders spoof thing that's fun.

Petr has a music player with graphics timed to music as I recall.

jack might have a math thing that would blow STxAxTIC's socks off?

I know Cobalt has a game somewhere probably his current one.

Johnno's Sprite Editor got stuck on a problem I would like to see solved.
« Last Edit: March 15, 2020, 11:06:15 pm by bplus »

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: Samples Gallery
« Reply #158 on: March 16, 2020, 07:10:32 am »
@johnno56 We all have our various skills.  We Librarians will not press any member to contribute to Samples.  It will only ever be if a member specifically wishes to do so.

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: Samples Gallery
« Reply #159 on: March 16, 2020, 07:45:22 am »
@bplus Do you think that we should include any more of Erik Oredson's stuff?  His Recursive Descent Parser looks technical (too technical for me).  His Symbolic Instruction Code Kit is already in Interpreters.  If you have any other projects that you'd like me to do the admin on, please say - I know that you've been looking at Steve's material which is again too technical for me.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Samples Gallery
« Reply #160 on: March 16, 2020, 10:01:19 am »
Hi @Qwerkey,

I never got into Erik's stuff much, reminded me of a bunch of old DOS utilities. I tried SICK and decided to stick with modern day Interpreters but building your own Interpreter is great adventure, instructive challenge! The Recursive Decent Parser is vital part of Interpreter, other people might call it Evaluate or Eval what processes coded text strings into variables and values... yep complex, I was just looking at Steve's massive one the other day, used in QB64! Has Erik "cooked" any of his code in the Programs Board here?

Steve is well represented but I suppose I should get around to getting his keyboard customizer that fixes keycodes and allows you to code your keyboards special keys before buried in the past. I think I was waiting for Terry's endorsement after testing. Maybe he is as eager to test as I, ha, ha! Steve should have his own board, already has a version of SDL QB64 going. Steve is a QB6force of nature! ;-))

I am curious what in samples is Pete's, I looked and am not seeing it? Could you remind me?

« Last Edit: March 16, 2020, 10:07:29 am by bplus »

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: Samples Gallery
« Reply #161 on: March 16, 2020, 12:43:14 pm »
@bplus To get a Smiley Face, you only need a contribution to a collaborative Samples project. https://www.qb64.org/forum/index.php?topic=1069.0  As STxAxTIC hasn't warned me off issuing an invite for Samples, I'll create a new post here for that.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Samples Gallery
« Reply #162 on: March 16, 2020, 01:51:02 pm »
Ah! The ellipse fill yes, Pete found some interesting speed test results as I recall (now).

Thanks Qwerkey!